Skip to content

Commit b19ab85

Browse files
committed
Fix #2024: TypeApply can be a final apply of a recursive method.
nullary methods with type parameters were handled wrongly, which led to absence of type application and a cryptic error message.
1 parent 144c309 commit b19ab85

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/src/dotty/tools/dotc/transform/TailRec.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,10 @@ class TailRec extends MiniPhaseTransform with DenotTransformer with FullParamete
325325
else
326326
rewriteApply(tree, meth)
327327

328+
case TypeApply(fun, targs) =>
329+
val meth = fun.symbol
330+
rewriteApply(tree, meth)
331+
328332
case tree@Block(stats, expr) =>
329333
tpd.cpy.Block(tree)(
330334
noTailTransforms(stats),

0 commit comments

Comments
 (0)