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

Check @targetName when subtyping Refined Types #19081

Merged
merged 3 commits into from
Nov 30, 2023

Conversation

hamzaremmal
Copy link
Member

Closes #18922

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't like this error message as it does not explain exactly why the types didn't match. We will have to add some custom message probably

@hamzaremmal hamzaremmal marked this pull request as ready for review November 29, 2023 14:15
Comment on lines 2087 to 2089
(isSubInfo(info1, info2, m.symbol.info.orElse(info1)) && m.symbol.hasTargetName(m.symbol.name))
|| matchAbstractTypeMember(m.info)
|| (tp1.isStable && m.symbol.isStableMember && isSubType(TermRef(tp1, m.symbol), tp2.refinedInfo))
Copy link
Member

Choose a reason for hiding this comment

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

Why add the target name test only in the first of the three alternatives, and not in all of them? Couldn't we have the same issue in other cases?

@hamzaremmal hamzaremmal merged commit 4d45087 into scala:main Nov 30, 2023
17 checks passed
@Kordyjan Kordyjan added this to the 3.4.0 milestone Dec 20, 2023
@hamzaremmal hamzaremmal deleted the i18922 branch June 25, 2024 11:22
WojciechMazur added a commit that referenced this pull request Jun 26, 2024
)

Backports #19081 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
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.

selectDynamic doesn't work with @targetName
3 participants