X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fgo%2Ftypes%2Fissues_test.go;h=01d739878840a18fd4951ffa42a87fc7acb01d87;hb=bea55136b2d50fc514ddfba4380311295975a660;hp=5530fceef6d9aca01d9eaaeb5df84f53b417c288;hpb=1b03ec8a25412342ca072c0860bdf046d58e82ac;p=gostls13.git diff --git a/src/go/types/issues_test.go b/src/go/types/issues_test.go index 5530fceef6..01d7398788 100644 --- a/src/go/types/issues_test.go +++ b/src/go/types/issues_test.go @@ -990,3 +990,27 @@ func f[I *T, T any]() { t.Fatalf("types of v and T are not pointer-identical: %p != %p", v.Type().(*TypeParam), T) } } + +func TestIssue44410(t *testing.T) { + const src = ` +package p + +type A = []int +type S struct{ A } +` + + var conf Config + *boolFieldAddr(&conf, "_EnableAlias") = true + pkg := mustTypecheck(src, &conf, nil) + + S := pkg.Scope().Lookup("S") + if S == nil { + t.Fatal("object S not found") + } + + got := S.String() + const want = "type p.S struct{p.A /* = []int */}" + if got != want { + t.Fatalf("got %q; want %q", got, want) + } +}