aboutsummaryrefslogtreecommitdiff
path: root/src/go/types/predicates.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/go/types/predicates.go')
-rw-r--r--src/go/types/predicates.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/go/types/predicates.go b/src/go/types/predicates.go
index 1889694342..83bc64772f 100644
--- a/src/go/types/predicates.go
+++ b/src/go/types/predicates.go
@@ -521,7 +521,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]