diff options
-rw-r--r-- | project/ScalaOptionParser.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/Global.scala | 6 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/settings/ScalaSettings.scala | 1 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala | 2 | ||||
-rw-r--r-- | src/reflect/scala/reflect/internal/tpe/TypeMaps.scala | 10 | ||||
-rw-r--r-- | test/files/neg/eta-expand-star-deprecation.check | 4 | ||||
-rw-r--r-- | test/files/neg/eta-expand-star-deprecation.flags | 1 | ||||
-rw-r--r-- | test/files/neg/eta-expand-star-deprecation.scala | 8 | ||||
-rw-r--r-- | test/files/run/eta-expand-star2.check | 2 | ||||
-rw-r--r-- | test/files/run/eta-expand-star2.flags | 1 | ||||
-rw-r--r-- | test/files/run/eta-expand-star2.scala | 8 |
11 files changed, 3 insertions, 42 deletions
diff --git a/project/ScalaOptionParser.scala b/project/ScalaOptionParser.scala index af82f8fce5..bcc561cb0d 100644 --- a/project/ScalaOptionParser.scala +++ b/project/ScalaOptionParser.scala @@ -83,7 +83,7 @@ object ScalaOptionParser { private def booleanSettingNames = List("-X", "-Xcheckinit", "-Xdev", "-Xdisable-assertions", "-Xexperimental", "-Xfatal-warnings", "-Xfull-lubs", "-Xfuture", "-Xlog-free-terms", "-Xlog-free-types", "-Xlog-implicit-conversions", "-Xlog-implicits", "-Xlog-reflective-calls", "-Xno-forwarders", "-Xno-patmat-analysis", "-Xno-uescape", "-Xnojline", "-Xprint-pos", "-Xprint-types", "-Xprompt", "-Xresident", "-Xshow-phases", "-Xstrict-inference", "-Xverify", "-Y", "-Ybreak-cycles", "-Ydebug", "-Ycompact-trees", "-YdisableFlatCpCaching", "-Ydoc-debug", - "-Yeta-expand-keeps-star", "-Yide-debug", "-Yinfer-argument-types", "-Yinfer-by-name", + "-Yide-debug", "-Yinfer-argument-types", "-Yinfer-by-name", "-Yissue-debug", "-Ylog-classpath", "-Ymacro-debug-lite", "-Ymacro-debug-verbose", "-Ymacro-no-expand", "-Yno-completion", "-Yno-generic-signatures", "-Yno-imports", "-Yno-predef", "-Yoverride-objects", "-Yoverride-vars", "-Ypatmat-debug", "-Yno-adapted-args", "-Ypartial-unification", "-Ypos-debug", "-Ypresentation-debug", diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index 464fa1ad18..873a5947ed 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -341,12 +341,6 @@ class Global(var currentSettings: Settings, var reporter: Reporter) s"[search path for class files: ${classPath.asClassPathString}]" ) - // 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 - def getSourceFile(f: AbstractFile): BatchSourceFile = new BatchSourceFile(f, reader read f) def getSourceFile(name: String): SourceFile = { diff --git a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala index a3b9df1518..4e69c35f96 100644 --- a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala +++ b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala @@ -211,7 +211,6 @@ trait ScalaSettings extends AbsScalaSettings val Yreplclassbased = BooleanSetting ("-Yrepl-class-based", "Use classes to wrap REPL snippets instead of objects") val Yreploutdir = StringSetting ("-Yrepl-outdir", "path", "Write repl-generated classfiles to given output directory (use \"\" to generate a temporary dir)" , "") val YmethodInfer = BooleanSetting ("-Yinfer-argument-types", "Infer types for arguments of overridden 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.").withDeprecationMessage(removalIn212) val inferByName = BooleanSetting ("-Yinfer-by-name", "Allow inference of by-name types. This is a temporary option to ease transition. See SI-7899.").withDeprecationMessage(removalIn212) val YdisableFlatCpCaching = BooleanSetting ("-YdisableFlatCpCaching", "Do not cache flat classpath representation of classpath elements from jars across compiler instances.") val YpartialUnification = BooleanSetting ("-Ypartial-unification", "Enable partial unification in type constructor inference") diff --git a/src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala b/src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala index 97de2b6c85..5f4fa499b6 100644 --- a/src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala +++ b/src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala @@ -105,7 +105,7 @@ trait EtaExpansion { self: Analyzer => val origTpe = sym.tpe val isRepeated = definitions.isRepeatedParamType(origTpe) // SI-4176 Don't leak A* in eta-expanded function types. See t4176b.scala - val droppedStarTpe = if (settings.etaExpandKeepsStar) origTpe else dropIllegalStarTypes(origTpe) + val droppedStarTpe = dropIllegalStarTypes(origTpe) val valDef = ValDef(Modifiers(SYNTHETIC | PARAM), sym.name.toTermName, TypeTree(droppedStarTpe), EmptyTree) (valDef, isRepeated) } diff --git a/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala b/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala index 08219c0634..de065d0b5d 100644 --- a/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala +++ b/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala @@ -53,14 +53,6 @@ private[internal] trait TypeMaps { } } - // Set to true for A* => Seq[A] - // (And it will only rewrite A* in method result types.) - // This is the pre-existing behavior. - // Or false for Seq[A] => Seq[A] - // (It will rewrite A* everywhere but method parameters.) - // This is the specified behavior. - protected def etaExpandKeepsStar = false - /** Turn any T* types into Seq[T] except when * in method parameter position. */ @@ -74,7 +66,7 @@ private[internal] trait TypeMaps { case TypeRef(_, RepeatedParamClass, arg :: Nil) => seqType(arg) case _ => - if (etaExpandKeepsStar) tp else mapOver(tp) + mapOver(tp) } } diff --git a/test/files/neg/eta-expand-star-deprecation.check b/test/files/neg/eta-expand-star-deprecation.check deleted file mode 100644 index a79f0df76c..0000000000 --- a/test/files/neg/eta-expand-star-deprecation.check +++ /dev/null @@ -1,4 +0,0 @@ -warning: -Yeta-expand-keeps-star is deprecated: This flag is scheduled for removal in 2.12. If you have a case where you need this flag then please report a bug. -error: No warnings can be incurred under -Xfatal-warnings. -one warning found -one error found diff --git a/test/files/neg/eta-expand-star-deprecation.flags b/test/files/neg/eta-expand-star-deprecation.flags deleted file mode 100644 index 5ac8b638e4..0000000000 --- a/test/files/neg/eta-expand-star-deprecation.flags +++ /dev/null @@ -1 +0,0 @@ --Yeta-expand-keeps-star -deprecation -Xfatal-warnings diff --git a/test/files/neg/eta-expand-star-deprecation.scala b/test/files/neg/eta-expand-star-deprecation.scala deleted file mode 100644 index 5749692522..0000000000 --- a/test/files/neg/eta-expand-star-deprecation.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Test { - def f[T](xs: T*): Unit = () - def g[T] = f[T] _ - - def main(args: Array[String]): Unit = { - g(1, 2) - } -} diff --git a/test/files/run/eta-expand-star2.check b/test/files/run/eta-expand-star2.check deleted file mode 100644 index d6929e4969..0000000000 --- a/test/files/run/eta-expand-star2.check +++ /dev/null @@ -1,2 +0,0 @@ -warning: there was one deprecation warning; re-run with -deprecation for details -hello diff --git a/test/files/run/eta-expand-star2.flags b/test/files/run/eta-expand-star2.flags deleted file mode 100644 index 0402fe55a4..0000000000 --- a/test/files/run/eta-expand-star2.flags +++ /dev/null @@ -1 +0,0 @@ --Yeta-expand-keeps-star
\ No newline at end of file diff --git a/test/files/run/eta-expand-star2.scala b/test/files/run/eta-expand-star2.scala deleted file mode 100644 index eb650788d0..0000000000 --- a/test/files/run/eta-expand-star2.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Test { - def f[T](xs: T*): T = xs.head - def g[T] = f[T] _ - - def main(args: Array[String]): Unit = { - println(g("hello")) - } -} |