fix map __call__

This commit is contained in:
2023-06-16 10:35:06 +01:00
parent 3071da2e2d
commit 651830ec31

View File

@@ -78,10 +78,20 @@ func runCall(c call, stack stack, stacklevel int) (any, ArErr) {
} }
switch x := callable_.(type) { switch x := callable_.(type) {
case ArObject: case ArObject:
callable_ = x.obj["__call__"] callable_, err := mapGet(ArMapGet{
} x,
[]any{"__call__"},
c.line,
c.code,
c.path,
}, stack, stacklevel)
if !err.EXISTS {
callable = callable_ callable = callable_
} }
default:
callable = callable_
}
}
args := []any{} args := []any{}
level := append(stack, newscope()) level := append(stack, newscope())
for _, arg := range c.args { for _, arg := range c.args {