aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/pos/t6084.scala
diff options
context:
space:
mode:
authorSamuel Gruetter <samuel.gruetter@epfl.ch>2014-03-12 22:44:33 +0100
committerSamuel Gruetter <samuel.gruetter@epfl.ch>2014-03-12 22:44:33 +0100
commit9ef5f6817688f814a3450126aa7383b0928e80a0 (patch)
tree5727a2f7f7fd665cefdb312af2785c692f04377c /tests/untried/pos/t6084.scala
parent194be919664447631ba55446eb4874979c908d27 (diff)
downloaddotty-9ef5f6817688f814a3450126aa7383b0928e80a0.tar.gz
dotty-9ef5f6817688f814a3450126aa7383b0928e80a0.tar.bz2
dotty-9ef5f6817688f814a3450126aa7383b0928e80a0.zip
add tests from scala/test/files/{pos,neg}
with explicit Unit return type
Diffstat (limited to 'tests/untried/pos/t6084.scala')
-rw-r--r--tests/untried/pos/t6084.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/untried/pos/t6084.scala b/tests/untried/pos/t6084.scala
new file mode 100644
index 000000000..1aa1fed39
--- /dev/null
+++ b/tests/untried/pos/t6084.scala
@@ -0,0 +1,15 @@
+package object foo { type X[T, U] = (T => U) }
+
+package foo {
+ abstract class Foo[T, U](val d: T => U) extends (T => U) {
+ def f1(r: X[T, U]) = r match { case x: Foo[_,_] => x.d } // inferred ok
+ def f2(r: X[T, U]): (T => U) = r match { case x: Foo[_,_] => x.d } // dealiased ok
+ def f3(r: X[T, U]): X[T, U] = r match { case x: Foo[_,_] => x.d } // alias not ok
+
+ // x.d : foo.this.package.type.X[?scala.reflect.internal.Types$NoPrefix$?.T, ?scala.reflect.internal.Types$NoPrefix$?.U] ~>scala.this.Function1[?scala.reflect.internal.Types$NoPrefix$?.T, ?scala.reflect.internal.Types$NoPrefix$?.U]
+ // at scala.Predef$.assert(Predef.scala:170)
+ // at scala.tools.nsc.Global.assert(Global.scala:235)
+ // at scala.tools.nsc.ast.TreeGen.mkCast(TreeGen.scala:252)
+ // at scala.tools.nsc.typechecker.Typers$Typer.typedCase(Typers.scala:2263)
+ }
+}