@Contract(value = "null -> null", pure = true)
  public static @Nullable PsiType getPatternType(@Nullable PsiCaseLabelElement pattern) {
    PsiTypeElement typeElement = getPatternTypeElement(pattern);
    if (typeElement == null) return null;
    return typeElement.getType();
  }
@Contract(value = "null -> null", pure = true)
  public static @Nullable PsiType getPatternType(@Nullable PsiCaseLabelElement pattern)