diff options
Diffstat (limited to 'src/cmd/compile/internal/types2/subst.go')
-rw-r--r-- | src/cmd/compile/internal/types2/subst.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cmd/compile/internal/types2/subst.go b/src/cmd/compile/internal/types2/subst.go index e497e17463..6c5f756491 100644 --- a/src/cmd/compile/internal/types2/subst.go +++ b/src/cmd/compile/internal/types2/subst.go @@ -145,12 +145,12 @@ func (subst *subster) typ(typ Type) Type { } case *Union: - terms, copied := subst.termList(t.terms) + terms, copied := subst.termlist(t.terms) if copied { - // TODO(gri) Remove duplicates that may have crept in after substitution - // (unlikely but possible). This matters for the Identical - // predicate on unions. - return &Union{terms} + // term list substitution may introduce duplicate terms (unlikely but possible). + // This is ok; lazy type set computation will determine the actual type set + // in normal form. + return &Union{terms, nil} } case *Interface: @@ -387,7 +387,7 @@ func (subst *subster) typeList(in []Type) (out []Type, copied bool) { return } -func (subst *subster) termList(in []*term) (out []*term, copied bool) { +func (subst *subster) termlist(in []*term) (out []*term, copied bool) { out = in for i, t := range in { if u := subst.typ(t.typ); u != t.typ { |