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

chore(compiler): Add fromNumber(<literal>) warning for short types #2024

Conversation

spotandjake
Copy link
Member

This pr makes the fromNumber(<literal>) warning work on all types.

On a side note I think we broke the implementation of this check when we added default args and this pr also fixes that issue.

I merged the FromNumberLiteralXXX warnings into a single warning. I don't know if we want to make this a breaking change as the warning numbers have changed (I feel like we should consider it as one).

closes: #2019

Copy link
Member

@ospencer ospencer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add tests for the short nums?

Copy link
Member

@phated phated left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing

compiler/src/typed/typed_well_formedness.re Show resolved Hide resolved
@spotandjake spotandjake force-pushed the spotandjake-improve-fromNumberLiteral-warn branch from 3eb0d70 to e386d59 Compare March 3, 2024 01:25
@phated phated added this pull request to the merge queue Mar 3, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Mar 3, 2024
@ospencer ospencer enabled auto-merge March 3, 2024 23:53
@ospencer ospencer added this pull request to the merge queue Mar 4, 2024
Merged via the queue into grain-lang:main with commit b09ea66 Mar 4, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Compiler: Improve FromNumberLiteral warnings.
4 participants