aboutsummaryrefslogtreecommitdiff
path: root/src/go/types/unify.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/go/types/unify.go')
-rw-r--r--src/go/types/unify.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/go/types/unify.go b/src/go/types/unify.go
index 1b1d875dad..bef851f423 100644
--- a/src/go/types/unify.go
+++ b/src/go/types/unify.go
@@ -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).
// Either both types are interfaces, or neither type is.
// 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 {
u.set(px, y)
}