]> Cypherpunks repositories - gostls13.git/commitdiff
go/importer: match predeclared type list with gc's list in binary exporter
authorRobert Griesemer <gri@golang.org>
Tue, 5 Apr 2016 18:17:57 +0000 (11:17 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 5 Apr 2016 18:23:31 +0000 (18:23 +0000)
I think we had this code before but it may have gone lost somehow.

Change-Id: Ifde490e686de0d2bfe907cbe19c9197f24f5fa8e
Reviewed-on: https://go-review.googlesource.com/21537
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/go/internal/gcimporter/bimport.go

index 182e8a10442a21858357d6ce0840734b4318bdcd..12efb2aaf33561585e224e2e08856dec80b7434a 100644 (file)
@@ -723,7 +723,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" }