Skip to content

Weird syntax error on undefined identifier #487

Open

Description

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlanguageLanguage feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions