Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extractor pattern no longer matches
null
Until now, the spec did not say anything about `null` for extractor pattern, so that: - The pattern matcher would happily pass `null` into your extractor. - One could write a `null`-matching extractor `MyNull`. - But all extractor authors must consider `null` as a possible argument value. No more! The pattern matcher inserts a non-`null` check before invoking an extractor, so that you don't have to. This is a general fix for scala/bug#2241, scala/bug#8787. See scala/bug#4364.
- Loading branch information
Showing
15 changed files
with
202 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
patmatnew.scala:351: warning: a pure expression does nothing in statement position | ||
patmatnew.scala:352: warning: a pure expression does nothing in statement position | ||
case 1 => "OK" | ||
^ | ||
patmatnew.scala:352: warning: a pure expression does nothing in statement position | ||
patmatnew.scala:353: warning: a pure expression does nothing in statement position | ||
case 2 => assert(false); "KO" | ||
^ | ||
patmatnew.scala:352: warning: multiline expressions might require enclosing parentheses; a value can be silently discarded when Unit is expected | ||
patmatnew.scala:353: 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 | ||
patmatnew.scala:354: 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 | ||
patmatnew.scala:354: 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. | ||
patmatnew.scala:671: 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 | ||
patmatnew.scala:490: warning: unreachable code | ||
case _ if false => | ||
^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.