We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cdb83f9 commit bcb652bCopy full SHA for bcb652b
src/dotty/tools/dotc/transform/TailRec.scala
@@ -143,7 +143,11 @@ class TailRec extends MiniPhaseTransform with DenotTransformer with FullParamete
143
newOwners = label :: Nil
144
).transform(rhsSemiTransformed)
145
})
146
- Block(List(labelDef), ref(label).appliedToArgss(vparamss0.map(_.map(x=> ref(x.symbol)))))
+ val callIntoLabel = (
147
+ if (dd.tparams.isEmpty) ref(label)
148
+ else ref(label).appliedToTypes(dd.tparams.map(_.tpe))
149
+ ).appliedToArgss(vparamss0.map(_.map(x=> ref(x.symbol))))
150
+ Block(List(labelDef), callIntoLabel)
151
}} else {
152
if (mandatory) ctx.error(
153
"TailRec optimisation not applicable, method not tail recursive",
0 commit comments