test/typeparam/issue49432.go
raw| 1 | // compile |
| 2 | |
| 3 | // Copyright 2021 The Go Authors. All rights reserved. |
| 4 | // Use of this source code is governed by a BSD-style |
| 5 | // license that can be found in the LICENSE file. |
| 6 | |
| 7 | package main |
| 8 | |
| 9 | type Handler func(in ...interface{}) |
| 10 | |
| 11 | type Foo[T any] struct{} |
| 12 | |
| 13 | func (b *Foo[T]) Bar(in ...interface{}) {} |
| 14 | |
| 15 | func (b *Foo[T]) Init() { |
| 16 | _ = Handler(b.Bar) |
| 17 | } |
| 18 | |
| 19 | func main() { |
| 20 | c := &Foo[int]{} |
| 21 | c.Init() |
| 22 | } |