2013-11-23 14:55:05 -08:00
|
|
|
class Foo {
|
2014-01-05 12:27:12 -08:00
|
|
|
write { IO.print(_field) } // Compile a use of the field...
|
2013-11-23 14:55:05 -08:00
|
|
|
init { _field = "value" } // ...before an assignment to it.
|
|
|
|
|
}
|
|
|
|
|
|
2013-12-19 07:02:27 -08:00
|
|
|
var foo = new Foo
|
2013-11-23 14:55:05 -08:00
|
|
|
// But invoke them in the right order.
|
|
|
|
|
foo.init
|
|
|
|
|
foo.write // expect: value
|