Skip to content

Commit 1518487

Browse files
Fix #9416: Add regression test
1 parent 7b9ea5c commit 1518487

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/run/9416.scala

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
trait Base[D <: Domain] {
2+
def f(pp: Extract[D]): Unit
3+
}
4+
5+
class Ext extends Base[ExtDomain] {
6+
def f(pp: String) = println(pp.length)
7+
}
8+
9+
type Domain
10+
type DomainImpl[T] <: Domain
11+
type ExtDomain = DomainImpl[String]
12+
13+
type Extract[X] = X match { case DomainImpl[t] => t }
14+
15+
object Test {
16+
def main(args: Array[String]): Unit = {
17+
def f[M <: Domain](rc: Base[M], v: Extract[M]): Unit = rc.f(v)
18+
f(new Ext, "foo")
19+
}
20+
}

0 commit comments

Comments
 (0)