On Friday, 13 February 2015 at 13:25:55 UTC, Steven Schveighoffer wrote:
Yes, the operator precedence (curiously not defined in the spec) is here:

http://wiki.dlang.org/Operator_precedence

Conditional operator is above assignment operators.

It's specified through the grammar [1]:

----
AssignExpression:
    ConditionalExpression
    ConditionalExpression = AssignExpression
    [...]

ConditionalExpression:
    OrOrExpression
    OrOrExpression ? Expression : ConditionalExpression
----

The third operand of ConditionalExpression cannot be an AssignExpression without parentheses.

So `foo ? bar : baz = qux` can only be interpreted as `(foo ? bar : baz) = qux`.

[1] http://dlang.org/expression.html

Reply via email to