diff --git a/compiler/testData/loadJava/compiledJava/notNull/NotNullIntArray.txt b/compiler/testData/loadJava/compiledJava/notNull/NotNullIntArray.txt index 78ebd40404b..3d622bcfffd 100644 --- a/compiler/testData/loadJava/compiledJava/notNull/NotNullIntArray.txt +++ b/compiler/testData/loadJava/compiledJava/notNull/NotNullIntArray.txt @@ -2,5 +2,5 @@ package test public open class NotNullIntArray { public constructor NotNullIntArray() - public open fun hi(): kotlin.IntArray + public open fun hi(): kotlin.IntArray! } diff --git a/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/java/lazy/types/LazyJavaTypeResolver.kt b/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/java/lazy/types/LazyJavaTypeResolver.kt index e3b90dd87ba..b8bfcb26777 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/java/lazy/types/LazyJavaTypeResolver.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/java/lazy/types/LazyJavaTypeResolver.kt @@ -59,7 +59,11 @@ class LazyJavaTypeResolver( val javaComponentType = arrayType.getComponentType() if (javaComponentType is JavaPrimitiveType) { 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