From ef2bc28463f67b832b38518cf529337a972f3cce Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Thu, 19 Nov 2015 16:40:58 +0300 Subject: [PATCH] Minor. Rename TypeMappingMode entries --- .../kotlin/codegen/state/JetTypeMapper.java | 18 +++++++++--------- .../kotlin/codegen/state/TypeMappingMode.kt | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/JetTypeMapper.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/JetTypeMapper.java index 64780ea477d..e4165aace04 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/JetTypeMapper.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/JetTypeMapper.java @@ -321,9 +321,9 @@ public class JetTypeMapper { return Type.VOID_TYPE; } else if (descriptor instanceof FunctionDescriptor && forceBoxedReturnType((FunctionDescriptor) descriptor)) { - // TYPE_PARAMETER is a hack to automatically box the return type + // GENERIC_TYPE is a hack to automatically box the return type //noinspection ConstantConditions - return mapType(descriptor.getReturnType(), sw, TypeMappingMode.TYPE_PARAMETER); + return mapType(descriptor.getReturnType(), sw, TypeMappingMode.GENERIC_TYPE); } else if (DescriptorUtils.isAnnotationClass(descriptor.getContainingDeclaration())) { //noinspection ConstantConditions @@ -346,7 +346,7 @@ public class JetTypeMapper { @NotNull public Type mapTypeParameter(@NotNull KotlinType jetType, @Nullable BothSignatureWriter signatureVisitor) { - return mapType(jetType, signatureVisitor, TypeMappingMode.TYPE_PARAMETER); + return mapType(jetType, signatureVisitor, TypeMappingMode.GENERIC_TYPE); } @NotNull @@ -441,8 +441,8 @@ public class JetTypeMapper { if (signatureVisitor != null) { signatureVisitor.writeArrayType(); TypeMappingMode newMode = mode.isForAnnotationParameter() ? - TypeMappingMode.TYPE_PARAMETER_FOR_ANNOTATION : - TypeMappingMode.TYPE_PARAMETER; + TypeMappingMode.GENERIC_TYPE_PARAMETER_FOR_ANNOTATION_PARAMETER : + TypeMappingMode.GENERIC_TYPE; mapType(memberType, signatureVisitor, newMode, memberProjection.getProjectionKind()); signatureVisitor.writeArrayEnd(); } @@ -649,7 +649,7 @@ public class JetTypeMapper { getEffectiveVariance(parameter.getVariance(), argument.getProjectionKind(), howThisTypeIsUsed, mode); signatureVisitor.writeTypeArgument(projectionKind); - mapType(argument.getType(), signatureVisitor, TypeMappingMode.TYPE_PARAMETER); + mapType(argument.getType(), signatureVisitor, TypeMappingMode.GENERIC_TYPE); signatureVisitor.writeTypeArgumentEnd(); } } @@ -1151,7 +1151,7 @@ public class JetTypeMapper { for (KotlinType jetType : typeParameterDescriptor.getUpperBounds()) { if (jetType.getConstructor().getDeclarationDescriptor() instanceof ClassDescriptor) { if (!isJvmInterface(jetType)) { - mapType(jetType, sw, TypeMappingMode.TYPE_PARAMETER); + mapType(jetType, sw, TypeMappingMode.GENERIC_TYPE); break classBound; } } @@ -1169,13 +1169,13 @@ public class JetTypeMapper { if (classifier instanceof ClassDescriptor) { if (isJvmInterface(jetType)) { sw.writeInterfaceBound(); - mapType(jetType, sw, TypeMappingMode.TYPE_PARAMETER); + mapType(jetType, sw, TypeMappingMode.GENERIC_TYPE); sw.writeInterfaceBoundEnd(); } } else if (classifier instanceof TypeParameterDescriptor) { sw.writeInterfaceBound(); - mapType(jetType, sw, TypeMappingMode.TYPE_PARAMETER); + mapType(jetType, sw, TypeMappingMode.GENERIC_TYPE); sw.writeInterfaceBoundEnd(); } else { diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/TypeMappingMode.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/TypeMappingMode.kt index a3a1b51b40d..93fc2fd76c7 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/TypeMappingMode.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/TypeMappingMode.kt @@ -28,7 +28,7 @@ internal enum class TypeMappingMode( /** * kotlin.Int is mapped to Ljava/lang/Integer; */ - TYPE_PARAMETER(needPrimitiveBoxing = true), + GENERIC_TYPE(needPrimitiveBoxing = true), /** * kotlin.Int is mapped to Ljava/lang/Integer; * No projections allowed in immediate arguments @@ -41,7 +41,7 @@ internal enum class TypeMappingMode( VALUE_FOR_ANNOTATION(isForAnnotationParameter = true), /** * kotlin.reflect.KClass mapped to java.lang.Class - * Other types mapped as TYPE_PARAMETER + * Other types mapped as GENERIC_TYPE */ - TYPE_PARAMETER_FOR_ANNOTATION(isForAnnotationParameter = true, needPrimitiveBoxing = true); + GENERIC_TYPE_PARAMETER_FOR_ANNOTATION_PARAMETER(isForAnnotationParameter = true, needPrimitiveBoxing = true); }