aboutsummaryrefslogtreecommitdiff
path: root/tests/pos
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pos')
-rw-r--r--tests/pos/conformsWild.scala11
-rw-r--r--tests/pos/hkgadt.scala9
-rw-r--r--tests/pos/i1181b.scala11
-rw-r--r--tests/pos/i1181c.scala11
-rw-r--r--tests/pos/i618.scala3
-rw-r--r--tests/pos/t2660.scala43
6 files changed, 88 insertions, 0 deletions
diff --git a/tests/pos/conformsWild.scala b/tests/pos/conformsWild.scala
new file mode 100644
index 000000000..cfc10d92d
--- /dev/null
+++ b/tests/pos/conformsWild.scala
@@ -0,0 +1,11 @@
+object Test {
+
+ val x: Function1[_, _] = (x: String) => 1
+
+ val y: Function1[_, _] = x => 1
+ val y0: Function1[_, _] = x => x
+ val y1: Function1[_, Nothing] = x => x
+
+ val z: (_, _) = (1, 2)
+
+}
diff --git a/tests/pos/hkgadt.scala b/tests/pos/hkgadt.scala
new file mode 100644
index 000000000..ac8caa6f3
--- /dev/null
+++ b/tests/pos/hkgadt.scala
@@ -0,0 +1,9 @@
+object HKGADT {
+ sealed trait Foo[F[_]]
+ final case class Bar() extends Foo[List]
+
+ def frob[F[_]](foo: Foo[F]) =
+ foo match {
+ case Bar() => ()
+ }
+}
diff --git a/tests/pos/i1181b.scala b/tests/pos/i1181b.scala
new file mode 100644
index 000000000..7694aed0b
--- /dev/null
+++ b/tests/pos/i1181b.scala
@@ -0,0 +1,11 @@
+class Foo[A]
+
+object Test {
+ def foo[M[_,_]](x: M[Int,Int]) = x
+
+ type Alias[X,Y] = Foo[X]
+ val x: Alias[Int,Int] = new Foo[Int]
+
+ foo[Alias](x) // ok
+ foo(x)
+}
diff --git a/tests/pos/i1181c.scala b/tests/pos/i1181c.scala
new file mode 100644
index 000000000..940629259
--- /dev/null
+++ b/tests/pos/i1181c.scala
@@ -0,0 +1,11 @@
+class Foo[A]
+
+trait Bar[DD[_,_]] {
+ val x: DD[Int, Int]
+}
+
+trait Baz extends Bar[[X,Y] -> Foo[X]] {
+ def foo[M[_,_]](x: M[Int, Int]) = x
+
+ foo(x)
+}
diff --git a/tests/pos/i618.scala b/tests/pos/i618.scala
new file mode 100644
index 000000000..70be56cc2
--- /dev/null
+++ b/tests/pos/i618.scala
@@ -0,0 +1,3 @@
+class C(val f: Any*)
+
+class D(override val f: Nothing) extends C(f)
diff --git a/tests/pos/t2660.scala b/tests/pos/t2660.scala
new file mode 100644
index 000000000..695db67b9
--- /dev/null
+++ b/tests/pos/t2660.scala
@@ -0,0 +1,43 @@
+package hoho
+
+class G
+
+class H extends G
+
+class A[T](x: T) {
+
+ def this(y: G, z: T) = {
+ this(z)
+ print(1)
+ }
+
+ def this(z: H, h: T) = {
+ this(h)
+ print(2)
+ }
+}
+
+object T {
+ def main(args: Array[String]): Unit = {
+ implicit def g2h(g: G): H = new H
+ new A[Int](new H, 23)
+ }
+}
+
+
+// A version of t2660 which does not use constructors
+
+object X {
+ def f[T](x: T) = ???
+ def f[T](y: G, z: T) = ???
+ def f[T](z: H, h: T) = ???
+}
+
+object T2 {
+ def main(args: Array[String]): Unit = {
+ implicit def g2h(g: G): H = new H
+ X.f(new H, 23)
+ }
+}
+
+