aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/union.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile/internal/types2/union.go')
-rw-r--r--src/cmd/compile/internal/types2/union.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/cmd/compile/internal/types2/union.go b/src/cmd/compile/internal/types2/union.go
index 85aa3d9104..f61c37a6af 100644
--- a/src/cmd/compile/internal/types2/union.go
+++ b/src/cmd/compile/internal/types2/union.go
@@ -68,8 +68,7 @@ func parseUnion(check *Checker, tlist []syntax.Expr) Type {
// Note: This is a quadratic algorithm, but unions tend to be short.
check.later(func() {
for i, t := range terms {
- typ := expand(t.typ)
- if typ == Typ[Invalid] {
+ if t.typ == Typ[Invalid] {
continue
}
@@ -85,16 +84,16 @@ func parseUnion(check *Checker, tlist []syntax.Expr) Type {
}
}
- u := under(typ)
+ u := under(t.typ)
f, _ := u.(*Interface)
if t.tilde {
if f != nil {
- check.errorf(x, "invalid use of ~ (%s is an interface)", typ)
+ check.errorf(x, "invalid use of ~ (%s is an interface)", t.typ)
continue // don't report another error for t
}
- if !Identical(u, typ) {
- check.errorf(x, "invalid use of ~ (underlying type of %s is %s)", typ, u)
+ if !Identical(u, t.typ) {
+ check.errorf(x, "invalid use of ~ (underlying type of %s is %s)", t.typ, u)
continue // don't report another error for t
}
}