mint
mint copied to clipboard
Weird syntax error on undefined identifier
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