Skip to content
This repository was archived by the owner on Sep 1, 2020. It is now read-only.

Commit 79e3cf3

Browse files
author
Adriaan Moors
committed
Merge pull request scala#591 from retronym/ticket/3888
Test case closes SI-3880.
2 parents 1cd9f5b + d046b9a commit 79e3cf3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/files/pos/t3880.scala

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
abstract class Bar[+B] {
2+
}
3+
abstract class C1[+B] extends Bar[B] {
4+
private[this] def g(x: C1[B]): Unit = ()
5+
6+
// this method is fine: notice that it allows the call to g,
7+
// which requires C1[B], even though we matched on C1[_].
8+
// (That is good news.)
9+
private[this] def f1(x: Bar[B]): Unit = x match {
10+
case x: C1[_] => g(x)
11+
}
12+
// this one crashes.
13+
private[this] def f2(x: Bar[B]): Unit = x match {
14+
case x: C1[_] => f2(x)
15+
}
16+
}

0 commit comments

Comments
 (0)