I am not 100% sure what the intended design for typename::Spawn is, if it should only work with the default constructor or not, but right now this code
class TestClass { void TestClass(string param = "hello world") { PrintFormat(ToString() + "::ctor(%1)", param); } } ... Class test = String("TestClass").ToType().Spawn(); Print(test);
Results in this:
SCRIPT : TestClass<0x0000020514F1CD28>::ctor(ÈJü÷)
SCRIPT : Class test = TestClass<0x0000020514F1CD28>
I would have expected either "hello world" as the default value is known or an empty string or the constructor not being called at all in case the engine is hard wired to only call the parameterless constructor void TestClass(). Either way, I think one of these should be preferred over unassigned memory.