Not possible to reference private inner classes in method signatures
NotMyWing opened this issue · 1 comments
NotMyWing commented
It's currently impossible to reference instances of private inner classes (specifically, of other mods, which can't traditionally be access transformed) in method signatures. Coercing arguments also doesn't seem to be possible, as Mixin strictly expects the signature to be A$B
, so defining the argument as Object
fails at runtime. @Local
expects A$B
as well. This leaves no options for targeting the instance.
Example class:
class A {
method(B b);
static class B {}
}
Example mixin:
interface IExtendedB {}
@Mixin(B.class)
class mB implements IExtendedB {}
@Mixin(A.class)
class mA {
@Inject(method = "method", ...)
public void injection(A.B b, CallbackInfo ci) {} // oops! fails at compile-time
public void injection(CallbackInfo ci, @Local IExtendedB b) {} // oops! fails at runtime
public void injection(CallbackInfo ci, @Local Object b) {} // oops! failed to validate at runtime
}
NotMyWing commented
Update: I might be an idiot, but @Coerce
finally worked in my environment RIGHT AFTER I have submitted this.
public void injection(@Coerce Object b, ...)
Feel free to close this or do as you see fit.