unison/unison-src/transcripts/error-messages.md
2022-02-17 12:44:22 -06:00

1.3 KiB

.> builtins.merge

This file contains programs with parse errors and type errors, for visual inspection of error message quality and to check for regressions or changes to error reporting.

Parse errors

Some basic errors of literals.

Floating point literals

x = 1. -- missing some digits after the decimal
x = 1e -- missing an exponent
x = 1e- -- missing an exponent
x = 1E+ -- missing an exponent

Hex, octal, and bytes literals

x = 0xoogabooga -- invalid hex chars
x = 0o987654321 -- 9 and 8 are not valid octal char
x = 0xsf -- odd number of hex chars in a bytes literal
x = 0xsnotvalidhexchars -- invalid hex chars in a bytes literal

Layout errors

foo = else -- not matching if
foo = then -- unclosed
foo = with -- unclosed

Matching

foo = match 1 with
  2 -- no right-hand-side
-- Mismatched arities
foo = cases
  1, 2 -> ()
  3 -> ()

Watches

-- Empty watch
>

Keywords

use.keyword.in.namespace = 1
-- reserved operator
a ! b = 1