value-as-statement

A phrase that gives a value stands where a statement is expected.

compile error, shown by synod check.

A value phrase gives its value with result. If you write it on a line by itself, the value is thrown away, which is almost always a mistake. Use the value, for example with set.

Example

Check this program to see the diagnostic.

# package p
Node has
  set count to 0

define Twice [x: number]
  result (x times 2)

define [n: Node] Go
  Twice 3

Diagnostic

p/p.synod:9:3: error[value-as-statement]: "Twice 3" gives a value but stands as a statement
  hint: use it, as in "set x to (…)"

Fix

Use the value.

# package p
Node has
  set count to 0

define Twice [x: number]
  result (x times 2)

define [n: Node] Go
  set n.count to (Twice 3)