]> Cypherpunks repositories - gostls13.git/commit
go/internal/gcimporter: fix ureader.go handling of local defined types
authorMatthew Dempsky <mdempsky@google.com>
Fri, 16 Sep 2022 21:27:01 +0000 (14:27 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 19 Sep 2022 18:47:11 +0000 (18:47 +0000)
commit29153be75763b7cbf9395d732f454336e3df0286
tree795209141b00878516ee267ed82a70eeaf855228
parent38cecb22903415b34991ce76efe725f47aaf21a3
go/internal/gcimporter: fix ureader.go handling of local defined types

In unified IR, local defined types are promoted to a global defined
type with a "vargen" suffix. These shouldn't actually be exposed to
go/types users, because they're only relevant within function bodies,
which go/types doesn't support importing.

Moreover, in the case of defined types that were declared within a
generic function, they can have ambient type parameters, which the
go/types importer doesn't know how to handle (because they shouldn't
be needed for that use case).

While here, prune the gcimporter_test.go skip list, because some of
the listed failures have actually been fixed and all of them are
specific to the Go 1.18 (nounified) frontend. They all work correctly
with GOEXPERIMENT=unified.

Fixes #55110.

Change-Id: I7dd8b86355d910dfed1d47edbad7695144c3f84d
Reviewed-on: https://go-review.googlesource.com/c/go/+/431495
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/go/internal/gcimporter/gcimporter_test.go
src/go/internal/gcimporter/support.go
src/go/internal/gcimporter/ureader.go