summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2003-03-07 16:50:21 +0000
committerMartin Odersky <odersky@gmail.com>2003-03-07 16:50:21 +0000
commitaac15cfe1ca11cea138b7463481f4a2b600999d7 (patch)
treefb1c9af2d44b38f39bcd40f2661e23d21a160a4b /test
parent14bc0c4f0df23f78fcd143a719113b1c1c37c4ea (diff)
downloadscala-aac15cfe1ca11cea138b7463481f4a2b600999d7.tar.gz
scala-aac15cfe1ca11cea138b7463481f4a2b600999d7.tar.bz2
scala-aac15cfe1ca11cea138b7463481f4a2b600999d7.zip
*** empty log message ***
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/constrparams.scala6
-rw-r--r--test/files/pos/aliases.scala21
-rw-r--r--test/files/pos/null.scala3
-rw-r--r--test/neg/constrparams.scala6
-rw-r--r--test/pos/aliases.scala21
-rw-r--r--test/pos/null.scala3
6 files changed, 60 insertions, 0 deletions
diff --git a/test/files/neg/constrparams.scala b/test/files/neg/constrparams.scala
new file mode 100644
index 0000000000..f6b037b312
--- /dev/null
+++ b/test/files/neg/constrparams.scala
@@ -0,0 +1,6 @@
+abstract class C(x: C) {
+ type t;
+ private val y: x.type = x;
+ private val z: x.t = null; //error
+}
+
diff --git a/test/files/pos/aliases.scala b/test/files/pos/aliases.scala
new file mode 100644
index 0000000000..bcca90d99d
--- /dev/null
+++ b/test/files/pos/aliases.scala
@@ -0,0 +1,21 @@
+abstract class C() {
+
+ type t <: C;
+
+ val x: t;
+ val y: x.type;
+ val z: x.type;
+
+ val xt: x.t;
+ val yt: y.t;
+ val zt: z.t;
+
+ def fx(a: x.t): Unit;
+ def fy(a: y.t): Unit;
+ def fz(a: z.t): Unit;
+
+ fx(xt); fx(yt); fx(zt);
+ fy(xt); fy(yt); fy(zt);
+ fz(xt); fz(yt); fz(zt);
+
+}
diff --git a/test/files/pos/null.scala b/test/files/pos/null.scala
new file mode 100644
index 0000000000..54a2c0f995
--- /dev/null
+++ b/test/files/pos/null.scala
@@ -0,0 +1,3 @@
+module M {
+ val x: Boolean = null == null;
+} \ No newline at end of file
diff --git a/test/neg/constrparams.scala b/test/neg/constrparams.scala
new file mode 100644
index 0000000000..f6b037b312
--- /dev/null
+++ b/test/neg/constrparams.scala
@@ -0,0 +1,6 @@
+abstract class C(x: C) {
+ type t;
+ private val y: x.type = x;
+ private val z: x.t = null; //error
+}
+
diff --git a/test/pos/aliases.scala b/test/pos/aliases.scala
new file mode 100644
index 0000000000..bcca90d99d
--- /dev/null
+++ b/test/pos/aliases.scala
@@ -0,0 +1,21 @@
+abstract class C() {
+
+ type t <: C;
+
+ val x: t;
+ val y: x.type;
+ val z: x.type;
+
+ val xt: x.t;
+ val yt: y.t;
+ val zt: z.t;
+
+ def fx(a: x.t): Unit;
+ def fy(a: y.t): Unit;
+ def fz(a: z.t): Unit;
+
+ fx(xt); fx(yt); fx(zt);
+ fy(xt); fy(yt); fy(zt);
+ fz(xt); fz(yt); fz(zt);
+
+}
diff --git a/test/pos/null.scala b/test/pos/null.scala
new file mode 100644
index 0000000000..54a2c0f995
--- /dev/null
+++ b/test/pos/null.scala
@@ -0,0 +1,3 @@
+module M {
+ val x: Boolean = null == null;
+} \ No newline at end of file