summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2008-09-04 16:33:51 +0000
committerMartin Odersky <odersky@gmail.com>2008-09-04 16:33:51 +0000
commit3e0cd7e7488477e60eb8d12ffeea1b3dc02433a5 (patch)
tree39e044e9c789277e68c89a72533088dc4190e8d7 /test/files/neg
parent743edeefd44939ada6e81c5936cc04f7c6601931 (diff)
downloadscala-3e0cd7e7488477e60eb8d12ffeea1b3dc02433a5.tar.gz
scala-3e0cd7e7488477e60eb8d12ffeea1b3dc02433a5.tar.bz2
scala-3e0cd7e7488477e60eb8d12ffeea1b3dc02433a5.zip
now checking for volatile types.
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/bug412.check9
-rw-r--r--test/files/neg/bug414.check5
-rw-r--r--test/files/neg/bug692.check14
-rw-r--r--test/files/neg/bug692.scala4
-rw-r--r--test/files/neg/bug961.check7
-rw-r--r--test/files/neg/null-unsoundness.check5
-rw-r--r--test/files/neg/null-unsoundness.scala15
7 files changed, 44 insertions, 15 deletions
diff --git a/test/files/neg/bug412.check b/test/files/neg/bug412.check
index e275c5d271..f25ad6fa7e 100644
--- a/test/files/neg/bug412.check
+++ b/test/files/neg/bug412.check
@@ -1,6 +1,5 @@
-bug412.scala:9: error: type mismatch;
- found : Null(null)
- required: A.this.CX with A.this.C2
- val c: CX with C2 = null;
- ^
+bug412.scala:11: error: stable identifier required, but A.this.c found.
+ Note that value c is not stable because its type, A.this.CX with A.this.C2, is volatile.
+ def castA(x: c.T): T2 = x;
+ ^
one error found
diff --git a/test/files/neg/bug414.check b/test/files/neg/bug414.check
index ec23e26337..c0f039ad26 100644
--- a/test/files/neg/bug414.check
+++ b/test/files/neg/bug414.check
@@ -1,3 +1,7 @@
+bug414.scala:1: warning: case classes without a parameter list have been deprecated;
+use either case objects or case classes with `()' as parameter list.
+case class Empty[a] extends IntMap[a];
+ ^
bug414.scala:5: error: pattern type is incompatible with expected type;
found : object Empty
required: IntMap[a]
@@ -8,4 +12,5 @@ bug414.scala:7: error: type mismatch;
required: a
case _ =>
^
+one warning found
two errors found
diff --git a/test/files/neg/bug692.check b/test/files/neg/bug692.check
index 308048b80a..099a261f42 100644
--- a/test/files/neg/bug692.check
+++ b/test/files/neg/bug692.check
@@ -1,19 +1,19 @@
bug692.scala:3: error: not found: type T
- trait Type[T0] extends Type0[T];
+ trait Type[T0] extends Type0[T];
^
bug692.scala:10: error: class Foo takes type parameters
- case class FooType extends ClassType[Foo,AnyRef](ObjectType());
- ^
+ case class FooType() extends ClassType[Foo,AnyRef](ObjectType());
+ ^
bug692.scala:13: error: class Foo takes type parameters
- case class BarType[T3 <: Foo](tpeT : RefType[T3]) extends ClassType[Bar[T3],Foo](FooType);
+ case class BarType[T3 <: Foo](tpeT : RefType[T3]) extends ClassType[Bar[T3],Foo](FooType);
^
bug692.scala:13: error: class Foo takes type parameters
- case class BarType[T3 <: Foo](tpeT : RefType[T3]) extends ClassType[Bar[T3],Foo](FooType);
+ case class BarType[T3 <: Foo](tpeT : RefType[T3]) extends ClassType[Bar[T3],Foo](FooType);
^
bug692.scala:19: error: class Foo takes type parameters
- class Bar[A <: Foo](implicit tpeA : Type[A]) extends Foo;
+ class Bar[A <: Foo](implicit tpeA : Type[A]) extends Foo;
^
bug692.scala:14: error: class Foo takes type parameters
- implicit def typeOfBar[T4 <: Foo](implicit elem : RefType[T4]) : RefType[Bar[T4]] =
+ implicit def typeOfBar[T4 <: Foo](implicit elem : RefType[T4]) : RefType[Bar[T4]] =
^
6 errors found
diff --git a/test/files/neg/bug692.scala b/test/files/neg/bug692.scala
index 184a14b4b6..24e1d2fea3 100644
--- a/test/files/neg/bug692.scala
+++ b/test/files/neg/bug692.scala
@@ -3,11 +3,11 @@ abstract class test3 {
trait Type[T0] extends Type0[T];
trait ClassType0[+C <: AnyRef] extends Type0[C];
abstract class RefType[C <: AnyRef] extends Type[C];
- case class ObjectType extends RefType[AnyRef];
+ case class ObjectType() extends RefType[AnyRef];
abstract class ClassType[C <: Z, Z <: AnyRef](zuper : RefType[Z]) extends RefType[C];
- case class FooType extends ClassType[Foo,AnyRef](ObjectType());
+ case class FooType() extends ClassType[Foo,AnyRef](ObjectType());
implicit def typeOfFoo = FooType();
case class BarType[T3 <: Foo](tpeT : RefType[T3]) extends ClassType[Bar[T3],Foo](FooType);
diff --git a/test/files/neg/bug961.check b/test/files/neg/bug961.check
index 794acf5519..33bb0559b1 100644
--- a/test/files/neg/bug961.check
+++ b/test/files/neg/bug961.check
@@ -1,4 +1,9 @@
+bug961.scala:4: warning: case classes without a parameter list have been deprecated;
+use either case objects or case classes with `()' as parameter list.
+ private case class B_inner extends A
+ ^
bug961.scala:11: error: Temp.this.B of type object Temp.B does not take parameters
- B() match {
+ B() match {
^
+one warning found
one error found
diff --git a/test/files/neg/null-unsoundness.check b/test/files/neg/null-unsoundness.check
new file mode 100644
index 0000000000..5f28e76d06
--- /dev/null
+++ b/test/files/neg/null-unsoundness.check
@@ -0,0 +1,5 @@
+null-unsoundness.scala:8: error: stable identifier required, but A.this.x found.
+ Note that value x is not stable because its type, A.this.D with A.this.A, is volatile.
+ var y: x.T = new C("abc")
+ ^
+one error found
diff --git a/test/files/neg/null-unsoundness.scala b/test/files/neg/null-unsoundness.scala
new file mode 100644
index 0000000000..d30ff613b1
--- /dev/null
+++ b/test/files/neg/null-unsoundness.scala
@@ -0,0 +1,15 @@
+class B
+class C(x: String) extends B
+
+class A {
+ type A >: Null
+ class D { type T >: C <: B }
+ val x: D with A = null
+ var y: x.T = new C("abc")
+}
+object Test extends A with Application {
+ class C { type T = Int; val x = 1 }
+ type A = C
+ y = 42
+}
+