summaryrefslogtreecommitdiffstats
path: root/src/go
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 19:27:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 19:27:10 +0000
commit32c8b04ddb6829a3f5f7267a666b4caa3cf38a1f (patch)
tree6e5b1b98afaeadd19ba7fd4b710f71cbf187942e /src/go
parentAdding upstream version 1.22.1. (diff)
downloadgolang-1.22-32c8b04ddb6829a3f5f7267a666b4caa3cf38a1f.tar.xz
golang-1.22-32c8b04ddb6829a3f5f7267a666b4caa3cf38a1f.zip
Adding upstream version 1.22.2.upstream/1.22.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/go')
-rw-r--r--src/go/types/subst.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/go/types/subst.go b/src/go/types/subst.go
index 1934eba..178f717 100644
--- a/src/go/types/subst.go
+++ b/src/go/types/subst.go
@@ -97,6 +97,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 {