Skip to content

Commit

Permalink
assert(0, msg) ignores the msg expression
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Jul 23, 2015
1 parent 2759d7b commit 4f5da79
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions expression.dd
Expand Up @@ -1664,16 +1664,6 @@ $(GNAME AssertExpression):
Contract Programming) support in D.
)

$(P The expression $(D assert(0)) is a special case; it
signifies that it is unreachable code.
Either $(D AssertError) is thrown at runtime if it is reachable,
or the execution is halted
(on the x86 processor, a $(D HLT) instruction can be used to halt
execution).
The optimization and code generation phases of compilation may
assume that it is unreachable code.
)

$(P The second $(I AssignExpression), if present, must be implicitly
convertible to type $(D const(char)[]).
It is evaluated if the
Expand All @@ -1695,6 +1685,16 @@ Error: AssertError Failure test.d(3) an error message
)
)

$(P The expression $(D assert(0)) is a special case; it
signifies that it is unreachable code.
Either $(D AssertError) is thrown at runtime if it is reachable,
or the execution is halted
(on the x86 processor, a $(D HLT) instruction can be used to halt
execution) and the second $(I AssignExpression) is ignored.
The optimization and code generation phases of compilation may
assume that it is unreachable code.
)

$(H4 Mixin Expressions)

$(GRAMMAR
Expand Down

0 comments on commit 4f5da79

Please sign in to comment.