Skip to content

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