https://issues.dlang.org/show_bug.cgi?id=23202

Dennis <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]
           Hardware|x86_64                      |All
            Summary|assigning class.tupleof     |catch null dereferences at
                   |with a string segfaults at  |compille time
                   |runtime, also with @safe    |
                 OS|Linux                       |All
           Severity|normal                      |enhancement

--- Comment #1 from Dennis <[email protected]> ---
S.init is `null`, which you dereference by accessing a member. `@safe` does not
prevent `null` dereferences, since those only abort the program, they don't
corrupt memory. The code is essentially doing this:

```
auto s = (cast(S)null).str;
```

Changing this to an enhancement.

--

Reply via email to