aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/unify.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile/internal/types2/unify.go')
-rw-r--r--src/cmd/compile/internal/types2/unify.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/cmd/compile/internal/types2/unify.go b/src/cmd/compile/internal/types2/unify.go
index 58f5c17e5f..d4fbebc11b 100644
--- a/src/cmd/compile/internal/types2/unify.go
+++ b/src/cmd/compile/internal/types2/unify.go
@@ -429,13 +429,17 @@ func (u *unifier) nify(x, y Type, p *ifacePair) bool {
if y, ok := y.(*Named); ok {
x.expand(nil)
y.expand(nil)
+
+ xargs := x.targs.list()
+ yargs := y.targs.list()
+
// TODO(gri) This is not always correct: two types may have the same names
// in the same package if one of them is nested in a function.
// Extremely unlikely but we need an always correct solution.
if x.obj.pkg == y.obj.pkg && x.obj.name == y.obj.name {
- assert(len(x.targs) == len(y.targs))
- for i, x := range x.targs {
- if !u.nify(x, y.targs[i], p) {
+ assert(len(xargs) == len(yargs))
+ for i, x := range xargs {
+ if !u.nify(x, yargs[i], p) {
return false
}
}