diff --git a/compiler/testData/diagnostics/tests/annotations/annotationOnParameterInFunctionType.txt b/compiler/testData/diagnostics/tests/annotations/annotationOnParameterInFunctionType.txt index deb815ca476..5edb5bc631d 100644 --- a/compiler/testData/diagnostics/tests/annotations/annotationOnParameterInFunctionType.txt +++ b/compiler/testData/diagnostics/tests/annotations/annotationOnParameterInFunctionType.txt @@ -1,7 +1,7 @@ package public val inVal: (x: kotlin.Int) -> kotlin.Unit -public val onType: @TypeAnn A.(a: @TypeAnn A, A) -> @TypeAnn A? +public val onType: (@TypeAnn A).(a: @TypeAnn A, A) -> @TypeAnn A? public fun f(/*0*/ @Ann x: kotlin.Int): kotlin.Unit public fun inParam(/*0*/ fn: (x: kotlin.Int) -> kotlin.Unit): kotlin.Unit public fun inParamNested(/*0*/ fn1: (fn2: (n: kotlin.Int) -> kotlin.Unit) -> kotlin.Unit): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/insideTopLevelExtensionAnnotatedType.txt b/compiler/testData/diagnostics/tests/resolve/dslMarker/insideTopLevelExtensionAnnotatedType.txt index 2b667293445..ce61bc6c088 100644 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/insideTopLevelExtensionAnnotatedType.txt +++ b/compiler/testData/diagnostics/tests/resolve/dslMarker/insideTopLevelExtensionAnnotatedType.txt @@ -1,6 +1,6 @@ package -public fun bar(/*0*/ x: @Ann B.() -> kotlin.Unit): kotlin.Unit +public fun bar(/*0*/ x: (@Ann B).() -> kotlin.Unit): kotlin.Unit public fun @Ann A.test(): kotlin.Unit public final class A { diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/markersIntersection.txt b/compiler/testData/diagnostics/tests/resolve/dslMarker/markersIntersection.txt index 65d788b378f..50e24d3c396 100644 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/markersIntersection.txt +++ b/compiler/testData/diagnostics/tests/resolve/dslMarker/markersIntersection.txt @@ -1,11 +1,11 @@ package -public fun bar1(/*0*/ x: @L1 B.() -> kotlin.Unit): kotlin.Unit -public fun bar1t(/*0*/ q: T, /*1*/ x: @L1 T.() -> kotlin.Unit): kotlin.Unit -public fun bar2(/*0*/ x: @L2 B.() -> kotlin.Unit): kotlin.Unit -public fun foo1(/*0*/ x: @L1 A.() -> kotlin.Unit): kotlin.Unit -public fun foo12(/*0*/ x: @L1 @L2 A.() -> kotlin.Unit): kotlin.Unit -public fun foo2(/*0*/ x: @L2 A.() -> kotlin.Unit): kotlin.Unit +public fun bar1(/*0*/ x: (@L1 B).() -> kotlin.Unit): kotlin.Unit +public fun bar1t(/*0*/ q: T, /*1*/ x: (@L1 T).() -> kotlin.Unit): kotlin.Unit +public fun bar2(/*0*/ x: (@L2 B).() -> kotlin.Unit): kotlin.Unit +public fun foo1(/*0*/ x: (@L1 A).() -> kotlin.Unit): kotlin.Unit +public fun foo12(/*0*/ x: (@L1 @L2 A).() -> kotlin.Unit): kotlin.Unit +public fun foo2(/*0*/ x: (@L2 A).() -> kotlin.Unit): kotlin.Unit public fun test(): kotlin.Unit public final class A { diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/nestedWithSameReceiver.txt b/compiler/testData/diagnostics/tests/resolve/dslMarker/nestedWithSameReceiver.txt index f357dd91e2b..437f60f4872 100644 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/nestedWithSameReceiver.txt +++ b/compiler/testData/diagnostics/tests/resolve/dslMarker/nestedWithSameReceiver.txt @@ -1,7 +1,7 @@ package -public fun bar(/*0*/ x: @Ann B.() -> kotlin.Unit): kotlin.Unit -public fun foo(/*0*/ x: @Ann A.() -> kotlin.Unit): kotlin.Unit +public fun bar(/*0*/ x: (@Ann B).() -> kotlin.Unit): kotlin.Unit +public fun foo(/*0*/ x: (@Ann A).() -> kotlin.Unit): kotlin.Unit public fun test(): kotlin.Unit public final class A { diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/simpleAnnotatedTypes.txt b/compiler/testData/diagnostics/tests/resolve/dslMarker/simpleAnnotatedTypes.txt index f357dd91e2b..437f60f4872 100644 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/simpleAnnotatedTypes.txt +++ b/compiler/testData/diagnostics/tests/resolve/dslMarker/simpleAnnotatedTypes.txt @@ -1,7 +1,7 @@ package -public fun bar(/*0*/ x: @Ann B.() -> kotlin.Unit): kotlin.Unit -public fun foo(/*0*/ x: @Ann A.() -> kotlin.Unit): kotlin.Unit +public fun bar(/*0*/ x: (@Ann B).() -> kotlin.Unit): kotlin.Unit +public fun foo(/*0*/ x: (@Ann A).() -> kotlin.Unit): kotlin.Unit public fun test(): kotlin.Unit public final class A { diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/substitutedReceiverAnnotatedType.txt b/compiler/testData/diagnostics/tests/resolve/dslMarker/substitutedReceiverAnnotatedType.txt index 752c1683b55..48584b71526 100644 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/substitutedReceiverAnnotatedType.txt +++ b/compiler/testData/diagnostics/tests/resolve/dslMarker/substitutedReceiverAnnotatedType.txt @@ -1,7 +1,7 @@ package -public fun bar(/*0*/ x: @Ann E.() -> kotlin.Unit): kotlin.Unit -public fun foo(/*0*/ x: @Ann T.() -> kotlin.Unit): kotlin.Unit +public fun bar(/*0*/ x: (@Ann E).() -> kotlin.Unit): kotlin.Unit +public fun foo(/*0*/ x: (@Ann T).() -> kotlin.Unit): kotlin.Unit public fun test(): kotlin.Unit public final class A { diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/threeImplicitReceivers.txt b/compiler/testData/diagnostics/tests/resolve/dslMarker/threeImplicitReceivers.txt index ca83745a4a9..ab161f25ec2 100644 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/threeImplicitReceivers.txt +++ b/compiler/testData/diagnostics/tests/resolve/dslMarker/threeImplicitReceivers.txt @@ -1,11 +1,11 @@ package -public fun bar(/*0*/ x: @Ann2 B.() -> kotlin.Unit): kotlin.Unit -public fun baz(/*0*/ x: @Ann3 C.() -> kotlin.Unit): kotlin.Unit -public fun foo(/*0*/ x: @Ann1 A.() -> kotlin.Unit): kotlin.Unit -public fun foo1(/*0*/ x: @Ann1 D.() -> kotlin.Unit): kotlin.Unit -public fun foo2(/*0*/ x: @Ann2 D.() -> kotlin.Unit): kotlin.Unit -public fun foo3(/*0*/ x: @Ann3 D.() -> kotlin.Unit): kotlin.Unit +public fun bar(/*0*/ x: (@Ann2 B).() -> kotlin.Unit): kotlin.Unit +public fun baz(/*0*/ x: (@Ann3 C).() -> kotlin.Unit): kotlin.Unit +public fun foo(/*0*/ x: (@Ann1 A).() -> kotlin.Unit): kotlin.Unit +public fun foo1(/*0*/ x: (@Ann1 D).() -> kotlin.Unit): kotlin.Unit +public fun foo2(/*0*/ x: (@Ann2 D).() -> kotlin.Unit): kotlin.Unit +public fun foo3(/*0*/ x: (@Ann3 D).() -> kotlin.Unit): kotlin.Unit public fun test(): kotlin.Unit public final class A { diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/threeImplicitReceivers2.txt b/compiler/testData/diagnostics/tests/resolve/dslMarker/threeImplicitReceivers2.txt index b4ac66465be..6ca56284e1c 100644 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/threeImplicitReceivers2.txt +++ b/compiler/testData/diagnostics/tests/resolve/dslMarker/threeImplicitReceivers2.txt @@ -1,11 +1,11 @@ package -public fun bar(/*0*/ x: @Ann2 B.() -> kotlin.Unit): kotlin.Unit -public fun baz(/*0*/ x: @Ann3 C.() -> kotlin.Unit): kotlin.Unit -public fun foo(/*0*/ x: @Ann1 A.() -> kotlin.Unit): kotlin.Unit -public fun foo1(/*0*/ x: @Ann1 D.() -> kotlin.Unit): kotlin.Unit -public fun foo2(/*0*/ x: @Ann2 D.() -> kotlin.Unit): kotlin.Unit -public fun foo3(/*0*/ x: @Ann3 D.() -> kotlin.Unit): kotlin.Unit +public fun bar(/*0*/ x: (@Ann2 B).() -> kotlin.Unit): kotlin.Unit +public fun baz(/*0*/ x: (@Ann3 C).() -> kotlin.Unit): kotlin.Unit +public fun foo(/*0*/ x: (@Ann1 A).() -> kotlin.Unit): kotlin.Unit +public fun foo1(/*0*/ x: (@Ann1 D).() -> kotlin.Unit): kotlin.Unit +public fun foo2(/*0*/ x: (@Ann2 D).() -> kotlin.Unit): kotlin.Unit +public fun foo3(/*0*/ x: (@Ann3 D).() -> kotlin.Unit): kotlin.Unit public fun test(): kotlin.Unit public final class A { diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/twoImplicitReceivers.txt b/compiler/testData/diagnostics/tests/resolve/dslMarker/twoImplicitReceivers.txt index 025cce2dbee..27e6992017b 100644 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/twoImplicitReceivers.txt +++ b/compiler/testData/diagnostics/tests/resolve/dslMarker/twoImplicitReceivers.txt @@ -1,8 +1,8 @@ package -public fun bar(/*0*/ x: @Ann2 B.() -> kotlin.Unit): kotlin.Unit -public fun baz(/*0*/ x: @Ann1 D.() -> kotlin.Unit): kotlin.Unit -public fun foo(/*0*/ x: @Ann1 A.() -> kotlin.Unit): kotlin.Unit +public fun bar(/*0*/ x: (@Ann2 B).() -> kotlin.Unit): kotlin.Unit +public fun baz(/*0*/ x: (@Ann1 D).() -> kotlin.Unit): kotlin.Unit +public fun foo(/*0*/ x: (@Ann1 A).() -> kotlin.Unit): kotlin.Unit public fun test(): kotlin.Unit public final class A { diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/twoLanguages.txt b/compiler/testData/diagnostics/tests/resolve/dslMarker/twoLanguages.txt index fa000bc836c..5a97271a267 100644 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/twoLanguages.txt +++ b/compiler/testData/diagnostics/tests/resolve/dslMarker/twoLanguages.txt @@ -1,9 +1,9 @@ package -public fun bar1(/*0*/ x: @L1 B.() -> kotlin.Unit): kotlin.Unit -public fun bar2(/*0*/ x: @L2 B.() -> kotlin.Unit): kotlin.Unit -public fun foo1(/*0*/ x: @L1 A.() -> kotlin.Unit): kotlin.Unit -public fun foo2(/*0*/ x: @L2 A.() -> kotlin.Unit): kotlin.Unit +public fun bar1(/*0*/ x: (@L1 B).() -> kotlin.Unit): kotlin.Unit +public fun bar2(/*0*/ x: (@L2 B).() -> kotlin.Unit): kotlin.Unit +public fun foo1(/*0*/ x: (@L1 A).() -> kotlin.Unit): kotlin.Unit +public fun foo2(/*0*/ x: (@L2 A).() -> kotlin.Unit): kotlin.Unit public fun test(): kotlin.Unit public final class A { diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/usingWithThis.txt b/compiler/testData/diagnostics/tests/resolve/dslMarker/usingWithThis.txt index f357dd91e2b..437f60f4872 100644 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/usingWithThis.txt +++ b/compiler/testData/diagnostics/tests/resolve/dslMarker/usingWithThis.txt @@ -1,7 +1,7 @@ package -public fun bar(/*0*/ x: @Ann B.() -> kotlin.Unit): kotlin.Unit -public fun foo(/*0*/ x: @Ann A.() -> kotlin.Unit): kotlin.Unit +public fun bar(/*0*/ x: (@Ann B).() -> kotlin.Unit): kotlin.Unit +public fun foo(/*0*/ x: (@Ann A).() -> kotlin.Unit): kotlin.Unit public fun test(): kotlin.Unit public final class A { diff --git a/compiler/testData/psi/TypeModifiers.kt b/compiler/testData/psi/TypeModifiers.kt index 1cf609c4de0..93284a8342b 100644 --- a/compiler/testData/psi/TypeModifiers.kt +++ b/compiler/testData/psi/TypeModifiers.kt @@ -2,7 +2,9 @@ val p1: suspend a val p2: suspend (a) -> a val p3: suspend (a) -> suspend a val p4: suspend a.() -> a +val p4a: @a a.() -> a val p5: (suspend a).() -> a +val p5a: (@a a).() -> a val p6: a val p7: a val p8: a diff --git a/compiler/testData/psi/TypeModifiers.txt b/compiler/testData/psi/TypeModifiers.txt index 2810d2d0a3e..6ae01c6494b 100644 --- a/compiler/testData/psi/TypeModifiers.txt +++ b/compiler/testData/psi/TypeModifiers.txt @@ -102,6 +102,40 @@ JetFile: TypeModifiers.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') PsiWhiteSpace('\n') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('p4a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + MODIFIER_LIST + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + FUNCTION_TYPE + FUNCTION_TYPE_RECEIVER + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace('\n') PROPERTY PsiElement(val)('val') PsiWhiteSpace(' ') @@ -132,6 +166,42 @@ JetFile: TypeModifiers.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') PsiWhiteSpace('\n') + PROPERTY + PsiElement(val)('val') + PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('p5a') + PsiElement(COLON)(':') + PsiWhiteSpace(' ') + TYPE_REFERENCE + FUNCTION_TYPE + FUNCTION_TYPE_RECEIVER + TYPE_REFERENCE + PsiElement(LPAR)('(') + MODIFIER_LIST + ANNOTATION_ENTRY + PsiElement(AT)('@') + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace(' ') + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiElement(RPAR)(')') + PsiElement(DOT)('.') + VALUE_PARAMETER_LIST + PsiElement(LPAR)('(') + PsiElement(RPAR)(')') + PsiWhiteSpace(' ') + PsiElement(ARROW)('->') + PsiWhiteSpace(' ') + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('a') + PsiWhiteSpace('\n') PROPERTY PsiElement(val)('val') PsiWhiteSpace(' ') diff --git a/core/descriptors/src/org/jetbrains/kotlin/renderer/DescriptorRendererImpl.kt b/core/descriptors/src/org/jetbrains/kotlin/renderer/DescriptorRendererImpl.kt index 38fb7bab41a..acc908a8acf 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/renderer/DescriptorRendererImpl.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/renderer/DescriptorRendererImpl.kt @@ -327,7 +327,8 @@ internal class DescriptorRendererImpl( } if (receiverType != null) { - val surroundReceiver = shouldRenderAsPrettyFunctionType(receiverType) && !receiverType.isMarkedNullable + val surroundReceiver = shouldRenderAsPrettyFunctionType(receiverType) && !receiverType.isMarkedNullable || + receiverType.hasModifiersOrAnnotations() if (surroundReceiver) { append("(") } @@ -361,6 +362,8 @@ internal class DescriptorRendererImpl( if (isNullable) append("?") } + private fun KotlinType.hasModifiersOrAnnotations() = + isSuspendFunctionType || !annotations.isEmpty() /* METHODS FOR ALL KINDS OF DESCRIPTORS */ private fun StringBuilder.appendDefinedIn(descriptor: DeclarationDescriptor) { diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/TypeClsStubBuilder.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/TypeClsStubBuilder.kt index 49b6992ffd0..ef6300b9a4a 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/TypeClsStubBuilder.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/TypeClsStubBuilder.kt @@ -95,7 +95,6 @@ class TypeClsStubBuilder(private val c: ClsStubBuilderContext) { val (extensionAnnotations, notExtensionAnnotations) = annotations.partition { it.asSingleFqName() == KotlinBuiltIns.FQ_NAMES.extensionFunctionType } - createTypeAnnotationStubs(parent, type, notExtensionAnnotations) val isExtension = extensionAnnotations.isNotEmpty() diff --git a/idea/testData/decompiler/stubBuilder/AnnotationsOnNullableTypes/AnnotationsOnNullableTypes.kt b/idea/testData/decompiler/stubBuilder/AnnotationsOnNullableTypes/AnnotationsOnNullableTypes.kt index 8e370414915..932165dcf99 100644 --- a/idea/testData/decompiler/stubBuilder/AnnotationsOnNullableTypes/AnnotationsOnNullableTypes.kt +++ b/idea/testData/decompiler/stubBuilder/AnnotationsOnNullableTypes/AnnotationsOnNullableTypes.kt @@ -17,7 +17,9 @@ public class AnnotationsOnNullableTypes { val lambdaReturnValue: () -> @A C? = null!! - val lambdaReceiver: @A C?.() -> C = null!! + val lambdaReceiver: (@A C?).() -> C = null!! + + val lambdaTypeWithNullableReceiver: @A C?.() -> C = null!! } @Target(AnnotationTarget.TYPE, AnnotationTarget.TYPE_PARAMETER) diff --git a/idea/testData/decompiler/stubBuilder/AnnotationsOnNullableTypes/AnnotationsOnNullableTypes.txt b/idea/testData/decompiler/stubBuilder/AnnotationsOnNullableTypes/AnnotationsOnNullableTypes.txt index 153160eeb6e..515d977c5e6 100644 --- a/idea/testData/decompiler/stubBuilder/AnnotationsOnNullableTypes/AnnotationsOnNullableTypes.txt +++ b/idea/testData/decompiler/stubBuilder/AnnotationsOnNullableTypes/AnnotationsOnNullableTypes.txt @@ -23,15 +23,15 @@ PsiJetFileStubImpl[package=] PROPERTY[fqName=AnnotationsOnNullableTypes.lambdaReceiver, hasDelegate=false, hasDelegateExpression=false, hasInitializer=false, hasReturnTypeRef=true, isExtension=false, isTopLevel=false, isVar=false, name=lambdaReceiver] MODIFIER_LIST[public final] TYPE_REFERENCE - MODIFIER_LIST[] - ANNOTATION_ENTRY[hasValueArguments=false, shortName=A] - CONSTRUCTOR_CALLEE - TYPE_REFERENCE - USER_TYPE - REFERENCE_EXPRESSION[referencedName=A] FUNCTION_TYPE FUNCTION_TYPE_RECEIVER TYPE_REFERENCE + MODIFIER_LIST[] + ANNOTATION_ENTRY[hasValueArguments=false, shortName=A] + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION[referencedName=A] NULLABLE_TYPE USER_TYPE REFERENCE_EXPRESSION[referencedName=C] @@ -69,6 +69,25 @@ PsiJetFileStubImpl[package=] TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION[referencedName=C] + PROPERTY[fqName=AnnotationsOnNullableTypes.lambdaTypeWithNullableReceiver, hasDelegate=false, hasDelegateExpression=false, hasInitializer=false, hasReturnTypeRef=true, isExtension=false, isTopLevel=false, isVar=false, name=lambdaTypeWithNullableReceiver] + MODIFIER_LIST[public final] + TYPE_REFERENCE + MODIFIER_LIST[] + ANNOTATION_ENTRY[hasValueArguments=false, shortName=A] + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION[referencedName=A] + FUNCTION_TYPE + FUNCTION_TYPE_RECEIVER + TYPE_REFERENCE + NULLABLE_TYPE + USER_TYPE + REFERENCE_EXPRESSION[referencedName=C] + VALUE_PARAMETER_LIST + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION[referencedName=C] FUN[fqName=AnnotationsOnNullableTypes.parameter, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=parameter] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST diff --git a/idea/testData/decompiler/stubBuilder/TypeModifiers/TypeModifiers.kt b/idea/testData/decompiler/stubBuilder/TypeModifiers/TypeModifiers.kt new file mode 100644 index 00000000000..feaa33d0d72 --- /dev/null +++ b/idea/testData/decompiler/stubBuilder/TypeModifiers/TypeModifiers.kt @@ -0,0 +1,7 @@ +public class TypeModifiers { + val suspendFunction: suspend () -> Unit = null!! + + val suspendExtFunction: suspend Any.() -> Unit = null!! + + val functionOnSuspendFunction: (suspend () -> Unit).() -> Unit = null!! +} \ No newline at end of file diff --git a/idea/testData/decompiler/stubBuilder/TypeModifiers/TypeModifiers.txt b/idea/testData/decompiler/stubBuilder/TypeModifiers/TypeModifiers.txt new file mode 100644 index 00000000000..d30b77a21ae --- /dev/null +++ b/idea/testData/decompiler/stubBuilder/TypeModifiers/TypeModifiers.txt @@ -0,0 +1,54 @@ +PsiJetFileStubImpl[package=] + PACKAGE_DIRECTIVE + IMPORT_LIST + CLASS[fqName=TypeModifiers, isEnumEntry=false, isInterface=false, isLocal=false, isTopLevel=true, name=TypeModifiers, superNames=[]] + MODIFIER_LIST[public final] + PRIMARY_CONSTRUCTOR + MODIFIER_LIST[public] + VALUE_PARAMETER_LIST + CLASS_BODY + PROPERTY[fqName=TypeModifiers.functionOnSuspendFunction, hasDelegate=false, hasDelegateExpression=false, hasInitializer=false, hasReturnTypeRef=true, isExtension=false, isTopLevel=false, isVar=false, name=functionOnSuspendFunction] + MODIFIER_LIST[public final] + TYPE_REFERENCE + FUNCTION_TYPE + FUNCTION_TYPE_RECEIVER + TYPE_REFERENCE + FUNCTION_TYPE + VALUE_PARAMETER_LIST + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION[referencedName=kotlin] + REFERENCE_EXPRESSION[referencedName=Unit] + VALUE_PARAMETER_LIST + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION[referencedName=kotlin] + REFERENCE_EXPRESSION[referencedName=Unit] + PROPERTY[fqName=TypeModifiers.suspendExtFunction, hasDelegate=false, hasDelegateExpression=false, hasInitializer=false, hasReturnTypeRef=true, isExtension=false, isTopLevel=false, isVar=false, name=suspendExtFunction] + MODIFIER_LIST[public final] + TYPE_REFERENCE + FUNCTION_TYPE + FUNCTION_TYPE_RECEIVER + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION[referencedName=kotlin] + REFERENCE_EXPRESSION[referencedName=Any] + VALUE_PARAMETER_LIST + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION[referencedName=kotlin] + REFERENCE_EXPRESSION[referencedName=Unit] + PROPERTY[fqName=TypeModifiers.suspendFunction, hasDelegate=false, hasDelegateExpression=false, hasInitializer=false, hasReturnTypeRef=true, isExtension=false, isTopLevel=false, isVar=false, name=suspendFunction] + MODIFIER_LIST[public final] + TYPE_REFERENCE + FUNCTION_TYPE + VALUE_PARAMETER_LIST + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION[referencedName=kotlin] + REFERENCE_EXPRESSION[referencedName=Unit] diff --git a/idea/tests/org/jetbrains/kotlin/idea/decompiler/stubBuilder/ClsStubBuilderTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/decompiler/stubBuilder/ClsStubBuilderTestGenerated.java index 02fe7592f90..39e7ed558e7 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/decompiler/stubBuilder/ClsStubBuilderTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/decompiler/stubBuilder/ClsStubBuilderTestGenerated.java @@ -198,6 +198,12 @@ public class ClsStubBuilderTestGenerated extends AbstractClsStubBuilderTest { doTest(fileName); } + @TestMetadata("TypeModifiers") + public void testTypeModifiers() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/decompiler/stubBuilder/TypeModifiers/"); + doTest(fileName); + } + @TestMetadata("TypeParams") public void testTypeParams() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/testData/decompiler/stubBuilder/TypeParams/");