diff options
Diffstat (limited to 'src/cmd/compile/internal/types2/predicates.go')
-rw-r--r-- | src/cmd/compile/internal/types2/predicates.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/types2/predicates.go b/src/cmd/compile/internal/types2/predicates.go index 6d9e6ec760..986cd6aa61 100644 --- a/src/cmd/compile/internal/types2/predicates.go +++ b/src/cmd/compile/internal/types2/predicates.go @@ -518,7 +518,9 @@ func identicalInstance(xorig Type, xargs []Type, yorig Type, yargs []Type) bool // it returns the incoming type for all other types. The default type // for untyped nil is untyped nil. func Default(t Type) Type { - if t, ok := Unalias(t).(*Basic); ok { + // Alias and named types cannot denote untyped types + // so there's no need to call Unalias or under, below. + if t, _ := t.(*Basic); t != nil { switch t.kind { case UntypedBool: return Typ[Bool] |