1
0
mirror of https://github.com/golang/go synced 2024-11-14 14:10:29 -07:00

go/types, types2: replace TODO with clarifying comment

This resolves an open question.
No non-comment code changes.

Change-Id: Idc92794090b2dde694394d1fcd916f6ea61f03e7
Reviewed-on: https://go-review.googlesource.com/c/go/+/506395
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
This commit is contained in:
Robert Griesemer 2023-06-26 13:52:37 -07:00 committed by Gopher Robot
parent 7cc0740596
commit 1dbbafc70f
2 changed files with 10 additions and 4 deletions

View File

@ -410,8 +410,11 @@ func (u *unifier) nify(x, y Type, mode unifyMode, p *ifacePair) (result bool) {
// recorded an underlying type (go.dev/issue/43056). // recorded an underlying type (go.dev/issue/43056).
// Either both types are interfaces, or neither type is. // Either both types are interfaces, or neither type is.
// If both are interfaces, they have the same methods. // If both are interfaces, they have the same methods.
// TODO(gri) We probably can do this only for inexact //
// unification. Need to find a failure case. // Note: Changing the recorded type for a type parameter to
// a defined type is only ok when unification is inexact.
// But in exact unification, if we have a match, x and y must
// be identical, so changing the recorded type for x is a no-op.
if yn { if yn {
u.set(px, y) u.set(px, y)
} }

View File

@ -412,8 +412,11 @@ func (u *unifier) nify(x, y Type, mode unifyMode, p *ifacePair) (result bool) {
// recorded an underlying type (go.dev/issue/43056). // recorded an underlying type (go.dev/issue/43056).
// Either both types are interfaces, or neither type is. // Either both types are interfaces, or neither type is.
// If both are interfaces, they have the same methods. // If both are interfaces, they have the same methods.
// TODO(gri) We probably can do this only for inexact //
// unification. Need to find a failure case. // Note: Changing the recorded type for a type parameter to
// a defined type is only ok when unification is inexact.
// But in exact unification, if we have a match, x and y must
// be identical, so changing the recorded type for x is a no-op.
if yn { if yn {
u.set(px, y) u.set(px, y)
} }