diff --git a/src/cmd/compile/internal/noder/writer.go b/src/cmd/compile/internal/noder/writer.go index 87c54b976943e..c57ccdf36db00 100644 --- a/src/cmd/compile/internal/noder/writer.go +++ b/src/cmd/compile/internal/noder/writer.go @@ -831,7 +831,7 @@ func (w *writer) doObj(wext *writer, obj types2.Object) pkgbits.CodeObj { case *types2.TypeName: if obj.IsAlias() { w.pos(obj) - w.typ(obj.Type()) + w.typ(types2.Unalias(obj.Type())) return pkgbits.ObjAlias } diff --git a/test/fixedbugs/issue65778.go b/test/fixedbugs/issue65778.go new file mode 100644 index 0000000000000..30c680404d91d --- /dev/null +++ b/test/fixedbugs/issue65778.go @@ -0,0 +1,13 @@ +// compile -godebug gotypesalias=1 + +// Copyright 2024 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package p + +type A = int + +type T[P any] *A + +var _ T[int]