From 5ab79a111db425e32c658805ec6db9ed9c8a674f Mon Sep 17 00:00:00 2001 From: Dmitry Savvinov Date: Fri, 27 Jul 2018 11:18:13 +0300 Subject: [PATCH] Introduce 'mayHaveContract'-flag in stubs This is needed for further commit, which supports contracts-based smartcasts in partial body resolve mode. NB: Stubs can be built from 3 sources: - source code (contract presence can be checked by PSI) - binary data (contract presence can be checked by Kotlin Metadata) - decompiled sources The last case is a bit of a headache, because usually bodies are omitted in decompiled sources. To workaround it, we have to inject stubbed contract-call in the body. --- .../jetbrains/kotlin/psi/KtNamedFunction.java | 10 ++++++++ .../kotlin/psi/stubs/StubInterfaces.kt | 1 + .../stubs/elements/KtFunctionElementType.java | 7 ++++-- .../psi/stubs/impl/KotlinFunctionStubImpl.kt | 4 +++- .../DeserializerForClassfileDecompiler.kt | 10 ++++++-- .../stubBuilder/CallableClsStubBuilder.kt | 3 ++- .../textBuilder/buildDecompiledText.kt | 10 +++++++- .../idea/stubindex/IdeStubIndexService.java | 4 ++++ .../AnnotatedFlexibleTypes.txt | 2 +- .../stubBuilder/Annotations/Annotations.txt | 12 +++++----- .../AnnotationsOnNullableTypes.txt | 14 +++++------ .../AnnotationsOnParenthesizedTypes.txt | 12 +++++----- .../AnonymousReturnWithGenericType.txt | 4 ++-- .../stubBuilder/ClassMembers/ClassMembers.txt | 6 ++--- .../stubBuilder/ClassObject/ClassObject.txt | 8 +++---- .../stubBuilder/Contracts/Contracts.kt | 12 ++++++++++ .../stubBuilder/Contracts/Contracts.txt | 18 +++++++++++++++ .../stubBuilder/DataClass/DataClass.txt | 6 ++--- .../stubBuilder/Delegation/Delegation.txt | 2 +- .../DependencyOnNestedClasses.txt | 2 +- .../decompiler/stubBuilder/Enum/Enum.txt | 2 +- .../FlexibleTypes/FlexibleTypes.txt | 4 ++-- .../InheritingClasses/InheritingClasses.txt | 8 +++---- .../stubBuilder/InnerTypes/InnerTypes.txt | 4 ++-- .../stubBuilder/LocalClass/LocalClass.txt | 2 +- .../stubBuilder/Modifiers/Modifiers.txt | 14 +++++------ .../MultifileClass/MultifileClass.txt | 12 +++++----- .../NamedCompanionObject.txt | 8 +++---- .../NestedClasses/NestedClasses.txt | 12 +++++----- .../stubBuilder/Objects/Objects.txt | 6 ++--- .../PrivateToThis/PrivateToThis.txt | 2 +- .../SuspendLambda/SuspendLambda.txt | 14 +++++------ .../TopJvmPackageName/TopJvmPackageName.txt | 2 +- .../TopLevelMembersAnnotatedKt.txt | 2 +- .../TopLevelMembersKt/TopLevelMembersKt.txt | 12 +++++----- .../stubBuilder/TypeAliases/TypeAliases.txt | 6 ++--- .../stubBuilder/TypeParams/TypeParams.txt | 16 ++++++------- .../decompiler/stubBuilder/Types/Types.txt | 4 ++-- .../stubs/AnnotationOnFunction.expected | 2 +- .../stubs/AnnotationOnLocalFunction.expected | 4 ++-- idea/testData/stubs/ClassObject.expected | 2 +- idea/testData/stubs/Contracts.expected | 23 +++++++++++++++++++ idea/testData/stubs/Contracts.kt | 10 ++++++++ .../stubs/FunctionInNotNamedObject.expected | 2 +- .../stubs/FunctionParameters.expected | 2 +- idea/testData/stubs/LocalClass.expected | 2 +- .../stubs/LocalClassInLocalFunction.expected | 4 ++-- idea/testData/stubs/LocalNamedObject.expected | 2 +- .../stubs/ManyAnnotationsOnFunction.expected | 2 +- .../stubs/MembersInLocalClass.expected | 4 ++-- .../stubs/MembersInLocalObject.expected | 4 ++-- .../stubs/NotStorePropertiesFrom.expected | 2 +- .../NotStorePropertyFromInitializer.expected | 2 +- .../stubs/ObjectInInitializer.expected | 2 +- .../stubs/ObjectInPropertyDelegate.expected | 2 +- .../QualifiedAnnotationOnFunction.expected | 2 +- idea/testData/stubs/TypeAnnotation.expected | 2 +- .../ClsStubBuilderTestGenerated.java | 5 ++++ .../idea/stubs/StubBuilderTestGenerated.java | 5 ++++ 59 files changed, 235 insertions(+), 127 deletions(-) create mode 100644 idea/testData/decompiler/stubBuilder/Contracts/Contracts.kt create mode 100644 idea/testData/decompiler/stubBuilder/Contracts/Contracts.txt create mode 100644 idea/testData/stubs/Contracts.expected create mode 100644 idea/testData/stubs/Contracts.kt diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/KtNamedFunction.java b/compiler/psi/src/org/jetbrains/kotlin/psi/KtNamedFunction.java index 31520772c2e..7415a6cfc05 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/psi/KtNamedFunction.java +++ b/compiler/psi/src/org/jetbrains/kotlin/psi/KtNamedFunction.java @@ -26,6 +26,7 @@ import com.intellij.psi.util.PsiTreeUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.kotlin.lexer.KtTokens; +import org.jetbrains.kotlin.psi.psiUtil.KtPsiUtilKt; import org.jetbrains.kotlin.psi.stubs.KotlinFunctionStub; import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes; import org.jetbrains.kotlin.psi.typeRefHelpers.TypeRefHelpersKt; @@ -219,4 +220,13 @@ public class KtNamedFunction extends KtTypeParameterListOwnerStub { fun hasBlockBody(): Boolean fun hasBody(): Boolean fun hasTypeParameterListBeforeFunctionName(): Boolean + fun mayHaveContract(): Boolean } interface KotlinImportAliasStub : StubElement { diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtFunctionElementType.java b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtFunctionElementType.java index 9c27482b7d9..8208f804fb6 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtFunctionElementType.java +++ b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtFunctionElementType.java @@ -46,7 +46,8 @@ public class KtFunctionElementType extends KtStubElementType(parent, KtStubElementTypes.FUNCTION), KotlinFunctionStub { init { if (isTopLevel && fqName == null) { @@ -48,4 +49,5 @@ class KotlinFunctionStubImpl( override fun hasBlockBody() = hasBlockBody override fun hasBody() = hasBody override fun hasTypeParameterListBeforeFunctionName() = hasTypeParameterListBeforeFunctionName + override fun mayHaveContract(): Boolean = mayHaveContract } diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/classFile/DeserializerForClassfileDecompiler.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/classFile/DeserializerForClassfileDecompiler.kt index 86b7d44b855..324681529fa 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/classFile/DeserializerForClassfileDecompiler.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/classFile/DeserializerForClassfileDecompiler.kt @@ -20,6 +20,7 @@ import com.intellij.openapi.diagnostic.Logger import com.intellij.openapi.vfs.VirtualFile import org.jetbrains.kotlin.builtins.DefaultBuiltIns import org.jetbrains.kotlin.builtins.KotlinBuiltIns +import org.jetbrains.kotlin.contracts.ContractDeserializerImpl import org.jetbrains.kotlin.descriptors.DeclarationDescriptor import org.jetbrains.kotlin.descriptors.NotFoundClasses import org.jetbrains.kotlin.idea.caches.IDEKotlinBinaryClassCache @@ -63,11 +64,16 @@ class DeserializerForClassfileDecompiler( val annotationAndConstantLoader = BinaryClassAnnotationAndConstantLoaderImpl(moduleDescriptor, notFoundClasses, storageManager, classFinder) + val configuration = object : DeserializationConfiguration { + override val readDeserializedContracts: Boolean + get() = true + } + deserializationComponents = DeserializationComponents( - storageManager, moduleDescriptor, DeserializationConfiguration.Default, classDataFinder, annotationAndConstantLoader, + storageManager, moduleDescriptor, configuration, classDataFinder, annotationAndConstantLoader, packageFragmentProvider, ResolveEverythingToKotlinAnyLocalClassifierResolver(builtIns), LoggingErrorReporter(LOG), LookupTracker.DO_NOTHING, JavaFlexibleTypeDeserializer, emptyList(), notFoundClasses, - ContractDeserializer.DEFAULT, + ContractDeserializerImpl(configuration), extensionRegistryLite = JvmProtoBufUtil.EXTENSION_REGISTRY ) } 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 abd63f9ec03..57525bc3548 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 @@ -180,7 +180,8 @@ private class FunctionClsStubBuilder( isExtension = functionProto.hasReceiver(), hasBlockBody = true, hasBody = Flags.MODALITY.get(functionProto.flags) != Modality.ABSTRACT, - hasTypeParameterListBeforeFunctionName = functionProto.typeParameterList.isNotEmpty() + hasTypeParameterListBeforeFunctionName = functionProto.typeParameterList.isNotEmpty(), + hasContract = functionProto.hasContract() ) } } diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/textBuilder/buildDecompiledText.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/textBuilder/buildDecompiledText.kt index b7926d11335..a50e18fbb1f 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/textBuilder/buildDecompiledText.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/textBuilder/buildDecompiledText.kt @@ -17,6 +17,7 @@ package org.jetbrains.kotlin.idea.decompiler.textBuilder import com.intellij.openapi.util.TextRange +import org.jetbrains.kotlin.contracts.description.ContractProviderKey import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.idea.decompiler.navigation.ByDescriptorIndexer import org.jetbrains.kotlin.name.FqName @@ -31,6 +32,7 @@ import org.jetbrains.kotlin.types.isFlexible private val DECOMPILED_CODE_COMMENT = "/* compiled code */" private val DECOMPILED_COMMENT_FOR_PARAMETER = "/* = compiled code */" private val FLEXIBLE_TYPE_COMMENT = "/* platform type */" +private val DECOMPILED_CONTRACT_STUB = "contract { /* compiled contract */ }" fun DescriptorRendererOptions.defaultDecompilerRendererOptions() { withDefinedIn = false @@ -89,7 +91,13 @@ fun buildDecompiledText( if (descriptor is FunctionDescriptor || descriptor is PropertyDescriptor) { if ((descriptor as MemberDescriptor).modality != Modality.ABSTRACT) { if (descriptor is FunctionDescriptor) { - builder.append(" { ").append(DECOMPILED_CODE_COMMENT).append(" }") + with(builder) { + append(" { ") + if (descriptor.getUserData(ContractProviderKey)?.getContractDescription() != null) { + append(DECOMPILED_CONTRACT_STUB).append("; ") + } + append(DECOMPILED_CODE_COMMENT).append(" }") + } } else { // descriptor instanceof PropertyDescriptor diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/stubindex/IdeStubIndexService.java b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/stubindex/IdeStubIndexService.java index 45fa5fdd402..40b1ef766ad 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/stubindex/IdeStubIndexService.java +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/stubindex/IdeStubIndexService.java @@ -156,6 +156,10 @@ public class IdeStubIndexService extends StubIndexService { if (TypeIndexUtilKt.isProbablyNothing(stub.getPsi().getTypeReference())) { sink.occurrence(KotlinProbablyNothingFunctionShortNameIndex.getInstance().getKey(), name); } + + if (stub.mayHaveContract()) { + sink.occurrence(KotlinProbablyContractedFunctionShortNameIndex.getInstance().getKey(), name); + } } if (stub.isTopLevel()) { diff --git a/idea/testData/decompiler/stubBuilder/AnnotatedFlexibleTypes/AnnotatedFlexibleTypes.txt b/idea/testData/decompiler/stubBuilder/AnnotatedFlexibleTypes/AnnotatedFlexibleTypes.txt index 4844447276a..cdbcfffca38 100644 --- a/idea/testData/decompiler/stubBuilder/AnnotatedFlexibleTypes/AnnotatedFlexibleTypes.txt +++ b/idea/testData/decompiler/stubBuilder/AnnotatedFlexibleTypes/AnnotatedFlexibleTypes.txt @@ -37,7 +37,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=d] REFERENCE_EXPRESSION[referencedName=JavaClass] - FUN[fqName=test.AnnotatedFlexibleTypes.foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=foo] + FUN[fqName=test.AnnotatedFlexibleTypes.foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=foo] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST TYPE_REFERENCE diff --git a/idea/testData/decompiler/stubBuilder/Annotations/Annotations.txt b/idea/testData/decompiler/stubBuilder/Annotations/Annotations.txt index b67877f58c2..a349c6650af 100644 --- a/idea/testData/decompiler/stubBuilder/Annotations/Annotations.txt +++ b/idea/testData/decompiler/stubBuilder/Annotations/Annotations.txt @@ -178,7 +178,7 @@ PsiJetFileStubImpl[package=] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=String] - FUN[fqName=Annotations.annotationWithVararg, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=annotationWithVararg] + FUN[fqName=Annotations.annotationWithVararg, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=annotationWithVararg] MODIFIER_LIST[private final] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=i] @@ -198,7 +198,7 @@ PsiJetFileStubImpl[package=] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=Annotations.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=f] + FUN[fqName=Annotations.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f] MODIFIER_LIST[protected final] ANNOTATION_ENTRY[hasValueArguments=false, shortName=a] CONSTRUCTOR_CALLEE @@ -211,7 +211,7 @@ PsiJetFileStubImpl[package=] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=Annotations.g, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=g] + FUN[fqName=Annotations.g, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=g] MODIFIER_LIST[public final] ANNOTATION_ENTRY[hasValueArguments=false, shortName=a] CONSTRUCTOR_CALLEE @@ -234,7 +234,7 @@ PsiJetFileStubImpl[package=] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=Annotations.inlineFun, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=false, isTopLevel=false, name=inlineFun] + FUN[fqName=Annotations.inlineFun, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=false, isTopLevel=false, mayHaveContract=false, name=inlineFun] MODIFIER_LIST[public final inline] TYPE_PARAMETER_LIST TYPE_PARAMETER[fqName=null, isInVariance=false, isOutVariance=false, name=T] @@ -257,7 +257,7 @@ PsiJetFileStubImpl[package=] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=Annotations.types, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=types] + FUN[fqName=Annotations.types, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=types] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=param] @@ -285,7 +285,7 @@ PsiJetFileStubImpl[package=] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=Annotations.foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=true, isTopLevel=false, name=foo] + FUN[fqName=Annotations.foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=true, isTopLevel=false, mayHaveContract=false, name=foo] MODIFIER_LIST[public final] TYPE_REFERENCE MODIFIER_LIST[] diff --git a/idea/testData/decompiler/stubBuilder/AnnotationsOnNullableTypes/AnnotationsOnNullableTypes.txt b/idea/testData/decompiler/stubBuilder/AnnotationsOnNullableTypes/AnnotationsOnNullableTypes.txt index c0d5cff5c03..8a170e3fcc9 100644 --- a/idea/testData/decompiler/stubBuilder/AnnotationsOnNullableTypes/AnnotationsOnNullableTypes.txt +++ b/idea/testData/decompiler/stubBuilder/AnnotationsOnNullableTypes/AnnotationsOnNullableTypes.txt @@ -94,7 +94,7 @@ PsiJetFileStubImpl[package=] TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION[referencedName=C] - FUN[fqName=AnnotationsOnNullableTypes.parameter, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=parameter] + FUN[fqName=AnnotationsOnNullableTypes.parameter, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=parameter] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=a] @@ -113,7 +113,7 @@ PsiJetFileStubImpl[package=] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=AnnotationsOnNullableTypes.parameterArgument, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=parameterArgument] + FUN[fqName=AnnotationsOnNullableTypes.parameterArgument, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=parameterArgument] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=a] @@ -137,7 +137,7 @@ PsiJetFileStubImpl[package=] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=AnnotationsOnNullableTypes.returnArgument, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=returnArgument] + FUN[fqName=AnnotationsOnNullableTypes.returnArgument, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=returnArgument] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -155,7 +155,7 @@ PsiJetFileStubImpl[package=] NULLABLE_TYPE USER_TYPE REFERENCE_EXPRESSION[referencedName=C] - FUN[fqName=AnnotationsOnNullableTypes.returnTypeParameterValue, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=false, isTopLevel=false, name=returnTypeParameterValue] + FUN[fqName=AnnotationsOnNullableTypes.returnTypeParameterValue, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=false, isTopLevel=false, mayHaveContract=false, name=returnTypeParameterValue] MODIFIER_LIST[public final] TYPE_PARAMETER_LIST TYPE_PARAMETER[fqName=null, isInVariance=false, isOutVariance=false, name=T] @@ -170,7 +170,7 @@ PsiJetFileStubImpl[package=] NULLABLE_TYPE USER_TYPE REFERENCE_EXPRESSION[referencedName=T] - FUN[fqName=AnnotationsOnNullableTypes.returnValue, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=returnValue] + FUN[fqName=AnnotationsOnNullableTypes.returnValue, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=returnValue] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -183,7 +183,7 @@ PsiJetFileStubImpl[package=] NULLABLE_TYPE USER_TYPE REFERENCE_EXPRESSION[referencedName=C] - FUN[fqName=AnnotationsOnNullableTypes.functionWithAnnotatedReceiver, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=true, isTopLevel=false, name=functionWithAnnotatedReceiver] + FUN[fqName=AnnotationsOnNullableTypes.functionWithAnnotatedReceiver, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=true, isTopLevel=false, mayHaveContract=false, name=functionWithAnnotatedReceiver] MODIFIER_LIST[public final] TYPE_REFERENCE MODIFIER_LIST[] @@ -202,7 +202,7 @@ PsiJetFileStubImpl[package=] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=AnnotationsOnNullableTypes.receiverArgument, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=true, isTopLevel=false, name=receiverArgument] + FUN[fqName=AnnotationsOnNullableTypes.receiverArgument, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=true, isTopLevel=false, mayHaveContract=false, name=receiverArgument] MODIFIER_LIST[public final] TYPE_REFERENCE USER_TYPE diff --git a/idea/testData/decompiler/stubBuilder/AnnotationsOnParenthesizedTypes/AnnotationsOnParenthesizedTypes.txt b/idea/testData/decompiler/stubBuilder/AnnotationsOnParenthesizedTypes/AnnotationsOnParenthesizedTypes.txt index 550881e14c9..c2e462dae04 100644 --- a/idea/testData/decompiler/stubBuilder/AnnotationsOnParenthesizedTypes/AnnotationsOnParenthesizedTypes.txt +++ b/idea/testData/decompiler/stubBuilder/AnnotationsOnParenthesizedTypes/AnnotationsOnParenthesizedTypes.txt @@ -90,7 +90,7 @@ PsiJetFileStubImpl[package=] TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION[referencedName=C] - FUN[fqName=AnnotationsOnParenthesizedTypes.parameter, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=parameter] + FUN[fqName=AnnotationsOnParenthesizedTypes.parameter, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=parameter] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=a] @@ -108,7 +108,7 @@ PsiJetFileStubImpl[package=] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=AnnotationsOnParenthesizedTypes.parameterArgument, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=parameterArgument] + FUN[fqName=AnnotationsOnParenthesizedTypes.parameterArgument, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=parameterArgument] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=a] @@ -131,7 +131,7 @@ PsiJetFileStubImpl[package=] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=AnnotationsOnParenthesizedTypes.returnArgument, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=returnArgument] + FUN[fqName=AnnotationsOnParenthesizedTypes.returnArgument, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=returnArgument] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -148,7 +148,7 @@ PsiJetFileStubImpl[package=] REFERENCE_EXPRESSION[referencedName=A] USER_TYPE REFERENCE_EXPRESSION[referencedName=C] - FUN[fqName=AnnotationsOnParenthesizedTypes.returnTypeParameterValue, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=false, isTopLevel=false, name=returnTypeParameterValue] + FUN[fqName=AnnotationsOnParenthesizedTypes.returnTypeParameterValue, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=false, isTopLevel=false, mayHaveContract=false, name=returnTypeParameterValue] MODIFIER_LIST[public final] TYPE_PARAMETER_LIST TYPE_PARAMETER[fqName=null, isInVariance=false, isOutVariance=false, name=T] @@ -162,7 +162,7 @@ PsiJetFileStubImpl[package=] REFERENCE_EXPRESSION[referencedName=A] USER_TYPE REFERENCE_EXPRESSION[referencedName=T] - FUN[fqName=AnnotationsOnParenthesizedTypes.returnValue, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=returnValue] + FUN[fqName=AnnotationsOnParenthesizedTypes.returnValue, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=returnValue] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -174,7 +174,7 @@ PsiJetFileStubImpl[package=] REFERENCE_EXPRESSION[referencedName=A] USER_TYPE REFERENCE_EXPRESSION[referencedName=C] - FUN[fqName=AnnotationsOnParenthesizedTypes.receiverArgument, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=true, isTopLevel=false, name=receiverArgument] + FUN[fqName=AnnotationsOnParenthesizedTypes.receiverArgument, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=true, isTopLevel=false, mayHaveContract=false, name=receiverArgument] MODIFIER_LIST[public final] TYPE_REFERENCE USER_TYPE diff --git a/idea/testData/decompiler/stubBuilder/AnonymousReturnWithGenericType/AnonymousReturnWithGenericType.txt b/idea/testData/decompiler/stubBuilder/AnonymousReturnWithGenericType/AnonymousReturnWithGenericType.txt index b42d1310f3e..80802c08ee4 100644 --- a/idea/testData/decompiler/stubBuilder/AnonymousReturnWithGenericType/AnonymousReturnWithGenericType.txt +++ b/idea/testData/decompiler/stubBuilder/AnonymousReturnWithGenericType/AnonymousReturnWithGenericType.txt @@ -26,7 +26,7 @@ PsiJetFileStubImpl[package=] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Any] - FUN[fqName=AnonymousReturnWithGenericType.f1, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=f1] + FUN[fqName=AnonymousReturnWithGenericType.f1, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f1] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -37,7 +37,7 @@ PsiJetFileStubImpl[package=] TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION[referencedName=T] - FUN[fqName=AnonymousReturnWithGenericType.f2, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=f2] + FUN[fqName=AnonymousReturnWithGenericType.f2, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f2] MODIFIER_LIST[private final] VALUE_PARAMETER_LIST TYPE_REFERENCE diff --git a/idea/testData/decompiler/stubBuilder/ClassMembers/ClassMembers.txt b/idea/testData/decompiler/stubBuilder/ClassMembers/ClassMembers.txt index f75be248268..c2f32d98960 100644 --- a/idea/testData/decompiler/stubBuilder/ClassMembers/ClassMembers.txt +++ b/idea/testData/decompiler/stubBuilder/ClassMembers/ClassMembers.txt @@ -80,7 +80,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=String] - FUN[fqName=test.ClassMembers.abstractFun, hasBlockBody=true, hasBody=false, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=abstractFun] + FUN[fqName=test.ClassMembers.abstractFun, hasBlockBody=true, hasBody=false, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=abstractFun] MODIFIER_LIST[abstract public] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -88,7 +88,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=test.ClassMembers.bar, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=bar] + FUN[fqName=test.ClassMembers.bar, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=bar] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -96,7 +96,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=test.ClassMembers.openFun, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=openFun] + FUN[fqName=test.ClassMembers.openFun, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=openFun] MODIFIER_LIST[open public] VALUE_PARAMETER_LIST TYPE_REFERENCE diff --git a/idea/testData/decompiler/stubBuilder/ClassObject/ClassObject.txt b/idea/testData/decompiler/stubBuilder/ClassObject/ClassObject.txt index 854b87e490a..c59f73cd0a3 100644 --- a/idea/testData/decompiler/stubBuilder/ClassObject/ClassObject.txt +++ b/idea/testData/decompiler/stubBuilder/ClassObject/ClassObject.txt @@ -20,7 +20,7 @@ PsiJetFileStubImpl[package=test.class_object] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=test.class_object.ClassObject.Companion.z, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=z] + FUN[fqName=test.class_object.ClassObject.Companion.z, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=z] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -47,7 +47,7 @@ PsiJetFileStubImpl[package=test.class_object] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=test.class_object.ClassObject.Companion.A.B.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=f] + FUN[fqName=test.class_object.ClassObject.Companion.A.B.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -62,7 +62,7 @@ PsiJetFileStubImpl[package=test.class_object] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=test.class_object.ClassObject.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=f] + FUN[fqName=test.class_object.ClassObject.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -104,7 +104,7 @@ PsiJetFileStubImpl[package=test.class_object] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=test.class_object.ClassObject.B.Companion.C.Companion.D.Companion.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=f] + FUN[fqName=test.class_object.ClassObject.B.Companion.C.Companion.D.Companion.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST TYPE_REFERENCE diff --git a/idea/testData/decompiler/stubBuilder/Contracts/Contracts.kt b/idea/testData/decompiler/stubBuilder/Contracts/Contracts.kt new file mode 100644 index 00000000000..a4337199b37 --- /dev/null +++ b/idea/testData/decompiler/stubBuilder/Contracts/Contracts.kt @@ -0,0 +1,12 @@ +// JVM_FILE_NAME: ContractsKt + +@file:Suppress("INVISIBLE_MEMBER") +package test + +import kotlin.internal.contracts.* + +fun myRequire(x: Boolean) { + contract { + returns(true) implies (x) + } +} \ No newline at end of file diff --git a/idea/testData/decompiler/stubBuilder/Contracts/Contracts.txt b/idea/testData/decompiler/stubBuilder/Contracts/Contracts.txt new file mode 100644 index 00000000000..344f711884a --- /dev/null +++ b/idea/testData/decompiler/stubBuilder/Contracts/Contracts.txt @@ -0,0 +1,18 @@ +PsiJetFileStubImpl[package=test] + PACKAGE_DIRECTIVE + REFERENCE_EXPRESSION[referencedName=test] + IMPORT_LIST + FUN[fqName=test.myRequire, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=true, name=myRequire] + MODIFIER_LIST[public] + VALUE_PARAMETER_LIST + VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=x] + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION[referencedName=kotlin] + REFERENCE_EXPRESSION[referencedName=Boolean] + TYPE_REFERENCE + USER_TYPE + USER_TYPE + REFERENCE_EXPRESSION[referencedName=kotlin] + REFERENCE_EXPRESSION[referencedName=Unit] diff --git a/idea/testData/decompiler/stubBuilder/DataClass/DataClass.txt b/idea/testData/decompiler/stubBuilder/DataClass/DataClass.txt index 8bb896ef207..f6a99667f22 100644 --- a/idea/testData/decompiler/stubBuilder/DataClass/DataClass.txt +++ b/idea/testData/decompiler/stubBuilder/DataClass/DataClass.txt @@ -38,7 +38,7 @@ PsiJetFileStubImpl[package=a.b.c] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=String] - FUN[fqName=a.b.c.DataClass.component1, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=component1] + FUN[fqName=a.b.c.DataClass.component1, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=component1] MODIFIER_LIST[public final operator] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -46,7 +46,7 @@ PsiJetFileStubImpl[package=a.b.c] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=a.b.c.DataClass.component2, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=component2] + FUN[fqName=a.b.c.DataClass.component2, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=component2] MODIFIER_LIST[public final operator] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -54,7 +54,7 @@ PsiJetFileStubImpl[package=a.b.c] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=String] - FUN[fqName=a.b.c.DataClass.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=f] + FUN[fqName=a.b.c.DataClass.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST TYPE_REFERENCE diff --git a/idea/testData/decompiler/stubBuilder/Delegation/Delegation.txt b/idea/testData/decompiler/stubBuilder/Delegation/Delegation.txt index 5ce1efd14aa..e73c64a4090 100644 --- a/idea/testData/decompiler/stubBuilder/Delegation/Delegation.txt +++ b/idea/testData/decompiler/stubBuilder/Delegation/Delegation.txt @@ -29,7 +29,7 @@ PsiJetFileStubImpl[package=] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=Delegation.ff, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=ff] + FUN[fqName=Delegation.ff, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=ff] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST TYPE_REFERENCE diff --git a/idea/testData/decompiler/stubBuilder/DependencyOnNestedClasses/DependencyOnNestedClasses.txt b/idea/testData/decompiler/stubBuilder/DependencyOnNestedClasses/DependencyOnNestedClasses.txt index 9bbdcfc2ac2..61fffcf0067 100644 --- a/idea/testData/decompiler/stubBuilder/DependencyOnNestedClasses/DependencyOnNestedClasses.txt +++ b/idea/testData/decompiler/stubBuilder/DependencyOnNestedClasses/DependencyOnNestedClasses.txt @@ -17,7 +17,7 @@ PsiJetFileStubImpl[package=test] REFERENCE_EXPRESSION[referencedName=D] REFERENCE_EXPRESSION[referencedName=Nested] CLASS_BODY - FUN[fqName=test.DependencyOnNestedClasses.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=f] + FUN[fqName=test.DependencyOnNestedClasses.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=nc] diff --git a/idea/testData/decompiler/stubBuilder/Enum/Enum.txt b/idea/testData/decompiler/stubBuilder/Enum/Enum.txt index 7e9c6a05cb1..bb416e29380 100644 --- a/idea/testData/decompiler/stubBuilder/Enum/Enum.txt +++ b/idea/testData/decompiler/stubBuilder/Enum/Enum.txt @@ -69,7 +69,7 @@ PsiJetFileStubImpl[package=a.b.c.test.enum] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=a.b.c.test.enum.Enum.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=f] + FUN[fqName=a.b.c.test.enum.Enum.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f] MODIFIER_LIST[open public] VALUE_PARAMETER_LIST TYPE_REFERENCE diff --git a/idea/testData/decompiler/stubBuilder/FlexibleTypes/FlexibleTypes.txt b/idea/testData/decompiler/stubBuilder/FlexibleTypes/FlexibleTypes.txt index d089e12c6e8..1bcc86804db 100644 --- a/idea/testData/decompiler/stubBuilder/FlexibleTypes/FlexibleTypes.txt +++ b/idea/testData/decompiler/stubBuilder/FlexibleTypes/FlexibleTypes.txt @@ -15,7 +15,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=test.FlexibleTypes.collection, hasBlockBody=true, hasBody=false, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=collection] + FUN[fqName=test.FlexibleTypes.collection, hasBlockBody=true, hasBody=false, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=collection] MODIFIER_LIST[abstract public] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -32,7 +32,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=test.FlexibleTypes.withBody, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=withBody] + FUN[fqName=test.FlexibleTypes.withBody, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=withBody] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST TYPE_REFERENCE diff --git a/idea/testData/decompiler/stubBuilder/InheritingClasses/InheritingClasses.txt b/idea/testData/decompiler/stubBuilder/InheritingClasses/InheritingClasses.txt index 788e7230fd7..487b23096c7 100644 --- a/idea/testData/decompiler/stubBuilder/InheritingClasses/InheritingClasses.txt +++ b/idea/testData/decompiler/stubBuilder/InheritingClasses/InheritingClasses.txt @@ -50,7 +50,7 @@ PsiJetFileStubImpl[package=a] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=a.InheritingClasses.A.af, hasBlockBody=true, hasBody=false, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=af] + FUN[fqName=a.InheritingClasses.A.af, hasBlockBody=true, hasBody=false, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=af] MODIFIER_LIST[abstract public] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -58,7 +58,7 @@ PsiJetFileStubImpl[package=a] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=a.InheritingClasses.A.of, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=of] + FUN[fqName=a.InheritingClasses.A.of, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=of] MODIFIER_LIST[open public] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -95,7 +95,7 @@ PsiJetFileStubImpl[package=a] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=a.InheritingClasses.B.af, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=af] + FUN[fqName=a.InheritingClasses.B.af, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=af] MODIFIER_LIST[open public] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -103,7 +103,7 @@ PsiJetFileStubImpl[package=a] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=a.InheritingClasses.B.of, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=of] + FUN[fqName=a.InheritingClasses.B.of, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=of] MODIFIER_LIST[open public] VALUE_PARAMETER_LIST TYPE_REFERENCE diff --git a/idea/testData/decompiler/stubBuilder/InnerTypes/InnerTypes.txt b/idea/testData/decompiler/stubBuilder/InnerTypes/InnerTypes.txt index 80192efb959..4b96142a43d 100644 --- a/idea/testData/decompiler/stubBuilder/InnerTypes/InnerTypes.txt +++ b/idea/testData/decompiler/stubBuilder/InnerTypes/InnerTypes.txt @@ -11,7 +11,7 @@ PsiJetFileStubImpl[package=test] MODIFIER_LIST[public] VALUE_PARAMETER_LIST CLASS_BODY - FUN[fqName=test.InnerTypes.bar, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=bar] + FUN[fqName=test.InnerTypes.bar, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=bar] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=x] @@ -74,7 +74,7 @@ PsiJetFileStubImpl[package=test] MODIFIER_LIST[public] VALUE_PARAMETER_LIST CLASS_BODY - FUN[fqName=test.InnerTypes.Inner.Inner3.foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=foo] + FUN[fqName=test.InnerTypes.Inner.Inner3.foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=foo] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=x] diff --git a/idea/testData/decompiler/stubBuilder/LocalClass/LocalClass.txt b/idea/testData/decompiler/stubBuilder/LocalClass/LocalClass.txt index c4a26502a8b..96b5e7da6be 100644 --- a/idea/testData/decompiler/stubBuilder/LocalClass/LocalClass.txt +++ b/idea/testData/decompiler/stubBuilder/LocalClass/LocalClass.txt @@ -31,7 +31,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Any] - FUN[fqName=test.LocalClass.foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=foo] + FUN[fqName=test.LocalClass.foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=foo] MODIFIER_LIST[private final] VALUE_PARAMETER_LIST TYPE_REFERENCE diff --git a/idea/testData/decompiler/stubBuilder/Modifiers/Modifiers.txt b/idea/testData/decompiler/stubBuilder/Modifiers/Modifiers.txt index b7d5d8b1b2d..bcaf94883ab 100644 --- a/idea/testData/decompiler/stubBuilder/Modifiers/Modifiers.txt +++ b/idea/testData/decompiler/stubBuilder/Modifiers/Modifiers.txt @@ -28,7 +28,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=test.Modifiers.builder, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=builder] + FUN[fqName=test.Modifiers.builder, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=builder] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=c] @@ -52,7 +52,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=test.Modifiers.component1, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=component1] + FUN[fqName=test.Modifiers.component1, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=component1] MODIFIER_LIST[public final operator] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -60,7 +60,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=test.Modifiers.equals, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=equals] + FUN[fqName=test.Modifiers.equals, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=equals] MODIFIER_LIST[open public operator] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=other] @@ -75,7 +75,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Boolean] - FUN[fqName=test.Modifiers.extFun, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=extFun] + FUN[fqName=test.Modifiers.extFun, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=extFun] MODIFIER_LIST[public final external] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -83,7 +83,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE 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] + FUN[fqName=test.Modifiers.inlined, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=inlined] MODIFIER_LIST[public final inline] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=arg1] @@ -111,7 +111,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE 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] + FUN[fqName=test.Modifiers.sum, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=sum] MODIFIER_LIST[public final tailrec] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=x] @@ -131,7 +131,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Long] - FUN[fqName=test.Modifiers.suspend, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=suspend] + FUN[fqName=test.Modifiers.suspend, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=suspend] MODIFIER_LIST[public final suspend] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=x] diff --git a/idea/testData/decompiler/stubBuilder/MultifileClass/MultifileClass.txt b/idea/testData/decompiler/stubBuilder/MultifileClass/MultifileClass.txt index eacbc52bb07..9b8997034e1 100644 --- a/idea/testData/decompiler/stubBuilder/MultifileClass/MultifileClass.txt +++ b/idea/testData/decompiler/stubBuilder/MultifileClass/MultifileClass.txt @@ -42,7 +42,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=test.p1ExprFun, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=p1ExprFun] + FUN[fqName=test.p1ExprFun, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=false, name=p1ExprFun] MODIFIER_LIST[public] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -50,7 +50,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=test.p1Fun, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=p1Fun] + FUN[fqName=test.p1Fun, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=false, name=p1Fun] MODIFIER_LIST[public] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -58,7 +58,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=test.p1FunWithParams, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=p1FunWithParams] + FUN[fqName=test.p1FunWithParams, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=false, name=p1FunWithParams] MODIFIER_LIST[public] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=x] @@ -72,7 +72,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=test.p1ExtFun, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=true, isTopLevel=true, name=p1ExtFun] + FUN[fqName=test.p1ExtFun, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=true, isTopLevel=true, mayHaveContract=false, name=p1ExtFun] MODIFIER_LIST[public] TYPE_REFERENCE USER_TYPE @@ -104,7 +104,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=test.p2Fun, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=p2Fun] + FUN[fqName=test.p2Fun, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=false, name=p2Fun] MODIFIER_LIST[public] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -112,7 +112,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=test.p2ExtFun, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=true, isTopLevel=true, name=p2ExtFun] + FUN[fqName=test.p2ExtFun, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=true, isTopLevel=true, mayHaveContract=false, name=p2ExtFun] MODIFIER_LIST[public] TYPE_REFERENCE USER_TYPE diff --git a/idea/testData/decompiler/stubBuilder/NamedCompanionObject/NamedCompanionObject.txt b/idea/testData/decompiler/stubBuilder/NamedCompanionObject/NamedCompanionObject.txt index 72d8b85641e..9c6d279654e 100644 --- a/idea/testData/decompiler/stubBuilder/NamedCompanionObject/NamedCompanionObject.txt +++ b/idea/testData/decompiler/stubBuilder/NamedCompanionObject/NamedCompanionObject.txt @@ -18,7 +18,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=test.NamedCompanionObject.Named.z, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=z] + FUN[fqName=test.NamedCompanionObject.Named.z, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=z] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -45,7 +45,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=test.NamedCompanionObject.Named.A.B.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=f] + FUN[fqName=test.NamedCompanionObject.Named.A.B.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -60,7 +60,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=test.NamedCompanionObject.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=f] + FUN[fqName=test.NamedCompanionObject.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -102,7 +102,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=test.NamedCompanionObject.B.NamedInB.C.NamedInC.D.Companion.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=f] + FUN[fqName=test.NamedCompanionObject.B.NamedInB.C.NamedInC.D.Companion.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST TYPE_REFERENCE diff --git a/idea/testData/decompiler/stubBuilder/NestedClasses/NestedClasses.txt b/idea/testData/decompiler/stubBuilder/NestedClasses/NestedClasses.txt index 7e22c705b15..b2dd4a20220 100644 --- a/idea/testData/decompiler/stubBuilder/NestedClasses/NestedClasses.txt +++ b/idea/testData/decompiler/stubBuilder/NestedClasses/NestedClasses.txt @@ -17,7 +17,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=test.NestedClasses.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=f] + FUN[fqName=test.NestedClasses.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -36,7 +36,7 @@ PsiJetFileStubImpl[package=test] MODIFIER_LIST[public] VALUE_PARAMETER_LIST CLASS_BODY - FUN[fqName=test.NestedClasses.Inner.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=f] + FUN[fqName=test.NestedClasses.Inner.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=p1] @@ -56,7 +56,7 @@ PsiJetFileStubImpl[package=test] MODIFIER_LIST[public] VALUE_PARAMETER_LIST CLASS_BODY - FUN[fqName=test.NestedClasses.Inner.II.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=f] + FUN[fqName=test.NestedClasses.Inner.II.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=p1] @@ -119,7 +119,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=test.NestedClasses.Nested.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=f] + FUN[fqName=test.NestedClasses.Nested.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=p1] @@ -142,7 +142,7 @@ PsiJetFileStubImpl[package=test] MODIFIER_LIST[public] VALUE_PARAMETER_LIST CLASS_BODY - FUN[fqName=test.NestedClasses.Nested.NI.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=f] + FUN[fqName=test.NestedClasses.Nested.NI.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=p1] @@ -173,7 +173,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=test.NestedClasses.Nested.NN.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=f] + FUN[fqName=test.NestedClasses.Nested.NN.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=p1] diff --git a/idea/testData/decompiler/stubBuilder/Objects/Objects.txt b/idea/testData/decompiler/stubBuilder/Objects/Objects.txt index 2ccc9789b98..1d92fab97fc 100644 --- a/idea/testData/decompiler/stubBuilder/Objects/Objects.txt +++ b/idea/testData/decompiler/stubBuilder/Objects/Objects.txt @@ -11,7 +11,7 @@ PsiJetFileStubImpl[package=] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=Objects.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=f] + FUN[fqName=Objects.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -34,7 +34,7 @@ PsiJetFileStubImpl[package=] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=Objects.InnerObject.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=f] + FUN[fqName=Objects.InnerObject.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -65,7 +65,7 @@ PsiJetFileStubImpl[package=] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=Objects.OtherObject.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=f] + FUN[fqName=Objects.OtherObject.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST TYPE_REFERENCE diff --git a/idea/testData/decompiler/stubBuilder/PrivateToThis/PrivateToThis.txt b/idea/testData/decompiler/stubBuilder/PrivateToThis/PrivateToThis.txt index 92052748a2e..1864f996187 100644 --- a/idea/testData/decompiler/stubBuilder/PrivateToThis/PrivateToThis.txt +++ b/idea/testData/decompiler/stubBuilder/PrivateToThis/PrivateToThis.txt @@ -31,7 +31,7 @@ PsiJetFileStubImpl[package=p] TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION[referencedName=I] - FUN[fqName=p.PrivateToThis.bas, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=bas] + FUN[fqName=p.PrivateToThis.bas, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=bas] MODIFIER_LIST[private final] VALUE_PARAMETER_LIST TYPE_REFERENCE diff --git a/idea/testData/decompiler/stubBuilder/SuspendLambda/SuspendLambda.txt b/idea/testData/decompiler/stubBuilder/SuspendLambda/SuspendLambda.txt index af7de2ae676..4aff4774d4f 100644 --- a/idea/testData/decompiler/stubBuilder/SuspendLambda/SuspendLambda.txt +++ b/idea/testData/decompiler/stubBuilder/SuspendLambda/SuspendLambda.txt @@ -119,7 +119,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=test.SuspendLambda.override, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=override] + FUN[fqName=test.SuspendLambda.override, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=override] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=p] @@ -150,7 +150,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Nothing] - FUN[fqName=test.SuspendLambda.override, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=override] + FUN[fqName=test.SuspendLambda.override, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=override] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=b] @@ -175,7 +175,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Nothing] - FUN[fqName=test.SuspendLambda.testCoroutine, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=false, isTopLevel=false, name=testCoroutine] + FUN[fqName=test.SuspendLambda.testCoroutine, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=false, isTopLevel=false, mayHaveContract=false, name=testCoroutine] MODIFIER_LIST[public final] TYPE_PARAMETER_LIST TYPE_PARAMETER[fqName=null, isInVariance=false, isOutVariance=false, name=T] @@ -200,7 +200,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=test.SuspendLambda.testCoroutineWithAnnotation, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=false, isTopLevel=false, name=testCoroutineWithAnnotation] + FUN[fqName=test.SuspendLambda.testCoroutineWithAnnotation, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=false, isTopLevel=false, mayHaveContract=false, name=testCoroutineWithAnnotation] MODIFIER_LIST[public final] TYPE_PARAMETER_LIST TYPE_PARAMETER[fqName=null, isInVariance=false, isOutVariance=false, name=T] @@ -233,7 +233,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=test.SuspendLambda.createCoroutine1, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=true, isTopLevel=false, name=createCoroutine1] + FUN[fqName=test.SuspendLambda.createCoroutine1, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=true, isTopLevel=false, mayHaveContract=false, name=createCoroutine1] MODIFIER_LIST[public final] TYPE_PARAMETER_LIST TYPE_PARAMETER[fqName=null, isInVariance=false, isOutVariance=false, name=T] @@ -261,7 +261,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=test.SuspendLambda.createCoroutine2, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=true, isTopLevel=false, name=createCoroutine2] + FUN[fqName=test.SuspendLambda.createCoroutine2, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=true, isTopLevel=false, mayHaveContract=false, name=createCoroutine2] MODIFIER_LIST[public final] TYPE_PARAMETER_LIST TYPE_PARAMETER[fqName=null, isInVariance=false, isOutVariance=false, name=R] @@ -298,7 +298,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=test.SuspendLambda.createCoroutineAnother, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=true, isTopLevel=false, name=createCoroutineAnother] + FUN[fqName=test.SuspendLambda.createCoroutineAnother, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=true, isTopLevel=false, mayHaveContract=false, name=createCoroutineAnother] MODIFIER_LIST[public final] TYPE_PARAMETER_LIST TYPE_PARAMETER[fqName=null, isInVariance=false, isOutVariance=false, name=R] diff --git a/idea/testData/decompiler/stubBuilder/TopJvmPackageName/TopJvmPackageName.txt b/idea/testData/decompiler/stubBuilder/TopJvmPackageName/TopJvmPackageName.txt index 950a286ee62..6da43b31553 100644 --- a/idea/testData/decompiler/stubBuilder/TopJvmPackageName/TopJvmPackageName.txt +++ b/idea/testData/decompiler/stubBuilder/TopJvmPackageName/TopJvmPackageName.txt @@ -4,7 +4,7 @@ PsiJetFileStubImpl[package=some.other] REFERENCE_EXPRESSION[referencedName=some] REFERENCE_EXPRESSION[referencedName=other] IMPORT_LIST - FUN[fqName=some.other.foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=foo] + FUN[fqName=some.other.foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=false, name=foo] MODIFIER_LIST[public] ANNOTATION_ENTRY[hasValueArguments=false, shortName=SinceKotlin] CONSTRUCTOR_CALLEE diff --git a/idea/testData/decompiler/stubBuilder/TopLevelMembersAnnotatedKt/TopLevelMembersAnnotatedKt.txt b/idea/testData/decompiler/stubBuilder/TopLevelMembersAnnotatedKt/TopLevelMembersAnnotatedKt.txt index 1cda28769be..18b6051b36d 100644 --- a/idea/testData/decompiler/stubBuilder/TopLevelMembersAnnotatedKt/TopLevelMembersAnnotatedKt.txt +++ b/idea/testData/decompiler/stubBuilder/TopLevelMembersAnnotatedKt/TopLevelMembersAnnotatedKt.txt @@ -37,7 +37,7 @@ PsiJetFileStubImpl[package=a.b.c.topLevelMembersAnnotated] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=a.b.c.topLevelMembersAnnotated.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=f] + FUN[fqName=a.b.c.topLevelMembersAnnotated.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=false, name=f] MODIFIER_LIST[public] ANNOTATION_ENTRY[hasValueArguments=false, shortName=a] CONSTRUCTOR_CALLEE diff --git a/idea/testData/decompiler/stubBuilder/TopLevelMembersKt/TopLevelMembersKt.txt b/idea/testData/decompiler/stubBuilder/TopLevelMembersKt/TopLevelMembersKt.txt index 7ba119f29ec..bfe0405ab46 100644 --- a/idea/testData/decompiler/stubBuilder/TopLevelMembersKt/TopLevelMembersKt.txt +++ b/idea/testData/decompiler/stubBuilder/TopLevelMembersKt/TopLevelMembersKt.txt @@ -37,7 +37,7 @@ PsiJetFileStubImpl[package=foo.TopLevelMembers] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=String] - FUN[fqName=foo.TopLevelMembers.funWithBlockBody, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=funWithBlockBody] + FUN[fqName=foo.TopLevelMembers.funWithBlockBody, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=false, name=funWithBlockBody] MODIFIER_LIST[public] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -45,7 +45,7 @@ PsiJetFileStubImpl[package=foo.TopLevelMembers] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=foo.TopLevelMembers.funWithExprBody, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=funWithExprBody] + FUN[fqName=foo.TopLevelMembers.funWithExprBody, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=false, name=funWithExprBody] MODIFIER_LIST[private] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -53,7 +53,7 @@ PsiJetFileStubImpl[package=foo.TopLevelMembers] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Int] - FUN[fqName=foo.TopLevelMembers.funWithParams, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=funWithParams] + FUN[fqName=foo.TopLevelMembers.funWithParams, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=false, name=funWithParams] MODIFIER_LIST[private] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=c] @@ -67,7 +67,7 @@ PsiJetFileStubImpl[package=foo.TopLevelMembers] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=foo.TopLevelMembers.funWithVarargParam, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=funWithVarargParam] + FUN[fqName=foo.TopLevelMembers.funWithVarargParam, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=false, name=funWithVarargParam] MODIFIER_LIST[private] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=c] @@ -88,7 +88,7 @@ PsiJetFileStubImpl[package=foo.TopLevelMembers] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=foo.TopLevelMembers.probablyNothing, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=probablyNothing] + FUN[fqName=foo.TopLevelMembers.probablyNothing, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=false, name=probablyNothing] MODIFIER_LIST[private] VALUE_PARAMETER_LIST TYPE_REFERENCE @@ -98,7 +98,7 @@ PsiJetFileStubImpl[package=foo.TopLevelMembers] REFERENCE_EXPRESSION[referencedName=foo] REFERENCE_EXPRESSION[referencedName=TopLevelMembers] REFERENCE_EXPRESSION[referencedName=Nothing] - FUN[fqName=foo.TopLevelMembers.ext, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=true, isTopLevel=true, name=ext] + FUN[fqName=foo.TopLevelMembers.ext, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=true, isTopLevel=true, mayHaveContract=false, name=ext] MODIFIER_LIST[public] TYPE_REFERENCE USER_TYPE diff --git a/idea/testData/decompiler/stubBuilder/TypeAliases/TypeAliases.txt b/idea/testData/decompiler/stubBuilder/TypeAliases/TypeAliases.txt index 2cc7d31e187..1be32771b01 100644 --- a/idea/testData/decompiler/stubBuilder/TypeAliases/TypeAliases.txt +++ b/idea/testData/decompiler/stubBuilder/TypeAliases/TypeAliases.txt @@ -8,7 +8,7 @@ PsiJetFileStubImpl[package=test] MODIFIER_LIST[public] VALUE_PARAMETER_LIST CLASS_BODY - FUN[fqName=test.TypeAliases.foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=foo] + FUN[fqName=test.TypeAliases.foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=foo] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=a] @@ -67,7 +67,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=test.TypeAliases.order, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=order] + FUN[fqName=test.TypeAliases.order, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=order] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=path] @@ -81,7 +81,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=test.TypeAliases.order, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=order] + FUN[fqName=test.TypeAliases.order, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=order] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=body] diff --git a/idea/testData/decompiler/stubBuilder/TypeParams/TypeParams.txt b/idea/testData/decompiler/stubBuilder/TypeParams/TypeParams.txt index 84f61c18607..a824cada927 100644 --- a/idea/testData/decompiler/stubBuilder/TypeParams/TypeParams.txt +++ b/idea/testData/decompiler/stubBuilder/TypeParams/TypeParams.txt @@ -110,7 +110,7 @@ PsiJetFileStubImpl[package=test] TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION[referencedName=G1] - FUN[fqName=test.TypeParams.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=false, isTopLevel=false, name=f] + FUN[fqName=test.TypeParams.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f] MODIFIER_LIST[public final inline] TYPE_PARAMETER_LIST TYPE_PARAMETER[fqName=null, isInVariance=false, isOutVariance=false, name=G] @@ -136,7 +136,7 @@ PsiJetFileStubImpl[package=test] TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION[referencedName=T] - FUN[fqName=test.TypeParams.useParams, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=useParams] + FUN[fqName=test.TypeParams.useParams, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=useParams] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=p1] @@ -173,7 +173,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=test.TypeParams.useParamsInOtherOrder, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=useParamsInOtherOrder] + FUN[fqName=test.TypeParams.useParamsInOtherOrder, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=useParamsInOtherOrder] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=p1] @@ -201,7 +201,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=test.TypeParams.useParamsInTypeArg, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=useParamsInTypeArg] + FUN[fqName=test.TypeParams.useParamsInTypeArg, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=useParamsInTypeArg] MODIFIER_LIST[public final] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=p1] @@ -260,7 +260,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=test.TypeParams.withOwnParams, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=false, isTopLevel=false, name=withOwnParams] + FUN[fqName=test.TypeParams.withOwnParams, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=false, isTopLevel=false, mayHaveContract=false, name=withOwnParams] MODIFIER_LIST[public final] TYPE_PARAMETER_LIST TYPE_PARAMETER[fqName=null, isInVariance=false, isOutVariance=false, name=G1] @@ -301,7 +301,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=test.TypeParams.withOwnParamsAndTypeConstraints, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=false, isTopLevel=false, name=withOwnParamsAndTypeConstraints] + FUN[fqName=test.TypeParams.withOwnParamsAndTypeConstraints, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=false, isTopLevel=false, mayHaveContract=false, name=withOwnParamsAndTypeConstraints] MODIFIER_LIST[public final] TYPE_PARAMETER_LIST TYPE_PARAMETER[fqName=null, isInVariance=false, isOutVariance=false, name=G1] @@ -365,7 +365,7 @@ PsiJetFileStubImpl[package=test] REFERENCE_EXPRESSION[referencedName=java] REFERENCE_EXPRESSION[referencedName=io] REFERENCE_EXPRESSION[referencedName=Serializable] - FUN[fqName=test.TypeParams.withOwnParamsClashing, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=false, isTopLevel=false, name=withOwnParamsClashing] + FUN[fqName=test.TypeParams.withOwnParamsClashing, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=false, isTopLevel=false, mayHaveContract=false, name=withOwnParamsClashing] MODIFIER_LIST[public final] TYPE_PARAMETER_LIST TYPE_PARAMETER[fqName=null, isInVariance=false, isOutVariance=false, name=T1] @@ -397,7 +397,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=test.TypeParams.withOwnParamExtension, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=true, isTopLevel=false, name=withOwnParamExtension] + FUN[fqName=test.TypeParams.withOwnParamExtension, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=true, isTopLevel=false, mayHaveContract=false, name=withOwnParamExtension] MODIFIER_LIST[public final] TYPE_PARAMETER_LIST TYPE_PARAMETER[fqName=null, isInVariance=false, isOutVariance=false, name=T1] diff --git a/idea/testData/decompiler/stubBuilder/Types/Types.txt b/idea/testData/decompiler/stubBuilder/Types/Types.txt index 74d84cf9406..7100d63ed3c 100644 --- a/idea/testData/decompiler/stubBuilder/Types/Types.txt +++ b/idea/testData/decompiler/stubBuilder/Types/Types.txt @@ -381,7 +381,7 @@ PsiJetFileStubImpl[package=test] REFERENCE_EXPRESSION[referencedName=List] TYPE_ARGUMENT_LIST TYPE_PROJECTION[projectionKind=STAR] - FUN[fqName=test.Types.functionTypeWithNamedArgs, hasBlockBody=true, hasBody=false, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=functionTypeWithNamedArgs] + FUN[fqName=test.Types.functionTypeWithNamedArgs, hasBlockBody=true, hasBody=false, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=functionTypeWithNamedArgs] MODIFIER_LIST[abstract public] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=fType] @@ -411,7 +411,7 @@ PsiJetFileStubImpl[package=test] USER_TYPE REFERENCE_EXPRESSION[referencedName=kotlin] REFERENCE_EXPRESSION[referencedName=Unit] - FUN[fqName=test.Types.extOnFunctionType, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=true, isTopLevel=false, name=extOnFunctionType] + FUN[fqName=test.Types.extOnFunctionType, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=true, isTopLevel=false, mayHaveContract=false, name=extOnFunctionType] MODIFIER_LIST[public final] TYPE_PARAMETER_LIST TYPE_PARAMETER[fqName=null, isInVariance=false, isOutVariance=false, name=P1] diff --git a/idea/testData/stubs/AnnotationOnFunction.expected b/idea/testData/stubs/AnnotationOnFunction.expected index e72bd554441..156b82660f9 100644 --- a/idea/testData/stubs/AnnotationOnFunction.expected +++ b/idea/testData/stubs/AnnotationOnFunction.expected @@ -1,7 +1,7 @@ PsiJetFileStubImpl[package=] PACKAGE_DIRECTIVE IMPORT_LIST - FUN[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=foo] + FUN[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=false, name=foo] MODIFIER_LIST[] ANNOTATION_ENTRY[hasValueArguments=false, shortName=Deprecated] CONSTRUCTOR_CALLEE diff --git a/idea/testData/stubs/AnnotationOnLocalFunction.expected b/idea/testData/stubs/AnnotationOnLocalFunction.expected index f98483215dc..a08c66d7df7 100644 --- a/idea/testData/stubs/AnnotationOnLocalFunction.expected +++ b/idea/testData/stubs/AnnotationOnLocalFunction.expected @@ -1,9 +1,9 @@ PsiJetFileStubImpl[package=] PACKAGE_DIRECTIVE IMPORT_LIST - FUN[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=foo] + FUN[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=false, name=foo] VALUE_PARAMETER_LIST - FUN[fqName=null, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=innerFoo] + FUN[fqName=null, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=innerFoo] MODIFIER_LIST[] ANNOTATION_ENTRY[hasValueArguments=false, shortName=Deprecated] CONSTRUCTOR_CALLEE diff --git a/idea/testData/stubs/ClassObject.expected b/idea/testData/stubs/ClassObject.expected index eecfdf95fbf..4f1f07aa746 100644 --- a/idea/testData/stubs/ClassObject.expected +++ b/idea/testData/stubs/ClassObject.expected @@ -6,7 +6,7 @@ PsiJetFileStubImpl[package=] OBJECT_DECLARATION[fqName=C.Companion, isCompanion=true, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=Companion, superNames=[]] MODIFIER_LIST[companion] CLASS_BODY - FUN[fqName=C.Companion.foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=foo] + FUN[fqName=C.Companion.foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=foo] VALUE_PARAMETER_LIST CLASS[fqName=D, isEnumEntry=false, isInterface=false, isLocal=false, isTopLevel=true, name=D, superNames=[]] CLASS_BODY diff --git a/idea/testData/stubs/Contracts.expected b/idea/testData/stubs/Contracts.expected new file mode 100644 index 00000000000..8740306f432 --- /dev/null +++ b/idea/testData/stubs/Contracts.expected @@ -0,0 +1,23 @@ +PsiJetFileStubImpl[package=test] + FILE_ANNOTATION_LIST + ANNOTATION_ENTRY[hasValueArguments=true, shortName=Suppress] + ANNOTATION_TARGET[useSiteTarget=FILE] + CONSTRUCTOR_CALLEE + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION[referencedName=Suppress] + PACKAGE_DIRECTIVE + REFERENCE_EXPRESSION[referencedName=test] + IMPORT_LIST + IMPORT_DIRECTIVE[importedFqName=kotlin.internal.contracts, isAllUnder=true, isValid=true] + DOT_QUALIFIED_EXPRESSION + DOT_QUALIFIED_EXPRESSION + REFERENCE_EXPRESSION[referencedName=kotlin] + REFERENCE_EXPRESSION[referencedName=internal] + REFERENCE_EXPRESSION[referencedName=contracts] + FUN[fqName=test.myRequire, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=true, name=myRequire] + VALUE_PARAMETER_LIST + VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=x] + TYPE_REFERENCE + USER_TYPE + REFERENCE_EXPRESSION[referencedName=Boolean] diff --git a/idea/testData/stubs/Contracts.kt b/idea/testData/stubs/Contracts.kt new file mode 100644 index 00000000000..26de4542780 --- /dev/null +++ b/idea/testData/stubs/Contracts.kt @@ -0,0 +1,10 @@ +@file:Suppress("INVISIBLE_MEMBER") +package test + +import kotlin.internal.contracts.* + +fun myRequire(x: Boolean) { + contract { + returns() implies x + } +} \ No newline at end of file diff --git a/idea/testData/stubs/FunctionInNotNamedObject.expected b/idea/testData/stubs/FunctionInNotNamedObject.expected index d107c8b78d8..254921d9dcd 100644 --- a/idea/testData/stubs/FunctionInNotNamedObject.expected +++ b/idea/testData/stubs/FunctionInNotNamedObject.expected @@ -3,5 +3,5 @@ PsiJetFileStubImpl[package=] IMPORT_LIST OBJECT_DECLARATION[fqName=, isCompanion=false, isLocal=false, isObjectLiteral=false, isTopLevel=true, name=null, superNames=[]] CLASS_BODY - FUN[fqName=null, hasBlockBody=false, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=testing] + FUN[fqName=null, hasBlockBody=false, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=testing] VALUE_PARAMETER_LIST diff --git a/idea/testData/stubs/FunctionParameters.expected b/idea/testData/stubs/FunctionParameters.expected index d157591547f..e7f9537504f 100644 --- a/idea/testData/stubs/FunctionParameters.expected +++ b/idea/testData/stubs/FunctionParameters.expected @@ -1,7 +1,7 @@ PsiJetFileStubImpl[package=] PACKAGE_DIRECTIVE IMPORT_LIST - FUN[fqName=some, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=some] + FUN[fqName=some, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=false, name=some] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=t] TYPE_REFERENCE diff --git a/idea/testData/stubs/LocalClass.expected b/idea/testData/stubs/LocalClass.expected index 2b07ba76171..fb16279d34b 100644 --- a/idea/testData/stubs/LocalClass.expected +++ b/idea/testData/stubs/LocalClass.expected @@ -3,7 +3,7 @@ PsiJetFileStubImpl[package=] IMPORT_LIST CLASS[fqName=A, isEnumEntry=false, isInterface=false, isLocal=false, isTopLevel=true, name=A, superNames=[]] CLASS[fqName=T, isEnumEntry=false, isInterface=true, isLocal=false, isTopLevel=true, name=T, superNames=[]] - FUN[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=foo] + FUN[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=false, name=foo] VALUE_PARAMETER_LIST CLASS[fqName=null, isEnumEntry=false, isInterface=false, isLocal=true, isTopLevel=false, name=Test, superNames=[A, T]] SUPER_TYPE_LIST diff --git a/idea/testData/stubs/LocalClassInLocalFunction.expected b/idea/testData/stubs/LocalClassInLocalFunction.expected index 3c1546ef9cf..adca93a1faf 100644 --- a/idea/testData/stubs/LocalClassInLocalFunction.expected +++ b/idea/testData/stubs/LocalClassInLocalFunction.expected @@ -3,9 +3,9 @@ PsiJetFileStubImpl[package=] IMPORT_LIST CLASS[fqName=A, isEnumEntry=false, isInterface=false, isLocal=false, isTopLevel=true, name=A, superNames=[]] CLASS[fqName=T, isEnumEntry=false, isInterface=true, isLocal=false, isTopLevel=true, name=T, superNames=[]] - FUN[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=foo] + FUN[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=false, name=foo] VALUE_PARAMETER_LIST - FUN[fqName=null, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=bar] + FUN[fqName=null, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=bar] VALUE_PARAMETER_LIST CLASS[fqName=null, isEnumEntry=false, isInterface=false, isLocal=true, isTopLevel=false, name=Test, superNames=[A, T]] SUPER_TYPE_LIST diff --git a/idea/testData/stubs/LocalNamedObject.expected b/idea/testData/stubs/LocalNamedObject.expected index c921738e9cb..366322a9046 100644 --- a/idea/testData/stubs/LocalNamedObject.expected +++ b/idea/testData/stubs/LocalNamedObject.expected @@ -3,7 +3,7 @@ PsiJetFileStubImpl[package=] IMPORT_LIST CLASS[fqName=A, isEnumEntry=false, isInterface=false, isLocal=false, isTopLevel=true, name=A, superNames=[]] CLASS[fqName=T, isEnumEntry=false, isInterface=true, isLocal=false, isTopLevel=true, name=T, superNames=[]] - FUN[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=foo] + FUN[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=false, name=foo] VALUE_PARAMETER_LIST OBJECT_DECLARATION[fqName=null, isCompanion=false, isLocal=true, isObjectLiteral=false, isTopLevel=false, name=O, superNames=[A, T]] SUPER_TYPE_LIST diff --git a/idea/testData/stubs/ManyAnnotationsOnFunction.expected b/idea/testData/stubs/ManyAnnotationsOnFunction.expected index 44e111308e1..0ba7c1f984b 100644 --- a/idea/testData/stubs/ManyAnnotationsOnFunction.expected +++ b/idea/testData/stubs/ManyAnnotationsOnFunction.expected @@ -1,7 +1,7 @@ PsiJetFileStubImpl[package=] PACKAGE_DIRECTIVE IMPORT_LIST - FUN[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=foo] + FUN[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=false, name=foo] MODIFIER_LIST[] ANNOTATION ANNOTATION_ENTRY[hasValueArguments=false, shortName=Deprecated] diff --git a/idea/testData/stubs/MembersInLocalClass.expected b/idea/testData/stubs/MembersInLocalClass.expected index f416bf5d067..d6970a24b91 100644 --- a/idea/testData/stubs/MembersInLocalClass.expected +++ b/idea/testData/stubs/MembersInLocalClass.expected @@ -1,11 +1,11 @@ PsiJetFileStubImpl[package=] PACKAGE_DIRECTIVE IMPORT_LIST - FUN[fqName=f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=f] + FUN[fqName=f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=false, name=f] MODIFIER_LIST[public] CLASS[fqName=null, isEnumEntry=false, isInterface=false, isLocal=true, isTopLevel=false, name=C, superNames=[]] CLASS_BODY - FUN[fqName=null, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=f] + FUN[fqName=null, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f] VALUE_PARAMETER_LIST PROPERTY[fqName=null, hasDelegate=false, hasDelegateExpression=false, hasInitializer=false, hasReturnTypeRef=true, isExtension=false, isTopLevel=false, isVar=false, name=c] TYPE_REFERENCE diff --git a/idea/testData/stubs/MembersInLocalObject.expected b/idea/testData/stubs/MembersInLocalObject.expected index bd6e937481d..861a77625f7 100644 --- a/idea/testData/stubs/MembersInLocalObject.expected +++ b/idea/testData/stubs/MembersInLocalObject.expected @@ -1,11 +1,11 @@ PsiJetFileStubImpl[package=] PACKAGE_DIRECTIVE IMPORT_LIST - FUN[fqName=f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=f] + FUN[fqName=f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=false, name=f] VALUE_PARAMETER_LIST OBJECT_DECLARATION[fqName=null, isCompanion=false, isLocal=true, isObjectLiteral=false, isTopLevel=false, name=foo, superNames=[]] CLASS_BODY - FUN[fqName=null, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=foo] + FUN[fqName=null, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=foo] VALUE_PARAMETER_LIST PROPERTY[fqName=null, hasDelegate=false, hasDelegateExpression=false, hasInitializer=true, hasReturnTypeRef=true, isExtension=false, isTopLevel=false, isVar=false, name=foo] TYPE_REFERENCE diff --git a/idea/testData/stubs/NotStorePropertiesFrom.expected b/idea/testData/stubs/NotStorePropertiesFrom.expected index 557deb5e246..95c7d5db633 100644 --- a/idea/testData/stubs/NotStorePropertiesFrom.expected +++ b/idea/testData/stubs/NotStorePropertiesFrom.expected @@ -7,5 +7,5 @@ PsiJetFileStubImpl[package=] CLASS_BODY PROPERTY[fqName=Test.test, hasDelegate=false, hasDelegateExpression=false, hasInitializer=true, hasReturnTypeRef=false, isExtension=false, isTopLevel=false, isVar=false, name=test] CLASS_INITIALIZER - FUN[fqName=Test.more, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=more] + FUN[fqName=Test.more, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=more] VALUE_PARAMETER_LIST diff --git a/idea/testData/stubs/NotStorePropertyFromInitializer.expected b/idea/testData/stubs/NotStorePropertyFromInitializer.expected index a6ceb49c4be..35722f89c9c 100644 --- a/idea/testData/stubs/NotStorePropertyFromInitializer.expected +++ b/idea/testData/stubs/NotStorePropertyFromInitializer.expected @@ -1,7 +1,7 @@ PsiJetFileStubImpl[package=] PACKAGE_DIRECTIVE IMPORT_LIST - FUN[fqName=some, hasBlockBody=false, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=true, isTopLevel=true, name=some] + FUN[fqName=some, hasBlockBody=false, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=true, isTopLevel=true, mayHaveContract=false, name=some] TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION[referencedName=DoubleArray] diff --git a/idea/testData/stubs/ObjectInInitializer.expected b/idea/testData/stubs/ObjectInInitializer.expected index 877ff438d8c..8dcc21cda00 100644 --- a/idea/testData/stubs/ObjectInInitializer.expected +++ b/idea/testData/stubs/ObjectInInitializer.expected @@ -4,7 +4,7 @@ PsiJetFileStubImpl[package=] PROPERTY[fqName=p, hasDelegate=false, hasDelegateExpression=false, hasInitializer=true, hasReturnTypeRef=false, isExtension=false, isTopLevel=true, isVar=false, name=p] OBJECT_DECLARATION[fqName=null, isCompanion=false, isLocal=true, isObjectLiteral=true, isTopLevel=false, name=null, superNames=[]] CLASS_BODY - FUN[fqName=null, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=f] + FUN[fqName=null, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f] VALUE_PARAMETER_LIST PROPERTY[fqName=null, hasDelegate=false, hasDelegateExpression=false, hasInitializer=true, hasReturnTypeRef=true, isExtension=false, isTopLevel=false, isVar=false, name=p] TYPE_REFERENCE diff --git a/idea/testData/stubs/ObjectInPropertyDelegate.expected b/idea/testData/stubs/ObjectInPropertyDelegate.expected index 378ee51f7f7..3bc016a06a7 100644 --- a/idea/testData/stubs/ObjectInPropertyDelegate.expected +++ b/idea/testData/stubs/ObjectInPropertyDelegate.expected @@ -4,7 +4,7 @@ PsiJetFileStubImpl[package=] PROPERTY[fqName=p, hasDelegate=true, hasDelegateExpression=true, hasInitializer=false, hasReturnTypeRef=false, isExtension=false, isTopLevel=true, isVar=false, name=p] OBJECT_DECLARATION[fqName=null, isCompanion=false, isLocal=true, isObjectLiteral=true, isTopLevel=false, name=null, superNames=[]] CLASS_BODY - FUN[fqName=null, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=f] + FUN[fqName=null, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, mayHaveContract=false, name=f] VALUE_PARAMETER_LIST PROPERTY[fqName=null, hasDelegate=false, hasDelegateExpression=false, hasInitializer=true, hasReturnTypeRef=true, isExtension=false, isTopLevel=false, isVar=false, name=p] TYPE_REFERENCE diff --git a/idea/testData/stubs/QualifiedAnnotationOnFunction.expected b/idea/testData/stubs/QualifiedAnnotationOnFunction.expected index 5f9ede6552e..0810601cda2 100644 --- a/idea/testData/stubs/QualifiedAnnotationOnFunction.expected +++ b/idea/testData/stubs/QualifiedAnnotationOnFunction.expected @@ -1,7 +1,7 @@ PsiJetFileStubImpl[package=] PACKAGE_DIRECTIVE IMPORT_LIST - FUN[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=foo] + FUN[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=false, name=foo] MODIFIER_LIST[] ANNOTATION_ENTRY[hasValueArguments=false, shortName=Deprecated] CONSTRUCTOR_CALLEE diff --git a/idea/testData/stubs/TypeAnnotation.expected b/idea/testData/stubs/TypeAnnotation.expected index 83a5749020a..14227ecdc18 100644 --- a/idea/testData/stubs/TypeAnnotation.expected +++ b/idea/testData/stubs/TypeAnnotation.expected @@ -16,7 +16,7 @@ PsiJetFileStubImpl[package=] CLASS_BODY ENUM_ENTRY[fqName=E.E1, isEnumEntry=true, isInterface=false, isLocal=false, isTopLevel=false, name=E1, superNames=[]] ENUM_ENTRY[fqName=E.E2, isEnumEntry=true, isInterface=false, isLocal=false, isTopLevel=false, name=E2, superNames=[]] - FUN[fqName=types, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=types] + FUN[fqName=types, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, mayHaveContract=false, name=types] VALUE_PARAMETER_LIST VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=param] TYPE_REFERENCE 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 109393de8b0..015b6145c78 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/decompiler/stubBuilder/ClsStubBuilderTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/decompiler/stubBuilder/ClsStubBuilderTestGenerated.java @@ -74,6 +74,11 @@ public class ClsStubBuilderTestGenerated extends AbstractClsStubBuilderTest { runTest("idea/testData/decompiler/stubBuilder/Const/"); } + @TestMetadata("Contracts") + public void testContracts() throws Exception { + runTest("idea/testData/decompiler/stubBuilder/Contracts/"); + } + @TestMetadata("DataClass") public void testDataClass() throws Exception { runTest("idea/testData/decompiler/stubBuilder/DataClass/"); diff --git a/idea/tests/org/jetbrains/kotlin/idea/stubs/StubBuilderTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/stubs/StubBuilderTestGenerated.java index 3f68328adce..fd8165a55b4 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/stubs/StubBuilderTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/stubs/StubBuilderTestGenerated.java @@ -84,6 +84,11 @@ public class StubBuilderTestGenerated extends AbstractStubBuilderTest { runTest("idea/testData/stubs/Const.kt"); } + @TestMetadata("Contracts.kt") + public void testContracts() throws Exception { + runTest("idea/testData/stubs/Contracts.kt"); + } + @TestMetadata("DanglingAnnotations.kt") public void testDanglingAnnotations() throws Exception { runTest("idea/testData/stubs/DanglingAnnotations.kt");