When Linq and ref Parameters Meet(programmersheaven.com)
submitted by
pheaven(430) 4 years, 1 month ago
In this post we look into a curious quirk of C#: you can't use parameters passed as "ref" inside a Linq query (or a lambda expression or anonymous method either). By analysing the intermediate code produced by the C# compiler, we learn how anonymous methods are compiled when they need lexical scoping semantics. Finally, an attempt to change the IL to get the desired semantics reveals why C# forbids this.
|category: Linq
|Views: 2
tags:
LINQ another
Everyones tags:
Your Tags: