Indirect constraint '<constraint1>' obtained from the type parameter constraint '<typeparameter1>' conflicts with the indirect constraint '<constraint2>' obtained from the type parameter constraint '<typeparameter2>'
A generic type is declared with conflicting constraints due to a combination of indirect constraints.
The following statement can generate this error.
Public Class testClass(Of t1 As {t2, t3}, t2 As Structure, t3 As Class)
The indirect constraints Structure and Class cause a conflict for type parameter t1, because the Structure constraint requires that the corresponding type argument be a value type, while Class requires that it be a reference type.
Error ID: BC32109
To correct this error
- Change the type parameter constraints to avoid conflicting constraints.
See Also
Concepts
Value Types and Reference Types