]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: don't re-typecheck while importing
authorKeith Randall <khr@golang.org>
Tue, 14 Dec 2021 04:11:07 +0000 (20:11 -0800)
committerKeith Randall <khr@golang.org>
Thu, 16 Dec 2021 00:34:10 +0000 (00:34 +0000)
commit7f2314530e7cb4a11c6df4f7bd51187f5cffe2a5
tree825ead197c79fcf3a50ca93bd79e7bafb497b495
parentd107aa2cd1fdc596b9275a127e6c35cc5f8d32bb
cmd/compile: don't re-typecheck while importing

The imported code is already typechecked. NodAddrAt typechecks its
argument, which is unnecessary here and leads to errors when
typechecking unexported field references in other packages' code.

Mark the node is question as already typechecked, so we don't
retypecheck it.

Fixes #50148

Change-Id: I9789e3e7dd4d58ec095675e27b1c98389f7a0c44
Reviewed-on: https://go-review.googlesource.com/c/go/+/371554
Trust: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Dan Scales <danscales@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/compile/internal/typecheck/iimport.go
test/typeparam/structinit.dir/a.go [new file with mode: 0644]
test/typeparam/structinit.dir/b.go [new file with mode: 0644]
test/typeparam/structinit.dir/main.go [new file with mode: 0644]
test/typeparam/structinit.go [new file with mode: 0644]