This is almost a non-issue, but AsEnumerable reports "Object allocation: LINQ method call" when used on reference types. When used on a struct, an allocation is reported on the variable as well as a "Boxing allocation". For unrestricted generics, a possible boxing is reported as well.
From what I understand, only one boxing is done in that case as AsEnumerable returns the parameter as-is.
Proposal: exclude AsEnumerable from the list of allocating LINQ methods. This should fix all of these cases.
"LINQ method call" allocation inspector was removed, will be eventually replaced with the inspection that reports manually-annotated BCLs methods that do allocate
This is almost a non-issue, but
AsEnumerable
reports "Object allocation: LINQ method call" when used on reference types. When used on a struct, an allocation is reported on the variable as well as a "Boxing allocation". For unrestricted generics, a possible boxing is reported as well. From what I understand, only one boxing is done in that case asAsEnumerable
returns the parameter as-is.Proposal: exclude
AsEnumerable
from the list of allocating LINQ methods. This should fix all of these cases.