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

Add missing error messages to asserts in QuotesImpl #21852

Merged
merged 2 commits into from
Nov 4, 2024

Conversation

KacperFKorban
Copy link
Member

closes #20946

@KacperFKorban KacperFKorban marked this pull request as ready for review October 30, 2024 12:48
@KacperFKorban KacperFKorban requested a review from jchyb October 30, 2024 12:48
Copy link
Contributor

@jchyb jchyb left a comment

Choose a reason for hiding this comment

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

The changes itself LGTM! Just found the smallest typo. I do have one concern for the tests though... we have two of these already, and the visible stack trace makes it require regenerating check files with every change to QuotesImpl.scala (I do intend to adjust those, one day...). Perhaps we could catch the assertion error in the macro, check the message, rethrow it, and not have a checkfile here?

compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala Outdated Show resolved Hide resolved
@KacperFKorban
Copy link
Member Author

Right! I didn't think about the fact that the whole stack trace is very implementation dependent. Looks a bit hacky now, but works. Nice catch!

@KacperFKorban KacperFKorban requested a review from jchyb November 1, 2024 14:51
Copy link
Contributor

@jchyb jchyb left a comment

Choose a reason for hiding this comment

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

Thank you!

@jchyb jchyb merged commit b47f0f2 into scala:main Nov 4, 2024
29 checks passed
@jchyb jchyb deleted the fix-i20946 branch November 4, 2024 11:34
@WojciechMazur WojciechMazur added this to the 3.6.3 milestone Dec 9, 2024
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.

All asserts in Quotes should give helpful error messages
3 participants