www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11304] New: In case of different safe/ trusted/ system attributes the weaker is selected

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 puremagic.com
        ReportedBy: verylonglogin.reg gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg 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: -------
Oct 20 2013