diff --git a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalFirJvmCompilerRunnerTestGenerated.java b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalFirJvmCompilerRunnerTestGenerated.java index 5bb809d749b..024a842383e 100644 --- a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalFirJvmCompilerRunnerTestGenerated.java +++ b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalFirJvmCompilerRunnerTestGenerated.java @@ -1350,6 +1350,11 @@ public class IncrementalFirJvmCompilerRunnerTestGenerated extends AbstractIncrem runTest("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/notChangeSignature/"); } + @TestMetadata("rawErrorTypeDuringSerialization") + public void testRawErrorTypeDuringSerialization() throws Exception { + runTest("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization/"); + } + @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeFieldType") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -1597,6 +1602,19 @@ public class IncrementalFirJvmCompilerRunnerTestGenerated extends AbstractIncrem } } + @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class RawErrorTypeDuringSerialization extends AbstractIncrementalFirJvmCompilerRunnerTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInRawErrorTypeDuringSerialization() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + } + } + @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJvmCompilerRunnerTestGenerated.java b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJvmCompilerRunnerTestGenerated.java index a01ca08daee..47f5a1e922e 100644 --- a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJvmCompilerRunnerTestGenerated.java +++ b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJvmCompilerRunnerTestGenerated.java @@ -1350,6 +1350,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement runTest("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/notChangeSignature/"); } + @TestMetadata("rawErrorTypeDuringSerialization") + public void testRawErrorTypeDuringSerialization() throws Exception { + runTest("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization/"); + } + @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeFieldType") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -1597,6 +1602,19 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement } } + @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class RawErrorTypeDuringSerialization extends AbstractIncrementalJvmCompilerRunnerTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInRawErrorTypeDuringSerialization() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + } + } + @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJvmOldBackendCompilerRunnerTestGenerated.java b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJvmOldBackendCompilerRunnerTestGenerated.java index 9230da3da0d..028f6f50fb7 100644 --- a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJvmOldBackendCompilerRunnerTestGenerated.java +++ b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJvmOldBackendCompilerRunnerTestGenerated.java @@ -1350,6 +1350,11 @@ public class IncrementalJvmOldBackendCompilerRunnerTestGenerated extends Abstrac runTest("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/notChangeSignature/"); } + @TestMetadata("rawErrorTypeDuringSerialization") + public void testRawErrorTypeDuringSerialization() throws Exception { + runTest("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization/"); + } + @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeFieldType") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -1597,6 +1602,19 @@ public class IncrementalJvmOldBackendCompilerRunnerTestGenerated extends Abstrac } } + @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class RawErrorTypeDuringSerialization extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInRawErrorTypeDuringSerialization() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + } + } + @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/testData/loadJava/compiledJava/signaturePropagation/RawSuperTypeWithRecursiveBound.txt b/compiler/testData/loadJava/compiledJava/signaturePropagation/RawSuperTypeWithRecursiveBound.txt index 3f2722c4648..d853d82afef 100644 --- a/compiler/testData/loadJava/compiledJava/signaturePropagation/RawSuperTypeWithRecursiveBound.txt +++ b/compiler/testData/loadJava/compiledJava/signaturePropagation/RawSuperTypeWithRecursiveBound.txt @@ -3,7 +3,7 @@ package test public open class RawSuperTypeWithRecursiveBound { public constructor RawSuperTypeWithRecursiveBound() - public open inner class Derived : test.RawSuperTypeWithRecursiveBound.Super<(raw) *> { + public open inner class Derived : test.RawSuperTypeWithRecursiveBound.Super<(raw) test.RawSuperTypeWithRecursiveBound.Super<*>!> { public constructor Derived() public open override /*1*/ fun dummy(): kotlin.Unit public open fun foo(/*0*/ p0: kotlin.Any!): kotlin.Unit diff --git a/compiler/testData/loadJava/compiledJava/signaturePropagation/RawSuperTypeWithRecursiveBoundMultipleParameters.txt b/compiler/testData/loadJava/compiledJava/signaturePropagation/RawSuperTypeWithRecursiveBoundMultipleParameters.txt index 9123ed9580b..392e03bf864 100644 --- a/compiler/testData/loadJava/compiledJava/signaturePropagation/RawSuperTypeWithRecursiveBoundMultipleParameters.txt +++ b/compiler/testData/loadJava/compiledJava/signaturePropagation/RawSuperTypeWithRecursiveBoundMultipleParameters.txt @@ -3,7 +3,7 @@ package test public open class RawSuperTypeWithRecursiveBoundMultipleParameters { public constructor RawSuperTypeWithRecursiveBoundMultipleParameters() - public open inner class Derived : test.RawSuperTypeWithRecursiveBoundMultipleParameters.Super<(raw) kotlin.Any!, (raw) *> { + public open inner class Derived : test.RawSuperTypeWithRecursiveBoundMultipleParameters.Super<(raw) kotlin.Any!, (raw) test.RawSuperTypeWithRecursiveBoundMultipleParameters.Super<*, *>!> { public constructor Derived() public open override /*1*/ fun dummy(): kotlin.Unit public open fun foo(/*0*/ p0: kotlin.Any!, /*1*/ p1: kotlin.Any!): kotlin.Unit diff --git a/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/signatureEnhancement.kt b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/signatureEnhancement.kt index 63aaa549c70..d8f6963c63a 100644 --- a/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/signatureEnhancement.kt +++ b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/signatureEnhancement.kt @@ -252,7 +252,10 @@ class SignatureEnhancement( * class A extends B<@NotNull Integer> {} */ fun enhanceSuperType(type: KotlinType, context: LazyJavaResolverContext) = - SignatureParts(null, type, emptyList(), false, context, AnnotationQualifierApplicabilityType.TYPE_USE).enhance().type + SignatureParts( + typeContainer = null, type, emptyList(), isCovariant = false, + context, AnnotationQualifierApplicabilityType.TYPE_USE, isSuperTypesEnhancement = true + ).enhance().type private inner class SignatureParts( private val typeContainer: Annotated?, @@ -261,7 +264,8 @@ class SignatureEnhancement( private val isCovariant: Boolean, private val containerContext: LazyJavaResolverContext, private val containerApplicabilityType: AnnotationQualifierApplicabilityType, - private val typeParameterBounds: Boolean = false + private val typeParameterBounds: Boolean = false, + private val isSuperTypesEnhancement: Boolean = false ) { private val isForVarargParameter get() = typeContainer.safeAs()?.varargElementType != null @@ -275,15 +279,21 @@ class SignatureEnhancement( } } - val containsFunctionN = TypeUtils.contains(fromOverride) { - val classifier = it.constructor.declarationDescriptor ?: return@contains false + fun containsFunctionN(type: UnwrappedType): Boolean { + val classifier = type.constructor.declarationDescriptor ?: return false - classifier.name == JavaToKotlinClassMap.FUNCTION_N_FQ_NAME.shortName() && + return classifier.name == JavaToKotlinClassMap.FUNCTION_N_FQ_NAME.shortName() && classifier.fqNameOrNull() == JavaToKotlinClassMap.FUNCTION_N_FQ_NAME } + val containsFunctionN = if (isSuperTypesEnhancement) { + TypeUtils.containsStoppingAt(fromOverride, ::containsFunctionN) { it is RawType } + } else { + TypeUtils.contains(fromOverride, ::containsFunctionN) + } + return with(typeEnhancement) { - fromOverride.enhance(qualifiersWithPredefined ?: qualifiers)?.let { enhanced -> + fromOverride.enhance(qualifiersWithPredefined ?: qualifiers, isSuperTypesEnhancement)?.let { enhanced -> PartEnhancementResult(enhanced, wereChanges = true, containsFunctionN = containsFunctionN) } ?: PartEnhancementResult(fromOverride, wereChanges = false, containsFunctionN = containsFunctionN) } @@ -531,6 +541,8 @@ class SignatureEnhancement( ) ) + if (isSuperTypesEnhancement && type is RawType) return + for ((arg, parameter) in type.arguments.zip(type.constructor.parameters)) { if (arg.isStarProjection) { // TODO: sort out how to handle wildcards diff --git a/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/typeEnhancement.kt b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/typeEnhancement.kt index 63df012d8c3..bc8341fb574 100644 --- a/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/typeEnhancement.kt +++ b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/typeEnhancement.kt @@ -52,15 +52,24 @@ class JavaTypeEnhancement(private val javaResolverSettings: JavaResolverSettings // Example: for `A>`, indices go as follows: `0 - A<...>, 1 - B, 2 - C, 3 - D, 4 - E`, // which corresponds to the left-to-right breadth-first walk of the tree representation of the type. // For flexible types, both bounds are indexed in the same way: `(A..C)` gives `0 - (A..C), 1 - B and D`. - fun KotlinType.enhance(qualifiers: (Int) -> JavaTypeQualifiers) = unwrap().enhancePossiblyFlexible(qualifiers, 0).type + fun KotlinType.enhance(qualifiers: (Int) -> JavaTypeQualifiers, isSuperTypesEnhancement: Boolean = false) = + unwrap().enhancePossiblyFlexible(qualifiers, 0, isSuperTypesEnhancement).type - private fun UnwrappedType.enhancePossiblyFlexible(qualifiers: (Int) -> JavaTypeQualifiers, index: Int): Result { + private fun UnwrappedType.enhancePossiblyFlexible( + qualifiers: (Int) -> JavaTypeQualifiers, + index: Int, + isSuperTypesEnhancement: Boolean = false + ): Result { if (isError) return Result(null, 1) return when (this) { is FlexibleType -> { val isRawType = this is RawType - val lowerResult = lowerBound.enhanceInflexible(qualifiers, index, TypeComponentPosition.FLEXIBLE_LOWER, isRawType) - val upperResult = upperBound.enhanceInflexible(qualifiers, index, TypeComponentPosition.FLEXIBLE_UPPER, isRawType) + val lowerResult = lowerBound.enhanceInflexible( + qualifiers, index, TypeComponentPosition.FLEXIBLE_LOWER, isRawType, isSuperTypesEnhancement + ) + val upperResult = upperBound.enhanceInflexible( + qualifiers, index, TypeComponentPosition.FLEXIBLE_UPPER, isRawType, isSuperTypesEnhancement + ) assert(lowerResult.subtreeSize == upperResult.subtreeSize) { "Different tree sizes of bounds: " + "lower = ($lowerBound, ${lowerResult.subtreeSize}), " + @@ -80,7 +89,9 @@ class JavaTypeEnhancement(private val javaResolverSettings: JavaResolverSettings Result(type, lowerResult.subtreeSize) } is SimpleType -> { - val result = enhanceInflexible(qualifiers, index, TypeComponentPosition.INFLEXIBLE) + val result = enhanceInflexible( + qualifiers, index, TypeComponentPosition.INFLEXIBLE, isSuperTypesEnhancement = isSuperTypesEnhancement + ) Result(if (result.forWarnings) wrapEnhancement(result.type) else result.type, result.subtreeSize) } } @@ -90,7 +101,8 @@ class JavaTypeEnhancement(private val javaResolverSettings: JavaResolverSettings qualifiers: (Int) -> JavaTypeQualifiers, index: Int, position: TypeComponentPosition, - isBoundOfRawType: Boolean = false + isBoundOfRawType: Boolean = false, + isSuperTypesEnhancement: Boolean = false ): SimpleResult { val shouldEnhance = position.shouldEnhance() if (!shouldEnhance && arguments.isEmpty()) return SimpleResult(null, 1, false) @@ -105,24 +117,29 @@ class JavaTypeEnhancement(private val javaResolverSettings: JavaResolverSettings var globalArgIndex = index + 1 var wereChanges = enhancedMutabilityAnnotations != null - val enhancedArguments = arguments.mapIndexed { localArgIndex, arg -> - if (arg.isStarProjection) { - val qualifiersForStarProjection = qualifiers(globalArgIndex) - globalArgIndex++ + val enhancedArguments = if (!isSuperTypesEnhancement || !isBoundOfRawType) { + arguments.mapIndexed { localArgIndex, arg -> + if (arg.isStarProjection) { + val qualifiersForStarProjection = qualifiers(globalArgIndex) + globalArgIndex++ - if (qualifiersForStarProjection.nullability == NOT_NULL && !isBoundOfRawType) { - val enhanced = arg.type.unwrap().makeNotNullable() - createProjection(enhanced, arg.projectionKind, typeParameterDescriptor = typeConstructor.parameters[localArgIndex]) + if (qualifiersForStarProjection.nullability == NOT_NULL && !isBoundOfRawType) { + val enhanced = arg.type.unwrap().makeNotNullable() + createProjection(enhanced, arg.projectionKind, typeParameterDescriptor = typeConstructor.parameters[localArgIndex]) + } else { + TypeUtils.makeStarProjection(enhancedClassifier.typeConstructor.parameters[localArgIndex]) + } } else { - TypeUtils.makeStarProjection(enhancedClassifier.typeConstructor.parameters[localArgIndex]) - } - } else { - val unwrapped = arg.type.unwrap() - val enhanced = unwrapped.enhancePossiblyFlexible(qualifiers, globalArgIndex) - globalArgIndex += enhanced.subtreeSize - val type = enhanced.type?.also { wereChanges = true } ?: unwrapped + val unwrapped = arg.type.unwrap() + val enhanced = unwrapped.enhancePossiblyFlexible(qualifiers, globalArgIndex, isSuperTypesEnhancement) + globalArgIndex += enhanced.subtreeSize + val type = enhanced.type?.also { wereChanges = true } ?: unwrapped createProjection(type, arg.projectionKind, typeParameterDescriptor = typeConstructor.parameters[localArgIndex]) + } } + } else { + globalArgIndex += arguments.size + arguments } val (enhancedNullability, enhancedNullabilityAnnotations) = this.getEnhancedNullability(effectiveQualifiers, position) diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/TypeUtils.java b/core/descriptors/src/org/jetbrains/kotlin/types/TypeUtils.java index c6b1d244c70..6c29ca117d8 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/TypeUtils.java +++ b/core/descriptors/src/org/jetbrains/kotlin/types/TypeUtils.java @@ -425,12 +425,21 @@ public class TypeUtils { @Nullable KotlinType type, @NotNull Function1 isSpecialType ) { - return contains(type, isSpecialType, null); + return contains(type, isSpecialType, null, null); + } + + public static boolean containsStoppingAt( + @Nullable KotlinType type, + @NotNull Function1 isSpecialType, + @NotNull Function1 shouldStopAt + ) { + return contains(type, isSpecialType, shouldStopAt, null); } private static boolean contains( @Nullable KotlinType type, @NotNull Function1 isSpecialType, + @Nullable Function1 shouldStopAt, SmartSet visited ) { if (type == null) return false; @@ -440,6 +449,7 @@ public class TypeUtils { if (noExpectedType(type)) return isSpecialType.invoke(unwrappedType); if (visited != null && visited.contains(type)) return false; if (isSpecialType.invoke(unwrappedType)) return true; + if (shouldStopAt != null && shouldStopAt.invoke(unwrappedType)) return false; if (visited == null) { visited = SmartSet.create(); @@ -448,12 +458,13 @@ public class TypeUtils { FlexibleType flexibleType = unwrappedType instanceof FlexibleType ? (FlexibleType) unwrappedType : null; if (flexibleType != null - && (contains(flexibleType.getLowerBound(), isSpecialType, visited) || contains(flexibleType.getUpperBound(), isSpecialType, visited))) { + && (contains(flexibleType.getLowerBound(), isSpecialType, shouldStopAt, visited) + || contains(flexibleType.getUpperBound(), isSpecialType, shouldStopAt, visited))) { return true; } if (unwrappedType instanceof DefinitelyNotNullType && - contains(((DefinitelyNotNullType) unwrappedType).getOriginal(), isSpecialType, visited)) { + contains(((DefinitelyNotNullType) unwrappedType).getOriginal(), isSpecialType, shouldStopAt, visited)) { return true; } @@ -461,13 +472,14 @@ public class TypeUtils { if (typeConstructor instanceof IntersectionTypeConstructor) { IntersectionTypeConstructor intersectionTypeConstructor = (IntersectionTypeConstructor) typeConstructor; for (KotlinType supertype : intersectionTypeConstructor.getSupertypes()) { - if (contains(supertype, isSpecialType, visited)) return true; + if (contains(supertype, isSpecialType, shouldStopAt, visited)) return true; } return false; } for (TypeProjection projection : type.getArguments()) { - if (!projection.isStarProjection() && contains(projection.getType(), isSpecialType, visited)) return true; + if (projection.isStarProjection()) continue; + if (contains(projection.getType(), isSpecialType, shouldStopAt, visited)) return true; } return false; } diff --git a/jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization/Bar.java b/jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization/Bar.java new file mode 100644 index 00000000000..fc96c9d3658 --- /dev/null +++ b/jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization/Bar.java @@ -0,0 +1,2 @@ +class Bar { +} \ No newline at end of file diff --git a/jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization/Foo.java b/jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization/Foo.java new file mode 100644 index 00000000000..93165fee779 --- /dev/null +++ b/jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization/Foo.java @@ -0,0 +1,27 @@ +// WITH_RUNTIME +// TARGET_BACKEND: JVM + +/* + ServletOpenApiContextBuilder< + T : raw ( + ServletOpenApiContextBuilder> + .. + ServletOpenApiContextBuilder>? + ) + > + : GenericOpenApiContextBuilder< + raw ( + ServletOpenApiContextBuilder<[ERROR : ]> // exception on this error type during serialization + .. + ServletOpenApiContextBuilder<*>? + ) + > + */ +public class Foo extends Bar { + String ctxId = ""; + + public T ctxId(String ctxId) { + this.ctxId = ctxId; + return (T) this; + } +} diff --git a/jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization/Foo.java.new b/jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization/Foo.java.new new file mode 100644 index 00000000000..352f82b7016 --- /dev/null +++ b/jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization/Foo.java.new @@ -0,0 +1,11 @@ +// WITH_RUNTIME +// TARGET_BACKEND: JVM + +public class Foo extends Bar { + String ctxId = ""; + + public T ctxId(String ctxId) { + this.ctxId = ctxId; + return (T) this; + } +} diff --git a/jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization/build.log b/jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization/build.log new file mode 100644 index 00000000000..c2381f800c9 --- /dev/null +++ b/jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization/build.log @@ -0,0 +1,6 @@ +================ Step #1 ================= + +Compiling files: +End of files +Exit code: OK + diff --git a/jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization/fir-build.log b/jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization/fir-build.log new file mode 100644 index 00000000000..9d5e0adc049 --- /dev/null +++ b/jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization/fir-build.log @@ -0,0 +1,7 @@ +================ Step #1 ================= + +Compiling files: + src/main.kt +End of files +Exit code: OK + diff --git a/jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization/main.kt b/jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization/main.kt new file mode 100644 index 00000000000..d75a347234f --- /dev/null +++ b/jps-plugin/testData/incremental/withJava/javaUsedInKotlin/rawErrorTypeDuringSerialization/main.kt @@ -0,0 +1,7 @@ +class Main { + fun init() { + Foo>() //this is the call that causes the build exception, if you comment it out everything works fine + .ctxId("") + } +} +fun box() = "OK" \ No newline at end of file