Udostępnij za pośrednictwem


'System.Nullable' does not satisfy the 'Structure' constraint for type parameter '<typeparametername>'

A generic type is invoked passing a type argument of Nullable<T> to a type parameter with a Structure constraint.

The common language runtime (CLR) specifically disallows the Nullable<T> structure as a type argument to itself. Even though it is a structure and would otherwise satisfy a Structure constraint, using it recursively could lead to awkward constructions such as Nullable(Of Nullable(Of Nullable)).

Error ID: BC32115

To correct this error

  • Either remove the Structure constraint from the type parameter, or change the type argument to some value type other than Nullable<T>.

See Also

Concepts

Generic Types in Visual Basic

Reference

Nullable<T>

Structure (Visual Basic)