1
2
3
4
5 package p
6
7
8
9 type (
10 T1 interface{int}
11 T2 interface{~int}
12 T3 interface{T1 | bool | string}
13 T4 interface{T2 | ~bool | ~string}
14 )
15
16 type (
17
18
19 _ interface{int | int }
20 _ interface{int | ~ int}
21 _ interface{~int | int }
22 _ interface{~int | ~ int}
23
24 _ interface{T1 | bool | string | T1 | bool | string }
25 _ interface{T1 | bool | string | T2 | ~ bool | ~ string}
26
27
28 _ interface{T1 | T1}
29 _ interface{T1 | T2}
30 _ interface{T2 | T1}
31 _ interface{T2 | T2}
32
33 _ interface{T3 | T3 | int}
34 _ interface{T3 | T4 | bool }
35 _ interface{T4 | T3 | string }
36 _ interface{T4 | T4 | float64 }
37 )
38
39 func _[_ T1 | bool | string | T1 | bool ]() {}
40 func _[_ T1 | bool | string | T2 | ~ bool ]() {}
41 func _[_ T2 | ~bool | ~string | T1 | bool ]() {}
42 func _[_ T2 | ~bool | ~string | T2 | ~ bool ]() {}
43
44 func _[_ T3 | T3 | int]() {}
45 func _[_ T3 | T4 | bool]() {}
46 func _[_ T4 | T3 | string]() {}
47 func _[_ T4 | T4 | float64]() {}
48
49
50
51 type _ interface {
52 interface {bool | int} | interface {bool | string}
53 }
54
55 type _ interface {
56 interface {bool | int} ; interface {bool | string}
57 }
58
59 type _ interface {
60 interface {bool; int} ; interface {bool; string}
61 }
62
63 type _ interface {
64 interface {bool; int} | interface {bool; string}
65 }
View as plain text