Skip to content

Commit 53252c8

Browse files
authored
Merge pull request #13124 from SethTisue/issue-13096
Run PatternMatcher earlier, in the group before ExplicitOuter
2 parents d7d70c0 + 3b2e762 commit 53252c8

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

compiler/src/dotty/tools/dotc/Compiler.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ class Compiler {
7373
new ByNameClosures, // Expand arguments to by-name parameters to closures
7474
new HoistSuperArgs, // Hoist complex arguments of supercalls to enclosing scope
7575
new SpecializeApplyMethods, // Adds specialized methods to FunctionN
76-
new RefChecks) :: // Various checks mostly related to abstract members and overriding
77-
List(new ElimOpaque, // Turn opaque into normal aliases
76+
new RefChecks, // Various checks mostly related to abstract members and overriding
7877
new TryCatchPatterns, // Compile cases in try/catch
79-
new PatternMatcher, // Compile pattern matches
78+
new PatternMatcher) :: // Compile pattern matches
79+
List(new ElimOpaque, // Turn opaque into normal aliases
8080
new sjs.ExplicitJSClasses, // Make all JS classes explicit (Scala.js only)
8181
new ExplicitOuter, // Add accessors to outer classes from nested ones.
8282
new ExplicitSelf, // Make references to non-trivial self types explicit as casts

compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,8 @@ class ExplicitOuter extends MiniPhase with InfoTransformer { thisPhase =>
4040

4141
override def phaseName: String = ExplicitOuter.name
4242

43-
/** List of names of phases that should have finished their processing of all compilation units
44-
* before this phase starts
45-
*/
46-
override def runsAfter: Set[String] = Set(PatternMatcher.name, HoistSuperArgs.name)
43+
override def runsAfter: Set[String] = Set(HoistSuperArgs.name)
44+
override def runsAfterGroupsOf: Set[String] = Set(PatternMatcher.name)
4745

4846
override def changesMembers: Boolean = true // the phase adds outer accessors
4947

tests/run/i13096.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class C1 {
2+
private class C2
3+
new C2 match {
4+
case c: C2 =>
5+
}
6+
}
7+
8+
object Test extends App {
9+
new C1
10+
}

0 commit comments

Comments
 (0)