]> Cypherpunks.ru repositories - gostls13.git/commit
go/types, types2: no "imported but not used" error for unimported packages
authorRobert Griesemer <gri@golang.org>
Wed, 30 Mar 2022 22:09:13 +0000 (15:09 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 31 Mar 2022 00:27:01 +0000 (00:27 +0000)
commit0a6ddcc4f03b5a89bf2eadee1fe284faf0e20be2
tree62e259464374196c3a6b2ad974482625ce90a2dd
parent077573018027c30e5f422d50f0b96e1733ac6001
go/types, types2: no "imported but not used" error for unimported packages

If a package could not be imported for whatever reason, the type checker
creates fake package with which it continues for more tolerant type
checking.

Do not report an "imported but not used" error in that case.

Clarify a few comments along the way.

Fixes #43109.

Change-Id: Ifeec0daa688fbf666412dc9176ff1522d02a23ef
Reviewed-on: https://go-review.googlesource.com/c/go/+/396875
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/compile/internal/types2/resolver.go
src/cmd/compile/internal/types2/testdata/fixedbugs/issue43109.go [new file with mode: 0644]
src/go/types/resolver.go
src/go/types/testdata/fixedbugs/issue43109.go [new file with mode: 0644]