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

Max and MaxBy return int instead of the container's type #9

Closed
CyberBotX opened this issue Jun 27, 2023 · 1 comment
Closed

Max and MaxBy return int instead of the container's type #9

CyberBotX opened this issue Jun 27, 2023 · 1 comment
Assignees

Comments

@CyberBotX
Copy link

I was looking into LinqGen to see if it would be able to replace most of my vanilla LINQ usage, and stumbled upon this. Vanilla LINQ's Max and MaxBy methods will return the type of the container. LinqGen's returns int instead. (Min and MinBy are also affected.)

Example:

var list = new List<double> { 1.0, 2.0, 4.0 };

// Vanilla LINQ:
double maxVanilla = list.Max();
double maxNegVanilla = list.MaxBy(x => -x);

// LinqGen:
double maxGen = list.Gen().Max(); // This won't compile, as Max return int
double maxNegGen = list.Gen().MaxBy(x => -x); // This won't compile, as MaxBy returns int
@cathei cathei self-assigned this Jul 25, 2023
cathei added a commit that referenced this issue Jul 25, 2023
@cathei
Copy link
Owner

cathei commented Jul 25, 2023

Thank you for reporting this. It is fixed in v0.2.5.

Also thank you for trying this project out, please reach out if you encounter other issue!

@cathei cathei closed this as completed Jul 25, 2023
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

2 participants