aboutsummaryrefslogtreecommitdiff
path: root/src/dotty
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-09-25 13:47:42 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2014-10-11 06:38:11 +0200
commiteb2e265e12d10aa28c63bbe99b2c4a4a79ee8869 (patch)
treefbee74ff83a2d47a95c0fea71178034d906ef998 /src/dotty
parent543ff7f4123ded7172fd6ede59f09945efd7c158 (diff)
downloaddotty-eb2e265e12d10aa28c63bbe99b2c4a4a79ee8869.tar.gz
dotty-eb2e265e12d10aa28c63bbe99b2c4a4a79ee8869.tar.bz2
dotty-eb2e265e12d10aa28c63bbe99b2c4a4a79ee8869.zip
Make rejection of deep subtype call stack optional
Move flag that throws exception on deep subtyping stacks from Config varianble to setting. Disable setting for core-pickling which had a deep subtype failure after pattern matcher was integrated. Todo: Figure out why the subtype stack got so deep.
Diffstat (limited to 'src/dotty')
-rw-r--r--src/dotty/tools/dotc/config/Config.scala3
-rw-r--r--src/dotty/tools/dotc/config/ScalaSettings.scala1
-rw-r--r--src/dotty/tools/dotc/core/TypeComparer.scala2
3 files changed, 2 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/config/Config.scala b/src/dotty/tools/dotc/config/Config.scala
index 353ec1dce..b17a5630f 100644
--- a/src/dotty/tools/dotc/config/Config.scala
+++ b/src/dotty/tools/dotc/config/Config.scala
@@ -21,9 +21,6 @@ object Config {
*/
final val checkNoDoubleBindings = true
- /** Throw an exception if a deep subtype recursion is detected */
- final val flagDeepSubTypeRecursions = true
-
/** Show subtype traces for all deep subtype recursions */
final val traceDeepSubTypeRecursions = false
diff --git a/src/dotty/tools/dotc/config/ScalaSettings.scala b/src/dotty/tools/dotc/config/ScalaSettings.scala
index 177813555..f23fb6201 100644
--- a/src/dotty/tools/dotc/config/ScalaSettings.scala
+++ b/src/dotty/tools/dotc/config/ScalaSettings.scala
@@ -146,6 +146,7 @@ class ScalaSettings extends Settings.SettingGroup {
val YshowSuppressedErrors = BooleanSetting("-Yshow-suppressed-errors", "Also show follow-on errors and warnings that are normally supressed.")
val Yheartbeat = BooleanSetting("-Yheartbeat", "show heartbeat stack trace of compiler operations.")
val Yprintpos = BooleanSetting("-Yprintpos", "show tree positions")
+ val YnoDeepSubtypes = BooleanSetting("-YnoDeepSubtypes", "throw an exception on deep subtyping call stacks")
def stop = YstopAfter
/** Area-specific debug output.
diff --git a/src/dotty/tools/dotc/core/TypeComparer.scala b/src/dotty/tools/dotc/core/TypeComparer.scala
index 805941c5d..5322162d5 100644
--- a/src/dotty/tools/dotc/core/TypeComparer.scala
+++ b/src/dotty/tools/dotc/core/TypeComparer.scala
@@ -422,7 +422,7 @@ class TypeComparer(initctx: Context) extends DotClass {
pendingSubTypes = new mutable.HashSet[(Type, Type)]
ctx.log(s"!!! deep subtype recursion involving ${tp1.show} <:< ${tp2.show}, constraint = ${state.constraint.show}")
ctx.log(s"!!! constraint = ${constraint.show}")
- assert(!Config.flagDeepSubTypeRecursions)
+ assert(!ctx.settings.YnoDeepSubtypes.value)
if (Config.traceDeepSubTypeRecursions && !this.isInstanceOf[ExplainingTypeComparer])
ctx.log(TypeComparer.explained(implicit ctx => ctx.typeComparer.isSubType(tp1, tp2)))
}