We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9e05fdf + 1518487 commit 8d324c6Copy full SHA for 8d324c6
tests/run/9416.scala
@@ -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