Re: c++/cli compiler oddity

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Martin Lafferty wrote:
....

This does not compile. The constraint on T seems to be ignored.


if FuncB is written as follows:

generic<typename T> where T : ITest
public ref class B abstract : public A<T> {
public:
void FuncB() {
T x = Func();
x->Test();
}
};


It compiles! Is this expected behaviour?

That sounds like a bug to me. If you submit it to connect, please post the
URL here so others can vote on it.

-cd

PS: http://connect.microsoft.com/VisualStudio/Feedback


.