Skip to content

UFCS does not work with pointer arguments #225

@rainers

Description

@rainers

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions