Skip to content

Use inference for part of non inferable generic arguments only #6207

@MatthieuMEZIL

Description

@MatthieuMEZIL

When we have a method like this:

void Foo<T1, T2, T3, T4>(T1 t1, T2 t2, T3 t3, T4 t4)
{
}

It's great that the compiler can infer generic arguments from the call.

But when one generic argument cannot be inferred, we need to specify all.

It would be great to have a way to specify only generic arguments that cannot be inferred.

Ex:

void Foo<T1, T2, T3, T4, TResult>(T1 t1, T2 t2, T3 t3, T4 t4)
{
}

Foo<TResult:int>(0, 0, 0, 0);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions