1// Copyright 2022 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
5package p
6
7func f1[_ comparable]()              {}
8func f2[_ interface{ comparable }]() {}
9
10type T interface{ m() }
11
12func _[P comparable, Q ~int, R any]() {
13	_ = f1[int]
14	_ = f1[T /* T does satisfy comparable */]
15	_ = f1[any /* any does satisfy comparable */]
16	_ = f1[P]
17	_ = f1[Q]
18	_ = f1[R /* ERROR "R does not satisfy comparable" */]
19
20	_ = f2[int]
21	_ = f2[T /* T does satisfy comparable */]
22	_ = f2[any /* any does satisfy comparable */]
23	_ = f2[P]
24	_ = f2[Q]
25	_ = f2[R /* ERROR "R does not satisfy comparable" */]
26}
27