-
Notifications
You must be signed in to change notification settings - Fork 315
Open
Description
Covariance is only working with interfaces. Meaning something like this is possible:
public interface IVehicle { }
public class Car : IVehicle { }
public class Bus : IVehicle { }
IResult<IVehicle> carResult1 = Result.Success(new Car());
This on the other hand is not possible:
Result<IVehicle> carResult2 = Result.Success(new Car());
The solution seams simple, just go with IResult rather than Result.
But all the extension methods (those) are on Result, and not on IResult.
Is there a possibility to put all extension methods onto IResult rather than Result?
The "creation" methods (those) can stay on Result, but they return an IResult.
I guess when the extension methods are moved to IResult, we break compatibility...
If the extension methods are copied to IResult, the codebase gets much bigger...
Metadata
Metadata
Assignees
Labels
No labels