-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Run PatternMatcher earlier, in the group before ExplicitOuter #13124
Conversation
I was prompted to even try this fix by this comment in
I don't know how miniphases work exactly, but in the
which doesn't seem like "after", or does it? does the order of mini phases within a mega phase matter? |
note that override def runsAfter: Set[String] = Set(PatternMatcher.name, HoistSuperArgs.name) apparently this isn't having the effect the author (Dmitry in d68c106) intended? |
I don't see anything wrong here, the order of mini-phases in a group does matter so it makes sense to talk about a miniphase running after another (meaning: in a |
the CI run shows only a single regression,
|
The problem is that the change is across siblings: class C1() extends Object() {
private[this] class C2() extends Object() {}
new C1.this.C2() match { case c @ _:C1.this.C2 => () }
} to class C1() extends Object() {
private[this] class C2() extends Object() {
private[this] val $outer: C1
final def C1$C2$$$outer: C1 = C2.this.$outer
}
matchResult1[Unit]: {
case val x1: C1.this.C2 = new C1.this.C2()
if x1.$isInstanceOf[C1.this.C2].&&(x1.1_<outer>.eq(this)) then {
case val c: C1.this.C2 = x1.$asInstanceOf[C1.this.C2]
return[matchResult1] { () }
} else ()
throw new MatchError(x1)
}
} Pattern matcher changes C1's constructor, which requires a change in the C2 class definition, and those two are siblings. |
given the sibling thing, it sounds like miniphase paper:
|
ready for review! (tests were passing before I squashed) |
lol that worked |
TryCatchPatterns is similar in spirit, so keep it with its buddy. Fixes scala#13096 Co-authored-by: Dale Wijnand <[email protected]>
This is ready for final review and merge afaict |
fixes #13096, which @dwijnand and I are looking at together
marked as draft for now since this is a naive fix. let's see if anything else regresses, and also consider if the fix can be refined