This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
In #29589 I wrote local:test in modules-collide-var-001 could raise XPST0017, which is ofc nonsense. It was supposed to read: modules-pub-priv-24 (!) has <a>{local:test()}</a>, but there is no local:test() function. So it could throw XPST0017 instead the expected error
Now I am starting to wonder: When an variable initialization expression has an (static or dynamic) error, but the variable is never used, is it still an error of the entire query? It might get evaluated lazily
(In reply to Benito van der Zander from comment #1) > but the variable is never used, is it still an > error of the entire query? It might get evaluated lazily Section "2.3.4 Errors and Optimization" of XP31 explains this. If the variable is never called, it need not be evaluated. In such cases it is implementation dependent whether the dynamic error is raised (i.e., with eager variable evaluation, the error may always be raised, with lazy evaluation only when actually evaluated).
> It might get evaluated lazily Note that my comment #2 applies to *dynamic errors*, static errors must always be reported.
Decision after WG discussion: (a) there are two static errors in the test, we should eliminate the call on local:test() so there is only one error. (b) it then becomes mandatory to report the error. Static errors must be reported whether or not the code is evaluated.
Closing this bug as the fix has been applied in the test case.