When the current() function is used in an XPath expression within a stylesheet, Saxon rewrites the expression to use a local variable. This rewrite is not happening correctly when the call to current() appears on the rhs of a "/" operator in which the inferred type of the rhs operand is a sequence of atomic values. The consequence is that at execution time, a fatal error occurs saying that calls to current() should have been resolved at compile time.
Affects the 9.3 branch only; a patch is being committed. (This affects module ForEach, because the same code is used for xsl:for-each and for a "/" operator whose rhs selects atomic values.)