]> Cypherpunks.ru repositories - gostls13.git/commit
go/types: fix a bug in package qualification logic
authorRob Findley <rfindley@google.com>
Thu, 24 Jun 2021 15:01:49 +0000 (11:01 -0400)
committerRobert Findley <rfindley@google.com>
Fri, 25 Jun 2021 01:08:06 +0000 (01:08 +0000)
commit37f9a8f69d6299783eac8848d87e27eb563500ac
treebf383070890e408a827a73df6ab4c58bd86574a9
parentc309c89db5aa15e1dad486c49ed4fd1babd23360
go/types: fix a bug in package qualification logic

CL 313035 had a bug, initializing pkgPathMap by walking the imported
package being considered rather than check.pkg.

Fix this, and enhance our tests to exercise this bug as well as other
edge cases.

Also fix error assertions in issues.src to not use quotation marks
inside the error regexp. The check tests only matched the error regexp
up to the first quotation mark.

Fixes #46905

Change-Id: I6aa8eae4bec6495006a5c03fc063db0d66b44cd6
Reviewed-on: https://go-review.googlesource.com/c/go/+/330629
Trust: Robert Findley <rfindley@google.com>
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/types/check_test.go
src/go/types/errors.go
src/go/types/issues_test.go
src/go/types/testdata/check/issues.src