diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/contrib674.check | 5 | ||||
-rw-r--r-- | test/files/run/contrib674.scala | 2 | ||||
-rw-r--r-- | test/files/run/delay-bad.check | 4 | ||||
-rw-r--r-- | test/files/run/delay-good.check | 4 | ||||
-rw-r--r-- | test/files/run/exceptions-2.check | 2 | ||||
-rw-r--r-- | test/files/run/lazy-locals.check | 4 | ||||
-rw-r--r-- | test/files/run/macro-duplicate.check | 2 | ||||
-rw-r--r-- | test/files/run/misc.check | 16 | ||||
-rw-r--r-- | test/files/run/names-defaults.check | 5 | ||||
-rw-r--r-- | test/files/run/patmatnew.check | 12 | ||||
-rw-r--r-- | test/files/run/reify_lazyunit.check | 2 | ||||
-rw-r--r-- | test/files/run/repl-bare-expr.check | 12 | ||||
-rw-r--r-- | test/files/run/repl-no-imports-no-predef.check | 24 | ||||
-rw-r--r-- | test/files/run/repl-parens.check | 12 | ||||
-rw-r--r-- | test/files/run/t3488.check | 10 | ||||
-rw-r--r-- | test/files/run/t4047.check | 8 | ||||
-rw-r--r-- | test/files/run/t4680.check | 4 | ||||
-rw-r--r-- | test/files/run/t5380.check | 4 | ||||
-rw-r--r-- | test/files/run/t7047.check | 2 | ||||
-rw-r--r-- | test/files/run/t7747-repl.check | 24 | ||||
-rw-r--r-- | test/files/run/t8196.check | 2 | ||||
-rw-r--r-- | test/files/run/try-2.check | 2 | ||||
-rw-r--r-- | test/files/run/try.check | 2 |
23 files changed, 91 insertions, 73 deletions
diff --git a/test/files/run/contrib674.check b/test/files/run/contrib674.check index 78325c1810..98c72f34dd 100644 --- a/test/files/run/contrib674.check +++ b/test/files/run/contrib674.check @@ -1,3 +1,6 @@ -contrib674.scala:15: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +contrib674.scala:15: warning: a pure expression does nothing in statement position + 1 + ^ +contrib674.scala:15: warning: multiline expressions might require enclosing parentheses; a value can be silently discarded when Unit is expected 1 ^ diff --git a/test/files/run/contrib674.scala b/test/files/run/contrib674.scala index 45c9871fc4..bb9dad3686 100644 --- a/test/files/run/contrib674.scala +++ b/test/files/run/contrib674.scala @@ -1,7 +1,7 @@ // causes VerifyError with scala-2.5.1 object Test extends App { - def bad() { + def bad(): Unit = { try { 1 } catch { diff --git a/test/files/run/delay-bad.check b/test/files/run/delay-bad.check index fcd05c827f..bf41c79a3a 100644 --- a/test/files/run/delay-bad.check +++ b/test/files/run/delay-bad.check @@ -1,7 +1,7 @@ -delay-bad.scala:53: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +delay-bad.scala:53: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses f(new C { 5 }) ^ -delay-bad.scala:73: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +delay-bad.scala:73: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses f(new { val x = 5 } with E() { 5 }) ^ warning: there was one deprecation warning (since 2.11.0); re-run with -deprecation for details diff --git a/test/files/run/delay-good.check b/test/files/run/delay-good.check index b4f6b04af7..ed35b9225f 100644 --- a/test/files/run/delay-good.check +++ b/test/files/run/delay-good.check @@ -1,7 +1,7 @@ -delay-good.scala:53: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +delay-good.scala:53: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses f(new C { 5 }) ^ -delay-good.scala:73: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +delay-good.scala:73: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses f(new { val x = 5 } with E() { 5 }) ^ diff --git a/test/files/run/exceptions-2.check b/test/files/run/exceptions-2.check index 4f8244800a..5cf5e71f41 100644 --- a/test/files/run/exceptions-2.check +++ b/test/files/run/exceptions-2.check @@ -1,4 +1,4 @@ -exceptions-2.scala:267: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +exceptions-2.scala:267: warning: a pure expression does nothing in statement position try { 1 } catch { case e: java.io.IOException => () } ^ nested1: diff --git a/test/files/run/lazy-locals.check b/test/files/run/lazy-locals.check index 9e88a55d18..4565326bea 100644 --- a/test/files/run/lazy-locals.check +++ b/test/files/run/lazy-locals.check @@ -1,7 +1,7 @@ -lazy-locals.scala:153: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +lazy-locals.scala:153: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses { ^ -lazy-locals.scala:159: 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; multiline expressions may require enclosing parentheses { ^ forced lazy val q diff --git a/test/files/run/macro-duplicate.check b/test/files/run/macro-duplicate.check index 58781b719a..7006b16611 100644 --- a/test/files/run/macro-duplicate.check +++ b/test/files/run/macro-duplicate.check @@ -1,3 +1,3 @@ -Test_2.scala:5: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +Test_2.scala:5: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses Macros.foo ^ diff --git a/test/files/run/misc.check b/test/files/run/misc.check index 56116f8104..075dfeff2f 100644 --- a/test/files/run/misc.check +++ b/test/files/run/misc.check @@ -1,25 +1,25 @@ -misc.scala:46: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +misc.scala:46: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses 42; ^ -misc.scala:47: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +misc.scala:47: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses 42l; ^ -misc.scala:48: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +misc.scala:48: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses 23.5f; ^ -misc.scala:49: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +misc.scala:49: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses 23.5; ^ -misc.scala:50: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +misc.scala:50: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses "Hello"; ^ -misc.scala:51: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +misc.scala:51: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses 32 + 45; ^ -misc.scala:62: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +misc.scala:62: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses x; ^ -misc.scala:74: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +misc.scala:74: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses 1 < 2; ^ ### Hello diff --git a/test/files/run/names-defaults.check b/test/files/run/names-defaults.check index c358dc5849..722d28dd11 100644 --- a/test/files/run/names-defaults.check +++ b/test/files/run/names-defaults.check @@ -1,4 +1,7 @@ -names-defaults.scala:269: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +names-defaults.scala:269: warning: a pure expression does nothing in statement position + spawn(b = { val ttt = 1; ttt }, a = 0) + ^ +names-defaults.scala:269: warning: multiline expressions might require enclosing parentheses; a value can be silently discarded when Unit is expected spawn(b = { val ttt = 1; ttt }, a = 0) ^ warning: there were four deprecation warnings; re-run with -deprecation for details diff --git a/test/files/run/patmatnew.check b/test/files/run/patmatnew.check index 56b8ac2f4f..117bc28c2d 100644 --- a/test/files/run/patmatnew.check +++ b/test/files/run/patmatnew.check @@ -1,10 +1,16 @@ -patmatnew.scala:351: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +patmatnew.scala:351: warning: a pure expression does nothing in statement position case 1 => "OK" ^ -patmatnew.scala:352: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +patmatnew.scala:352: warning: a pure expression does nothing in statement position case 2 => assert(false); "KO" ^ -patmatnew.scala:353: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +patmatnew.scala:352: warning: multiline expressions might require enclosing parentheses; a value can be silently discarded when Unit is expected + case 2 => assert(false); "KO" + ^ +patmatnew.scala:353: warning: a pure expression does nothing in statement position + case 3 => assert(false); "KO" + ^ +patmatnew.scala:353: warning: multiline expressions might require enclosing parentheses; a value can be silently discarded when Unit is expected 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. diff --git a/test/files/run/reify_lazyunit.check b/test/files/run/reify_lazyunit.check index 579ecfe8aa..e6acf5d17b 100644 --- a/test/files/run/reify_lazyunit.check +++ b/test/files/run/reify_lazyunit.check @@ -1,4 +1,4 @@ -reify_lazyunit.scala:6: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +reify_lazyunit.scala:6: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses lazy val x = { 0; println("12")} ^ 12 diff --git a/test/files/run/repl-bare-expr.check b/test/files/run/repl-bare-expr.check index e0a1f4ecd6..bdf8842bb0 100644 --- a/test/files/run/repl-bare-expr.check +++ b/test/files/run/repl-bare-expr.check @@ -1,12 +1,12 @@ scala> 2 ; 3 -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 2 ;; ^ res0: Int = 3 scala> { 2 ; 3 } -<console>:12: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:12: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses { 2 ; 3 } ^ res1: Int = 3 @@ -15,16 +15,16 @@ scala> 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Mooo 1 + 2 + 3 } ; bippy+88+11 -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = { ^ -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = { ^ -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = { ^ -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = { ^ defined object Cow diff --git a/test/files/run/repl-no-imports-no-predef.check b/test/files/run/repl-no-imports-no-predef.check index c2c8d21c0a..7c4ee82c78 100644 --- a/test/files/run/repl-no-imports-no-predef.check +++ b/test/files/run/repl-no-imports-no-predef.check @@ -76,13 +76,13 @@ y: Int = 13 scala> scala> 2 ; 3 -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 2 ;; ^ res14: Int = 3 scala> { 2 ; 3 } -<console>:12: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:12: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses { 2 ; 3 } ^ res15: Int = 3 @@ -92,16 +92,16 @@ bippy = { 1 + 2 + 3 } ; bippy+88+11 -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def ^ -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def ^ -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def ^ -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def ^ defined object Cow @@ -143,10 +143,10 @@ scala> ( (2 + 2 ) ) res24: Int = 4 scala> 5 ; ( (2 + 2 ) ) ; ((5)) -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 5 ; ( (2 + 2 ) ) ;; ^ -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 5 ; ( (2 + 2 ) ) ;; ^ res25: Int = 5 @@ -163,16 +163,16 @@ res28: String = 4423 scala> scala> 55 ; ((2 + 2)) ; (1, 2, 3) -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 55 ; ((2 + 2)) ;; ^ -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 55 ; ((2 + 2)) ;; ^ res29: (Int, Int, Int) = (1,2,3) scala> 55 ; (x: scala.Int) => x + 1 ; () => ((5)) -<console>:12: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:12: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 55 ; (x: scala.Int) => x + 1 ;; ^ res30: () => Int = <function0> @@ -183,7 +183,7 @@ scala> () => 5 res31: () => Int = <function0> scala> 55 ; () => 5 -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 55 ;; ^ res32: () => Int = <function0> diff --git a/test/files/run/repl-parens.check b/test/files/run/repl-parens.check index 6516f4ea90..477d4d462f 100644 --- a/test/files/run/repl-parens.check +++ b/test/files/run/repl-parens.check @@ -18,10 +18,10 @@ scala> ( (2 + 2 ) ) res5: Int = 4 scala> 5 ; ( (2 + 2 ) ) ; ((5)) -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 5 ; ( (2 + 2 ) ) ;; ^ -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 5 ; ( (2 + 2 ) ) ;; ^ res6: Int = 5 @@ -38,16 +38,16 @@ res9: String = 4423 scala> scala> 55 ; ((2 + 2)) ; (1, 2, 3) -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 55 ; ((2 + 2)) ;; ^ -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 55 ; ((2 + 2)) ;; ^ res10: (Int, Int, Int) = (1,2,3) scala> 55 ; (x: Int) => x + 1 ; () => ((5)) -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 55 ; (x: Int) => x + 1 ;; ^ res11: () => Int = <function0> @@ -58,7 +58,7 @@ scala> () => 5 res12: () => Int = <function0> scala> 55 ; () => 5 -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 55 ;; ^ res13: () => Int = <function0> diff --git a/test/files/run/t3488.check b/test/files/run/t3488.check index 314dfc7838..75b2c3b07f 100644 --- a/test/files/run/t3488.check +++ b/test/files/run/t3488.check @@ -1,7 +1,13 @@ -t3488.scala:4: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +t3488.scala:4: warning: a pure expression does nothing in statement position 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 +t3488.scala:4: warning: multiline expressions might require enclosing parentheses; a value can be silently discarded when Unit is expected + println(foo { val List(_*)=List(0); 1 } ()) + ^ +t3488.scala:5: warning: a pure expression does nothing in statement position + println(foo { val List(_*)=List(0); 1 } (1)) + ^ +t3488.scala:5: warning: multiline expressions might require enclosing parentheses; a value can be silently discarded when Unit is expected println(foo { val List(_*)=List(0); 1 } (1)) ^ 0 diff --git a/test/files/run/t4047.check b/test/files/run/t4047.check index 3c41e6e244..c31f2f0858 100644 --- a/test/files/run/t4047.check +++ b/test/files/run/t4047.check @@ -1,13 +1,13 @@ -t4047.scala:23: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +t4047.scala:23: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses a.foo ^ -t4047.scala:24: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +t4047.scala:24: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses a.foo ^ -t4047.scala:26: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +t4047.scala:26: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses b.foo ^ -t4047.scala:27: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +t4047.scala:27: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses b.foo ^ Unit: called A.foo diff --git a/test/files/run/t4680.check b/test/files/run/t4680.check index 21c5f9e567..749ce4c627 100644 --- a/test/files/run/t4680.check +++ b/test/files/run/t4680.check @@ -1,7 +1,7 @@ -t4680.scala:51: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +t4680.scala:51: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses new C { 5 } ^ -t4680.scala:69: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +t4680.scala:69: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses new { val x = 5 } with E() { 5 } ^ warning: there was one deprecation warning (since 2.11.0); re-run with -deprecation for details diff --git a/test/files/run/t5380.check b/test/files/run/t5380.check index 731a798301..19471ac2d2 100644 --- a/test/files/run/t5380.check +++ b/test/files/run/t5380.check @@ -1,7 +1,7 @@ -t5380.scala:3: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +t5380.scala:3: warning: a pure expression does nothing in statement position 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 +t5380.scala:3: warning: a pure expression does nothing in statement position val f = () => return try { 1 } catch { case _: Throwable => 0 } ^ t5380.scala:3: warning: enclosing method main has result type Unit: return value discarded diff --git a/test/files/run/t7047.check b/test/files/run/t7047.check index 32bd581094..129ce3eeca 100644 --- a/test/files/run/t7047.check +++ b/test/files/run/t7047.check @@ -1,3 +1,3 @@ -Test_2.scala:2: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +Test_2.scala:2: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses Macros.foo ^ diff --git a/test/files/run/t7747-repl.check b/test/files/run/t7747-repl.check index c5e92e9d79..621a70205e 100644 --- a/test/files/run/t7747-repl.check +++ b/test/files/run/t7747-repl.check @@ -15,13 +15,13 @@ scala> val z = x * y z: Int = 156 scala> 2 ; 3 -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 2 ;; ^ res0: Int = 3 scala> { 2 ; 3 } -<console>:12: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:12: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses { 2 ; 3 } ^ res1: Int = 3 @@ -30,16 +30,16 @@ scala> 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Mooo 1 + 2 + 3 } ; bippy+88+11 -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = { ^ -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = { ^ -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = { ^ -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = { ^ defined object Cow @@ -81,10 +81,10 @@ scala> ( (2 + 2 ) ) res10: Int = 4 scala> 5 ; ( (2 + 2 ) ) ; ((5)) -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 5 ; ( (2 + 2 ) ) ;; ^ -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 5 ; ( (2 + 2 ) ) ;; ^ res11: Int = 5 @@ -101,16 +101,16 @@ res14: String = 4423 scala> scala> 55 ; ((2 + 2)) ; (1, 2, 3) -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 55 ; ((2 + 2)) ;; ^ -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 55 ; ((2 + 2)) ;; ^ res15: (Int, Int, Int) = (1,2,3) scala> 55 ; (x: Int) => x + 1 ; () => ((5)) -<console>:13: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:13: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 55 ; (x: Int) => x + 1 ;; ^ res16: () => Int = <function0> @@ -121,7 +121,7 @@ scala> () => 5 res17: () => Int = <function0> scala> 55 ; () => 5 -<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +<console>:11: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses 55 ;; ^ res18: () => Int = <function0> diff --git a/test/files/run/t8196.check b/test/files/run/t8196.check index d11dc27e68..8a07ebb6d7 100644 --- a/test/files/run/t8196.check +++ b/test/files/run/t8196.check @@ -1,4 +1,4 @@ -t8196.scala:26: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +t8196.scala:26: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses form2.g1 // comment this line in order to make the test pass ^ warning: there were two feature warnings; re-run with -feature for details diff --git a/test/files/run/try-2.check b/test/files/run/try-2.check index 987d3462df..7fd45414da 100644 --- a/test/files/run/try-2.check +++ b/test/files/run/try-2.check @@ -1,4 +1,4 @@ -try-2.scala:41: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +try-2.scala:41: warning: a pure expression does nothing in statement position 10; ^ exception happened diff --git a/test/files/run/try.check b/test/files/run/try.check index f742ccb0df..d9521c2362 100644 --- a/test/files/run/try.check +++ b/test/files/run/try.check @@ -1,4 +1,4 @@ -try.scala:65: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses +try.scala:65: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses 1+1; ^ 1 + 1 = 2 |