[Issue 9229] Private default arguments

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Dec 28 01:29:29 PST 2012


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



--- Comment #1 from bearophile_hugs at eml.cc 2012-12-28 01:29:27 PST ---
Some more rules. The use of private arguments is allowed in pre/post
conditions:

int foo(private int n = 1)
in {
    return foo(5);
} body {
    return n;
}



If an argument is private, it needs to be private in its
overriding/implementations too:

interface IFoo {
    void foo(private int x = 5);
}
class Foo1 : IFoo {
    void foo(int x = 6) {} // Error.
}
class Bar1 {
    void foo(private int x = 7) {}
    void bar(int x = 8) {}
}
class Bar2: Bar1 {
    override void foo(int x = 7) {} // Error.
    override void bar(private int x = 8) {} // Error.
}
void main() {}

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