summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/Settings.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-10-28 20:10:54 +0000
committerPaul Phillips <paulp@improving.org>2009-10-28 20:10:54 +0000
commitb7772a6535b1d3989ad350069568b124619f2877 (patch)
tree56726bf0a76929fc69bcf059e68e6e7fb2632ce1 /src/compiler/scala/tools/nsc/Settings.scala
parentcc934ee7bb181645d4436eb923f7eb843b7c259d (diff)
downloadscala-b7772a6535b1d3989ad350069568b124619f2877.tar.gz
scala-b7772a6535b1d3989ad350069568b124619f2877.tar.bz2
scala-b7772a6535b1d3989ad350069568b124619f2877.zip
Whole bunch of code for people interested in eq...
Whole bunch of code for people interested in equality. This includes four command line options you can use to alter equality semantics and the various levels of babbling and panicking which the runtime has to offer when confronted with a boxed primitive comparison.
Diffstat (limited to 'src/compiler/scala/tools/nsc/Settings.scala')
-rw-r--r--src/compiler/scala/tools/nsc/Settings.scala12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/Settings.scala b/src/compiler/scala/tools/nsc/Settings.scala
index e1429b1644..eb6017815a 100644
--- a/src/compiler/scala/tools/nsc/Settings.scala
+++ b/src/compiler/scala/tools/nsc/Settings.scala
@@ -825,8 +825,6 @@ trait ScalacSettings {
withHelpSyntax("-Ysqueeze:<enabled>")
val Ystatistics = BooleanSetting ("-Ystatistics", "Print compiler statistics")
val stop = PhasesSetting ("-Ystop", "Stop after phase")
- val logEquality = BooleanSetting ("-Ylog-equality", "Log all noteworthy equality tests (hardcoded to /tmp/scala-equality-log.txt)") .
- withPostSetHook(() => scala.runtime.Equality.logEverything = true)
val refinementMethodDispatch =
ChoiceSetting ("-Ystruct-dispatch", "Selects dispatch method for structural refinement method calls",
List("no-cache", "mono-cache", "poly-cache", "invoke-dynamic"), "poly-cache") .
@@ -838,6 +836,16 @@ trait ScalacSettings {
val Ypmatdebug = BooleanSetting ("-Ypmat-debug", "Trace all pattern matcher activity.")
val Ytailrec = BooleanSetting ("-Ytailrecommend", "Alert methods which would be tail-recursive if private or final.")
+ // Equality specific
+ val logEqEq = BooleanSetting ("-Ylog-eqeq", "Log all noteworthy equality tests") .
+ withPostSetHook(() => scala.runtime.Equality.logEverything = true)
+ val YfutureEqEq = BooleanSetting ("-Yfuture-eqeq", "Use proposed overloading-based numeric equality semantics.") .
+ withPostSetHook(() => scala.runtime.Equality.use28Semantics = true)
+ val YwarnEqEq = BooleanSetting ("-Ywarn-eqeq", "Warn when boxed primitives of different types are compared.") .
+ withPostSetHook(() => scala.runtime.Equality.warnOnBoxedCompare = true)
+ val YdieEqEq = BooleanSetting ("-Ydie-changed-eqeq", "Throw an exception if a comparison would have come back differently in scala 2.7.") .
+ withPostSetHook(() => scala.runtime.Equality.dieOnBoxedCompareIfValuesAreEqual = true)
+
// Warnings
val Xwarninit = BooleanSetting ("-Xwarninit", "Warn about possible changes in initialization semantics")
val Xchecknull = BooleanSetting ("-Xcheck-null", "Emit warning on selection of nullable reference")