boolean (@NotNull PsiCaseLabelElement who, @Nullable PsiType overWhom) { if (overWhom == null) return false; if (PsiUtil.getLanguageLevel(who) != LanguageLevel.JDK_20_PREVIEW){ who = findUnconditionalPattern(who); } PsiType whoType = TypeConversionUtil.erasure(getPatternType(who)); if (whoType == null) return false; PsiType overWhomType = null; if (overWhom instanceof PsiPrimitiveType) { overWhomType = ((PsiPrimitiveType)overWhom).getBoxedType(who); } else if (overWhom instanceof PsiClassType) { overWhomType = overWhom; } return overWhomType != null && TypeConversionUtil.areTypesConvertible(overWhomType, whoType); }