kyleect / locks

A toy language branched from Lox to learn language implementation and tooling. Forked from loxcraft
https://kyleect.github.io/locks/#/docs
MIT License
0 stars 0 forks source link

Passing super.method to a function causes error #152

Open kyleect opened 5 months ago

kyleect commented 5 months ago

This looks like a similar issue passing this.method to functions before. Might be a similar fix.

class Parent {
    let value = 100;

    fn call() {
        println("CALL!");
    }
}

class Child extends Parent {
    fn init () {
        println(this.value);
        println(super.call);
    }
}

let child = Child();

https://kyleect.github.io/locks/#/?code=MYGwhgzhAEAKYCcCmA7ALtA3gKGn6ISGAbmCAK5LQC80AjAAwMDcu+beAZitMGSAAoAlFg748ABwQBLdCBQCARAGEAggBl1AQkVDW4gL7Yj2UJBjKAFtJAATaEgAeaVLZjxk6UeO7RZ0jGFvcXwpWTR5ATRrCAA6UgokPTFxMLkFCHIJJARYvhAQZMNjbGxCDGBrOxpoKxtbYVYgA

100
error[TypeError]: call() takes 0 arguments but 1 were given
   ┌─ <script>:12:9
   │
12 │         println(super.call);
   │         ^^^^^^^^^^^^^^^^^^^