Skip to content

Add additional test case for #4661 #4950

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
Aug 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/patmat/t4661b.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
10: Pattern Match Exhaustivity: _: c.Foo
13: Match case Unreachable
15 changes: 15 additions & 0 deletions tests/patmat/t4661b.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class C {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The convention is to prefix the test file name by i. The tests starting with t are the ones that come from scalac IIRC

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
}
}