File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 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 {
2323 recur(tree.fun)
2424 }
2525
26+ private def needsDistribution (fun : Tree ) = fun match {
27+ case _ : Block | _ : If => true
28+ case _ => false
29+ }
30+
2631 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
2836
2937 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
3142
3243 private val typeApply = (fn : Tree , args : List [Tree ]) => (ctx : Context ) => TypeApply (fn, args)(ctx)
3344 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