Page MenuHomeFeedback Tracker

Incorrect compilation
Assigned, UrgentPublic

Description

If there is a procedure in class A that matches the name of a third-party class B, an error occurs.

Details

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

MODIFICATION A

ref A_Test A_TEST;
//	Class A_Test in modification A
class A_Test
{
	void OnEvent( EventType v_EventType, Param v_Params )
	{
		if ( v_EventType == ChatMessageEventTypeID )
		{
			ChatCommand( v_Params );
		}
	}
	
	void ChatCommand( Param v_Params )
	{
	}
}
//	modded class MissionServer in modification A
modded class MissionServer
{
	override void OnInit()
	{
		super.OnInit();

		A_TEST	=	new A_Test();
	}
	
	override void OnEvent( EventType eventTypeId, Param params )
	{
		super.OnEvent( eventTypeId, params );

		if ( A_TEST )
		{
			A_TEST.OnEvent( eventTypeId, params );
		}
	}
}

MODIFICATION B

//	Class ChatCommand from modification B
class ChatCommand
{
	void ChatCommand( string v_String )
	{

	}
}

Separately, both modifications will work correctly.

If you connect both modifications, you see error message:
Cannot convert 'Param' to 'string' for argument '0' to method 'ChatCommand'

line:

ChatCommand( v_Params );

Must call a class procedure, from A_Test
But in fact, it calls the class constructor, which is strange - even without an operator "new"

P.S.
i can use THIS for correctly work -
this.ChatCommand( v_Params );
but this is wrong))))

Additional Information

Based on the compatibility issue, I add the names of all my classes with the postscript "US_" to exclude accidental matches with the names of classes of third-party modifications.
But do not rename nested procedures and functions inside the classes themselves...

in c# all ok

example:

public class myclass0
{
    void myclass1( int i ) { Debug.Log("form myclass0 - test"); }
    public void test() {  myclass1( 0 );  }

}

public class myclass1
{
    myclass1()
    {
    }
}

....

myclass0 v_myclass0 = new myclass0();
v_myclass0.test();

it's work correctly.

Event Timeline

NoNameUltima edited Steps To Reproduce. (Show Details)
NoNameUltima edited Additional Information. (Show Details)Aug 24 2021, 6:57 PM
NoNameUltima edited Additional Information. (Show Details)
Geez changed the task status from New to Assigned.Aug 30 2021, 10:36 AM