Open RedworkDE opened 1 year ago
@RedworkDE oops, just noticed your PR, thank you so much for the contribution!
It slightly not aligned to the way I see generics support - I want to avoid complex UI for them and give user ability to quickly declare generics via comments directly in code, e.g.:
// Disasmo-Generic: int, System.String
// Disasmo-Generic: byte, float
static void Foo<T1, T2>()
{
}
this is expected to produce two compilations: Foo<int, System._Canon>
and Foo<byte, float>
If user attempts to disasm a function without these annotations - a quick tutorial is printed in the output.
I'll have to think about how to best get data from such a format into the loader; I imagine there will be some complications with correctly matching things in all cases, tho I think it would be easiest to reuse the loader that i currently have and to just live with a few extra instantiations if you reuse the generic parameter name in type and method / disassemble the whole type.
I'll see what works without becoming a giant mess and taking too much time.
Adds a setting to provide types to use for generic arguments.
Example:
produces the output
The default setting is to try
int
andTuple<object, int>
for all arguments, because common value type and some reference type. Exact reference type doesn't matter anyways and this way it demonstrates the syntax for specifying generic arguments. For completeness, I added a way to specify pointer and array types, but I don't think there is a way for them to matter, so they are not documented in the UI.