1
0
mirror of https://github.com/golang/go synced 2024-11-18 02:24:45 -07:00
go/test/typeparam/issue48198.go
korzhao 6226020c2f cmd/compile: make sure that the names created for instantiated type are the same
Now we have two functions that create names for instantiated types.
They are inconsistent when dealing with byte/rune type.

This CL makes instTypeName2 reuse the code of typecheck.InstTypeName

Fixes #48198

Change-Id: I4c216b532cba6618ef9b63fd0b76e8f1c0ed7a75
Reviewed-on: https://go-review.googlesource.com/c/go/+/347491
Reviewed-by: Dan Scales <danscales@google.com>
Trust: Dan Scales <danscales@google.com>
Trust: Keith Randall <khr@golang.org>
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
2021-09-07 03:56:13 +00:00

23 lines
377 B
Go

// compile -G=3
// Copyright 2021 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 Foo[T any] struct {
}
func (foo Foo[T]) Get() {
}
var(
_ = Foo[byte]{}
_ = Foo[[]byte]{}
_ = Foo[map[byte]rune]{}
_ = Foo[rune]{}
_ = Foo[[]rune]{}
_ = Foo[map[rune]byte]{}
)