If you make a C# assembly with the following code: public class B { } public class C<T, TB> where TB : B { } public class A<T> { public C<T, TB> makeC<TB>() where TB : B { return new C<T, TB>(); } }Then make a C++/CLI project that references the previous one and has the following code:A<bool>^ x = gcnew A<bool>();The result is: error C3214: 'TB' : invalid type argument for generic parameter 'TB' of generic 'C', does not meet constraint 'B ^'This error message should not be there. Interestingly, if the code is written entirely in C# or entirely in C++ (in a single source file), then no error message is generated. Update: If you define classes A,B,C in a C++/CLI assembly instead of C#, then the error message is still generated. So the issue is not about C# but rather referencing any assembly that defines classes A,B,C in the above manner. Here is the analogous C++ code:public ref class B {};generic<typename T,typename TB> where TB : B public ref class C {};generic<typename T> public ref class A{public: generic<typename TB> where TB : B C<T, TB>^ makeC() { return gcnew C<T, TB>(); }};
Visual Studio/Team Foundation Server/.NET Framework Tooling version
Steps to reproduce
Product Language
Operating System
Operating System Language
Actual results
Expected results