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

Backport "Expr#show: Don't crash when the expression contains an unsupported type (like a SkolemType)" to LTS #9

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

WojciechMazur
Copy link

Backports scala#20494 to the 3.3.5.

PR submitted by the release tooling.
[skip ci]

…pe (like a SkolemType)

When the SkolemType appears as the prefix of a TypeRef, we avoid it by going
using `qualifier` which is defined in QuotesImpl to widen skolem, but skolems
can appear in any position, and so before this change we would get a compiler
crash in the added test case where the skolem appears as the prefix of a
TermRef.

We fix this by adding fallback cases in the quotes pretty-printer, now for the
test case we get:

    Test.f.ho(((arg: <<SkolemType(693709097) does not have a corresponding extractor> does not have a source representation>.x.type) => arg))

Which isn't great, but better than a crash.

Maybe we should run `Type#deskolemized` on a type before trying to print it in
SourceCode/Extractors, but currently these files are intentionally defined to
not depend on compiler internals and do not have a `Context` so we cannot even
call `deskolemized` on them.

Alternatively, maybe SkolemType should be a tasty-reflect constructor but that
would also be a pretty big change.

[Cherry-picked 0ee8762][modified]
Base automatically changed from backport-lts-3.3-21674 to lts-3.3 December 6, 2024 15:14
@WojciechMazur
Copy link
Author

No regressions detected in the community build up to backport-lts-3.3-22148.

Reference

@WojciechMazur WojciechMazur merged commit 0150109 into lts-3.3 Dec 6, 2024
18 of 19 checks passed
@WojciechMazur WojciechMazur deleted the backport-lts-3.3-20494 branch December 6, 2024 15:15
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.

1 participant