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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Oct 20 01:40:56 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=11304

           Summary: In case of different @safe/@trusted/@system attributes
                    the weaker is selected
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: verylonglogin.reg at gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg at gmail.com> 2013-10-20 12:40:53 MSD ---
In case of different attributes the weaker is selected i.e. `f1` is expected to
be @safe:
---
void f() @system {}

@trusted {
    void f1() @safe
    { static assert(!__traits(compiles, f())); } // assert fails
}

@safe {
    void f2() @trusted { f(); } // @trusted as expected
}

// 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
---

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list