Skip to content

Error messages for poly variant syntax error are hard to understand #1994

@arnarthor

Description

@arnarthor
type apiKeyError
   = [|`Dev |`Prod];
type validationErrors = [ | `AnalyticsPlatformMissing | `ApiKeyMissing(apiKeyError)];

This just gives a generic kinda cryptic syntax error message with no context and my editor (Emacs) pointed me to the later type decleration (CLI did point to the correct line).
As soon as I change it to [ |`Dev |`Prod] it reformats just fine.

Wondering if it's possible to detect something like this since it's probably quite common due to the similarities with array and poly variant declaration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Error messagesconfusing, missing, or just weak error messages

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions