If you attempt to compile the following code the engine crashes to death most of the time and if you are very lucky it prints the error message below the code thinking a function inside the base class does not exist. To reproduce this all aspects of the code example are important. The class that uses two templates, for the own class and for the base class, the fact that the base class has a function, that the inherited class attempts to override it, and that the whole class is tried to be instantiated. I tried around a bit, but could not find any clear workaround. This can only be fixed by debugging what is going on in the script VM. Thank you :)
class SomeType { } class FirstClass<Class T> { void SomeFnc(int someValue); } class SecondClass<Class T> : FirstClass<SomeType> { T m_Value; void SecondClass(T argument) { m_Value = argument; } override void SomeFnc(int someValue) { PrintFormat("SomeFnc(%1)", someValue); } } void UseSecondClass() { SecondClass<int> instance(1337); }
SCRIPT (E): @"Scripts/Game/Core/Test.c,19": Function 'SomeFnc' is marked as override, but there is no function with this name in the base class
SCRIPT (E): @"Scripts/Game/Core/Test.c,19": ...while compiling template class 'SecondClass<int>'
SCRIPT (E): Can't compile "Game" script module!Scripts/Game/Core/Test.c(19): Function 'SomeFnc' is marked as override, but there is no function with this name in the base class