github.com/JimmyHuang454/JLS-go@v0.0.0-20230831150107-90d536585ba0/internal/types/testdata/fixedbugs/issue39754.go (about) 1 // Copyright 2020 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 type Optional[T any] struct {} 8 9 func (_ Optional[T]) Val() (T, bool) 10 11 type Box[T any] interface { 12 Val() (T, bool) 13 } 14 15 func f[V interface{}, A, B Box[V]]() {} 16 17 func _() { 18 f[int, Optional[int], Optional[int]]() 19 _ = f[int, Optional[int], Optional /* ERROR does not satisfy Box */ [string]] 20 _ = f[int, Optional[int], Optional /* ERROR Optional.* does not satisfy Box.* */ [string]] 21 }