编译器错误 C3050

“type1”:ref 类不能从“type1”继承

System::ValueType 不能作为引用类型的基类。

以下示例生成 C3050:

// C3050.cpp
// compile with: /clr /LD
ref struct X : System::ValueType {};   // C3050
ref struct Y {};   // OK