Skip to content

The type of this does not get properly remapped when calling a @PolymorphicSignature method #693

@Floweynt

Description

@Floweynt

When calling a @PolymorphicSignature method such as the ones provided in VarHandle:

// exception handling omitted
@Unique 
private static final VarHandle someVarHandle = MethodHandles.lookup().findVarHandle(TargetClass.class, "someField", int.class); 

@Inject(method = "foo", at = @At("HEAD"))
private void myHandler() {
    someVarHandle.getAcquire(this);
} 

Javac compiles this down to:

INVOKEVIRTUAL java/lang/invoke/VarHandle.getAcquire (Lcom/example/mixin/TargetClassMixin;)Z

This is not properly handled by Mixin, since Lcom/example/mixin/TargetClassMixin; should be replaced with Lnet/minecraft/TargetClass;.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions