unused-name

A local or `each` name is never read.

compile error, shown by synod check.

Like Go, Synod rejects an unused local. A name is used when it is read, or when it is the base of set item … of x. Setting it again is not a use. Hole parameters and names bound by when may stay unused.

Example

Check this program to see the diagnostic.

# package p
Node has
  set count to 0

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

Diagnostic

p/p.synod:6:7: error[unused-name]: "step" is never used

Fix

Use the local, or remove it.

# package p
Node has
  set count to 0

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