aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/subst.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile/internal/types2/subst.go')
-rw-r--r--src/cmd/compile/internal/types2/subst.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/types2/subst.go b/src/cmd/compile/internal/types2/subst.go
index 09dc58527a..1ad73c41ce 100644
--- a/src/cmd/compile/internal/types2/subst.go
+++ b/src/cmd/compile/internal/types2/subst.go
@@ -95,6 +95,18 @@ func (subst *subster) typ(typ Type) Type {
case *Basic:
// nothing to do
+ case *Alias:
+ rhs := subst.typ(t.fromRHS)
+ if rhs != t.fromRHS {
+ // This branch cannot be reached because the RHS of an alias
+ // may only contain type parameters of an enclosing function.
+ // Such function bodies are never "instantiated" and thus
+ // substitution is not called on locally declared alias types.
+ // TODO(gri) adjust once parameterized aliases are supported
+ panic("unreachable for unparameterized aliases")
+ // return subst.check.newAlias(t.obj, rhs)
+ }
+
case *Array:
elem := subst.typOrNil(t.elem)
if elem != t.elem {