Language reference · section 30

30. Error message style

Error messages follow section 1. The compiler speaks to the writer.

Feature: Error messages

  Scenario: A message names the problem in plain words
    Given a compile error
    Then the message says what is wrong in plain words

  Scenario: A message gives the next step when one is known
    Given a common mistake with a known fix
    Then the message gives the fix as a hint

  Scenario: A message uses the terms in section 2
    Given a compile error about a binding
    Then the message says "binding", not "variable"

  Scenario: A contract failure names the contract
    Given a failed requires line
    Then the message reads "contract failed: requires <cond>"

Hints the compiler gives today:

Mistake Hint
== or === write is
!= write isnt
&& write and
|| write or
elif write else if
a call without parentheses write the parentheses
a block after name = that is not regex or find write regex: or find: