diff --git a/plugins/kapt3/kapt3-compiler/src/org/jetbrains/kotlin/kapt3/stubs/ClassFileToSourceStubConverter.kt b/plugins/kapt3/kapt3-compiler/src/org/jetbrains/kotlin/kapt3/stubs/ClassFileToSourceStubConverter.kt index 0125a1b5711..6bc5314be96 100644 --- a/plugins/kapt3/kapt3-compiler/src/org/jetbrains/kotlin/kapt3/stubs/ClassFileToSourceStubConverter.kt +++ b/plugins/kapt3/kapt3-compiler/src/org/jetbrains/kotlin/kapt3/stubs/ClassFileToSourceStubConverter.kt @@ -29,6 +29,7 @@ import org.jetbrains.kotlin.base.kapt3.KaptFlag import org.jetbrains.kotlin.builtins.StandardNames import org.jetbrains.kotlin.codegen.AsmUtil import org.jetbrains.kotlin.codegen.coroutines.CONTINUATION_PARAMETER_NAME +import org.jetbrains.kotlin.codegen.coroutines.SUSPEND_FUNCTION_COMPLETION_PARAMETER_NAME import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor import org.jetbrains.kotlin.descriptors.annotations.Annotations @@ -1122,7 +1123,7 @@ class ClassFileToSourceStubConverter(val kaptContext: KaptContextForStubGenerati val containingCallable = descriptor.containingDeclaration return containingCallable.valueParameters.lastOrNull() == descriptor - && descriptor.name == CONTINUATION_PARAMETER_NAME + && (descriptor.name == CONTINUATION_PARAMETER_NAME || descriptor.name.asString() == SUSPEND_FUNCTION_COMPLETION_PARAMETER_NAME) && descriptor.source == SourceElement.NO_SOURCE && descriptor.type.constructor.declarationDescriptor?.fqNameSafe == StandardNames.CONTINUATION_INTERFACE_FQ_NAME } diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/suspendErrorTypes.kt b/plugins/kapt3/kapt3-compiler/testData/converter/suspendErrorTypes.kt index a1f3dc171ee..c8c08d8f757 100644 --- a/plugins/kapt3/kapt3-compiler/testData/converter/suspendErrorTypes.kt +++ b/plugins/kapt3/kapt3-compiler/testData/converter/suspendErrorTypes.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR // CORRECT_ERROR_TYPES // NO_VALIDATION // WITH_STDLIB diff --git a/plugins/kapt3/kapt3-compiler/testData/converter/suspendErrorTypes_ir.txt b/plugins/kapt3/kapt3-compiler/testData/converter/suspendErrorTypes_ir.txt new file mode 100644 index 00000000000..5f10c1ac8f5 --- /dev/null +++ b/plugins/kapt3/kapt3-compiler/testData/converter/suspendErrorTypes_ir.txt @@ -0,0 +1,13 @@ +@kotlin.Metadata() +public final class Foo { + + public Foo() { + super(); + } + + @org.jetbrains.annotations.Nullable() + public final java.lang.Object a(@org.jetbrains.annotations.NotNull() + kotlin.coroutines.Continuation $completion) { + return null; + } +}