Skip to content

Commit 65ca50e

Browse files
authored
Mention -checkaction=context for AssertError (#3627)
1 parent df8a274 commit 65ca50e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

spec/expression.dd

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2427,6 +2427,17 @@ $(GNAME AssertArguments):
24272427
)
24282428
)
24292429

2430+
$(NOTE $(D AssertError) is the default for $(B dmd), with an optional
2431+
$(DDSUBLINK dmd, switch-checkaction, $(B -checkaction=context))
2432+
switch to show certain sub-expressions used in the first *AssertExpression*
2433+
in the error message:)
2434+
2435+
---
2436+
auto x = 4;
2437+
assert(x < 3);
2438+
---
2439+
$(P When in use, the above will throw an `AssertError` with a message `4 >= 3`.)
2440+
24302441
$(BEST_PRACTICE
24312442
$(OL
24322443
$(LI Do not have side effects in either $(I AssignExpression) that subsequent code

0 commit comments

Comments
 (0)