Skip to content

Fix #2253 edge cases: recurse into refined type #2261

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
Apr 14, 2017
Merged

Fix #2253 edge cases: recurse into refined type #2261

merged 1 commit into from
Apr 14, 2017

Conversation

abgruszecki
Copy link
Contributor

I managed to get some interesting results after #2257:

scala> trait T1; trait T2; sealed trait S; object O extends S with T2; object O2
defined trait T1
defined trait T2
defined trait S
defined module O
defined module O2
scala> def m(s: S { val x: T2 }) = s match { case _: T1 => ; }
-- [E028] Pattern Match Exhaustivity Warning: <console> ------------------------
7 |def m(s: S { val x: T2 }) = s match { case _: T1 => ; }
  |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |                            match may not be exhaustive.
  |
  |                            It would fail on: O

This should hopefully fix such cases. @liufengyun could you please review?

@liufengyun
Copy link
Contributor

LGTM, thanks a lot @AleksanderBG 👍

@liufengyun liufengyun merged commit f20ca3d into scala:master Apr 14, 2017
@abgruszecki abgruszecki deleted the fix-2253 branch April 14, 2017 07:03
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