Re: unexpected noreturn behavior

2022-04-21 Thread Paul Backus via Digitalmars-d-learn
On Thursday, 21 April 2022 at 12:54:12 UTC, Dennis wrote: On Thursday, 21 April 2022 at 12:41:08 UTC, WebFreak001 wrote: which I think is a little bug-prone, but at least that would solve my issues. What issue do you have with it returning `true`? Presumably the problem is that if you write

Re: unexpected noreturn behavior

2022-04-21 Thread Dennis via Digitalmars-d-learn
On Thursday, 21 April 2022 at 12:41:08 UTC, WebFreak001 wrote: which I think is a little bug-prone, but at least that would solve my issues. What issue do you have with it returning `true`? Note that this compiles: ```D @safe: import std.sumtype; void main() { SumType!(int, string) s =

Re: unexpected noreturn behavior

2022-04-21 Thread rikki cattermole via Digitalmars-d-learn
Could we add a check for this in DScanner? Otherwise I'm not sure how else we are going to find all of these instances and fix them.

Re: unexpected noreturn behavior

2022-04-21 Thread WebFreak001 via Digitalmars-d-learn
On Thursday, 21 April 2022 at 12:28:37 UTC, rikki cattermole wrote: noreturn is the bottom type which can implicitly convert to any type, including void. A value of type noreturn will never be produced and the compiler can optimize such code accordingly.

Re: unexpected noreturn behavior

2022-04-21 Thread rikki cattermole via Digitalmars-d-learn
noreturn is the bottom type which can implicitly convert to any type, including void. A value of type noreturn will never be produced and the compiler can optimize such code accordingly. https://dlang.org/spec/type.html#noreturn