Skip to content

templated alias/enum does not capture arguments #224

@rainers

Description

@rainers

Reported by Manu:

// cursor here  ------------------>  vvvvvvvvvvv    and press F12
alias isValidPixelType(ElementType) = ElementType;

// cursor moves to here:
template ElementType(Img)  // <- except the cursor goes to the start of the line rather than the proper token
{
    alias ElementType = void;
}

// the cursor should move to the template argument for the template it's in, not some other declaration with the same name

//===========================================================================================================================================
//===========================================================================================================================================

// cursor here    ----------------->  vvvvvvvvvvvv    and press F12
enum isValidPixelType(ElementType2) = ElementType2;

template ElementType2()  // <- note that I removed the template argument
{
    alias ElementType2 = void;
}

// the cursor no longer moves anywhere

//===========================================================================================================================================
//===========================================================================================================================================

template ElementType3(Img)    // <=========   To the declaration
{
    // cursor here and press F12
    //    vvvvvvvvvvvv
    alias ElementType3 = void;
}
//
// I feel like it should move to here ===//

(Not so sure what should happen in the third case). Seems like the template arguments of the alias/enum definitions are ignored in symbol lookup.

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