compiler: support calling function literals

This commit is contained in:
Evgenii Stratonikov 2020-08-19 17:31:02 +03:00
parent b4bcd23c0f
commit d73f3cd24c
2 changed files with 19 additions and 0 deletions

View file

@ -13,3 +13,16 @@ func TestFuncLiteral(t *testing.T) {
}`
eval(t, src, big.NewInt(5))
}
func TestCallInPlace(t *testing.T) {
src := `package foo
var a int = 1
func Main() int {
func() {
a += 10
}()
a += 100
return a
}`
eval(t, src, big.NewInt(111))
}