action-as-value

A phrase that gives no value is used as a value.

compile error, shown by synod check.

An action phrase has no result. It cannot be an argument, the right side of set, or a condition. Write it as a statement on its own line.

Example

Check this program to see the diagnostic.

# package p
Node has
  set count to 0

define [n: Node] Bump
  set n.count to (n.count plus 1)

define [n: Node] Go
  set n.count to n.Bump

Diagnostic

p/p.synod:9:18: error[action-as-value]: "n.Bump" gives no value

Fix

Call the phrase as a statement.

# package p
Node has
  set count to 0

define [n: Node] Bump
  set n.count to (n.count plus 1)

define [n: Node] Go
  n.Bump