nickel icon indicating copy to clipboard operation
nickel copied to clipboard

Invalid record field accesses can produce confusing errors

Open vkleen opened this issue 3 years ago • 0 comments

Nickel currently parses, e.g., record.5 as a function application of record to the number .5, leading to a confusing error message:

error: not a function
  ┌─ repl-input-2:1:14
  │
1 │ let record = {}
  │              ^^ this term is applied, but it is not a function
  │
  ┌─ repl-input-3:1:1
  │
1 │ record.5
  │ -------- applied here

We may want to make the parser slightly stricter to produce a better error message.

vkleen avatar Apr 13 '23 13:04 vkleen