mirror of
https://github.com/golang/go.git
synced 2025-05-07 16:43:03 +00:00
Fixes #53723 Change-Id: Ibad64f5c4af2112deeb0a9ecc9c589b17594bd05 Reviewed-on: https://go-review.googlesource.com/c/go/+/414836 Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/416155 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com>
29 lines
433 B
Go
29 lines
433 B
Go
// run -gcflags=-G=3
|
|
|
|
// Copyright 2022 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 main
|
|
|
|
type T1 struct{}
|
|
type T2 struct{}
|
|
type Both struct {
|
|
T1
|
|
T2
|
|
}
|
|
|
|
func (T1) m() { panic("FAIL") }
|
|
func (T2) m() { panic("FAIL") }
|
|
func (Both) m() {}
|
|
|
|
func f[T interface{ m() }](c T) {
|
|
c.m()
|
|
}
|
|
|
|
func main() {
|
|
var b Both
|
|
b.m()
|
|
f(b)
|
|
}
|