File: newpat_unreachable.check

package info (click to toggle)
scala 2.11.8-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 61,060 kB
  • ctags: 3,923
  • sloc: java: 13,251; xml: 3,214; sh: 1,553; python: 756; makefile: 40; awk: 36; ansic: 6
file content (35 lines) | stat: -rw-r--r-- 1,858 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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:7: warning: unreachable code
      case c => println("matched c")
                       ^
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
                    ^
newpat_unreachable.scala:23: warning: unreachable code
          case c => 2
                    ^
error: No warnings can be incurred under -Xfatal-warnings.
9 warnings found
one error found