You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a mixin uses one of the target's interface's default methods, any parent class which also implements a method with a matching signature will take the call instead.
You would expect new B().testCall() to return I've got 5, but it instead throws an AbstractMethodError:
java.lang.AbstractMethodError: com.chocohead.example.A.method(I)Ljava/lang/String;
at com.chocohead.example.B.handler$zzc000$test-mod$addInterfaceCall(B.java:521)
at com.chocohead.example.B.test(B.java)
at com.chocohead.example.Test.onInitialize(Test.java)
This is caused by the re-parenting Mixin does to correct super calls in mixins preferring the target's parent interfaces over the target's own...
MixinTargetContext#transformMethodRef will attempt to re-parent any INVOKESPECIAL call (that isn't to the mixin's parent class) if the mixin's parent class doesn't match the target's, or if any of the target's parent classes have mixins targeting them
ClassInfo#findInHierarchy looks depth first at the parents and their interfaces before checking its own
MixinTargetContext#updateBinding sets the call to use the implementer of the found method. For our situation, that's the implementer of IA#method, i.e. A
This crash can be caused in a Minecraft context by having an empty mixin targeting FixedColourVertexConsumer whilst Iris is installed before 1.21. This crash is from opening ModMenu on 1.20.4 for example:
java.lang.AbstractMethodError: Method net/minecraft/class_4585.method_22921(II)Lnet/minecraft/class_4588; is abstract
at net.minecraft.class_4585.method_22921(class_4585.java)
at net.minecraft.class_287.method_22921(class_287.java:2095)
at net.minecraft.class_4588.method_22916(class_4588.java:56)
at net.minecraft.class_382.method_22944(class_382.java:55)
at net.minecraft.class_327$class_5232.method_27531(class_327.java:282)
at net.minecraft.class_327.method_27530(class_327.java:299)
at net.minecraft.class_327.method_1723(class_327.java:147)
at net.minecraft.class_327.method_22942(class_327.java:84)
at net.minecraft.class_332.method_51430(class_332.java:289)
at net.minecraft.class_332.method_35720(class_332.java:285)
at com.terraformersmc.modmenu.gui.widget.DescriptionListWidget$DescriptionEntry.method_25343(DescriptionListWidget.java:338)
at net.minecraft.class_350.method_44397(class_350.java:411)
at net.minecraft.class_350.method_25311(class_350.java:396)
at com.terraformersmc.modmenu.gui.widget.DescriptionListWidget.method_25311(DescriptionListWidget.java:226)
at net.minecraft.class_350.method_48579(class_350.java:184)
at net.minecraft.class_339.method_25394(class_339.java:66)
at com.terraformersmc.modmenu.gui.ModsScreen.method_25394(ModsScreen.java:301)
at net.minecraft.class_437.method_47413(class_437.java:110)
at net.minecraft.class_757.mixinextras$bridge$method_47413$241(class_757.java)
at net.minecraft.class_757.wrapOperation$znj000$fabric-screen-api-v1$onRenderScreen(class_757.java:2611)
at net.minecraft.class_757.method_3192(class_757.java:931)
at net.minecraft.class_310.method_1523(class_310.java:1327)
at net.minecraft.class_310.method_1514(class_310.java:888)
at net.minecraft.client.main.Main.main(Main.java:265)
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470)
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
When a mixin uses one of the target's interface's default methods, any parent class which also implements a method with a matching signature will take the call instead.
In the following situation:
with the following mixin:
You would expect
new B().testCall()
to returnI've got 5
, but it instead throws anAbstractMethodError
:This is caused by the re-parenting Mixin does to correct super calls in mixins preferring the target's parent interfaces over the target's own...
MixinTargetContext#transformMethodRef
will attempt to re-parent anyINVOKESPECIAL
call (that isn't to the mixin's parent class) if the mixin's parent class doesn't match the target's, or if any of the target's parent classes have mixins targeting themMixinTargetContext#updateStaticBinding
sets theTraversal
toSUPER
MixinTargetContext#updateBinding
goes looking for a matching method in the hierarchyClassInfo#findInHierarchy
looks depth first at the parents and their interfaces before checking its ownMixinTargetContext#updateBinding
sets the call to use the implementer of the found method. For our situation, that's the implementer ofIA#method
, i.e.A
This crash can be caused in a Minecraft context by having an empty mixin targeting
FixedColourVertexConsumer
whilst Iris is installed before 1.21. This crash is from opening ModMenu on 1.20.4 for example:Iris's mixin using
BufferVertexConsumer#light
is here.The text was updated successfully, but these errors were encountered: