Skip to content

Run PatternMatcher earlier, in the group before ExplicitOuter #13124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions compiler/src/dotty/tools/dotc/Compiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ class Compiler {
new ByNameClosures, // Expand arguments to by-name parameters to closures
new HoistSuperArgs, // Hoist complex arguments of supercalls to enclosing scope
new SpecializeApplyMethods, // Adds specialized methods to FunctionN
new RefChecks) :: // Various checks mostly related to abstract members and overriding
List(new ElimOpaque, // Turn opaque into normal aliases
new RefChecks, // Various checks mostly related to abstract members and overriding
new TryCatchPatterns, // Compile cases in try/catch
new PatternMatcher, // Compile pattern matches
new PatternMatcher) :: // Compile pattern matches
List(new ElimOpaque, // Turn opaque into normal aliases
new sjs.ExplicitJSClasses, // Make all JS classes explicit (Scala.js only)
new ExplicitOuter, // Add accessors to outer classes from nested ones.
new ExplicitSelf, // Make references to non-trivial self types explicit as casts
Expand Down
6 changes: 2 additions & 4 deletions compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ class ExplicitOuter extends MiniPhase with InfoTransformer { thisPhase =>

override def phaseName: String = ExplicitOuter.name

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

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

Expand Down
10 changes: 10 additions & 0 deletions tests/run/i13096.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class C1 {
private class C2
new C2 match {
case c: C2 =>
}
}

object Test extends App {
new C1
}