Skip to content

Function prototypes do not match between any and non-any array parameters #684

@FortyTwoFortyTwo

Description

@FortyTwoFortyTwo

Attempting use function with non-any array parameter on typedef/typeset function with any array, error is reported on function prototypes. No error reported if cell is used instead of array, or function with any array parameter is used.
Compiles without error in 1.10, broke in 1.11.0.6798.

typedef CallbackCell = function void (any cell);
typedef CallbackArray = function void (any array[4]);

public void OnPluginStart()
{
	ReturnCallbackCell(CellAny);	// no error
	ReturnCallbackCell(CellInt);	// no error
	
	ReturnCallbackArray(ArrayAny);	// no error
	ReturnCallbackArray(ArrayInt);	// error 100: function prototypes do not match
}

CallbackCell ReturnCallbackCell(CallbackCell callback)
{
	return callback;
}

CallbackArray ReturnCallbackArray(CallbackArray callback)
{
	return callback;
}

void CellAny(any cell) {}
void CellInt(int cell) {}
void ArrayAny(any array[4]) {}
void ArrayInt(int array[4]) {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions