summaryrefslogtreecommitdiff
path: root/test/junit
diff options
context:
space:
mode:
authorGerard Basler <gerard.basler@gmail.com>2015-03-02 04:22:02 +0100
committerGerard Basler <gerard.basler@leonteq.com>2015-03-02 11:14:36 +0100
commit081c1f1d3ae01b1a237ab0f7cacdf04eecf71793 (patch)
tree8490f3afad8556ae99f371ee86a32a4bf26b1397 /test/junit
parent092690e7bf71bb22e6e57afb7ea7f67fdfe31a0a (diff)
downloadscala-081c1f1d3ae01b1a237ab0f7cacdf04eecf71793.tar.gz
scala-081c1f1d3ae01b1a237ab0f7cacdf04eecf71793.tar.bz2
scala-081c1f1d3ae01b1a237ab0f7cacdf04eecf71793.zip
Add a check to ensure that if the formulas originating from the exhaustivity /
reachability analysis are too big to be solved in reasonable time, then we skip the analysis. I also cleaned up warnings. Why did `t9181.scala` work fine with 2.11.4, but is now running out of memory? In order to ensure that the scrutinee is associated only with one of the 400 derived classes we add 400*400 / 2 ~ 80k clauses to ensure mutual exclusivity. In 2.11.4 the translation into CNF used to fail, since it would blow up already at this point in memory. This has been fixed in 2.11.5, but now the DPLL solver is the bottleneck. There's a check in the search for all models (exhaustivity) that it would avoid a blow up, but in the search for a model (reachability), such a check is missing.
Diffstat (limited to 'test/junit')
-rw-r--r--test/junit/scala/tools/nsc/transform/patmat/SolvingTest.scala3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/junit/scala/tools/nsc/transform/patmat/SolvingTest.scala b/test/junit/scala/tools/nsc/transform/patmat/SolvingTest.scala
index 1fff9c9a32..1fe7b19056 100644
--- a/test/junit/scala/tools/nsc/transform/patmat/SolvingTest.scala
+++ b/test/junit/scala/tools/nsc/transform/patmat/SolvingTest.scala
@@ -6,6 +6,7 @@ import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import scala.collection.mutable
+import scala.reflect.internal.util.Position
import scala.tools.nsc.{Global, Settings}
object TestSolver extends Logic with Solving {
@@ -72,6 +73,8 @@ object TestSolver extends Logic with Solving {
def prepareNewAnalysis() = {}
+ def uncheckedWarning(pos: Position, msg: String) = sys.error(msg)
+
def reportWarning(msg: String) = sys.error(msg)
/**