[Issue 8677] New: compiler attempts to call ctor instead of opCall
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Sep 17 07:30:56 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8677
Summary: compiler attempts to call ctor instead of opCall
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: andrej.mitrovich at gmail.com
--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2012-09-17 07:31:40 PDT ---
struct Foo
{
this(int) {}
bool opCall(string)
{
return true;
}
}
void main()
{
Foo foo = Foo(1);
if (foo("a")) { } // error
}
test.d(17): Error: constructor test.Foo.this (int _param_0) is not callable
using argument types (string)
test.d(17): Error: cannot implicitly convert expression ("a") of type string to
int
The compiler has no business calling a ctor on a variable invocation.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list