aboutsummaryrefslogtreecommitdiff
path: root/tests/disabled/not-representable/pos
diff options
context:
space:
mode:
Diffstat (limited to 'tests/disabled/not-representable/pos')
-rw-r--r--tests/disabled/not-representable/pos/t1357.scala25
-rw-r--r--tests/disabled/not-representable/pos/t1381-new.scala37
-rw-r--r--tests/disabled/not-representable/pos/t1803.flags1
-rw-r--r--tests/disabled/not-representable/pos/t1803.scala3
-rw-r--r--tests/disabled/not-representable/pos/t2066-2.10-compat.scala72
-rw-r--r--tests/disabled/not-representable/pos/t2066.scala25
6 files changed, 163 insertions, 0 deletions
diff --git a/tests/disabled/not-representable/pos/t1357.scala b/tests/disabled/not-representable/pos/t1357.scala
new file mode 100644
index 000000000..4095168d2
--- /dev/null
+++ b/tests/disabled/not-representable/pos/t1357.scala
@@ -0,0 +1,25 @@
+// Existential quantification cannot be expressed, and cannot be eliminated
+// because it's F-bounded. Trying to paramerize BinaryTree with T instead also fails
+// because the type alias cannot be represented
+
+object NonEmptyCons {
+ def unapply[H, T](c: (H, T)): Option[(H, T)] = Some(c)
+}
+
+
+object Main {
+
+ type BT[+H, +T <: Tuple2[Tuple2[H, T], Tuple2[H, T]]] = Tuple2[H, T]
+
+ // type T = Tuple2[String,String]
+ type BinaryTree[+E] = BT[E, T forSome { type T <: Tuple2[BT[E, T], BT[E, T]] }]
+
+ def foo[E](tree: BinaryTree[E]): Unit = tree match {
+ case NonEmptyCons(_, tail) => {
+ tail match {
+ case NonEmptyCons(_, _) => {
+ }
+ }
+ }
+ }
+}
diff --git a/tests/disabled/not-representable/pos/t1381-new.scala b/tests/disabled/not-representable/pos/t1381-new.scala
new file mode 100644
index 000000000..2944b1deb
--- /dev/null
+++ b/tests/disabled/not-representable/pos/t1381-new.scala
@@ -0,0 +1,37 @@
+/* Gives
+
+ t1381-new.scala:6: error: V is not a valid prefix for '#'
+ type E = V#ValueType
+ ^
+ */
+import scala.reflect.runtime.universe._
+
+class D[V <: Variable]
+
+class ID[V<:IV] extends D[V] {
+ type E = V#ValueType
+ def index(value:E) : Int = 0
+ // Comment this out to eliminate crash. Or see below
+ def index(values:E*) : Iterable[Int] = null
+}
+
+abstract class Variable {
+ type VT <: Variable
+ def d : D[VT] = null
+}
+
+abstract class PV[T](initval:T) extends Variable {
+ type VT <: PV[T]
+ type ValueType = T
+}
+
+trait IV extends Variable {
+ type ValueType
+}
+
+abstract class EV[T](initval:T) extends PV[T](initval) with IV {
+ type VT <: EV[T]
+ override def d : ID[VT] = null
+ // Comment this out to eliminate crash
+ protected var indx = d.index(initval)
+}
diff --git a/tests/disabled/not-representable/pos/t1803.flags b/tests/disabled/not-representable/pos/t1803.flags
new file mode 100644
index 000000000..d1a824416
--- /dev/null
+++ b/tests/disabled/not-representable/pos/t1803.flags
@@ -0,0 +1 @@
+-Yinfer-argument-types \ No newline at end of file
diff --git a/tests/disabled/not-representable/pos/t1803.scala b/tests/disabled/not-representable/pos/t1803.scala
new file mode 100644
index 000000000..94b59a480
--- /dev/null
+++ b/tests/disabled/not-representable/pos/t1803.scala
@@ -0,0 +1,3 @@
+// No parameter type inference in Dotty
+class A { def foo[A](a: A) = a }
+class B extends A { override def foo[A](b) = b }
diff --git a/tests/disabled/not-representable/pos/t2066-2.10-compat.scala b/tests/disabled/not-representable/pos/t2066-2.10-compat.scala
new file mode 100644
index 000000000..9cbf0092a
--- /dev/null
+++ b/tests/disabled/not-representable/pos/t2066-2.10-compat.scala
@@ -0,0 +1,72 @@
+import language._
+trait A1 {
+ def f[T[_]] = ()
+}
+
+trait B1 extends A1 {
+ override def f[T[+_]] = ()
+}
+
+trait C1 extends A1 {
+ override def f[T[-_]] = ()
+}
+
+
+trait A2 {
+ def f[T[+_]] = ()
+}
+
+trait B2 extends A2 {
+ override def f[T[_]] = () // okay
+}
+
+trait C2 extends A2 {
+ override def f[T[-_]] = ()
+}
+
+
+trait A3 {
+ def f[T[-_]] = ()
+}
+
+trait B3 extends A3 {
+ override def f[T[_]] = () // okay
+}
+
+// These nested higher-kinded types are not parsable in Dotty=
+trait C3 extends A3 {
+ override def f[T[-_]] = ()
+}
+
+
+trait A4 {
+ def f[T[X[+_]]] = ()
+}
+
+trait B4 extends A4 {
+ override def f[T[X[_]]] = ()
+}
+
+trait A5 {
+ def f[T[X[-_]]] = ()
+}
+
+trait B5 extends A5 {
+ override def f[T[X[_]]] = ()
+}
+
+
+
+trait A6 {
+ def f[T[X[_]]] = ()
+}
+
+trait B6 extends A6 {
+ override def f[T[X[+_]]] = () // okay
+}
+trait C6 extends A6 {
+ override def f[T[X[_]]] = () // okay
+}
+trait D6 extends A6 {
+ override def f[T[X[-_]]] = ()
+}
diff --git a/tests/disabled/not-representable/pos/t2066.scala b/tests/disabled/not-representable/pos/t2066.scala
new file mode 100644
index 000000000..30cb99d45
--- /dev/null
+++ b/tests/disabled/not-representable/pos/t2066.scala
@@ -0,0 +1,25 @@
+trait A1 {
+ def f[T[+_]] = ()
+}
+
+trait B1 extends A1 {
+ override def f[T[_]] = ()
+}
+
+
+trait A2 {
+ def f[T[-_]] = ()
+}
+
+trait B2 extends A2 {
+ override def f[T[_]] = ()
+}
+
+
+trait A3 {
+ def f[T[X[_]]] = ()
+}
+
+trait B3 extends A3 {
+ override def f[T[X[+_]]] = ()
+}