Page MenuHomeFeedback Tracker

Overload detection bug in script vm
Reviewed, NormalPublic

Description

If I try to add both these functions and call either one of which with IsAnyInherited(Class, {Class, Class});

//------------------------------------------------------------------------------------------------
static bool IsAnyInherited(typename type, notnull array<typename> from)
{
}

//------------------------------------------------------------------------------------------------
static bool IsAnyInherited(Class instance, notnull array<typename> from)
{
}

I get the error Array initialization of non-array type.. If I remove one overload or rename one of the functions it works flawlessly. Please fix.

Details

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

Event Timeline

Arkensor created this task.May 26 2023, 7:48 AM
Geez changed the task status from New to Assigned.May 29 2023, 4:47 PM
Geez added a subscriber: Geez.Jun 9 2023, 12:49 PM

Hello Arkensor,
we cannot produce this on our end. Was this possibly fixed?

Hello,

I have just run this code on 0.9.8.73 and reproduced the error. If this code compiles without error on the current dev build then I guess one of the many fixes made in the mean time to the script-vm maybe fixed it. Please try my example to be sure:

class TAG_REPRODUCE
{
	//------------------------------------------------------------------------------------------------
	static bool IsAnyInherited(typename type, notnull array<typename> from)
	{
	}
	
	//------------------------------------------------------------------------------------------------
	static bool IsAnyInherited(Class instance, notnull array<typename> from)
	{
	}
}

void TriggerError()
{
	TAG_REPRODUCE.IsAnyInherited(Class, {Class, Class});
}

Geez changed the task status from Assigned to Reviewed.Jun 12 2023, 11:13 AM

Thank you.
We cannot seem to produce this on 0.9.9 internal and therefore the issue has most likely been fixed for the 0.9.9 update.
Please let us know in case it persists in 0.9.9.

Ok, I will check when 0.9.9 exp drops and let you know if it can be closed or not. Thank you for the investigation.