Skip to content

More careful type variable instance improvements #19659

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
Feb 9, 2024

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Feb 9, 2024

The previous code tried to recursively apply the current instance of FullyDefinedAccumulator to the prospective instance type. This can have unforeseen side-effects, as i19637 shows. We now are more conservative: We check that the prospective instance type is already fully defined without the possibility to instantiate more type variables. This still passes the test cases that type variable improvement solves and avoids the problem with #19637.

Fixes #19637

The previous code tried to recursively apply the current instance
of FullyDefinedAccumulator to the prospective instance type. This
can have unforeseen side-effects, as i19637 shows. We now are more
conservative: We check that the prospective instance type is already
fully defined without the possibility to instantiate more type variables.
This still passes the test cases that type variable improvement solves
and avoids the problem with scala#19637.

Fixes scala#19637
@odersky odersky marked this pull request as ready for review February 9, 2024 16:26
@odersky odersky merged commit 067ec20 into scala:main Feb 9, 2024
@odersky odersky deleted the fix-19637 branch February 9, 2024 16:56
@Kordyjan Kordyjan added this to the 3.4.1 milestone Feb 14, 2024
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.

Good code is red. Java interop issue with collectors
3 participants