Summary: Can't use auto on const member functions.
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD

--- Comment #0 from Peter Alexander <> 2010-10-02 
17:26:27 PDT ---
When you try to use type inference on a const member function, you get a
compiler error:

class Foo
    auto foo() const { return 0; }    

Compiling gives:

test.d(4): no identifier for declarator foo
test.d(4): semicolon expected, not 'const'
test.d(4): Declaration expected, not 'return'

Removing the 'const' allows it to compile, but the function can no longer be
called on const objects.

The same applies for structs and @property methods.

This is using DMD 2.049.

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

Reply via email to