1 // Copyright 2023 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package p 6 7 func f(func(int) string) {} 8 9 func g2[P, Q any](P) Q { var q Q; return q } 10 func g3[P, Q, R any](P) R { var r R; return r } 11 12 func _() { 13 f(g2) 14 f(g2[int]) 15 f(g2[int, string]) 16 17 f(g3[int, bool]) 18 f(g3[int, bool, string]) 19 20 var _ func(int) string = g2 21 var _ func(int) string = g2[int] 22 } 23