Move staticness check for mixin field after unique check, closes #576

This commit is contained in:
Mumfrey committed 2024-05-12 23:39:40 +01:00
1 parent 480bd3d9e5
commit d2d1fbc6f4
1 file changed
+5 -5
@@ -633,11 +633,6 @@ class MixinPreProcessorStandard {
mixinField.name = field.renameTo(target.name);
}
if (!Bytecode.compareFlags(mixinField, target, Opcodes.ACC_STATIC)) {
throw new InvalidMixinException(this.mixin, String.format("STATIC modifier of @Shadow field %s in %s does not match the target",
mixinField.name, this.mixin));
}
if (field.isUnique()) {
if ((mixinField.access & (Opcodes.ACC_PRIVATE | Opcodes.ACC_PROTECTED)) != 0) {
String uniqueName = context.getUniqueName(mixinField);
@@ -659,6 +654,11 @@ class MixinPreProcessorStandard {
continue;
}
if (!Bytecode.compareFlags(mixinField, target, Opcodes.ACC_STATIC)) {
throw new InvalidMixinException(this.mixin, String.format("STATIC modifier of @Shadow field %s in %s does not match the target",
mixinField.name, this.mixin));
}
// Check that the shadow field has a matching descriptor
if (!target.desc.equals(mixinField.desc)) {
throw new InvalidMixinException(this.mixin, String.format("The field %s in the target class has a conflicting signature",