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

Remove the -rewrite option for typechecks methods in Quotes #21547

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

jchyb
Copy link
Contributor

@jchyb jchyb commented Sep 5, 2024

Fixes #21415

This is somewhat related to #21185, but I think it's better to merge this one separately first since it's an easy backport, which might not be the case with the other PR (since we are technically changing the semantics there)

@@ -342,10 +342,13 @@ object Inlines:
if Inlines.isInlineable(codeArg1.symbol) then stripTyped(Inlines.inlineCall(codeArg1))
else codeArg1

// We should not be rewriting tested strings
val noRewriteSettings = ctx.base.settings.rewrite.update(None)
Copy link
Member

Choose a reason for hiding this comment

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

Actually, this call might either mutate the state in the ctx itself and return that context's SettingState or it will return a new SettingState depending on the state of reading the setting itself. See:

def update(idx: Int, x: Any): SettingsState =
if (_wasRead) then SettingsState(values.toSeq, changed.toSet).update(idx, x)
else
values(idx) = x
changed.add(idx)
this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I did not realize this was the case. Thank you for the catch!

@jchyb jchyb assigned jchyb and unassigned hamzaremmal Sep 10, 2024
@hamzaremmal hamzaremmal merged commit 61adf81 into scala:main Sep 13, 2024
28 checks passed
@hamzaremmal hamzaremmal deleted the i21415-type-check-errors branch September 13, 2024 14:44
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.

Overlapping patches crash when using -rewrite and compiletime.testing.typeCheckErrors
2 participants