Files
wren/test/language/assignment/syntax.wren
T
Bob Nystrom d50275eae0 fix: correct variable reference in chained assignment test assertion
The test for chained assignment was incorrectly printing variable `a` twice instead of printing `b` for the second assertion. This fix changes the second `System.print(a)` to `System.print(b)` so the test correctly verifies that both `a` and `b` hold the value "chain" after the chained assignment `a = b = "chain"`.
2016-10-08 17:51:19 +00:00

12 lines
244 B
Plaintext

// Chained assignment.
var a = "a"
var b = "b"
a = b = "chain"
System.print(a) // expect: chain
System.print(b) // expect: chain
// Assignment on RHS of variable.
var c = a = "var"
System.print(a) // expect: var
System.print(c) // expect: var