Files
wren/test/language/super/closure.wren
T

13 lines
238 B
Plaintext
Raw Normal View History

2013-12-22 20:46:12 -08:00
class Base {
2014-04-03 07:48:19 -07:00
toString { "Base" }
2013-12-22 20:46:12 -08:00
}
class Derived is Base {
2015-09-01 08:16:04 -07:00
construct new() {}
2015-07-10 09:18:22 -07:00
getClosure { Fn.new { super.toString } }
2014-04-03 07:48:19 -07:00
toString { "Derived" }
2013-12-22 20:46:12 -08:00
}
2015-07-10 09:18:22 -07:00
var closure = Derived.new().getClosure
2015-09-15 07:46:09 -07:00
System.print(closure.call()) // expect: Base