aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/pickling/i2166.scala5
-rw-r--r--tests/pos/i2188.scala5
-rw-r--r--tests/pos/i2192.scala7
-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/i2201a.scala8
-rw-r--r--tests/pos/i2201b.scala14
-rw-r--r--tests/pos/i2201c.scala11
9 files changed, 66 insertions, 0 deletions
diff --git a/tests/pickling/i2166.scala b/tests/pickling/i2166.scala
new file mode 100644
index 000000000..7199b7a36
--- /dev/null
+++ b/tests/pickling/i2166.scala
@@ -0,0 +1,5 @@
+object Test {
+ @inline def f = "" match { case _ => false }
+
+ def main(args: Array[String]): Unit = f
+} \ No newline at end of file
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/i2192.scala b/tests/pos/i2192.scala
new file mode 100644
index 000000000..2e85e366e
--- /dev/null
+++ b/tests/pos/i2192.scala
@@ -0,0 +1,7 @@
+object Test {
+ def foo(x: Int): Int = x
+
+ Some(foo): Option[Int => Int]
+ // missing arguments for method foo
+ // follow this method with `_' if you want to treat it as a partially applied function
+}
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/i2201a.scala b/tests/pos/i2201a.scala
new file mode 100644
index 000000000..165f0a76e
--- /dev/null
+++ b/tests/pos/i2201a.scala
@@ -0,0 +1,8 @@
+class Foo[T]
+
+class Fix[F[_]](unfix: F[Fix[F]])
+object DocTree {
+ type Const[T] = Foo[Int]
+ type FixConst = Fix[Const]
+ def docTree(s: Const[FixConst]): FixConst = new Fix(s)
+}
diff --git a/tests/pos/i2201b.scala b/tests/pos/i2201b.scala
new file mode 100644
index 000000000..4aafc0d28
--- /dev/null
+++ b/tests/pos/i2201b.scala
@@ -0,0 +1,14 @@
+trait X
+trait Y
+
+object Test {
+ type One[A <: X, B <: Y]
+
+ type Two[TA <: Y, TB <: X] = One[TB, TA]
+
+ def foo[M[_ <: Y, _ <: X]](x: M[_ <: Y, _ <: X]) = x
+
+ val a: Two[Y, X] = ???
+
+ foo(a)
+}
diff --git a/tests/pos/i2201c.scala b/tests/pos/i2201c.scala
new file mode 100644
index 000000000..91f2529d9
--- /dev/null
+++ b/tests/pos/i2201c.scala
@@ -0,0 +1,11 @@
+object Test {
+ implicit val theAnswer: Int = 42
+
+ type Swap[A, B] = (B, A)
+
+ def foo[M[_, _], T, S](x: M[T, S])(implicit ev: T) = ev
+
+ val a: Swap[Int, String] = ("hi", 1)
+
+ foo(a)
+}