Skip to content

[Bug]: No suitable method for method overloads using ambiguous generics #2197

Description

@TimothyMakkison

Describe the bug 🐞

I receive the following error message when trying to invoke a method on the below interface.

No suitable Method found...
   at Refit.RequestBuilderImplementation.FindMatchingRestMethodInfo(String key, Type[] parameterTypes, Type[] genericArgumentTypes) in C:\Users\Lenovo ThinkPad\Desktop\coding\C#\refit\src\Refit\RequestBuilderImplementation.cs:line 361

Step to reproduce

public interface IGenericMethodAndInterface<in TInterface>
{
    [Get("/{value1}/{value2}")]
    Task GetGenericParameter<T1>(T1 value1, TInterface value2);

    [Get("/{value1}/{value2}")]
    Task GetGenericParameter<T1>(T1 value1, int value2);
}

Reproduction repository

https://github.com/reactiveui/refit

Expected behavior

Should invoke method

Found while writing #2195

Version

9bc6754

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions