ErrorProne.NET
ErrorProne.NET copied to clipboard
EPS05 ("Use in-modifier for passing readonly struct") is incorrectly reported for parameters used in LINQ queries
Have a function like this
static bool existsAfter(DbContext db, DateTime? date)
{
return date.HasValue &&
db.Table
.Where(t => t.Date > date)
.Any();
}
EPS05 ("Use in-modifier for passing readonly struct 'Nullable'") is reported for DateTime? date and gets fixed as in DateTime? date. But in that case the compiler throws this error:
CS1628: Cannot use ref, out, or in parameter 'date' inside an anonymous method, lambda expression, query expression, or local function
EPS05 shouldn't be reported for parameters used in lambda expressions.