mirror of
https://github.com/hanzoai/yaegi.git
synced 2026-10-01 00:49:47 +00:00
Use node action to better discriminate between function call and type conversion which have the same pattern at AST level. Fixes #960.
18 lines
199 B
Go
18 lines
199 B
Go
package main
|
|
|
|
type F func() (int, error)
|
|
|
|
func f1() (int, error) { return 3, nil }
|
|
|
|
func f2(a string, f F) {
|
|
c, _ := f()
|
|
println(a, c)
|
|
}
|
|
|
|
func main() {
|
|
f2("hello", F(f1))
|
|
}
|
|
|
|
// Output:
|
|
// hello 3
|