Simplify method call when using delegates (like LINQ) #3482
Unanswered
Enderlook
asked this question in
Language Ideas
Replies: 2 comments
-
Beta Was this translation helpful? Give feedback.
0 replies
-
I believe that the For the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Sorry for the weird title, I'm not sure how to name it.
Imagine this current working code:
Wouldn't be nice if you could do?:
or even:
The compiler could infer what you are trying to call and generate the corresponding code like currently does.
Maybe with the instance version (either
foos.Select(Foo.InstanceBar)
orfoos.Select(InstanceBar)
) the compiler-generated class could be avoided. However, I don't know if the CLR supports that. Anyway, there is no need for the optimization, the syntactic sugar is very nice and readable by itself.What do you think?
Beta Was this translation helpful? Give feedback.
All reactions