aboutsummaryrefslogtreecommitdiff
path: root/tests/pos
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pos')
-rw-r--r--tests/pos/i2188.scala5
-rw-r--r--tests/pos/i2198.scala6
-rw-r--r--tests/pos/i2200/Hello.scala6
-rw-r--r--tests/pos/i2200/package.scala4
-rw-r--r--tests/pos/i2218.scala9
-rw-r--r--tests/pos/i2219.scala7
-rw-r--r--tests/pos/t7296.scala7
7 files changed, 44 insertions, 0 deletions
diff --git a/tests/pos/i2188.scala b/tests/pos/i2188.scala
new file mode 100644
index 000000000..4129977ac
--- /dev/null
+++ b/tests/pos/i2188.scala
@@ -0,0 +1,5 @@
+class Fill(elem: => Int) {
+ class Iter {
+ def next(): Int = elem
+ }
+}
diff --git a/tests/pos/i2198.scala b/tests/pos/i2198.scala
new file mode 100644
index 000000000..62ae7e8b5
--- /dev/null
+++ b/tests/pos/i2198.scala
@@ -0,0 +1,6 @@
+object Test {
+ val nil = scala.collection.immutable.Nil
+ def f(x: nil.type): Int = 3
+
+ f(scala.collection.immutable.Nil)
+}
diff --git a/tests/pos/i2200/Hello.scala b/tests/pos/i2200/Hello.scala
new file mode 100644
index 000000000..47e8b2024
--- /dev/null
+++ b/tests/pos/i2200/Hello.scala
@@ -0,0 +1,6 @@
+package bar
+import scala.language.higherKinds
+class Fix[F[_]](unfix: F[Fix[F]])
+object DocTree {
+ def docTree(s: StreamTree[DocTree]): DocTree = new Fix(s: StreamTree[DocTree])
+}
diff --git a/tests/pos/i2200/package.scala b/tests/pos/i2200/package.scala
new file mode 100644
index 000000000..3bc519b72
--- /dev/null
+++ b/tests/pos/i2200/package.scala
@@ -0,0 +1,4 @@
+package object bar {
+ type StreamTree[T] = Stream[Int]
+ type DocTree = Fix[StreamTree]
+}
diff --git a/tests/pos/i2218.scala b/tests/pos/i2218.scala
new file mode 100644
index 000000000..fbede8b9b
--- /dev/null
+++ b/tests/pos/i2218.scala
@@ -0,0 +1,9 @@
+trait Rule[In]
+
+class C {
+ def ruleWithName[In](f: In => Int): Rule[In] = {
+ new DefaultRule(f) {}
+ }
+
+ class DefaultRule[In](f: In => Int) extends Rule[In]
+}
diff --git a/tests/pos/i2219.scala b/tests/pos/i2219.scala
new file mode 100644
index 000000000..7f786eb3e
--- /dev/null
+++ b/tests/pos/i2219.scala
@@ -0,0 +1,7 @@
+object Test {
+ type Inv[T[_]] = T[_]
+
+ class Hi[T[_]](x: Inv[T]) {
+ def foo[T[_]](value: Inv[T] = x) = {}
+ }
+}
diff --git a/tests/pos/t7296.scala b/tests/pos/t7296.scala
new file mode 100644
index 000000000..fcba17c08
--- /dev/null
+++ b/tests/pos/t7296.scala
@@ -0,0 +1,7 @@
+// Fails Ycheck
+object Test {
+ type A = Int
+ // Emits the implementation restriction but then proceeds to crash
+ // when creating the Foo.unapply.
+ case class Foo(a: A, b: A, c: A, d: A, e: A, f: A, g: A, h: A, i: A, j: A, k: A, l: A, m: A, n: A, o: A, p: A, q: A, r: A, s: A, t: A, u: A, v: A, w: A, x: A, y: A, Z: A)
+}