-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4950 from abeln/unreachable2
Add additional test case for #4661
- Loading branch information
Showing
2 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
10: Pattern Match Exhaustivity: _: c.Foo | ||
13: Match case Unreachable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
class C { | ||
trait Foo | ||
class One extends Foo | ||
class Two extends Foo | ||
class Bla extends One | ||
} | ||
|
||
class Test(val c: C) { | ||
import c._ | ||
def test(f: Foo) = f match { // not exhaustive | ||
case f: One => | ||
case f: Two => | ||
case f: Bla => // unreachable case | ||
} | ||
} |