In a stylesheet function that (a) has a tail call to
another function (or to itself), and (b) declares a
return type that requires dynamic checking (because the
compiler can't establish at compile time that the type
is OK), the tail call optimization doesn't handle the
type check correctly, leading to a spurious run-time
This probably applies to XQuery as well as XSLT.
Present in 7.8 and probably in the last two or three
Reproduced and diagnosed but not yet fixed.