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

12 lines
213 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-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-02-26 23:08:36 -08:00
IO.print(closure.call()) // expect: Base