summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2004-08-30 14:18:10 +0000
committerpaltherr <paltherr@epfl.ch>2004-08-30 14:18:10 +0000
commit80cee61ed3569c06b3b3ca4e5a600c94ccc4f6c7 (patch)
treeae15ad052dca97bb781941c91e6b32d7572f27de /test/files/neg
parent97fcb93af10873a96ec0f3ae71c7a14ca860bbd9 (diff)
downloadscala-80cee61ed3569c06b3b3ca4e5a600c94ccc4f6c7.tar.gz
scala-80cee61ed3569c06b3b3ca4e5a600c94ccc4f6c7.tar.bz2
scala-80cee61ed3569c06b3b3ca4e5a600c94ccc4f6c7.zip
- Added tests on blocks
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/tests.check16
-rw-r--r--test/files/neg/tests.scala47
2 files changed, 63 insertions, 0 deletions
diff --git a/test/files/neg/tests.check b/test/files/neg/tests.check
new file mode 100644
index 0000000000..7f1427cf6a
--- /dev/null
+++ b/test/files/neg/tests.check
@@ -0,0 +1,16 @@
+tests.scala:29: package java is not a value
+ {System.out.print(11); java}.lang.System.out.println();
+ ^
+tests.scala:30: package lang is not a value
+ {System.out.print(12); java.lang}.System.out.println();
+ ^
+tests.scala:31: object System is not a value
+ {System.out.print(13); java.lang.System}.out.println();
+ ^
+tests.scala:37: package test0 is not a value
+ {System.out.print(21); test0}.bar.System.out.println();
+ ^
+tests.scala:38: package bar is not a value
+ {System.out.print(22); test0.bar}.System.out.println();
+ ^
+5 errors found
diff --git a/test/files/neg/tests.scala b/test/files/neg/tests.scala
new file mode 100644
index 0000000000..04a72fa222
--- /dev/null
+++ b/test/files/neg/tests.scala
@@ -0,0 +1,47 @@
+//############################################################################
+// Compile Time Errors
+//############################################################################
+// $Id$
+
+import java.lang.System; // to avoid name clash with .NET's library
+
+//############################################################################
+// Test 0 - Block Qualifiers
+
+package test0.bar {
+
+ object System {
+ val out: PrintStream = new PrintStream();
+ }
+
+ class PrintStream() {
+ def println(): Unit = {
+ java.lang.System.out.println();
+ }
+ }
+
+}
+
+object Test0Test {
+
+ def main(args: Array[String]): Unit = {
+ {System.out.print(10)}; java.lang.System.out.println();
+ {System.out.print(11); java}.lang.System.out.println();
+ {System.out.print(12); java.lang}.System.out.println();
+ {System.out.print(13); java.lang.System}.out.println();
+ {System.out.print(14); java.lang.System.out}.println();
+ {System.out.print(15); java.lang.System.out.println:(() => Unit)}();
+ {System.out.print(16); java.lang.System.out.println()};
+
+ {System.out.print(20)}; test0.bar.System.out.println();
+ {System.out.print(21); test0}.bar.System.out.println();
+ {System.out.print(22); test0.bar}.System.out.println();
+ {System.out.print(23); test0.bar.System}.out.println();
+ {System.out.print(24); test0.bar.System.out}.println();
+ {System.out.print(25); test0.bar.System.out.println:(() => Unit)}();
+ {System.out.print(26); test0.bar.System.out.println()};
+ }
+
+}
+
+//############################################################################