Retoor software development Projects Research SearchXNG
Register Sign In

17 lines
252 B
Plaintext
Raw Normal View History

feat: add superclass call support inside closures in wren compiler Add a new test case `test/super/closure.wren` verifying that `super.toString` correctly resolves to the base class method when called from within a closure defined in a derived class. Refactor `resolveLocal` and `resolveUpvalue` to accept explicit name and length parameters instead of relying on the previously consumed token, enabling proper name resolution in nested closure scopes during superclass method dispatch.
2013-12-23 05:46:12 +01:00
class Base {
toString { return "Base" }
}
class Derived is Base {
getClosure {
return fn {
return super.toString
}
}
toString { return "Derived" }
}
var closure = (new Derived).getClosure
IO.write(closure.call) // expect: Base
Reference in New Issue Copy Permalink
b72a42eedd
wren/test/super/closure.wren
Response time: 32ms
Mail Licenses API