Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate MatchAsync extension methods on Task<TryOption> #1212

Open
fuzzlebuck opened this issue Mar 19, 2023 · 3 comments
Open

Duplicate MatchAsync extension methods on Task<TryOption> #1212

fuzzlebuck opened this issue Mar 19, 2023 · 3 comments

Comments

@fuzzlebuck
Copy link
Contributor

Hey,

Having some trouble with what looks to be a duplicate extension method which results in:

The call is ambiguous between the following methods or properties: 'TaskTryOptionExtensions.MatchAsync<A, R>(Task<TryOption<A>>, Func<A, Task<R>>, Func<R>, Func<Exception, R>)' and 'TryOptionExtensions.MatchAsync<T, R>(Task<TryOption<T>>, Func<T, Task<R>>, Func<R>, Func<Exception, R>)'

They have the same signature so I can't use named params to specify which one.

The offending extensions are:

public static Task<R> MatchAsync<A, R>(this Task<TryOption<A>> self, Func<A, Task<R>> Some, Func<R> None, Func<Exception, R> Fail) =>

public static async Task<R> MatchAsync<T, R>(this Task<TryOption<T>> self, Func<T, Task<R>> Some, Func<R> None, Func<Exception, R> Fail) =>

Cheers.

@louthy
Copy link
Owner

louthy commented Mar 19, 2023

I feel a PR in your future ;-)

If you could check that the other overloads don't double up that'd be very appreciated 👍

@fuzzlebuck
Copy link
Contributor Author

Found 5 in total, removed the TryOption.Extensions version as the Task.TryOption.Extensions appear more well rounded and commented, hopefully this was the ideal solution, cheers.

PR: #1213

@Laptop765
Copy link

I think this also applies to OptionAsync.Extensions.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants