summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/pos/t8060.scala11
-rw-r--r--test/files/run/t7912.scala16
2 files changed, 27 insertions, 0 deletions
diff --git a/test/files/pos/t8060.scala b/test/files/pos/t8060.scala
new file mode 100644
index 0000000000..90e014d74b
--- /dev/null
+++ b/test/files/pos/t8060.scala
@@ -0,0 +1,11 @@
+trait M[F[_]]
+
+trait P[A] {
+ type CC[X] = P[X]
+ def f(p: A => Boolean): M[CC]
+}
+
+trait Other {
+ // was infinite loop trying to dealias `x$1.CC`
+ def g[A](p: A => Boolean): P[A] => M[P] = _ f p
+}
diff --git a/test/files/run/t7912.scala b/test/files/run/t7912.scala
new file mode 100644
index 0000000000..3d603e0e97
--- /dev/null
+++ b/test/files/run/t7912.scala
@@ -0,0 +1,16 @@
+case object A { override def toString = ??? }
+
+object Test {
+ def foo: Int = (A: Any) match {
+ case 0 => 0
+ }
+ def main(args: Array[String]): Unit = {
+ try {
+ foo
+ sys.error("no exception")
+ } catch {
+ case me: MatchError => assert(me.getMessage == "an instance of class A$", me.getMessage)
+ case ex: Throwable => sys.error("not a match error: " + ex.getClass)
+ }
+ }
+}