summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2006-03-09 15:32:43 +0000
committerMartin Odersky <odersky@gmail.com>2006-03-09 15:32:43 +0000
commit718cc9060ce80af502040d426e67bf2f333ff482 (patch)
treeaa84cd6ca2b67272ed2dd8491a3b47f846c1a509 /test/files/neg
parent719588d17415f4958571be1774948a4d4fd3fadf (diff)
downloadscala-718cc9060ce80af502040d426e67bf2f333ff482.tar.gz
scala-718cc9060ce80af502040d426e67bf2f333ff482.tar.bz2
scala-718cc9060ce80af502040d426e67bf2f333ff482.zip
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/bug85.check7
-rw-r--r--test/files/neg/constrs.check18
-rw-r--r--test/files/neg/constrs.scala19
3 files changed, 38 insertions, 6 deletions
diff --git a/test/files/neg/bug85.check b/test/files/neg/bug85.check
index 2e48792d5a..d4d56d3295 100644
--- a/test/files/neg/bug85.check
+++ b/test/files/neg/bug85.check
@@ -1,11 +1,6 @@
-bug85.scala:6 error: type mismatch;
- found : A.this.C
- required: A.this.B#C
- val b: B = new B(new C());
- ^
bug85.scala:7 error: type mismatch;
found : A.this.b.C
required: A.this.C
val c: C = b.c;
^
-two errors found
+one error found
diff --git a/test/files/neg/constrs.check b/test/files/neg/constrs.check
new file mode 100644
index 0000000000..7b7365ea00
--- /dev/null
+++ b/test/files/neg/constrs.check
@@ -0,0 +1,18 @@
+constrs.scala:6 error: type T is not a member of test
+ def this(y: int)(z: int)(t: this.T) = { this(this.u + y + z); System.out.println(x) }
+ ^
+constrs.scala:6 error: value u is not a member of test
+ def this(y: int)(z: int)(t: this.T) = { this(this.u + y + z); System.out.println(x) }
+ ^
+constrs.scala:10 error: called constructor must precede calling constructor
+ def this() = this("abc")
+ ^
+constrs.scala:12 error: called constructor must precede calling constructor
+ def this(x: boolean) = this(x)
+ ^
+constrs.scala:16 error: type mismatch;
+ found : scala.Int(1)
+ required: a
+ def this() = this(1)
+ ^
+5 errors found
diff --git a/test/files/neg/constrs.scala b/test/files/neg/constrs.scala
new file mode 100644
index 0000000000..5c4ac071e8
--- /dev/null
+++ b/test/files/neg/constrs.scala
@@ -0,0 +1,19 @@
+object test {
+
+ abstract class Test(x: int) {
+ type T;
+ val u = x;
+ def this(y: int)(z: int)(t: this.T) = { this(this.u + y + z); System.out.println(x) }
+ }
+
+ class Foo(x: int) {
+ def this() = this("abc")
+ def this(x: String) = this(1)
+ def this(x: boolean) = this(x)
+ }
+
+ class Bar[a](x: a) {
+ def this() = this(1)
+ }
+
+}