summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/reflect/internal/Types.scala2
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala6
-rw-r--r--src/compiler/scala/tools/nsc/settings/ScalaSettings.scala1
3 files changed, 8 insertions, 1 deletions
diff --git a/src/compiler/scala/reflect/internal/Types.scala b/src/compiler/scala/reflect/internal/Types.scala
index c313f079ae..1e0a265f4b 100644
--- a/src/compiler/scala/reflect/internal/Types.scala
+++ b/src/compiler/scala/reflect/internal/Types.scala
@@ -3092,7 +3092,7 @@ A type's typeSymbol should never be inspected directly.
// Or false for Seq[A] => Seq[A]
// (It will rewrite A* everywhere but method parameters.)
// This is the specified behavior.
- private final val etaExpandKeepsStar = true
+ protected def etaExpandKeepsStar = false
object dropRepeatedParamType extends TypeMap {
def apply(tp: Type): Type = tp match {
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala
index 604379d33f..e166b42436 100644
--- a/src/compiler/scala/tools/nsc/Global.scala
+++ b/src/compiler/scala/tools/nsc/Global.scala
@@ -300,6 +300,12 @@ class Global(var currentSettings: Settings, var reporter: Reporter) extends Symb
def lubDebug = (sys.props contains "scalac.debug.lub")
}
+ // The current division between scala.reflect.* and scala.tools.nsc.* is pretty
+ // clunky. It is often difficult to have a setting influence something without having
+ // to create it on that side. For this one my strategy is a constant def at the file
+ // where I need it, and then an override in Global with the setting.
+ override protected val etaExpandKeepsStar = settings.etaExpandKeepsStar.value
+
// True if -Xscript has been set, indicating a script run.
def isScriptRun = opt.script.isDefined
diff --git a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
index 10ba5b200a..5cf5767257 100644
--- a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
+++ b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
@@ -168,6 +168,7 @@ trait ScalaSettings extends AbsScalaSettings
val Ynotnull = BooleanSetting ("-Ynotnull", "Enable (experimental and incomplete) scala.NotNull.")
val YdepMethTpes = BooleanSetting ("-Ydependent-method-types", "Allow dependent method types.")
val YmethodInfer = BooleanSetting ("-Yinfer-argument-types", "Infer types for arguments of overriden methods.")
+ val etaExpandKeepsStar = BooleanSetting("-Yeta-expand-keeps-star", "Eta-expand varargs methods to T* rather than Seq[T]. This is a temporary option to ease transition.")
val noSelfCheck = BooleanSetting ("-Yno-self-type-checks", "Suppress check for self-type conformance among inherited members.")
val YvirtClasses = false // too embryonic to even expose as a -Y //BooleanSetting ("-Yvirtual-classes", "Support virtual classes")