Skip to content

Commit

Permalink
Fully replace -Xfuture by -Xsource
Browse files Browse the repository at this point in the history
Leave the now no-op command line option for now.
  • Loading branch information
adriaanm committed Oct 12, 2018
1 parent f5d4f4b commit 67195a5
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion project/ScalaOptionParser.scala
Expand Up @@ -82,7 +82,7 @@ object ScalaOptionParser {
}

// TODO retrieve this data programmatically, ala https://github.com/scala/scala-tool-support/blob/master/bash-completion/src/main/scala/BashCompletion.scala
private def booleanSettingNames = List("-X", "-Xcheckinit", "-Xdev", "-Xdisable-assertions", "-Xexperimental", "-Xfatal-warnings", "-Xfuture", "-Xlog-free-terms", "-Xlog-free-types", "-Xlog-implicit-conversions", "-Xlog-implicits", "-Xlog-reflective-calls",
private def booleanSettingNames = List("-X", "-Xcheckinit", "-Xdev", "-Xdisable-assertions", "-Xexperimental", "-Xfatal-warnings", "-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", "-Xverify", "-Y",
"-Ybreak-cycles", "-Ydebug", "-Ycompact-trees", "-YdisableFlatCpCaching", "-Ydoc-debug",
"-Yide-debug",
Expand Down
5 changes: 1 addition & 4 deletions src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
Expand Up @@ -39,9 +39,6 @@ trait ScalaSettings extends AbsScalaSettings
*/
protected def defaultClasspath = Option(System.getenv("CLASSPATH")).getOrElse(".")

/** Enabled under -Xfuture. */
protected def futureSettings = List[BooleanSetting]()

/** If any of these settings is enabled, the compiler should print a message and exit. */
def infoSettings = List[Setting](version, help, Xhelp, Yhelp, showPlugins, showPhases, genPhaseGraph, printArgs)

Expand Down Expand Up @@ -461,7 +458,7 @@ trait ScalaSettings extends AbsScalaSettings

/** Groups of Settings.
*/
val future = BooleanSetting("-Xfuture", "Turn on future language features.") enablingIfNotSetByUser futureSettings
val future = BooleanSetting("-Xfuture", "Deprecated. The future is now.").withDeprecationMessage("Use -Xsource instead.")
val optimise = BooleanSetting("-optimise", "Compiler flag for the optimizer in Scala 2.11")
.withAbbreviation("-optimize")
.withDeprecationMessage("In 2.12, -optimise enables -opt:l:inline -opt-inline-from:**. Check -opt:help for using the Scala 2.12 optimizer.")
Expand Down
3 changes: 0 additions & 3 deletions src/manual/scala/man1/scalac.scala
Expand Up @@ -205,9 +205,6 @@ object scalac extends Command {
Definition(
CmdOption("Xfull-lubs"),
"Retain pre 2.10 behavior of less aggressive truncation of least upper bounds."),
Definition(
CmdOption("Xfuture"),
"Turn on future language features."),
Definition(
CmdOption("Xgenerate-phase-graph", Argument("file")),
"Generate the phase graphs (outputs .dot files) to fileX.dot."),
Expand Down
4 changes: 2 additions & 2 deletions test/files/neg/t7294.scala
@@ -1,5 +1,5 @@
object Test {
// Treat TupleN as final under -Xfuture for the for the purposes
// of the "fruitless type test" warning.
// TupleN is final now, so we get a
// "fruitless type test" warning.
(1, 2) match { case Seq() => 0; case _ => 1 }
}
2 changes: 1 addition & 1 deletion test/files/run/t1503.scala
Expand Up @@ -5,7 +5,7 @@ object Whatever {
object Test extends App {
// this should make it abundantly clear Any is the best return type we can guarantee
def matchWhatever(x: Any): Any = x match { case n @ Whatever => n }
// until 2.13, when left to its own devices, and not under -Xfuture, the return type used to be Whatever.type
// until 2.13 the return type used to be Whatever.type
// now it is Any
def matchWhateverCCE(x: Any) = x match { case n @ Whatever => n }

Expand Down
4 changes: 2 additions & 2 deletions test/junit/scala/util/TryTest.scala
Expand Up @@ -5,7 +5,7 @@ import org.junit.runners.JUnit4
import org.junit.Test
import org.junit.Assert._

/* Test Try's withFilter method, which was added along with the -Xfuture fix for scala/bug#6455 */
/* Test Try's withFilter method, which was added along with the fix for scala/bug#6455 */
@RunWith(classOf[JUnit4])
class TryTest {
@Test
Expand All @@ -32,4 +32,4 @@ class TryTest {
for (x <- util.Try(1) if x == 1) ok = x == 1
assert(ok)
}
}
}

0 comments on commit 67195a5

Please sign in to comment.