summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2009-02-23 19:21:05 +0000
committerMartin Odersky <odersky@gmail.com>2009-02-23 19:21:05 +0000
commitbf35b888e49afb245883571cc00cbb5ec7341f24 (patch)
tree8c060484dde8c122f1d65fceedf0dd962a4ad90c /test
parenta4baf48a5fb38f29d462accc57f93032955efa0e (diff)
downloadscala-bf35b888e49afb245883571cc00cbb5ec7341f24.tar.gz
scala-bf35b888e49afb245883571cc00cbb5ec7341f24.tar.bz2
scala-bf35b888e49afb245883571cc00cbb5ec7341f24.zip
fixed several problems with cyclic references u...
fixed several problems with cyclic references uncovered by experimenting with collections. Added early type definitions.
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/cyclics.check10
-rw-r--r--test/files/neg/cyclics.scala6
-rw-r--r--test/files/neg/t0015.check7
-rw-r--r--test/files/neg/t0015.scala2
-rw-r--r--test/files/pos/bug1279a.scala (renamed from test/files/neg/bug1279a.scala)0
-rw-r--r--test/files/pos/t0674.scala7
6 files changed, 22 insertions, 10 deletions
diff --git a/test/files/neg/cyclics.check b/test/files/neg/cyclics.check
new file mode 100644
index 0000000000..c240387d2f
--- /dev/null
+++ b/test/files/neg/cyclics.check
@@ -0,0 +1,10 @@
+cyclics.scala:2: error: illegal cyclic reference involving type A
+ type A = List[A]
+ ^
+cyclics.scala:3: error: illegal cyclic reference involving type B
+ type B[T] = List[B[B[T]]]
+ ^
+cyclics.scala:5: error: illegal cyclic reference involving type E
+ type C = I { type E = C }
+ ^
+three errors found
diff --git a/test/files/neg/cyclics.scala b/test/files/neg/cyclics.scala
new file mode 100644
index 0000000000..adfc94e4e5
--- /dev/null
+++ b/test/files/neg/cyclics.scala
@@ -0,0 +1,6 @@
+object test {
+ type A = List[A]
+ type B[T] = List[B[B[T]]]
+ trait I { type E }
+ type C = I { type E = C }
+}
diff --git a/test/files/neg/t0015.check b/test/files/neg/t0015.check
index 2979237c0a..eb25fc46c8 100644
--- a/test/files/neg/t0015.check
+++ b/test/files/neg/t0015.check
@@ -3,9 +3,4 @@ t0015.scala:5: error: type mismatch;
required: (Nothing) => ?
Nil.map(f _)
^
-t0015.scala:21: error: type mismatch;
- found : M
- required: M.this.selfType
- f[Int](self: selfType)
- ^
-two errors found
+one error found
diff --git a/test/files/neg/t0015.scala b/test/files/neg/t0015.scala
index 35a6cd11fc..225197f950 100644
--- a/test/files/neg/t0015.scala
+++ b/test/files/neg/t0015.scala
@@ -18,7 +18,7 @@ abstract class M
// compiles successfully
//f[Int](self: actualSelfType)
- f[Int](self: selfType)
+ f[Int](self: selfType) // compiles Ok now was well, because we narrow to singletonType in this situation
//def g(x: Any) = {}
//g(self: selfType)
diff --git a/test/files/neg/bug1279a.scala b/test/files/pos/bug1279a.scala
index 7568d3afcd..7568d3afcd 100644
--- a/test/files/neg/bug1279a.scala
+++ b/test/files/pos/bug1279a.scala
diff --git a/test/files/pos/t0674.scala b/test/files/pos/t0674.scala
index 2bd9d9a9db..c3d2cc7476 100644
--- a/test/files/pos/t0674.scala
+++ b/test/files/pos/t0674.scala
@@ -41,7 +41,8 @@ for(a <- Some(1);
n <- Some(14);
o <- Some(15);
p <- Some(16);
- q <- Some(17);
- r <- Some(18);
- s <- Some(19)) yield a)
+ q <- Some(17)
+// r <- Some(18);
+// s <- Some(19)
+ ) yield a)
}