Use more conventional syntax for constructors.
They are now invoked like "new Foo". Also, superclass constructors are now much less semantically and syntactically weird. Since the instance is created before any constructor is called, there's no point in time where the instance isn't there.
This commit is contained in:
@@ -3,7 +3,7 @@ class Foo {
|
||||
init { _field = "value" } // ...before an assignment to it.
|
||||
}
|
||||
|
||||
var foo = Foo.new
|
||||
var foo = new Foo
|
||||
// But invoke them in the right order.
|
||||
foo.init
|
||||
foo.write // expect: value
|
||||
|
||||
Reference in New Issue
Block a user