[Issue 8464] debug too strict from function attributes
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sat Jul 19 22:46:00 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=8464
bearophile_hugs at eml.cc changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bearophile_hugs at eml.cc
--- Comment #4 from bearophile_hugs at eml.cc ---
(In reply to Era Scarecrow from comment #0)
> If a function is @safe then the debug {} calls all remain required to also
> follow that requirement as well.
>
> void pureSafe() @safe pure {
> debug {
> writeln("Debugging info!");
> }
> }
> Error: safe function 'pureSafe' cannot call system function 'writeln'
>
> Marking the function as @trusted (although works) when the non-debug code
> is provably @safe seems like a bad approach just for debugging. Debug scope
> should break constraints and limitations for debugging purposes.
What other unsafe functions do you want to call (beside writeln) in a debug{}?
--
More information about the Digitalmars-d-bugs
mailing list