[Issue 13430] New: Improve error message with wrong arg type to inout function
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sat Sep 6 01:42:51 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13430
Issue ID: 13430
Summary: Improve error message with wrong arg type to inout
function
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: turkeyman at gmail.com
This error message had me scratching my head for half an hour. Please fix this
situation to report the appropriate error.
This code produces the error:
Error: inout method db.ui.listadapter.S.f is not callable using a mutable
object
struct S
{
inout(int) f(int x) inout // inout method
{
return x;
}
}
void f(size_t s)
{
S x;
// call it with the wrong type (size_t, expects int)
x.f(s); // very surprising error message
// call with appropriate type, no problem
x.f(cast(int)s);
}
--
More information about the Digitalmars-d-bugs
mailing list