In theory, all Il2Cpp Action and Func delegates in method signatures could be converted to their System counterparts. This would be emitted as a separate overload, rather than a direct substitution. It synergizes well with #148 and allows more system interfaces to be implemented, such as INotifyCompletion (which was the incentive for #133).
public Il2CppSystem.Action Method(Il2CppSystem.Action normalParam, in Il2CppSystem.Action inParam, out Il2CppSystem.Action outParam);
public System.Action Method(System.Action normalParam, in System.Action inParam, out System.Action outParam)
{
// Conversions are shown explicitly here for clarity, even though they're actually implicit
var normalParamIl2Cpp = (Il2CppSystem.Action)normalParam;
var inParamIl2Cpp = (Il2CppSystem.Action)inParam;
Il2CppSystem.Action result = Method(normalParamIl2Cpp, in inParamIl2Cpp, out Il2CppSystem.Action outParamIl2Cpp);
outParam = (System.Action)outParamIl2Cpp;
return (System.Action)result;
}
In theory, ref parameters could also be supported.
public void Method(ref Il2CppSystem.Action param);
public void Method(ref System.Action param)
{
// Conversions are shown explicitly here for clarity, even though they're actually implicit
var paramIl2Cpp = (Il2CppSystem.Action)param;
Method(ref paramIl2Cpp);
param = (System.Action)paramIl2Cpp;
}
Property accessors and conversion operators should be excluded. Converting event methods might enable #163 to become a reality.
Discussed briefly here: #133 (comment)
In theory, all Il2Cpp
ActionandFuncdelegates in method signatures could be converted to their System counterparts. This would be emitted as a separate overload, rather than a direct substitution. It synergizes well with #148 and allows more system interfaces to be implemented, such asINotifyCompletion(which was the incentive for #133).In theory,
refparameters could also be supported.Property accessors and conversion operators should be excluded. Converting event methods might enable #163 to become a reality.
Discussed briefly here: #133 (comment)