Using closure in function scope to make "real" private class members
Nick Treleaven
nick at geany.org
Tue Jun 7 13:15:31 UTC 2022
On Tuesday, 7 June 2022 at 10:40:41 UTC, Basile B. wrote:
> Also interfaces break visibility with joy. If an interface
> implementer implements one of the func as private, you can
> still use it, whatever is the call site.
Example? This gives an error:
```d
interface I {
void f();
}
class C : I // error
{
private void f(){}
}
```
privifaceimp.d(4): Error: class `privifaceimp.C` interface
function `void f()` is not implemented
More information about the Digitalmars-d
mailing list