W3C home > Mailing lists > Public > public-qt-comments@w3.org > December 2015

[Bug 29320] [XQ31] Switch expressions should have same error semantics as typeswitch

From: <bugzilla@jessica.w3.org>
Date: Tue, 08 Dec 2015 17:16:00 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-29320-523-SuNMBJVkiG@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=29320

--- Comment #4 from Jonathan Robie <jonathan.robie@gmail.com> ---
The solution seems to be to add "switch expressions" to 2.3.4 Errors and
Optimization where it currently says "conditional or typeswitch expressions".

Typeswitch adds this:

A special rule applies to propagation of dynamic errors by typeswitch
expressions. A typeswitch expression ignores (does not raise) any dynamic
errors encountered in case clauses other than the effective case. Dynamic
errors encountered in the default clause are raised only if there is no
effective case. An implementation is permitted to raise dynamic errors in the
operand expressions of case clauses that occur before the effective case, but
not required to do so.

Switch adds this:

Switch expressions have rules regarding the propagation of dynamic errors that
take precedence over the general rules given in 2.3.4 Errors and Optimization.
The return clauses of a switch expression must not raise any dynamic errors
except in the effective case. Dynamic errors raised in the operand expressions
of the switch or the case clauses are propagated; however, an implementation
must not raise dynamic errors in the operand expressions of case clauses that
occur after the effective case. An implementation is permitted to raise dynamic
errors in the operand expressions of case clauses that occur before the
effective case, but not required to do so.

Conditional expressions add this:

Conditional expressions have a special rule for propagating dynamic errors. If
the effective value of the test expression is true, the conditional expression
ignores (does not raise) any dynamic errors encountered in the else-expression.
In this case, since the else-expression can have no observable effect, it need
not be evaluated. Similarly, if the effective value of the test expression is
false, the conditional expression ignores any dynamic errors encountered in the
then-expression, and the then-expression need not be evaluated.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Tuesday, 8 December 2015 17:16:04 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 8 December 2015 17:16:04 UTC