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

           Summary: @system on @safe class methods inconsistency
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: c...@klickverbot.at


--- Comment #0 from klickverbot <c...@klickverbot.at> 2011-12-02 09:55:41 PST 
---
Consider:
---
void unsafe() {}
@safe class Foo {
  void bar() @system {
    unsafe();
  }
}
---

DMD 2.057 Git (887dda0ba) fails with:
---
Error: safe function 'bar' cannot call system function 'unsafe'
---


The following two examples compile, however (note the different position of
@system in the first example):
---
void unsafe() {}
@safe class Foo {
  @system void bar() {
    unsafe();
  }
}
---
---
void unsafe() {}
@safe class Foo {
  void bar() @trusted {
    unsafe();
  }
}
---


Given that the effects of @safe being applied to classes don't seem to be
mentioned in the spec, this is technically not a rejects-valid bug, but
certainly very inconsistent.

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

Reply via email to