From 9a4742c08d5c27cad43fcb1cb69951a4c9dd0a9c Mon Sep 17 00:00:00 2001 From: Mark Punzalan Date: Thu, 8 Apr 2021 09:35:10 +0000 Subject: [PATCH] FIR: Properly build nullable suspend function types, and aggregate modifiers and annotations within KtTypeReference/REFERENCE_TYPE nodes. --- .../FirBlackBoxCodegenTestGenerated.java | 12 +++ .../converter/DeclarationsConverter.kt | 73 +++++++++++++------ ...ghtTree2FirConverterTestCaseGenerated.java | 20 +++++ .../kotlin/fir/builder/RawFirBuilder.kt | 39 ++++++++-- ...annotationsOnNullableParenthesizedTypes.kt | 27 +++++++ ...nNullableParenthesizedTypes.lazyBodies.txt | 37 ++++++++++ ...nnotationsOnNullableParenthesizedTypes.txt | 40 ++++++++++ .../annotationsOnParenthesizedTypes.kt | 29 ++++++++ ...tationsOnParenthesizedTypes.lazyBodies.txt | 40 ++++++++++ .../annotationsOnParenthesizedTypes.txt | 43 +++++++++++ .../declarations/splitModifierList.kt | 16 ++++ .../splitModifierList.lazyBodies.txt | 23 ++++++ .../declarations/splitModifierList.txt | 23 ++++++ .../declarations/suspendFunctionTypes.kt | 8 ++ .../suspendFunctionTypes.lazyBodies.txt | 4 + .../declarations/suspendFunctionTypes.txt | 9 +++ ...FirBuilderLazyBodiesTestCaseGenerated.java | 20 +++++ .../RawFirBuilderTestCaseGenerated.java | 20 +++++ .../org/jetbrains/kotlin/fir/FirRenderer.kt | 4 + .../suspendConversion/nullableParameter.kt | 23 ++++++ .../coroutines/nullableSuspendFunctionType.kt | 25 +++++++ .../suspendConversion.fir.kt.txt | 20 +++++ .../suspendConversion.fir.txt | 20 +++++ .../callableReferences/suspendConversion.kt | 8 +- .../suspendConversion.kt.txt | 25 +++++++ .../callableReferences/suspendConversion.txt | 22 ++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 12 +++ .../IrBlackBoxCodegenTestGenerated.java | 12 +++ .../LightAnalysisModeTestGenerated.java | 10 +++ .../FirVisualizerForRawFirDataGenerated.java | 24 ++++++ .../PsiVisualizerForRawFirDataGenerated.java | 24 ++++++ .../FirLazyBodiesCalculatorTestGenerated.java | 20 +++++ .../IrJsCodegenBoxES6TestGenerated.java | 10 +++ .../IrJsCodegenBoxTestGenerated.java | 10 +++ .../semantics/JsCodegenBoxTestGenerated.java | 10 +++ 35 files changed, 734 insertions(+), 28 deletions(-) create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnNullableParenthesizedTypes.kt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnNullableParenthesizedTypes.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnNullableParenthesizedTypes.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.kt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/splitModifierList.kt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/splitModifierList.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/splitModifierList.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/suspendFunctionTypes.kt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/suspendFunctionTypes.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/suspendFunctionTypes.txt create mode 100644 compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/nullableParameter.kt create mode 100644 compiler/testData/codegen/box/coroutines/nullableSuspendFunctionType.kt diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index b0eb588e4f7..a82107266c7 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -2794,6 +2794,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/isAs.kt"); } + @Test + @TestMetadata("nullableParameter.kt") + public void testNullableParameter() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/nullableParameter.kt"); + } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { @@ -9252,6 +9258,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt"); } + @Test + @TestMetadata("nullableSuspendFunctionType.kt") + public void testNullableSuspendFunctionType() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/nullableSuspendFunctionType.kt"); + } + @Test @TestMetadata("overrideDefaultArgument.kt") public void testOverrideDefaultArgument() throws Exception { diff --git a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/DeclarationsConverter.kt b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/DeclarationsConverter.kt index 81e91fb9f87..ba038c0a46d 100644 --- a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/DeclarationsConverter.kt +++ b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/DeclarationsConverter.kt @@ -916,7 +916,8 @@ class DeclarationsConverter( } constructedTypeRef = delegatedType.copyWithNewSourceKind(FirFakeSourceElementKind.ImplicitTypeRef) this.isThis = isThis - val calleeKind = if (isImplicit) FirFakeSourceElementKind.ImplicitConstructor else FirFakeSourceElementKind.DelegatingConstructorCall + val calleeKind = + if (isImplicit) FirFakeSourceElementKind.ImplicitConstructor else FirFakeSourceElementKind.DelegatingConstructorCall val calleeSource = constructorDelegationCall.getChildNodeByType(CONSTRUCTOR_DELEGATION_REFERENCE) ?.toFirSourceElement(calleeKind) ?: this@buildDelegatedConstructorCall.source?.fakeElement(calleeKind) @@ -1281,7 +1282,8 @@ class DeclarationsConverter( CONTRACT_EFFECT -> { val effect = it.getFirstChild() if (effect == null) { - val errorExpression = buildErrorExpression(null, ConeSimpleDiagnostic(errorReason, DiagnosticKind.ExpressionExpected)) + val errorExpression = + buildErrorExpression(null, ConeSimpleDiagnostic(errorReason, DiagnosticKind.ExpressionExpected)) destination.add(errorExpression) } else { val expression = expressionConverter.convertExpression(effect, errorReason) @@ -1674,18 +1676,32 @@ class DeclarationsConverter( if (type.asText.isEmpty()) { return buildErrorTypeRef { diagnostic = ConeSimpleDiagnostic("Unwrapped type is null", DiagnosticKind.Syntax) } } - var typeModifiers = TypeModifier() + + // There can be MODIFIER_LIST children on the TYPE_REFERENCE node AND the descendant NULLABLE_TYPE nodes. + // We aggregate them to get modifiers and annotations. Not only that, there could be multiple modifier lists on each. Examples: + // + // `@A() (@B Int)` -> Has 2 modifier lists (@A and @B) in TYPE_REFERENCE + // `(@A() (@B Int))? -> No modifier list on TYPE_REFERENCE, but 2 modifier lists (@A and @B) on child NULLABLE_TYPE + // `@A() (@B Int)? -> Has 1 modifier list (@A) on TYPE_REFERENCE, and 1 modifier list (@B) on child NULLABLE_TYPE + // `@A (@B() (@C() (@Bar D)?)?)?` -> Has 1 modifier list (@A) on B and 1 modifier list on each of the + // 3 descendant NULLABLE_TYPE (@B, @C, @D) + // + // We need to examine all modifier lists for some cases: + // 1. `@A Int?` and `(@A Int)?` are effectively the same, but in the latter, the modifier list is on the child NULLABLE_TYPE + // 2. `(suspend @A () -> Int)?` is a nullable suspend function type but the modifier list is on the child NULLABLE_TYPE + // + // TODO: Report MODIFIER_LIST_NOT_ALLOWED error when there are multiple modifier lists. How do we report on each of them? + val allTypeModifiers = mutableListOf() + var firType: FirTypeRef = buildErrorTypeRef { diagnostic = ConeSimpleDiagnostic("Incomplete code", DiagnosticKind.Syntax) } - var afterLPar = false type.forEachChildren { when (it.tokenType) { - LPAR -> afterLPar = true TYPE_REFERENCE -> firType = convertType(it) - MODIFIER_LIST -> if (!afterLPar || typeModifiers.hasNoAnnotations()) typeModifiers = convertTypeModifierList(it) + MODIFIER_LIST -> allTypeModifiers += convertTypeModifierList(it) USER_TYPE -> firType = convertUserType(it) - DEFINITELY_NOT_NULL_TYPE -> firType = unwrapDefinitelyNotNullableType(it) - NULLABLE_TYPE -> firType = convertNullableType(it) - FUNCTION_TYPE -> firType = convertFunctionType(it, isSuspend = typeModifiers.hasSuspend) + DEFINITELY_NOT_NULL_TYPE -> firType = unwrapDefinitelyNotNullableType(it, allTypeModifiers) + NULLABLE_TYPE -> firType = convertNullableType(it, allTypeModifiers) + FUNCTION_TYPE -> firType = convertFunctionType(it, isSuspend = allTypeModifiers.hasSuspend()) DYNAMIC_TYPE -> firType = buildDynamicTypeRef { source = type.toFirSourceElement() isMarkedNullable = false @@ -1695,9 +1711,14 @@ class DeclarationsConverter( } } - return firType.also { (it.annotations as MutableList) += typeModifiers.annotations } + for (modifierList in allTypeModifiers) { + (firType.annotations as MutableList) += modifierList.annotations + } + return firType } + private fun Collection.hasSuspend() = any { it.hasSuspend } + /** * @see org.jetbrains.kotlin.parsing.KotlinParsing.parseTypeRefContents */ @@ -1715,15 +1736,19 @@ class DeclarationsConverter( /** * @see org.jetbrains.kotlin.parsing.KotlinParsing.parseNullableTypeSuffix */ - private fun convertNullableType(nullableType: LighterASTNode): FirTypeRef { + private fun convertNullableType( + nullableType: LighterASTNode, + allTypeModifiers: MutableList, + isNullable: Boolean = true + ): FirTypeRef { lateinit var firType: FirTypeRef nullableType.forEachChildren { when (it.tokenType) { - USER_TYPE -> firType = - convertUserType(it, true) - FUNCTION_TYPE -> firType = convertFunctionType(it, true) - NULLABLE_TYPE -> firType = convertNullableType(it) - DEFINITELY_NOT_NULL_TYPE -> firType = unwrapDefinitelyNotNullableType(it, nullable = true) + MODIFIER_LIST -> allTypeModifiers += convertTypeModifierList(it) + USER_TYPE -> firType = convertUserType(it, isNullable) + FUNCTION_TYPE -> firType = convertFunctionType(it, isNullable, isSuspend = allTypeModifiers.hasSuspend()) + NULLABLE_TYPE -> firType = convertNullableType(it, allTypeModifiers) + DEFINITELY_NOT_NULL_TYPE -> firType = unwrapDefinitelyNotNullableType(it, allTypeModifiers, isNullable = true) DYNAMIC_TYPE -> firType = buildDynamicTypeRef { source = nullableType.toFirSourceElement() isMarkedNullable = true @@ -1734,16 +1759,20 @@ class DeclarationsConverter( return firType } - private fun unwrapDefinitelyNotNullableType(definitelyNotNullType: LighterASTNode, nullable: Boolean = false): FirTypeRef { + private fun unwrapDefinitelyNotNullableType( + definitelyNotNullType: LighterASTNode, + allTypeModifiers: MutableList, + isNullable: Boolean = false + ): FirTypeRef { lateinit var firType: FirTypeRef // TODO: Support proper DefinitelyNotNullableType definitelyNotNullType.forEachChildren { when (it.tokenType) { - USER_TYPE -> firType = - convertUserType(it, nullable) - FUNCTION_TYPE -> firType = convertFunctionType(it, nullable) - NULLABLE_TYPE -> firType = convertNullableType(it) - DEFINITELY_NOT_NULL_TYPE -> firType = unwrapDefinitelyNotNullableType(it, nullable) + MODIFIER_LIST -> allTypeModifiers += convertTypeModifierList(it) + USER_TYPE -> firType = convertUserType(it, isNullable) + FUNCTION_TYPE -> firType = convertFunctionType(it, isNullable, isSuspend = allTypeModifiers.hasSuspend()) + NULLABLE_TYPE -> firType = convertNullableType(it, allTypeModifiers, isNullable = false) + DEFINITELY_NOT_NULL_TYPE -> firType = unwrapDefinitelyNotNullableType(it, allTypeModifiers, isNullable) DYNAMIC_TYPE -> firType = buildDynamicTypeRef { source = definitelyNotNullType.toFirSourceElement() isMarkedNullable = false diff --git a/compiler/fir/raw-fir/light-tree2fir/tests-gen/org/jetbrains/kotlin/fir/lightTree/LightTree2FirConverterTestCaseGenerated.java b/compiler/fir/raw-fir/light-tree2fir/tests-gen/org/jetbrains/kotlin/fir/lightTree/LightTree2FirConverterTestCaseGenerated.java index eacc0fef7f8..f5d0976fc8b 100644 --- a/compiler/fir/raw-fir/light-tree2fir/tests-gen/org/jetbrains/kotlin/fir/lightTree/LightTree2FirConverterTestCaseGenerated.java +++ b/compiler/fir/raw-fir/light-tree2fir/tests-gen/org/jetbrains/kotlin/fir/lightTree/LightTree2FirConverterTestCaseGenerated.java @@ -46,6 +46,16 @@ public class LightTree2FirConverterTestCaseGenerated extends AbstractLightTree2F runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotation.kt"); } + @TestMetadata("annotationsOnNullableParenthesizedTypes.kt") + public void testAnnotationsOnNullableParenthesizedTypes() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnNullableParenthesizedTypes.kt"); + } + + @TestMetadata("annotationsOnParenthesizedTypes.kt") + public void testAnnotationsOnParenthesizedTypes() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.kt"); + } + @TestMetadata("complexTypes.kt") public void testComplexTypes() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/complexTypes.kt"); @@ -156,6 +166,16 @@ public class LightTree2FirConverterTestCaseGenerated extends AbstractLightTree2F runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/simpleTypeAlias.kt"); } + @TestMetadata("splitModifierList.kt") + public void testSplitModifierList() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/splitModifierList.kt"); + } + + @TestMetadata("suspendFunctionTypes.kt") + public void testSuspendFunctionTypes() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/suspendFunctionTypes.kt"); + } + @TestMetadata("typeAliasWithGeneric.kt") public void testTypeAliasWithGeneric() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/typeAliasWithGeneric.kt"); diff --git a/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt b/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt index 4a1e11e93c2..99f4c665aff 100644 --- a/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt +++ b/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt @@ -43,6 +43,7 @@ import org.jetbrains.kotlin.name.LocalCallableIdConstructor import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.psi.* import org.jetbrains.kotlin.psi.psiUtil.* +import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes import org.jetbrains.kotlin.types.ConstantValueKind import org.jetbrains.kotlin.types.Variance import org.jetbrains.kotlin.types.expressions.OperatorConventions @@ -1354,11 +1355,37 @@ open class RawFirBuilder( val source = typeReference.toFirSourceElement() val isNullable = typeElement is KtNullableType + // There can be KtDeclarationModifierLists in the KtTypeReference AND the descendant KtNullableTypes. + // We aggregate them to get modifiers and annotations. Not only that, there could be multiple modifier lists on each. Examples: + // + // `@A() (@B Int)` -> Has 2 modifier lists (@A and @B) on KtTypeReference + // `(@A() (@B Int))? -> No modifier list on KtTypeReference, but 2 modifier lists (@A and @B) on child KtNullableType + // `@A() (@B Int)? -> Has 1 modifier list (@A) on KtTypeReference, and 1 modifier list (@B) on child KtNullableType + // `@A (@B() (@C() (@Bar D)?)?)?` -> Has 1 modifier list (@A) on KtTypeReference and 1 modifier list on each of the + // 3 descendant KtNullableTypes (@B, @C, @D) + // + // We need to examine all modifier lists for some cases: + // 1. `@A Int?` and `(@A Int)?` are effectively the same, but in the latter, the modifier list is on the child KtNullableType + // 2. `(suspend @A () -> Int)?` is a nullable suspend function type but the modifier list is on the child KtNullableType + // + // `getModifierList()` only returns the first one so we have to get all modifier list children. + // TODO: Report MODIFIER_LIST_NOT_ALLOWED error when there are multiple modifier lists. How do we report on each of them? + fun KtElementImplStub<*>.getAllModifierLists(): Array = + getStubOrPsiChildren(KtStubElementTypes.MODIFIER_LIST, KtStubElementTypes.MODIFIER_LIST.arrayFactory) + + val allModifierLists = mutableListOf(*typeReference.getAllModifierLists()) + fun KtTypeElement?.unwrapNullable(): KtTypeElement? = when (this) { - is KtNullableType -> this.innerType.unwrapNullable() + is KtNullableType -> { + allModifierLists += getAllModifierLists() + this.innerType.unwrapNullable() + } // TODO: Support explicit definitely not null type - is KtDefinitelyNotNullType -> this.innerType.unwrapNullable() + is KtDefinitelyNotNullType -> { + allModifierLists += getAllModifierLists() + this.innerType.unwrapNullable() + } else -> this } @@ -1403,7 +1430,7 @@ open class RawFirBuilder( FirFunctionTypeRefBuilder().apply { this.source = source isMarkedNullable = isNullable - isSuspend = typeReference.hasModifier(SUSPEND_KEYWORD) + isSuspend = allModifierLists.any { it.hasSuspendModifier() } receiverTypeRef = unwrappedElement.receiverTypeReference.convertSafe() // TODO: probably implicit type should not be here returnTypeRef = unwrappedElement.returnTypeReference.toFirOrErrorType() @@ -1422,8 +1449,10 @@ open class RawFirBuilder( else -> throw AssertionError("Unexpected type element: ${unwrappedElement.text}") } - for (annotationEntry in typeReference.annotationEntries) { - firTypeBuilder.annotations += annotationEntry.convert() + for (modifierList in allModifierLists) { + for (annotationEntry in modifierList.annotationEntries) { + firTypeBuilder.annotations += annotationEntry.convert() + } } return firTypeBuilder.build() } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnNullableParenthesizedTypes.kt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnNullableParenthesizedTypes.kt new file mode 100644 index 00000000000..367c16412da --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnNullableParenthesizedTypes.kt @@ -0,0 +1,27 @@ +interface AnnotationsOnNullableParenthesizedTypes { + fun B<(@A C)?>.receiverArgument() {} + + fun parameter(a: (@A C)?) {} + + fun parameterArgument(a: B<(@A C)?>) {} + + fun returnValue(): (@A C)? + + fun returnTypeParameterValue(): (@A T)? + + fun returnArgument(): B<(@A C)?> + + val lambdaType: (@A() (() -> C))? + + val lambdaParameter: ((@A C)?) -> C + + val lambdaReturnValue: () -> (@A C)? + + val lambdaReceiver: (@A C)?.() -> C +} + +@Target(AnnotationTarget.TYPE, AnnotationTarget.TYPE_PARAMETER) +annotation class A + +interface B +interface C \ No newline at end of file diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnNullableParenthesizedTypes.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnNullableParenthesizedTypes.lazyBodies.txt new file mode 100644 index 00000000000..0c2921469c0 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnNullableParenthesizedTypes.lazyBodies.txt @@ -0,0 +1,37 @@ +FILE: annotationsOnNullableParenthesizedTypes.kt + public? final? interface AnnotationsOnNullableParenthesizedTypes : R|kotlin/Any| { + public? final? fun B<@A() C?>.receiverArgument(): R|kotlin/Unit| { LAZY_BLOCK } + + public? final? fun parameter(a: @A() C?): R|kotlin/Unit| { LAZY_BLOCK } + + public? final? fun parameterArgument(a: B<@A() C?>): R|kotlin/Unit| { LAZY_BLOCK } + + public? final? fun returnValue(): @A() C? + + public? final? fun returnTypeParameterValue(): @A() T? + + public? final? fun returnArgument(): B<@A() C?> + + public? final? val lambdaType: @A() ( () -> C )? + public? get(): @A() ( () -> C )? + + public? final? val lambdaParameter: ( (@A() C?) -> C ) + public? get(): ( (@A() C?) -> C ) + + public? final? val lambdaReturnValue: ( () -> @A() C? ) + public? get(): ( () -> @A() C? ) + + public? final? val lambdaReceiver: ( @A() C?.() -> C ) + public? get(): ( @A() C?.() -> C ) + + } + @Target(AnnotationTarget#.TYPE#, AnnotationTarget#.TYPE_PARAMETER#) public? final? annotation class A : R|kotlin/Annotation| { + public? constructor(): R|A| { + super() + } + + } + public? final? interface B : R|kotlin/Any| { + } + public? final? interface C : R|kotlin/Any| { + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnNullableParenthesizedTypes.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnNullableParenthesizedTypes.txt new file mode 100644 index 00000000000..807ed8bd549 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnNullableParenthesizedTypes.txt @@ -0,0 +1,40 @@ +FILE: annotationsOnNullableParenthesizedTypes.kt + public? final? interface AnnotationsOnNullableParenthesizedTypes : R|kotlin/Any| { + public? final? fun B<@A() C?>.receiverArgument(): R|kotlin/Unit| { + } + + public? final? fun parameter(a: @A() C?): R|kotlin/Unit| { + } + + public? final? fun parameterArgument(a: B<@A() C?>): R|kotlin/Unit| { + } + + public? final? fun returnValue(): @A() C? + + public? final? fun returnTypeParameterValue(): @A() T? + + public? final? fun returnArgument(): B<@A() C?> + + public? final? val lambdaType: @A() ( () -> C )? + [ContainingClassKey=AnnotationsOnNullableParenthesizedTypes] public? get(): @A() ( () -> C )? + + public? final? val lambdaParameter: ( (@A() C?) -> C ) + [ContainingClassKey=AnnotationsOnNullableParenthesizedTypes] public? get(): ( (@A() C?) -> C ) + + public? final? val lambdaReturnValue: ( () -> @A() C? ) + [ContainingClassKey=AnnotationsOnNullableParenthesizedTypes] public? get(): ( () -> @A() C? ) + + public? final? val lambdaReceiver: ( @A() C?.() -> C ) + [ContainingClassKey=AnnotationsOnNullableParenthesizedTypes] public? get(): ( @A() C?.() -> C ) + + } + @Target(AnnotationTarget#.TYPE#, AnnotationTarget#.TYPE_PARAMETER#) public? final? annotation class A : R|kotlin/Annotation| { + public? [ContainingClassKey=A] constructor(): R|A| { + super() + } + + } + public? final? interface B : R|kotlin/Any| { + } + public? final? interface C : R|kotlin/Any| { + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.kt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.kt new file mode 100644 index 00000000000..ef5b3caf845 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.kt @@ -0,0 +1,29 @@ +interface AnnotationsOnParenthesizedTypes { + fun B<(@A C)>.receiverArgument() {} + + fun parameter(a: (@A C)) {} + + fun parameterArgument(a: B<(@A C)>) {} + + fun returnValue(): (@A C) + + fun returnTypeParameterValue(): (@A T) + + fun returnArgument(): B<(@A C)> + + val lambdaType: (@A() (() -> C)) + + val lambdaParameter: ((@A C)) -> C + + val lambdaReturnValue: () -> (@A C) + + val lambdaReceiver: (@A C).() -> C + + val lambdaParameterNP: (@A C) -> C +} + +@Target(AnnotationTarget.TYPE, AnnotationTarget.TYPE_PARAMETER) +annotation class A + +interface B +interface C \ No newline at end of file diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.lazyBodies.txt new file mode 100644 index 00000000000..5c88652d134 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.lazyBodies.txt @@ -0,0 +1,40 @@ +FILE: annotationsOnParenthesizedTypes.kt + public? final? interface AnnotationsOnParenthesizedTypes : R|kotlin/Any| { + public? final? fun B<@A() C>.receiverArgument(): R|kotlin/Unit| { LAZY_BLOCK } + + public? final? fun parameter(a: @A() C): R|kotlin/Unit| { LAZY_BLOCK } + + public? final? fun parameterArgument(a: B<@A() C>): R|kotlin/Unit| { LAZY_BLOCK } + + public? final? fun returnValue(): @A() C + + public? final? fun returnTypeParameterValue(): @A() T + + public? final? fun returnArgument(): B<@A() C> + + public? final? val lambdaType: @A() ( () -> C ) + public? get(): @A() ( () -> C ) + + public? final? val lambdaParameter: ( (@A() C) -> C ) + public? get(): ( (@A() C) -> C ) + + public? final? val lambdaReturnValue: ( () -> @A() C ) + public? get(): ( () -> @A() C ) + + public? final? val lambdaReceiver: ( @A() C.() -> C ) + public? get(): ( @A() C.() -> C ) + + public? final? val lambdaParameterNP: ( (@A() C) -> C ) + public? get(): ( (@A() C) -> C ) + + } + @Target(AnnotationTarget#.TYPE#, AnnotationTarget#.TYPE_PARAMETER#) public? final? annotation class A : R|kotlin/Annotation| { + public? constructor(): R|A| { + super() + } + + } + public? final? interface B : R|kotlin/Any| { + } + public? final? interface C : R|kotlin/Any| { + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.txt new file mode 100644 index 00000000000..48b3d6328db --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.txt @@ -0,0 +1,43 @@ +FILE: annotationsOnParenthesizedTypes.kt + public? final? interface AnnotationsOnParenthesizedTypes : R|kotlin/Any| { + public? final? fun B<@A() C>.receiverArgument(): R|kotlin/Unit| { + } + + public? final? fun parameter(a: @A() C): R|kotlin/Unit| { + } + + public? final? fun parameterArgument(a: B<@A() C>): R|kotlin/Unit| { + } + + public? final? fun returnValue(): @A() C + + public? final? fun returnTypeParameterValue(): @A() T + + public? final? fun returnArgument(): B<@A() C> + + public? final? val lambdaType: @A() ( () -> C ) + [ContainingClassKey=AnnotationsOnParenthesizedTypes] public? get(): @A() ( () -> C ) + + public? final? val lambdaParameter: ( (@A() C) -> C ) + [ContainingClassKey=AnnotationsOnParenthesizedTypes] public? get(): ( (@A() C) -> C ) + + public? final? val lambdaReturnValue: ( () -> @A() C ) + [ContainingClassKey=AnnotationsOnParenthesizedTypes] public? get(): ( () -> @A() C ) + + public? final? val lambdaReceiver: ( @A() C.() -> C ) + [ContainingClassKey=AnnotationsOnParenthesizedTypes] public? get(): ( @A() C.() -> C ) + + public? final? val lambdaParameterNP: ( (@A() C) -> C ) + [ContainingClassKey=AnnotationsOnParenthesizedTypes] public? get(): ( (@A() C) -> C ) + + } + @Target(AnnotationTarget#.TYPE#, AnnotationTarget#.TYPE_PARAMETER#) public? final? annotation class A : R|kotlin/Annotation| { + public? [ContainingClassKey=A] constructor(): R|A| { + super() + } + + } + public? final? interface B : R|kotlin/Any| { + } + public? final? interface C : R|kotlin/Any| { + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/splitModifierList.kt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/splitModifierList.kt new file mode 100644 index 00000000000..0e41b321904 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/splitModifierList.kt @@ -0,0 +1,16 @@ +@Target(AnnotationTarget.TYPE, AnnotationTarget.TYPE_PARAMETER) +annotation class A + +@Target(AnnotationTarget.TYPE, AnnotationTarget.TYPE_PARAMETER) +annotation class B + +typealias Test0 = @A @B Int +typealias Test1 = @A() (@A Int) +typealias Test2 = @A() (@B Int) +typealias Test3 = @A() (@A Int) -> Int +typealias Test4 = @A() (@B Int)? +typealias Test5 = @A() ( (@B Int)? ) +typealias Test6 = (@A @B Int) +typealias Test7 = (@A @B Int)? +typealias Test8 = (@A() (@B Int)? ) +typealias Test9 = (@A() (@B Int) )? \ No newline at end of file diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/splitModifierList.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/splitModifierList.lazyBodies.txt new file mode 100644 index 00000000000..9660b9389f4 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/splitModifierList.lazyBodies.txt @@ -0,0 +1,23 @@ +FILE: splitModifierList.kt + @Target(AnnotationTarget#.TYPE#, AnnotationTarget#.TYPE_PARAMETER#) public? final? annotation class A : R|kotlin/Annotation| { + public? constructor(): R|A| { + super() + } + + } + @Target(AnnotationTarget#.TYPE#, AnnotationTarget#.TYPE_PARAMETER#) public? final? annotation class B : R|kotlin/Annotation| { + public? constructor(): R|B| { + super() + } + + } + public? final typealias Test0 = @A() @B() Int + public? final typealias Test1 = @A() @A() Int + public? final typealias Test2 = @A() @B() Int + public? final typealias Test3 = @A() ( (@A() Int) -> Int ) + public? final typealias Test4 = @A() @B() Int? + public? final typealias Test5 = @A() @B() Int? + public? final typealias Test6 = @A() @B() Int + public? final typealias Test7 = @A() @B() Int? + public? final typealias Test8 = @A() @B() Int? + public? final typealias Test9 = @A() @B() Int? diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/splitModifierList.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/splitModifierList.txt new file mode 100644 index 00000000000..f188c91b99c --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/splitModifierList.txt @@ -0,0 +1,23 @@ +FILE: splitModifierList.kt + @Target(AnnotationTarget#.TYPE#, AnnotationTarget#.TYPE_PARAMETER#) public? final? annotation class A : R|kotlin/Annotation| { + public? [ContainingClassKey=A] constructor(): R|A| { + super() + } + + } + @Target(AnnotationTarget#.TYPE#, AnnotationTarget#.TYPE_PARAMETER#) public? final? annotation class B : R|kotlin/Annotation| { + public? [ContainingClassKey=B] constructor(): R|B| { + super() + } + + } + public? final typealias Test0 = @A() @B() Int + public? final typealias Test1 = @A() @A() Int + public? final typealias Test2 = @A() @B() Int + public? final typealias Test3 = @A() ( (@A() Int) -> Int ) + public? final typealias Test4 = @A() @B() Int? + public? final typealias Test5 = @A() @B() Int? + public? final typealias Test6 = @A() @B() Int + public? final typealias Test7 = @A() @B() Int? + public? final typealias Test8 = @A() @B() Int? + public? final typealias Test9 = @A() @B() Int? diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/suspendFunctionTypes.kt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/suspendFunctionTypes.kt new file mode 100644 index 00000000000..a10d0933296 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/suspendFunctionTypes.kt @@ -0,0 +1,8 @@ +suspend fun simpleRun(f: suspend () -> T): T = f() + +suspend fun List.simpleMap(f: suspend (T) -> R): R { + +} + +suspend fun simpleWith(t: T, f: suspend T.() -> Unit): Unit = t.f() + diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/suspendFunctionTypes.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/suspendFunctionTypes.lazyBodies.txt new file mode 100644 index 00000000000..2f4c764e322 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/suspendFunctionTypes.lazyBodies.txt @@ -0,0 +1,4 @@ +FILE: suspendFunctionTypes.kt + public? final? suspend fun simpleRun(f: ( suspend () -> T )): T { LAZY_BLOCK } + public? final? suspend fun List.simpleMap(f: ( suspend (T) -> R )): R { LAZY_BLOCK } + public? final? suspend fun simpleWith(t: T, f: ( suspend T.() -> Unit )): Unit { LAZY_BLOCK } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/suspendFunctionTypes.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/suspendFunctionTypes.txt new file mode 100644 index 00000000000..b81f9a452a3 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/suspendFunctionTypes.txt @@ -0,0 +1,9 @@ +FILE: suspendFunctionTypes.kt + public? final? suspend fun simpleRun(f: ( suspend () -> T )): T { + ^simpleRun f#() + } + public? final? suspend fun List.simpleMap(f: ( suspend (T) -> R )): R { + } + public? final? suspend fun simpleWith(t: T, f: ( suspend T.() -> Unit )): Unit { + ^simpleWith t#.f#() + } diff --git a/compiler/fir/raw-fir/psi2fir/tests-gen/org/jetbrains/kotlin/fir/builder/RawFirBuilderLazyBodiesTestCaseGenerated.java b/compiler/fir/raw-fir/psi2fir/tests-gen/org/jetbrains/kotlin/fir/builder/RawFirBuilderLazyBodiesTestCaseGenerated.java index 8945c237d41..d306443634e 100644 --- a/compiler/fir/raw-fir/psi2fir/tests-gen/org/jetbrains/kotlin/fir/builder/RawFirBuilderLazyBodiesTestCaseGenerated.java +++ b/compiler/fir/raw-fir/psi2fir/tests-gen/org/jetbrains/kotlin/fir/builder/RawFirBuilderLazyBodiesTestCaseGenerated.java @@ -46,6 +46,16 @@ public class RawFirBuilderLazyBodiesTestCaseGenerated extends AbstractRawFirBuil runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotation.kt"); } + @TestMetadata("annotationsOnNullableParenthesizedTypes.kt") + public void testAnnotationsOnNullableParenthesizedTypes() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnNullableParenthesizedTypes.kt"); + } + + @TestMetadata("annotationsOnParenthesizedTypes.kt") + public void testAnnotationsOnParenthesizedTypes() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.kt"); + } + @TestMetadata("complexTypes.kt") public void testComplexTypes() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/complexTypes.kt"); @@ -156,6 +166,16 @@ public class RawFirBuilderLazyBodiesTestCaseGenerated extends AbstractRawFirBuil runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/simpleTypeAlias.kt"); } + @TestMetadata("splitModifierList.kt") + public void testSplitModifierList() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/splitModifierList.kt"); + } + + @TestMetadata("suspendFunctionTypes.kt") + public void testSuspendFunctionTypes() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/suspendFunctionTypes.kt"); + } + @TestMetadata("typeAliasWithGeneric.kt") public void testTypeAliasWithGeneric() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/typeAliasWithGeneric.kt"); diff --git a/compiler/fir/raw-fir/psi2fir/tests-gen/org/jetbrains/kotlin/fir/builder/RawFirBuilderTestCaseGenerated.java b/compiler/fir/raw-fir/psi2fir/tests-gen/org/jetbrains/kotlin/fir/builder/RawFirBuilderTestCaseGenerated.java index a84a9533246..5be06767410 100644 --- a/compiler/fir/raw-fir/psi2fir/tests-gen/org/jetbrains/kotlin/fir/builder/RawFirBuilderTestCaseGenerated.java +++ b/compiler/fir/raw-fir/psi2fir/tests-gen/org/jetbrains/kotlin/fir/builder/RawFirBuilderTestCaseGenerated.java @@ -46,6 +46,16 @@ public class RawFirBuilderTestCaseGenerated extends AbstractRawFirBuilderTestCas runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotation.kt"); } + @TestMetadata("annotationsOnNullableParenthesizedTypes.kt") + public void testAnnotationsOnNullableParenthesizedTypes() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnNullableParenthesizedTypes.kt"); + } + + @TestMetadata("annotationsOnParenthesizedTypes.kt") + public void testAnnotationsOnParenthesizedTypes() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.kt"); + } + @TestMetadata("complexTypes.kt") public void testComplexTypes() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/complexTypes.kt"); @@ -156,6 +166,16 @@ public class RawFirBuilderTestCaseGenerated extends AbstractRawFirBuilderTestCas runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/simpleTypeAlias.kt"); } + @TestMetadata("splitModifierList.kt") + public void testSplitModifierList() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/splitModifierList.kt"); + } + + @TestMetadata("suspendFunctionTypes.kt") + public void testSuspendFunctionTypes() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/suspendFunctionTypes.kt"); + } + @TestMetadata("typeAliasWithGeneric.kt") public void testTypeAliasWithGeneric() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/typeAliasWithGeneric.kt"); diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirRenderer.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirRenderer.kt index 8d3758eec60..a0d42cf1d11 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirRenderer.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirRenderer.kt @@ -983,7 +983,11 @@ class FirRenderer(builder: StringBuilder, private val mode: RenderMode = RenderM } override fun visitFunctionTypeRef(functionTypeRef: FirFunctionTypeRef) { + functionTypeRef.annotations.dropExtensionFunctionAnnotation().renderAnnotations() print("( ") + if (functionTypeRef.isSuspend) { + print("suspend ") + } functionTypeRef.receiverTypeRef?.let { it.accept(this) print(".") diff --git a/compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/nullableParameter.kt b/compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/nullableParameter.kt new file mode 100644 index 00000000000..5e2f27728ad --- /dev/null +++ b/compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/nullableParameter.kt @@ -0,0 +1,23 @@ +// DONT_TARGET_EXACT_BACKEND: WASM +// WASM_MUTE_REASON: COROUTINES +// !LANGUAGE: +SuspendConversion +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import kotlin.coroutines.* +import kotlin.coroutines.intrinsics.* + + +fun runSuspend(c: (suspend () -> Unit)?) { + c?.startCoroutine(EmptyContinuation) +} + +var test = "failed" + +fun foo() { test = "OK" } + +fun box(): String { + runSuspend(::foo) + return test +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/coroutines/nullableSuspendFunctionType.kt b/compiler/testData/codegen/box/coroutines/nullableSuspendFunctionType.kt new file mode 100644 index 00000000000..6e0b945c00d --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/nullableSuspendFunctionType.kt @@ -0,0 +1,25 @@ +// WITH_RUNTIME +// WITH_COROUTINES +import helpers.* +import kotlin.coroutines.* +import kotlin.coroutines.intrinsics.* + +suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> + x.resume("OK") + COROUTINE_SUSPENDED +} + +fun builder(c: (suspend () -> Unit)?) { + c?.startCoroutine(EmptyContinuation) +} + +fun box(): String { + var result = "" + + builder(null) + builder { + result = suspendHere() + } + + return result +} diff --git a/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.fir.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.fir.kt.txt index 43399532177..d78368b9342 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.fir.kt.txt @@ -1,6 +1,12 @@ fun useSuspend(fn: SuspendFunction0) { } +fun useSuspendNullable(fn: SuspendFunction0?) { +} + +fun useSuspendNestedNullable(fn: SuspendFunction0?) { +} + fun useSuspendInt(fn: SuspendFunction1) { } @@ -97,3 +103,17 @@ fun testWithBoundReceiver() { C()::bar }) } + +fun testNullableParam() { + useSuspendNullable(fn = local suspend fun foo1() { + foo1() + } +) +} + +fun testNestedNullableParam() { + useSuspendNestedNullable(fn = local suspend fun foo1() { + foo1() + } +) +} diff --git a/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.fir.txt index 857bd8ef946..09c81f08743 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.fir.txt @@ -2,6 +2,12 @@ FILE fqName: fileName:/suspendConversion.kt FUN name:useSuspend visibility:public modality:FINAL <> (fn:kotlin.coroutines.SuspendFunction0) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.coroutines.SuspendFunction0 BLOCK_BODY + FUN name:useSuspendNullable visibility:public modality:FINAL <> (fn:kotlin.coroutines.SuspendFunction0?) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.coroutines.SuspendFunction0? + BLOCK_BODY + FUN name:useSuspendNestedNullable visibility:public modality:FINAL <> (fn:kotlin.coroutines.SuspendFunction0?) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.coroutines.SuspendFunction0? + BLOCK_BODY FUN name:useSuspendInt visibility:public modality:FINAL <> (fn:kotlin.coroutines.SuspendFunction1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.coroutines.SuspendFunction1 BLOCK_BODY @@ -115,3 +121,17 @@ FILE fqName: fileName:/suspendConversion.kt $this: GET_VAR 'receiver: .C declared in .testWithBoundReceiver.bar' type=.C origin=ADAPTED_FUNCTION_REFERENCE FUNCTION_REFERENCE 'local final fun bar (): kotlin.Unit [suspend] declared in .testWithBoundReceiver' type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=null $receiver: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .C' type=.C origin=null + FUN name:testNullableParam visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun useSuspendNullable (fn: kotlin.coroutines.SuspendFunction0?): kotlin.Unit declared in ' type=kotlin.Unit origin=null + fn: FUN_EXPR type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:foo1 visibility:local modality:FINAL <> () returnType:kotlin.Unit [suspend] + BLOCK_BODY + CALL 'public final fun foo1 (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + FUN name:testNestedNullableParam visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun useSuspendNestedNullable (fn: kotlin.coroutines.SuspendFunction0?): kotlin.Unit declared in ' type=kotlin.Unit origin=null + fn: FUN_EXPR type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:foo1 visibility:local modality:FINAL <> () returnType:kotlin.Unit [suspend] + BLOCK_BODY + CALL 'public final fun foo1 (): kotlin.Unit declared in ' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.kt b/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.kt index 9ae40e03e79..07b374f0faf 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.kt @@ -1,6 +1,8 @@ // !LANGUAGE: +SuspendConversion fun useSuspend(fn: suspend () -> Unit) {} +fun useSuspendNullable(fn: (suspend () -> Unit)?) {} +fun useSuspendNestedNullable(fn: ((suspend () -> Unit)?)?) {} fun useSuspendInt(fn: suspend (Int) -> Unit) {} suspend fun foo0() {} @@ -30,4 +32,8 @@ fun testWithCoercionToUnit() { useSuspend(::foo3) } fun testWithDefaults() { useSuspend(::foo4) } -fun testWithBoundReceiver() { useSuspend(C()::bar) } \ No newline at end of file +fun testWithBoundReceiver() { useSuspend(C()::bar) } + +fun testNullableParam() { useSuspendNullable(::foo1) } + +fun testNestedNullableParam() { useSuspendNestedNullable(::foo1) } \ No newline at end of file diff --git a/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.kt.txt index 4d38f21ca77..bb9d391b534 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.kt.txt @@ -1,6 +1,12 @@ fun useSuspend(fn: SuspendFunction0) { } +fun useSuspendNullable(fn: SuspendFunction0?) { +} + +fun useSuspendNestedNullable(fn: SuspendFunction0?) { +} + fun useSuspendInt(fn: SuspendFunction1) { } @@ -116,3 +122,22 @@ fun testWithBoundReceiver() { }) } +fun testNullableParam() { + useSuspendNullable(fn = { // BLOCK + local suspend fun foo1() { + foo1() + } + + ::foo1 + }) +} + +fun testNestedNullableParam() { + useSuspendNestedNullable(fn = { // BLOCK + local suspend fun foo1() { + foo1() + } + + ::foo1 + }) +} diff --git a/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.txt b/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.txt index 7683500d480..d165fbc6a9f 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.txt @@ -2,6 +2,12 @@ FILE fqName: fileName:/suspendConversion.kt FUN name:useSuspend visibility:public modality:FINAL <> (fn:kotlin.coroutines.SuspendFunction0) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.coroutines.SuspendFunction0 BLOCK_BODY + FUN name:useSuspendNullable visibility:public modality:FINAL <> (fn:kotlin.coroutines.SuspendFunction0?) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.coroutines.SuspendFunction0? + BLOCK_BODY + FUN name:useSuspendNestedNullable visibility:public modality:FINAL <> (fn:kotlin.coroutines.SuspendFunction0?) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:kotlin.coroutines.SuspendFunction0? + BLOCK_BODY FUN name:useSuspendInt visibility:public modality:FINAL <> (fn:kotlin.coroutines.SuspendFunction1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.coroutines.SuspendFunction1 BLOCK_BODY @@ -122,3 +128,19 @@ FILE fqName: fileName:/suspendConversion.kt $this: GET_VAR 'receiver: .C declared in .testWithBoundReceiver.bar' type=.C origin=ADAPTED_FUNCTION_REFERENCE FUNCTION_REFERENCE 'local final fun bar (): kotlin.Unit [suspend] declared in .testWithBoundReceiver' type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun bar (): kotlin.Unit declared in .C $receiver: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .C' type=.C origin=null + FUN name:testNullableParam visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun useSuspendNullable (fn: kotlin.coroutines.SuspendFunction0?): kotlin.Unit declared in ' type=kotlin.Unit origin=null + fn: BLOCK type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:foo1 visibility:local modality:FINAL <> () returnType:kotlin.Unit [suspend] + BLOCK_BODY + CALL 'public final fun foo1 (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + FUNCTION_REFERENCE 'local final fun foo1 (): kotlin.Unit [suspend] declared in .testNullableParam' type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun foo1 (): kotlin.Unit declared in + FUN name:testNestedNullableParam visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun useSuspendNestedNullable (fn: kotlin.coroutines.SuspendFunction0?): kotlin.Unit declared in ' type=kotlin.Unit origin=null + fn: BLOCK type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE + FUN ADAPTER_FOR_CALLABLE_REFERENCE name:foo1 visibility:local modality:FINAL <> () returnType:kotlin.Unit [suspend] + BLOCK_BODY + CALL 'public final fun foo1 (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + FUNCTION_REFERENCE 'local final fun foo1 (): kotlin.Unit [suspend] declared in .testNestedNullableParam' type=kotlin.coroutines.SuspendFunction0 origin=ADAPTED_FUNCTION_REFERENCE reflectionTarget=public final fun foo1 (): kotlin.Unit declared in diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 33055ce4e0b..5628c38d3b2 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -2794,6 +2794,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/isAs.kt"); } + @Test + @TestMetadata("nullableParameter.kt") + public void testNullableParameter() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/nullableParameter.kt"); + } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { @@ -9252,6 +9258,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt"); } + @Test + @TestMetadata("nullableSuspendFunctionType.kt") + public void testNullableSuspendFunctionType() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/nullableSuspendFunctionType.kt"); + } + @Test @TestMetadata("overrideDefaultArgument.kt") public void testOverrideDefaultArgument() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 3de2da87981..f8bc1e8695f 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -2794,6 +2794,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/isAs.kt"); } + @Test + @TestMetadata("nullableParameter.kt") + public void testNullableParameter() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/nullableParameter.kt"); + } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { @@ -9252,6 +9258,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt"); } + @Test + @TestMetadata("nullableSuspendFunctionType.kt") + public void testNullableSuspendFunctionType() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/nullableSuspendFunctionType.kt"); + } + @Test @TestMetadata("overrideDefaultArgument.kt") public void testOverrideDefaultArgument() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 174a6965e67..c6993c01501 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -2449,6 +2449,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/isAs.kt"); } + @TestMetadata("nullableParameter.kt") + public void testNullableParameter() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/nullableParameter.kt"); + } + @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/simple.kt"); @@ -7224,6 +7229,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt"); } + @TestMetadata("nullableSuspendFunctionType.kt") + public void testNullableSuspendFunctionType() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/nullableSuspendFunctionType.kt"); + } + @TestMetadata("overrideDefaultArgument.kt") public void testOverrideDefaultArgument() throws Exception { runTest("compiler/testData/codegen/box/coroutines/overrideDefaultArgument.kt"); diff --git a/compiler/visualizer/tests-gen/org/jetbrains/kotlin/visualizer/fir/FirVisualizerForRawFirDataGenerated.java b/compiler/visualizer/tests-gen/org/jetbrains/kotlin/visualizer/fir/FirVisualizerForRawFirDataGenerated.java index ad1e22a5f99..393d3427993 100644 --- a/compiler/visualizer/tests-gen/org/jetbrains/kotlin/visualizer/fir/FirVisualizerForRawFirDataGenerated.java +++ b/compiler/visualizer/tests-gen/org/jetbrains/kotlin/visualizer/fir/FirVisualizerForRawFirDataGenerated.java @@ -39,6 +39,18 @@ public class FirVisualizerForRawFirDataGenerated extends AbstractFirVisualizerTe runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotation.kt"); } + @Test + @TestMetadata("annotationsOnNullableParenthesizedTypes.kt") + public void testAnnotationsOnNullableParenthesizedTypes() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnNullableParenthesizedTypes.kt"); + } + + @Test + @TestMetadata("annotationsOnParenthesizedTypes.kt") + public void testAnnotationsOnParenthesizedTypes() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.kt"); + } + @Test @TestMetadata("complexTypes.kt") public void testComplexTypes() throws Exception { @@ -171,6 +183,18 @@ public class FirVisualizerForRawFirDataGenerated extends AbstractFirVisualizerTe runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/simpleTypeAlias.kt"); } + @Test + @TestMetadata("splitModifierList.kt") + public void testSplitModifierList() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/splitModifierList.kt"); + } + + @Test + @TestMetadata("suspendFunctionTypes.kt") + public void testSuspendFunctionTypes() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/suspendFunctionTypes.kt"); + } + @Test @TestMetadata("typeAliasWithGeneric.kt") public void testTypeAliasWithGeneric() throws Exception { diff --git a/compiler/visualizer/tests-gen/org/jetbrains/kotlin/visualizer/psi/PsiVisualizerForRawFirDataGenerated.java b/compiler/visualizer/tests-gen/org/jetbrains/kotlin/visualizer/psi/PsiVisualizerForRawFirDataGenerated.java index 3f28e4b0234..1105bb82d2d 100644 --- a/compiler/visualizer/tests-gen/org/jetbrains/kotlin/visualizer/psi/PsiVisualizerForRawFirDataGenerated.java +++ b/compiler/visualizer/tests-gen/org/jetbrains/kotlin/visualizer/psi/PsiVisualizerForRawFirDataGenerated.java @@ -39,6 +39,18 @@ public class PsiVisualizerForRawFirDataGenerated extends AbstractPsiVisualizerTe runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotation.kt"); } + @Test + @TestMetadata("annotationsOnNullableParenthesizedTypes.kt") + public void testAnnotationsOnNullableParenthesizedTypes() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnNullableParenthesizedTypes.kt"); + } + + @Test + @TestMetadata("annotationsOnParenthesizedTypes.kt") + public void testAnnotationsOnParenthesizedTypes() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.kt"); + } + @Test @TestMetadata("complexTypes.kt") public void testComplexTypes() throws Exception { @@ -171,6 +183,18 @@ public class PsiVisualizerForRawFirDataGenerated extends AbstractPsiVisualizerTe runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/simpleTypeAlias.kt"); } + @Test + @TestMetadata("splitModifierList.kt") + public void testSplitModifierList() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/splitModifierList.kt"); + } + + @Test + @TestMetadata("suspendFunctionTypes.kt") + public void testSuspendFunctionTypes() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/suspendFunctionTypes.kt"); + } + @Test @TestMetadata("typeAliasWithGeneric.kt") public void testTypeAliasWithGeneric() throws Exception { diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/FirLazyBodiesCalculatorTestGenerated.java b/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/FirLazyBodiesCalculatorTestGenerated.java index 3a692469251..91223a72d2d 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/FirLazyBodiesCalculatorTestGenerated.java +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/FirLazyBodiesCalculatorTestGenerated.java @@ -46,6 +46,16 @@ public class FirLazyBodiesCalculatorTestGenerated extends AbstractFirLazyBodiesC runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotation.kt"); } + @TestMetadata("annotationsOnNullableParenthesizedTypes.kt") + public void testAnnotationsOnNullableParenthesizedTypes() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnNullableParenthesizedTypes.kt"); + } + + @TestMetadata("annotationsOnParenthesizedTypes.kt") + public void testAnnotationsOnParenthesizedTypes() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.kt"); + } + @TestMetadata("complexTypes.kt") public void testComplexTypes() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/complexTypes.kt"); @@ -156,6 +166,16 @@ public class FirLazyBodiesCalculatorTestGenerated extends AbstractFirLazyBodiesC runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/simpleTypeAlias.kt"); } + @TestMetadata("splitModifierList.kt") + public void testSplitModifierList() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/splitModifierList.kt"); + } + + @TestMetadata("suspendFunctionTypes.kt") + public void testSuspendFunctionTypes() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/suspendFunctionTypes.kt"); + } + @TestMetadata("typeAliasWithGeneric.kt") public void testTypeAliasWithGeneric() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/typeAliasWithGeneric.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java index ded6681c749..e68d7f5343b 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java @@ -1694,6 +1694,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/isAs.kt"); } + @TestMetadata("nullableParameter.kt") + public void testNullableParameter() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/nullableParameter.kt"); + } + @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/simple.kt"); @@ -6473,6 +6478,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes runTest("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt"); } + @TestMetadata("nullableSuspendFunctionType.kt") + public void testNullableSuspendFunctionType() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/nullableSuspendFunctionType.kt"); + } + @TestMetadata("overrideDefaultArgument.kt") public void testOverrideDefaultArgument() throws Exception { runTest("compiler/testData/codegen/box/coroutines/overrideDefaultArgument.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index 28f51f66285..1c5cbd0f797 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -1694,6 +1694,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/isAs.kt"); } + @TestMetadata("nullableParameter.kt") + public void testNullableParameter() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/nullableParameter.kt"); + } + @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/simple.kt"); @@ -5884,6 +5889,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt"); } + @TestMetadata("nullableSuspendFunctionType.kt") + public void testNullableSuspendFunctionType() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/nullableSuspendFunctionType.kt"); + } + @TestMetadata("overrideDefaultArgument.kt") public void testOverrideDefaultArgument() throws Exception { runTest("compiler/testData/codegen/box/coroutines/overrideDefaultArgument.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 6353718e80f..b38fc49d4b6 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -1694,6 +1694,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/isAs.kt"); } + @TestMetadata("nullableParameter.kt") + public void testNullableParameter() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/nullableParameter.kt"); + } + @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/simple.kt"); @@ -5884,6 +5889,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/coroutines/nonLocalReturnFromInlineLambdaDeep.kt"); } + @TestMetadata("nullableSuspendFunctionType.kt") + public void testNullableSuspendFunctionType() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/nullableSuspendFunctionType.kt"); + } + @TestMetadata("overrideDefaultArgument.kt") public void testOverrideDefaultArgument() throws Exception { runTest("compiler/testData/codegen/box/coroutines/overrideDefaultArgument.kt");