नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'type_arg' : invalid type argument for generic parameter 'param' of generic 'generic_type', must be a non-nullable value type
Remarks
A generic type was instantiated incorrectly. Check the type definition. For more information, see Nullable and Generics.
Example
The following example uses C# to create a component that contains a generic type that has certain constraints that are not supported when authoring generic types in C++/CLI. For more information, see Constraints on Type Parameters.
// C3391.cs
// Compile by using: csc /target:library C3391.cs
// a C# program
public class GR<N>
where N : struct {}
When the C3391.dll component is available, the following example generates C3391.
// C3391_b.cpp
// Compile by using: cl /clr C3391_b.cpp
#using <C3391.dll>
using namespace System;
value class VClass {};
int main() {
GR< Nullable<VClass> >^ a =
gcnew GR< Nullable<VClass> >(); // C3391 can't be Nullable
GR<VClass>^ aa = gcnew GR<VClass>(); // OK
}