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
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
andMaxBy
methods will return the type of the container. LinqGen's returnsint
instead. (Min
andMinBy
are also affected.)Example: