Udostępnij za pośrednictwem


Type arguments inferred for method '<procedurename>' result in the following errors :<errorlist>

A generic procedure is called without supplying any type arguments, and the inferred type arguments result in one or more constraint violations.

Normally, when you invoke a generic type, you supply a type argument for each type parameter the generic type defines. If you do not supply any type arguments, the compiler attempts to infer the types to be passed to the type parameters. If the inferred types fail to satisfy one or more of the type parameter constraints, the compiler generates this error.

A constraint on a type parameter limits what type arguments can be passed to it. For example, a type parameter might be constrained to be a class that implements the IComparable<T> interface. For more information, see "Constraints" in Generic Procedures in Visual Basic.

Error ID: BC30954

To correct this error

  • Supply type arguments to the generic procedure so that the compiler does not have to infer them.

See Also

Concepts

Generic Types in Visual Basic

Generic Procedures in Visual Basic

Reference

Type List