diff --git a/compiler/frontend/src/org/jetbrains/kotlin/types/CastDiagnosticsUtil.java b/compiler/frontend/src/org/jetbrains/kotlin/types/CastDiagnosticsUtil.java index d98906b06cb..178ba33a131 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/types/CastDiagnosticsUtil.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/types/CastDiagnosticsUtil.java @@ -120,7 +120,7 @@ public class CastDiagnosticsUtil { if (typeChecker.isSubtypeOf(supertype, subtype)) return false; // downcasting to a non-reified type parameter is always erased - if (TypeUtils.isNonReifiedTypeParemeter(subtype)) return true; + if (TypeUtils.isNonReifiedTypeParameter(subtype)) return true; // Check that we are actually casting to a generic type // NOTE: this does not account for 'as Array>' diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/TypeUtils.java b/core/descriptors/src/org/jetbrains/kotlin/types/TypeUtils.java index 75826b36f2f..9ab5eb12ad1 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/TypeUtils.java +++ b/core/descriptors/src/org/jetbrains/kotlin/types/TypeUtils.java @@ -490,7 +490,12 @@ public class TypeUtils { return getTypeParameterDescriptorOrNull(type) != null; } - public static boolean isNonReifiedTypeParemeter(@NotNull KotlinType type) { + public static boolean isReifiedTypeParameter(@NotNull KotlinType type) { + TypeParameterDescriptor typeParameterDescriptor = getTypeParameterDescriptorOrNull(type); + return typeParameterDescriptor != null && typeParameterDescriptor.isReified(); + } + + public static boolean isNonReifiedTypeParameter(@NotNull KotlinType type) { TypeParameterDescriptor typeParameterDescriptor = getTypeParameterDescriptorOrNull(type); return typeParameterDescriptor != null && !typeParameterDescriptor.isReified(); }