Steven Schveighoffer <> changed:

           What    |Removed                     |Added
                 CC|                            |

--- Comment #2 from Steven Schveighoffer <> 2010-07-26 
06:20:03 PDT ---
I think the message is actually accurate.  I'll split out the relevant parts:

testbug.d(11): Error: function

testbug.Foo.getX ()          is not callable using argument types 
                 () const

What's happening is, the hidden this parameter is passed as const since the
object is const, but getX doesn't accept a const Foo.

It's the same as if you had a function like this:

void foo(Foo x)


Since f is const, and foo(Foo) must accept a mutable foo.

However, most people see the "const" applying to the function, which is a
common misconception.

I think a better error message might look like this:

Error: function constobj.Foo.getX () cannot be called using a const Foo.

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

Reply via email to