Interpreter - Working bound methods

This commit is contained in:
Emmanuel BENOîT 2023-01-09 11:19:42 +01:00
parent 542bc56aad
commit 3e4aea0d78
3 changed files with 39 additions and 6 deletions
src/interpreter

View file

@ -539,7 +539,7 @@ impl ExprNode {
) -> InterpreterResult {
let instance = get_expr.instance.interpret(itpr_state)?.result();
instance.with_instance(
|instance| instance.get(&get_expr.name).map(|v| v.into()),
|inst| inst.get(&instance, &get_expr.name).map(|v| v.into()),
|| error(&get_expr.name, "only instances have properties"),
)
}