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

23 lines
393 B
Plaintext
Raw Normal View History

2014-04-19 11:51:36 -07:00
class Base {
2015-09-15 07:46:09 -07:00
foo { System.print("Base.foo") }
foo(a) { System.print("Base.foo(a)") }
foo(a, b) { System.print("Base.foo(a, b)") }
2014-04-19 11:51:36 -07:00
}
class Derived is Base {
2015-09-01 08:16:04 -07:00
construct new() {}
2014-04-19 11:51:36 -07:00
foo(a) {
2015-09-15 07:46:09 -07:00
System.print("Derived.bar(a)")
2014-04-19 11:51:36 -07:00
super
super(1)
super(1, 2)
}
}
2015-07-10 09:18:22 -07:00
Derived.new().foo(1)
2014-04-19 11:51:36 -07:00
// expect: Derived.bar(a)
// expect: Base.foo
// expect: Base.foo(a)
// expect: Base.foo(a, b)