MinecraftDev icon indicating copy to clipboard operation
MinecraftDev copied to clipboard

Invalid injector method signature inspection is not supressed by @Coerce

Open tildejustin opened this issue 2 years ago • 0 comments

Minecraft Development for IntelliJ plugin version

2023.3-1.6.12-443

IntelliJ version

2023.3.2

Operating System

EndeavorOS Linux, kernel 6.6.8-arch1-1

Target platform

Mixins

Description of the bug

source: https://github.com/tildejustin/voyager/blob/mixin-extras/src%2Fmain%2Fjava%2Fme%2Fmodmuss50%2Fvoyager%2Fmixin%2FStructureManagerMixin.java

image

Maps.<Identifier, Structure>newHashMap(), which returns a HashMap<Identifier, Structure> is assigned to StructureManager#structures, which is just a Map<Identifier, Structure>. Without the @Coerce the error is correct as Mixin throws a ClassCastException when it finds that it can't cast a SyncronizedMap to a HashMap, but @Coerce bypasses this cast and thus the inspection is incorrect in this case.

tildejustin avatar Jan 01 '24 01:01 tildejustin