-
Notifications
You must be signed in to change notification settings - Fork 199
Open
Description
Minecraft Development for IntelliJ plugin version
2025.2-1.8.6
Description of the feature request
Interface injection has a problem where if javac can't find the implementation of the method it is calling at compile time, and the owner of the method isn't abstract, then a compile error is generated. The IDE does not pick up this error, so users only discover it at runtime and are often confused about how to solve it. For example:
public class Item implements /*injected*/ MyItemInterface {
// ...
}
public interface MyItemInterface {
void foo(); // no default method impl
}
@Mixin(Item.class)
public class ItemMixin implements MyItemInterface {
@Override
public void foo() {
// method is implemented in mixin
}
}Item item = ...;
item.foo(); // generates a compile error in javac, but the IDE does not pick it upEven though no crash would happen at runtime, javac cannot detect that the foo method is in fact implemented by the mixin. Note that this would not occur if the Item class was abstract, as this disables javac's check for whether the method implementation exists.