File tree 1 file changed +13
-2
lines changed
compiler/src/dotty/tools/dotc/transform 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -23,11 +23,22 @@ class Splitter extends MiniPhase {
23
23
recur(tree.fun)
24
24
}
25
25
26
+ private def needsDistribution (fun : Tree ) = fun match {
27
+ case _ : Block | _ : If => true
28
+ case _ => false
29
+ }
30
+
26
31
override def transformTypeApply (tree : TypeApply )(implicit ctx : Context ) =
27
- distribute(tree, typeApply)
32
+ if (needsDistribution(tree.fun))
33
+ distribute(tree, typeApply)
34
+ else
35
+ tree
28
36
29
37
override def transformApply (tree : Apply )(implicit ctx : Context ) =
30
- distribute(tree, apply)
38
+ if (needsDistribution(tree.fun))
39
+ distribute(tree, apply)
40
+ else
41
+ tree
31
42
32
43
private val typeApply = (fn : Tree , args : List [Tree ]) => (ctx : Context ) => TypeApply (fn, args)(ctx)
33
44
private val apply = (fn : Tree , args : List [Tree ]) => (ctx : Context ) => Apply (fn, args)(ctx)
You can’t perform that action at this time.
0 commit comments