Skip to content

Backport "Handle TupleXXL in match analysis" to LTS #20791

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 3 commits into from
Jun 26, 2024
Merged

Conversation

WojciechMazur
Copy link
Contributor

Backports #19212 to the LTS branch.

PR submitted by the release tooling.
[skip ci]

dwijnand added 3 commits June 25, 2024 13:18
There's a number of problems with the match analysis of TupleXXL.
Of course, they manifest as (in)exhaustivity and (un)reachability
warnings.

Reachability suffered by the problem that a large generic tuple
scrutinee type wasn't considered extractable by the TupleXXL extractor
that Typer associates the extractor pattern with.  That was solved by
special handling in SpaceEngine's isSubType.

Exhaustivity suffered by a variety of problems, again stemming from the
disconnect between the TupleXXL pattern type and the large generic tuple
scrutinee (or component) type.  That was solved by special handling in
exhaustivityCheckable to ignore large generic tuple scrutinees.

That then highlighted an irrefutable failure (checkIrrefutable), which
also needed to be taught that extra large generic tuples do conform to
TupleXXL extractors type, afterwhich SpaceEngine isIrrefutable needed
special handling to consider TuplXXL irrefutable.

[Cherry-picked e56b75e]
…19103)

Previously, simpleExpr was recovered as `Literal(Constant(null))` which
led to some errors in interactive.

Type inference in Scala 3 works on whole chain, thus type vars were
inferred as union type of `Null` because of this very reason. Recovering
such errors as `unimplementedExpr` which has a type of `Nothing`, solves
the issue.
Base automatically changed from lts-19103 to lts-3.3 June 26, 2024 09:23
@WojciechMazur
Copy link
Contributor Author

No regressions detected in the community build up to lts-19356.

Reference

@WojciechMazur WojciechMazur merged commit e69a18d into lts-3.3 Jun 26, 2024
19 checks passed
@WojciechMazur WojciechMazur deleted the lts-19212 branch June 26, 2024 09:23
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