]> Cypherpunks.ru repositories - gostls13.git/commit
go/types: print package path in error messages if package name is not unique
authorRobert Griesemer <gri@golang.org>
Mon, 2 Dec 2019 17:38:03 +0000 (09:38 -0800)
committerRobert Griesemer <gri@golang.org>
Fri, 6 Dec 2019 03:52:48 +0000 (03:52 +0000)
commitb81e01dc2ee9cb586b971f6a86cf0f32a0af69ba
tree7993aec54cecf2d47acfc3c5947beaacccbbbda6
parent5fd75810060e72ba9da44be85c7767417c8bbee7
go/types: print package path in error messages if package name is not unique

Change package qualification to print the full package path for packages
that have non-unique names (that is, where multiple different packages
have the same name). Use the package name as qualifier in all other cases
(but don't print any qualification if we're talking about the package
being type-checked).

This matches the behavior of the compiler.

Fixes #35895.

Change-Id: I33ab8e7adfae1378907c01e33cabda114f65887f
Reviewed-on: https://go-review.googlesource.com/c/go/+/209578
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/go/types/check.go
src/go/types/errors.go
src/go/types/resolver.go
src/go/types/testdata/issues.src