Note: More evidence that the below scenario is a compiler bug is that it works when compiled as a static lib; it only fails as a .dll
--------------------
Define a managed class with a method that takes a template parameter
public __gc class UtilClass
public
UtilClass()
void ConvertSomething( System::String *inString, NativeClass<int>&outType );
}
When you build, there will be no errors
Now build another MC++ library, and reference the library with the class described above
public __gc class LegacyWrapper
public
LegacyWrapper()
void DoSomething( System::String *inString ); // calls UtilClass::ConvertSomethin
}
To get the second library to compile, you must include the definitions of any native types used by the library you are referencing (which is in this case, the template class NativeType). This is expected, just like using a dll that uses a class that it does not export, you must get the definitions somewhere
However, in this case, you'll notice that no matter what you do the compiler refuses to believe that NativeType has been included
Notice also, that this is *not* the case if you replace the template native type with any old non-template native (i.e. non gc) class. Then it works just fine
Is there something I am missing??!