Non-techincal brain, is @safe by default good or not?
Timon Gehr
timon.gehr at gmx.ch
Thu May 28 10:43:14 UTC 2020
On 28.05.20 12:28, Mathias LANG wrote:
>
> Results in:
> ```
> /usr/local/opt/dmd/include/dlang/dmd/std/json.d(459): Error: @safe
> function std.json.JSONValue.assign!(MyCustomType).assign cannot call
> @system function foo.MyCustomType.toString
> foo.d(5): foo.MyCustomType.toString is declared here
> /usr/local/opt/dmd/include/dlang/dmd/std/json.d(593): Error: template
> instance std.json.JSONValue.assign!(MyCustomType) error instantiating
> foo.d(13): instantiated from here: opAssign!(MyCustomType)
> ```
>
> But... WHY ?
Indeed. Why is it even annotated? It would be inferred anyway...
More information about the Digitalmars-d
mailing list