1
0
mirror of https://github.com/golang/go synced 2024-11-22 10:04:42 -07:00

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 <cuong.manhle.vn@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
This commit is contained in:
Cuong Manh Le 2024-02-22 18:52:39 +07:00 committed by Gopher Robot
parent 4d923e3f07
commit cda1e40b44
2 changed files with 14 additions and 1 deletions

View File

@ -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
}

View File

@ -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]