Function call without parentheses?

Jonathan M Davis jmdavisProg at gmx.com
Tue May 10 12:48:26 PDT 2011


On 2011-05-10 12:45, bearophile wrote:
> Rainer:
> > The problem is that it took me hours to find this simple bug.
> 
> Please, show me a minimal test case that reproduces the problem, and I'll
> put it in Bugzilla as bug or enhancement request, etc.
> 
> This doesn't compile:
> 
> class Foo {
>     private bool bar;
>     bool bar() {
>         return this.bar;
>     }
> }
> void main() {}

Perhaps he had a module-level variable with the same name? In that case, the 
member function would shadow the module variable.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list