Skip to content

Commit c07442d

Browse files
committed
Set -Xsource to 2.12 by default
1 parent a179845 commit c07442d

File tree

5 files changed

+18
-13
lines changed

5 files changed

+18
-13
lines changed

src/compiler/scala/tools/nsc/settings/ScalaSettings.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ trait ScalaSettings extends AbsScalaSettings
136136
val sourceReader = StringSetting ("-Xsource-reader", "classname", "Specify a custom method for reading source files.", "")
137137
val reporter = StringSetting ("-Xreporter", "classname", "Specify a custom reporter for compiler messages.", "scala.tools.nsc.reporters.ConsoleReporter")
138138
val strictInference = BooleanSetting ("-Xstrict-inference", "Don't infer known-unsound types")
139-
val source = ScalaVersionSetting ("-Xsource", "version", "Treat compiler input as Scala source for the specified version, see SI-8126.", initial = ScalaVersion("2.11"))
139+
val source = ScalaVersionSetting ("-Xsource", "version", "Treat compiler input as Scala source for the specified version, see SI-8126.", initial = ScalaVersion("2.12"))
140140

141141
val XnoPatmatAnalysis = BooleanSetting ("-Xno-patmat-analysis", "Don't perform exhaustivity/unreachability analysis. Also, ignore @switch annotation.")
142142
val XfullLubs = BooleanSetting ("-Xfull-lubs", "Retains pre 2.10 behavior of less aggressive truncation of least upper bounds.")

test/files/neg/t5639b.flags

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-Xsource:2.11

test/files/run/macroPlugins-namerHooks.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ enterStat(<synthetic> val C$1: C = x$1.asInstanceOf[C])
2828
enterSym(def <init>() = { super.<init>(); () })
2929
enterSym(final override <synthetic> def toString() = "C")
3030
enterSym(case <synthetic> def apply(x: Int, y: Int): C = new C(x, y))
31-
enterSym(case <synthetic> def unapply(x$0: C) = if (x$0.==(null)) scala.this.None else Some(scala.Tuple2(x$0.x, x$0.y)))
31+
enterSym(case <synthetic> def unapply(x$0: C): _root_.scala.Option[scala.Tuple2[Int, Int]] = if (x$0.==(null)) scala.this.None else Some(scala.Tuple2(x$0.x, x$0.y)))
3232
enterStat(def <init>() = { super.<init>(); () })
3333
enterStat(final override <synthetic> def toString() = "C")
3434
enterSym(def <init>() = { super.<init>(); () })

test/files/run/t3368-c.check

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ package <empty> {
66
};
77
def x = {
88
val $buf = new _root_.scala.xml.NodeBuffer();
9-
$buf.$amp$plus(new _root_.scala.xml.Text("hi & bye"));
10-
$buf.$amp$plus(new _root_.scala.xml.Text("red & black"));
9+
$buf.$amp$plus(new _root_.scala.xml.PCData("hi & bye"));
10+
$buf.$amp$plus(new _root_.scala.xml.PCData("red & black"));
1111
$buf
1212
}
1313
};
@@ -24,7 +24,8 @@ package <empty> {
2424
new _root_.scala.xml.Elem(null, "b", _root_.scala.xml.Null, $scope, true)
2525
}
2626
});
27-
$buf.$amp$plus(new _root_.scala.xml.Text("starthi & bye"));
27+
$buf.$amp$plus(new _root_.scala.xml.Text("start"));
28+
$buf.$amp$plus(new _root_.scala.xml.PCData("hi & bye"));
2829
$buf.$amp$plus({
2930
{
3031
new _root_.scala.xml.Elem(null, "c", _root_.scala.xml.Null, $scope, true)
@@ -36,7 +37,8 @@ package <empty> {
3637
new _root_.scala.xml.Elem(null, "d", _root_.scala.xml.Null, $scope, true)
3738
}
3839
});
39-
$buf.$amp$plus(new _root_.scala.xml.Text("stuffred & black"));
40+
$buf.$amp$plus(new _root_.scala.xml.Text("stuff"));
41+
$buf.$amp$plus(new _root_.scala.xml.PCData("red & black"));
4042
$buf
4143
}: _*))
4244
}
@@ -46,18 +48,19 @@ package <empty> {
4648
def $init$() = {
4749
()
4850
};
49-
def d = new _root_.scala.xml.Text("hello, world");
51+
def d = new _root_.scala.xml.PCData("hello, world");
5052
def e = {
5153
val $buf = new _root_.scala.xml.NodeBuffer();
52-
$buf.$amp$plus(new _root_.scala.xml.Text("hello, world"));
53-
$buf.$amp$plus(new _root_.scala.xml.Text("hello, world"));
54+
$buf.$amp$plus(new _root_.scala.xml.PCData("hello, world"));
55+
$buf.$amp$plus(new _root_.scala.xml.PCData("hello, world"));
5456
$buf
5557
};
5658
def f = {
5759
{
5860
new _root_.scala.xml.Elem(null, "foo", _root_.scala.xml.Null, $scope, false, ({
5961
val $buf = new _root_.scala.xml.NodeBuffer();
60-
$buf.$amp$plus(new _root_.scala.xml.Text("xhello, world"));
62+
$buf.$amp$plus(new _root_.scala.xml.Text("x"));
63+
$buf.$amp$plus(new _root_.scala.xml.PCData("hello, world"));
6164
$buf
6265
}: _*))
6366
}
@@ -66,7 +69,7 @@ package <empty> {
6669
{
6770
new _root_.scala.xml.Elem(null, "foo", _root_.scala.xml.Null, $scope, false, ({
6871
val $buf = new _root_.scala.xml.NodeBuffer();
69-
$buf.$amp$plus(new _root_.scala.xml.Text("hello, world"));
72+
$buf.$amp$plus(new _root_.scala.xml.PCData("hello, world"));
7073
$buf
7174
}: _*))
7275
}
@@ -75,7 +78,8 @@ package <empty> {
7578
{
7679
new _root_.scala.xml.Elem(null, "foo", _root_.scala.xml.Null, $scope, false, ({
7780
val $buf = new _root_.scala.xml.NodeBuffer();
78-
$buf.$amp$plus(new _root_.scala.xml.Text("hello, worldhello, world"));
81+
$buf.$amp$plus(new _root_.scala.xml.PCData("hello, world"));
82+
$buf.$amp$plus(new _root_.scala.xml.PCData("hello, world"));
7983
$buf
8084
}: _*))
8185
}

test/junit/scala/tools/nsc/settings/SettingsTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class SettingsTest {
172172
assert(residual.isEmpty)
173173
assertTrue(s.source.value == ScalaVersion(expected))
174174
}
175-
check(expected = "2.11.0") // default
175+
check(expected = "2.12.0") // default
176176
check(expected = "2.11.0", "-Xsource:2.11")
177177
check(expected = "2.10", "-Xsource:2.10.0")
178178
check(expected = "2.12", "-Xsource:2.12")

0 commit comments

Comments
 (0)