[Issue 11304] In case of different @safe/@trusted/@system attributes the weaker is selected

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Jul 16 03:25:07 PDT 2015


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

Kenji Hara <k.hara.pg at gmail.com> changed:

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

--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> ---
(In reply to Denis Shelomovskij from comment #0)
> void f() @system {}
> 
> @trusted {
>     void f1() @safe
>     { static assert(!__traits(compiles, f())); } // assert fails
> }

>From 2.066, f1 is marked as @safe, then the assert failure is fixed.

> // It would be also good to reject g1/g2:
> @safe void g1() @trusted { f(); } // compiled as @trusted
> @trusted void g2() @safe { f(); } // compiled as @trusted

>From 2.066, those fails to compile with "conflicting storage class" error.

--


More information about the Digitalmars-d-bugs mailing list