Can anyone explain this?

Andrea Fontana nospam at example.com
Tue Jun 5 08:31:53 UTC 2018


On Tuesday, 5 June 2018 at 08:12:54 UTC, Shachar Shemesh wrote:
> I set up to find out what happens if the assert string throws.

 From here: 
https://dlang.org/spec/expression.html#assert_expressions

[...]
8. Undefined Behavior: Once in an Invalid State the behavior of 
the continuing execution of the program is undefined.
[...]

[...]
Best Practices:
- Do not have side effects in either AssignExpression that 
subsequent code depends on.
- AssertExpressions are intended to detect bugs in the program, 
do not use for detecting input or environmental errors.
- Do not attempt to resume normal execution after an Assert 
Failure.
[...]

Anyway you can try to catch "Throwable" to understand what is 
going to happen (but it's not a good idea at all to keep it in a 
program)

Andrea


More information about the Digitalmars-d mailing list