Page MenuHomeFeedback Tracker

Crash when trying to subclass from template that calls a method of another subclassed template
Assigned, NormalPublic

Description

Workbench crashes (ID: 784e823e-4f52-4054-be46-f606902259a6) when trying to compile the code below:

//------------------------------------------------------------------------------------------------
class IElement<Class T> : Managed
{
	//------------------------------------------------------------------------------------------------
	void DoSomething();
}

//------------------------------------------------------------------------------------------------
class ConcreteElement : IElement<Managed>
{
}

//------------------------------------------------------------------------------------------------
class IContainer<Class T> : Managed
{
	ref T m_pElement = new T();
	
	//------------------------------------------------------------------------------------------------
	void DoSomething()
	{
		m_pElement.DoSomething();
	}
}

//------------------------------------------------------------------------------------------------
class ConcreteContainer : IContainer<ConcreteElement>
{
}

Crash does not happen when commenting out m_pElement.DoSomething();

Details

Severity
Crash
Resolution
Open
Reproducibility
Always
Operating System
Windows 11 x64
Category
General
Steps To Reproduce

See Description

Event Timeline

ookexoo created this task.Tue, Jul 15, 10:22 PM
Geez changed the task status from New to Assigned.Wed, Jul 16, 12:57 PM

Also crashes when replacing

//------------------------------------------------------------------------------------------------
class ConcreteContainer : IContainer<ConcreteElement>
{
}

with

//------------------------------------------------------------------------------------------------
class Client : Managed
{
	protected ref IContainer<ConcreteElement> m_pInstance;
}

so subclassing the container is not even necessary for producing a crash.