http://d.puremagic.com/issues/show_bug.cgi?id=4501

           Summary: Can't call templated properties as properties from
                    within class
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: dsim...@yahoo.com


--- Comment #0 from David Simcha <dsim...@yahoo.com> 2010-07-24 09:48:24 PDT ---
class Foo {
    int _num;

    int num()()  {
        return _num;
    }

    void doStuff() {
        int i = num;  // Broken
    }
}

void main() {
    auto foo = new Foo;
    auto n = foo.num;  // Works
}


Errors:
test9.d(8): Error: template num() has no value
test9.d(8): Error: cannot implicitly convert expression (num()) of type void to
int

If I comment out Foo.doStuff(), the line `auto n = bar.num;` works, apparently
becuase it's not inside the class.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to