aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/inferred.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-08-13 11:31:39 +0200
committerMartin Odersky <odersky@gmail.com>2014-08-13 12:05:05 +0200
commit34f73ded3519a1df7d278685f3f33facd00f1c58 (patch)
tree3cf71a8baea0de46c9ca126a1ea2dbd6ea55c731 /tests/pos/inferred.scala
parent3558e07b8f3a604bfd67c721cdec3eb9db29e7eb (diff)
downloaddotty-34f73ded3519a1df7d278685f3f33facd00f1c58.tar.gz
dotty-34f73ded3519a1df7d278685f3f33facd00f1c58.tar.bz2
dotty-34f73ded3519a1df7d278685f3f33facd00f1c58.zip
Fix and enable RefChecks
RefChecks is now enabled. Some of the tests had to be fixed to be refchecks-correct.
Diffstat (limited to 'tests/pos/inferred.scala')
-rw-r--r--tests/pos/inferred.scala26
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/pos/inferred.scala b/tests/pos/inferred.scala
index 525848541..87bbd9473 100644
--- a/tests/pos/inferred.scala
+++ b/tests/pos/inferred.scala
@@ -1,13 +1,13 @@
-class LIST[+T] {
-
+abstract class LIST[+T] {
+
def isEmpty: Boolean
def head: T
def tail: LIST[T]
-
+
def prepend [U >: T] (x: U): LIST[U] = new CONS(x, this)
-
+
def map[U](f: T => U): LIST[U] = if (isEmpty) NIL else tail.map(f).prepend(f(head))
-
+
}
object NIL extends LIST[Nothing] {
@@ -37,22 +37,22 @@ object Inferred {
val nn = bar(NIL)
val ints: LIST[Int] = NIL prepend 1
-
+
val ints1 = NIL prepend 1 prepend 2
val a = if (1 == 0) NIL else ints
-
+
val n2 = scala.collection.immutable.Nil
-
+
val ss2: scala.collection.immutable.List[String] = "abc" :: n2
-
+
val ss3 = "abc" :: n2
-
+
def cl = ((x: Int) => x + 1)
-
+
val ints2 = ints map (_ + 1)
-
+
val ints3 = new CONS[Int](1, NIL)
-
+
val ints4 = new CONS(1, NIL)
} \ No newline at end of file