Summary: delegate should specify 'this' decorations
           Product: D
           Version: 2.036
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Steven Schveighoffer <> 2009-12-28 
06:34:17 PST ---
Note, this bug applies to 2.037, but for some reason it's not in the version

import std.stdio;

class A
    void f() {}

void main()
    const A a = new A;
    auto g = &a.f;
    writefln("%s", typeof(g).stringof);

This outputs:

void delegate()

First, the line:

auto g = &a.f;

shouldn't compile because f cannot be called on a.  However, even if f is
changed to a const function, the output is still "void delegate()", it should
be "void delegate() const".

This breaks const correctness without a cast, because I can call g, but not

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

Reply via email to