Search code examples
c#linqlambdaanonymous-methods

why are lambdas & anonymous methods not allowed on the left side of the is or as operator?


Lambdas are not allowed on the left side of the is or as operator. MSDN

A clear explanation with an real example would be appreciated?


Solution

  • Lambdas have no type, so consequently, it makes no sense to use an operator that inspects the type of a value that has no type.