Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rescript: prefix invalid ctor names by 'Case' #393

Merged
merged 2 commits into from
Mar 4, 2024
Merged

rescript: prefix invalid ctor names by 'Case' #393

merged 2 commits into from
Mar 4, 2024

Conversation

cannorin
Copy link
Member

@cannorin cannorin commented Mar 4, 2024

Fixes #392.

This PR modifies ReScriptHelper.Naming.constructorName so that it prefixes any kind of invalid constructor name (not starting with an alphabet) by Case.

export type Test = "1" | "2";
type t =
  | @as(1) Case1
  | @as(2) Case2

@cannorin cannorin merged commit 1f6d0d4 into main Mar 4, 2024
6 checks passed
@cannorin cannorin deleted the fix-392 branch March 4, 2024 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Keeping numbers at the start of union cases is invalid syntax with ReScript
1 participant