From fcde77432eb91f1389e8b5be6a4d018536ceac02 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Fri, 18 Mar 2016 13:09:10 -0400 Subject: [PATCH] go/gcimporter15: create dummy "anyType" to fix breakage The previous CL added a duplicate InvalidType to the predecl table so that it tracked the one used by gc, but this caused it to fail an assertion of uniqueness, and I ran the wrong tests. Change-Id: I56342046cea328e503d917127f5b12205df7999a Reviewed-on: https://go-review.googlesource.com/20870 Reviewed-by: Robert Griesemer --- go/gcimporter15/bimport.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/go/gcimporter15/bimport.go b/go/gcimporter15/bimport.go index a39e3261ad..0d725f6ece 100644 --- a/go/gcimporter15/bimport.go +++ b/go/gcimporter15/bimport.go @@ -692,7 +692,11 @@ var predeclared = []types.Type{ // invalid type types.Typ[types.Invalid], // only appears in packages with errors - // TODO(mdempsky): Provide an actual Type value to represent "any"? - // (Why exactly does gc emit the "any" type?) - types.Typ[types.Invalid], + // used internally by gc; never used by this package or in .a files + anyType{}, } + +type anyType struct{} + +func (t anyType) Underlying() types.Type { return t } +func (t anyType) String() string { return "any" }