From d42cbde74de63d540be638255112a47c886c8879 Mon Sep 17 00:00:00 2001 From: Alexey Tsvetkov Date: Wed, 24 Jun 2015 15:44:09 +0300 Subject: [PATCH] JS/RTTI: (minor) fixed typo --- .../org/jetbrains/kotlin/types/CastDiagnosticsUtil.java | 2 +- .../src/org/jetbrains/kotlin/types/TypeUtils.java | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) 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(); }