Files
wren/test/language/field/use_before_set.wren
T
Bob Nystrom 64eccdd9be Reorganize tests and benchmark scripts.
Mainly to get rid of one top level directory. But this will
also be useful when there are tests of the embedding API.
2015-03-14 12:45:56 -07:00

10 lines
233 B
Plaintext

class Foo {
write { IO.print(_field) } // Compile a use of the field...
init { _field = "value" } // ...before an assignment to it.
}
var foo = new Foo
// But invoke them in the right order.
foo.init
foo.write // expect: value