Mixin icon indicating copy to clipboard operation
Mixin copied to clipboard

Enable accessors to return a (potentially mixin added) supertype of the targetted field

Open dimitriye98 opened this issue 4 years ago • 0 comments

When dealing with fields whose type is a private class, it would be useful to be able to target those fields with an accessor whose return type is a supertype of the field type.

For instance

public class Target {
    private class Inner {}
    private Inner inner;
}

@Mixin(Target.class)
interface TargetInnerAccessor {
    interface Inner { /* some accessors */ }
    @Accessor Inner getInner();
}

Having support for this with shadowing would also be nice.

dimitriye98 avatar Jun 11 '21 12:06 dimitriye98