diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2011-10-20 22:28:44 +0000 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2011-10-20 22:28:44 +0000 |
commit | 3921e5be742ff9523825037056e82b7b82db5932 (patch) | |
tree | 046e7f6ff585ba66c80825132974f52f5a3638e0 /src/compiler/scala/tools | |
parent | 24eb4c5bb5b3ed0e6bb4ede3e68876cdbe7d18fc (diff) | |
download | scala-3921e5be742ff9523825037056e82b7b82db5932.tar.gz scala-3921e5be742ff9523825037056e82b7b82db5932.tar.bz2 scala-3921e5be742ff9523825037056e82b7b82db5932.zip |
dependent methods types are now always enabled
for now, left the old if(settings.YdepMethTpes.value) guards in comments
removed *.flags containing -Ydependent-method-types also updated one
check file with one fewer error
no review
Diffstat (limited to 'src/compiler/scala/tools')
4 files changed, 7 insertions, 17 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index 57aedb5169..a32e4bff61 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -267,7 +267,6 @@ class Global(var currentSettings: Settings, var reporter: Reporter) extends Symb } // behavior - def dependentMethodTypes = settings.YdepMethTpes.value // debugging def checkPhase = wasActive(settings.check) diff --git a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala index 5cf5767257..ef60dc32d4 100644 --- a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala +++ b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala @@ -92,7 +92,8 @@ trait ScalaSettings extends AbsScalaSettings // Experimental Extensions val Xexperimental = BooleanSetting ("-Xexperimental", "Enable experimental extensions.") . - withPostSetHook(set => List(YdepMethTpes, YmethodInfer, overrideObjects) foreach (_.value = set.value)) //YvirtClasses, + withPostSetHook(set => List(YmethodInfer, overrideObjects) foreach (_.value = set.value)) + // YdepMethTpes, YvirtClasses, /** Compatibility stubs for options whose value name did * not previously match the option name. @@ -166,7 +167,7 @@ trait ScalaSettings extends AbsScalaSettings val Ydocdebug = BooleanSetting ("-Ydoc-debug", "Trace all scaladoc activity.") val Ypmatnaive = BooleanSetting ("-Ypmat-naive", "Desugar matches as naively as possible.") val Ynotnull = BooleanSetting ("-Ynotnull", "Enable (experimental and incomplete) scala.NotNull.") - val YdepMethTpes = BooleanSetting ("-Ydependent-method-types", "Allow dependent method types.") + // 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.") diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala index 874d1149a0..1b2b737074 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala @@ -1459,15 +1459,11 @@ trait Namers { self: Analyzer => this(p.info) // can only refer to symbols in earlier parameter sections // (if the extension is enabled) - if (opt.dependentMethodTypes) - okParams ++= vps + okParams ++= vps } } - private def errorAddendum = ( - if (opt.dependentMethodTypes) - ": parameter appears in the type of another parameter in the same section or an earlier one" - else "" - ) + private def errorAddendum = + ": parameter appears in the type of another parameter in the same section or an earlier one" } @deprecated("Use underlyingSymbol instead", "2.10.0") diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 3cdfca9cf4..097def8390 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -724,7 +724,7 @@ trait Typers extends Modes with Adaptations { context.undetparams = inferExprInstance(tree, context.extractUndetparams(), pt, // approximate types that depend on arguments since dependency on implicit argument is like dependency on type parameter - if (settings.YdepMethTpes.value) mt.approximate else mt, + mt.approximate, // if we are looking for a manifest, instantiate type to Nothing anyway, // as we would get ambiguity errors otherwise. Example // Looking for a manifest of Nil: This has many potential types, @@ -1792,12 +1792,6 @@ trait Typers extends Modes with Adaptations { error(vparam1.pos, "*-parameter must come last") var tpt1 = checkNoEscaping.privates(meth, typedType(ddef.tpt)) - if (!settings.YdepMethTpes.value) { - for (vparams <- vparamss1; vparam <- vparams) { - checkNoEscaping.locals(context.scope, WildcardType, vparam.tpt); () - } - checkNoEscaping.locals(context.scope, WildcardType, tpt1) - } checkNonCyclic(ddef, tpt1) ddef.tpt.setType(tpt1.tpe) val typedMods = removeAnnotations(ddef.mods) |