]> Cypherpunks repositories - gostls13.git/commitdiff
go/internal/gccgoimporter: recognize "any" as a builtin type
authorIan Lance Taylor <iant@golang.org>
Mon, 23 Oct 2023 21:32:44 +0000 (14:32 -0700)
committerIan Lance Taylor <iant@golang.org>
Fri, 2 Feb 2024 23:14:07 +0000 (23:14 +0000)
In CL 536715 we're changing the gofrontend export data to report
"any" as a builtin type. This permits us to distinguish the builtin
type from some other package-level type "any". That requires an update
to this code.

Change-Id: I91d75a056a155fa9892c4b25ab396cb4d39cc8e4
Reviewed-on: https://go-review.googlesource.com/c/go/+/537195
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/go/internal/gccgoimporter/parser.go

index a7d2094e0c356c2ab12f458de775317112bac0e5..e8ee74783b9e96f5c23623d9dfe9e1c247b450f6 100644 (file)
@@ -902,6 +902,7 @@ const (
        gccgoBuiltinERROR      = 19
        gccgoBuiltinBYTE       = 20
        gccgoBuiltinRUNE       = 21
+       gccgoBuiltinANY        = 22
 )
 
 func lookupBuiltinType(typ int) types.Type {
@@ -926,6 +927,7 @@ func lookupBuiltinType(typ int) types.Type {
                gccgoBuiltinERROR:      types.Universe.Lookup("error").Type(),
                gccgoBuiltinBYTE:       types.Universe.Lookup("byte").Type(),
                gccgoBuiltinRUNE:       types.Universe.Lookup("rune").Type(),
+               gccgoBuiltinANY:        types.Universe.Lookup("any").Type(),
        }[typ]
 }