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

Work around https://github.com/lampepfl/dotty/issues/19237 #425

Merged
merged 1 commit into from
Dec 18, 2023

Conversation

sjrd
Copy link
Contributor

@sjrd sjrd commented Dec 18, 2023

It does not seem that the upstream issue will be fixed any time soon due to binary compatibility concerns. Nevertheless, it makes no sense, and it is not possible possible to create a value of a "package type".

Therefore, we work around the issue by tolerating a PackageRef as the type of a PARAM of an inline accessor method. We replace it by Nothing, which matches the fact that no value can be created for it.

Note that the signature and therefore the signed name of such a method will be different from what dotc computes, so it will still be semantically broken.

It does not seem that the upstream issue will be fixed any time
soon due to binary compatibility concerns. Nevertheless, it makes
no sense, and it is not possible possible to create a *value* of
a "package type".

Therefore, we work around the issue by tolerating a `PackageRef`
as the type of a PARAM of an inline accessor method. We replace it
by `Nothing`, which matches the fact that no value can be created
for it.

Note that the *signature* and therefore the *signed name* of such
a method will be different from what dotc computes, so it will
still be semantically broken.
@sjrd sjrd requested a review from adpi2 December 18, 2023 10:36
Copy link
Member

@adpi2 adpi2 left a comment

Choose a reason for hiding this comment

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

Nice

@sjrd sjrd merged commit e711b4a into scalacenter:main Dec 18, 2023
4 checks passed
@sjrd sjrd deleted the work-around-upstream-package-param branch December 18, 2023 13:40
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.

2 participants