aboutsummaryrefslogtreecommitdiff
path: root/tests/pending
diff options
context:
space:
mode:
authorodersky <odersky@gmail.com>2015-01-31 19:19:07 +0100
committerodersky <odersky@gmail.com>2015-01-31 19:19:07 +0100
commita822fc15235d9cc91302bd82d180830eff357ae2 (patch)
tree3bd15eecb77b1fca0b944ba5f203ba6f5c41a582 /tests/pending
parent537c53b2eba195317f0e7f0ede0cf3fdbd80e790 (diff)
parent70e55d26100199b99502705233786bbdc15c4c6b (diff)
downloaddotty-a822fc15235d9cc91302bd82d180830eff357ae2.tar.gz
dotty-a822fc15235d9cc91302bd82d180830eff357ae2.tar.bz2
dotty-a822fc15235d9cc91302bd82d180830eff357ae2.zip
Merge pull request #331 from dotty-staging/fix/refined-subtyping
Fix/refined subtyping
Diffstat (limited to 'tests/pending')
-rw-r--r--tests/pending/pos/bounds.scala11
-rw-r--r--tests/pending/pos/caseClassInMethod.scala5
-rw-r--r--tests/pending/pos/channels.scala4
-rw-r--r--tests/pending/pos/class-dependent-extension-method.scala3
-rw-r--r--tests/pending/pos/compound.scala9
-rw-r--r--tests/pending/pos/subtypcycle.scala10
-rw-r--r--tests/pending/pos/t1208.scala7
-rw-r--r--tests/pending/pos/t2624.scala4
-rw-r--r--tests/pending/pos/t267.scala55
9 files changed, 13 insertions, 95 deletions
diff --git a/tests/pending/pos/bounds.scala b/tests/pending/pos/bounds.scala
deleted file mode 100644
index 26bc84a1b..000000000
--- a/tests/pending/pos/bounds.scala
+++ /dev/null
@@ -1,11 +0,0 @@
-trait Map[A, +C] {
- def ++ [B1 >: C] (kvs: Iterable[Tuple2[A, B1]]): Map[A, B1] = this
- def ++ [B1 >: C] (kvs: Iterator[Tuple2[A, B1]]): Map[A, B1] = this
-}
-
-class ListMap[A, +B] extends Map[A, B] {}
-
-object ListMap {
- def empty[X, Y] = new ListMap[X, Y]
- def apply[A1, B2](elems: Tuple2[A1, B2]*): Map[A1, B2] = empty[A1,B2].++(elems.iterator)
-}
diff --git a/tests/pending/pos/caseClassInMethod.scala b/tests/pending/pos/caseClassInMethod.scala
deleted file mode 100644
index 958e5dd47..000000000
--- a/tests/pending/pos/caseClassInMethod.scala
+++ /dev/null
@@ -1,5 +0,0 @@
-object t {
- def f = { object C; case class C(); 1 }
- // pending: def g = { case class D(x: Int); object D; 2 }
- def h = { case class E(y: Int = 10); 3 }
-}
diff --git a/tests/pending/pos/channels.scala b/tests/pending/pos/channels.scala
index b2f0cdc32..77736305f 100644
--- a/tests/pending/pos/channels.scala
+++ b/tests/pending/pos/channels.scala
@@ -1,3 +1,5 @@
+// To compile this test, we need some more elaborate GADT capabilities.
+// Not sure yet we should invest to get them.
class Channel[a]
import collection.mutable.Set
@@ -16,7 +18,7 @@ object Test extends App {
def f[b](x: ![b]): Int = x match {
case send: ![c] =>
send.chan match {
- case IC => send.data
+ case IC => send.data // Here, from the fact that `chan` is an IC, we need to conclude that `c` is Int.
}
}
}
diff --git a/tests/pending/pos/class-dependent-extension-method.scala b/tests/pending/pos/class-dependent-extension-method.scala
deleted file mode 100644
index b557dfa8f..000000000
--- a/tests/pending/pos/class-dependent-extension-method.scala
+++ /dev/null
@@ -1,3 +0,0 @@
-class C(val a: String) extends AnyVal {
- def foo[U <: a.type]: Unit = foo[U]
-}
diff --git a/tests/pending/pos/compound.scala b/tests/pending/pos/compound.scala
deleted file mode 100644
index 60890f910..000000000
--- a/tests/pending/pos/compound.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-abstract class A { type T }
-
-abstract class B { val xz: Any }
-
-abstract class Test {
- var yy: A with B { type T; val xz: T } = null;
- var xx: A with B { type T; val xz: T } = null;
- xx = yy;
-}
diff --git a/tests/pending/pos/subtypcycle.scala b/tests/pending/pos/subtypcycle.scala
new file mode 100644
index 000000000..76eb7ffec
--- /dev/null
+++ b/tests/pending/pos/subtypcycle.scala
@@ -0,0 +1,10 @@
+object subtypcycle {
+ trait Y {
+ type A <: { type T >: B }
+ type B >: { type T >: A }
+ }
+
+ val y: Y = ???
+ val a: y.A = ???
+ val b: y.B = a
+}
diff --git a/tests/pending/pos/t1208.scala b/tests/pending/pos/t1208.scala
deleted file mode 100644
index 7b14aadca..000000000
--- a/tests/pending/pos/t1208.scala
+++ /dev/null
@@ -1,7 +0,0 @@
-object Test {
- object Foo
- val f: Option[Foo.type] = Some(Foo)
-}
-
-// unsupported with current typing rules.
-// on the other hand, we need a way to refer to a module class.
diff --git a/tests/pending/pos/t2624.scala b/tests/pending/pos/t2624.scala
deleted file mode 100644
index 76f0e3036..000000000
--- a/tests/pending/pos/t2624.scala
+++ /dev/null
@@ -1,4 +0,0 @@
-object Test {
- List(1).map(identity(_))
- List(1).map(identity) // this didn't typecheck before the fix
-}
diff --git a/tests/pending/pos/t267.scala b/tests/pending/pos/t267.scala
deleted file mode 100644
index 7e5876eae..000000000
--- a/tests/pending/pos/t267.scala
+++ /dev/null
@@ -1,55 +0,0 @@
-package expAbstractData
-
-/** A base class consisting of
- * - a root trait (i.e. abstract class) `Exp' with an `eval' function
- * - an abstract type `exp' bounded by `Exp'
- * - a concrete instance class `Num' of `Exp' for numeric literals
- */
-trait Base {
- type exp <: Exp
-
- trait Exp {
- def eval: Int
- }
- class Num(v: Int) extends Exp { self: exp =>
- val value = v
- def eval = value
- }
-}
-
-object testBase extends App with Base {
- type exp = Exp
- val term = new Num(2);
- Console.println(term.eval)
-}
-
-/** Data extension: An extension of `Base' with `Plus' expressions
- */
-trait BasePlus extends Base {
- class Plus(l: exp, r: exp) extends Exp { self: exp =>
- val left = l
- val right = r
- def eval = left.eval + right.eval
- }
-}
-
-/** Operation extension: An extension of `Base' with 'show' methods.
- */
-trait Show extends Base {
- type exp <: Exp1
-
- trait Exp1 extends Exp {
- def show: String
- }
- class Num1(v: Int) extends Num(v) with Exp1 { self: exp with Num1 =>
- def show = value.toString()
- }
-}
-
-/** Operation extension: An extension of `BasePlus' with 'show' methods.
- */
-trait ShowPlus extends BasePlus with Show {
- class Plus1(l: exp, r: exp) extends Plus(l, r) with Exp1 { self: exp with Plus1 =>
- def show = left.show + " + " + right.show
- }
-}