From 77f14bfa8ec0e9266dcdf9bbede90e98b230089a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Fri, 13 Jan 2023 08:21:18 +0100 Subject: [PATCH] Interpreter - Static methods are returned by the getter --- src/interpreter/classes.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/interpreter/classes.rs b/src/interpreter/classes.rs index e64c7a6..663a673 100644 --- a/src/interpreter/classes.rs +++ b/src/interpreter/classes.rs @@ -101,12 +101,10 @@ impl PropertyCarrier for ClassRef { if let Some(value) = class.fields.borrow().get(&name.lexeme) { return Ok(value.clone()); } - /* - if let Some(method) = class.methods.get(&name.lexeme) { + if let Some(method) = class.static_methods.get(&name.lexeme) { let bound_method = bind_method(method, Value::from(self.clone())); return Ok(Value::from(bound_method)); } - */ Err(SloxError::with_token( ErrorKind::Runtime,