mint icon indicating copy to clipboard operation
mint copied to clipboard

Weird syntax error on undefined identifier

Open cie opened this issue 4 years ago • 0 comments

Hello, This error message puzzled me.

enum Token {
  As
}

module Mod {
  const TOKENS = [
    {A, (s : String) { A }},
    {"a", (s : String) { Token::As }},
    {"a", (s : String) { As }}
  ]
}

Line 9: The body of a record must end with a closing bracket. I was looking for the bracket } but found "a", instead.

The problem was that As is not defined, only Token::As. But the same error doesn't come for A, which is not defined either.

https://sandbox.mint-lang.com/sandboxes/zRGwYXyqzRL9HQ

cie avatar Sep 19 '21 13:09 cie