aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/pos/t319.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/untried/pos/t319.scala')
-rw-r--r--tests/untried/pos/t319.scala21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/untried/pos/t319.scala b/tests/untried/pos/t319.scala
new file mode 100644
index 000000000..eed25eb84
--- /dev/null
+++ b/tests/untried/pos/t319.scala
@@ -0,0 +1,21 @@
+object test {
+
+ trait A { type T; }
+
+ trait B { type T; }
+
+ /** def functor(x: A): B { type T = x.T } */
+ abstract class functor() {
+ val arg: A;
+ val res: B { type T = arg.T } =
+ new B { type T = arg.T; };
+ }
+
+ val a = new A { type T = String };
+ /** val b: B { type T = String } = functor(a) */
+ val b: B { type T = String } = {
+ val tmp = new functor() { val arg = a };
+ tmp.res
+ }
+
+}