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

Tighten product match logic in irrefutable check #13962

Merged
merged 1 commit into from Nov 19, 2021

Conversation

dwijnand
Copy link
Member

This avoids accidentally considering refutable name-based extractors as
irrefutable because they also happen to be a Product.

With this change some tests no longer go through the Typ to Prod rewrite
that occurs in minus(a, b) when a is a Typ and b is a Prod,
leading to a Typ result. This renders in the counter-example as a
generic value type rather than a product, which we see in the warning
text changes in the tests.

This avoids accidentally considering refutable name-based extractors as
irrefutable because they also happen to be a Product.

With this change some tests no longer go through the Typ to Prod rewrite
that occurs in `minus(a, b)` when `a` is a Typ and `b` is a Prod,
leading to a Typ result.  This renders in the counter-example as a
generic value type rather than a product, which we see in the warning
text changes in the tests.

Co-authored-by: Gagandeep Kalra <gagandeepkalra1994@gmail.com>
Co-authored-by: Mark T. Kennedy <mtk@acm.org>
@anatoliykmetyuk anatoliykmetyuk merged commit 2ef89b2 into scala:master Nov 19, 2021
@dwijnand dwijnand deleted the pattern-typer/arity branch November 19, 2021 14:05
@Kordyjan Kordyjan added this to the 3.1.2 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.

Got ArrayIndexOutOfBoundsException in SpaceLogic instead of type error due to missing argument
3 participants