Skip to content

Handle type alias in capturing wildcards #13260

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

Merged
merged 1 commit into from
Aug 8, 2021

Conversation

dwijnand
Copy link
Member

@dwijnand dwijnand commented Aug 5, 2021

We extend capturing wildcards so that it operates on the type after
dealiasing. However, in line with, for example, derivedRefinedType, we
want to return the original type if nothing was captured, because it's
on that basis that adapt decides whether it needs to cast and re-adapt
to the new type with the type boxes.

Fixes #12739

@dwijnand dwijnand marked this pull request as ready for review August 5, 2021 19:36
Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

LGTM

We extend capturing wildcards so that it operates on the type after
dealiasing.  However, in line with, for example, derivedRefinedType, we
want to return the original type if nothing was captured, because it's
on that basis that adapt decides whether it needs to cast and re-adapt
to the new type with the type boxes.

Co-authored-by: Seth Tisue <[email protected]>
@dwijnand dwijnand force-pushed the wildcards-be-wild branch from d1b9a01 to e0622ea Compare August 6, 2021 16:52
@dwijnand dwijnand requested a review from liufengyun August 7, 2021 20:16
@dwijnand dwijnand merged commit 6655587 into scala:master Aug 8, 2021
@dwijnand dwijnand deleted the wildcards-be-wild branch August 9, 2021 13:25
@Kordyjan Kordyjan added this to the 3.1.0 milestone Aug 2, 2023
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.

asInstanceOf causes type mismatch error when used in method argument position
3 participants