Files
wren/test/language/setter/associativity.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

19 lines
355 B
Plaintext

class Foo {
new(value) { _value = value }
toString { _value }
bar=(value) {
_value = value
return value
}
}
var a = new Foo("a")
var b = new Foo("b")
var c = new Foo("c")
// Assignment is right-associative.
a.bar = b.bar = c.bar = "d"
IO.print(a.toString) // expect: d
IO.print(b.toString) // expect: d
IO.print(c.toString) // expect: d