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

Stop printing type error context when reaching "while defining..." #1336

Closed
Tracked by #1297
byorgey opened this issue Jun 20, 2023 · 0 comments · Fixed by #1936
Closed
Tracked by #1297

Stop printing type error context when reaching "while defining..." #1336

byorgey opened this issue Jun 20, 2023 · 0 comments · Fixed by #1936
Labels
C-Low Hanging Fruit Ideal issue for new contributors. L-Error reporting Reporting language or runtime errors to the player. S-Nice to have The bug fix or feature would be nice but doesn't currently have much negative impact. Z-Feature A new feature to be added to the game.

Comments

@byorgey
Copy link
Member

byorgey commented Jun 20, 2023

When checking a file full of definitions, technically all the definitions are joined by (possibly implicit) semicolons. So when you get a type error in a definition, it currently prints something like

Error blah blah

- While checking the definition of foo
- While checking the left-hand side of a semicolon
- While checking the right-hand side of a semicolon
- While checking the right-hand side of a semicolon
- While checking the right-hand side of a semicolon
- While checking the right-hand side of a semicolon

This is obviously ridiculous and provides no useful information. We should stop printing the context as soon as we print out a "While checking the definition of ..." since those can only occur at the top level, and the combination of the line and column info plus the name of the function is plenty to uniquely identify the location of the error.

Related: #1314, #1297

@byorgey byorgey added Z-Feature A new feature to be added to the game. C-Low Hanging Fruit Ideal issue for new contributors. L-Error reporting Reporting language or runtime errors to the player. labels Jun 20, 2023
@byorgey byorgey added the S-Nice to have The bug fix or feature would be nice but doesn't currently have much negative impact. label Jun 11, 2024
@mergify mergify bot closed this as completed in #1936 Jun 17, 2024
@mergify mergify bot closed this as completed in a66c7c8 Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Low Hanging Fruit Ideal issue for new contributors. L-Error reporting Reporting language or runtime errors to the player. S-Nice to have The bug fix or feature would be nice but doesn't currently have much negative impact. Z-Feature A new feature to be added to the game.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant