]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix crawler for unexported fields with instantiated types
authorDan Scales <danscales@google.com>
Sun, 19 Sep 2021 03:02:08 +0000 (20:02 -0700)
committerDan Scales <danscales@google.com>
Fri, 24 Sep 2021 18:21:14 +0000 (18:21 +0000)
commitf6b5ffb5e1d31fd24edadfe6c105886093638825
tree0dcabfd533af81963f3c6a7be586ca2b2444efc7
parent812c99f86a1b38d50c5c0b501d10b72c3b7dfb95
cmd/compile: fix crawler for unexported fields with instantiated types

In markType() in crawler.go, mark the type of a unexported field if it
is a fully-instantiated type, since we create and instantiate the
methods of any fully-instantiated type that we see during import. As
before, we still do not mark the type of an unexported field if that
type is not generic. Fixes #48454 and most recent issue described in
48337. The included test is similar to the case in 48454.

Fixes #48454
Fixes #48337

Change-Id: I77a2a62b9e2647876facfa6f004201e8f699c905
Reviewed-on: https://go-review.googlesource.com/c/go/+/351315
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/typecheck/crawler.go
test/typeparam/issue48454.dir/a.go [new file with mode: 0644]
test/typeparam/issue48454.dir/b.go [new file with mode: 0644]
test/typeparam/issue48454.dir/main.go [new file with mode: 0644]
test/typeparam/issue48454.go [new file with mode: 0644]