I’m trying to write a macro which modifies all functions/methods from all compiled classes to inject custom code into them, but I am unable to find a way to even access the Function expression via the field.kind
property like how you would do with matching and FVar.
var fields:Array<ClassField> = classType.fields.get();
for (i in 0...fields.length)
{
var field:ClassField = fields[i];
switch(field.kind)
{
case FieldKind.FMethod(f):
// `f` only represents the function "kind", it doesn't give any info about the function itself
// how can i modify the function code here???
//case FFun(f): <- can't get function info like this
//case FVar(t,_) <- but you can for variables?? why?
default:
}
}