Summary: @property does not properly disambiguate delegate
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Jonathan M Davis <> 2012-04-22 16:19:41 
PDT ---
This code:

import std.stdio;

alias void delegate() Callable;

class Test
    @property Callable a()
        return { writeln("hello"); };

void main()
    auto t = new Test;
    t.a(); // does NOT say hello
    t.a()(); // this does

compiles and gives this output


With -property, the second call to a should be illegal, but it still compiles.
And regardless of whether -property is used or not, hello only gets printed
once. The first call should call the delegate and print hello, but only the
second one is.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to