Use mapping mode for inline class underlying type without wrapping

This commit is contained in:
Dmitry Petrov
2018-08-15 17:01:30 +03:00
parent 06ef8824b6
commit b6e3218ca2
9 changed files with 195 additions and 9 deletions
@@ -107,7 +107,9 @@ class TypeMappingMode private constructor(
if (type.isInlineClassType() && shouldUseUnderlyingType(type)) {
val underlyingType = computeUnderlyingType(type)
if (underlyingType != null) {
return getOptimalModeForSignaturePart(underlyingType, isForAnnotationParameter, canBeUsedInSupertypePosition)
return getOptimalModeForSignaturePart(
underlyingType, isForAnnotationParameter, canBeUsedInSupertypePosition
).dontWrapInlineClassesMode()
}
}
@@ -161,4 +163,10 @@ class TypeMappingMode private constructor(
needPrimitiveBoxing, true, isForAnnotationParameter, skipDeclarationSiteWildcards, skipDeclarationSiteWildcardsIfPossible,
genericArgumentMode, kotlinCollectionsToJavaCollections, genericContravariantArgumentMode, genericInvariantArgumentMode
)
fun dontWrapInlineClassesMode(): TypeMappingMode =
TypeMappingMode(
needPrimitiveBoxing, false, isForAnnotationParameter, skipDeclarationSiteWildcards, skipDeclarationSiteWildcardsIfPossible,
genericArgumentMode, kotlinCollectionsToJavaCollections, genericContravariantArgumentMode, genericInvariantArgumentMode
)
}