Bug 4392 – Problems with const/non-const overloads of member functions
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2010-06-25T07:34:00Z
Last change time
2011-07-02T22:09:36Z
Assigned to
nobody
Creator
webby
Comments
Comment #0 by webby — 2010-06-25T07:34:43Z
Using the latest DMD2, the code:
//
class c1
{
void foo() const
{
}
void foo()
{
}
void bar() const
{
foo();
}
}
//
fails to compile with the error:
constest.d(15): Error: function constest.c1.foo () is not callable using
argument types () const
However, if I either:
1) Change bar() to call this.foo() or
2) switch the 2 foo()s so that the const version is defined second.
Then it compiles ok.
Comment #1 by yebblies — 2011-07-02T22:09:36Z
*** This issue has been marked as a duplicate of issue 3733 ***