Comment #0 by matti.niemenmaa+dbugzilla — 2006-11-15T07:40:40Z
This is similar to Issue 516. The following code is directly from the spec:
class Foo
{
public void f() { }
private void g() { }
invariant
{
f(); // error, cannot call public member function from invariant
g(); // ok, g() is not public
}
}
According to the comments in the code and a paragraph in the spec the above should fail to compile, yet it compiles fine (and, due to Issue 519, runs fine, instead of falling to stack overflow). The compiler shouldn't allow this, as there is no situation where this is useful: it's always an infinite loop.