I\'m defining a lambda and calling it, by appending \"()\", immediately.
Try:
int i = (() => 0) ();
Error:
Er
You're not "defining a lambda".. you're wrapping parenthesis around what you think is one.
The compiler doesn't infer this type of thing. It needs context. You give it context by assigning or casting the representation of the lambda to a delegate type:
Func f = () => 0;
int i = f();
Thats clear context. If you want an unclear one.. this sort of thing also works:
int i = ((Func)(() => 0))();