Skip to content

Commit cda1e40

Browse files
cuonglmgopherbot
authored andcommitted
cmd/compile: add missing Unalias call when writing type alias
Fixes #65778 Change-Id: I93af42967c7976d63b4f460b7ffbcb9a9c05ffe7 Reviewed-on: https://go-review.googlesource.com/c/go/+/565995 Auto-Submit: Cuong Manh Le <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]> Reviewed-by: Robert Griesemer <[email protected]> Reviewed-by: Jorropo <[email protected]>
1 parent 4d923e3 commit cda1e40

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/cmd/compile/internal/noder/writer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ func (w *writer) doObj(wext *writer, obj types2.Object) pkgbits.CodeObj {
831831
case *types2.TypeName:
832832
if obj.IsAlias() {
833833
w.pos(obj)
834-
w.typ(obj.Type())
834+
w.typ(types2.Unalias(obj.Type()))
835835
return pkgbits.ObjAlias
836836
}
837837

test/fixedbugs/issue65778.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// compile -godebug gotypesalias=1
2+
3+
// Copyright 2024 The Go Authors. All rights reserved.
4+
// Use of this source code is governed by a BSD-style
5+
// license that can be found in the LICENSE file.
6+
7+
package p
8+
9+
type A = int
10+
11+
type T[P any] *A
12+
13+
var _ T[int]

0 commit comments

Comments
 (0)