Page MenuHomeFeedback Tracker

typename::Spawn not respecting default ctor values
Closed, ResolvedPublic

Description

When having default parameter values on the constructor of a class, an instance spawned through typename::Spawn will init it with random? data pointers. The code below should print hello world twice if it was working correctly.

class MyLittlePony
{
	void MyLittlePony(string someParamWithDefault = "hello world")
	{
		Print(someParamWithDefault);
	}
}

MyLittlePony inst1();
Print(inst1);
typename ponyType = MyLittlePony;
MyLittlePony inst2 = MyLittlePony.Cast(ponyType.Spawn());
Print(inst2);

SCRIPT : string someParamWithDefault = 'hello world'
SCRIPT : MyLittlePony inst1 = MyLittlePony<0x0000026008857618>
SCRIPT : string someParamWithDefault = '�8�q�'
SCRIPT : MyLittlePony inst2 = MyLittlePony<0x00000260088575C8>

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
General

Event Timeline

Arkensor created this task.Apr 17 2023, 9:52 AM
Geez changed the task status from New to Assigned.Apr 17 2023, 2:52 PM
Geez closed this task as Resolved.Jun 9 2023, 11:01 AM
Geez claimed this task.
Geez added a subscriber: Geez.

Should be fixed in the next major update.