1
0
forked from Mirror/wren

No more default constructors.

Fixes #296.
This commit is contained in:
Bob Nystrom
2015-09-01 08:16:04 -07:00
parent 36f3059e48
commit 2e83f056c1
86 changed files with 248 additions and 133 deletions

View File

@ -5,6 +5,8 @@ class Base {
}
class Derived is Base {
construct new() {}
foo(a) {
IO.print("Derived.bar(a)")
super

View File

@ -5,6 +5,8 @@ class Base {
}
class Derived is Base {
construct new() {}
bar {
IO.print("Derived.bar")
super.foo

View File

@ -5,6 +5,8 @@ class Base {
}
class Derived is Base {
construct new() {}
foo {
IO.print("Derived.foo")
super.foo

View File

@ -3,6 +3,7 @@ class Base {
}
class Derived is Base {
construct new() {}
getClosure { Fn.new { super.toString } }
toString { "Derived" }
}

View File

@ -5,6 +5,8 @@ class Base {
}
class Derived is Base {
construct new() {}
foo {
IO.print("Derived.foo")
super

View File

@ -7,6 +7,8 @@ class A {
class B is A {}
class C is B {
construct new() {}
foo {
IO.print("C.foo")
super.foo

View File

@ -1,6 +1,7 @@
class Base {}
class Derived is Base {
construct new() {}
foo { super.doesNotExist(1) } // expect runtime error: Base does not implement 'doesNotExist(_)'.
}

View File

@ -6,6 +6,8 @@ class A {
toString { "A.toString" }
}
class B is A {}
class B is A {
construct new() {}
}
IO.print(B.new().callSuperToString) // expect: instance of B

View File

@ -4,6 +4,8 @@ class A {
toString { "A.toString" }
}
class B is A {}
class B is A {
construct new() {}
}
IO.print(B.new().callSuperToString) // expect: instance of B