summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2013-04-27 21:36:53 -0700
committerSom Snytt <som.snytt@gmail.com>2013-05-25 09:51:37 -0700
commit99b4d95fe6c908ce3170ff4d090420f8e47efa1d (patch)
treef7819550cc9b9cbce24b98f1c5b085939e37883d /test/files/run
parent369f1f27ac6a27918e767e393dc6e22f7424aa38 (diff)
downloadscala-99b4d95fe6c908ce3170ff4d090420f8e47efa1d.tar.gz
scala-99b4d95fe6c908ce3170ff4d090420f8e47efa1d.tar.bz2
scala-99b4d95fe6c908ce3170ff4d090420f8e47efa1d.zip
SI-7003 Partest redirects stderr to log file
Some scalac output is on stderr, and it's useful to see that in the log file, especially for debugging. Adds a line filter for logs, specified as "filter: pattern" in the test source. Backslashes are made forward only when detected as paths. Test alignments: Deprecations which do not pertain to the system under test are corrected in the obvious way. When testing deprecated API, suppress warnings by deprecating the Test object. Check files are updated with useful true warnings, instead of running under -nowarn. Language feature imports as required, instead of running under -language. Language feature not required, such as casual use of postfix. Heed useful warning. Ignore broken warnings. (Rarely, -nowarn.) Inliner warnings pop up under -optimise only, so for now, just filter them out where they occur. Debug output from the test required an update.
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/Course-2002-01.check3
-rw-r--r--test/files/run/Meter.check3
-rw-r--r--test/files/run/MeterCaseClass.check3
-rw-r--r--test/files/run/Predef.readLine.scala3
-rw-r--r--test/files/run/SymbolsTest.scala3
-rw-r--r--test/files/run/abstypetags_serialize.scala3
-rw-r--r--test/files/run/array-existential-bound.scala4
-rw-r--r--test/files/run/arrays.check6
-rw-r--r--test/files/run/bitsets.scala2
-rw-r--r--test/files/run/bridges.scala2
-rw-r--r--test/files/run/bugs.scala2
-rw-r--r--test/files/run/classmanifests_new_alias.scala4
-rw-r--r--test/files/run/classmanifests_new_core.scala3
-rw-r--r--test/files/run/collections.scala3
-rw-r--r--test/files/run/colltest1.scala6
-rw-r--r--test/files/run/comparable-comparator.scala3
-rw-r--r--test/files/run/compiler-asSeenFrom.scala5
-rw-r--r--test/files/run/concurrent-stream.scala45
-rw-r--r--test/files/run/contrib674.check3
-rw-r--r--test/files/run/contrib674.scala4
-rw-r--r--test/files/run/ctries-new/main.scala7
-rw-r--r--test/files/run/ctries-old/concmap.scala1
-rw-r--r--test/files/run/ctries-old/iterator.scala1
-rw-r--r--test/files/run/ctries-old/lnode.scala1
-rw-r--r--test/files/run/ctries-old/main.scala8
-rw-r--r--test/files/run/ctries-old/snapshot.scala1
-rw-r--r--test/files/run/delay-bad.check6
-rw-r--r--test/files/run/delay-good.check6
-rw-r--r--test/files/run/distinct.scala2
-rw-r--r--test/files/run/enrich-gentraversable.scala3
-rw-r--r--test/files/run/eta-expand-star2.check1
-rw-r--r--test/files/run/exceptions-2.check3
-rw-r--r--test/files/run/exceptions-2.scala12
-rw-r--r--test/files/run/exceptions-nest.scala30
-rw-r--r--test/files/run/exceptions.scala2
-rw-r--r--test/files/run/existentials-in-compiler.scala8
-rw-r--r--test/files/run/existentials.scala3
-rw-r--r--test/files/run/existentials3-new.scala3
-rw-r--r--test/files/run/existentials3-old.scala2
-rw-r--r--test/files/run/finally.scala18
-rw-r--r--test/files/run/genericValueClass.scala2
-rw-r--r--test/files/run/getClassTest-old.scala1
-rw-r--r--test/files/run/global-showdef.scala7
-rw-r--r--test/files/run/impconvtimes.scala2
-rw-r--r--test/files/run/implicits.scala2
-rw-r--r--test/files/run/indexedSeq.scala7
-rw-r--r--test/files/run/inner-obj-auto.scala130
-rw-r--r--test/files/run/interop_classtags_are_classmanifests.scala5
-rw-r--r--test/files/run/interop_manifests_are_classtags.scala3
-rw-r--r--test/files/run/interpolationArgs.scala4
-rw-r--r--test/files/run/interpolationMultiline2.scala17
-rw-r--r--test/files/run/io-position.scala4
-rw-r--r--test/files/run/is-valid-num.scala3
-rw-r--r--test/files/run/issue192.scala2
-rw-r--r--test/files/run/iterator-from.scala4
-rw-r--r--test/files/run/iterator-iterate-lazy.scala2
-rw-r--r--test/files/run/iterators.scala2
-rw-r--r--test/files/run/json.scala8
-rw-r--r--test/files/run/lazy-exprs.check8
-rw-r--r--test/files/run/lazy-locals.check6
-rw-r--r--test/files/run/lists-run.scala4
-rw-r--r--test/files/run/literals.check4
-rw-r--r--test/files/run/literals.scala6
-rw-r--r--test/files/run/macro-declared-in-anonymous/Macros_Test_2.scala4
-rw-r--r--test/files/run/macro-declared-in-refinement/Macros_Test_2.scala5
-rw-r--r--test/files/run/macro-duplicate.check3
-rw-r--r--test/files/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala3
-rw-r--r--test/files/run/macro-expand-implicit-macro-is-view.flags1
-rw-r--r--test/files/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala5
-rw-r--r--test/files/run/manifests-new.scala5
-rw-r--r--test/files/run/manifests-old.scala5
-rw-r--r--test/files/run/mapConserve.scala5
-rw-r--r--test/files/run/misc.check24
-rw-r--r--test/files/run/names-defaults.check4
-rw-r--r--test/files/run/names-defaults.scala3
-rw-r--r--test/files/run/no-pickle-skolems/Test_2.scala2
-rw-r--r--test/files/run/option-fold.scala11
-rw-r--r--test/files/run/patmat-exprs.scala4
-rw-r--r--test/files/run/patmat_unapp_abstype-new.check6
-rw-r--r--test/files/run/patmatnew.check15
-rw-r--r--test/files/run/patmatnew.scala3
-rw-r--r--test/files/run/pc-conversions.scala4
-rw-r--r--test/files/run/pf-catch.scala4
-rw-r--r--test/files/run/preinits.check6
-rw-r--r--test/files/run/primitive-sigs-2-new.scala4
-rw-r--r--test/files/run/primitive-sigs-2-old.scala2
-rw-r--r--test/files/run/private-inline.check6
-rw-r--r--test/files/run/private-inline.flags2
-rw-r--r--test/files/run/private-inline.scala2
-rw-r--r--test/files/run/programmatic-main.scala2
-rw-r--r--test/files/run/records.scala3
-rw-r--r--test/files/run/reflection-allmirrors-tostring.scala4
-rw-r--r--test/files/run/reflection-implicit.scala4
-rw-r--r--test/files/run/reflection-magicsymbols-vanilla.scala2
-rw-r--r--test/files/run/reify-each-node-type.scala2
-rw-r--r--test/files/run/reify_ann1b.check5
-rw-r--r--test/files/run/reify_classfileann_a.check5
-rw-r--r--test/files/run/reify_classfileann_b.check5
-rw-r--r--test/files/run/reify_extendbuiltins.scala4
-rw-r--r--test/files/run/reify_implicits-new.scala4
-rw-r--r--test/files/run/reify_implicits-old.scala4
-rw-r--r--test/files/run/reify_lazyevaluation.scala2
-rw-r--r--test/files/run/reify_lazyunit.check3
-rw-r--r--test/files/run/reify_printf.check1
-rw-r--r--test/files/run/reify_printf.scala8
-rw-r--r--test/files/run/repl-backticks.scala2
-rw-r--r--test/files/run/resetattrs-this.scala4
-rw-r--r--test/files/run/richs.scala4
-rw-r--r--test/files/run/runtime.check6
-rw-r--r--test/files/run/runtime.scala2
-rw-r--r--test/files/run/sequenceComparisons.scala2
-rw-r--r--test/files/run/settings-parse.scala2
-rw-r--r--test/files/run/si5045.scala3
-rw-r--r--test/files/run/slices.scala3
-rw-r--r--test/files/run/spec-nlreturn.scala3
-rw-r--r--test/files/run/stream_flatmap_odds.scala2
-rw-r--r--test/files/run/stringbuilder-drop.scala4
-rw-r--r--test/files/run/stringbuilder.scala7
-rw-r--r--test/files/run/stringinterpolation_macro-run.scala3
-rw-r--r--test/files/run/structural.scala5
-rw-r--r--test/files/run/synchronized.check1
-rw-r--r--test/files/run/synchronized.flags2
-rw-r--r--test/files/run/t0325.scala2
-rw-r--r--test/files/run/t0421-old.scala2
-rw-r--r--test/files/run/t0432.scala3
-rw-r--r--test/files/run/t0528.scala2
-rw-r--r--test/files/run/t0677-old.scala3
-rw-r--r--test/files/run/t1005.scala9
-rw-r--r--test/files/run/t1110.scala6
-rw-r--r--test/files/run/t1141.scala4
-rw-r--r--test/files/run/t1195-new.scala4
-rw-r--r--test/files/run/t1195-old.scala3
-rw-r--r--test/files/run/t1368.check3
-rw-r--r--test/files/run/t1427.check3
-rw-r--r--test/files/run/t1427.scala3
-rw-r--r--test/files/run/t1500.scala2
-rw-r--r--test/files/run/t1501.scala2
-rw-r--r--test/files/run/t153.scala2
-rw-r--r--test/files/run/t1766.scala3
-rw-r--r--test/files/run/t2106.check3
-rw-r--r--test/files/run/t2106.flags2
-rw-r--r--test/files/run/t2106.scala2
-rw-r--r--test/files/run/t2308a.scala2
-rw-r--r--test/files/run/t2318.scala2
-rw-r--r--test/files/run/t2333.scala4
-rw-r--r--test/files/run/t2417.scala2
-rw-r--r--test/files/run/t2514.scala6
-rw-r--r--test/files/run/t2594_tcpoly.scala5
-rw-r--r--test/files/run/t2636.scala5
-rw-r--r--test/files/run/t3038d.scala2
-rw-r--r--test/files/run/t3050.scala2
-rw-r--r--test/files/run/t3175.scala3
-rw-r--r--test/files/run/t3232.scala2
-rw-r--r--test/files/run/t3242.scala3
-rw-r--r--test/files/run/t3361.scala4
-rw-r--r--test/files/run/t3425.scala1
-rw-r--r--test/files/run/t3488.check6
-rw-r--r--test/files/run/t3507-new.scala4
-rw-r--r--test/files/run/t3529.scala1
-rw-r--r--test/files/run/t3651.scala2
-rw-r--r--test/files/run/t3705.scala4
-rw-r--r--test/files/run/t3758-old.scala4
-rw-r--r--test/files/run/t3855.scala4
-rw-r--r--test/files/run/t3888.check1
-rw-r--r--test/files/run/t3888.scala5
-rw-r--r--test/files/run/t3935.scala2
-rw-r--r--test/files/run/t3964.scala3
-rw-r--r--test/files/run/t4047.check12
-rw-r--r--test/files/run/t4072.scala2
-rw-r--r--test/files/run/t4080.scala5
-rw-r--r--test/files/run/t4148.scala6
-rw-r--r--test/files/run/t4171.scala3
-rw-r--r--test/files/run/t4398.scala2
-rw-r--r--test/files/run/t4560.scala3
-rw-r--r--test/files/run/t4660.scala2
-rw-r--r--test/files/run/t4680.check6
-rw-r--r--test/files/run/t4729/S_2.scala1
-rw-r--r--test/files/run/t4766.scala4
-rw-r--r--test/files/run/t4777.scala4
-rw-r--r--test/files/run/t4794.scala3
-rw-r--r--test/files/run/t4929.scala1
-rw-r--r--test/files/run/t498.scala3
-rw-r--r--test/files/run/t5053.scala3
-rw-r--r--test/files/run/t5080.scala4
-rw-r--r--test/files/run/t5224.check5
-rw-r--r--test/files/run/t5277_1.scala3
-rw-r--r--test/files/run/t5284b.check3
-rw-r--r--test/files/run/t5284c.check3
-rw-r--r--test/files/run/t5353.scala9
-rw-r--r--test/files/run/t5356.scala2
-rw-r--r--test/files/run/t5375.scala2
-rw-r--r--test/files/run/t5380.check9
-rw-r--r--test/files/run/t5380.scala2
-rw-r--r--test/files/run/t5428.scala2
-rw-r--r--test/files/run/t5568.flags1
-rw-r--r--test/files/run/t5629b.scala2
-rwxr-xr-xtest/files/run/t5699.scala2
-rw-r--r--test/files/run/t576.scala2
-rw-r--r--test/files/run/t5881.scala3
-rw-r--r--test/files/run/t5912.scala3
-rw-r--r--test/files/run/t5942.scala2
-rw-r--r--test/files/run/t6011c.check3
-rw-r--r--test/files/run/t603.scala2
-rw-r--r--test/files/run/t6102.check30
-rw-r--r--test/files/run/t6113.scala4
-rw-r--r--test/files/run/t6146b.check4
-rw-r--r--test/files/run/t6246.scala3
-rw-r--r--test/files/run/t6329_vanilla.scala1
-rw-r--r--test/files/run/t6443.scala2
-rw-r--r--test/files/run/t657.scala2
-rw-r--r--test/files/run/t6690.scala2
-rw-r--r--test/files/run/t6731.scala2
-rw-r--r--test/files/run/t6863.check12
-rw-r--r--test/files/run/t6863.scala4
-rw-r--r--test/files/run/t6969.scala4
-rw-r--r--test/files/run/t7047.check3
-rw-r--r--test/files/run/t7096.scala3
-rw-r--r--test/files/run/t7120b.scala3
-rw-r--r--test/files/run/t7171.check3
-rw-r--r--test/files/run/t7171.flags1
-rw-r--r--test/files/run/t7171.scala2
-rw-r--r--test/files/run/t7240/Test_2.scala4
-rw-r--r--test/files/run/t7271.check8
-rw-r--r--test/files/run/t7271.scala3
-rw-r--r--test/files/run/t7290.check6
-rw-r--r--test/files/run/t7291.scala3
-rw-r--r--test/files/run/t874.scala2
-rw-r--r--test/files/run/tcpoly_monads.scala3
-rw-r--r--test/files/run/tcpoly_overriding.scala3
-rw-r--r--test/files/run/tcpoly_parseridioms.check20
-rw-r--r--test/files/run/tcpoly_parseridioms.scala3
-rw-r--r--test/files/run/toolbox_console_reporter.scala13
-rw-r--r--test/files/run/transform.scala2
-rw-r--r--test/files/run/try-2.check3
-rw-r--r--test/files/run/try-2.scala12
-rw-r--r--test/files/run/try-catch-unify.scala2
-rw-r--r--test/files/run/try.check3
-rw-r--r--test/files/run/try.scala8
-rw-r--r--test/files/run/tuple-zipped.scala3
-rw-r--r--test/files/run/tuples.scala1
-rw-r--r--test/files/run/type-currying.scala3
-rw-r--r--test/files/run/unapply.check3
-rw-r--r--test/files/run/unittest_io.scala2
-rw-r--r--test/files/run/unreachable.scala19
-rw-r--r--test/files/run/valueclasses-classmanifest-basic.scala3
-rw-r--r--test/files/run/valueclasses-classmanifest-existential.scala3
-rw-r--r--test/files/run/valueclasses-classmanifest-generic.scala3
-rw-r--r--test/files/run/vector1.scala2
-rw-r--r--test/files/run/view-iterator-stream.scala3
-rw-r--r--test/files/run/virtpatmat_alts.check6
-rw-r--r--test/files/run/virtpatmat_alts.flags1
-rw-r--r--test/files/run/virtpatmat_alts.scala5
-rw-r--r--test/files/run/virtpatmat_nested_lists.check5
-rw-r--r--test/files/run/virtpatmat_nested_lists.flags1
-rw-r--r--test/files/run/virtpatmat_nested_lists.scala3
-rw-r--r--test/files/run/virtpatmat_opt_sharing.check3
-rw-r--r--test/files/run/virtpatmat_opt_sharing.flags1
-rw-r--r--test/files/run/virtpatmat_opt_sharing.scala5
-rw-r--r--test/files/run/virtpatmat_staging.scala7
-rw-r--r--test/files/run/virtpatmat_stringinterp.scala5
-rw-r--r--test/files/run/virtpatmat_try.scala8
-rw-r--r--test/files/run/virtpatmat_typed.check3
-rw-r--r--test/files/run/xml-loop-bug.scala14
263 files changed, 933 insertions, 340 deletions
diff --git a/test/files/run/Course-2002-01.check b/test/files/run/Course-2002-01.check
index 17b30bf3c2..16b491d6e2 100644
--- a/test/files/run/Course-2002-01.check
+++ b/test/files/run/Course-2002-01.check
@@ -1,3 +1,6 @@
+Course-2002-01.scala:41: warning: method loop in object M0 does nothing other than call itself recursively
+ def loop: Int = loop;
+ ^
232
667
11
diff --git a/test/files/run/Meter.check b/test/files/run/Meter.check
index b7e2eac125..c79c51a294 100644
--- a/test/files/run/Meter.check
+++ b/test/files/run/Meter.check
@@ -1,3 +1,6 @@
+Meter.scala:72: warning: a.Meter and Int are unrelated: they will never compare equal
+ println("x == 1: "+(x == 1))
+ ^
2.0
4.0m
false
diff --git a/test/files/run/MeterCaseClass.check b/test/files/run/MeterCaseClass.check
index 2528753657..2782704f9f 100644
--- a/test/files/run/MeterCaseClass.check
+++ b/test/files/run/MeterCaseClass.check
@@ -1,3 +1,6 @@
+MeterCaseClass.scala:69: warning: comparing values of types a.Meter and Int using `==' will always yield false
+ println("x == 1: "+(x == 1))
+ ^
2.0
Meter(4.0)
false
diff --git a/test/files/run/Predef.readLine.scala b/test/files/run/Predef.readLine.scala
index 9f07936638..54809f8071 100644
--- a/test/files/run/Predef.readLine.scala
+++ b/test/files/run/Predef.readLine.scala
@@ -1,4 +1,5 @@
import java.io.StringReader
+import scala.io.ReadStdin.readLine
object Test extends App {
Console.withIn(new StringReader("")) {
@@ -7,4 +8,4 @@ object Test extends App {
readLine("%s prompt\n", "fancy")
readLine("%s %s prompt\n", "immensely", "fancy")
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/SymbolsTest.scala b/test/files/run/SymbolsTest.scala
index 53caa5e62f..d5948ea168 100644
--- a/test/files/run/SymbolsTest.scala
+++ b/test/files/run/SymbolsTest.scala
@@ -1,6 +1,5 @@
-
-
+import scala.language.reflectiveCalls
class Slazz {
val s1 = 'myFirstSymbol
diff --git a/test/files/run/abstypetags_serialize.scala b/test/files/run/abstypetags_serialize.scala
index 93fb5dcd06..6ec97105fe 100644
--- a/test/files/run/abstypetags_serialize.scala
+++ b/test/files/run/abstypetags_serialize.scala
@@ -1,3 +1,4 @@
+import scala.language.higherKinds
import java.io._
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{universe => ru}
@@ -30,4 +31,4 @@ object Test extends App {
}
qwe
-} \ No newline at end of file
+}
diff --git a/test/files/run/array-existential-bound.scala b/test/files/run/array-existential-bound.scala
index bc442d39f7..b397c98111 100644
--- a/test/files/run/array-existential-bound.scala
+++ b/test/files/run/array-existential-bound.scala
@@ -10,8 +10,8 @@ object Test extends Fooz[Array[Int]] {
def main(args: Array[String]): Unit = {
println(f1.f0(Array[String]("a", "b")))
- println(f2.f0(1 to 1000 toArray))
+ println(f2.f0((1 to 1000).toArray))
println(f3.f0((1 to 1000).toArray[Any]))
- println(f4.f0('a' to 'z' toArray))
+ println(f4.f0(('a' to 'z').toArray))
}
}
diff --git a/test/files/run/arrays.check b/test/files/run/arrays.check
index b1f7fae1d1..c9a3a87268 100644
--- a/test/files/run/arrays.check
+++ b/test/files/run/arrays.check
@@ -1 +1,7 @@
+arrays.scala:248: warning: comparing values of types Unit and Unit using `==' will always yield true
+ check(xs(0) == u0, xs(0), u0);
+ ^
+arrays.scala:249: warning: comparing values of types Unit and Unit using `==' will always yield true
+ check(xs(1) == u1, xs(1), u1);
+ ^
checks: 2302
diff --git a/test/files/run/bitsets.scala b/test/files/run/bitsets.scala
index 3bfb8c7ac3..5d49220749 100644
--- a/test/files/run/bitsets.scala
+++ b/test/files/run/bitsets.scala
@@ -4,6 +4,8 @@
//############################################################################
+import scala.language.postfixOps
+
object TestMutable {
import scala.collection.mutable.BitSet
diff --git a/test/files/run/bridges.scala b/test/files/run/bridges.scala
index fda86eabc6..eb036bd781 100644
--- a/test/files/run/bridges.scala
+++ b/test/files/run/bridges.scala
@@ -3588,7 +3588,7 @@ object Test {
errors = errors + 1;
}
} catch {
- case exception => {
+ case exception: Throwable => {
Console.print(name + " raised exception " + exception);
Console.println;
errors = errors + 1;
diff --git a/test/files/run/bugs.scala b/test/files/run/bugs.scala
index ca598603bb..9d2be42fb7 100644
--- a/test/files/run/bugs.scala
+++ b/test/files/run/bugs.scala
@@ -444,7 +444,7 @@ object Test {
try {
test;
} catch {
- case exception =>
+ case exception: Throwable =>
Console.print("Exception in thread \"" + Thread.currentThread + "\" " + exception);
Console.println;
errors += 1
diff --git a/test/files/run/classmanifests_new_alias.scala b/test/files/run/classmanifests_new_alias.scala
index 12bd93bab6..777bd5dd6d 100644
--- a/test/files/run/classmanifests_new_alias.scala
+++ b/test/files/run/classmanifests_new_alias.scala
@@ -1,5 +1,7 @@
+
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
type CM[T] = ClassManifest[T]
println(implicitly[CM[Int]])
println(implicitly[CM[Int]] eq Manifest.Int)
-} \ No newline at end of file
+}
diff --git a/test/files/run/classmanifests_new_core.scala b/test/files/run/classmanifests_new_core.scala
index 63dbfab25c..0a9c58e8e1 100644
--- a/test/files/run/classmanifests_new_core.scala
+++ b/test/files/run/classmanifests_new_core.scala
@@ -1,4 +1,5 @@
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
println(classManifest[Int])
println(classManifest[Int] eq Manifest.Int)
-} \ No newline at end of file
+}
diff --git a/test/files/run/collections.scala b/test/files/run/collections.scala
index 69c40fae80..1e4e8791ac 100644
--- a/test/files/run/collections.scala
+++ b/test/files/run/collections.scala
@@ -1,5 +1,6 @@
-import collection._
+import scala.collection._
import scala.compat.Platform.currentTime
+import scala.language.postfixOps
object Test extends App {
diff --git a/test/files/run/colltest1.scala b/test/files/run/colltest1.scala
index 54adeb7cda..87d3ef618b 100644
--- a/test/files/run/colltest1.scala
+++ b/test/files/run/colltest1.scala
@@ -1,4 +1,8 @@
-import collection._
+/*
+ * filter: inliner warning(s); re-run with -Yinline-warnings for details
+ */
+import scala.collection._
+import scala.language.postfixOps
object Test extends App {
diff --git a/test/files/run/comparable-comparator.scala b/test/files/run/comparable-comparator.scala
index ac943c63bb..1707fb6e61 100644
--- a/test/files/run/comparable-comparator.scala
+++ b/test/files/run/comparable-comparator.scala
@@ -15,7 +15,8 @@ object Test {
def compare(p1: C2, p2: C2) = p2.s compareTo p1.s
}
- val strs = "zip foo bar baz aggle bing bong" split ' ' toList
+ val words = "zip foo bar baz aggle bing bong" split ' '
+ val strs = words.toList
val c1s = strs map (x => new C1(x))
val c2s = strs map (x => new C2(x))
diff --git a/test/files/run/compiler-asSeenFrom.scala b/test/files/run/compiler-asSeenFrom.scala
index 0d4b504d3c..2952f85f01 100644
--- a/test/files/run/compiler-asSeenFrom.scala
+++ b/test/files/run/compiler-asSeenFrom.scala
@@ -1,6 +1,10 @@
+/*
+ * filter: inliner warning(s); re-run with -Yinline-warnings for details
+ */
import scala.tools.nsc._
import scala.tools.partest.CompilerTest
import scala.collection.{ mutable, immutable, generic }
+import scala.language.postfixOps
/** It's too messy but it's better than not having it.
*/
@@ -117,6 +121,5 @@ package ll {
println(sigs.mkString(x + " { // after " + ph + "\n ", "\n ", "\n}\n"))
}
}
- true
}
}
diff --git a/test/files/run/concurrent-stream.scala b/test/files/run/concurrent-stream.scala
index 42c695964e..9d5ba0428e 100644
--- a/test/files/run/concurrent-stream.scala
+++ b/test/files/run/concurrent-stream.scala
@@ -1,32 +1,33 @@
// test concurrent calls to Stream.tail
+@deprecated("Suppress warnings", since="2.11")
object Test {
-def slowRange(from: Int, until: Int, cons: (Int, => Stream[Int]) => Stream[Int]): Stream[Int] = {
- var current = from
- def next: Stream[Int] = {
- Thread.sleep(100)
- if (current >= until) Stream.empty
- else {
- val stream = cons(current, next)
- current += 1
- stream
+ def slowRange(from: Int, until: Int, cons: (Int, => Stream[Int]) => Stream[Int]): Stream[Int] = {
+ var current = from
+ def next: Stream[Int] = {
+ Thread.sleep(100)
+ if (current >= until) Stream.empty
+ else {
+ val stream = cons(current, next)
+ current += 1
+ stream
+ }
}
+ next
}
- next
-}
-def testCons(cons: (Int, => Stream[Int]) => Stream[Int]): Unit = {
- import scala.actors.Actor._
+ def testCons(cons: (Int, => Stream[Int]) => Stream[Int]): Unit = {
+ import scala.actors.Actor._
- val stream = slowRange(0, 10, cons)
- val main = self
- actor { main ! stream.toList }
- actor { main ! stream.toList }
- val eval0 = receive { case list: List[Int] => list }
- val eval1 = receive { case list: List[Int] => list }
- println("Evaluation 0: " + eval0)
- println("Evaluation 1: " + eval1)
-}
+ val stream = slowRange(0, 10, cons)
+ val main = self
+ actor { main ! stream.toList }
+ actor { main ! stream.toList }
+ val eval0 = receive { case list: List[Int @unchecked] => list }
+ val eval1 = receive { case list: List[Int @unchecked] => list }
+ println("Evaluation 0: " + eval0)
+ println("Evaluation 1: " + eval1)
+ }
def main(args: Array[String]) {
println("Testing standard cons.")
diff --git a/test/files/run/contrib674.check b/test/files/run/contrib674.check
new file mode 100644
index 0000000000..78325c1810
--- /dev/null
+++ b/test/files/run/contrib674.check
@@ -0,0 +1,3 @@
+contrib674.scala:15: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ 1
+ ^
diff --git a/test/files/run/contrib674.scala b/test/files/run/contrib674.scala
index f6b46d13c6..45c9871fc4 100644
--- a/test/files/run/contrib674.scala
+++ b/test/files/run/contrib674.scala
@@ -5,11 +5,11 @@ object Test extends App {
try {
1
} catch {
- case e =>
+ case e: Throwable =>
} finally {
try {
} catch {
- case e =>
+ case e: Throwable =>
}
}
1
diff --git a/test/files/run/ctries-new/main.scala b/test/files/run/ctries-new/main.scala
index d7fe087e4d..34f3ec2ccf 100644
--- a/test/files/run/ctries-new/main.scala
+++ b/test/files/run/ctries-new/main.scala
@@ -21,6 +21,9 @@ object Test {
trait Spec {
+ implicit def implicitously = scala.language.implicitConversions
+ implicit def reflectively = scala.language.reflectiveCalls
+
implicit def str2ops(s: String) = new {
def in[U](body: =>U) {
// just execute body
@@ -37,11 +40,11 @@ trait Spec {
var produced = false
try body
catch {
- case e => if (e.getClass == implicitly[ClassTag[T]].runtimeClass) produced = true
+ case e: Throwable => if (e.getClass == implicitly[ClassTag[T]].runtimeClass) produced = true
} finally {
assert(produced, "Did not produce exception of type: " + implicitly[ClassTag[T]])
}
}
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/ctries-old/concmap.scala b/test/files/run/ctries-old/concmap.scala
index 3ec0256afb..fccd4bed3e 100644
--- a/test/files/run/ctries-old/concmap.scala
+++ b/test/files/run/ctries-old/concmap.scala
@@ -2,6 +2,7 @@
import collection.concurrent.TrieMap
+import Test.Spec
object ConcurrentMapSpec extends Spec {
diff --git a/test/files/run/ctries-old/iterator.scala b/test/files/run/ctries-old/iterator.scala
index b953a40e00..585bdc0e48 100644
--- a/test/files/run/ctries-old/iterator.scala
+++ b/test/files/run/ctries-old/iterator.scala
@@ -5,6 +5,7 @@
import collection._
import collection.concurrent.TrieMap
+import Test.Spec
object IteratorSpec extends Spec {
diff --git a/test/files/run/ctries-old/lnode.scala b/test/files/run/ctries-old/lnode.scala
index 92a31088e5..3ff5414ac0 100644
--- a/test/files/run/ctries-old/lnode.scala
+++ b/test/files/run/ctries-old/lnode.scala
@@ -3,6 +3,7 @@
import collection.concurrent.TrieMap
+import Test.Spec
object LNodeSpec extends Spec {
diff --git a/test/files/run/ctries-old/main.scala b/test/files/run/ctries-old/main.scala
index 78ba7f0db1..f714bcdcdc 100644
--- a/test/files/run/ctries-old/main.scala
+++ b/test/files/run/ctries-old/main.scala
@@ -5,6 +5,7 @@
+@deprecated("Suppress warnings", since="2.11")
object Test {
def main(args: Array[String]) {
@@ -14,11 +15,13 @@ object Test {
SnapshotSpec.test()
}
-}
trait Spec {
+ implicit def implicitously = scala.language.implicitConversions
+ implicit def reflectively = scala.language.reflectiveCalls
+
implicit def str2ops(s: String) = new {
def in[U](body: =>U) {
// just execute body
@@ -35,7 +38,7 @@ trait Spec {
var produced = false
try body
catch {
- case e => if (e.getClass == implicitly[ClassManifest[T]].erasure) produced = true
+ case e: Throwable => if (e.getClass == implicitly[ClassManifest[T]].erasure) produced = true
} finally {
assert(produced, "Did not produce exception of type: " + implicitly[ClassManifest[T]])
}
@@ -43,3 +46,4 @@ trait Spec {
}
}
+}
diff --git a/test/files/run/ctries-old/snapshot.scala b/test/files/run/ctries-old/snapshot.scala
index 5fe77d445b..768b588f81 100644
--- a/test/files/run/ctries-old/snapshot.scala
+++ b/test/files/run/ctries-old/snapshot.scala
@@ -5,6 +5,7 @@
import collection._
import collection.concurrent.TrieMap
+import Test.Spec
object SnapshotSpec extends Spec {
diff --git a/test/files/run/delay-bad.check b/test/files/run/delay-bad.check
index 9d9c828a03..2ae88267c5 100644
--- a/test/files/run/delay-bad.check
+++ b/test/files/run/delay-bad.check
@@ -1,3 +1,9 @@
+delay-bad.scala:53: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ f(new C { 5 })
+ ^
+delay-bad.scala:73: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ f(new { val x = 5 } with E() { 5 })
+ ^
// new C { }
diff --git a/test/files/run/delay-good.check b/test/files/run/delay-good.check
index 8eb04c7cff..b4f6b04af7 100644
--- a/test/files/run/delay-good.check
+++ b/test/files/run/delay-good.check
@@ -1,3 +1,9 @@
+delay-good.scala:53: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ f(new C { 5 })
+ ^
+delay-good.scala:73: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ f(new { val x = 5 } with E() { 5 })
+ ^
// new C { }
diff --git a/test/files/run/distinct.scala b/test/files/run/distinct.scala
index 09e5a0734a..37bbe7805a 100644
--- a/test/files/run/distinct.scala
+++ b/test/files/run/distinct.scala
@@ -3,7 +3,7 @@
*/
object Test {
val alphabet = 'a' to 'z' mkString ""
- val alphaList = 'a' to 'z' toList
+ val alphaList = ('a' to 'z').toList
def shuffled = util.Random.shuffle(alphaList)
def main(args: Array[String]): Unit = {
diff --git a/test/files/run/enrich-gentraversable.scala b/test/files/run/enrich-gentraversable.scala
index 52eded55fd..0f79a47030 100644
--- a/test/files/run/enrich-gentraversable.scala
+++ b/test/files/run/enrich-gentraversable.scala
@@ -1,3 +1,6 @@
+import scala.language.implicitConversions
+import scala.language.postfixOps
+
object Test extends App {
import scala.collection.{GenTraversableOnce,GenTraversableLike}
import scala.collection.generic._
diff --git a/test/files/run/eta-expand-star2.check b/test/files/run/eta-expand-star2.check
index ce01362503..cbf4781255 100644
--- a/test/files/run/eta-expand-star2.check
+++ b/test/files/run/eta-expand-star2.check
@@ -1 +1,2 @@
+warning: there were 1 deprecation warning(s); re-run with -deprecation for details
hello
diff --git a/test/files/run/exceptions-2.check b/test/files/run/exceptions-2.check
index 9a3044cd4f..4f8244800a 100644
--- a/test/files/run/exceptions-2.check
+++ b/test/files/run/exceptions-2.check
@@ -1,3 +1,6 @@
+exceptions-2.scala:267: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ try { 1 } catch { case e: java.io.IOException => () }
+ ^
nested1:
Innermost finally
Outermost finally
diff --git a/test/files/run/exceptions-2.scala b/test/files/run/exceptions-2.scala
index f5bbcca210..8d755c3809 100644
--- a/test/files/run/exceptions-2.scala
+++ b/test/files/run/exceptions-2.scala
@@ -42,7 +42,7 @@ object NoExcep {
def method4 = try {
Console.println("..");
} catch {
- case _ => sys.error("..");
+ case _: Throwable => sys.error("..");
}
}
@@ -136,7 +136,7 @@ object Test {
try {
sys.error("a");
} catch {
- case _ => Console.println("Silently ignore exception in finally");
+ case _: Throwable => Console.println("Silently ignore exception in finally");
}
}
}
@@ -146,7 +146,7 @@ object Test {
} finally {
val fin = "Abc";
Console.println(fin);
- };
+ }
def tryAndValInFinally: Unit =
try {
@@ -154,8 +154,8 @@ object Test {
val fin = "Abc";
try {
Console.println(fin);
- } catch { case _ => () }
- };
+ } catch { case _: Throwable => () }
+ }
def returnInBody: Unit = try {
try {
@@ -249,7 +249,7 @@ object Test {
def execute(f: => Unit) = try {
f;
} catch {
- case _ => ();
+ case _: Throwable => ()
}
diff --git a/test/files/run/exceptions-nest.scala b/test/files/run/exceptions-nest.scala
index 841e6b1c67..432d600d13 100644
--- a/test/files/run/exceptions-nest.scala
+++ b/test/files/run/exceptions-nest.scala
@@ -5,9 +5,9 @@ object Test extends App {
println(test3)
println(test4)
println(test5)
- try { println(test6) } catch { case _ => println("OK") }
+ try { println(test6) } catch { case _: Throwable => println("OK") }
println(test7)
- try { println(test8) } catch { case _ => println("OK") }
+ try { println(test8) } catch { case _: Throwable => println("OK") }
println(test9)
println(test10)
println(test11)
@@ -19,7 +19,7 @@ object Test extends App {
x = 2
} catch {
case _: NullPointerException => x = 3
- case _ => x = 4
+ case _: Throwable => x = 4
}
x
}
@@ -31,12 +31,12 @@ object Test extends App {
try {
x = 21
} catch {
- case _ => x = 22
+ case _: Throwable => x = 22
}
x = 23
} catch {
case _: NullPointerException => x = 3
- case _ => x = 4
+ case _: Throwable => x = 4
}
x
}
@@ -44,10 +44,10 @@ object Test extends App {
def test3 = {
var x = 1
try {
- try{x = 2} catch { case _ => x = 4 }
+ try{x = 2} catch { case _: Throwable => x = 4 }
} catch {
case _: NullPointerException => x = 3
- case _ => x = 4
+ case _: Throwable => x = 4
}
x
}
@@ -58,7 +58,7 @@ object Test extends App {
x = 2
} catch {
case _: NullPointerException => x = 3
- case _ => x = 4
+ case _: Throwable => x = 4
}
try {
x = 5
@@ -73,8 +73,8 @@ object Test extends App {
try {
x = 2
} catch {
- case _: NullPointerException => try { x = 3 } catch { case f => throw f }
- case _ => x = 4; try { x = 41 } catch { case _: Exception => x = 42 }; x = 43
+ case _: NullPointerException => try { x = 3 } catch { case f: Throwable => throw f }
+ case _: Throwable => x = 4; try { x = 41 } catch { case _: Exception => x = 42 }; x = 43
}
x
}
@@ -87,7 +87,7 @@ object Test extends App {
} catch {
case e: NullPointerException =>
throw e
- case _ =>
+ case _: Throwable =>
x = 3
return 1000
} finally {
@@ -105,7 +105,7 @@ object Test extends App {
try {
x = 4
} catch {
- case _ => x = 5
+ case _: Throwable => x = 5
}
}
x
@@ -116,7 +116,7 @@ object Test extends App {
try {
throw new NullPointerException
} catch {
- case e => throw e
+ case e: Throwable => throw e
}
x
}
@@ -124,7 +124,7 @@ object Test extends App {
def test9 = {
try { "" match {
case s: String => 10
- }} catch { case _ => 20 }
+ }} catch { case _: Throwable => 20 }
}
var x10 = 1
@@ -135,7 +135,7 @@ object Test extends App {
def test11 {
try { () }
- catch { case e => () }
+ catch { case e: Throwable => () }
}
class E1 extends Exception
diff --git a/test/files/run/exceptions.scala b/test/files/run/exceptions.scala
index 90f681e3c5..f0fe76946b 100644
--- a/test/files/run/exceptions.scala
+++ b/test/files/run/exceptions.scala
@@ -32,7 +32,7 @@ object exceptions {
val value = try {
map.lookup(key)
} catch {
- case e => e.getMessage()
+ case e: Throwable => e.getMessage()
}
check("lookup(" + key + ")", value, "KO");
}
diff --git a/test/files/run/existentials-in-compiler.scala b/test/files/run/existentials-in-compiler.scala
index 14c25849cb..5ff40578c5 100644
--- a/test/files/run/existentials-in-compiler.scala
+++ b/test/files/run/existentials-in-compiler.scala
@@ -1,3 +1,6 @@
+/*
+ * filter: inliner warning(s); re-run with -Yinline-warnings for details
+ */
import scala.tools.nsc._
import scala.tools.partest.CompilerTest
import scala.collection.{ mutable, immutable, generic }
@@ -71,14 +74,13 @@ package extest {
}
"""
- def check(source: String, unit: global.CompilationUnit) = {
- getRequiredPackage("extest").moduleClass.info.decls.toList.filter(_.isType).map(_.initialize).sortBy(_.name.toString) foreach { clazz =>
+ override def check(source: String, unit: global.CompilationUnit) {
+ getPackage("extest").moduleClass.info.decls.toList.filter(_.isType).map(_.initialize).sortBy(_.name.toString) foreach { clazz =>
exitingTyper {
clazz.info
println(clazz.defString)
println(" " + classExistentialType(clazz) + "\n")
}
}
- true
}
}
diff --git a/test/files/run/existentials.scala b/test/files/run/existentials.scala
index 3977d47417..65acfd2ac0 100644
--- a/test/files/run/existentials.scala
+++ b/test/files/run/existentials.scala
@@ -1,3 +1,6 @@
+import scala.language.existentials
+import scala.language.reflectiveCalls
+
class Foo {
class Line {
case class Cell[T](var x: T)
diff --git a/test/files/run/existentials3-new.scala b/test/files/run/existentials3-new.scala
index 110c8eff7a..6112a7b856 100644
--- a/test/files/run/existentials3-new.scala
+++ b/test/files/run/existentials3-new.scala
@@ -1,3 +1,4 @@
+import scala.language.existentials
import scala.reflect.runtime.universe._
object Test {
@@ -77,4 +78,4 @@ object Misc {
}
def g1 = o1.f1 _
def g2 = o1.f2 _
-} \ No newline at end of file
+}
diff --git a/test/files/run/existentials3-old.scala b/test/files/run/existentials3-old.scala
index 944160ff12..c021c0e71e 100644
--- a/test/files/run/existentials3-old.scala
+++ b/test/files/run/existentials3-old.scala
@@ -1,3 +1,5 @@
+import scala.language.existentials
+
object Test {
trait ToS { final override def toString = getClass.getName }
diff --git a/test/files/run/finally.scala b/test/files/run/finally.scala
index 635123cc4d..01180fd217 100644
--- a/test/files/run/finally.scala
+++ b/test/files/run/finally.scala
@@ -7,7 +7,7 @@ object Test extends App {
try {
bar
} catch {
- case e => println(e)
+ case e: Throwable => println(e)
}
}
@@ -17,7 +17,7 @@ object Test extends App {
println("hi")
}
catch {
- case e => println("SHOULD NOT GET HERE")
+ case e: Throwable => println("SHOULD NOT GET HERE")
}
finally {
println("In Finally")
@@ -30,7 +30,7 @@ object Test extends App {
try {
throw new Exception
} catch {
- case e =>
+ case e: Throwable =>
println(e);
return
} finally println("in finally")
@@ -41,7 +41,7 @@ object Test extends App {
try {
throw new Exception
} catch {
- case e =>
+ case e: Throwable =>
println(e);
throw e
} finally println("in finally")
@@ -52,7 +52,7 @@ object Test extends App {
try {
return
} catch {
- case e =>
+ case e: Throwable =>
println(e);
throw e
} finally println("in finally")
@@ -63,7 +63,7 @@ object Test extends App {
try {
throw new Exception
} catch {
- case e =>
+ case e: Throwable =>
println(e);
} finally println("in finally")
}
@@ -89,7 +89,7 @@ object Test extends App {
throw new Exception
}
} catch {
- case e => println(e)
+ case e: Throwable => println(e)
}
}
@@ -99,7 +99,7 @@ object Test extends App {
try {
return 10
} finally {
- try { () } catch { case _ => () }
+ try { () } catch { case _: Throwable => () }
println("in finally 1")
}
} finally {
@@ -111,7 +111,7 @@ object Test extends App {
try {
m
} catch {
- case e => println("COUGHT: " + e)
+ case e: Throwable => println("COUGHT: " + e)
}
println("-" * 40)
}
diff --git a/test/files/run/genericValueClass.scala b/test/files/run/genericValueClass.scala
index 768e1f86a5..9398390a80 100644
--- a/test/files/run/genericValueClass.scala
+++ b/test/files/run/genericValueClass.scala
@@ -1,4 +1,6 @@
+import scala.language.implicitConversions
+
object Test extends App {
class ArrowAssocClass[A](val __leftOfArrow: A) extends AnyVal {
@inline def -> [B](y: B): Tuple2[A, B] = Tuple2(__leftOfArrow, y)
diff --git a/test/files/run/getClassTest-old.scala b/test/files/run/getClassTest-old.scala
index 951cc8d931..789dd4d162 100644
--- a/test/files/run/getClassTest-old.scala
+++ b/test/files/run/getClassTest-old.scala
@@ -50,6 +50,7 @@ class MoreAnyRefs {
def f4 = (new A { def bippy() = 5 }).getClass()
}
+@deprecated("Suppress warnings", since="2.11")
object Test {
def returnTypes[T: Manifest] = (
manifest[T].erasure.getMethods.toList
diff --git a/test/files/run/global-showdef.scala b/test/files/run/global-showdef.scala
index 71ba7b8bb3..2a00ee51bd 100644
--- a/test/files/run/global-showdef.scala
+++ b/test/files/run/global-showdef.scala
@@ -1,6 +1,7 @@
import scala.tools.nsc._
-import io.{ AbstractFile }
-import util.{ SourceFile, BatchSourceFile, stringFromStream }
+import scala.reflect.io.AbstractFile
+import scala.tools.nsc.util.stringFromStream
+import scala.reflect.internal.util.{ SourceFile, BatchSourceFile }
import scala.tools.nsc.reporters.ConsoleReporter
object Test {
@@ -53,7 +54,7 @@ object Bippy {
val run = new compiler.Run()
run.compileSources(List(src))
}
- output split "\\n" toList
+ (output split "\\n").toList
}
def showClass(name: String) = lines("-Yshow:typer", "-Xshow-class", name)
def showObject(name: String) = lines("-Yshow:typer", "-Xshow-object", name)
diff --git a/test/files/run/impconvtimes.scala b/test/files/run/impconvtimes.scala
index 8c5ab61779..477a16a890 100644
--- a/test/files/run/impconvtimes.scala
+++ b/test/files/run/impconvtimes.scala
@@ -1,3 +1,5 @@
+import scala.language.implicitConversions
+
object Test {
abstract class Unit
object NoUnit extends Unit
diff --git a/test/files/run/implicits.scala b/test/files/run/implicits.scala
index a30f60f6d0..5681a9d484 100644
--- a/test/files/run/implicits.scala
+++ b/test/files/run/implicits.scala
@@ -1,3 +1,5 @@
+import scala.language.implicitConversions
+
object A {
object B {
implicit def int2string(x: Int) = "["+x.toString+"]"
diff --git a/test/files/run/indexedSeq.scala b/test/files/run/indexedSeq.scala
index 9744f47f63..29a8be701d 100644
--- a/test/files/run/indexedSeq.scala
+++ b/test/files/run/indexedSeq.scala
@@ -1,10 +1,11 @@
object Test {
- import scala.collection.{ mutable, immutable, generic }
+ import scala.collection.immutable
def checkIdentity[A](xs: immutable.IndexedSeq[A]) = assert(xs.toIndexedSeq eq xs)
def main(args: Array[String]): Unit = {
- checkIdentity(immutable.Vector(1 to 10: _*))
- checkIdentity(1 to 10 toIndexedSeq)
+ def r = 1 to 10
+ checkIdentity(immutable.Vector(r: _*))
+ checkIdentity(r.toIndexedSeq)
}
}
diff --git a/test/files/run/inner-obj-auto.scala b/test/files/run/inner-obj-auto.scala
index aa2e29326f..35ca56ba3e 100644
--- a/test/files/run/inner-obj-auto.scala
+++ b/test/files/run/inner-obj-auto.scala
@@ -25,7 +25,7 @@ class Class2_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -54,7 +54,7 @@ object Object3_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -83,7 +83,7 @@ trait Trait4_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -112,7 +112,7 @@ class Class6_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -141,7 +141,7 @@ object Object7_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -170,7 +170,7 @@ trait Trait8_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -199,7 +199,7 @@ class Class10_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -228,7 +228,7 @@ object Object11_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -257,7 +257,7 @@ trait Trait12_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -286,7 +286,7 @@ class Class14_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -315,7 +315,7 @@ object Object15_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -344,7 +344,7 @@ trait Trait16_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -373,7 +373,7 @@ class Class18_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -402,7 +402,7 @@ object Object19_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -431,7 +431,7 @@ trait Trait20_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -460,7 +460,7 @@ class Class22_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -489,7 +489,7 @@ object Object23_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -518,7 +518,7 @@ trait Trait24_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -548,7 +548,7 @@ class Class26_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -579,7 +579,7 @@ object Object27_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -610,7 +610,7 @@ trait Trait28_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -641,7 +641,7 @@ class Class30_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -672,7 +672,7 @@ object Object31_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -703,7 +703,7 @@ trait Trait32_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -733,7 +733,7 @@ class Class34_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -762,7 +762,7 @@ object Object35_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -791,7 +791,7 @@ trait Trait36_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -820,7 +820,7 @@ class Class38_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -849,7 +849,7 @@ object Object39_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -878,7 +878,7 @@ trait Trait40_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -907,7 +907,7 @@ class Class42_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -936,7 +936,7 @@ object Object43_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -965,7 +965,7 @@ trait Trait44_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -994,7 +994,7 @@ class Class46_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -1023,7 +1023,7 @@ object Object47_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -1052,7 +1052,7 @@ trait Trait48_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -1081,7 +1081,7 @@ class Class50_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -1110,7 +1110,7 @@ object Object51_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -1139,7 +1139,7 @@ trait Trait52_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("failed "); e.printStackTrace()
+ case e: Throwable => print("failed "); e.printStackTrace()
}
}
@@ -1172,7 +1172,7 @@ class Class54_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1205,7 +1205,7 @@ object Object55_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1238,7 +1238,7 @@ trait Trait56_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1271,7 +1271,7 @@ class Class58_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1304,7 +1304,7 @@ object Object59_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1337,7 +1337,7 @@ trait Trait60_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1370,7 +1370,7 @@ class Class62_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1403,7 +1403,7 @@ object Object63_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1436,7 +1436,7 @@ trait Trait64_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1469,7 +1469,7 @@ class Class66_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1502,7 +1502,7 @@ object Object67_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1535,7 +1535,7 @@ trait Trait68_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1568,7 +1568,7 @@ class Class70_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1601,7 +1601,7 @@ object Object71_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1634,7 +1634,7 @@ trait Trait72_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1667,7 +1667,7 @@ class Class74_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1700,7 +1700,7 @@ object Object75_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1733,7 +1733,7 @@ trait Trait76_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1767,7 +1767,7 @@ class Class78_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1802,7 +1802,7 @@ object Object79_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1837,7 +1837,7 @@ trait Trait80_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1872,7 +1872,7 @@ class Class82_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1907,7 +1907,7 @@ object Object83_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1942,7 +1942,7 @@ trait Trait84_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -1976,7 +1976,7 @@ class Class90_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
@@ -2009,7 +2009,7 @@ trait Trait92_1 {
assert(ObjCounter == 1, "multiple instances: " + ObjCounter)
println("ok")
} catch {
- case e => print("multi-threaded failed "); e.printStackTrace()
+ case e: Throwable => print("multi-threaded failed "); e.printStackTrace()
}
}
diff --git a/test/files/run/interop_classtags_are_classmanifests.scala b/test/files/run/interop_classtags_are_classmanifests.scala
index 91b9d89c6e..62d85c3ce3 100644
--- a/test/files/run/interop_classtags_are_classmanifests.scala
+++ b/test/files/run/interop_classtags_are_classmanifests.scala
@@ -1,5 +1,6 @@
-import scala.reflect.{ClassTag, classTag}
+import scala.reflect.ClassTag
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
def classTagIsClassManifest[T: ClassTag] = {
println(classManifest[T])
@@ -8,4 +9,4 @@ object Test extends App {
classTagIsClassManifest[Int]
classTagIsClassManifest[String]
classTagIsClassManifest[Array[Int]]
-} \ No newline at end of file
+}
diff --git a/test/files/run/interop_manifests_are_classtags.scala b/test/files/run/interop_manifests_are_classtags.scala
index 03479e527a..705038ece7 100644
--- a/test/files/run/interop_manifests_are_classtags.scala
+++ b/test/files/run/interop_manifests_are_classtags.scala
@@ -1,5 +1,6 @@
import scala.reflect.{ClassTag, classTag}
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
def classManifestIsClassTag[T: ClassManifest] = {
println(classTag[T])
@@ -20,4 +21,4 @@ object Test extends App {
manifestIsClassTag[Int]
manifestIsClassTag[String]
manifestIsClassTag[Array[Int]]
-} \ No newline at end of file
+}
diff --git a/test/files/run/interpolationArgs.scala b/test/files/run/interpolationArgs.scala
index eb13767907..ffb254b63f 100644
--- a/test/files/run/interpolationArgs.scala
+++ b/test/files/run/interpolationArgs.scala
@@ -1,5 +1,5 @@
object Test extends App {
- try { scala.StringContext("p1", "p2", "p3").s("e1") } catch { case ex => println(ex) }
- try { scala.StringContext("p1").s("e1") } catch { case ex => println(ex) }
+ try { scala.StringContext("p1", "p2", "p3").s("e1") } catch { case ex: Throwable => println(ex) }
+ try { scala.StringContext("p1").s("e1") } catch { case ex: Throwable => println(ex) }
}
diff --git a/test/files/run/interpolationMultiline2.scala b/test/files/run/interpolationMultiline2.scala
index f6a682c3ce..2de4c4b22e 100644
--- a/test/files/run/interpolationMultiline2.scala
+++ b/test/files/run/interpolationMultiline2.scala
@@ -2,14 +2,15 @@ object Test extends App {
def test1(n: Int) = {
val old = "old"
- try { println(s"""Bob is ${s"$n"} years ${s"$old"}!""") } catch { case ex => println(ex) }
- try { println(s"""Bob is ${f"$n"} years ${s"$old"}!""") } catch { case ex => println(ex) }
- try { println(f"""Bob is ${s"$n"} years ${s"$old"}!""") } catch { case ex => println(ex) }
- try { println(f"""Bob is ${f"$n"} years ${s"$old"}!""") } catch { case ex => println(ex) }
- try { println(f"""Bob is ${f"$n%2d"} years ${s"$old"}!""") } catch { case ex => println(ex) }
- try { println(f"""Bob is ${s"$n%2d"} years ${s"$old"}!""") } catch { case ex => println(ex) }
- try { println(s"""Bob is ${f"$n%2d"} years ${s"$old"}!""") } catch { case ex => println(ex) }
- try { println(s"""Bob is ${s"$n%2d"} years ${s"$old"}!""") } catch { case ex => println(ex) }
+ val catcher: PartialFunction[Throwable, Unit] = { case e => println(e) }
+ try { println(s"""Bob is ${s"$n"} years ${s"$old"}!""") } catch catcher
+ try { println(s"""Bob is ${f"$n"} years ${s"$old"}!""") } catch catcher
+ try { println(f"""Bob is ${s"$n"} years ${s"$old"}!""") } catch catcher
+ try { println(f"""Bob is ${f"$n"} years ${s"$old"}!""") } catch catcher
+ try { println(f"""Bob is ${f"$n%2d"} years ${s"$old"}!""") } catch catcher
+ try { println(f"""Bob is ${s"$n%2d"} years ${s"$old"}!""") } catch catcher
+ try { println(s"""Bob is ${f"$n%2d"} years ${s"$old"}!""") } catch catcher
+ try { println(s"""Bob is ${s"$n%2d"} years ${s"$old"}!""") } catch catcher
}
test1(1)
diff --git a/test/files/run/io-position.scala b/test/files/run/io-position.scala
index 1093704fa4..b227846fb4 100644
--- a/test/files/run/io-position.scala
+++ b/test/files/run/io-position.scala
@@ -1,7 +1,5 @@
object Test {
- Console.setErr(Console.out)
-
- def main(args: Array[String]): Unit = {
+ def main(args: Array[String]): Unit = Console.withErr(Console.out) {
try {
xml.parsing.ConstructingParser.fromSource(io.Source.fromString("<foo>"), false).document()
} catch {
diff --git a/test/files/run/is-valid-num.scala b/test/files/run/is-valid-num.scala
index 402eff99d6..6d281d625f 100644
--- a/test/files/run/is-valid-num.scala
+++ b/test/files/run/is-valid-num.scala
@@ -1,3 +1,6 @@
+/*
+ * filter: inliner warning(s); re-run with -Yinline-warnings for details
+ */
object Test {
def x = BigInt("10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")
def y = BigDecimal("" + (Short.MaxValue + 1) + ".0")
diff --git a/test/files/run/issue192.scala b/test/files/run/issue192.scala
index d8db8b5816..3c3b44a8fb 100644
--- a/test/files/run/issue192.scala
+++ b/test/files/run/issue192.scala
@@ -1,3 +1,5 @@
+import scala.language.reflectiveCalls
+
object Test extends App {
def f1(p: Any{def unary_+ : Int}) = +p
diff --git a/test/files/run/iterator-from.scala b/test/files/run/iterator-from.scala
index 8dc6ae4e51..c8efa01b77 100644
--- a/test/files/run/iterator-from.scala
+++ b/test/files/run/iterator-from.scala
@@ -1,4 +1,6 @@
-// This file tests iteratorFrom, keysIteratorFrom, and valueIteratorFrom on various sorted sets and maps
+/* This file tests iteratorFrom, keysIteratorFrom, and valueIteratorFrom on various sorted sets and maps
+ * filter: inliner warning(s); re-run with -Yinline-warnings for details
+ */
import scala.util.{Random => R}
import scala.collection._
diff --git a/test/files/run/iterator-iterate-lazy.scala b/test/files/run/iterator-iterate-lazy.scala
index 73886f192b..92b170062e 100644
--- a/test/files/run/iterator-iterate-lazy.scala
+++ b/test/files/run/iterator-iterate-lazy.scala
@@ -1,5 +1,5 @@
object Test {
def main(args: Array[String]): Unit = {
- Iterator.iterate(1 to 5 toList)(_.tail).takeWhile(_.nonEmpty).map(_.head).toList
+ Iterator.iterate((1 to 5).toList)(_.tail).takeWhile(_.nonEmpty).map(_.head).toList
}
}
diff --git a/test/files/run/iterators.scala b/test/files/run/iterators.scala
index b85291cd72..e2d0f93a05 100644
--- a/test/files/run/iterators.scala
+++ b/test/files/run/iterators.scala
@@ -4,6 +4,8 @@
//############################################################################
+import scala.language.postfixOps
+
object Test {
def check_from: Int = {
diff --git a/test/files/run/json.scala b/test/files/run/json.scala
index a81f12564c..d9d28ba1ca 100644
--- a/test/files/run/json.scala
+++ b/test/files/run/json.scala
@@ -1,13 +1,17 @@
+/*
+ * filter: inliner warning(s); re-run with -Yinline-warnings for details
+ */
import scala.util.parsing.json._
import scala.collection.immutable.TreeMap
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
/* This method converts parsed JSON back into real JSON notation with objects in
* sorted-key order. Not required by the spec, but it allows us to do a stable
* toString comparison. */
def jsonToString(in : Any) : String = in match {
case l : List[_] => "[" + l.map(jsonToString).mkString(", ") + "]"
- case m : Map[String,_] => "{" + m.iterator.toList
+ case m : Map[String @unchecked,_] => "{" + m.iterator.toList
.sortWith({ (x,y) => x._1 < y._1 })
.map({ case (k,v) => "\"" + k + "\": " + jsonToString(v) })
.mkString(", ") + "}"
@@ -20,7 +24,7 @@ object Test extends App {
*/
def sortJSON(in : Any) : Any = in match {
case l : List[_] => l.map(sortJSON)
- case m : Map[String,_] => TreeMap(m.mapValues(sortJSON).iterator.toSeq : _*)
+ case m : Map[String @unchecked,_] => TreeMap(m.mapValues(sortJSON).iterator.toSeq : _*)
// For the object versions, sort their contents, ugly casts and all...
case JSONObject(data) => JSONObject(sortJSON(data).asInstanceOf[Map[String,Any]])
case JSONArray(data) => JSONArray(sortJSON(data).asInstanceOf[List[Any]])
diff --git a/test/files/run/lazy-exprs.check b/test/files/run/lazy-exprs.check
index e77d204251..2efb8ceb4a 100644
--- a/test/files/run/lazy-exprs.check
+++ b/test/files/run/lazy-exprs.check
@@ -1,3 +1,11 @@
+lazy-exprs.scala:38: warning: match may not be exhaustive.
+It would fail on the following input: Some((x: String forSome x not in Z1))
+ t match {
+ ^
+lazy-exprs.scala:62: warning: match may not be exhaustive.
+It would fail on the following input: Some((x: String forSome x not in LazyField))
+ t match {
+ ^
forced <z1>
lazy val in scrutinee: ok
forced <z1>
diff --git a/test/files/run/lazy-locals.check b/test/files/run/lazy-locals.check
index d1cc754f2c..9e88a55d18 100644
--- a/test/files/run/lazy-locals.check
+++ b/test/files/run/lazy-locals.check
@@ -1,3 +1,9 @@
+lazy-locals.scala:153: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ {
+ ^
+lazy-locals.scala:159: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ {
+ ^
forced lazy val q
q = 10
forced lazy val t
diff --git a/test/files/run/lists-run.scala b/test/files/run/lists-run.scala
index ccfe5bc260..5ff3ee353e 100644
--- a/test/files/run/lists-run.scala
+++ b/test/files/run/lists-run.scala
@@ -2,6 +2,8 @@
*
* @author Stephane Micheloud
*/
+import scala.language.postfixOps
+
object Test {
def main(args: Array[String]) {
Test_multiset.run() // multiset operations: union, intersect, diff
@@ -153,7 +155,7 @@ object Test3 {
List.range(1, 10, 0)
} catch {
case e: IllegalArgumentException => ()
- case _ => throw new Error("List.range(1, 10, 0)")
+ case _: Throwable => throw new Error("List.range(1, 10, 0)")
}
assert(List.range(10, 0, -2) == List(10, 8, 6, 4, 2))
}
diff --git a/test/files/run/literals.check b/test/files/run/literals.check
index f53c879dea..6be5137994 100644
--- a/test/files/run/literals.check
+++ b/test/files/run/literals.check
@@ -1,3 +1,4 @@
+warning: there were 13 deprecation warning(s); re-run with -deprecation for details
test '\u0024' == '$' was successful
test '\u005f' == '_' was successful
test 65.asInstanceOf[Char] == 'A' was successful
@@ -43,7 +44,6 @@ test 0x8000000000000000L == -9223372036854775808L was successful
test 0xffffffffffffffffL == -1L was successful
test 1e1f == 10.0f was successful
-test 2.f == 2.0f was successful
test .3f == 0.3f was successful
test 0f == 0.0f was successful
test 3.14f == 3.14f was successful
@@ -53,8 +53,6 @@ test 1.asInstanceOf[Float] == 1.0 was successful
test 1l.asInstanceOf[Float] == 1.0 was successful
test 1e1 == 10.0 was successful
-test 2. == 2.0 was successful
-test 2.d == 2.0 was successful
test .3 == 0.3 was successful
test 0.0 == 0.0 was successful
test 0d == 0.0 was successful
diff --git a/test/files/run/literals.scala b/test/files/run/literals.scala
index 32bc29fda8..7676125339 100644
--- a/test/files/run/literals.scala
+++ b/test/files/run/literals.scala
@@ -105,7 +105,7 @@ object Test {
// float
check_success("1e1f == 10.0f", 1e1f, 10.0f)
- check_success("2.f == 2.0f", 2.f, 2.0f)
+ //check_success("2.f == 2.0f", 2.f, 2.0f)
check_success(".3f == 0.3f", .3f, 0.3f)
check_success("0f == 0.0f", 0f, 0.0f)
check_success("3.14f == 3.14f", 3.14f, 3.14f)
@@ -118,8 +118,8 @@ object Test {
// double
check_success("1e1 == 10.0", 1e1, 10.0)
- check_success("2. == 2.0", 2., 2.0)
- check_success("2.d == 2.0", 2.d, 2.0)
+ //check_success("2. == 2.0", 2., 2.0)
+ //check_success("2.d == 2.0", 2.d, 2.0)
check_success(".3 == 0.3", .3, 0.3)
check_success("0.0 == 0.0", 0.0, 0.0)
check_success("0d == 0.0", 0d, 0.0)
diff --git a/test/files/run/macro-declared-in-anonymous/Macros_Test_2.scala b/test/files/run/macro-declared-in-anonymous/Macros_Test_2.scala
index 8bd8c172c9..88cd29ae4f 100644
--- a/test/files/run/macro-declared-in-anonymous/Macros_Test_2.scala
+++ b/test/files/run/macro-declared-in-anonymous/Macros_Test_2.scala
@@ -1,4 +1,6 @@
+import scala.language.reflectiveCalls
+
object Test extends App {
val macros = new { def foo = macro Impls.foo }
macros.foo
-} \ No newline at end of file
+}
diff --git a/test/files/run/macro-declared-in-refinement/Macros_Test_2.scala b/test/files/run/macro-declared-in-refinement/Macros_Test_2.scala
index f746c2da57..ff9a66d58a 100644
--- a/test/files/run/macro-declared-in-refinement/Macros_Test_2.scala
+++ b/test/files/run/macro-declared-in-refinement/Macros_Test_2.scala
@@ -1,6 +1,9 @@
+
+import scala.language.reflectiveCalls
+
class Base
object Test extends App {
val macros = new Base { def foo = macro Impls.foo }
macros.foo
-} \ No newline at end of file
+}
diff --git a/test/files/run/macro-duplicate.check b/test/files/run/macro-duplicate.check
index e69de29bb2..58781b719a 100644
--- a/test/files/run/macro-duplicate.check
+++ b/test/files/run/macro-duplicate.check
@@ -0,0 +1,3 @@
+Test_2.scala:5: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ Macros.foo
+ ^
diff --git a/test/files/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala b/test/files/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala
index 81ebd63c5f..22047eeb36 100644
--- a/test/files/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala
+++ b/test/files/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala
@@ -1,4 +1,5 @@
object Macros {
+ import scala.language.implicitConversions
implicit def foo(x: String): Option[Int] = macro Impls.foo
}
@@ -7,4 +8,4 @@ object Test extends App {
println("2": Option[Int])
val s: Int = "2" getOrElse 0
println(s)
-} \ No newline at end of file
+}
diff --git a/test/files/run/macro-expand-implicit-macro-is-view.flags b/test/files/run/macro-expand-implicit-macro-is-view.flags
deleted file mode 100644
index cd66464f2f..0000000000
--- a/test/files/run/macro-expand-implicit-macro-is-view.flags
+++ /dev/null
@@ -1 +0,0 @@
--language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala b/test/files/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala
index 0ff1fb80ca..0d99f32d7e 100644
--- a/test/files/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala
+++ b/test/files/run/macro-expand-implicit-macro-is-view/Macros_Test_2.scala
@@ -1,4 +1,7 @@
+
object Macros {
+ import scala.language.experimental.macros
+ import scala.language.implicitConversions
implicit def foo(x: String): Option[Int] = macro Impls.foo
}
@@ -6,4 +9,4 @@ object Test extends App {
import Macros._
def bar[T <% Option[Int]](x: T) = println(x)
println("2")
-} \ No newline at end of file
+}
diff --git a/test/files/run/manifests-new.scala b/test/files/run/manifests-new.scala
index f1596dee81..8b42e3ca73 100644
--- a/test/files/run/manifests-new.scala
+++ b/test/files/run/manifests-new.scala
@@ -1,3 +1,6 @@
+
+
+import scala.language.{ higherKinds, postfixOps }
import scala.reflect.runtime.universe._
object Test
@@ -146,4 +149,4 @@ object Test
}
def main(args: Array[String]): Unit = runAllTests
-} \ No newline at end of file
+}
diff --git a/test/files/run/manifests-old.scala b/test/files/run/manifests-old.scala
index 621689a254..d8b1e751d4 100644
--- a/test/files/run/manifests-old.scala
+++ b/test/files/run/manifests-old.scala
@@ -1,3 +1,6 @@
+import scala.language.{ higherKinds, postfixOps }
+
+@deprecated("Suppress warnings", since="2.11")
object Test
{
object Variances extends Enumeration {
@@ -144,4 +147,4 @@ object Test
}
def main(args: Array[String]): Unit = runAllTests
-} \ No newline at end of file
+}
diff --git a/test/files/run/mapConserve.scala b/test/files/run/mapConserve.scala
index 013095b1de..ffd9106fa9 100644
--- a/test/files/run/mapConserve.scala
+++ b/test/files/run/mapConserve.scala
@@ -1,3 +1,6 @@
+/*
+ * filter: inliner warning(s); re-run with -Yinline-warnings for details
+ */
import scala.annotation.tailrec
import scala.collection.mutable.ListBuffer
@@ -50,4 +53,4 @@ object Test {
checkStackOverflow();
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/misc.check b/test/files/run/misc.check
index 9fa7b72d50..56116f8104 100644
--- a/test/files/run/misc.check
+++ b/test/files/run/misc.check
@@ -1,3 +1,27 @@
+misc.scala:46: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ 42;
+ ^
+misc.scala:47: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ 42l;
+ ^
+misc.scala:48: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ 23.5f;
+ ^
+misc.scala:49: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ 23.5;
+ ^
+misc.scala:50: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ "Hello";
+ ^
+misc.scala:51: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ 32 + 45;
+ ^
+misc.scala:62: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ x;
+ ^
+misc.scala:74: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ 1 < 2;
+ ^
### Hello
### 17
### Bye
diff --git a/test/files/run/names-defaults.check b/test/files/run/names-defaults.check
index f253de71d6..0037822f3b 100644
--- a/test/files/run/names-defaults.check
+++ b/test/files/run/names-defaults.check
@@ -1,3 +1,7 @@
+names-defaults.scala:269: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ spawn(b = { val ttt = 1; ttt }, a = 0)
+ ^
+warning: there were 4 deprecation warning(s); re-run with -deprecation for details
1: @
get: $
get: 2
diff --git a/test/files/run/names-defaults.scala b/test/files/run/names-defaults.scala
index 220414f02a..05cd4a540c 100644
--- a/test/files/run/names-defaults.scala
+++ b/test/files/run/names-defaults.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ higherKinds, existentials }
+
object Test extends App {
def get[T](x: T) = { println("get: "+ x); x }
diff --git a/test/files/run/no-pickle-skolems/Test_2.scala b/test/files/run/no-pickle-skolems/Test_2.scala
index 90bb4c4f88..8fd6016aea 100644
--- a/test/files/run/no-pickle-skolems/Test_2.scala
+++ b/test/files/run/no-pickle-skolems/Test_2.scala
@@ -1,3 +1,5 @@
+
+import scala.language.reflectiveCalls
import scala.reflect.runtime.universe._
object Test {
diff --git a/test/files/run/option-fold.scala b/test/files/run/option-fold.scala
index d554ba4f9b..7e21403c2e 100644
--- a/test/files/run/option-fold.scala
+++ b/test/files/run/option-fold.scala
@@ -7,13 +7,14 @@ object Test {
def g(x: Option[A]) = x.fold(-1) {
case B => 0
case C(x) => x
+ case _ => ???
}
def main(args: Array[String]): Unit = {
- println(f(None))
- println(f(Some(5)))
- println(g(None))
- println(g(Some(B)))
- println(g(Some(C(1))))
+ println(f(None)) //List()
+ println(f(Some(5))) //List(5)
+ println(g(None)) //-1
+ println(g(Some(B))) //0
+ println(g(Some(C(1)))) //1
}
}
diff --git a/test/files/run/patmat-exprs.scala b/test/files/run/patmat-exprs.scala
index dfc78e2ca5..56e4e01598 100644
--- a/test/files/run/patmat-exprs.scala
+++ b/test/files/run/patmat-exprs.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ implicitConversions }
import runtime.ScalaRunTime
object Test {
@@ -576,4 +578,4 @@ trait Pattern {
implicit def long2Constant[T](l: Long)(implicit num: NumericOps[T]): Leaf[T] =
const(num.fromDouble(l.toDouble))
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/patmat_unapp_abstype-new.check b/test/files/run/patmat_unapp_abstype-new.check
index 42c54631d2..c5511e9516 100644
--- a/test/files/run/patmat_unapp_abstype-new.check
+++ b/test/files/run/patmat_unapp_abstype-new.check
@@ -1,3 +1,9 @@
+patmat_unapp_abstype-new.scala:21: warning: abstract type pattern TypesUser.this.TypeRef is unchecked since it is eliminated by erasure
+ case TypeRef(x) => println("TypeRef")
+ ^
+patmat_unapp_abstype-new.scala:53: warning: abstract type pattern Intermed.this.Foo is unchecked since it is eliminated by erasure
+ case Foo(x) => println("Foo")
+ ^
TypeRef
MethodType
Bar
diff --git a/test/files/run/patmatnew.check b/test/files/run/patmatnew.check
index e69de29bb2..56b8ac2f4f 100644
--- a/test/files/run/patmatnew.check
+++ b/test/files/run/patmatnew.check
@@ -0,0 +1,15 @@
+patmatnew.scala:351: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ case 1 => "OK"
+ ^
+patmatnew.scala:352: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ case 2 => assert(false); "KO"
+ ^
+patmatnew.scala:353: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ case 3 => assert(false); "KO"
+ ^
+patmatnew.scala:670: warning: This catches all Throwables. If this is really intended, use `case e : Throwable` to clear this warning.
+ case e => {
+ ^
+patmatnew.scala:489: warning: unreachable code
+ case _ if false =>
+ ^
diff --git a/test/files/run/patmatnew.scala b/test/files/run/patmatnew.scala
index a6f8199457..fb49e0c924 100644
--- a/test/files/run/patmatnew.scala
+++ b/test/files/run/patmatnew.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ postfixOps }
+
object Test {
def main(args: Array[String]) {
diff --git a/test/files/run/pc-conversions.scala b/test/files/run/pc-conversions.scala
index 60ee59c3c4..0a51d312e1 100644
--- a/test/files/run/pc-conversions.scala
+++ b/test/files/run/pc-conversions.scala
@@ -1,4 +1,6 @@
-
+/*
+ * filter: inliner warning(s); re-run with -Yinline-warnings for details
+ */
import collection._
diff --git a/test/files/run/pf-catch.scala b/test/files/run/pf-catch.scala
index ba0781fe89..dfe43dc750 100644
--- a/test/files/run/pf-catch.scala
+++ b/test/files/run/pf-catch.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ postfixOps }
object Test {
def shortName(x: AnyRef) = x.getClass.getName split '.' last
type Handler[+T] = PartialFunction[Throwable, T]
@@ -27,7 +29,7 @@ object Test {
def main(args: Array[String]): Unit = {
try f1
- catch { case x => println(shortName(x) + " slipped by.") }
+ catch { case x: Throwable => println(shortName(x) + " slipped by.") }
f2
}
diff --git a/test/files/run/preinits.check b/test/files/run/preinits.check
index 5584ab261e..e97a14b77f 100644
--- a/test/files/run/preinits.check
+++ b/test/files/run/preinits.check
@@ -1,3 +1,9 @@
+preinits.scala:2: warning: Implementation restriction: early definitions in traits are not initialized before the super class is initialized.
+trait B extends { override val x = 1 } with A { println("B") }
+ ^
+preinits.scala:3: warning: Implementation restriction: early definitions in traits are not initialized before the super class is initialized.
+trait C extends { override val x = 2 } with A
+ ^
A
B
2
diff --git a/test/files/run/primitive-sigs-2-new.scala b/test/files/run/primitive-sigs-2-new.scala
index cf6de9c81b..1f39667b18 100644
--- a/test/files/run/primitive-sigs-2-new.scala
+++ b/test/files/run/primitive-sigs-2-new.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ postfixOps }
import scala.reflect.{ClassTag, classTag}
import java.{ lang => jl }
@@ -29,4 +31,4 @@ object Test {
println(new C f)
c3m.sorted foreach println
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/primitive-sigs-2-old.scala b/test/files/run/primitive-sigs-2-old.scala
index b7152f7e3d..0a4be93f22 100644
--- a/test/files/run/primitive-sigs-2-old.scala
+++ b/test/files/run/primitive-sigs-2-old.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ postfixOps }
import java.{ lang => jl }
trait T[A] {
diff --git a/test/files/run/private-inline.check b/test/files/run/private-inline.check
index 209e3ef4b6..eee7f2973b 100644
--- a/test/files/run/private-inline.check
+++ b/test/files/run/private-inline.check
@@ -1 +1,7 @@
+private-inline.scala:24: warning: Could not inline required method wrapper1 because callee contains exception handlers / finally clause, and is invoked with non-empty operand stack.
+ def f1b() = identity(wrapper1(5))
+ ^
+private-inline.scala:29: warning: Could not inline required method wrapper2 because callee contains exception handlers / finally clause, and is invoked with non-empty operand stack.
+ def f2b() = identity(wrapper2(5))
+ ^
20
diff --git a/test/files/run/private-inline.flags b/test/files/run/private-inline.flags
index eb4d19bcb9..00d3643fd4 100644
--- a/test/files/run/private-inline.flags
+++ b/test/files/run/private-inline.flags
@@ -1 +1 @@
--optimise \ No newline at end of file
+-optimise -Yinline-warnings
diff --git a/test/files/run/private-inline.scala b/test/files/run/private-inline.scala
index a62007779c..72cabaeff0 100644
--- a/test/files/run/private-inline.scala
+++ b/test/files/run/private-inline.scala
@@ -43,7 +43,7 @@ object Test {
val foundClass = (
try Class.forName(clazz)
- catch { case _ => null }
+ catch { case _: Throwable => null }
)
assert(foundClass == null, foundClass)
diff --git a/test/files/run/programmatic-main.scala b/test/files/run/programmatic-main.scala
index 7bc5c5dfcf..08335ca6f6 100644
--- a/test/files/run/programmatic-main.scala
+++ b/test/files/run/programmatic-main.scala
@@ -1,3 +1,5 @@
+
+import scala.language.postfixOps
import scala.tools.nsc._
import io.Path
diff --git a/test/files/run/records.scala b/test/files/run/records.scala
index 96b0b4cb0f..bae0d943ff 100644
--- a/test/files/run/records.scala
+++ b/test/files/run/records.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ reflectiveCalls }
+
trait C {
def f: Int
}
diff --git a/test/files/run/reflection-allmirrors-tostring.scala b/test/files/run/reflection-allmirrors-tostring.scala
index 0ca387a6b1..41bab5ac0e 100644
--- a/test/files/run/reflection-allmirrors-tostring.scala
+++ b/test/files/run/reflection-allmirrors-tostring.scala
@@ -1,3 +1,5 @@
+
+import scala.language.higherKinds
import scala.reflect.runtime.universe._
class C {
@@ -40,4 +42,4 @@ object Test extends App {
val cc = typeOf[C].member(TypeName("C")).asClass
println(cm.reflectClass(c).reflectConstructor(c.typeSignature.member(nme.CONSTRUCTOR).asMethod))
println(im.reflectClass(cc).reflectConstructor(cc.typeSignature.member(nme.CONSTRUCTOR).asMethod))
-} \ No newline at end of file
+}
diff --git a/test/files/run/reflection-implicit.scala b/test/files/run/reflection-implicit.scala
index 0bcb0bc3a0..f2b3ba960c 100644
--- a/test/files/run/reflection-implicit.scala
+++ b/test/files/run/reflection-implicit.scala
@@ -1,3 +1,5 @@
+
+import scala.language.implicitConversions
import scala.reflect.runtime.universe._
class C {
@@ -12,4 +14,4 @@ object Test extends App {
val param = decls.find(_.name.toString == "d").get.asMethod.paramss.last.head
param.typeSignature
println(param.isImplicit)
-} \ No newline at end of file
+}
diff --git a/test/files/run/reflection-magicsymbols-vanilla.scala b/test/files/run/reflection-magicsymbols-vanilla.scala
index 26b70460eb..2bde3d8874 100644
--- a/test/files/run/reflection-magicsymbols-vanilla.scala
+++ b/test/files/run/reflection-magicsymbols-vanilla.scala
@@ -1,3 +1,5 @@
+import scala.language.postfixOps
+
class A {
def foo1(x: Int*) = ???
def foo2(x: => Int) = ???
diff --git a/test/files/run/reify-each-node-type.scala b/test/files/run/reify-each-node-type.scala
index a827da766d..425061f955 100644
--- a/test/files/run/reify-each-node-type.scala
+++ b/test/files/run/reify-each-node-type.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ existentials, postfixOps }
import scala.reflect.runtime.universe._
object r {
diff --git a/test/files/run/reify_ann1b.check b/test/files/run/reify_ann1b.check
index bc046a7455..a046dafeab 100644
--- a/test/files/run/reify_ann1b.check
+++ b/test/files/run/reify_ann1b.check
@@ -1,3 +1,8 @@
+reify_ann1b.scala:6: warning: Implementation restriction: subclassing Classfile does not
+make your annotation visible at runtime. If that is what
+you want, you must write the annotation class in Java.
+class ann(bar: String) extends annotation.ClassfileAnnotation
+ ^
{
@new ann(bar = "1a") @new ann(bar = "1b") class C[@new ann(bar = "2a") @new ann(bar = "2b") T] extends AnyRef {
@new ann(bar = "3a") @new ann(bar = "3b") <paramaccessor> private[this] val x: T @ann(bar = "4a") @ann(bar = "4b") = _;
diff --git a/test/files/run/reify_classfileann_a.check b/test/files/run/reify_classfileann_a.check
index 0c919020a8..51f255b232 100644
--- a/test/files/run/reify_classfileann_a.check
+++ b/test/files/run/reify_classfileann_a.check
@@ -1,3 +1,8 @@
+reify_classfileann_a.scala:6: warning: Implementation restriction: subclassing Classfile does not
+make your annotation visible at runtime. If that is what
+you want, you must write the annotation class in Java.
+class ann(bar: String, quux: Array[String] = Array(), baz: ann = null) extends annotation.ClassfileAnnotation
+ ^
{
@new ann(bar = "1", quux = Array("2", "3"), baz = new ann(bar = "4")) class C extends AnyRef {
def <init>() = {
diff --git a/test/files/run/reify_classfileann_b.check b/test/files/run/reify_classfileann_b.check
index c204fa8dc0..05f2e5bfc6 100644
--- a/test/files/run/reify_classfileann_b.check
+++ b/test/files/run/reify_classfileann_b.check
@@ -1,3 +1,8 @@
+reify_classfileann_b.scala:6: warning: Implementation restriction: subclassing Classfile does not
+make your annotation visible at runtime. If that is what
+you want, you must write the annotation class in Java.
+class ann(bar: String, quux: Array[String] = Array(), baz: ann = null) extends annotation.ClassfileAnnotation
+ ^
{
class C extends AnyRef {
def <init>() = {
diff --git a/test/files/run/reify_extendbuiltins.scala b/test/files/run/reify_extendbuiltins.scala
index a2d546579d..46d5b7e55e 100644
--- a/test/files/run/reify_extendbuiltins.scala
+++ b/test/files/run/reify_extendbuiltins.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ implicitConversions, postfixOps }
import scala.reflect.runtime.universe._
import scala.tools.reflect.Eval
@@ -12,4 +14,4 @@ object Test extends App {
println("10! = " + (10!))
}.eval
-} \ No newline at end of file
+}
diff --git a/test/files/run/reify_implicits-new.scala b/test/files/run/reify_implicits-new.scala
index 42a1deef26..1d90d907ea 100644
--- a/test/files/run/reify_implicits-new.scala
+++ b/test/files/run/reify_implicits-new.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ implicitConversions, reflectiveCalls }
import scala.reflect.{ClassTag, classTag}
import scala.reflect.runtime.universe._
import scala.tools.reflect.Eval
@@ -13,4 +15,4 @@ object Test extends App {
val x = Array(2, 3, 1, 4)
println("x = "+ x.sort((x: Int, y: Int) => x < y).toList)
}.eval
-} \ No newline at end of file
+}
diff --git a/test/files/run/reify_implicits-old.scala b/test/files/run/reify_implicits-old.scala
index 8ff256d2d4..a4e90488e5 100644
--- a/test/files/run/reify_implicits-old.scala
+++ b/test/files/run/reify_implicits-old.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ implicitConversions, reflectiveCalls }
import scala.reflect.runtime.universe._
import scala.tools.reflect.Eval
@@ -12,4 +14,4 @@ object Test extends App {
val x = Array(2, 3, 1, 4)
println("x = "+ x.sort((x: Int, y: Int) => x < y).toList)
}.eval
-} \ No newline at end of file
+}
diff --git a/test/files/run/reify_lazyevaluation.scala b/test/files/run/reify_lazyevaluation.scala
index 5b310d95f7..3f2530ddee 100644
--- a/test/files/run/reify_lazyevaluation.scala
+++ b/test/files/run/reify_lazyevaluation.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ implicitConversions }
import scala.reflect.runtime.universe._
import scala.tools.reflect.Eval
diff --git a/test/files/run/reify_lazyunit.check b/test/files/run/reify_lazyunit.check
index 1b46c909be..579ecfe8aa 100644
--- a/test/files/run/reify_lazyunit.check
+++ b/test/files/run/reify_lazyunit.check
@@ -1,3 +1,6 @@
+reify_lazyunit.scala:6: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ lazy val x = { 0; println("12")}
+ ^
12
one
two
diff --git a/test/files/run/reify_printf.check b/test/files/run/reify_printf.check
index e69de29bb2..3b18e512db 100644
--- a/test/files/run/reify_printf.check
+++ b/test/files/run/reify_printf.check
@@ -0,0 +1 @@
+hello world
diff --git a/test/files/run/reify_printf.scala b/test/files/run/reify_printf.scala
index 9932a58dfa..c4ade79837 100644
--- a/test/files/run/reify_printf.scala
+++ b/test/files/run/reify_printf.scala
@@ -9,13 +9,13 @@ import scala.reflect.internal.Types
import scala.util.matching.Regex
object Test extends App {
- val output = new ByteArrayOutputStream()
- Console.setOut(new PrintStream(output))
+ //val output = new ByteArrayOutputStream()
+ //Console.setOut(new PrintStream(output))
val toolbox = cm.mkToolBox()
val tree = tree_printf(reify("hello %s").tree, reify("world").tree)
val evaluated = toolbox.eval(tree)
- assert(output.toString() == "hello world", output.toString() +" == hello world")
+ //assert(output.toString() == "hello world", output.toString() +" == hello world")
/*
// upd. Oh, good old times, our very-very first experiments with macros :)
@@ -68,4 +68,4 @@ object Test extends App {
): Tree
Block((evals ++ prints).toList, Literal(Constant(())))
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/repl-backticks.scala b/test/files/run/repl-backticks.scala
index 5eaa1ec4c1..ec2691d9c5 100644
--- a/test/files/run/repl-backticks.scala
+++ b/test/files/run/repl-backticks.scala
@@ -8,7 +8,7 @@ object Test {
`yield`
</code>.text
- def main(args: Array[String]) = {
+ def main(args: Array[String]) {
val settings = new Settings()
settings.classpath.value = System.getProperty("java.class.path")
val repl = new interpreter.IMain(settings)
diff --git a/test/files/run/resetattrs-this.scala b/test/files/run/resetattrs-this.scala
index 12afa3d712..2a55437273 100644
--- a/test/files/run/resetattrs-this.scala
+++ b/test/files/run/resetattrs-this.scala
@@ -4,8 +4,8 @@ import scala.tools.reflect.ToolBox
object Test extends App {
val tb = cm.mkToolBox()
- val tree = Select(This(cm.staticPackage("scala").moduleClass), newTermName("Predef"))
+ val tree = Select(This(cm.staticPackage("scala").moduleClass), TermName("Predef"))
val ttree = tb.typeCheck(tree)
val rttree = tb.resetAllAttrs(ttree)
println(tb.eval(rttree) == Predef)
-} \ No newline at end of file
+}
diff --git a/test/files/run/richs.scala b/test/files/run/richs.scala
index 5ee573673d..4b5345757c 100644
--- a/test/files/run/richs.scala
+++ b/test/files/run/richs.scala
@@ -11,8 +11,8 @@ trait RichTest {
val cn = this.getClass().getName()
cn.substring(0, cn.length-1)
}
- def length[A](it: Iterator[A]) = it.toList length
- def length[A](it: Iterable[A]) = it.toList length
+ def length[A](it: Iterator[A]) = it.toList.length
+ def length[A](it: Iterable[A]) = it.toList.length
def run: Unit
}
object RichCharTest1 extends RichTest {
diff --git a/test/files/run/runtime.check b/test/files/run/runtime.check
index 990a087da0..d613c9bd42 100644
--- a/test/files/run/runtime.check
+++ b/test/files/run/runtime.check
@@ -1,3 +1,9 @@
+runtime.scala:141: warning: comparing values of types Null and Null using `eq' will always yield true
+ check(true , null eq null, null ne null);
+ ^
+runtime.scala:141: warning: comparing values of types Null and Null using `ne' will always yield false
+ check(true , null eq null, null ne null);
+ ^
<<< Test0
[false,true]
[0,1,2]
diff --git a/test/files/run/runtime.scala b/test/files/run/runtime.scala
index a2ac204e8a..89348b294d 100644
--- a/test/files/run/runtime.scala
+++ b/test/files/run/runtime.scala
@@ -171,7 +171,7 @@ object Test {
try {
test;
} catch {
- case exception => {
+ case exception: Throwable => {
//val name: String = Thread.currentThread().getName();
Console.print("Exception in thread \"" + name + "\" " + exception);
Console.println;
diff --git a/test/files/run/sequenceComparisons.scala b/test/files/run/sequenceComparisons.scala
index 5d7958bc7e..f8ef17d77d 100644
--- a/test/files/run/sequenceComparisons.scala
+++ b/test/files/run/sequenceComparisons.scala
@@ -82,7 +82,7 @@ object Test {
val sameElementsInputs = (
List(List(1,2,3,4,5)),
- List(Nil, List(1), List(1,2), List(2,3,4), List(2,3,4,5), List(2,3,4,5,1), List(1,2,3,5,4), seq reverse)
+ List(Nil, List(1), List(1,2), List(2,3,4), List(2,3,4,5), List(2,3,4,5,1), List(1,2,3,5,4), seq.reverse)
)
}
diff --git a/test/files/run/settings-parse.scala b/test/files/run/settings-parse.scala
index 2b04f55b24..2754feb972 100644
--- a/test/files/run/settings-parse.scala
+++ b/test/files/run/settings-parse.scala
@@ -1,3 +1,5 @@
+
+import scala.language.postfixOps
import scala.tools.nsc._
object Test {
diff --git a/test/files/run/si5045.scala b/test/files/run/si5045.scala
index e198b101f3..b0c3a4ddc4 100644
--- a/test/files/run/si5045.scala
+++ b/test/files/run/si5045.scala
@@ -1,3 +1,6 @@
+
+import scala.language.postfixOps
+
object Test extends App {
import scala.util.matching.{ Regex, UnanchoredRegex }
diff --git a/test/files/run/slices.scala b/test/files/run/slices.scala
index e31ea4046f..107b8e658a 100644
--- a/test/files/run/slices.scala
+++ b/test/files/run/slices.scala
@@ -1,3 +1,6 @@
+
+import scala.language.postfixOps
+
object Test extends App {
// lists
diff --git a/test/files/run/spec-nlreturn.scala b/test/files/run/spec-nlreturn.scala
index ec5e7229d3..a84160ecca 100644
--- a/test/files/run/spec-nlreturn.scala
+++ b/test/files/run/spec-nlreturn.scala
@@ -1,7 +1,8 @@
+
object Test {
def f(): Int = {
try {
- val g = 1 to 10 map { i => return 16 ; i } sum;
+ val g = (1 to 10 map { i => return 16 ; i }).sum
g
}
catch { case x: runtime.NonLocalReturnControl[_] =>
diff --git a/test/files/run/stream_flatmap_odds.scala b/test/files/run/stream_flatmap_odds.scala
index 6fb202ca68..1935253595 100644
--- a/test/files/run/stream_flatmap_odds.scala
+++ b/test/files/run/stream_flatmap_odds.scala
@@ -1,4 +1,4 @@
object Test extends App {
lazy val odds: Stream[Int] = Stream(1) append ( odds flatMap {x => Stream(x + 2)} )
- println(odds take 42 force)
+ Console println (odds take 42).force
}
diff --git a/test/files/run/stringbuilder-drop.scala b/test/files/run/stringbuilder-drop.scala
index a9e5a71762..422fb2bc7c 100644
--- a/test/files/run/stringbuilder-drop.scala
+++ b/test/files/run/stringbuilder-drop.scala
@@ -1,7 +1,7 @@
object Test {
def main(args: Array[String]): Unit = {
- val s = (new StringBuilder ++= "hello world") dropRight 1 toString;
- assert(s == "hello worl")
+ val s = (new StringBuilder ++= "hello world") dropRight 1
+ assert("" + s == "hello worl")
}
}
diff --git a/test/files/run/stringbuilder.scala b/test/files/run/stringbuilder.scala
index ef85fc02a6..a88ea38b92 100644
--- a/test/files/run/stringbuilder.scala
+++ b/test/files/run/stringbuilder.scala
@@ -1,3 +1,6 @@
+
+import scala.language.reflectiveCalls
+
object Test extends App {
val str = "ABCDEFGHIJKLMABCDEFGHIJKLM"
val surrogateStr = "an old Turkic letter: \uD803\uDC22"
@@ -33,8 +36,8 @@ object Test extends App {
sameAnswers(_.lastIndexOf("KLM", 22))
// testing that the "reverse" implementation avoids reversing surrogate pairs
- val jsb = new JavaStringBuilder(surrogateStr) reverse
- val ssb = new ScalaStringBuilder(surrogateStr) reverseContents ;
+ val jsb = new JavaStringBuilder(surrogateStr).reverse
+ val ssb = new ScalaStringBuilder(surrogateStr).reverseContents
assert(jsb.toString == ssb.toString)
}
diff --git a/test/files/run/stringinterpolation_macro-run.scala b/test/files/run/stringinterpolation_macro-run.scala
index 9c59c334f8..4c43f2059e 100644
--- a/test/files/run/stringinterpolation_macro-run.scala
+++ b/test/files/run/stringinterpolation_macro-run.scala
@@ -1,3 +1,6 @@
+/*
+ * filter: inliner warning(s); re-run with -Yinline-warnings for details
+ */
object Test extends App {
// 'b' / 'B' (category: general)
diff --git a/test/files/run/structural.scala b/test/files/run/structural.scala
index 3a703d2cf1..2788717ec2 100644
--- a/test/files/run/structural.scala
+++ b/test/files/run/structural.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ reflectiveCalls }
+
object test1 {
val o1 = new Object { override def toString = "ohone" }
@@ -164,7 +167,7 @@ object test3 {
}
catch {
case e: Exc => println("caught")
- case e => println(e)
+ case e: Throwable => println(e)
}
m(Rec)
diff --git a/test/files/run/synchronized.check b/test/files/run/synchronized.check
index dd9f4ef424..6e99739633 100644
--- a/test/files/run/synchronized.check
+++ b/test/files/run/synchronized.check
@@ -1,3 +1,4 @@
+warning: there were 14 inliner warning(s); re-run with -Yinline-warnings for details
.|. c1.f1: OK
.|. c1.fi: OK
.|... c1.fv: OK
diff --git a/test/files/run/synchronized.flags b/test/files/run/synchronized.flags
index 1182725e86..49d036a887 100644
--- a/test/files/run/synchronized.flags
+++ b/test/files/run/synchronized.flags
@@ -1 +1 @@
--optimize \ No newline at end of file
+-optimize
diff --git a/test/files/run/t0325.scala b/test/files/run/t0325.scala
index 92331ab05f..048303206c 100644
--- a/test/files/run/t0325.scala
+++ b/test/files/run/t0325.scala
@@ -24,7 +24,7 @@ object Test {
else
println(ret)
} catch {
- case e@_ => println(which + " failed with " + e.getClass)
+ case e: Throwable => println(which + " failed with " + e.getClass)
}
}
diff --git a/test/files/run/t0421-old.scala b/test/files/run/t0421-old.scala
index 8d51013924..9b88b4789b 100644
--- a/test/files/run/t0421-old.scala
+++ b/test/files/run/t0421-old.scala
@@ -1,4 +1,6 @@
// ticket #421
+
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
def transpose[A: ClassManifest](xss: Array[Array[A]]) = {
diff --git a/test/files/run/t0432.scala b/test/files/run/t0432.scala
index 8ba9015d81..b860a0874f 100644
--- a/test/files/run/t0432.scala
+++ b/test/files/run/t0432.scala
@@ -1,3 +1,6 @@
+
+import scala.language.reflectiveCalls
+
object Test {
type valueType = { def value: this.type }
diff --git a/test/files/run/t0528.scala b/test/files/run/t0528.scala
index a76f602ed3..68a9975173 100644
--- a/test/files/run/t0528.scala
+++ b/test/files/run/t0528.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ existentials }
trait Sequ[A] {
def toArray: Array[T forSome {type T <: A}]
}
diff --git a/test/files/run/t0677-old.scala b/test/files/run/t0677-old.scala
index 6c8a3a7e99..c0f1abae53 100644
--- a/test/files/run/t0677-old.scala
+++ b/test/files/run/t0677-old.scala
@@ -1,3 +1,6 @@
+
+
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
class X[T: ClassManifest] {
val a = Array.ofDim[T](3, 4)
diff --git a/test/files/run/t1005.scala b/test/files/run/t1005.scala
index 60129bcc51..575ec43565 100644
--- a/test/files/run/t1005.scala
+++ b/test/files/run/t1005.scala
@@ -1,19 +1,20 @@
+import scala.language.postfixOps
object Test
{
class Foo[T](x : Array[AnyRef]) { def bar = x.asInstanceOf[Array[T]] }
class Bar[T](x : Array[T]) { def bar = x.asInstanceOf[Array[AnyRef]] }
object FromMono{
- def main(args : Array[String]) = (new Foo[AnyRef](Array[AnyRef]("Halp!"))).bar
+ def mainer(args : Array[String]) = (new Foo[AnyRef](Array[AnyRef]("Halp!"))).bar
}
object FromPoly{
- def main(args : Array[String]) = (new Bar[AnyRef](Array[AnyRef]("Halp!"))).bar
+ def mainer(args : Array[String]) = (new Bar[AnyRef](Array[AnyRef]("Halp!"))).bar
}
def main(args: Array[String]): Unit = {
- println(FromMono main null mkString)
- println(FromPoly main null mkString)
+ println(FromMono mainer null mkString)
+ println(FromPoly mainer null mkString)
}
}
diff --git a/test/files/run/t1110.scala b/test/files/run/t1110.scala
index 824643868c..81917789c8 100644
--- a/test/files/run/t1110.scala
+++ b/test/files/run/t1110.scala
@@ -1,8 +1,12 @@
+
+
+import scala.language.{ reflectiveCalls }
+
class Stuff {
def zoop(p: Any{def &(q: Int): Int}) = p & 7
def floop = new { def & = "Hello" }
- assert((floop &) == "Hello")
+ assert((floop.&) == "Hello")
assert(zoop(10) == 2)
}
diff --git a/test/files/run/t1141.scala b/test/files/run/t1141.scala
index ee4f2e7fd2..b907b4798f 100644
--- a/test/files/run/t1141.scala
+++ b/test/files/run/t1141.scala
@@ -1,3 +1,7 @@
+
+
+import scala.language.reflectiveCalls
+
object Test extends App {
val foo = new {
def apply(args : String*) = args foreach println
diff --git a/test/files/run/t1195-new.scala b/test/files/run/t1195-new.scala
index 0f62b140c9..4f068c7d42 100644
--- a/test/files/run/t1195-new.scala
+++ b/test/files/run/t1195-new.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ existentials }
import scala.reflect.runtime.universe._
object Test {
@@ -25,4 +27,4 @@ class A1[T] {
class B1[U] {
def f = { case class D(x: Int) extends A1[String] ; new D(5) }
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/t1195-old.scala b/test/files/run/t1195-old.scala
index b46a3b70f5..f80734c228 100644
--- a/test/files/run/t1195-old.scala
+++ b/test/files/run/t1195-old.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ existentials }
+
object Test {
def f() = { case class Bar(x: Int); Bar }
def g() = { case class Bar(x: Int); Bar(5) }
diff --git a/test/files/run/t1368.check b/test/files/run/t1368.check
new file mode 100644
index 0000000000..581e8a4039
--- /dev/null
+++ b/test/files/run/t1368.check
@@ -0,0 +1,3 @@
+t1368.scala:7: warning: Reference to uninitialized value blurp
+ def go3 = (new AnyRef with Happy with Sad { override val status = blurp ; val blurp = "happysad" }).status
+ ^
diff --git a/test/files/run/t1427.check b/test/files/run/t1427.check
new file mode 100644
index 0000000000..11a3d2f4a9
--- /dev/null
+++ b/test/files/run/t1427.check
@@ -0,0 +1,3 @@
+t1427.scala:6: warning: abstract type X in type pattern Bob[_[_] <: Any] is unchecked since it is eliminated by erasure
+ case x: (Bob[X] forSome { type X[_] }) => true
+ ^
diff --git a/test/files/run/t1427.scala b/test/files/run/t1427.scala
index 21bd71ffef..eeb2603c26 100644
--- a/test/files/run/t1427.scala
+++ b/test/files/run/t1427.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ higherKinds }
+
class Bob[K[_]] {
def foo(other: Any) = other match {
case x: (Bob[X] forSome { type X[_] }) => true
diff --git a/test/files/run/t1500.scala b/test/files/run/t1500.scala
index 6d2e7ee05f..75a6e31cdf 100644
--- a/test/files/run/t1500.scala
+++ b/test/files/run/t1500.scala
@@ -16,7 +16,7 @@ object Test {
</code>.text
- def main(args: Array[String]) = {
+ def main(args: Array[String]) {
val settings = new Settings()
settings.classpath.value = System.getProperty("java.class.path")
diff --git a/test/files/run/t1501.scala b/test/files/run/t1501.scala
index a2f7bb3a65..71ad0aeb5c 100644
--- a/test/files/run/t1501.scala
+++ b/test/files/run/t1501.scala
@@ -27,7 +27,7 @@ object Test {
</code>.text
- def main(args: Array[String]) = {
+ def main(args: Array[String]) {
val settings = new Settings()
settings.classpath.value = System.getProperty("java.class.path")
val tool = new interpreter.IMain(settings)
diff --git a/test/files/run/t153.scala b/test/files/run/t153.scala
index 82492fdbe6..3fdb423865 100644
--- a/test/files/run/t153.scala
+++ b/test/files/run/t153.scala
@@ -1,5 +1,5 @@
object Test extends App {
def powers(x: Int) = if ((x&(x-1))==0) Some(x) else None
val res = (Stream.range(1, 500000) flatMap powers).reverse
- println(res take 42 force)
+ println((res take 42).force)
}
diff --git a/test/files/run/t1766.scala b/test/files/run/t1766.scala
index 2afd883755..7d12451092 100644
--- a/test/files/run/t1766.scala
+++ b/test/files/run/t1766.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ reflectiveCalls }
+
object Test extends App {
class C(s: String) {
diff --git a/test/files/run/t2106.check b/test/files/run/t2106.check
new file mode 100644
index 0000000000..b14e9d1c41
--- /dev/null
+++ b/test/files/run/t2106.check
@@ -0,0 +1,3 @@
+t2106.scala:7: warning: Could not inline required method foo because access level required by callee not matched by caller.
+ def main(args: Array[String]): Unit = x.foo
+ ^
diff --git a/test/files/run/t2106.flags b/test/files/run/t2106.flags
index eb4d19bcb9..00d3643fd4 100644
--- a/test/files/run/t2106.flags
+++ b/test/files/run/t2106.flags
@@ -1 +1 @@
--optimise \ No newline at end of file
+-optimise -Yinline-warnings
diff --git a/test/files/run/t2106.scala b/test/files/run/t2106.scala
index e8124dabab..55b89da805 100644
--- a/test/files/run/t2106.scala
+++ b/test/files/run/t2106.scala
@@ -4,5 +4,5 @@ class A extends Cloneable {
object Test {
val x = new A
- def main(args: Array[String]) = x.foo
+ def main(args: Array[String]): Unit = x.foo
}
diff --git a/test/files/run/t2308a.scala b/test/files/run/t2308a.scala
index abb568064a..200dee1ef6 100644
--- a/test/files/run/t2308a.scala
+++ b/test/files/run/t2308a.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ higherKinds }
object Test {
trait T[M[_]]
diff --git a/test/files/run/t2318.scala b/test/files/run/t2318.scala
index 47d083eb9d..d7fd9fdd41 100644
--- a/test/files/run/t2318.scala
+++ b/test/files/run/t2318.scala
@@ -1,5 +1,7 @@
import java.security._
+import scala.language.{ reflectiveCalls }
+
object Test {
trait Bar { def bar: Unit }
diff --git a/test/files/run/t2333.scala b/test/files/run/t2333.scala
index da43386572..7dc7a92df2 100644
--- a/test/files/run/t2333.scala
+++ b/test/files/run/t2333.scala
@@ -1,7 +1,7 @@
class A {
def whatever() {
lazy val a = 1
- lazy val b = try { 2 } catch { case _ => 0 }
+ lazy val b = try { 2 } catch { case _: Throwable => 0 }
a
b
@@ -13,4 +13,4 @@ object Test {
val a = new A
a.whatever
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/t2417.scala b/test/files/run/t2417.scala
index 2d0bc2d405..18b6c326b5 100644
--- a/test/files/run/t2417.scala
+++ b/test/files/run/t2417.scala
@@ -8,7 +8,7 @@ object Test {
try {
block
} catch {
- case x => failure = x
+ case x: Throwable => failure = x
}
}
})
diff --git a/test/files/run/t2514.scala b/test/files/run/t2514.scala
index 21c4afb472..cf5fa0ea02 100644
--- a/test/files/run/t2514.scala
+++ b/test/files/run/t2514.scala
@@ -1,3 +1,7 @@
+
+
+import scala.language.{ implicitConversions, postfixOps, reflectiveCalls }
+
object Test
{
implicit def x[A](a: A) = new { def xx = a }
@@ -12,4 +16,4 @@ object Test
assert(r5 == 24)
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/t2594_tcpoly.scala b/test/files/run/t2594_tcpoly.scala
index e759ca8b0f..a9d26693f9 100644
--- a/test/files/run/t2594_tcpoly.scala
+++ b/test/files/run/t2594_tcpoly.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ higherKinds }
+
trait Monad[M[_]] {
def foo[A](a: M[A]): M[A]
}
@@ -15,4 +18,4 @@ object Test {
}
def main(as: Array[String]) { BarMonad[Int] foo (new Bar[Int, Int]) }
-} \ No newline at end of file
+}
diff --git a/test/files/run/t2636.scala b/test/files/run/t2636.scala
index 3271f79ffc..6ae2248a26 100644
--- a/test/files/run/t2636.scala
+++ b/test/files/run/t2636.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ reflectiveCalls }
+
object Test
{
type Foo = { def update(x: Int, value: String): Unit }
@@ -32,4 +35,4 @@ object Test
assert(arrApply(arr, 1) == "o")
assert(arrApply(new { def apply(x: Int) = "tom" }, -100) == "tom")
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/t3038d.scala b/test/files/run/t3038d.scala
index 9550165235..56cfcdb174 100644
--- a/test/files/run/t3038d.scala
+++ b/test/files/run/t3038d.scala
@@ -21,7 +21,7 @@ class Bar extends Foo with Serializable {
def size = a
@transient var second: Any = null
- def checkMember { first }
+ def checkMember { if (first == null) print("") }
private def writeObject(out: java.io.ObjectOutputStream) {
serializeTo(out)
diff --git a/test/files/run/t3050.scala b/test/files/run/t3050.scala
index ca9d91e191..65b2674b69 100644
--- a/test/files/run/t3050.scala
+++ b/test/files/run/t3050.scala
@@ -2,7 +2,7 @@ object Test {
def main(args: Array[String]): Unit = {
val x =
try { ("": Any) match { case List(_*) => true } }
- catch { case _ => false }
+ catch { case _: Throwable => false }
assert(!x)
}
diff --git a/test/files/run/t3175.scala b/test/files/run/t3175.scala
index aff2e67d0d..5c6daead38 100644
--- a/test/files/run/t3175.scala
+++ b/test/files/run/t3175.scala
@@ -1,6 +1,9 @@
/** A bit down the road this test will examine
* the bytecode.
*/
+
+import scala.language.reflectiveCalls
+
object Test {
def len(x:{ def length: Int }) = x.length
def f1(x:{ def apply(x: Int): Long }) = x(0)
diff --git a/test/files/run/t3232.scala b/test/files/run/t3232.scala
index feff7e7089..4c6cb1e35c 100644
--- a/test/files/run/t3232.scala
+++ b/test/files/run/t3232.scala
@@ -15,7 +15,7 @@ object Test {
// exception required
List(e1, e2) foreach { f =>
try { f() ; assert(false) }
- catch { case _ => () }
+ catch { case _: Throwable => () }
}
}
}
diff --git a/test/files/run/t3242.scala b/test/files/run/t3242.scala
index f8defaa5cd..0a449d51f9 100644
--- a/test/files/run/t3242.scala
+++ b/test/files/run/t3242.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ higherKinds }
+
object Test {
def benchmarkA(num: Int) {
diff --git a/test/files/run/t3361.scala b/test/files/run/t3361.scala
index 7fbc6777f2..f739d17b86 100644
--- a/test/files/run/t3361.scala
+++ b/test/files/run/t3361.scala
@@ -57,7 +57,7 @@ object Test extends App {
DoubleLinkedList().insert(ten)
} catch {
case _: IllegalArgumentException => require(true)
- case _ => require(false)
+ case _: Throwable => require(false)
}
val zero = DoubleLinkedList(0)
zero.insert(ten)
@@ -87,7 +87,7 @@ object Test extends App {
DoubleLinkedList().append(ten)
} catch {
case _: IllegalArgumentException => require(true)
- case _ => require(false)
+ case _: Throwable => require(false)
}
val zero = DoubleLinkedList(0)
zero.append(ten)
diff --git a/test/files/run/t3425.scala b/test/files/run/t3425.scala
index 6505ee6e24..c61d1071a5 100644
--- a/test/files/run/t3425.scala
+++ b/test/files/run/t3425.scala
@@ -1,3 +1,4 @@
+import scala.language.reflectiveCalls
object Other {
abstract class Foo {
type R1 <: { def x: Any }
diff --git a/test/files/run/t3488.check b/test/files/run/t3488.check
index 0d66ea1aee..314dfc7838 100644
--- a/test/files/run/t3488.check
+++ b/test/files/run/t3488.check
@@ -1,2 +1,8 @@
+t3488.scala:4: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ println(foo { val List(_*)=List(0); 1 } ())
+ ^
+t3488.scala:5: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ println(foo { val List(_*)=List(0); 1 } (1))
+ ^
0
1
diff --git a/test/files/run/t3507-new.scala b/test/files/run/t3507-new.scala
index f045755b8f..bd16849e8a 100644
--- a/test/files/run/t3507-new.scala
+++ b/test/files/run/t3507-new.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ existentials }
import scala.reflect.runtime.universe._
class A {
@@ -14,4 +16,4 @@ object Test extends App {
def mani[T: TypeTag](x: T) = println(typeOf[T])
mani/*[object _1.b.c]*/(c) // kaboom in manifestOfType / TreeGen.mkAttributedQualifier
// --> _1 is not in scope here
-} \ No newline at end of file
+}
diff --git a/test/files/run/t3529.scala b/test/files/run/t3529.scala
index bb82424bf6..a5977d0a6c 100644
--- a/test/files/run/t3529.scala
+++ b/test/files/run/t3529.scala
@@ -1,3 +1,4 @@
+import scala.language.postfixOps
object Test {
def main(args: Array[String]): Unit = {
assert(1 to 10 drop 10 isEmpty)
diff --git a/test/files/run/t3651.scala b/test/files/run/t3651.scala
index 49ae173249..3a6dda0de3 100644
--- a/test/files/run/t3651.scala
+++ b/test/files/run/t3651.scala
@@ -5,6 +5,6 @@ class LongKlass( override val a: Long ) extends Klass[Long](a)
object Test {
def main(args: Array[String]) {
val lk = new LongKlass(10)
- lk.a
+ val a = lk.a
}
}
diff --git a/test/files/run/t3705.scala b/test/files/run/t3705.scala
index fcc020f28c..3ebf6fc95d 100644
--- a/test/files/run/t3705.scala
+++ b/test/files/run/t3705.scala
@@ -2,16 +2,16 @@
import scala.xml._
object Test {
+ // guard caused verifyerror in oldpatmat
def updateNodes(ns: Seq[Node]): Seq[Node] =
for(subnode <- ns) yield subnode match {
case <d>{_}</d> if true => <d>abc</d>
case Elem(prefix, label, attribs, scope, children @ _*) =>
- Elem(prefix, label, attribs, scope, updateNodes(children) : _*)
+ Elem(prefix, label, attribs, scope, minimizeEmpty = true, updateNodes(children) : _*)
case other => other
}
def main(args: Array[String]): Unit = {
updateNodes(<b />)
-
}
}
diff --git a/test/files/run/t3758-old.scala b/test/files/run/t3758-old.scala
index f00254afee..d5e4a6cc1c 100644
--- a/test/files/run/t3758-old.scala
+++ b/test/files/run/t3758-old.scala
@@ -1,3 +1,5 @@
+
+@deprecated("Suppress warnings", since="2.11")
object Test {
def main(args: Array[String]): Unit = {
assert(classManifest[Array[String]].typeArguments contains classManifest[String])
@@ -7,4 +9,4 @@ object Test {
assert(manifest[Array[Int]].typeArguments contains manifest[Int])
assert(manifest[Array[Float]].typeArguments contains manifest[Float])
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/t3855.scala b/test/files/run/t3855.scala
index e55714201f..d8029e16f0 100644
--- a/test/files/run/t3855.scala
+++ b/test/files/run/t3855.scala
@@ -3,11 +3,11 @@ object Test {
def closure[A](f: () => A) = f()
def f1(s: String) = {
- var n = try { s.toInt } catch { case _ => 1 }
+ var n = try { s.toInt } catch { case _: Throwable => 1 }
byval(n)
}
def f2(s: String) = {
- var n = try { s.toInt } catch { case _ => 1 }
+ var n = try { s.toInt } catch { case _: Throwable => 1 }
closure(() => n)
}
diff --git a/test/files/run/t3888.check b/test/files/run/t3888.check
new file mode 100644
index 0000000000..844ca54682
--- /dev/null
+++ b/test/files/run/t3888.check
@@ -0,0 +1 @@
+warning: there were 1 deprecation warning(s); re-run with -deprecation for details
diff --git a/test/files/run/t3888.scala b/test/files/run/t3888.scala
index e0f1453b1d..1914072599 100644
--- a/test/files/run/t3888.scala
+++ b/test/files/run/t3888.scala
@@ -1,3 +1,6 @@
+
+// in a match, which notion of equals prevails?
+// extending Tuple doesn't seem to be at issue here.
object Test {
val T1 = new P
@@ -23,4 +26,4 @@ object Test {
class P extends Pair(1, 1) {
override def equals(x: Any) = true
-} \ No newline at end of file
+}
diff --git a/test/files/run/t3935.scala b/test/files/run/t3935.scala
index c66b1b0599..fa1bbf8d3f 100644
--- a/test/files/run/t3935.scala
+++ b/test/files/run/t3935.scala
@@ -9,7 +9,7 @@ object Test {
try {
assert(q.front != null)
} catch {
- case _ =>
+ case _: Throwable =>
}
}
}
diff --git a/test/files/run/t3964.scala b/test/files/run/t3964.scala
index 80ba361a20..68ff9a44c4 100644
--- a/test/files/run/t3964.scala
+++ b/test/files/run/t3964.scala
@@ -1,3 +1,6 @@
+
+import scala.language.implicitConversions
+
object Test {
class Base
object Bob extends Base
diff --git a/test/files/run/t4047.check b/test/files/run/t4047.check
index 2a942a70e0..3c41e6e244 100644
--- a/test/files/run/t4047.check
+++ b/test/files/run/t4047.check
@@ -1,3 +1,15 @@
+t4047.scala:23: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ a.foo
+ ^
+t4047.scala:24: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ a.foo
+ ^
+t4047.scala:26: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ b.foo
+ ^
+t4047.scala:27: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ b.foo
+ ^
Unit: called A.foo
Unit: called B.foo
Unit: called C.foo
diff --git a/test/files/run/t4072.scala b/test/files/run/t4072.scala
index 872072a4ce..bff2e0c7d2 100644
--- a/test/files/run/t4072.scala
+++ b/test/files/run/t4072.scala
@@ -1,5 +1,7 @@
import scala.tools.nsc._
+import scala.language.{ reflectiveCalls }
+
object Test {
class DryRun {
val compiler = new Global(new Settings()) {
diff --git a/test/files/run/t4080.scala b/test/files/run/t4080.scala
index 92740ed776..1d1418847d 100644
--- a/test/files/run/t4080.scala
+++ b/test/files/run/t4080.scala
@@ -1,4 +1,5 @@
import scala.collection.mutable.LinkedList
+import java.util.NoSuchElementException
object Test {
def main(args: Array[String]) {
@@ -6,7 +7,7 @@ object Test {
ll.insert(LinkedList(0))
println(ll)
val ll2 = LinkedList[Int]()
- try println(ll2.head)
- catch { case _ => () }
+ try println("Empty head? " + ll2.head)
+ catch { case _: NoSuchElementException => () }
}
}
diff --git a/test/files/run/t4148.scala b/test/files/run/t4148.scala
index 0739403594..6de0c8fe7a 100644
--- a/test/files/run/t4148.scala
+++ b/test/files/run/t4148.scala
@@ -1,7 +1,7 @@
object Test {
- val x1 = try { "aaa".asInstanceOf[Int] } catch { case _ => "cce1" }
- val x2 = try { (5: Any).asInstanceOf[Int] } catch { case _ => "cce2" }
- val x3 = try { (new java.lang.Short(100.toShort).asInstanceOf[Int]) } catch { case _ => "cce3" }
+ val x1 = try { "aaa".asInstanceOf[Int] } catch { case _: Throwable => "cce1" }
+ val x2 = try { (5: Any).asInstanceOf[Int] } catch { case _: Throwable => "cce2" }
+ val x3 = try { (new java.lang.Short(100.toShort).asInstanceOf[Int]) } catch { case _: Throwable => "cce3" }
def main(args: Array[String]): Unit = {
List(x1, x2, x3) foreach println
diff --git a/test/files/run/t4171.scala b/test/files/run/t4171.scala
index fba2fb5ed6..7f6dfd48ce 100644
--- a/test/files/run/t4171.scala
+++ b/test/files/run/t4171.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ reflectiveCalls }
+
object Test {
val c = { class C; new C { def foo = 1 } }
val a = { class B { def bar = 5 }; class C extends B; new C }
diff --git a/test/files/run/t4398.scala b/test/files/run/t4398.scala
index 1d57eb688d..87dc870afc 100644
--- a/test/files/run/t4398.scala
+++ b/test/files/run/t4398.scala
@@ -1,5 +1,7 @@
+import scala.language.{ postfixOps }
+
object Test {
def main(args: Array[String]) {
val x = 1 to 10 toSet
diff --git a/test/files/run/t4560.scala b/test/files/run/t4560.scala
index 9979199067..ee657e47eb 100644
--- a/test/files/run/t4560.scala
+++ b/test/files/run/t4560.scala
@@ -7,6 +7,9 @@
// TEST 1
// self-type is other trait
+
+import scala.language.{ reflectiveCalls }
+
trait Aa
trait Ab
diff --git a/test/files/run/t4660.scala b/test/files/run/t4660.scala
index e57bb4bf25..9aac10ddfd 100644
--- a/test/files/run/t4660.scala
+++ b/test/files/run/t4660.scala
@@ -3,7 +3,7 @@ object Test {
val traversable = 1 to 20 map (_.toString)
def normalize(m: Map[Char, Traversable[String]]) = m.map { case (k,v) => (k, v.toList) }
- val groupedFromView = (traversable view).groupBy(_(0))
+ val groupedFromView = traversable.view.groupBy(_(0))
val groupedFromStrict = traversable.groupBy(_(0))
assert(normalize(groupedFromView) == normalize(groupedFromStrict))
diff --git a/test/files/run/t4680.check b/test/files/run/t4680.check
index b5cfc651f2..b2e5209dc5 100644
--- a/test/files/run/t4680.check
+++ b/test/files/run/t4680.check
@@ -1,3 +1,9 @@
+t4680.scala:51: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ new C { 5 }
+ ^
+t4680.scala:69: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ new { val x = 5 } with E() { 5 }
+ ^
// new C { }
diff --git a/test/files/run/t4729/S_2.scala b/test/files/run/t4729/S_2.scala
index a80afb0257..f823433ded 100644
--- a/test/files/run/t4729/S_2.scala
+++ b/test/files/run/t4729/S_2.scala
@@ -1,3 +1,4 @@
+import scala.language.reflectiveCalls
// Scala class:
class ScalaVarArgs extends J_1 {
// -- no problem on overriding it using ordinary class
diff --git a/test/files/run/t4766.scala b/test/files/run/t4766.scala
index c2a864ddb2..d67431f50e 100644
--- a/test/files/run/t4766.scala
+++ b/test/files/run/t4766.scala
@@ -1,3 +1,7 @@
+
+import scala.language.postfixOps
+import scala.language.reflectiveCalls
+
object Test extends App {
val x = new {
def > = 1
diff --git a/test/files/run/t4777.scala b/test/files/run/t4777.scala
index 4a811d3b9a..6c7b856e39 100644
--- a/test/files/run/t4777.scala
+++ b/test/files/run/t4777.scala
@@ -3,6 +3,6 @@ class DefaultsTest(x: Int = 25) extends A(28)
object DefaultsTest extends DefaultsTest(12)
object Test extends App {
- println(new DefaultsTest() a)
- println(DefaultsTest a)
+ println(new DefaultsTest().a)
+ println(DefaultsTest.a)
}
diff --git a/test/files/run/t4794.scala b/test/files/run/t4794.scala
index afe89fa429..720906f507 100644
--- a/test/files/run/t4794.scala
+++ b/test/files/run/t4794.scala
@@ -7,6 +7,7 @@ class Arr[@specialized A](val arr: Array[A]) {
object Test {
def main(args: Array[String]): Unit = {
- println(classOf[Arr[_]].getMethods filter (_.getName contains "quux") size) // expect 10, not 1
+ def quuxae = classOf[Arr[_]].getMethods filter (_.getName contains "quux")
+ println(quuxae.size) // expect 10, not 1
}
}
diff --git a/test/files/run/t4929.scala b/test/files/run/t4929.scala
index 3208cd1b09..1b0e8672d5 100644
--- a/test/files/run/t4929.scala
+++ b/test/files/run/t4929.scala
@@ -2,6 +2,7 @@ import scala.util.parsing.json._
import java.util.concurrent._
import collection.JavaConversions._
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
val LIMIT = 2000
diff --git a/test/files/run/t498.scala b/test/files/run/t498.scala
index b4ede951f0..5c10e6630f 100644
--- a/test/files/run/t498.scala
+++ b/test/files/run/t498.scala
@@ -1,3 +1,6 @@
+
+import scala.language.postfixOps
+
object Test extends App {
// the function passed to flatMap produces lots of empty streams, but this should not overflow the stack
val res = Stream.from(1).flatMap(i => if (i < 3000) Stream.empty else List(1))
diff --git a/test/files/run/t5053.scala b/test/files/run/t5053.scala
index e46dad5ac6..233edf6780 100644
--- a/test/files/run/t5053.scala
+++ b/test/files/run/t5053.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ existentials }
+
object Test extends App {
{
val (left, right) = Seq((1, "a"), (1, "a"), (1, "a"), (3, "c")).view.unzip
diff --git a/test/files/run/t5080.scala b/test/files/run/t5080.scala
index ce72d13a54..acb6167f46 100644
--- a/test/files/run/t5080.scala
+++ b/test/files/run/t5080.scala
@@ -1,3 +1,7 @@
+
+import scala.language.implicitConversions
+import scala.language.reflectiveCalls
+
object Test extends App {
abstract class Value {
diff --git a/test/files/run/t5224.check b/test/files/run/t5224.check
index e15c1c90eb..b11480acdf 100644
--- a/test/files/run/t5224.check
+++ b/test/files/run/t5224.check
@@ -1,3 +1,8 @@
+t5224.scala:3: warning: Implementation restriction: subclassing Classfile does not
+make your annotation visible at runtime. If that is what
+you want, you must write the annotation class in Java.
+class Foo(bar: String) extends annotation.ClassfileAnnotation
+ ^
{
@new Foo(bar = "qwe") class C extends AnyRef {
def <init>() = {
diff --git a/test/files/run/t5277_1.scala b/test/files/run/t5277_1.scala
index a2d546579d..65232967c2 100644
--- a/test/files/run/t5277_1.scala
+++ b/test/files/run/t5277_1.scala
@@ -1,6 +1,7 @@
import scala.reflect.runtime.universe._
import scala.tools.reflect.Eval
+import scala.language.{ implicitConversions, postfixOps }
object Test extends App {
reify {
def fact(n: Int): BigInt =
@@ -12,4 +13,4 @@ object Test extends App {
println("10! = " + (10!))
}.eval
-} \ No newline at end of file
+}
diff --git a/test/files/run/t5284b.check b/test/files/run/t5284b.check
index 98d9bcb75a..71426ad0b7 100644
--- a/test/files/run/t5284b.check
+++ b/test/files/run/t5284b.check
@@ -1 +1,4 @@
+t5284b.scala:27: warning: type S is unused or used in non-specializable positions.
+ def bar[@specialized(Int) W <: T, @specialized(Int) S](w: W) = id(w)
+ ^
17
diff --git a/test/files/run/t5284c.check b/test/files/run/t5284c.check
index 00750edc07..cf578ad102 100644
--- a/test/files/run/t5284c.check
+++ b/test/files/run/t5284c.check
@@ -1 +1,4 @@
+t5284c.scala:29: warning: type W is unused or used in non-specializable positions.
+ def bar[@specialized(Int) W <: T](ws: List[W]) = len(ws)
+ ^
3
diff --git a/test/files/run/t5353.scala b/test/files/run/t5353.scala
deleted file mode 100644
index 5208fe527f..0000000000
--- a/test/files/run/t5353.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-object Test extends App {
- def f(x: Boolean) = if (x) Array("abc") else Array()
- try {
- println(f(true).length)
- println(f(false).length)
- } catch {
- case ex: Throwable => println(ex.getMessage)
- }
-}
diff --git a/test/files/run/t5356.scala b/test/files/run/t5356.scala
index ec17e036ad..dabb9ef855 100644
--- a/test/files/run/t5356.scala
+++ b/test/files/run/t5356.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ reflectiveCalls }
object Test {
def f(x: Any { def toInt: Int }) = println(x.toInt + " " + x.getClass.getName)
diff --git a/test/files/run/t5375.scala b/test/files/run/t5375.scala
index e4b329deae..fa5932ff89 100644
--- a/test/files/run/t5375.scala
+++ b/test/files/run/t5375.scala
@@ -8,7 +8,7 @@ import collection.parallel.CompositeThrowable
object Test {
def main(args: Array[String]) {
- val foos = (1 to 1000) toSeq;
+ val foos = (1 to 1000).toSeq
try {
foos.par.map(i => if (i % 37 == 0) sys.error("i div 37") else i)
} catch {
diff --git a/test/files/run/t5380.check b/test/files/run/t5380.check
new file mode 100644
index 0000000000..731a798301
--- /dev/null
+++ b/test/files/run/t5380.check
@@ -0,0 +1,9 @@
+t5380.scala:3: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ val f = () => return try { 1 } catch { case _: Throwable => 0 }
+ ^
+t5380.scala:3: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ val f = () => return try { 1 } catch { case _: Throwable => 0 }
+ ^
+t5380.scala:3: warning: enclosing method main has result type Unit: return value discarded
+ val f = () => return try { 1 } catch { case _: Throwable => 0 }
+ ^
diff --git a/test/files/run/t5380.scala b/test/files/run/t5380.scala
index 6083161a9b..66d12a0ca6 100644
--- a/test/files/run/t5380.scala
+++ b/test/files/run/t5380.scala
@@ -1,6 +1,6 @@
object Test {
def main(args: Array[String]) {
- val f = () => return try { 1 } catch { case _ => 0 }
+ val f = () => return try { 1 } catch { case _: Throwable => 0 }
f()
}
}
diff --git a/test/files/run/t5428.scala b/test/files/run/t5428.scala
index 106bb7fc31..fb58cbbe24 100644
--- a/test/files/run/t5428.scala
+++ b/test/files/run/t5428.scala
@@ -23,7 +23,7 @@ object Test {
println(a)
- a pop
+ a.pop
}
}
diff --git a/test/files/run/t5568.flags b/test/files/run/t5568.flags
new file mode 100644
index 0000000000..ad51758c39
--- /dev/null
+++ b/test/files/run/t5568.flags
@@ -0,0 +1 @@
+-nowarn
diff --git a/test/files/run/t5629b.scala b/test/files/run/t5629b.scala
index 6c908081b9..adb9ca5498 100644
--- a/test/files/run/t5629b.scala
+++ b/test/files/run/t5629b.scala
@@ -33,7 +33,7 @@ object Test extends App {
val pf = newPF(1)
println("=== pf(1):")
- try { pf(1) } catch { case x => println(x) }
+ try { pf(1) } catch { case x: Throwable => println(x) }
println("=== pf(42):")
pf(42)
println("=== done")
diff --git a/test/files/run/t5699.scala b/test/files/run/t5699.scala
index 5cef67e3b1..ec3b1d26b4 100755
--- a/test/files/run/t5699.scala
+++ b/test/files/run/t5699.scala
@@ -1,5 +1,5 @@
import scala.tools.partest.DirectTest
-import scala.tools.nsc.util.BatchSourceFile
+import scala.reflect.internal.util.BatchSourceFile
object Test extends DirectTest {
// Java code
diff --git a/test/files/run/t576.scala b/test/files/run/t576.scala
index 756a241572..5c8c9a90cb 100644
--- a/test/files/run/t576.scala
+++ b/test/files/run/t576.scala
@@ -1,3 +1,5 @@
+import scala.language.reflectiveCalls
+
class A {
override def equals(other: Any) = other match {
case _: this.type => true
diff --git a/test/files/run/t5881.scala b/test/files/run/t5881.scala
index 01bee29181..04b24b713d 100644
--- a/test/files/run/t5881.scala
+++ b/test/files/run/t5881.scala
@@ -1,6 +1,7 @@
+import scala.language.existentials
import scala.reflect.ClassTag
object Test extends App {
println(implicitly[ClassTag[List[T forSome {type T <: List[T]}]]])
println(implicitly[ClassTag[List[Any]]])
-} \ No newline at end of file
+}
diff --git a/test/files/run/t5912.scala b/test/files/run/t5912.scala
index 7710d04396..9418e946d0 100644
--- a/test/files/run/t5912.scala
+++ b/test/files/run/t5912.scala
@@ -1,6 +1,7 @@
+import scala.language.existentials
object Test extends App{
import scala.reflect.runtime.{currentMirror=>cm}
import scala.tools.reflect._
import scala.reflect.runtime.universe._
val tree = cm.mkToolBox().typeCheck( Literal(Constant("test")) )
-} \ No newline at end of file
+}
diff --git a/test/files/run/t5942.scala b/test/files/run/t5942.scala
index 44a8be93f6..c90d29e1ca 100644
--- a/test/files/run/t5942.scala
+++ b/test/files/run/t5942.scala
@@ -5,6 +5,6 @@ import scala.tools.reflect._
object Test extends App {
val tb = cm.mkToolBox()
tb.parse("def x = {}")
- try { tb.parse("def x = {") } catch { case _ => }
+ try { tb.parse("def x = {") } catch { case _: Throwable => }
tb.parse("def x = {}")
}
diff --git a/test/files/run/t6011c.check b/test/files/run/t6011c.check
new file mode 100644
index 0000000000..088e6fdaae
--- /dev/null
+++ b/test/files/run/t6011c.check
@@ -0,0 +1,3 @@
+t6011c.scala:11: warning: unreachable code
+ case 1 => 3 // crash
+ ^
diff --git a/test/files/run/t603.scala b/test/files/run/t603.scala
index b8825c933b..54fb8e6974 100644
--- a/test/files/run/t603.scala
+++ b/test/files/run/t603.scala
@@ -1,4 +1,6 @@
object forceDelay {
+ import scala.language.implicitConversions
+
class Susp[+A](lazyValue: => A) extends Function0[A] {
private var func: () => Any = () => lazyValue
private var value: Any = null
diff --git a/test/files/run/t6102.check b/test/files/run/t6102.check
index b6fc4c620b..97e455647b 100644
--- a/test/files/run/t6102.check
+++ b/test/files/run/t6102.check
@@ -1 +1,29 @@
-hello \ No newline at end of file
+[running phase parser on t6102.scala]
+[running phase namer on t6102.scala]
+[running phase packageobjects on t6102.scala]
+[running phase typer on t6102.scala]
+[running phase patmat on t6102.scala]
+[running phase superaccessors on t6102.scala]
+[running phase extmethods on t6102.scala]
+[running phase pickler on t6102.scala]
+[running phase refchecks on t6102.scala]
+[running phase uncurry on t6102.scala]
+[running phase tailcalls on t6102.scala]
+[running phase specialize on t6102.scala]
+[running phase explicitouter on t6102.scala]
+[running phase erasure on t6102.scala]
+[running phase posterasure on t6102.scala]
+[running phase lazyvals on t6102.scala]
+[running phase lambdalift on t6102.scala]
+[running phase constructors on t6102.scala]
+[running phase flatten on t6102.scala]
+[running phase mixin on t6102.scala]
+[running phase cleanup on t6102.scala]
+[running phase icode on t6102.scala]
+[running phase inliner on t6102.scala]
+[running phase inlinehandlers on t6102.scala]
+[running phase closelim on t6102.scala]
+[running phase constopt on t6102.scala]
+[running phase dce on t6102.scala]
+[running phase jvm on icode]
+hello
diff --git a/test/files/run/t6113.scala b/test/files/run/t6113.scala
index 321cae86a3..b77a56029a 100644
--- a/test/files/run/t6113.scala
+++ b/test/files/run/t6113.scala
@@ -1,6 +1,8 @@
+import scala.language.higherKinds
+
trait Foo[C[_]]
object Test extends App {
import scala.reflect.runtime.universe._
println(typeOf[Foo[({type l[X] = (Int, X)})#l]])
-} \ No newline at end of file
+}
diff --git a/test/files/run/t6146b.check b/test/files/run/t6146b.check
index 49ff70697e..2333b9d986 100644
--- a/test/files/run/t6146b.check
+++ b/test/files/run/t6146b.check
@@ -1,3 +1,7 @@
+t6146b.scala:15: warning: match may not be exhaustive.
+It would fail on the following inputs: S2(), S3()
+ def foo(f: F[Int]) = f match { case X.S1 => }
+ ^
Type in expressions to have them evaluated.
Type :help for more information.
diff --git a/test/files/run/t6246.scala b/test/files/run/t6246.scala
index 28765e1adf..2db87aa6d2 100644
--- a/test/files/run/t6246.scala
+++ b/test/files/run/t6246.scala
@@ -1,5 +1,6 @@
import scala.reflect.{ClassTag, classTag}
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
def testValueClass(tag: ClassTag[_]) {
println(s"runtimeClass = ${tag.runtimeClass}, toString = ${tag.toString}")
@@ -23,4 +24,4 @@ object Test extends App {
testValueClass(ClassTag.Double)
testValueClass(ClassTag.Unit)
testValueClass(ClassTag.Boolean)
-} \ No newline at end of file
+}
diff --git a/test/files/run/t6329_vanilla.scala b/test/files/run/t6329_vanilla.scala
index f2d843896d..ec84f1f938 100644
--- a/test/files/run/t6329_vanilla.scala
+++ b/test/files/run/t6329_vanilla.scala
@@ -1,5 +1,6 @@
import scala.reflect.classTag
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
println(classManifest[scala.List[_]])
println(classTag[scala.List[_]])
diff --git a/test/files/run/t6443.scala b/test/files/run/t6443.scala
index 67fe2cab22..3ab8c345fe 100644
--- a/test/files/run/t6443.scala
+++ b/test/files/run/t6443.scala
@@ -1,3 +1,5 @@
+import scala.language.existentials
+
class Base
class Derived extends Base
diff --git a/test/files/run/t657.scala b/test/files/run/t657.scala
index a9726092e7..e76b0292dd 100644
--- a/test/files/run/t657.scala
+++ b/test/files/run/t657.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ implicitConversions }
abstract class BaseList {
type Node <: NodeImpl;
implicit def convertNode(ni : NodeImpl) = ni.asInstanceOf[Node];
diff --git a/test/files/run/t6690.scala b/test/files/run/t6690.scala
index 43ede967a0..15b1817e87 100644
--- a/test/files/run/t6690.scala
+++ b/test/files/run/t6690.scala
@@ -1,5 +1,7 @@
import scala.collection.mutable
+import scala.language.{ reflectiveCalls }
+
object Test extends App {
def last0(ml: mutable.MutableList[Int]) =
ml.asInstanceOf[{def last0: mutable.LinkedList[Int]}].last0
diff --git a/test/files/run/t6731.scala b/test/files/run/t6731.scala
index 89d212e91e..12357b935e 100644
--- a/test/files/run/t6731.scala
+++ b/test/files/run/t6731.scala
@@ -12,7 +12,7 @@ abstract class MonoDynamic extends Dynamic {
def applyDynamic(name: String)(args: Any*): String = show(this + "." + name + mkArgs(args: _*))
def applyDynamicNamed(name: String)(args: (String, Any)*): String = show(this + "." + name + mkArgs(args: _*))
- override def toString = this.getClass.getName split '.' last
+ override def toString = (this.getClass.getName split '.').last
}
object Mono extends MonoDynamic {
diff --git a/test/files/run/t6863.check b/test/files/run/t6863.check
new file mode 100644
index 0000000000..030cb8b265
--- /dev/null
+++ b/test/files/run/t6863.check
@@ -0,0 +1,12 @@
+t6863.scala:38: warning: comparing values of types Unit and Unit using `==' will always yield true
+ assert({ () => x}.apply == ())
+ ^
+t6863.scala:42: warning: comparing values of types Unit and Unit using `==' will always yield true
+ assert({ () => x}.apply == ())
+ ^
+t6863.scala:46: warning: comparing values of types Unit and Unit using `==' will always yield true
+ assert({ () => x}.apply == ())
+ ^
+t6863.scala:59: warning: comparing values of types Unit and Unit using `==' will always yield true
+ assert({ () => x }.apply == ())
+ ^
diff --git a/test/files/run/t6863.scala b/test/files/run/t6863.scala
index d77adb6af4..c4f3c2c885 100644
--- a/test/files/run/t6863.scala
+++ b/test/files/run/t6863.scala
@@ -51,7 +51,7 @@ object Test {
assert({ () => x }.apply == "42")
}
def tryCatch() = {
- var x = try { "42" } catch { case _ => "43" }
+ var x = try { "42" } catch { case _: Throwable => "43" }
assert({ () => x }.apply == "42")
}
def `if`() = {
@@ -85,7 +85,7 @@ object Test {
def nested() = {
var x = {
val y = 42
- if(true) try "42" catch {case _ => "43"}
+ if(true) try "42" catch {case _: Throwable => "43"}
else "44"
}
assert({ () => x }.apply == "42")
diff --git a/test/files/run/t6969.scala b/test/files/run/t6969.scala
index 8cfc28c1e5..c4561b4424 100644
--- a/test/files/run/t6969.scala
+++ b/test/files/run/t6969.scala
@@ -1,3 +1,7 @@
+
+
+import scala.language.{ reflectiveCalls }
+
object Test {
private type Clearable = { def clear(): Unit }
private def choke() = {
diff --git a/test/files/run/t7047.check b/test/files/run/t7047.check
index e69de29bb2..32bd581094 100644
--- a/test/files/run/t7047.check
+++ b/test/files/run/t7047.check
@@ -0,0 +1,3 @@
+Test_2.scala:2: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ Macros.foo
+ ^
diff --git a/test/files/run/t7096.scala b/test/files/run/t7096.scala
index 2a93dcc571..437f7a086d 100644
--- a/test/files/run/t7096.scala
+++ b/test/files/run/t7096.scala
@@ -1,3 +1,6 @@
+/*
+ * filter: inliner warning(s); re-run with -Yinline-warnings for details
+ */
import scala.tools.partest._
import scala.tools.nsc._
diff --git a/test/files/run/t7120b.scala b/test/files/run/t7120b.scala
index 9f6591aa06..0be4eb70a7 100644
--- a/test/files/run/t7120b.scala
+++ b/test/files/run/t7120b.scala
@@ -1,3 +1,6 @@
+
+import scala.language.higherKinds
+
trait Base[A] { type B = A; }
class C extends Base[String] {
class D {
diff --git a/test/files/run/t7171.check b/test/files/run/t7171.check
new file mode 100644
index 0000000000..d826f6cb94
--- /dev/null
+++ b/test/files/run/t7171.check
@@ -0,0 +1,3 @@
+t7171.scala:2: warning: The outer reference in this type test cannot be checked at run time.
+ final case class A()
+ ^
diff --git a/test/files/run/t7171.flags b/test/files/run/t7171.flags
new file mode 100644
index 0000000000..c02e5f2461
--- /dev/null
+++ b/test/files/run/t7171.flags
@@ -0,0 +1 @@
+-unchecked
diff --git a/test/files/run/t7171.scala b/test/files/run/t7171.scala
index 97585b9860..e0a1192228 100644
--- a/test/files/run/t7171.scala
+++ b/test/files/run/t7171.scala
@@ -16,7 +16,7 @@ object Test extends App {
val a1 = new t1.A()
val a2 = new t1.A()
assert(t1.foo(a1))
- // as noted in the unchecked warning (tested in the corresponding neg test),
+ // as noted in the unchecked warning (also tested in the corresponding neg test),
// the outer pointer isn't checked
assert(t1.foo(a2))
}
diff --git a/test/files/run/t7240/Test_2.scala b/test/files/run/t7240/Test_2.scala
index 2450bdabf9..5cc2cc7f78 100644
--- a/test/files/run/t7240/Test_2.scala
+++ b/test/files/run/t7240/Test_2.scala
@@ -1,3 +1,3 @@
object Test extends App {
- bakery.Bakery.failure
-} \ No newline at end of file
+ val v = bakery.Bakery.failure
+}
diff --git a/test/files/run/t7271.check b/test/files/run/t7271.check
index 6db301c21d..f7a23018ca 100644
--- a/test/files/run/t7271.check
+++ b/test/files/run/t7271.check
@@ -1,12 +1,12 @@
[[syntax trees at end of parser]] // newSource1.scala
-[0:91]package [0:0]<empty> {
- [0:91]class C extends [8:91][91]scala.AnyRef {
+[6]package [6]<empty> {
+ [6]class C extends [8][91]scala.AnyRef {
[8]def <init>() = [8]{
[NoPosition][NoPosition][NoPosition]super.<init>();
[8]()
};
- [16:44]def quote = [28:44]<28:44><28:44>[28]StringContext([30:34]"foo", [40:44]"baz").s([35:39]this);
- [51:85]def tripleQuote = [69:85]<69:85><69:85>[69]StringContext([71:75]"foo", [81:85]"baz").s([76:80]this)
+ [20]def quote = [28][28][28][28]StringContext([30]"foo", [40]"baz").s([35]this);
+ [55]def tripleQuote = [69][69][69][69]StringContext([71]"foo", [81]"baz").s([76]this)
}
}
diff --git a/test/files/run/t7271.scala b/test/files/run/t7271.scala
index 6fccf14d20..cb43331a29 100644
--- a/test/files/run/t7271.scala
+++ b/test/files/run/t7271.scala
@@ -4,6 +4,7 @@ import scala.tools.nsc._
import scala.tools.nsc.util.CommandLineParser
import scala.tools.nsc.{Global, Settings, CompilerCommand}
import scala.tools.nsc.reporters.ConsoleReporter
+import scala.reflect.internal.Positions
object Test extends DirectTest {
@@ -29,6 +30,6 @@ object Test extends DirectTest {
val settings = new Settings()
settings.Xprintpos.value = true
val command = new CompilerCommand((CommandLineParser tokenize extraSettings) ++ args.toList, settings)
- new Global(command.settings, new ConsoleReporter(settings)) with interactive.RangePositions
+ new Global(command.settings, new ConsoleReporter(settings)) with Positions
}
}
diff --git a/test/files/run/t7290.check b/test/files/run/t7290.check
new file mode 100644
index 0000000000..aff48abd4a
--- /dev/null
+++ b/test/files/run/t7290.check
@@ -0,0 +1,6 @@
+t7290.scala:4: warning: Pattern contains duplicate alternatives: 0
+ case 0 | 0 => 0
+ ^
+t7290.scala:5: warning: Pattern contains duplicate alternatives: 2, 3
+ case 2 | 2 | 2 | 3 | 2 | 3 => 0
+ ^
diff --git a/test/files/run/t7291.scala b/test/files/run/t7291.scala
index 30c4261a81..d996c615ce 100644
--- a/test/files/run/t7291.scala
+++ b/test/files/run/t7291.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ higherKinds, implicitConversions }
+
trait Fooable[T]
object Fooable {
implicit def conjure[T]: Fooable[T] = {
diff --git a/test/files/run/t874.scala b/test/files/run/t874.scala
index 41d124f728..7e70fc34eb 100644
--- a/test/files/run/t874.scala
+++ b/test/files/run/t874.scala
@@ -1,3 +1,5 @@
+
+import scala.language.{ reflectiveCalls }
object Test {
abstract class Base {
val U: {
diff --git a/test/files/run/tcpoly_monads.scala b/test/files/run/tcpoly_monads.scala
index cffbcc963b..6372851451 100644
--- a/test/files/run/tcpoly_monads.scala
+++ b/test/files/run/tcpoly_monads.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ higherKinds, implicitConversions }
+
trait Monads {
/**
* class Monad m where
diff --git a/test/files/run/tcpoly_overriding.scala b/test/files/run/tcpoly_overriding.scala
index 86ba89f530..32174ad8bf 100644
--- a/test/files/run/tcpoly_overriding.scala
+++ b/test/files/run/tcpoly_overriding.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ higherKinds }
+
abstract class A[t[x]] {
def b: t[Int]
}
diff --git a/test/files/run/tcpoly_parseridioms.check b/test/files/run/tcpoly_parseridioms.check
index 5fff2efb15..ab829e0a0e 100644
--- a/test/files/run/tcpoly_parseridioms.check
+++ b/test/files/run/tcpoly_parseridioms.check
@@ -1 +1,21 @@
+tcpoly_parseridioms.scala:18: warning: match may not be exhaustive.
+It would fail on the following input: ParseResult()
+ case Success(next, x) => b(next) match {
+ ^
+tcpoly_parseridioms.scala:17: warning: match may not be exhaustive.
+It would fail on the following input: ParseResult()
+ def apply(in: Input): ParseResult[Pair[T, U]] = a(in) match {
+ ^
+tcpoly_parseridioms.scala:30: warning: match may not be exhaustive.
+It would fail on the following input: ParseResult()
+ case Failure(_, _) => b(in) match {
+ ^
+tcpoly_parseridioms.scala:28: warning: match may not be exhaustive.
+It would fail on the following input: ParseResult()
+ def apply(in: Input): ParseResult[T] = a(in) match {
+ ^
+tcpoly_parseridioms.scala:39: warning: match may not be exhaustive.
+It would fail on the following input: ParseResult()
+ def apply(in: Input): ParseResult[U] = a(in) match {
+ ^
Success(List(),Plus(1,2))
diff --git a/test/files/run/tcpoly_parseridioms.scala b/test/files/run/tcpoly_parseridioms.scala
index 634240e44d..ec17e062db 100644
--- a/test/files/run/tcpoly_parseridioms.scala
+++ b/test/files/run/tcpoly_parseridioms.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ higherKinds, implicitConversions, postfixOps }
+
trait Parsers {
type Input = List[Char]
diff --git a/test/files/run/toolbox_console_reporter.scala b/test/files/run/toolbox_console_reporter.scala
index d672ccb9cb..ce28086c25 100644
--- a/test/files/run/toolbox_console_reporter.scala
+++ b/test/files/run/toolbox_console_reporter.scala
@@ -4,10 +4,10 @@ import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.{ToolBox, mkConsoleFrontEnd}
object Test extends App {
- val oldErr = Console.err;
- val baos = new java.io.ByteArrayOutputStream();
- Console.setErr(new java.io.PrintStream(baos));
- try {
+ //val oldErr = Console.err;
+ val baos = new java.io.ByteArrayOutputStream()
+ val errs = new java.io.PrintStream(baos)
+ (Console withErr errs) {
val toolbox = cm.mkToolBox(frontEnd = mkConsoleFrontEnd(), options = "-deprecation")
toolbox.eval(reify{
object Utils {
@@ -18,12 +18,11 @@ object Test extends App {
Utils.foo
}.tree)
println("============compiler console=============")
+ errs.flush()
println(baos.toString);
println("=========================================")
println("============compiler messages============")
toolbox.frontEnd.infos.foreach(println(_))
println("=========================================")
- } finally {
- Console.setErr(oldErr);
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/transform.scala b/test/files/run/transform.scala
index 5cc1c49d6f..82f924950d 100644
--- a/test/files/run/transform.scala
+++ b/test/files/run/transform.scala
@@ -1,5 +1,5 @@
object Test {
- val x = 1 to 10 toBuffer
+ val x = (1 to 10).toBuffer
def main(args: Array[String]): Unit = {
x transform (_ * 2)
diff --git a/test/files/run/try-2.check b/test/files/run/try-2.check
index 6c4a024c93..987d3462df 100644
--- a/test/files/run/try-2.check
+++ b/test/files/run/try-2.check
@@ -1,3 +1,6 @@
+try-2.scala:41: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ 10;
+ ^
exception happened
Nothin
diff --git a/test/files/run/try-2.scala b/test/files/run/try-2.scala
index da321f2668..b55977ba8b 100644
--- a/test/files/run/try-2.scala
+++ b/test/files/run/try-2.scala
@@ -12,42 +12,42 @@ object Test {
throw new Error();
}
catch {
- case _ => Console.println("exception happened\n");
+ case _: Throwable => Console.println("exception happened\n");
}
def tryUnitAll: Unit =
try {
Console.println("Nothin");
} catch {
- case _ => sys.error("Bad, bad, lama!");
+ case _: Throwable => sys.error("Bad, bad, lama!");
}
def tryAllAll: Unit =
try {
throw new Error();
} catch {
- case _ => sys.error("Bad, bad, lama!");
+ case _: Throwable => sys.error("Bad, bad, lama!");
}
def tryUnitUnit: Unit =
try {
Console.println("Nothin");
} catch {
- case _ => Console.println("Nothin");
+ case _: Throwable => Console.println("Nothin");
}
def tryIntUnit: Unit =
try {
10;
} catch {
- case _ => Console.println("Huh?");
+ case _: Throwable => Console.println("Huh?");
}
def execute(f: => Unit) = try {
f;
} catch {
- case _ => ();
+ case _: Throwable => ();
}
diff --git a/test/files/run/try-catch-unify.scala b/test/files/run/try-catch-unify.scala
index 8cb14d060e..151e549e5f 100644
--- a/test/files/run/try-catch-unify.scala
+++ b/test/files/run/try-catch-unify.scala
@@ -9,7 +9,7 @@ object Test {
try {
catching(classOf[NumberFormatException]) withTry (sys.error("O NOES"))
} catch {
- case t => println(t.getMessage)
+ case t: Throwable => println(t.getMessage)
}
println(nonFatalCatch withTry ("Hi".toDouble))
}
diff --git a/test/files/run/try.check b/test/files/run/try.check
index 3983e26060..f742ccb0df 100644
--- a/test/files/run/try.check
+++ b/test/files/run/try.check
@@ -1,3 +1,6 @@
+try.scala:65: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+ 1+1;
+ ^
1 + 1 = 2
1 + 1 = 2
1 + 1 = 2
diff --git a/test/files/run/try.scala b/test/files/run/try.scala
index e393c0b4b1..a4fdfd796b 100644
--- a/test/files/run/try.scala
+++ b/test/files/run/try.scala
@@ -45,7 +45,7 @@ object Test extends AnyRef with App {
instance = try {
"" //new String();
} catch {
- case _ =>
+ case _: Throwable =>
val cs = "aaa";
if (cs.length() > 0) {
"" //new String();
@@ -65,13 +65,13 @@ object Test extends AnyRef with App {
1+1;
()
} catch {
- case _ =>
+ case _: Throwable =>
Console.println("2");
sys.error("for good");
}
Console.println("a");
} catch {
- case _ => ();
+ case _: Throwable => ();
}
class A {
@@ -95,7 +95,7 @@ object Test extends AnyRef with App {
try {
null
} catch {
- case _ => null
+ case _: Throwable => null
}
new AnyRef {
diff --git a/test/files/run/tuple-zipped.scala b/test/files/run/tuple-zipped.scala
index b197183844..c8ba41f042 100644
--- a/test/files/run/tuple-zipped.scala
+++ b/test/files/run/tuple-zipped.scala
@@ -1,3 +1,6 @@
+
+import scala.language.postfixOps
+
object Test {
val xs1 = List.range(1, 100)
val xs2 = xs1.view
diff --git a/test/files/run/tuples.scala b/test/files/run/tuples.scala
index 4854e36c96..a4ea9ddbcc 100644
--- a/test/files/run/tuples.scala
+++ b/test/files/run/tuples.scala
@@ -6,6 +6,7 @@ object Test extends App {
Console.println(xyz)
xyz match {
case (1, "abc", true) => Console.println("OK")
+ case _ => ???
}
def func(x: Int, y: String, z: Double) {
Console.println("x = " + x + "; y = " + y + "; z = " + z);
diff --git a/test/files/run/type-currying.scala b/test/files/run/type-currying.scala
index f9764c64f0..5e31fef403 100644
--- a/test/files/run/type-currying.scala
+++ b/test/files/run/type-currying.scala
@@ -1,3 +1,6 @@
+
+
+import scala.language.{ higherKinds, reflectiveCalls }
import scala.collection.{ mutable, immutable, generic }
import generic.CanBuildFrom
diff --git a/test/files/run/unapply.check b/test/files/run/unapply.check
new file mode 100644
index 0000000000..847e3b381e
--- /dev/null
+++ b/test/files/run/unapply.check
@@ -0,0 +1,3 @@
+unapply.scala:57: warning: comparing values of types Null and Null using `==' will always yield true
+ assert(doMatch2(b) == null)
+ ^
diff --git a/test/files/run/unittest_io.scala b/test/files/run/unittest_io.scala
index 2cadb9b1df..2c3dacdf91 100644
--- a/test/files/run/unittest_io.scala
+++ b/test/files/run/unittest_io.scala
@@ -1,3 +1,5 @@
+
+@deprecated("Suppress warnings", since="2.11")
object Test {
def main(args: Array[String]) {
diff --git a/test/files/run/unreachable.scala b/test/files/run/unreachable.scala
index 50a8d88b7c..99ac730746 100644
--- a/test/files/run/unreachable.scala
+++ b/test/files/run/unreachable.scala
@@ -1,3 +1,6 @@
+import scala.util.Random.nextInt
+import scala.sys.error
+
object Test extends App {
def unreachableNormalExit: Int = {
return 42
@@ -6,14 +9,14 @@ object Test extends App {
def unreachableIf: Int = {
return 42
- if (util.Random.nextInt % 2 == 0)
+ if (nextInt % 2 == 0)
0
else
1
}
def unreachableIfBranches: Int = {
- if (util.Random.nextInt % 2 == 0)
+ if (nextInt % 2 == 0)
return 42
else
return 42
@@ -22,14 +25,14 @@ object Test extends App {
}
def unreachableOneLegIf: Int = {
- if (util.Random.nextInt % 2 == 0)
+ if (nextInt % 2 == 0)
return 42
return 42
}
def unreachableLeftBranch: Int = {
- val result = if (util.Random.nextInt % 2 == 0)
+ val result = if (nextInt % 2 == 0)
return 42
else
42
@@ -38,7 +41,7 @@ object Test extends App {
}
def unreachableRightBranch: Int = {
- val result = if (util.Random.nextInt % 2 == 0)
+ val result = if (nextInt % 2 == 0)
42
else
return 42
@@ -89,7 +92,7 @@ object Test extends App {
def unreachableSwitch: Int = {
return 42
- val x = util.Random.nextInt % 2
+ val x = nextInt % 2
x match {
case 0 => return 0
case 1 => return 1
@@ -99,7 +102,7 @@ object Test extends App {
}
def unreachableAfterSwitch: Int = {
- val x = util.Random.nextInt % 2
+ val x = nextInt % 2
x match {
case 0 => return 42
case 1 => return 41 + x
@@ -122,4 +125,4 @@ object Test extends App {
check(unreachableAfterFinally)
check(unreachableSwitch)
check(unreachableAfterSwitch)
-} \ No newline at end of file
+}
diff --git a/test/files/run/valueclasses-classmanifest-basic.scala b/test/files/run/valueclasses-classmanifest-basic.scala
index c2aa08ef86..50addda359 100644
--- a/test/files/run/valueclasses-classmanifest-basic.scala
+++ b/test/files/run/valueclasses-classmanifest-basic.scala
@@ -1,5 +1,6 @@
class Foo(val x: Int) extends AnyVal
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
println(classManifest[Foo])
-} \ No newline at end of file
+}
diff --git a/test/files/run/valueclasses-classmanifest-existential.scala b/test/files/run/valueclasses-classmanifest-existential.scala
index 11999df678..6bcd7cf942 100644
--- a/test/files/run/valueclasses-classmanifest-existential.scala
+++ b/test/files/run/valueclasses-classmanifest-existential.scala
@@ -1,5 +1,6 @@
class Foo[T](val x: T) extends AnyVal
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
println(classManifest[Foo[_]])
-} \ No newline at end of file
+}
diff --git a/test/files/run/valueclasses-classmanifest-generic.scala b/test/files/run/valueclasses-classmanifest-generic.scala
index 280152dc1d..5efcaed959 100644
--- a/test/files/run/valueclasses-classmanifest-generic.scala
+++ b/test/files/run/valueclasses-classmanifest-generic.scala
@@ -1,5 +1,6 @@
class Foo[T](val x: T) extends AnyVal
+@deprecated("Suppress warnings", since="2.11")
object Test extends App {
println(classManifest[Foo[String]])
-} \ No newline at end of file
+}
diff --git a/test/files/run/vector1.scala b/test/files/run/vector1.scala
index b37cfe82e8..2e335aded4 100644
--- a/test/files/run/vector1.scala
+++ b/test/files/run/vector1.scala
@@ -102,7 +102,7 @@ object Test {
seqBack()
}
} catch {
- case ex =>
+ case ex: Throwable =>
//println("----------------")
//a.debug
throw ex
diff --git a/test/files/run/view-iterator-stream.scala b/test/files/run/view-iterator-stream.scala
index f91407f92c..c172b5cb99 100644
--- a/test/files/run/view-iterator-stream.scala
+++ b/test/files/run/view-iterator-stream.scala
@@ -1,3 +1,6 @@
+
+import scala.language.postfixOps
+
import scala.collection.{ mutable, immutable, generic }
import collection.TraversableView
diff --git a/test/files/run/virtpatmat_alts.check b/test/files/run/virtpatmat_alts.check
index 7a4ad0a741..f39e292fef 100644
--- a/test/files/run/virtpatmat_alts.check
+++ b/test/files/run/virtpatmat_alts.check
@@ -1 +1,7 @@
+virtpatmat_alts.scala:5: warning: match may not be exhaustive.
+ (true, true) match {
+ ^
+virtpatmat_alts.scala:9: warning: match may not be exhaustive.
+ List(5) match {
+ ^
OK 5
diff --git a/test/files/run/virtpatmat_alts.flags b/test/files/run/virtpatmat_alts.flags
deleted file mode 100644
index 3f5a3100e4..0000000000
--- a/test/files/run/virtpatmat_alts.flags
+++ /dev/null
@@ -1 +0,0 @@
- -Xexperimental
diff --git a/test/files/run/virtpatmat_alts.scala b/test/files/run/virtpatmat_alts.scala
index b7717524e2..d1dfa8a4a1 100644
--- a/test/files/run/virtpatmat_alts.scala
+++ b/test/files/run/virtpatmat_alts.scala
@@ -1,3 +1,6 @@
+/*
+ * filter: It would fail on the following input
+ */
object Test extends App {
(true, true) match {
case (true, true) | (false, false) => 1
@@ -9,4 +12,4 @@ object Test extends App {
case 7 :: Nil => println("FAILED")
case Nil => println("FAILED")
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/virtpatmat_nested_lists.check b/test/files/run/virtpatmat_nested_lists.check
index d8263ee986..ddf68eeedd 100644
--- a/test/files/run/virtpatmat_nested_lists.check
+++ b/test/files/run/virtpatmat_nested_lists.check
@@ -1 +1,4 @@
-2 \ No newline at end of file
+virtpatmat_nested_lists.scala:5: warning: match may not be exhaustive.
+ List(List(1), List(2)) match { case x :: (y :: Nil) :: Nil => println(y) }
+ ^
+2
diff --git a/test/files/run/virtpatmat_nested_lists.flags b/test/files/run/virtpatmat_nested_lists.flags
deleted file mode 100644
index 3f5a3100e4..0000000000
--- a/test/files/run/virtpatmat_nested_lists.flags
+++ /dev/null
@@ -1 +0,0 @@
- -Xexperimental
diff --git a/test/files/run/virtpatmat_nested_lists.scala b/test/files/run/virtpatmat_nested_lists.scala
index fef74cea15..d1aa68ea93 100644
--- a/test/files/run/virtpatmat_nested_lists.scala
+++ b/test/files/run/virtpatmat_nested_lists.scala
@@ -1,3 +1,6 @@
+/*
+ * filter: It would fail on the following input
+ */
object Test extends App {
List(List(1), List(2)) match { case x :: (y :: Nil) :: Nil => println(y) }
}
diff --git a/test/files/run/virtpatmat_opt_sharing.check b/test/files/run/virtpatmat_opt_sharing.check
index d00491fd7e..78ec61f19d 100644
--- a/test/files/run/virtpatmat_opt_sharing.check
+++ b/test/files/run/virtpatmat_opt_sharing.check
@@ -1 +1,4 @@
+virtpatmat_opt_sharing.scala:7: warning: match may not be exhaustive.
+ List(1, 3, 4, 7) match {
+ ^
1
diff --git a/test/files/run/virtpatmat_opt_sharing.flags b/test/files/run/virtpatmat_opt_sharing.flags
deleted file mode 100644
index 3f5a3100e4..0000000000
--- a/test/files/run/virtpatmat_opt_sharing.flags
+++ /dev/null
@@ -1 +0,0 @@
- -Xexperimental
diff --git a/test/files/run/virtpatmat_opt_sharing.scala b/test/files/run/virtpatmat_opt_sharing.scala
index 119e3050ea..d2c42cab48 100644
--- a/test/files/run/virtpatmat_opt_sharing.scala
+++ b/test/files/run/virtpatmat_opt_sharing.scala
@@ -1,3 +1,6 @@
+/*
+ * filter: It would fail on the following input
+ */
object Test extends App {
virtMatch()
def virtMatch() = {
@@ -7,4 +10,4 @@ object Test extends App {
case 1 :: 3 :: 4 :: 7 :: x => println(1)
}
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/virtpatmat_staging.scala b/test/files/run/virtpatmat_staging.scala
index c17b45043b..d444829b02 100644
--- a/test/files/run/virtpatmat_staging.scala
+++ b/test/files/run/virtpatmat_staging.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ higherKinds, implicitConversions }
+
trait Intf {
type Rep[+T]
type M[+T] = Rep[Maybe[T]]
@@ -9,7 +12,7 @@ trait Intf {
def zero: M[Nothing]
def one[T](x: Rep[T]): M[T]
- def guard[T](cond: Rep[Boolean], then: => Rep[T]): M[T]
+ def guard[T](cond: Rep[Boolean], dann: => Rep[T]): M[T]
def isSuccess[T, U](x: Rep[T])(f: Rep[T] => M[U]): Rep[Boolean] // used for isDefinedAt
}
@@ -33,7 +36,7 @@ trait Impl extends Intf {
def runOrElse[T, U](in: Rep[T])(matcher: Rep[T] => M[U]): Rep[U] = ("runOrElse("+ in +", ?" + matcher("?") + ")")
def zero: M[Nothing] = "zero"
def one[T](x: Rep[T]): M[T] = "one("+x.toString+")"
- def guard[T](cond: Rep[Boolean], then: => Rep[T]): M[T] = "guard("+cond+","+then+")"
+ def guard[T](cond: Rep[Boolean], dann: => Rep[T]): M[T] = s"guard($cond,$dann)"
def isSuccess[T, U](x: Rep[T])(f: Rep[T] => M[U]): Rep[Boolean] = ("isSuccess("+x+", ?" + f("?") + ")")
}
diff --git a/test/files/run/virtpatmat_stringinterp.scala b/test/files/run/virtpatmat_stringinterp.scala
index 213712f17a..c6c951e6e5 100644
--- a/test/files/run/virtpatmat_stringinterp.scala
+++ b/test/files/run/virtpatmat_stringinterp.scala
@@ -1,3 +1,6 @@
+
+import scala.language.{ implicitConversions }
+
object Test extends App {
case class Node(x: Int)
@@ -10,4 +13,4 @@ object Test extends App {
val x: Node = Node(0)
x match { case xml"""<foo arg=$a/>""" => println(a) }
-} \ No newline at end of file
+}
diff --git a/test/files/run/virtpatmat_try.scala b/test/files/run/virtpatmat_try.scala
index 46e67cb72e..dab2c89227 100644
--- a/test/files/run/virtpatmat_try.scala
+++ b/test/files/run/virtpatmat_try.scala
@@ -8,7 +8,7 @@ object Test extends App {
} catch { // this should emit a "catch-switch"
case y: A => println(y.x)
case (_ : A | _ : B) => println("B")
- case _ => println("other")
+ case _: Throwable => println("other")
}
try {
@@ -17,7 +17,7 @@ object Test extends App {
// case A(x) => println(x)
case y: A => println(y.x)
case x@((_ : A) | (_ : B)) => println(x)
- case _ => println("other")
+ case _: Throwable => println("other")
}
def simpleTry {
@@ -34,7 +34,7 @@ object Test extends App {
}
def wildcardTry {
- try { bla } catch { case _ => bla }
+ try { bla } catch { case _: Throwable => bla }
}
def tryPlusFinally {
@@ -44,4 +44,4 @@ object Test extends App {
def catchAndPassToLambda {
try { bla } catch { case ex: Exception => val f = () => ex }
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/virtpatmat_typed.check b/test/files/run/virtpatmat_typed.check
index cec2740d18..9924d84148 100644
--- a/test/files/run/virtpatmat_typed.check
+++ b/test/files/run/virtpatmat_typed.check
@@ -1 +1,4 @@
+virtpatmat_typed.scala:5: warning: unreachable code
+ case x: String => println("FAILED")
+ ^
OK foo
diff --git a/test/files/run/xml-loop-bug.scala b/test/files/run/xml-loop-bug.scala
index 67637674b2..dc155dbb02 100644
--- a/test/files/run/xml-loop-bug.scala
+++ b/test/files/run/xml-loop-bug.scala
@@ -1,8 +1,14 @@
+import java.io.{ Console => _, _ }
+import scala.io._
+import scala.xml.parsing._
object Test {
def main(args: Array[String]): Unit = {
- val sink = new java.io.PrintStream(new java.io.ByteArrayOutputStream())
- Console setOut sink
- Console setErr sink
- scala.xml.parsing.ConstructingParser.fromSource(scala.io.Source.fromString("<!DOCTYPE xmeml SYSTEM> <xmeml> <sequence> </sequence> </xmeml> "), true).document.docElem
+ val xml = "<!DOCTYPE xmeml SYSTEM> <xmeml> <sequence> </sequence> </xmeml> "
+ val sink = new PrintStream(new ByteArrayOutputStream())
+ (Console withOut sink) {
+ (Console withErr sink) {
+ ConstructingParser.fromSource((Source fromString xml), true).document.docElem
+ }
+ }
}
}