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

Teach typedConstructorPattern to ignore non-redefining unapplies #9462

Merged
merged 2 commits into from Feb 3, 2021

Conversation

@dwijnand
Copy link
Member

@dwijnand dwijnand commented Jan 28, 2021

In pos/t12250.scala Foo defines an unapply which doesn't redefine the
synthetic one. Thus unapply is overloaded. In the pattern being typed,
the synthetic one is indeed the one seeked, so despite being overloaded,
we should convertToCaseConstructor.

Fixes scala/bug#12250

@scala-jenkins scala-jenkins added this to the 2.13.5 milestone Jan 28, 2021
@lrytz

This comment has been hidden.

@dwijnand

This comment has been hidden.

@dwijnand dwijnand closed this Jan 29, 2021
@dwijnand dwijnand reopened this Jan 29, 2021
@dwijnand dwijnand force-pushed the patmat-unrelated-unapply branch from 0e6522a to a25a765 Jan 29, 2021
@dwijnand
Copy link
Member Author

@dwijnand dwijnand commented Jan 29, 2021

Fixed my boolean algebra mistake.

Just recording the current behaviour, to confirm the next commit doesn't
regress them.
@dwijnand dwijnand force-pushed the patmat-unrelated-unapply branch from a25a765 to fc34bf2 Jan 29, 2021
@dwijnand dwijnand requested a review from lrytz Feb 1, 2021
In pos/t12250.scala Foo defines an unapply which doesn't redefine the
synthetic one.  Thus unapply is overloaded.  In the pattern being typed,
the synthetic one is indeed the one seeked, so despite being overloaded,
we should convertToCaseConstructor.
@dwijnand dwijnand force-pushed the patmat-unrelated-unapply branch from fc34bf2 to 0b8dd2a Feb 3, 2021
@dwijnand dwijnand requested a review from SethTisue Feb 3, 2021
@dwijnand
Copy link
Member Author

@dwijnand dwijnand commented Feb 3, 2021

Seth was ready to merge, but I wanted to review this detail, so it can be merged now once it's green.

@dwijnand dwijnand merged commit aab85b1 into scala:2.13.x Feb 3, 2021
4 checks passed
@dwijnand dwijnand deleted the patmat-unrelated-unapply branch Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants