Flexible types for primitive arrays
This commit is contained in:
@@ -2,5 +2,5 @@ package test
|
|||||||
|
|
||||||
public open class NotNullIntArray {
|
public open class NotNullIntArray {
|
||||||
public constructor NotNullIntArray()
|
public constructor NotNullIntArray()
|
||||||
public open fun hi(): kotlin.IntArray
|
public open fun hi(): kotlin.IntArray!
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-1
@@ -59,7 +59,11 @@ class LazyJavaTypeResolver(
|
|||||||
val javaComponentType = arrayType.getComponentType()
|
val javaComponentType = arrayType.getComponentType()
|
||||||
if (javaComponentType is JavaPrimitiveType) {
|
if (javaComponentType is JavaPrimitiveType) {
|
||||||
val jetType = JavaToKotlinClassMap.getInstance().mapPrimitiveKotlinClass("[" + javaComponentType.getCanonicalText())
|
val jetType = JavaToKotlinClassMap.getInstance().mapPrimitiveKotlinClass("[" + javaComponentType.getCanonicalText())
|
||||||
if (jetType != null) return TypeUtils.makeNullableAsSpecified(jetType, !attr.isMarkedNotNull)
|
if (jetType != null) {
|
||||||
|
return if (PLATFORM_TYPES && attr.allowFlexible)
|
||||||
|
DelegatingFlexibleType(jetType, TypeUtils.makeNullable(jetType))
|
||||||
|
else TypeUtils.makeNullableAsSpecified(jetType, !attr.isMarkedNotNull)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val projectionKind = if (attr.howThisTypeIsUsed == MEMBER_SIGNATURE_CONTRAVARIANT && !isVararg) OUT_VARIANCE else INVARIANT
|
val projectionKind = if (attr.howThisTypeIsUsed == MEMBER_SIGNATURE_CONTRAVARIANT && !isVararg) OUT_VARIANCE else INVARIANT
|
||||||
|
|||||||
Reference in New Issue
Block a user