File tree 2 files changed +30
-0
lines changed
compiler/src/dotty/tools/dotc/transform/patmat 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -354,6 +354,7 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
354
354
case Bind (_, pat) => project(pat)
355
355
case UnApply (_, _, pats) =>
356
356
if (pat.tpe.classSymbol.is(CaseClass ))
357
+ // FIXME: why dealias is needed here?
357
358
Kon (pat.tpe.stripAnnots.dealias, pats.map(pat => project(pat, roundUp)))
358
359
else if (roundUp) Typ (pat.tpe.stripAnnots, false )
359
360
else Empty
Original file line number Diff line number Diff line change
1
+ trait Cap
2
+
3
+ trait Toolbox {
4
+ type Tree
5
+
6
+ val tpd : TypedTrees
7
+ trait TypedTrees {
8
+ type Tree
9
+ }
10
+
11
+ val Apply : ApplyImpl
12
+ trait ApplyImpl {
13
+ def unapply (tree : Tree ): Option [(Tree , Seq [Tree ])]
14
+ def unapply (tree : tpd.Tree )(implicit c : Cap ): Option [(tpd.Tree , Seq [tpd.Tree ])]
15
+ }
16
+ }
17
+
18
+ class Test (val tb : Toolbox ) {
19
+ import tb ._
20
+ implicit val cap : Cap = null
21
+
22
+ def foo (tree : Tree ): Int = tree match {
23
+ case Apply (fun, args) => 3
24
+ }
25
+
26
+ def bar (tree : tpd.Tree ): Int = tree match {
27
+ case Apply (fun, args) => 3
28
+ }
29
+ }
You can’t perform that action at this time.
0 commit comments