[Issue 14125] @trusted nested helper functions in std.file
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Feb 4 19:58:13 PST 2015
https://issues.dlang.org/show_bug.cgi?id=14125
Zach the Mystic <reachzach at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |reachzach at gmail.com
--- Comment #48 from Zach the Mystic <reachzach at gmail.com> ---
(In reply to Walter Bright from comment #47)
> (In reply to Andrei Alexandrescu from comment #45)
> > That's beautiful. Too bad it doesn't work :o).
>
> I did say I paraphrased it. I've come out against supporting
>
> @trusted { ... code ... }
>
> because it made it too easy to do bad things with it. But I did use it to
> make for a simpler example :-)
I think it would be funny if a @trusted function with fewer than two statements
was automatically rejected by the compiler. Since an unverifiable, but @safe
operation requires two actions, one to dive into unsafe territory, and a second
one to dive back out, any sound use of @trusted *must* have two or more
statements. Destroy! :-)
--
More information about the Digitalmars-d-bugs
mailing list