This documentation is archived and is not being maintained.

Compiler Error CS0748

Visual Studio 2008

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.

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