| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/fail241.d(18): Error: mutable method `fail241.Foo.f` is not callable using a `const` object |
| 5 |
fail_compilation/fail241.d(13): Consider adding `const` or `inout` here |
| 6 |
fail_compilation/fail241.d(19): Error: mutable method `fail241.Foo.g` is not callable using a `const` object |
| 7 |
fail_compilation/fail241.d(14): Consider adding `const` or `inout` here |
| 8 |
--- |
| 9 |
*/ |
| 10 |
|
| 11 |
class Foo |
| 12 |
{ |
| 13 |
public void f() { } |
| 14 |
private void g() { } |
| 15 |
|
| 16 |
invariant() |
| 17 |
{ |
| 18 |
f(); // error, cannot call public member function from invariant |
| 19 |
g(); // ok, g() is not public |
| 20 |
} |
| 21 |
} |