File tree Expand file tree Collapse file tree 2 files changed +47
-2
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 2 files changed +47
-2
lines changed Original file line number Diff line number Diff line change @@ -698,13 +698,15 @@ object PatternMatcher {
698698 for ((rhs, _) <- seenVars if ! seenAtLabel(plan.label).contains(rhs))
699699 yield (rhs, newVar(rhs.tree, Param ))
700700 }
701- plan.args =
701+ val newArgs =
702702 for {
703703 (rhs, actual) <- seenVars.toList
704704 formal <- paramsOfLabel(plan.label).get(rhs)
705705 }
706706 yield (formal -> actual)
707- plan
707+ if (plan.args.isEmpty) { plan.args = newArgs; plan }
708+ else if (newArgs == plan.args) plan
709+ else CallPlan (plan.label, newArgs)
708710 }
709711 }
710712 (new Merge (Map ()))(plan)
Original file line number Diff line number Diff line change 1+ class TreeAccumulator2 {
2+
3+ def foo (tasty : Tasty2 )(tree : Any ): Unit = {
4+ import tasty ._
5+ tree match {
6+ case A () =>
7+ case B () =>
8+ case C () =>
9+ case D () =>
10+ }
11+ }
12+
13+ }
14+
15+ abstract class Tasty2 {
16+
17+ type X
18+ type Y
19+
20+ implicit def xct : scala.reflect.ClassTag [X ]
21+ implicit def yct : scala.reflect.ClassTag [Y ]
22+
23+ val A : AExtractor
24+ trait AExtractor {
25+ def unapply (x : X ): Boolean
26+ }
27+
28+ val B : BExtractor
29+ trait BExtractor {
30+ def unapply (x : X ): Boolean
31+ }
32+
33+ val C : CExtractor
34+ trait CExtractor {
35+ def unapply (x : Y ): Boolean // Note the type Y
36+ }
37+
38+ val D : DExtractor
39+ trait DExtractor {
40+ def unapply (x : X ): Boolean
41+ }
42+
43+ }
You can’t perform that action at this time.
0 commit comments