Compiler Error CS0748

Inconsistent lambda parameter usage; all parameter types must either be explicit or implicit.

If a lambda expression has multiple input parameters, some parameters cannot use implicit typing while others use explicit typing.

To correct this error

  • Give all the input parameters implicit types, or give them all explicit types.

Example

The following code generates CS0748 because, in the lambda expression, only alpha is given an explicit type:

// cs0748.cs
class CS0748
{
    delegate double D(int x, int y);
    D d = (int alpha, beta) => { return beta / alpha; }; // CS0748
}

See Also

Reference

Lambda Expressions (C# Programming Guide)