summaryrefslogblamecommitdiff
path: root/test/files/neg/unit-returns-value.check
blob: f30a506ebe508970be6383e35ef782cc8605a1bc (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
                                                                                                                                    

                   
                                                                                                    

                   





                                                                                                                                     
                                                          
                   
               
unit-returns-value.scala:4: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
    if (b) return 5
                  ^
unit-returns-value.scala:4: warning: enclosing method f has result type Unit: return value discarded
    if (b) return 5
           ^
unit-returns-value.scala:22: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
    i1 // warn
    ^
unit-returns-value.scala:23: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
    i2 // warn
    ^
error: No warnings can be incurred under -Xfatal-warnings.
four warnings found
one error found