Skip to content

Commit

Permalink
Merge pull request #4 from gingershaped/master
Browse files Browse the repository at this point in the history
Fix __call__ to use State#metaCall
  • Loading branch information
Seggan committed Sep 10, 2024
2 parents ccded73 + 42c3714 commit 02993e4
Showing 1 changed file with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -381,18 +381,7 @@ class State(val parentState: State? = null) {
if (callable is CallableValue) {
callValue(callable, nargs, selfProvided, span)
} else {
val possiblyCallable = callable.lookUp("__call__".metisValue())
if (possiblyCallable is CallableValue) {
callValue(possiblyCallable, nargs, selfProvided, span)
} else {
throw MetisRuntimeException(
"TypeError",
"Cannot call non-callable: ${stringify(callable)}",
buildTable { table ->
table["callable"] = callable
}
)
}
metaCall(nargs, "__call__")
}
}

Expand Down

0 comments on commit 02993e4

Please sign in to comment.