Replies: 1 comment 29 replies
-
The static keyword when applied to a lambda has zero impact on the generated code. It serves only to enforce that the body of the lambda doesn't close over non-static state. Whether the emmitted method for the lambda is actually an instance or static method is an implementation detail of the C# compiler, and as you saw, your code today will result in an instance method (for performance reasons). |
Beta Was this translation helpful? Give feedback.
29 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it necessary to use 'static' keyword, or compiler can resolve it from lambda body?
Beta Was this translation helpful? Give feedback.
All reactions