summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2013-12-17 20:26:50 -0800
committerSom Snytt <som.snytt@gmail.com>2014-01-08 07:43:42 -0800
commitbb2e99a69201060b88dd25602def42f31ba9ab65 (patch)
tree7a3e3a16a0a5e9ee7221f26a6ec50464856989a3 /test/files/neg
parentada8d9156baad2d8a24c1a40e032eb4bc7154bac (diff)
downloadscala-bb2e99a69201060b88dd25602def42f31ba9ab65.tar.gz
scala-bb2e99a69201060b88dd25602def42f31ba9ab65.tar.bz2
scala-bb2e99a69201060b88dd25602def42f31ba9ab65.zip
SI-8015 Count lines by EOLs
Source lines were counted by "line break chars", including FF. Clients of `pos.line` seem to all expect the ordinary line num, so that is what they get. Unicode processing now precedes line ending processing.
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/t8015-ffa.check6
-rw-r--r--test/files/neg/t8015-ffa.scala8
-rw-r--r--test/files/neg/t8015-ffb.check6
-rw-r--r--test/files/neg/t8015-ffb.flags1
-rw-r--r--test/files/neg/t8015-ffb.scala11
5 files changed, 32 insertions, 0 deletions
diff --git a/test/files/neg/t8015-ffa.check b/test/files/neg/t8015-ffa.check
new file mode 100644
index 0000000000..0f28be7fe7
--- /dev/null
+++ b/test/files/neg/t8015-ffa.check
@@ -0,0 +1,6 @@
+t8015-ffa.scala:7: error: type mismatch;
+ found : String("3")
+ required: Int
+ val i: Int = "3" // error line 7 (was 8)
+ ^
+one error found
diff --git a/test/files/neg/t8015-ffa.scala b/test/files/neg/t8015-ffa.scala
new file mode 100644
index 0000000000..60876d9139
--- /dev/null
+++ b/test/files/neg/t8015-ffa.scala
@@ -0,0 +1,8 @@
+
+package foo
+
+//------- object Next
+
+trait F {
+ val i: Int = "3" // error line 7 (was 8)
+}
diff --git a/test/files/neg/t8015-ffb.check b/test/files/neg/t8015-ffb.check
new file mode 100644
index 0000000000..90c8d045b4
--- /dev/null
+++ b/test/files/neg/t8015-ffb.check
@@ -0,0 +1,6 @@
+t8015-ffb.scala:10: warning: side-effecting nullary methods are discouraged: suggest defining as `def w()` instead
+ def w = { x
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+one warning found
+one error found
diff --git a/test/files/neg/t8015-ffb.flags b/test/files/neg/t8015-ffb.flags
new file mode 100644
index 0000000000..7949c2afa2
--- /dev/null
+++ b/test/files/neg/t8015-ffb.flags
@@ -0,0 +1 @@
+-Xlint -Xfatal-warnings
diff --git a/test/files/neg/t8015-ffb.scala b/test/files/neg/t8015-ffb.scala
new file mode 100644
index 0000000000..dbdd942555
--- /dev/null
+++ b/test/files/neg/t8015-ffb.scala
@@ -0,0 +1,11 @@
+
+trait G {
+ val c: Char = '\u000a' // disallowed!
+ def x\u000d\u000a = 9 // as nl
+ def y() = x
+ def z() = {
+ y()\u000a() // was Int does not take parameters
+ }
+ def v = y()\u000c() // was Int does not take parameters
+ def w = { x () } // ^L is colored blue on this screen, hardly visible
+}