Source file
test/fixedbugs/issue65962.go
1
2
3
4
5
6
7 package main
8
9 func main() {
10 test1()
11 test2()
12 }
13
14 type I interface {
15 f()
16 g()
17 h()
18 }
19
20
21 func ld[T any]() {
22 var x I
23 if _, ok := x.(T); ok {
24 }
25 }
26
27 func isI(x any) {
28 _ = x.(I)
29 }
30
31 func test1() {
32 defer func() { recover() }()
33 ld[bool]()
34 _ = any(false).(I)
35 }
36
37 type B bool
38
39 func (B) f() {
40 }
41 func (B) g() {
42 }
43
44 func test2() {
45 defer func() { recover() }()
46 ld[B]()
47 _ = any(B(false)).(I)
48 }
49
View as plain text