Type parameter '<typeparametername>' cannot be inferred

A generic procedure is called without supplying a type argument list, and type inference fails for one of the type arguments.

When you call a generic procedure, you normally supply a type argument for each type parameter defined by the procedure. However, you have the alternative of omitting the type argument list entirely. When you do this, the compiler attempts to infer the type of each type argument from the context of your call. For more information, see "Type Inference" in Generic Procedures in Visual Basic.

Error ID: BC36572

To correct this error

  • Make sure the types of the normal arguments are such that type inference is consistent with the type parameters declared for the generic procedure.

    -or-

  • Call the generic procedure with a complete type argument list, so that type inference is not necessary.

See Also

Concepts

Generic Types in Visual Basic

Generic Procedures in Visual Basic

Reference

Type List