mirror of
https://github.com/golang/go
synced 2024-11-16 22:34:45 -07:00
2481f6e367
In case of embedded field, if the receiver was fully instantiated, we must use its instantiated type, instead of passing the type params of the base receiver. Fixes #47797 Fixes #48253 Change-Id: I97613e7e669a72605137e82406f7bf5fbb629378 Reviewed-on: https://go-review.googlesource.com/c/go/+/348549 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Trust: Dan Scales <danscales@google.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dan Scales <danscales@google.com>
23 lines
343 B
Go
23 lines
343 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 {
|
|
Val T
|
|
}
|
|
|
|
func (f Foo[T]) Bat() {}
|
|
|
|
type Bar struct {
|
|
Foo[int]
|
|
}
|
|
|
|
func foo() {
|
|
var b Bar
|
|
b.Bat()
|
|
}
|