Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@ModifyConstant with boolean return value incorrectly gets reported as an error #2258

Open
ErrorCraft opened this issue Mar 9, 2024 · 0 comments

Comments

@ErrorCraft
Copy link

Minecraft Development for IntelliJ plugin version

2023.2.2-1.7.3

IntelliJ version

IntelliJ IDEA 2023.2.6 (Community Edition)

Operating System

Windows 10

Target platform

Mixins

Description of the bug

A @ModifyConstant with a boolean return value can be used to replace an instanceof check with some other check, but it gets incorrectly reported as two errors: one for the Class return type, and one for the method parameters, the latter being #2231. However, it works just fine and replaces the instanceof check as expected.

Reproducable mixin (yarn mappings):

@Mixin(ArmorFeatureRenderer.class)
public class ArmorFeatureRendererMixin {
    @ModifyConstant(
        method = "renderArmor",
        constant = @Constant(
            classValue = ArmorItem.class,
            ordinal = 0
        )
    )
    private boolean instanceOfArmorItemDoWhatever(Object reference, Class<ArmorItem> clazz) {
        return false;
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant