Skip to content

Commit d839e7c

Browse files
committed
Merge branch 'backport/phase-change' into topic/pickle-jar
2 parents 81365dd + d7d8216 commit d839e7c

File tree

9 files changed

+48
-43
lines changed

9 files changed

+48
-43
lines changed

src/compiler/scala/tools/nsc/Global.scala

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -470,19 +470,11 @@ class Global(var currentSettings: Settings, reporter0: Reporter)
470470
val global: Global.this.type = Global.this
471471
} with Analyzer
472472

473-
// phaseName = "patmat"
474-
object patmat extends {
475-
val global: Global.this.type = Global.this
476-
val runsAfter = List("typer")
477-
val runsRightAfter = None
478-
// patmat doesn't need to be right after typer, as long as we run before superaccessors
479-
// (sbt does need to run right after typer, so don't conflict)
480-
} with PatternMatching
481-
482473
// phaseName = "superaccessors"
483474
object superAccessors extends {
484475
val global: Global.this.type = Global.this
485-
val runsAfter = List("patmat")
476+
val runsAfter = List("typer")
477+
// sbt needs to run right after typer, so don't conflict
486478
val runsRightAfter = None
487479
} with SuperAccessors
488480

@@ -507,10 +499,20 @@ class Global(var currentSettings: Settings, reporter0: Reporter)
507499
val runsRightAfter = None
508500
} with RefChecks
509501

502+
// phaseName = "patmat"
503+
object patmat extends {
504+
val global: Global.this.type = Global.this
505+
// patmat does not need to run before the superaccessors phase, because
506+
// patmat never emits `this.x` where `x` is a ParamAccessor.
507+
// (However, patmat does need to run before outer accessors generation).
508+
val runsAfter = List("refchecks")
509+
val runsRightAfter = None
510+
} with PatternMatching
511+
510512
// phaseName = "uncurry"
511513
override object uncurry extends {
512514
val global: Global.this.type = Global.this
513-
val runsAfter = List("refchecks")
515+
val runsAfter = List("patmat")
514516
val runsRightAfter = None
515517
} with UnCurry
516518

@@ -653,8 +655,8 @@ class Global(var currentSettings: Settings, reporter0: Reporter)
653655
analyzer.namerFactory -> "resolve names, attach symbols to named trees",
654656
analyzer.packageObjects -> "load package objects",
655657
analyzer.typerFactory -> "the meat and potatoes: type the trees",
656-
patmat -> "translate match expressions",
657658
superAccessors -> "add super accessors in traits and nested classes",
659+
patmat -> "translate match expressions",
658660
extensionMethods -> "add extension methods for inline classes",
659661
pickler -> "serialize symbol tables",
660662
refChecks -> "reference/override checking, translate nested objects",

src/compiler/scala/tools/nsc/Reporting.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ trait Reporting extends scala.reflect.internal.Reporting { self: ast.Positions w
2626
protected def PerRunReporting = new PerRunReporting
2727
class PerRunReporting extends PerRunReportingBase {
2828
/** Collects for certain classes of warnings during this run. */
29-
private class ConditionalWarning(what: String, doReport: () => Boolean, setting: Settings#Setting) {
29+
private class ConditionalWarning(what: String, doReport: Boolean, setting: Settings#Setting) {
3030
def this(what: String, booleanSetting: Settings#BooleanSetting) {
31-
this(what, () => booleanSetting, booleanSetting)
31+
this(what, booleanSetting.value, booleanSetting)
3232
}
3333
val warnings = mutable.LinkedHashMap[Position, (String, String)]()
3434
def warn(pos: Position, msg: String, since: String = "") =
35-
if (doReport()) reporter.warning(pos, msg)
35+
if (doReport) reporter.warning(pos, msg)
3636
else if (!(warnings contains pos)) warnings += ((pos, (msg, since)))
3737
def summarize() =
38-
if (warnings.nonEmpty && (setting.isDefault || doReport())) {
38+
if (warnings.nonEmpty && (setting.isDefault || doReport)) {
3939
val sinceAndAmount = mutable.TreeMap[String, Int]()
4040
warnings.valuesIterator.foreach { case (_, since) =>
4141
val value = sinceAndAmount.get(since)
@@ -65,7 +65,7 @@ trait Reporting extends scala.reflect.internal.Reporting { self: ast.Positions w
6565
private val _deprecationWarnings = new ConditionalWarning("deprecation", settings.deprecation)
6666
private val _uncheckedWarnings = new ConditionalWarning("unchecked", settings.unchecked)
6767
private val _featureWarnings = new ConditionalWarning("feature", settings.feature)
68-
private val _inlinerWarnings = new ConditionalWarning("inliner", () => !settings.optWarningsSummaryOnly, settings.optWarnings)
68+
private val _inlinerWarnings = new ConditionalWarning("inliner", !settings.optWarningsSummaryOnly, settings.optWarnings)
6969
private val _allConditionalWarnings = List(_deprecationWarnings, _uncheckedWarnings, _featureWarnings, _inlinerWarnings)
7070

7171
// TODO: remove in favor of the overload that takes a Symbol, give that argument a default (NoSymbol)

test/files/neg/t6446-additional.check

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
namer 2 resolve names, attach symbols to named trees
55
packageobjects 3 load package objects
66
typer 4 the meat and potatoes: type the trees
7-
patmat 5 translate match expressions
8-
superaccessors 6 add super accessors in traits and nested classes
9-
extmethods 7 add extension methods for inline classes
10-
pickler 8 serialize symbol tables
11-
refchecks 9 reference/override checking, translate nested objects
7+
superaccessors 5 add super accessors in traits and nested classes
8+
extmethods 6 add extension methods for inline classes
9+
pickler 7 serialize symbol tables
10+
refchecks 8 reference/override checking, translate nested objects
11+
patmat 9 translate match expressions
1212
uncurry 10 uncurry, translate function values to anonymous classes
1313
fields 11 synthesize accessors and fields, add bitmaps for lazy vals
1414
tailcalls 12 replace tail calls by jumps

test/files/neg/t6446-missing.check

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ Error: unable to load class: t6446.Ploogin
55
namer 2 resolve names, attach symbols to named trees
66
packageobjects 3 load package objects
77
typer 4 the meat and potatoes: type the trees
8-
patmat 5 translate match expressions
9-
superaccessors 6 add super accessors in traits and nested classes
10-
extmethods 7 add extension methods for inline classes
11-
pickler 8 serialize symbol tables
12-
refchecks 9 reference/override checking, translate nested objects
8+
superaccessors 5 add super accessors in traits and nested classes
9+
extmethods 6 add extension methods for inline classes
10+
pickler 7 serialize symbol tables
11+
refchecks 8 reference/override checking, translate nested objects
12+
patmat 9 translate match expressions
1313
uncurry 10 uncurry, translate function values to anonymous classes
1414
fields 11 synthesize accessors and fields, add bitmaps for lazy vals
1515
tailcalls 12 replace tail calls by jumps

test/files/neg/t6446-show-phases.check

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
namer 2 resolve names, attach symbols to named trees
55
packageobjects 3 load package objects
66
typer 4 the meat and potatoes: type the trees
7-
patmat 5 translate match expressions
8-
superaccessors 6 add super accessors in traits and nested classes
9-
extmethods 7 add extension methods for inline classes
10-
pickler 8 serialize symbol tables
11-
refchecks 9 reference/override checking, translate nested objects
7+
superaccessors 5 add super accessors in traits and nested classes
8+
extmethods 6 add extension methods for inline classes
9+
pickler 7 serialize symbol tables
10+
refchecks 8 reference/override checking, translate nested objects
11+
patmat 9 translate match expressions
1212
uncurry 10 uncurry, translate function values to anonymous classes
1313
fields 11 synthesize accessors and fields, add bitmaps for lazy vals
1414
tailcalls 12 replace tail calls by jumps

test/files/neg/t7494-no-options.check

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ error: Error: ploogin takes no options
55
namer 2 resolve names, attach symbols to named trees
66
packageobjects 3 load package objects
77
typer 4 the meat and potatoes: type the trees
8-
patmat 5 translate match expressions
9-
superaccessors 6 add super accessors in traits and nested classes
10-
extmethods 7 add extension methods for inline classes
11-
pickler 8 serialize symbol tables
12-
refchecks 9 reference/override checking, translate nested objects
8+
superaccessors 5 add super accessors in traits and nested classes
9+
extmethods 6 add extension methods for inline classes
10+
pickler 7 serialize symbol tables
11+
refchecks 8 reference/override checking, translate nested objects
12+
patmat 9 translate match expressions
1313
uncurry 10 uncurry, translate function values to anonymous classes
1414
fields 11 synthesize accessors and fields, add bitmaps for lazy vals
1515
tailcalls 12 replace tail calls by jumps

test/files/run/programmatic-main.check

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
namer 2 resolve names, attach symbols to named trees
55
packageobjects 3 load package objects
66
typer 4 the meat and potatoes: type the trees
7-
patmat 5 translate match expressions
8-
superaccessors 6 add super accessors in traits and nested classes
9-
extmethods 7 add extension methods for inline classes
10-
pickler 8 serialize symbol tables
11-
refchecks 9 reference/override checking, translate nested objects
7+
superaccessors 5 add super accessors in traits and nested classes
8+
extmethods 6 add extension methods for inline classes
9+
pickler 7 serialize symbol tables
10+
refchecks 8 reference/override checking, translate nested objects
11+
patmat 9 translate match expressions
1212
uncurry 10 uncurry, translate function values to anonymous classes
1313
fields 11 synthesize accessors and fields, add bitmaps for lazy vals
1414
tailcalls 12 replace tail calls by jumps

test/files/run/t1434.check

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
t1434.scala:7: warning: comparing values of types Null and Null using `!=' will always yield false
2+
case a: A[_] if(a.op != null) => "with op"
3+
^

test/files/run/t6288.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[106][106][106]Case3.super.<init>();
66
[13]()
77
};
8-
[21]def unapply([29]z: [32]<type: [32]scala.Any>): [21]Option[Int] = [56][52][52]scala.Some.apply[[52]Int]([57]-1);
8+
[21]def unapply([29]z: [32]<type: [32]scala.Any>): [21]Option[Int] = [56][52][52]new [52]Some[Int]([57]-1);
99
[64]{
1010
[64]case <synthetic> val x1: [64]String = [64]"";
1111
[64]case5()[84]{

0 commit comments

Comments
 (0)