'Class' constraint and 'Structure' constraint cannot be combined

A constraint list includes both the Class (Visual Basic) constraint and the Structure (Visual Basic) constraint.

A constraint list on a type parameter can specify that the type argument passed to that type parameter must be a value type (with the Structure constraint) or must be a reference type (with the Class constraint). You cannot specify both constraints on the same type parameter, and you cannot specify either one more than once.

Error ID: BC32104

To correct this error

  • Decide whether you want to require a value type or a reference type for the type argument.

    • If you want the type argument to be a value type, remove the Class keyword from the constraint list.

    • If you want the type argument to be a reference type, remove the Structure keyword from the constraint list.

See Also

Concepts

Generic Types in Visual Basic

Value Types and Reference Types