Skip to content

Improve error message when variant constructor is not prepended with pipe #7578

Open
@zth

Description

@zth

This is a syntax error because the constructor needs a preceding | when there's an attribute:

type variant = @as("one") One

But the error message is very cryptic:

[E] Line 1, column 26:
Did you mean `one` instead of `One`?

We should improve this error to say what you need to do.

https://rescript-lang.org/try?version=v12.0.0-alpha.14&module=esmodule&code=C4TwDgpgBAbghgJwJZwHbCgXigATgZwAoAiAe1QmIEooB5CoA

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions