You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(This should really be 2.10.0-RC5, but JIRA would not let me enter that.)
I emailed scala-internals about this issue. Basically, I have a pattern match that under RC3 and earlier did not issue any warnings but which now gives the following:
[warn] /Users/erik/w/spire/src/main/scala/test.scala:2: Cannot check match for unreachability.
[warn] (The analysis required more space than allowed. Please try with scalac -Dscalac.patmat.analysisBudget=512 or -Dscalac.patmat.analysisBudget=off.)
[warn] def qux(s: String): String = s match {
[warn] ^
[warn] one warning found
The suggestion (upping the analysis budget) does work, but I wonder if maybe there is a bug, since the pattern to be checked is relatively simple (a bunch of literal strings terminated by a wildcard). I have attached the test case I used.
The text was updated successfully, but these errors were encountered:
@paulp said:
A pattern built from all literals will become a switch if they're Int or smaller-Int, but other literals are given a hefty N^2 tax while the pattern matcher searches for unreachable code in rather inefficient fashion. It should be easy to fix.
@retronym said (edited on Jan 19, 2013 11:27:58 AM UTC):
Duplicate of #6942, i've confirmed that the open pull request fixes this example.
1915 ~/code/scala2 git describe
v2.10.0-311-g964776f
1915 ~/code/scala2 ./build/quick/bin/scalac -unchecked sandbox/test.scala
1915 ~/code/scala2 scalac210 -unchecked sandbox/test.scala
sandbox/test.scala:2: warning: Cannot check match for unreachability.
(The analysis required more space than allowed. Please try with scalac -Dscalac.patmat.analysisBudget=512 or -Dscalac.patmat.analysisBudget=off.)
def qux(s: String): String = s match {
^
one warning found
(This should really be 2.10.0-RC5, but JIRA would not let me enter that.)
I emailed scala-internals about this issue. Basically, I have a pattern match that under RC3 and earlier did not issue any warnings but which now gives the following:
[warn] /Users/erik/w/spire/src/main/scala/test.scala:2: Cannot check match for unreachability. [warn] (The analysis required more space than allowed. Please try with scalac -Dscalac.patmat.analysisBudget=512 or -Dscalac.patmat.analysisBudget=off.) [warn] def qux(s: String): String = s match { [warn] ^ [warn] one warning found
The suggestion (upping the analysis budget) does work, but I wonder if maybe there is a bug, since the pattern to be checked is relatively simple (a bunch of literal strings terminated by a wildcard). I have attached the test case I used.
The text was updated successfully, but these errors were encountered: