[Issue 14878] destructor of lambda parameter not included in speculative @safe check

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Aug 6 15:59:48 PDT 2015


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

Martin Nowak <code at dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Martin Nowak <code at dawg.eu> ---
(In reply to Kenji Hara from comment #1)
> Following static asserts work as you expects.
> 
> static assert(!__traits(compiles, (T b) @safe {}));
> static assert(!is(typeof((T b) @safe {})));

I'm sure I tried that, but apparently not on both at the same time ;).
It didn't occur to me though that `(T) @safe {}` was parsed as polymorphic
lambda with `T` being the parameter's name.

--


More information about the Digitalmars-d-bugs mailing list