cl: funcName check $bound
This commit is contained in:
25
cl/_testrt/closurebound/in.go
Normal file
25
cl/_testrt/closurebound/in.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
se := demo1{}
|
||||
f := se.encode
|
||||
if f() != 1 {
|
||||
panic("error")
|
||||
}
|
||||
}
|
||||
|
||||
var my = demo2{}.encode
|
||||
|
||||
type demo1 struct {
|
||||
}
|
||||
|
||||
func (se demo1) encode() int {
|
||||
return 1
|
||||
}
|
||||
|
||||
type demo2 struct {
|
||||
}
|
||||
|
||||
func (se demo2) encode() int {
|
||||
return 2
|
||||
}
|
||||
Reference in New Issue
Block a user