Skip to content

Improve variable instantiation when member is missing #11242

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
Jan 29, 2021

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jan 28, 2021

The couldInstantiateTypeVar method instantiated only type variables
that were the constructor of an applied type. But sometimes we
might also need to instantiate the argument(s), since doing so can
influence the members of the applied type. This happens in two cases

  1. The applied type's rhs is a match type
  2. The applied type's result is one of its type parameters

i11236.scala tests the first case, the additions to i9567.scala the second.

Fixes #11236

The `couldInstantiateTypeVar` method instantiated only type variables
that were the constructor of an applied type. But sometimes we
might also need to instantiate the argument(s), since doing so can
influence the members of the applied type. This happens in two cases

 1. The applied type's rhs is a match type
 2. The applied type's result is one of its type parameters

i11236.scala tests the first case, the additions to i9567.scala the second.

Fixes scala#11236
@nicolasstucki
Copy link
Contributor

There is a related issue that did not get fixed with these changes (see #11236).

@odersky odersky merged commit c49d6c0 into scala:master Jan 29, 2021
@odersky odersky deleted the fix-11236 branch January 29, 2021 16:41
@Kordyjan Kordyjan added this to the 3.0.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.

Match type not working unless ascribed
3 participants