diff --git a/src/main/kotlin/platform/mixin/handlers/mixinextras/WrapWithConditionHandler.kt b/src/main/kotlin/platform/mixin/handlers/mixinextras/WrapWithConditionHandler.kt index 408fd7448..cb54352df 100644 --- a/src/main/kotlin/platform/mixin/handlers/mixinextras/WrapWithConditionHandler.kt +++ b/src/main/kotlin/platform/mixin/handlers/mixinextras/WrapWithConditionHandler.kt @@ -23,6 +23,7 @@ package com.demonwav.mcdev.platform.mixin.handlers.mixinextras import com.demonwav.mcdev.platform.mixin.inspection.injector.ParameterGroup import com.intellij.psi.PsiAnnotation import com.intellij.psi.PsiType +import com.intellij.psi.PsiTypes import org.objectweb.asm.Type import org.objectweb.asm.tree.AbstractInsnNode import org.objectweb.asm.tree.ClassNode @@ -44,6 +45,6 @@ class WrapWithConditionHandler : MixinExtrasInjectorAnnotationHandler() { insn: AbstractInsnNode ): Pair? { val params = getPsiParameters(insn, targetClass, annotation) ?: return null - return ParameterGroup(params) to PsiType.BOOLEAN + return ParameterGroup(params) to PsiTypes.booleanType() } } diff --git a/src/main/kotlin/platform/mixin/inspection/injector/InjectCouldBeOverwriteInspection.kt b/src/main/kotlin/platform/mixin/inspection/injector/InjectCouldBeOverwriteInspection.kt index 9d96a33dc..e0ff25791 100644 --- a/src/main/kotlin/platform/mixin/inspection/injector/InjectCouldBeOverwriteInspection.kt +++ b/src/main/kotlin/platform/mixin/inspection/injector/InjectCouldBeOverwriteInspection.kt @@ -72,7 +72,7 @@ import com.intellij.psi.PsiMethodCallExpression import com.intellij.psi.PsiParameter import com.intellij.psi.PsiParameterList import com.intellij.psi.PsiReturnStatement -import com.intellij.psi.PsiType +import com.intellij.psi.PsiTypes import com.intellij.psi.codeStyle.VariableKind import com.intellij.psi.impl.light.LightParameter import com.intellij.psi.search.LocalSearchScope @@ -149,7 +149,7 @@ class InjectCouldBeOverwriteInspection : MixinInspection() { memState.applyCondition(ciVar.eq(stableCiVar)) val isCancelledVar = PlainDescriptor.createVariableValue( factory, - LightParameter("isCancelled", PsiType.BOOLEAN, methodBody) + LightParameter("isCancelled", PsiTypes.booleanType(), methodBody) ) memState.setVarValue(isCancelledVar, falseValue) diff --git a/src/main/kotlin/platform/mixin/util/Mixin.kt b/src/main/kotlin/platform/mixin/util/Mixin.kt index fab55e079..2b522a7b5 100644 --- a/src/main/kotlin/platform/mixin/util/Mixin.kt +++ b/src/main/kotlin/platform/mixin/util/Mixin.kt @@ -44,6 +44,7 @@ import com.intellij.psi.PsiMethod import com.intellij.psi.PsiParameter import com.intellij.psi.PsiPrimitiveType import com.intellij.psi.PsiType +import com.intellij.psi.PsiTypes import com.intellij.psi.search.GlobalSearchScope import com.intellij.psi.util.InheritanceUtil import com.intellij.psi.util.PsiModificationTracker @@ -165,7 +166,7 @@ fun isAssignable(left: PsiType, right: PsiType, allowPrimitiveConversion: Boolea left is PsiArrayType -> right is PsiArrayType && isAssignable(left.componentType, right.componentType) else -> { if (left !is PsiClassType || right !is PsiClassType) { - if (right == PsiType.NULL && left !is PsiPrimitiveType) { + if (right == PsiTypes.nullType() && left !is PsiPrimitiveType) { return true } if (!allowPrimitiveConversion && (left is PsiPrimitiveType || right is PsiPrimitiveType)) {