Having read in article "Anonymous Methods" (as part of the articles series "Delegates and Lambda Expressions in C# 3.0") the phrase:
"Advanced Topic: Parameterless Anonymous Methods
... anonymous methods are allowed to omit the parameter list (
delegate { return Console.ReadLine() != ""}
, for example). This is atypical, but it does allow the same anonymous method to appear in multiple scenarios even though the delegate type may vary"*
I became a little confused.
IMO (can't find now but as far as I remember), the type is determined by parameter list but not by return type of a method. Is it correct?
So, how can the types of a parameterless method or a delegate differ?
Any (simplest possible) code example illustrating the differing parameterless delegate type for the same anonymous method would be appreciated.