ssa: fix closure type

This commit is contained in:
visualfc
2024-10-29 20:50:02 +08:00
parent e92a0eb901
commit 2b5fdd3548
4 changed files with 384 additions and 58 deletions

View File

@@ -0,0 +1,14 @@
package main
func main() {
var m int = 200
fn := func(n int) int {
return m + n
}
var i any = fn
f, ok := i.(func(int) int)
if !ok {
panic("error")
}
println(f(100))
}