diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-08-14 08:56:26 +0200 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-08-14 09:37:19 +0200 |
commit | 3ccaa1026e7e74d99fe39c9608e28c48b422e2c9 (patch) | |
tree | a1187b22900d5904f9ba6e5664440a8248491f5a /test/files/neg/newpat_unreachable.check | |
parent | 48d9fb7307fb6519fe786a7d9be97996c5812fb7 (diff) | |
parent | 12baa2ea399b4f281c62fd20479c1e626f244d03 (diff) | |
download | scala-3ccaa1026e7e74d99fe39c9608e28c48b422e2c9.tar.gz scala-3ccaa1026e7e74d99fe39c9608e28c48b422e2c9.tar.bz2 scala-3ccaa1026e7e74d99fe39c9608e28c48b422e2c9.zip |
Merge branch '2.10.x'
Conflicts:
src/compiler/scala/tools/nsc/Global.scala
src/compiler/scala/tools/nsc/typechecker/Typers.scala
test/files/neg/t6048.check
Diffstat (limited to 'test/files/neg/newpat_unreachable.check')
-rw-r--r-- | test/files/neg/newpat_unreachable.check | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/files/neg/newpat_unreachable.check b/test/files/neg/newpat_unreachable.check new file mode 100644 index 0000000000..a928e3853a --- /dev/null +++ b/test/files/neg/newpat_unreachable.check @@ -0,0 +1,29 @@ +newpat_unreachable.scala:6: warning: patterns after a variable pattern cannot match (SLS 8.1.1) +If you intended to match against parameter b of method contrivedExample, you must use backticks, like: case `b` => + case b => println("matched b") + ^ +newpat_unreachable.scala:7: warning: unreachable code due to variable pattern 'b' on line 6 +If you intended to match against parameter c of method contrivedExample, you must use backticks, like: case `c` => + case c => println("matched c") + ^ +newpat_unreachable.scala:8: warning: unreachable code due to variable pattern 'b' on line 6 +If you intended to match against value d in class A, you must use backticks, like: case `d` => + case d => println("matched d") + ^ +newpat_unreachable.scala:9: warning: unreachable code due to variable pattern 'b' on line 6 + case _ => println("matched neither") + ^ +newpat_unreachable.scala:22: warning: patterns after a variable pattern cannot match (SLS 8.1.1) +If you intended to match against parameter b of method g, you must use backticks, like: case `b` => + case b => 1 + ^ +newpat_unreachable.scala:23: warning: unreachable code due to variable pattern 'b' on line 22 +If you intended to match against parameter c of method h, you must use backticks, like: case `c` => + case c => 2 + ^ +newpat_unreachable.scala:24: warning: unreachable code due to variable pattern 'b' on line 22 + case _ => 3 + ^ +error: No warnings can be incurred under -Xfatal-warnings. +7 warnings found +one error found |