-
-
Notifications
You must be signed in to change notification settings - Fork 443
Closed
Description
Description
When calling the Where method on a Fin<A> type, the compiler throws a CS0121 error due to an ambiguous call between two extension methods with the same signature.
Background
The Fin<A> type implements multiple interfaces:
IEnumerable<A>- enablesSystem.Linq.Enumerable.Whereextension methodMonoidK<Fin>- enablesLanguageExt.MonoidKExtensions.Whereextension method
This creates a conflict when trying to call Where directly on a Fin<A> instance.
Steps to Reproduce
- Create a new .NET project with LanguageExt.Core 5.0.0-beta-54
- Write the following code:
using LanguageExt;
using static LanguageExt.Prelude;
var fin = Fin<int>.Succ(2025);
var result = fin.Where(x => x > 20); // CS0121 error occurs here- Compile the project
Expected Behavior
The code should compile successfully, allowing one of the Where methods to be called unambiguously.
Actual Behavior
Compiler error CS0121:
I would appreciate any feedback if my understanding of the Fin type is inaccurate or incomplete.
Metadata
Metadata
Assignees
Labels
No labels