Skip to content

template tag jsdoc not evaluated with function callback as parameter #11724

Closed
@Thaina

Description

@Thaina

I made function SortFilter like this

/**
 * @param {T[]} arr
 * @template T
 */
function ItIs(arr) // for test
{
    return arr;
}

/**
 * @param {T[]} arr
 * @param {function(T):number} valuator
 * @template T
 */
function SortFilter(arr,valuator)
{
    return arr.map((item) => {
        return { item: item,value: valuator(item) };
    }).filter((pair) => Number.isFinite(pair.value)).sort((l,r) => {
        return l.value - r.value;
    }).map((pair) => pair.item);
}

And this is the result

image

image

As you could see. It seem like it only parse correctly when param is normal array. And fail with callback function as param

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions