You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to this grammar, the final operand of a BlockExpression (if present) can only be an ExpressionWithoutBlock. But surely this is not correct: it can be any Expression—i.e. including an ExpressionWithBlock.
For example, using the documented grammar to parse {{ 0 }} as a BlockExpression would result in the inner { 0 } block being a Statement within the outer block rather than its final operand; a consequence of this would be that such a statement must have unit type per the documentation of Expression statements; and even if a different type was permitted, its value would not be that of the outer block per the documentation of BlockExpression.
The text was updated successfully, but these errors were encountered:
Thanks for the report! Yea, the grammar isn't quite capturing what the "final operand" is, as answering that is a little complicated. I believe this is a duplicate of #762, so closing in favor of that.
The grammar for
BlockExpression
is currently given as:According to this grammar, the final operand of a
BlockExpression
(if present) can only be anExpressionWithoutBlock
. But surely this is not correct: it can be anyExpression
—i.e. including anExpressionWithBlock
.For example, using the documented grammar to parse
{{ 0 }}
as aBlockExpression
would result in the inner{ 0 }
block being aStatement
within the outer block rather than its final operand; a consequence of this would be that such a statement must have unit type per the documentation of Expression statements; and even if a different type was permitted, its value would not be that of the outer block per the documentation ofBlockExpression
.The text was updated successfully, but these errors were encountered: