#1179 Tail calls and FLWOR expressions

Michael Kay

A recursive function call appearing in the return clause of a FLWOR expression is not recognized as a tail call in 9.4.

This is because the special oode in LetExpression to handle static type checking is not activated, because during the type-checking phase the expression on the tree is in the form of a FLWORExpression. In consequence, typc-checking code is not projected down to the branches of a conditional so the tail call is not recognized as such because the result of the function call needs to be checked against the required type.

A patch to class FLWORExpression is being placed in Subversion.


  • Michael Kay

    Michael Kay - 2012-01-23

    Please raise Saxon bug reports via the list saxon-

    The bug register is not intended for users to raise suspected
    problems, but for acknowledged known errors.

    Mike Kay

  • Michael Kay

    Michael Kay - 2012-01-23

    Fixed in


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks