Closed martindevans closed 10 months ago
Added support for defining functions which have a tuple as a generic parameter.
Previously defining like this would work:
Linker.DefineFunction<int, int, int>("module", "name", (int a) => (a, a));
But doing this would not work:
void DefineWrapper<TIn, TOut>(Func<TIn, TOut> func) { Linker.DefineFunction<TIn, TOut>("module", "name", func); } DefineWrapper<int, (int, int)>((int a) => (a, a));
Even though they're ultimately doing the same thing, just with one more level of generic typing.
This PR detects that case and adds limited support for tuples (only up to 4 elements).
I have not added support for ValueRaw unboxing of tuples. As far as I can tell it's not required anywhere.
ValueRaw
Added support for defining functions which have a tuple as a generic parameter.
Previously defining like this would work:
But doing this would not work:
Even though they're ultimately doing the same thing, just with one more level of generic typing.
This PR detects that case and adds limited support for tuples (only up to 4 elements).
I have not added support for
ValueRaw
unboxing of tuples. As far as I can tell it's not required anywhere.