This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Is it an omission that in XPath 3.0 [1], '"as" SequenceType' appears in production [64] whereas 'TypeDeclaration' appears in production [3], where 'TypeDeclaration' is defined as '"as" SequenceType' in production [66]? [64] InlineFunctionExpr ::= "function" "(" ParamList? ")" ("as" SequenceType)? FunctionBody [2] ParamList ::= Param ("," Param)* [3] Param ::= "$" EQName TypeDeclaration? [66] TypeDeclaration ::= "as" SequenceType XQuery 3.0 [2] similarly uses '"as" SequenceType' in its production [165] while making rather more uses of 'TypeDeclaration' in other productions. [1] http://www.w3.org/TR/xpath-30/ [2] http://www.w3.org/TR/xquery-30/#id-inline-func [3] http://www.w3.org/TR/xpath-30/#prod-xpath30-Param [64] http://www.w3.org/TR/xpath-30/#prod-xpath30-InlineFunctionExpr [66] http://www.w3.org/TR/xpath-30/#prod-xpath30-TypeDeclaration [165] http://www.w3.org/TR/xquery-30/#prod-xquery30-InlineFunctionExpr
This is editorial. While I agree that it would be nice to make the two specs editorially consistent in the names of productions, the grammars are equivalent, and I would rather not change the grammar in a PR. I propose to fix this in 3.1.
(Jonathan perhaps failed to make it clear that his response is given after WG discussion and decision. The machinery for generating the grammars used in our specs is quite complex and refactoring can have unexpected consequences, so we felt that this change was too high risk to make at this stage of the game).
It looks like we use 'TypeDeclaration' when specifying the type of a variable or parameter, and 'as SequenceType' when specifying the return type of a function or function-type. I think it would look somewhat odd (possibly confusing) to replace 'as SequenceType' with 'TypeDeclaration' in the latter productions. So, to answer the initial question, I suspect it's not an omission (or oversight) that 'TypeDeclaration' isn't used everywhere it could be. And I'm inclined to think it doesn't need "fixing" in 3.1.