Source file
test/fixedbugs/issue76008.go
1
2
3
4
5
6
7 package main
8
9 import "runtime"
10
11 func main() {
12 shouldPanic(func() {
13 g = any(func() {}) == any(func() {})
14 })
15 shouldPanic(func() {
16 g = any(map[int]int{}) == any(map[int]int{})
17 })
18 shouldPanic(func() {
19 g = any([]int{}) == any([]int{})
20 })
21 }
22
23 var g bool
24
25 func shouldPanic(f func()) {
26 defer func() {
27 err := recover()
28 if err == nil {
29 _, _, line, _ := runtime.Caller(2)
30 println("did not panic at line", line+1)
31 }
32 }()
33
34 f()
35 }
36
View as plain text