Use "construct" instead of "this" to define constructors.

This commit is contained in:
Bob Nystrom
2015-07-21 07:24:53 -07:00
parent ed8ec262e4
commit 71ab3ca887
31 changed files with 68 additions and 81 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
class A {
this new(arg) {
construct new(arg) {
IO.print("new A ", arg)
_field = arg
}
@@ -8,7 +8,7 @@ class A {
}
class B is A {
this new(arg1, arg2) {
construct new(arg1, arg2) {
super(arg2)
IO.print("new B ", arg1)
_field = arg1
@@ -18,7 +18,7 @@ class B is A {
}
class C is B {
this new() {
construct new() {
super("one", "two")
IO.print("new C")
_field = "c"