]> Cypherpunks.ru repositories - gostls13.git/commit
go/types: return an error message from Checker.genericType
authorRobert Findley <rfindley@google.com>
Mon, 15 Nov 2021 15:49:54 +0000 (10:49 -0500)
committerRobert Findley <rfindley@google.com>
Mon, 15 Nov 2021 18:43:13 +0000 (18:43 +0000)
commitb6342a02ad901e015e1c4eb9f862824029efb7b7
tree97e776f782f065306ee7a980671478eb4fdab2c0
parent0e654100382f345ea555cfc1e1dd50853316b368
go/types: return an error message from Checker.genericType

The bare error message "%s is not a generic type" is probably never
sufficient, so change the signature of genericType to instead return an
message that may be formatted as additional context in errors.

Along the way, refactor instantiatedType to have access to the entire
index expression.

Fixes #48827

Change-Id: I0c455c1ce46ac3f1ef2990c997da19e5fc6c4eae
Reviewed-on: https://go-review.googlesource.com/c/go/+/363994
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/types/errorcodes.go
src/go/types/signature.go
src/go/types/testdata/fixedbugs/issue48827.go2 [new file with mode: 0644]
src/go/types/typexpr.go