You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In 1.11, for function prototypes you're able to mix between any and non-any variables and not able to mix between ref and non-ref, but in 1.12.0.7165 this rule seems to be all over the place on what's allowed and not allowed.
No longer able to assign &int param to &any callback, yet still able to assign int param to any callback as normal.
Able to mostly mix between ref and non-ref on param and callback
ReturnFunction in this test example are only used to silence unused variable warnings.
typedefCallbackCell = functionvoid (anyvalue);
typedefCallbackRef = functionvoid (any &value);
publicvoidOnPluginStart()
{
// 4 tests below does not report error in 1.11CallbackCellcellany=CellAny; // no errorReturnFunction(cellany);
CallbackCellcellint=CellInt; // no errorReturnFunction(cellint);
CallbackRefrefany=RefAny; // no errorReturnFunction(refany);
CallbackRefrefint=RefInt; // errorReturnFunction(refint);
// 4 tests below does report error in 1.11CallbackCellbadcellany=RefAny; // no errorReturnFunction(badcellany);
CallbackCellbadcellint=RefInt; // no errorReturnFunction(badcellint);
CallbackRefbadrefany=CellAny; // no errorReturnFunction(badrefany);
CallbackRefbadrefint=CellInt; // errorReturnFunction(badrefint);
}
voidCellAny(anyvalue) {}
voidCellInt(intvalue) {}
voidRefAny(any &value) {}
voidRefInt(int &value) {}
FunctionReturnFunction(Functionfunc)
{
returnfunc;
}
The text was updated successfully, but these errors were encountered:
FortyTwoFortyTwo
changed the title
Rule on Function prototype rule mixed on any/int and ref/non-ref variables
Rule on function prototypes mixed on any/int and ref/non-ref variables
Oct 30, 2024
FortyTwoFortyTwo
changed the title
Rule on function prototypes mixed on any/int and ref/non-ref variables
Rule on function prototypes mixed for any/int and ref/non-ref variables
Oct 30, 2024
In 1.11, for function prototypes you're able to mix between
any
and non-any variables and not able to mix between ref and non-ref, but in1.12.0.7165
this rule seems to be all over the place on what's allowed and not allowed.&int
param to&any
callback, yet still able to assignint
param toany
callback as normal.ReturnFunction
in this test example are only used to silence unused variable warnings.The text was updated successfully, but these errors were encountered: