sourcepawn icon indicating copy to clipboard operation
sourcepawn copied to clipboard

error 100: function prototypes do not match

Open stas11s11t opened this issue 6 months ago • 0 comments

typeset T
{
	function void (int a);
	function void (int a, int b);
}

native void N(T t);

public void OnPluginStart()
{
	bool b = true;
	N(b ? A : B); // error 100: function prototypes do not match
}

public void A(int a)
{

}

public void B(int a, int b)
{

}

This is inconvenient and you are forced to do:

if (b) {
	N(B);
} else {
	N(A);
}

stas11s11t avatar Jul 27 '24 20:07 stas11s11t