Minor. Rename TypeMappingMode entries
This commit is contained in:
@@ -321,9 +321,9 @@ public class JetTypeMapper {
|
|||||||
return Type.VOID_TYPE;
|
return Type.VOID_TYPE;
|
||||||
}
|
}
|
||||||
else if (descriptor instanceof FunctionDescriptor && forceBoxedReturnType((FunctionDescriptor) descriptor)) {
|
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
|
//noinspection ConstantConditions
|
||||||
return mapType(descriptor.getReturnType(), sw, TypeMappingMode.TYPE_PARAMETER);
|
return mapType(descriptor.getReturnType(), sw, TypeMappingMode.GENERIC_TYPE);
|
||||||
}
|
}
|
||||||
else if (DescriptorUtils.isAnnotationClass(descriptor.getContainingDeclaration())) {
|
else if (DescriptorUtils.isAnnotationClass(descriptor.getContainingDeclaration())) {
|
||||||
//noinspection ConstantConditions
|
//noinspection ConstantConditions
|
||||||
@@ -346,7 +346,7 @@ public class JetTypeMapper {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public Type mapTypeParameter(@NotNull KotlinType jetType, @Nullable BothSignatureWriter signatureVisitor) {
|
public Type mapTypeParameter(@NotNull KotlinType jetType, @Nullable BothSignatureWriter signatureVisitor) {
|
||||||
return mapType(jetType, signatureVisitor, TypeMappingMode.TYPE_PARAMETER);
|
return mapType(jetType, signatureVisitor, TypeMappingMode.GENERIC_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@@ -441,8 +441,8 @@ public class JetTypeMapper {
|
|||||||
if (signatureVisitor != null) {
|
if (signatureVisitor != null) {
|
||||||
signatureVisitor.writeArrayType();
|
signatureVisitor.writeArrayType();
|
||||||
TypeMappingMode newMode = mode.isForAnnotationParameter() ?
|
TypeMappingMode newMode = mode.isForAnnotationParameter() ?
|
||||||
TypeMappingMode.TYPE_PARAMETER_FOR_ANNOTATION :
|
TypeMappingMode.GENERIC_TYPE_PARAMETER_FOR_ANNOTATION_PARAMETER :
|
||||||
TypeMappingMode.TYPE_PARAMETER;
|
TypeMappingMode.GENERIC_TYPE;
|
||||||
mapType(memberType, signatureVisitor, newMode, memberProjection.getProjectionKind());
|
mapType(memberType, signatureVisitor, newMode, memberProjection.getProjectionKind());
|
||||||
signatureVisitor.writeArrayEnd();
|
signatureVisitor.writeArrayEnd();
|
||||||
}
|
}
|
||||||
@@ -649,7 +649,7 @@ public class JetTypeMapper {
|
|||||||
getEffectiveVariance(parameter.getVariance(), argument.getProjectionKind(), howThisTypeIsUsed, mode);
|
getEffectiveVariance(parameter.getVariance(), argument.getProjectionKind(), howThisTypeIsUsed, mode);
|
||||||
signatureVisitor.writeTypeArgument(projectionKind);
|
signatureVisitor.writeTypeArgument(projectionKind);
|
||||||
|
|
||||||
mapType(argument.getType(), signatureVisitor, TypeMappingMode.TYPE_PARAMETER);
|
mapType(argument.getType(), signatureVisitor, TypeMappingMode.GENERIC_TYPE);
|
||||||
signatureVisitor.writeTypeArgumentEnd();
|
signatureVisitor.writeTypeArgumentEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1151,7 +1151,7 @@ public class JetTypeMapper {
|
|||||||
for (KotlinType jetType : typeParameterDescriptor.getUpperBounds()) {
|
for (KotlinType jetType : typeParameterDescriptor.getUpperBounds()) {
|
||||||
if (jetType.getConstructor().getDeclarationDescriptor() instanceof ClassDescriptor) {
|
if (jetType.getConstructor().getDeclarationDescriptor() instanceof ClassDescriptor) {
|
||||||
if (!isJvmInterface(jetType)) {
|
if (!isJvmInterface(jetType)) {
|
||||||
mapType(jetType, sw, TypeMappingMode.TYPE_PARAMETER);
|
mapType(jetType, sw, TypeMappingMode.GENERIC_TYPE);
|
||||||
break classBound;
|
break classBound;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1169,13 +1169,13 @@ public class JetTypeMapper {
|
|||||||
if (classifier instanceof ClassDescriptor) {
|
if (classifier instanceof ClassDescriptor) {
|
||||||
if (isJvmInterface(jetType)) {
|
if (isJvmInterface(jetType)) {
|
||||||
sw.writeInterfaceBound();
|
sw.writeInterfaceBound();
|
||||||
mapType(jetType, sw, TypeMappingMode.TYPE_PARAMETER);
|
mapType(jetType, sw, TypeMappingMode.GENERIC_TYPE);
|
||||||
sw.writeInterfaceBoundEnd();
|
sw.writeInterfaceBoundEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (classifier instanceof TypeParameterDescriptor) {
|
else if (classifier instanceof TypeParameterDescriptor) {
|
||||||
sw.writeInterfaceBound();
|
sw.writeInterfaceBound();
|
||||||
mapType(jetType, sw, TypeMappingMode.TYPE_PARAMETER);
|
mapType(jetType, sw, TypeMappingMode.GENERIC_TYPE);
|
||||||
sw.writeInterfaceBoundEnd();
|
sw.writeInterfaceBoundEnd();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ internal enum class TypeMappingMode(
|
|||||||
/**
|
/**
|
||||||
* kotlin.Int is mapped to Ljava/lang/Integer;
|
* kotlin.Int is mapped to Ljava/lang/Integer;
|
||||||
*/
|
*/
|
||||||
TYPE_PARAMETER(needPrimitiveBoxing = true),
|
GENERIC_TYPE(needPrimitiveBoxing = true),
|
||||||
/**
|
/**
|
||||||
* kotlin.Int is mapped to Ljava/lang/Integer;
|
* kotlin.Int is mapped to Ljava/lang/Integer;
|
||||||
* No projections allowed in immediate arguments
|
* No projections allowed in immediate arguments
|
||||||
@@ -41,7 +41,7 @@ internal enum class TypeMappingMode(
|
|||||||
VALUE_FOR_ANNOTATION(isForAnnotationParameter = true),
|
VALUE_FOR_ANNOTATION(isForAnnotationParameter = true),
|
||||||
/**
|
/**
|
||||||
* kotlin.reflect.KClass mapped to java.lang.Class
|
* 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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user