blob: cbef0968e0a7b010bcf270f501b461e844ef48ff (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
import scala._;
package scalac.util {
trait A {
type X1, X2;
val x1: X1, x2: X2;
}
trait B extends A {
type Y;
val y1: Y, y2: Y;
type X1 = Y, X2 = Y;
val x1 = y1, x2 = y2;
def f(x: Y, xs: B): Unit = {}
def g() = f(y1, this);
}
module test {
val b: B with { type Y = Int } = new B {
type Y = Int;
val y1 = 1, y2 = 1;
}
val a: A with { type X1 = Int, X2 = Int } = b;
val a1 = new A with {
type X1 = Int, X2 = String;
val x1 = 1, x2 = "hello"
}
val b1 = new B with {
type Y = Any;
val y1 = 1, y2 = "hello";
}
}
}
|