Introduce TypeMappingMode.toGenericArgumentMode
This commit is contained in:
@@ -440,10 +440,7 @@ public class JetTypeMapper {
|
||||
arrayElementType = boxType(mapType(memberType, mode));
|
||||
if (signatureVisitor != null) {
|
||||
signatureVisitor.writeArrayType();
|
||||
TypeMappingMode newMode = mode.isForAnnotationParameter() ?
|
||||
TypeMappingMode.GENERIC_TYPE_PARAMETER_FOR_ANNOTATION_PARAMETER :
|
||||
TypeMappingMode.GENERIC_TYPE;
|
||||
mapType(memberType, signatureVisitor, newMode, memberProjection.getProjectionKind());
|
||||
mapType(memberType, signatureVisitor, mode.toGenericArgumentMode());
|
||||
signatureVisitor.writeArrayEnd();
|
||||
}
|
||||
}
|
||||
@@ -649,7 +646,7 @@ public class JetTypeMapper {
|
||||
getEffectiveVariance(parameter.getVariance(), argument.getProjectionKind(), howThisTypeIsUsed, mode);
|
||||
signatureVisitor.writeTypeArgument(projectionKind);
|
||||
|
||||
mapType(argument.getType(), signatureVisitor, TypeMappingMode.GENERIC_TYPE);
|
||||
mapType(argument.getType(), signatureVisitor, mode.toGenericArgumentMode());
|
||||
signatureVisitor.writeTypeArgumentEnd();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,9 @@ internal enum class TypeMappingMode(
|
||||
/**
|
||||
* kotlin.Int is mapped to I
|
||||
*/
|
||||
DEFAULT(),
|
||||
DEFAULT() {
|
||||
override fun toGenericArgumentMode(): TypeMappingMode = GENERIC_TYPE
|
||||
},
|
||||
/**
|
||||
* kotlin.Int is mapped to Ljava/lang/Integer;
|
||||
*/
|
||||
@@ -33,15 +35,21 @@ internal enum class TypeMappingMode(
|
||||
* kotlin.Int is mapped to Ljava/lang/Integer;
|
||||
* No projections allowed in immediate arguments
|
||||
*/
|
||||
SUPER_TYPE(needPrimitiveBoxing = true, writeDeclarationSiteProjections = false),
|
||||
SUPER_TYPE(needPrimitiveBoxing = true, writeDeclarationSiteProjections = false) {
|
||||
override fun toGenericArgumentMode(): TypeMappingMode = GENERIC_TYPE
|
||||
},
|
||||
/**
|
||||
* kotlin.reflect.KClass mapped to java.lang.Class
|
||||
* Other types mapped as DEFAULT
|
||||
*/
|
||||
VALUE_FOR_ANNOTATION(isForAnnotationParameter = true),
|
||||
VALUE_FOR_ANNOTATION(isForAnnotationParameter = true) {
|
||||
override fun toGenericArgumentMode(): TypeMappingMode = GENERIC_TYPE_PARAMETER_FOR_ANNOTATION_PARAMETER
|
||||
},
|
||||
/**
|
||||
* kotlin.reflect.KClass mapped to java.lang.Class
|
||||
* Other types mapped as GENERIC_TYPE
|
||||
*/
|
||||
GENERIC_TYPE_PARAMETER_FOR_ANNOTATION_PARAMETER(isForAnnotationParameter = true, needPrimitiveBoxing = true);
|
||||
|
||||
open fun toGenericArgumentMode(): TypeMappingMode = this
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user