D_Parser
D_Parser copied to clipboard
UFCS does not work with pointer arguments
Reported by Manu: Goto-Definition does not work with UFCS and pointer types, e.g.
inout(char)[] asDString(const(char)* cstr) pure nothrow @nogc @trusted
{
return null;
}
const(char)* pixelFormat;
@property const(char)[] format() const pure nothrow @nogc @safe
{
return pixelFormat.asDString(); // no definiton found for "asDString"
}
asDString(pixelFormat)
works as expected.
Looks like it already dereferences the pointer before UFCS lookup. If I add an overload for const char
it is found as definition:
inout(char)[] asDString(const char cstr) pure nothrow @nogc @trusted
{
return null;
}
Another issue seems to be that mutable char
is not considered as a matching overload.