When Linq and ref Parameters Meet(programmersheaven.com)

submitted by pheavenpheaven(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.

add a comment |category: |Views: 2

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

No comments so far

information Login or create an account to comment on this story