diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/CallableClsStubBuilder.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/CallableClsStubBuilder.kt index 3e2ce826333..d41f929acbe 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/CallableClsStubBuilder.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/CallableClsStubBuilder.kt @@ -133,7 +133,7 @@ private class FunctionClsStubBuilder( val modalityModifier = if (isTopLevel) listOf() else listOf(MODALITY) val modifierListStubImpl = createModifierListStubForDeclaration( callableStub, functionProto.flags, - listOf(VISIBILITY, OPERATOR, INFIX) + modalityModifier + listOf(VISIBILITY, OPERATOR, INFIX, EXTERNAL_FUN, INLINE, TAILREC) + modalityModifier ) val annotationIds = c.components.annotationLoader.loadCallableAnnotations( diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/ClassClsStubBuilder.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/ClassClsStubBuilder.kt index c7f947dd215..dfe59d02ce1 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/ClassClsStubBuilder.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/ClassClsStubBuilder.kt @@ -94,6 +94,7 @@ private class ClassClsStubBuilder( val additionalModifiers = when (classKind) { ProtoBuf.Class.Kind.ENUM_CLASS -> listOf(JetTokens.ENUM_KEYWORD) ProtoBuf.Class.Kind.COMPANION_OBJECT -> listOf(JetTokens.COMPANION_KEYWORD) + ProtoBuf.Class.Kind.ANNOTATION_CLASS -> listOf(JetTokens.ANNOTATION_KEYWORD) else -> listOf() } return createModifierListStubForDeclaration(parent, classProto.getFlags(), relevantFlags, additionalModifiers) 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 cb5b93c4abe..f463830b532 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 @@ -30,6 +30,7 @@ import org.jetbrains.kotlin.psi.* import org.jetbrains.kotlin.psi.stubs.KotlinUserTypeStub import org.jetbrains.kotlin.psi.stubs.elements.JetStubElementTypes import org.jetbrains.kotlin.psi.stubs.impl.* +import org.jetbrains.kotlin.serialization.Flags import org.jetbrains.kotlin.serialization.ProtoBuf import org.jetbrains.kotlin.serialization.ProtoBuf.Type import org.jetbrains.kotlin.serialization.ProtoBuf.Type.Argument.Projection @@ -162,8 +163,13 @@ class TypeClsStubBuilder(private val c: ClsStubBuilderContext) { ) val varargElementType = valueParameterProto.varargElementType(c.typeTable) val typeProto = varargElementType ?: valueParameterProto.type(c.typeTable) - val modifierList = - if (varargElementType != null) createModifierListStub(parameterStub, listOf(JetTokens.VARARG_KEYWORD)) else null + val modifiers = arrayListOf() + + if (varargElementType != null) { modifiers.add(JetTokens.VARARG_KEYWORD) } + if (Flags.IS_CROSSINLINE.get(valueParameterProto.flags)) { modifiers.add(JetTokens.CROSSINLINE_KEYWORD) } + if (Flags.IS_NOINLINE.get(valueParameterProto.flags)) { modifiers.add(JetTokens.NOINLINE_KEYWORD) } + + val modifierList = createModifierListStub(parameterStub, modifiers) val parameterAnnotations = c.components.annotationLoader.loadValueParameterAnnotations( container, callableProto, callableProto.annotatedCallableKind, index, valueParameterProto ) diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/clsStubBuilding.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/clsStubBuilding.kt index ac6023f1207..37fcc7a8af7 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/clsStubBuilding.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/clsStubBuilding.kt @@ -209,6 +209,24 @@ enum class FlagsToModifiers { override fun getModifiers(flags: Int): JetModifierKeywordToken? { return if (Flags.IS_DATA.get(flags)) JetTokens.DATA_KEYWORD else null } + }, + + EXTERNAL_FUN { + override fun getModifiers(flags: Int): JetModifierKeywordToken? { + return if (Flags.IS_EXTERNAL_FUNCTION.get(flags)) JetTokens.EXTERNAL_KEYWORD else null + } + }, + + INLINE { + override fun getModifiers(flags: Int): JetModifierKeywordToken? { + return if (Flags.IS_INLINE.get(flags)) JetTokens.INLINE_KEYWORD else null + } + }, + + TAILREC { + override fun getModifiers(flags: Int): JetModifierKeywordToken? { + return if (Flags.IS_TAILREC.get(flags)) JetTokens.TAILREC_KEYWORD else null + } }; abstract fun getModifiers(flags: Int): JetModifierKeywordToken? diff --git a/idea/testData/decompiler/decompiledText/Annotations.expected.kt b/idea/testData/decompiler/decompiledText/Annotations.expected.kt index 505256ae69d..77d0d529a35 100644 --- a/idea/testData/decompiler/decompiledText/Annotations.expected.kt +++ b/idea/testData/decompiler/decompiledText/Annotations.expected.kt @@ -4,7 +4,7 @@ package test @dependency.A @dependency.B @dependency.C public final class Annotations public constructor() { - @dependency.A @dependency.B @dependency.C @kotlin.inline public final val p: @dependency.B kotlin.Int /* compiled code */ + @dependency.A @dependency.B @dependency.C public final val p: @dependency.B kotlin.Int /* compiled code */ - @dependency.A @dependency.B @dependency.C @kotlin.inline public final fun f(@dependency.A @dependency.B @dependency.C i: @dependency.A kotlin.Int): kotlin.Unit { /* compiled code */ } + @dependency.A @dependency.B @dependency.C public final inline fun f(@dependency.A @dependency.B @dependency.C i: @dependency.A kotlin.Int): kotlin.Unit { /* compiled code */ } } \ No newline at end of file diff --git a/idea/testData/decompiler/decompiledText/Annotations/Annotations.kt b/idea/testData/decompiler/decompiledText/Annotations/Annotations.kt index 963e55ac4f2..ce3c60122a2 100644 --- a/idea/testData/decompiler/decompiledText/Annotations/Annotations.kt +++ b/idea/testData/decompiler/decompiledText/Annotations/Annotations.kt @@ -7,5 +7,5 @@ import dependency.* inline @A("f") @B(2) @C fun f(@A("i") @B(3) @C i: @A("int") Int) { } - inline @A("p") @B(3) @C val p: @B(4) Int = 2 + @A("p") @B(3) @C val p: @B(4) Int = 2 } diff --git a/idea/testData/decompiler/decompiledText/Modifiers.expected.kt b/idea/testData/decompiler/decompiledText/Modifiers.expected.kt index ddb9f0dbb8c..6cdcdb57a09 100644 --- a/idea/testData/decompiler/decompiledText/Modifiers.expected.kt +++ b/idea/testData/decompiler/decompiledText/Modifiers.expected.kt @@ -3,6 +3,12 @@ package test -public final data class Modifiers public constructor() { -} +public final data class Modifiers public constructor(x: kotlin.Int) { + public final val x: kotlin.Int /* compiled code */ + public final operator fun component1(): kotlin.Int { /* compiled code */ } + + public final inline fun inlined(crossinline arg1: () -> kotlin.Unit, noinline arg2: () -> kotlin.Unit): kotlin.Unit { /* compiled code */ } + + public final tailrec fun sum(x: kotlin.Long, sum: kotlin.Long): kotlin.Long { /* compiled code */ } +} diff --git a/idea/testData/decompiler/decompiledText/Modifiers/Modifiers.kt b/idea/testData/decompiler/decompiledText/Modifiers/Modifiers.kt index 2088a71a438..46f5123a019 100644 --- a/idea/testData/decompiler/decompiledText/Modifiers/Modifiers.kt +++ b/idea/testData/decompiler/decompiledText/Modifiers/Modifiers.kt @@ -1,3 +1,12 @@ package test -data class Modifiers \ No newline at end of file +data class Modifiers(val x: Int) { + tailrec fun sum(x: Long, sum: Long): Long { + if (x == 0.toLong()) return sum + return sum(x - 1, sum + x) + } + + inline fun inlined(crossinline arg1: ()->Unit, noinline arg2: ()->Unit): Unit {} +} + +annotation class Ann \ No newline at end of file diff --git a/idea/testData/decompiler/decompiledTextJvm/Modifiers.expected.kt b/idea/testData/decompiler/decompiledTextJvm/Modifiers.expected.kt new file mode 100644 index 00000000000..ade7a724e16 --- /dev/null +++ b/idea/testData/decompiler/decompiledTextJvm/Modifiers.expected.kt @@ -0,0 +1,11 @@ +// IntelliJ API Decompiler stub source generated from a class file +// Implementation of methods is not available + +package test + +public final class Modifiers public constructor() { + public final var extVar: kotlin.Int /* compiled code */ + + public final external fun extFun(): kotlin.Unit { /* compiled code */ } +} + diff --git a/idea/testData/decompiler/decompiledTextJvm/Modifiers/Modifiers.kt b/idea/testData/decompiler/decompiledTextJvm/Modifiers/Modifiers.kt new file mode 100644 index 00000000000..f10923c2379 --- /dev/null +++ b/idea/testData/decompiler/decompiledTextJvm/Modifiers/Modifiers.kt @@ -0,0 +1,9 @@ +package test + +class Modifiers { + external fun extFun() + + var extVar: Int = 1 + external get + external set +} diff --git a/idea/testData/decompiler/navigation/decompiled/MainKt.kt b/idea/testData/decompiler/navigation/decompiled/MainKt.kt index fd8839e3489..1ba7ee3ff70 100644 --- a/idea/testData/decompiler/navigation/decompiled/MainKt.kt +++ b/idea/testData/decompiler/navigation/decompiled/MainKt.kt @@ -33,4 +33,4 @@ package testData.libraries [public fun processDouble(d: testData.libraries.Double): kotlin.Unit { /* compiled code */ }] -[@kotlin.inline public fun T.filter(predicate: (T) -> kotlin.Boolean): T? { /* compiled code */ }] \ No newline at end of file +[public inline fun T.filter(predicate: (T) -> kotlin.Boolean): T? { /* compiled code */ }] \ No newline at end of file diff --git a/idea/testData/decompiler/stubBuilder/AnnotationClass/AnnotationClass.txt b/idea/testData/decompiler/stubBuilder/AnnotationClass/AnnotationClass.txt index 4f231a50cc5..cf8bc0020c3 100644 --- a/idea/testData/decompiler/stubBuilder/AnnotationClass/AnnotationClass.txt +++ b/idea/testData/decompiler/stubBuilder/AnnotationClass/AnnotationClass.txt @@ -5,16 +5,7 @@ PsiJetFileStubImpl[package=test.a] REFERENCE_EXPRESSION:[referencedName=a] IMPORT_LIST: CLASS:[fqName=test.a.AnnotationClass, isEnumEntry=false, isInterface=false, isLocal=false, isTopLevel=true, name=AnnotationClass, superNames=[Annotation]] - MODIFIER_LIST:[public final] - ANNOTATION_ENTRY:[hasValueArguments=false, shortName=annotation] - CONSTRUCTOR_CALLEE: - TYPE_REFERENCE: - USER_TYPE:[isAbsoluteInRootPackage=false] - USER_TYPE:[isAbsoluteInRootPackage=false] - USER_TYPE:[isAbsoluteInRootPackage=false] - REFERENCE_EXPRESSION:[referencedName=kotlin] - REFERENCE_EXPRESSION:[referencedName=annotation] - REFERENCE_EXPRESSION:[referencedName=annotation] + MODIFIER_LIST:[public final annotation] PRIMARY_CONSTRUCTOR: MODIFIER_LIST:[public] VALUE_PARAMETER_LIST: diff --git a/idea/testData/decompiler/stubBuilder/ClassObject/ClassObject.txt b/idea/testData/decompiler/stubBuilder/ClassObject/ClassObject.txt index d6f1d91679d..a4233655fad 100644 --- a/idea/testData/decompiler/stubBuilder/ClassObject/ClassObject.txt +++ b/idea/testData/decompiler/stubBuilder/ClassObject/ClassObject.txt @@ -113,16 +113,7 @@ PsiJetFileStubImpl[package=test.class_object] REFERENCE_EXPRESSION:[referencedName=kotlin] REFERENCE_EXPRESSION:[referencedName=Unit] CLASS:[fqName=test.class_object.ClassObject.B.Companion.C.Companion.D.Companion.Anno, isEnumEntry=false, isInterface=false, isLocal=false, isTopLevel=false, name=Anno, superNames=[Annotation]] - MODIFIER_LIST:[public final] - ANNOTATION_ENTRY:[hasValueArguments=false, shortName=annotation] - CONSTRUCTOR_CALLEE: - TYPE_REFERENCE: - USER_TYPE:[isAbsoluteInRootPackage=false] - USER_TYPE:[isAbsoluteInRootPackage=false] - USER_TYPE:[isAbsoluteInRootPackage=false] - REFERENCE_EXPRESSION:[referencedName=kotlin] - REFERENCE_EXPRESSION:[referencedName=annotation] - REFERENCE_EXPRESSION:[referencedName=annotation] + MODIFIER_LIST:[public final annotation] PRIMARY_CONSTRUCTOR: MODIFIER_LIST:[public] VALUE_PARAMETER_LIST: diff --git a/idea/testData/decompiler/stubBuilder/Modifiers/Modifiers.kt b/idea/testData/decompiler/stubBuilder/Modifiers/Modifiers.kt index 2088a71a438..08a9b9fae99 100644 --- a/idea/testData/decompiler/stubBuilder/Modifiers/Modifiers.kt +++ b/idea/testData/decompiler/stubBuilder/Modifiers/Modifiers.kt @@ -1,3 +1,18 @@ package test -data class Modifiers \ No newline at end of file +data class Modifiers(val x: Int) { + external fun extFun() + + var extVar: Int = 1 + external get + external set + + tailrec fun sum(x: Long, sum: Long): Long { + if (x == 0.toLong()) return sum + return sum(x - 1, sum + x) + } + + inline fun inlined(crossinline arg1: ()->Unit, noinline arg2: ()->Unit): Unit {} + + annotation class Ann +} \ No newline at end of file diff --git a/idea/testData/decompiler/stubBuilder/Modifiers/Modifiers.txt b/idea/testData/decompiler/stubBuilder/Modifiers/Modifiers.txt index eb08f37b895..e3c6379ecb8 100644 --- a/idea/testData/decompiler/stubBuilder/Modifiers/Modifiers.txt +++ b/idea/testData/decompiler/stubBuilder/Modifiers/Modifiers.txt @@ -7,4 +7,101 @@ PsiJetFileStubImpl[package=test] PRIMARY_CONSTRUCTOR: MODIFIER_LIST:[public] VALUE_PARAMETER_LIST: + VALUE_PARAMETER:[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=x] + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=kotlin] + REFERENCE_EXPRESSION:[referencedName=Int] CLASS_BODY: + PROPERTY:[fqName=test.Modifiers.extVar, hasDelegate=false, hasDelegateExpression=false, hasInitializer=false, hasReturnTypeRef=true, isExtension=false, isTopLevel=false, isVar=true, name=extVar] + MODIFIER_LIST:[public final] + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=kotlin] + REFERENCE_EXPRESSION:[referencedName=Int] + PROPERTY:[fqName=test.Modifiers.x, hasDelegate=false, hasDelegateExpression=false, hasInitializer=false, hasReturnTypeRef=true, isExtension=false, isTopLevel=false, isVar=false, name=x] + MODIFIER_LIST:[public final] + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=kotlin] + REFERENCE_EXPRESSION:[referencedName=Int] + FUN:[fqName=test.Modifiers.component1, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=component1] + MODIFIER_LIST:[public final operator] + VALUE_PARAMETER_LIST: + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=kotlin] + REFERENCE_EXPRESSION:[referencedName=Int] + FUN:[fqName=test.Modifiers.extFun, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=extFun] + MODIFIER_LIST:[public final external] + VALUE_PARAMETER_LIST: + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=kotlin] + REFERENCE_EXPRESSION:[referencedName=Unit] + FUN:[fqName=test.Modifiers.inlined, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=inlined] + MODIFIER_LIST:[public final inline] + VALUE_PARAMETER_LIST: + VALUE_PARAMETER:[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=arg1] + MODIFIER_LIST:[crossinline] + TYPE_REFERENCE: + FUNCTION_TYPE: + VALUE_PARAMETER_LIST: + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=kotlin] + REFERENCE_EXPRESSION:[referencedName=Unit] + VALUE_PARAMETER:[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=arg2] + MODIFIER_LIST:[noinline] + TYPE_REFERENCE: + FUNCTION_TYPE: + VALUE_PARAMETER_LIST: + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=kotlin] + REFERENCE_EXPRESSION:[referencedName=Unit] + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=kotlin] + REFERENCE_EXPRESSION:[referencedName=Unit] + FUN:[fqName=test.Modifiers.sum, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=sum] + MODIFIER_LIST:[public final tailrec] + VALUE_PARAMETER_LIST: + VALUE_PARAMETER:[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=x] + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=kotlin] + REFERENCE_EXPRESSION:[referencedName=Long] + VALUE_PARAMETER:[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=sum] + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=kotlin] + REFERENCE_EXPRESSION:[referencedName=Long] + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=kotlin] + REFERENCE_EXPRESSION:[referencedName=Long] + CLASS:[fqName=test.Modifiers.Ann, isEnumEntry=false, isInterface=false, isLocal=false, isTopLevel=false, name=Ann, superNames=[Annotation]] + MODIFIER_LIST:[public final annotation] + PRIMARY_CONSTRUCTOR: + MODIFIER_LIST:[public] + VALUE_PARAMETER_LIST: + DELEGATION_SPECIFIER_LIST: + DELEGATOR_SUPER_CLASS: + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=kotlin] + REFERENCE_EXPRESSION:[referencedName=Annotation] + CLASS_BODY: diff --git a/idea/testData/decompiler/stubBuilder/NamedCompanionObject/NamedCompanionObject.txt b/idea/testData/decompiler/stubBuilder/NamedCompanionObject/NamedCompanionObject.txt index f634410b424..384fb97707b 100644 --- a/idea/testData/decompiler/stubBuilder/NamedCompanionObject/NamedCompanionObject.txt +++ b/idea/testData/decompiler/stubBuilder/NamedCompanionObject/NamedCompanionObject.txt @@ -111,16 +111,7 @@ PsiJetFileStubImpl[package=test] REFERENCE_EXPRESSION:[referencedName=kotlin] REFERENCE_EXPRESSION:[referencedName=Unit] CLASS:[fqName=test.NamedCompanionObject.B.NamedInB.C.NamedInC.D.Companion.Anno, isEnumEntry=false, isInterface=false, isLocal=false, isTopLevel=false, name=Anno, superNames=[Annotation]] - MODIFIER_LIST:[public final] - ANNOTATION_ENTRY:[hasValueArguments=false, shortName=annotation] - CONSTRUCTOR_CALLEE: - TYPE_REFERENCE: - USER_TYPE:[isAbsoluteInRootPackage=false] - USER_TYPE:[isAbsoluteInRootPackage=false] - USER_TYPE:[isAbsoluteInRootPackage=false] - REFERENCE_EXPRESSION:[referencedName=kotlin] - REFERENCE_EXPRESSION:[referencedName=annotation] - REFERENCE_EXPRESSION:[referencedName=annotation] + MODIFIER_LIST:[public final annotation] PRIMARY_CONSTRUCTOR: MODIFIER_LIST:[public] VALUE_PARAMETER_LIST: diff --git a/idea/testData/decompiler/stubBuilder/TypeParams/TypeParams.txt b/idea/testData/decompiler/stubBuilder/TypeParams/TypeParams.txt index 007ad2ea0f2..d6f4ba36af9 100644 --- a/idea/testData/decompiler/stubBuilder/TypeParams/TypeParams.txt +++ b/idea/testData/decompiler/stubBuilder/TypeParams/TypeParams.txt @@ -124,14 +124,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=G1] FUN:[fqName=test.TypeParams.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=false, isTopLevel=false, name=f] - MODIFIER_LIST:[public final] - ANNOTATION_ENTRY:[hasValueArguments=false, shortName=inline] - CONSTRUCTOR_CALLEE: - TYPE_REFERENCE: - USER_TYPE:[isAbsoluteInRootPackage=false] - USER_TYPE:[isAbsoluteInRootPackage=false] - REFERENCE_EXPRESSION:[referencedName=kotlin] - REFERENCE_EXPRESSION:[referencedName=inline] + MODIFIER_LIST:[public final inline] TYPE_PARAMETER_LIST: TYPE_PARAMETER:[fqName=null, isInVariance=false, isOutVariance=false, name=G] MODIFIER_LIST:[reified] diff --git a/idea/testData/editor/quickDoc/MethodFromStdLib.kt b/idea/testData/editor/quickDoc/MethodFromStdLib.kt index a2e473d84fc..e699c32c094 100644 --- a/idea/testData/editor/quickDoc/MethodFromStdLib.kt +++ b/idea/testData/editor/quickDoc/MethodFromStdLib.kt @@ -2,4 +2,4 @@ fun test() { listOf(1, 2, 4).filter { it > 0 } } -//INFO: @inline public fun <T> Iterable<T>.filter(predicate: (T) → Boolean): List<T> defined in kotlin

Returns a list containing all elements matching the given predicate.

+//INFO: public inline fun <T> Iterable<T>.filter(predicate: (T) → Boolean): List<T> defined in kotlin

Returns a list containing all elements matching the given predicate.

diff --git a/idea/tests/org/jetbrains/kotlin/idea/decompiler/textBuilder/JvmDecompiledTextTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/decompiler/textBuilder/JvmDecompiledTextTestGenerated.java index ca5d31e0ebd..3bb8ee878a2 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/decompiler/textBuilder/JvmDecompiledTextTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/decompiler/textBuilder/JvmDecompiledTextTestGenerated.java @@ -35,6 +35,12 @@ public class JvmDecompiledTextTestGenerated extends AbstractJvmDecompiledTextTes JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/decompiler/decompiledTextJvm"), Pattern.compile("^([^\\.]+)$"), true); } + @TestMetadata("Modifiers") + public void testModifiers() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/decompiler/decompiledTextJvm/Modifiers/"); + doTest(fileName); + } + @TestMetadata("MultifileClass") public void testMultifileClass() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/decompiler/decompiledTextJvm/MultifileClass/");