summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan@lightbend.com>2017-02-16 12:23:23 -0800
committerGitHub <noreply@github.com>2017-02-16 12:23:23 -0800
commitc10d25135361e309ddfd71c6806e041e994dc6fd (patch)
treeec8d5215a6871a1233364909f6bc69c8daf0fad8 /test/files
parente62e9e239004dfa8df9491f293e17774fad6872b (diff)
parentf1aa0b3795a8f649e71fa84e52e5b6f86257f3cb (diff)
downloadscala-c10d25135361e309ddfd71c6806e041e994dc6fd.tar.gz
scala-c10d25135361e309ddfd71c6806e041e994dc6fd.tar.bz2
scala-c10d25135361e309ddfd71c6806e041e994dc6fd.zip
Merge pull request #5546 from som-snytt/issue/9636
SI-9636 More precise error pos on apply inference
Diffstat (limited to 'test/files')
-rw-r--r--test/files/neg/t9636.check6
-rw-r--r--test/files/neg/t9636.flags1
-rw-r--r--test/files/neg/t9636.scala17
-rw-r--r--test/files/neg/warn-inferred-any.check2
4 files changed, 25 insertions, 1 deletions
diff --git a/test/files/neg/t9636.check b/test/files/neg/t9636.check
new file mode 100644
index 0000000000..f36d1d32b2
--- /dev/null
+++ b/test/files/neg/t9636.check
@@ -0,0 +1,6 @@
+t9636.scala:11: warning: a type was inferred to be `AnyVal`; this may indicate a programming error.
+ if (signature.sameElements(Array(0x1F, 0x8B))) {
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+one warning found
+one error found
diff --git a/test/files/neg/t9636.flags b/test/files/neg/t9636.flags
new file mode 100644
index 0000000000..7949c2afa2
--- /dev/null
+++ b/test/files/neg/t9636.flags
@@ -0,0 +1 @@
+-Xlint -Xfatal-warnings
diff --git a/test/files/neg/t9636.scala b/test/files/neg/t9636.scala
new file mode 100644
index 0000000000..7ad5fb3e9e
--- /dev/null
+++ b/test/files/neg/t9636.scala
@@ -0,0 +1,17 @@
+
+import java.io._
+import java.util.zip._
+
+class C {
+ def isWrapper(is: FileInputStream): InputStream = {
+ val pb = new PushbackInputStream(is, 2)
+ val signature = new Array[Byte](2)
+ pb.read(signature)
+ pb.unread(signature)
+ if (signature.sameElements(Array(0x1F, 0x8B))) {
+ new GZIPInputStream(new BufferedInputStream(pb))
+ } else {
+ pb
+ }
+ }
+}
diff --git a/test/files/neg/warn-inferred-any.check b/test/files/neg/warn-inferred-any.check
index 8ad81d1529..2b321a83c9 100644
--- a/test/files/neg/warn-inferred-any.check
+++ b/test/files/neg/warn-inferred-any.check
@@ -9,7 +9,7 @@ warn-inferred-any.scala:17: warning: a type was inferred to be `AnyVal`; this ma
^
warn-inferred-any.scala:25: warning: a type was inferred to be `Any`; this may indicate a programming error.
def za = f(1, "one")
- ^
+ ^
error: No warnings can be incurred under -Xfatal-warnings.
four warnings found
one error found