]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.typeparams] go/types: trigger verification while resolving instance
authorRob Findley <rfindley@google.com>
Tue, 20 Jul 2021 17:07:50 +0000 (13:07 -0400)
committerRobert Findley <rfindley@google.com>
Thu, 22 Jul 2021 14:01:09 +0000 (14:01 +0000)
commitb7149b781fda907078b9312d301ea384e91482ef
treecdc8397871adef92d5dc0ba96c076b9344bc2508
parent61f69d2559a1177c23dea06343a4784514e8dd85
[dev.typeparams] go/types: trigger verification while resolving instance

The refactoring of CL 335929 to merge the instance and Named types
resulted in type instances only being evaluated once. As a side effect,
we only verified constraints once per unique instantiation expression.

This can be confusing if type instantations are occurring far apart in
the code. Resolve this by lifting up the verification logic into
Instantiate and InstantiateLazy.

Change-Id: Icd5a482d097d983073955c62931441edfd92f5c2
Reviewed-on: https://go-review.googlesource.com/c/go/+/335978
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/instance.go
src/go/types/instantiate.go
src/go/types/testdata/check/issues.go2