[Issue 14389] The "(attributelist):" attribute notation scope of effect

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Apr 1 13:15:30 PDT 2015


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

Adam D. Ruppe <destructionator at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |destructionator at gmail.com

--- Comment #1 from Adam D. Ruppe <destructionator at gmail.com> ---
class C {
   private:
   @safe:
     void foo() {}
}

Should foo still be private? I think a lot of people use this pattern today and
expect foo to be private and @safe. Your change would make the @safe turn
private off.

You expanded on chat to say it should be written

private @safe:
  void foo() {}

if you want both, put them both behind the colon. That's not a bad idea, I'll
admit.

--


More information about the Digitalmars-d-bugs mailing list