From 881073b1c95bfdc969194cbde3d73d7461a2f5e1 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Fri, 5 Apr 2019 13:37:48 +0300 Subject: [PATCH] Add basic FIR -> IR converter with a set of text tests Tests duplicate IrTextTestCaseGenerated #KT-24065 Fixed --- build.gradle.kts | 4 +- compiler/build.gradle.kts | 1 + compiler/fir/fir2ir/build.gradle.kts | 46 + .../kotlin/fir/backend/ConversionUtils.kt | 140 ++ .../kotlin/fir/backend/FakeOverrideMode.kt | 18 + .../kotlin/fir/backend/Fir2IrCallableCache.kt | 54 + .../kotlin/fir/backend/Fir2IrConverter.kt | 54 + .../fir/backend/Fir2IrDeclarationStorage.kt | 474 +++++ .../kotlin/fir/backend/Fir2IrLocalStorage.kt | 74 + .../kotlin/fir/backend/Fir2IrVisitor.kt | 1108 +++++++++++ .../fir/descriptors/FirModuleDescriptor.kt | 74 + .../FirPackageFragmentDescriptor.kt | 47 + .../descriptors/FirPackageViewDescriptor.kt | 45 + .../kotlin/fir/AbstractFir2IrTextTest.kt | 92 + .../kotlin/fir/Fir2IrTextTestGenerated.java | 1614 +++++++++++++++++ .../scopes/impl/FirClassSubstitutionScope.kt | 64 +- .../kotlin/fir/expressions/FirOperation.kt | 2 + .../fir/symbols/impl/FirFunctionSymbol.kt | 4 +- .../types/impl/FirImplicitBuiltinTypeRef.kt | 6 + .../jetbrains/kotlin/ir/util/SymbolTable.kt | 15 +- .../ir/irText/classes/abstractMembers.kt | 2 + .../irText/classes/annotationClasses.fir.txt | 115 ++ ...rderingInDelegatingConstructorCall.fir.txt | 96 + .../ir/irText/classes/classMembers.fir.txt | 173 ++ .../ir/irText/classes/classes.fir.txt | 98 + .../ir/irText/classes/companionObject.kt | 2 + .../classes/dataClassWithArrayMembers.fir.txt | 191 ++ .../ir/irText/classes/dataClasses.fir.txt | 154 ++ .../irText/classes/dataClassesGeneric.fir.txt | 128 ++ .../classes/delegatedImplementation.fir.txt | 169 ++ ...ImplementationWithExplicitOverride.fir.txt | 54 + ...structorCallToTypeAliasConstructor.fir.txt | 73 + ...ructorCallsInSecondaryConstructors.fir.txt | 48 + .../testData/ir/irText/classes/enum.fir.txt | 489 +++++ .../irText/classes/enumClassModality.fir.txt | 382 ++++ .../classes/enumWithSecondaryCtor.fir.txt | 260 +++ .../ir/irText/classes/initBlock.fir.txt | 152 ++ .../ir/irText/classes/initVal.fir.txt | 94 + .../ir/irText/classes/initVar.fir.txt | 228 +++ .../ir/irText/classes/inlineClass.fir.txt | 32 + .../ir/irText/classes/innerClass.fir.txt | 58 + ...nnerClassWithDelegatingConstructor.fir.txt | 55 + .../lambdaInDataClassDefaultParameter.fir.txt | 79 + .../ir/irText/classes/localClasses.fir.txt | 26 + .../classes/objectLiteralExpressions.fir.txt | 130 ++ .../classes/objectWithInitializers.fir.txt | 63 + .../irText/classes/outerClassAccess.fir.txt | 74 + .../irText/classes/primaryConstructor.fir.txt | 132 ++ ...onstructorWithSuperConstructorCall.fir.txt | 107 ++ .../classes/qualifiedSuperCalls.fir.txt | 83 + .../ir/irText/classes/sealedClasses.fir.txt | 113 ++ ...uctorWithInitializersFromClassBody.fir.txt | 91 + .../irText/classes/secondaryConstructors.kt | 2 + .../ir/irText/classes/superCalls.fir.txt | 64 + .../annotationsInAnnotationArguments.fir.txt | 87 + ...otationsWithDefaultParameterValues.fir.txt | 55 + .../annotationsWithVarargParameters.fir.txt | 35 + .../arrayInAnnotationArguments.fir.txt | 61 + .../classLiteralInAnnotation.fir.txt | 99 + .../classesWithAnnotations.fir.txt | 182 ++ ...stExpressionsInAnnotationArguments.fir.txt | 42 + .../constructorsWithAnnotations.fir.txt | 52 + .../delegateFieldWithAnnotations.fir.txt | 26 + ...edPropertyAccessorsWithAnnotations.fir.txt | 125 ++ .../enumEntriesWithAnnotations.fir.txt | 112 ++ .../enumsInAnnotationArguments.fir.txt | 135 ++ .../annotations/fieldsWithAnnotations.fir.txt | 59 + .../annotations/fileAnnotations.fir.txt | 32 + .../functionsWithAnnotations.fir.txt | 31 + .../annotations/javaAnnotation.fir.txt | 7 + ...DelegatedPropertiesWithAnnotations.fir.txt | 33 + ...ultipleAnnotationsInSquareBrackets.fir.txt | 51 + ...onstructorParameterWithAnnotations.fir.txt | 50 + .../propertiesWithAnnotations.fir.txt | 41 + ...sorsFromClassHeaderWithAnnotations.fir.txt | 92 + .../propertyAccessorsWithAnnotations.fir.txt | 81 + ...ertySetterParameterWithAnnotations.fir.txt | 75 + .../receiverParameterWithAnnotations.fir.txt | 58 + ...preadOperatorInAnnotationArguments.fir.txt | 31 + .../typeAliasesWithAnnotations.fir.txt | 29 + .../typeParametersWithAnnotations.fir.txt | 20 + .../valueParametersWithAnnotations.fir.txt | 63 + .../varargsInAnnotationArguments.fir.txt | 89 + .../variablesWithAnnotations.fir.txt | 35 + .../catchParameterInTopLevelProperty.fir.txt | 14 + .../declarations/classLevelProperties.fir.txt | 122 ++ .../declarations/constValInitializers.fir.txt | 68 + .../irText/declarations/defaultArguments.kt | 2 + .../declarations/delegatedProperties.fir.txt | 78 + .../declarations/extensionProperties.fir.txt | 55 + .../irText/declarations/fakeOverrides.fir.txt | 115 ++ .../declarations/fileWithAnnotations.fir.txt | 12 + .../declarations/fileWithTypeAliasesOnly.kt | 2 + .../declarations/interfaceProperties.kt | 1 + .../ir/irText/declarations/kt27005.fir.txt | 13 + .../ir/irText/declarations/kt29833.fir.txt | 42 + .../localClassWithOverrides.fir.txt | 75 + .../localDelegatedProperties.fir.txt | 15 + .../declarations/localVarInDoWhile.fir.txt | 11 + .../expectClassInherited.fir.txt | 95 + .../multiplatform/expectedEnumClass.fir.txt | 152 ++ .../multiplatform/expectedSealedClass.fir.txt | 77 + .../packageLevelProperties.fir.txt | 83 + .../declarations/parameters/class.fir.txt | 93 + .../parameters/constructor.fir.txt | 202 +++ .../parameters/dataClassMembers.fir.txt | 47 + .../defaultPropertyAccessors.fir.txt | 128 ++ .../parameters/delegatedMembers.fir.txt | 37 + .../declarations/parameters/fun.fir.txt | 51 + .../parameters/genericInnerClass.fir.txt | 46 + .../declarations/parameters/lambdas.fir.txt | 59 + .../declarations/parameters/localFun.fir.txt | 24 + .../parameters/propertyAccessors.fir.txt | 126 ++ .../typeParameterBeforeBound.fir.txt | 34 + .../typeParameterBoundedBySubclass.fir.txt | 88 + .../primaryCtorDefaultArguments.kt | 2 + .../declarations/primaryCtorProperties.kt | 2 + .../differentReceivers.fir.txt | 68 + .../provideDelegate/local.fir.txt | 81 + .../localDifferentReceivers.fir.txt | 53 + .../provideDelegate/member.fir.txt | 106 ++ .../provideDelegate/memberExtension.fir.txt | 87 + .../provideDelegate/topLevel.fir.txt | 85 + .../ir/irText/declarations/typeAlias.kt | 2 + .../errors/suppressedNonPublicCall.fir.txt | 26 + .../irText/errors/unresolvedReference.fir.txt | 39 + .../argumentMappedWithError.fir.txt | 17 + .../ir/irText/expressions/arrayAccess.fir.txt | 21 + .../expressions/arrayAssignment.fir.txt | 20 + .../arrayAugmentedAssignment1.fir.txt | 64 + .../arrayAugmentedAssignment2.fir.txt | 42 + .../ir/irText/expressions/assignments.fir.txt | 51 + .../expressions/augmentedAssignment1.fir.txt | 37 + .../expressions/augmentedAssignment2.fir.txt | 65 + .../augmentedAssignmentWithExpression.fir.txt | 46 + .../expressions/badBreakContinue.fir.txt | 34 + .../ir/irText/expressions/bangbang.fir.txt | 35 + .../booleanConstsInAndAndOrOr.fir.txt | 23 + .../expressions/booleanOperators.fir.txt | 39 + .../boundCallableReferences.fir.txt | 63 + .../testData/ir/irText/expressions/boxOk.kt | 2 + .../irText/expressions/breakContinue.fir.txt | 51 + .../breakContinueInLoopHeader.fir.txt | 125 ++ .../callWithReorderedArguments.fir.txt | 32 + .../callableRefToGenericMember.fir.txt | 53 + ...lableReferenceToImportedFromObject.fir.txt | 72 + .../callableReferenceTypeArguments.fir.txt | 60 + .../ir/irText/expressions/calls.fir.txt | 41 + .../expressions/castToTypeParameter.fir.txt | 85 + .../expressions/catchParameterAccess.fir.txt | 11 + .../expressions/chainOfSafeCalls.fir.txt | 35 + .../irText/expressions/classReference.fir.txt | 28 + .../irText/expressions/coercionToUnit.fir.txt | 26 + .../complexAugmentedAssignment.fir.txt | 220 +++ .../ir/irText/expressions/contructorCall.kt | 2 + .../expressions/conventionComparisons.fir.txt | 58 + .../irText/expressions/destructuring1.fir.txt | 57 + .../destructuringWithUnderscore.fir.txt | 64 + .../irText/expressions/dotQualified.fir.txt | 11 + .../ir/irText/expressions/elvis.fir.txt | 109 ++ .../expressions/enumEntryAsReceiver.fir.txt | 84 + ...umEntryReferenceFromEnumEntryClass.fir.txt | 125 ++ .../ir/irText/expressions/equality.kt | 2 + .../expressions/extFunInvokeAsFun.fir.txt | 14 + .../expressions/extFunSafeInvoke.fir.txt | 9 + .../extensionPropertyGetterCall.fir.txt | 11 + .../ir/irText/expressions/field.fir.txt | 29 + .../comparableWithDoubleOrFloat.fir.txt | 41 + ...eqRhsConditionPossiblyAffectingLhs.fir.txt | 27 + .../floatingPointCompareTo.fir.txt | 175 ++ .../floatingPointEqeq.fir.txt | 183 ++ .../floatingPointEquals.fir.txt | 219 +++ .../floatingPointExcleq.fir.txt | 197 ++ .../floatingPointLess.fir.txt | 123 ++ .../nullableAnyAsIntToDouble.fir.txt | 14 + .../nullableFloatingPointEqeq.fir.txt | 61 + ...meterWithPrimitiveNumericSupertype.fir.txt | 150 ++ .../whenByFloatingPoint.fir.txt | 140 ++ .../ir/irText/expressions/for.fir.txt | 47 + .../expressions/forWithBreakContinue.fir.txt | 77 + .../forWithImplicitReceivers.fir.txt | 109 ++ .../expressions/funImportedFromObject.fir.txt | 31 + .../expressions/genericPropertyCall.fir.txt | 16 + .../expressions/genericPropertyRef.fir.txt | 171 ++ .../ir/irText/expressions/identity.kt | 2 + .../ir/irText/expressions/ifElseIf.fir.txt | 23 + ...mplicitCastInReturnFromConstructor.fir.txt | 30 + .../implicitCastOnPlatformType.fir.txt | 6 + .../expressions/implicitCastToNonNull.fir.txt | 68 + .../implicitCastToTypeParameter.fir.txt | 74 + .../testData/ir/irText/expressions/in.fir.txt | 29 + .../expressions/incrementDecrement.fir.txt | 144 ++ .../expressions/interfaceThisRef.fir.txt | 22 + .../javaSyntheticPropertyAccess.fir.txt | 11 + .../jvmInstanceFieldReference.fir.txt | 62 + .../jvmStaticFieldReference.fir.txt | 59 + .../ir/irText/expressions/kt16904.fir.txt | 147 ++ .../ir/irText/expressions/kt16905.fir.txt | 81 + .../ir/irText/expressions/kt23030.fir.txt | 107 ++ .../ir/irText/expressions/kt24804.fir.txt | 36 + .../ir/irText/expressions/kt27933.fir.txt | 25 + .../ir/irText/expressions/kt28006.fir.txt | 75 + .../ir/irText/expressions/kt28456.fir.txt | 56 + .../ir/irText/expressions/kt28456a.fir.txt | 32 + .../ir/irText/expressions/kt28456b.fir.txt | 67 + .../ir/irText/expressions/kt30020.fir.txt | 245 +++ .../ir/irText/expressions/lambdaInCAO.fir.txt | 42 + .../ir/irText/expressions/literals.fir.txt | 158 ++ .../expressions/memberTypeArguments.fir.txt | 40 + .../membersImportedFromObject.fir.txt | 84 + .../multipleThisReferences.fir.txt | 107 ++ .../expressions/objectAsCallable.fir.txt | 97 + .../expressions/objectClassReference.fir.txt | 25 + .../expressions/objectReference.fir.txt | 153 ++ ...nceInClosureInSuperConstructorCall.fir.txt | 57 + .../objectReferenceInFieldInitializer.fir.txt | 54 + .../outerClassInstanceReference.fir.txt | 47 + .../expressions/primitiveComparisons.fir.txt | 177 ++ .../primitivesImplicitConversions.fir.txt | 110 ++ .../expressions/propertyReferences.fir.txt | 273 +++ .../ir/irText/expressions/references.fir.txt | 54 + .../expressions/reflectionLiterals.fir.txt | 90 + .../irText/expressions/safeAssignment.fir.txt | 45 + .../safeCallWithIncrementDecrement.fir.txt | 61 + .../ir/irText/expressions/safeCalls.fir.txt | 94 + .../expressions/sam/samConstructors.fir.txt | 37 + .../expressions/sam/samConversions.fir.txt | 45 + .../sam/samConversionsWithSmartCasts.fir.txt | 85 + .../expressions/sam/samOperators.fir.txt | 23 + .../setFieldWithImplicitCast.fir.txt | 59 + ...edToUnsignedConversions_annotation.fir.txt | 17 + .../signedToUnsignedConversions_test.fir.txt | 105 ++ .../expressions/simpleOperators.fir.txt | 78 + .../expressions/simpleUnaryOperators.fir.txt | 34 + .../ir/irText/expressions/smartCasts.fir.txt | 58 + .../smartCastsWithDestructuring.fir.txt | 54 + ...pecializedTypeAliasConstructorCall.fir.txt | 38 + .../expressions/stringComparisons.fir.txt | 25 + .../ir/irText/expressions/stringPlus.fir.txt | 22 + .../expressions/stringTemplates.fir.txt | 96 + .../temporaryInEnumEntryInitializer.fir.txt | 79 + .../expressions/temporaryInInitBlock.fir.txt | 34 + .../thisOfGenericOuterClass.fir.txt | 88 + .../thisReferenceBeforeClassDeclared.fir.txt | 67 + .../ir/irText/expressions/throw.fir.txt | 14 + .../ir/irText/expressions/tryCatch.fir.txt | 24 + .../tryCatchWithImplicitCast.fir.txt | 16 + .../irText/expressions/typeArguments.fir.txt | 13 + .../ir/irText/expressions/typeOperators.kt | 2 + .../typeParameterClassLiteral.fir.txt | 61 + .../unsignedIntegerLiterals.fir.txt | 91 + .../expressions/useImportedMember.fir.txt | 239 +++ .../ir/irText/expressions/values.fir.txt | 130 ++ .../ir/irText/expressions/vararg.fir.txt | 35 + .../varargWithImplicitCast.fir.txt | 25 + .../variableAsFunctionCall.fir.txt | 30 + ...variableAsFunctionCallWithGenerics.fir.txt | 32 + .../ir/irText/expressions/when.fir.txt | 155 ++ .../expressions/whenCoercedToUnit.fir.txt | 12 + .../ir/irText/expressions/whenElse.kt | 2 + .../ir/irText/expressions/whenReturn.fir.txt | 37 + .../whenWithSubjectVariable.fir.txt | 37 + .../irText/expressions/whileDoWhile.fir.txt | 54 + .../irText/lambdas/anonymousFunction.fir.txt | 14 + .../lambdas/destructuringInLambda.fir.txt | 71 + .../ir/irText/lambdas/extensionLambda.fir.txt | 11 + .../ir/irText/lambdas/justLambda.fir.txt | 29 + .../ir/irText/lambdas/localFunction.fir.txt | 12 + .../lambdas/multipleImplicitReceivers.fir.txt | 107 ++ .../ir/irText/lambdas/nonLocalReturn.fir.txt | 85 + .../ir/irText/lambdas/samAdapter.fir.txt | 13 + .../irText/regressions/coercionInLoop.fir.txt | 29 + .../regressions/integerCoercionToT.fir.txt | 87 + .../ir/irText/regressions/kt24114.fir.txt | 57 + .../newInference/fixationOrder1.fir.txt | 50 + .../typeAliasCtorForGenericClass.fir.txt | 41 + .../ir/irText/singletons/companion.fir.txt | 46 + .../ir/irText/singletons/enumEntry.fir.txt | 74 + .../ir/irText/singletons/object.fir.txt | 46 + .../ir/irText/stubs/builtinMap.fir.txt | 23 + .../ir/irText/stubs/constFromBuiltins.fir.txt | 10 + .../genericClassInDifferentModule_m1.fir.txt | 53 + .../genericClassInDifferentModule_m2.fir.txt | 61 + .../javaConstructorWithTypeParameters.fir.txt | 21 + .../testData/ir/irText/stubs/javaEnum.fir.txt | 10 + .../ir/irText/stubs/javaInnerClass.fir.txt | 64 + .../ir/irText/stubs/javaMethod.fir.txt | 6 + .../ir/irText/stubs/javaNestedClass.fir.txt | 6 + .../ir/irText/stubs/javaStaticMethod.fir.txt | 5 + .../stubs/javaSyntheticProperty.fir.txt | 10 + .../stubs/jdkClassSyntheticProperty.fir.txt | 7 + .../ir/irText/stubs/kotlinInnerClass.fir.txt | 6 + .../testData/ir/irText/stubs/simple.fir.txt | 11 + .../ir/irText/types/intersectionType1.fir.txt | 55 + .../ir/irText/types/intersectionType2.fir.txt | 100 + .../ir/irText/types/intersectionType3.fir.txt | 167 ++ .../localVariableOfIntersectionType.fir.txt | 102 ++ compiler/tests-common/build.gradle.kts | 1 + .../kotlin/ir/AbstractIrGeneratorTestCase.kt | 2 +- .../kotlin/ir/AbstractIrTextTestCase.kt | 44 +- .../generators/tests/GenerateCompilerTests.kt | 9 +- idea/build.gradle.kts | 1 + .../complexBuildGradleKts/build.gradle.kts | 3 +- prepare/idea-plugin/build.gradle.kts | 1 + settings.gradle | 1 + 305 files changed, 22829 insertions(+), 57 deletions(-) create mode 100644 compiler/fir/fir2ir/build.gradle.kts create mode 100644 compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt create mode 100644 compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/FakeOverrideMode.kt create mode 100644 compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrCallableCache.kt create mode 100644 compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConverter.kt create mode 100644 compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt create mode 100644 compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrLocalStorage.kt create mode 100644 compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt create mode 100644 compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/descriptors/FirModuleDescriptor.kt create mode 100644 compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/descriptors/FirPackageFragmentDescriptor.kt create mode 100644 compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/descriptors/FirPackageViewDescriptor.kt create mode 100644 compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/AbstractFir2IrTextTest.kt create mode 100644 compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java create mode 100644 compiler/testData/ir/irText/classes/annotationClasses.fir.txt create mode 100644 compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.fir.txt create mode 100644 compiler/testData/ir/irText/classes/classMembers.fir.txt create mode 100644 compiler/testData/ir/irText/classes/classes.fir.txt create mode 100644 compiler/testData/ir/irText/classes/dataClassWithArrayMembers.fir.txt create mode 100644 compiler/testData/ir/irText/classes/dataClasses.fir.txt create mode 100644 compiler/testData/ir/irText/classes/dataClassesGeneric.fir.txt create mode 100644 compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt create mode 100644 compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.txt create mode 100644 compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.fir.txt create mode 100644 compiler/testData/ir/irText/classes/delegatingConstructorCallsInSecondaryConstructors.fir.txt create mode 100644 compiler/testData/ir/irText/classes/enum.fir.txt create mode 100644 compiler/testData/ir/irText/classes/enumClassModality.fir.txt create mode 100644 compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.txt create mode 100644 compiler/testData/ir/irText/classes/initBlock.fir.txt create mode 100644 compiler/testData/ir/irText/classes/initVal.fir.txt create mode 100644 compiler/testData/ir/irText/classes/initVar.fir.txt create mode 100644 compiler/testData/ir/irText/classes/inlineClass.fir.txt create mode 100644 compiler/testData/ir/irText/classes/innerClass.fir.txt create mode 100644 compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.fir.txt create mode 100644 compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.txt create mode 100644 compiler/testData/ir/irText/classes/localClasses.fir.txt create mode 100644 compiler/testData/ir/irText/classes/objectLiteralExpressions.fir.txt create mode 100644 compiler/testData/ir/irText/classes/objectWithInitializers.fir.txt create mode 100644 compiler/testData/ir/irText/classes/outerClassAccess.fir.txt create mode 100644 compiler/testData/ir/irText/classes/primaryConstructor.fir.txt create mode 100644 compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.fir.txt create mode 100644 compiler/testData/ir/irText/classes/qualifiedSuperCalls.fir.txt create mode 100644 compiler/testData/ir/irText/classes/sealedClasses.fir.txt create mode 100644 compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.fir.txt create mode 100644 compiler/testData/ir/irText/classes/superCalls.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/annotationsInAnnotationArguments.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/annotationsWithDefaultParameterValues.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/annotationsWithVarargParameters.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/arrayInAnnotationArguments.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/classLiteralInAnnotation.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/constructorsWithAnnotations.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/fileAnnotations.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/functionsWithAnnotations.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/javaAnnotation.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/localDelegatedPropertiesWithAnnotations.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/multipleAnnotationsInSquareBrackets.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/propertyAccessorsFromClassHeaderWithAnnotations.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/typeParametersWithAnnotations.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/varargsInAnnotationArguments.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/annotations/variablesWithAnnotations.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/classLevelProperties.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/constValInitializers.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/delegatedProperties.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/extensionProperties.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/fakeOverrides.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/fileWithAnnotations.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/kt27005.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/kt29833.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/localClassWithOverrides.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/localVarInDoWhile.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/multiplatform/expectClassInherited.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/multiplatform/expectedSealedClass.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/packageLevelProperties.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/class.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/constructor.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/dataClassMembers.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/fun.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/genericInnerClass.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/lambdas.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/localFun.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/propertyAccessors.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/provideDelegate/local.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/provideDelegate/member.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt create mode 100644 compiler/testData/ir/irText/declarations/provideDelegate/topLevel.fir.txt create mode 100644 compiler/testData/ir/irText/errors/suppressedNonPublicCall.fir.txt create mode 100644 compiler/testData/ir/irText/errors/unresolvedReference.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/argumentMappedWithError.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/arrayAccess.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/arrayAssignment.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/assignments.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/augmentedAssignment1.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/augmentedAssignment2.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/badBreakContinue.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/bangbang.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/booleanConstsInAndAndOrOr.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/booleanOperators.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/boundCallableReferences.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/breakContinue.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/callWithReorderedArguments.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/callableRefToGenericMember.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/callableReferenceToImportedFromObject.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/callableReferenceTypeArguments.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/calls.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/castToTypeParameter.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/catchParameterAccess.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/chainOfSafeCalls.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/classReference.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/conventionComparisons.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/destructuring1.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/destructuringWithUnderscore.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/dotQualified.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/elvis.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/extFunInvokeAsFun.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/extFunSafeInvoke.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/field.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/floatingPointComparisons/comparableWithDoubleOrFloat.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/floatingPointComparisons/eqeqRhsConditionPossiblyAffectingLhs.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointLess.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableAnyAsIntToDouble.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableFloatingPointEqeq.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/for.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/forWithBreakContinue.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/funImportedFromObject.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/genericPropertyCall.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/genericPropertyRef.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/ifElseIf.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/implicitCastInReturnFromConstructor.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/implicitCastOnPlatformType.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/implicitCastToNonNull.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/in.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/incrementDecrement.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/interfaceThisRef.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/javaSyntheticPropertyAccess.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/jvmStaticFieldReference.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/kt16904.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/kt16905.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/kt23030.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/kt24804.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/kt27933.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/kt28006.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/kt28456.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/kt28456a.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/kt28456b.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/kt30020.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/lambdaInCAO.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/literals.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/memberTypeArguments.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/membersImportedFromObject.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/multipleThisReferences.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/objectAsCallable.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/objectClassReference.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/objectReference.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/objectReferenceInFieldInitializer.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/outerClassInstanceReference.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/primitiveComparisons.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/primitivesImplicitConversions.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/propertyReferences.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/references.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/reflectionLiterals.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/safeAssignment.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/safeCalls.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/sam/samConstructors.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/sam/samConversions.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/sam/samOperators.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/signedToUnsignedConversions_annotation.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/signedToUnsignedConversions_test.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/simpleOperators.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/simpleUnaryOperators.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/smartCasts.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/smartCastsWithDestructuring.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/stringComparisons.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/stringPlus.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/stringTemplates.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/temporaryInInitBlock.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/throw.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/tryCatch.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/typeArguments.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/typeParameterClassLiteral.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/unsignedIntegerLiterals.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/useImportedMember.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/values.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/vararg.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/varargWithImplicitCast.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/when.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/whenCoercedToUnit.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/whenReturn.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/whenWithSubjectVariable.fir.txt create mode 100644 compiler/testData/ir/irText/expressions/whileDoWhile.fir.txt create mode 100644 compiler/testData/ir/irText/lambdas/anonymousFunction.fir.txt create mode 100644 compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.txt create mode 100644 compiler/testData/ir/irText/lambdas/extensionLambda.fir.txt create mode 100644 compiler/testData/ir/irText/lambdas/justLambda.fir.txt create mode 100644 compiler/testData/ir/irText/lambdas/localFunction.fir.txt create mode 100644 compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt create mode 100644 compiler/testData/ir/irText/lambdas/nonLocalReturn.fir.txt create mode 100644 compiler/testData/ir/irText/lambdas/samAdapter.fir.txt create mode 100644 compiler/testData/ir/irText/regressions/coercionInLoop.fir.txt create mode 100644 compiler/testData/ir/irText/regressions/integerCoercionToT.fir.txt create mode 100644 compiler/testData/ir/irText/regressions/kt24114.fir.txt create mode 100644 compiler/testData/ir/irText/regressions/newInference/fixationOrder1.fir.txt create mode 100644 compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.fir.txt create mode 100644 compiler/testData/ir/irText/singletons/companion.fir.txt create mode 100644 compiler/testData/ir/irText/singletons/enumEntry.fir.txt create mode 100644 compiler/testData/ir/irText/singletons/object.fir.txt create mode 100644 compiler/testData/ir/irText/stubs/builtinMap.fir.txt create mode 100644 compiler/testData/ir/irText/stubs/constFromBuiltins.fir.txt create mode 100644 compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m1.fir.txt create mode 100644 compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt create mode 100644 compiler/testData/ir/irText/stubs/javaConstructorWithTypeParameters.fir.txt create mode 100644 compiler/testData/ir/irText/stubs/javaEnum.fir.txt create mode 100644 compiler/testData/ir/irText/stubs/javaInnerClass.fir.txt create mode 100644 compiler/testData/ir/irText/stubs/javaMethod.fir.txt create mode 100644 compiler/testData/ir/irText/stubs/javaNestedClass.fir.txt create mode 100644 compiler/testData/ir/irText/stubs/javaStaticMethod.fir.txt create mode 100644 compiler/testData/ir/irText/stubs/javaSyntheticProperty.fir.txt create mode 100644 compiler/testData/ir/irText/stubs/jdkClassSyntheticProperty.fir.txt create mode 100644 compiler/testData/ir/irText/stubs/kotlinInnerClass.fir.txt create mode 100644 compiler/testData/ir/irText/stubs/simple.fir.txt create mode 100644 compiler/testData/ir/irText/types/intersectionType1.fir.txt create mode 100644 compiler/testData/ir/irText/types/intersectionType2.fir.txt create mode 100644 compiler/testData/ir/irText/types/intersectionType3.fir.txt create mode 100644 compiler/testData/ir/irText/types/localVariableOfIntersectionType.fir.txt diff --git a/build.gradle.kts b/build.gradle.kts index 59aaa5a506d..e5332fa73de 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -195,7 +195,8 @@ extra["compilerModules"] = arrayOf( ":compiler:fir:cones", ":compiler:fir:resolve", ":compiler:fir:tree", - ":compiler:fir:psi2fir" + ":compiler:fir:psi2fir", + ":compiler:fir:fir2ir" ) } else { emptyArray() @@ -485,6 +486,7 @@ tasks { create("firCompilerTest") { dependsOn(":compiler:fir:psi2fir:test") dependsOn(":compiler:fir:resolve:test") + dependsOn(":compiler:fir:fir2ir:test") } create("scriptingTest") { diff --git a/compiler/build.gradle.kts b/compiler/build.gradle.kts index 0bc4644f807..e601a0a9377 100644 --- a/compiler/build.gradle.kts +++ b/compiler/build.gradle.kts @@ -47,6 +47,7 @@ dependencies { testCompileOnly(project(":kotlin-test:kotlin-test-junit")) testCompile(projectTests(":compiler:tests-common")) testCompile(projectTests(":compiler:fir:psi2fir")) + testCompile(projectTests(":compiler:fir:fir2ir")) testCompile(projectTests(":compiler:fir:resolve")) testCompile(projectTests(":generators:test-generator")) testCompile(project(":compiler:ir.ir2cfg")) diff --git a/compiler/fir/fir2ir/build.gradle.kts b/compiler/fir/fir2ir/build.gradle.kts new file mode 100644 index 00000000000..8d1f47a1e6e --- /dev/null +++ b/compiler/fir/fir2ir/build.gradle.kts @@ -0,0 +1,46 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +plugins { + kotlin("jvm") + id("jps-compatible") +} + +dependencies { + compileOnly(project(":core:descriptors")) + compileOnly(project(":compiler:fir:cones")) + compileOnly(project(":compiler:fir:resolve")) + compileOnly(project(":compiler:fir:tree")) + compileOnly(project(":compiler:ir.tree")) + compileOnly(project(":compiler:ir.psi2ir")) + compileOnly(project(":compiler:ir.backend.common")) + + compileOnly(intellijCoreDep()) { includeJars("intellij-core") } + + testCompileOnly(intellijDep()) { includeJars("openapi", "idea", "idea_rt", "util", "asm-all", rootProject = rootProject) } + + testRuntime(intellijDep()) + + testCompile(commonDep("junit:junit")) + testCompileOnly(project(":kotlin-test:kotlin-test-jvm")) + testCompileOnly(project(":kotlin-test:kotlin-test-junit")) + testCompile(projectTests(":compiler:tests-common")) + testCompile(projectTests(":compiler:fir:resolve")) + + testCompileOnly(project(":kotlin-reflect-api")) + testRuntime(project(":kotlin-reflect")) + +} + +sourceSets { + "main" { projectDefault() } + "test" { projectDefault() } +} + +projectTest { + workingDir = rootDir +} + +testsJar() \ No newline at end of file diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt new file mode 100644 index 00000000000..5c16a793a21 --- /dev/null +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt @@ -0,0 +1,140 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.backend + +import org.jetbrains.kotlin.fir.* +import org.jetbrains.kotlin.fir.resolve.toSymbol +import org.jetbrains.kotlin.fir.symbols.ConeClassifierSymbol +import org.jetbrains.kotlin.fir.symbols.LibraryTypeParameterSymbol +import org.jetbrains.kotlin.fir.symbols.impl.* +import org.jetbrains.kotlin.fir.types.* +import org.jetbrains.kotlin.ir.IrElement +import org.jetbrains.kotlin.ir.symbols.* +import org.jetbrains.kotlin.ir.types.IrErrorType +import org.jetbrains.kotlin.ir.types.IrType +import org.jetbrains.kotlin.ir.types.IrTypeArgument +import org.jetbrains.kotlin.ir.types.impl.* +import org.jetbrains.kotlin.psi.psiUtil.endOffset +import org.jetbrains.kotlin.psi.psiUtil.startOffsetSkippingComments +import org.jetbrains.kotlin.types.Variance + +internal fun FirElement.convertWithOffsets( + f: (startOffset: Int, endOffset: Int) -> T +): T { + val startOffset = psi?.startOffsetSkippingComments ?: -1 + val endOffset = psi?.endOffset ?: -1 + return f(startOffset, endOffset) +} + +internal fun createErrorType(): IrErrorType = IrErrorTypeImpl(null, emptyList(), Variance.INVARIANT) + +fun FirTypeRef.toIrType(session: FirSession, declarationStorage: Fir2IrDeclarationStorage): IrType { + if (this !is FirResolvedTypeRef) { + return createErrorType() + } + return type.toIrType(session, declarationStorage) +} + +fun ConeKotlinType.toIrType(session: FirSession, declarationStorage: Fir2IrDeclarationStorage): IrType { + return when (this) { + is ConeKotlinErrorType -> createErrorType() + is ConeLookupTagBasedType -> { + val firSymbol = this.lookupTag.toSymbol(session) ?: return createErrorType() + val irSymbol = firSymbol.toIrSymbol(session, declarationStorage) + // TODO: annotations + IrSimpleTypeImpl( + irSymbol, this.isMarkedNullable, + typeArguments.map { it.toIrTypeArgument(session, declarationStorage) }, + emptyList() + ) + } + is ConeFlexibleType -> { + // TODO: yet we take more general type. Not quite sure it's Ok + upperBound.toIrType(session, declarationStorage) + } + is ConeCapturedType -> TODO() + } +} + +fun ConeKotlinTypeProjection.toIrTypeArgument(session: FirSession, declarationStorage: Fir2IrDeclarationStorage): IrTypeArgument { + return when (this) { + ConeStarProjection -> IrStarProjectionImpl + is ConeKotlinTypeProjectionIn -> { + val irType = this.type.toIrType(session, declarationStorage) + makeTypeProjection(irType, Variance.IN_VARIANCE) + } + is ConeKotlinTypeProjectionOut -> { + val irType = this.type.toIrType(session, declarationStorage) + makeTypeProjection(irType, Variance.OUT_VARIANCE) + } + is ConeKotlinType -> { + val irType = toIrType(session, declarationStorage) + makeTypeProjection(irType, Variance.INVARIANT) + } + } +} + +fun ConeClassifierSymbol.toIrSymbol(session: FirSession, declarationStorage: Fir2IrDeclarationStorage): IrClassifierSymbol { + return when (this) { + is FirTypeParameterSymbol -> { + toTypeParameterSymbol(declarationStorage) + } + is LibraryTypeParameterSymbol -> { + toTypeParameterSymbol(declarationStorage) + } + is FirTypeAliasSymbol -> { + val typeAlias = fir + val coneClassLikeType = (typeAlias.expandedTypeRef as FirResolvedTypeRef).type as ConeClassLikeType + coneClassLikeType.lookupTag.toSymbol(session)!!.toIrSymbol(session, declarationStorage) + } + is FirClassSymbol -> { + toClassSymbol(declarationStorage) + } + else -> throw AssertionError("Should not be here: $this") + } +} + +fun FirReference.toSymbol(declarationStorage: Fir2IrDeclarationStorage): IrSymbol? { + if (this is FirNamedReference) { + return toSymbol(declarationStorage) + } + return null +} + +fun FirNamedReference.toSymbol(declarationStorage: Fir2IrDeclarationStorage): IrSymbol? { + if (this is FirResolvedCallableReference) { + when (val callableSymbol = this.callableSymbol) { + is FirFunctionSymbol -> return callableSymbol.toFunctionSymbol(declarationStorage) + is FirPropertySymbol -> return callableSymbol.toPropertySymbol(declarationStorage) + is FirVariableSymbol -> return callableSymbol.toValueSymbol(declarationStorage) + } + } + return null +} + +fun FirClassSymbol.toClassSymbol(declarationStorage: Fir2IrDeclarationStorage): IrClassSymbol { + return declarationStorage.getIrClassSymbol(this) +} + +fun FirTypeParameterSymbol.toTypeParameterSymbol(declarationStorage: Fir2IrDeclarationStorage): IrTypeParameterSymbol { + return declarationStorage.getIrTypeParameterSymbol(this) +} + +fun LibraryTypeParameterSymbol.toTypeParameterSymbol(declarationStorage: Fir2IrDeclarationStorage): IrTypeParameterSymbol { + return declarationStorage.getIrTypeParameterSymbol(this) +} + +fun FirFunctionSymbol.toFunctionSymbol(declarationStorage: Fir2IrDeclarationStorage): IrFunctionSymbol { + return declarationStorage.getIrFunctionSymbol(this) +} + +fun FirPropertySymbol.toPropertySymbol(declarationStorage: Fir2IrDeclarationStorage): IrPropertySymbol { + return declarationStorage.getIrPropertySymbol(this) +} + +fun FirVariableSymbol.toValueSymbol(declarationStorage: Fir2IrDeclarationStorage): IrValueSymbol { + return declarationStorage.getIrValueSymbol(this) +} diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/FakeOverrideMode.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/FakeOverrideMode.kt new file mode 100644 index 00000000000..d4654d42678 --- /dev/null +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/FakeOverrideMode.kt @@ -0,0 +1,18 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.backend + +enum class FakeOverrideMode { + // No fake overrides are generated + NONE, + // Only fake overrides with substituted signatures are generated + SUBSTITUTION, + // All fake overrides are generated, including trivial ones, explicitly declared function is specified as overridden one + NORMAL, + // All fake overrides are generated, function of direct base class (possibly also fake override) is specified as overridden one + // TODO: not supported yet (to be discussed) + FULLY_COMPATIBLE +} \ No newline at end of file diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrCallableCache.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrCallableCache.kt new file mode 100644 index 00000000000..52d1567d61a --- /dev/null +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrCallableCache.kt @@ -0,0 +1,54 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.backend + +import org.jetbrains.kotlin.descriptors.Visibilities +import org.jetbrains.kotlin.fir.declarations.* +import org.jetbrains.kotlin.fir.expressions.FirVariable +import org.jetbrains.kotlin.ir.declarations.* + +class Fir2IrCallableCache { + private val parameterCache = mutableMapOf() + + private val variableCache = mutableMapOf() + + private val localClassCache = mutableMapOf() + + private val localFunctionCache = mutableMapOf() + + fun getParameter(parameter: FirValueParameter): IrValueParameter? = parameterCache[parameter] + + fun putParameter(firParameter: FirValueParameter, irParameter: IrValueParameter) { + parameterCache[firParameter] = irParameter + } + + fun getVariable(variable: FirVariable): IrVariable? = variableCache[variable] + + fun putVariable(firVariable: FirVariable, irVariable: IrVariable) { + variableCache[firVariable] = irVariable + } + + fun getLocalClass(localClass: FirClass): IrClass? = localClassCache[localClass] + + fun putLocalClass(localClass: FirClass, irClass: IrClass) { + require(localClass !is FirRegularClass || localClass.visibility == Visibilities.LOCAL) + localClassCache[localClass] = irClass + } + + fun getLocalFunction(localFunction: FirFunction): IrSimpleFunction? = localFunctionCache[localFunction] + + fun putLocalFunction(localFunction: FirFunction, irFunction: IrSimpleFunction) { + require(localFunction !is FirNamedFunction || localFunction.visibility == Visibilities.LOCAL) + localFunctionCache[localFunction] = irFunction + } + + fun clear() { + parameterCache.clear() + variableCache.clear() + localClassCache.clear() + localFunctionCache.clear() + } +} \ No newline at end of file diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConverter.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConverter.kt new file mode 100644 index 00000000000..8242a528b1c --- /dev/null +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConverter.kt @@ -0,0 +1,54 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.backend + +import org.jetbrains.kotlin.config.LanguageVersionSettings +import org.jetbrains.kotlin.fir.FirSession +import org.jetbrains.kotlin.fir.declarations.FirFile +import org.jetbrains.kotlin.fir.descriptors.FirModuleDescriptor +import org.jetbrains.kotlin.ir.declarations.IrFile +import org.jetbrains.kotlin.ir.declarations.IrModuleFragment +import org.jetbrains.kotlin.ir.declarations.impl.IrModuleFragmentImpl +import org.jetbrains.kotlin.ir.descriptors.IrBuiltIns +import org.jetbrains.kotlin.ir.util.ConstantValueGenerator +import org.jetbrains.kotlin.ir.util.ExternalDependenciesGenerator +import org.jetbrains.kotlin.ir.util.SymbolTable +import org.jetbrains.kotlin.ir.util.TypeTranslator + +object Fir2IrConverter { + + fun createModuleFragment( + session: FirSession, + firFiles: List, + languageVersionSettings: LanguageVersionSettings, + fakeOverrideMode: FakeOverrideMode = FakeOverrideMode.NORMAL + ): IrModuleFragment { + val moduleDescriptor = FirModuleDescriptor(session) + val symbolTable = SymbolTable() + val constantValueGenerator = ConstantValueGenerator(moduleDescriptor, symbolTable) + val typeTranslator = TypeTranslator(symbolTable, languageVersionSettings, moduleDescriptor.builtIns) + constantValueGenerator.typeTranslator = typeTranslator + typeTranslator.constantValueGenerator = constantValueGenerator + val builtIns = IrBuiltIns(moduleDescriptor.builtIns, typeTranslator, symbolTable) + val fir2irTransformer = Fir2IrVisitor(session, moduleDescriptor, symbolTable, builtIns, fakeOverrideMode) + val irFiles = mutableListOf() + for (firFile in firFiles) { + irFiles += firFile.accept(fir2irTransformer, null) as IrFile + } + + val irModuleFragment = IrModuleFragmentImpl(moduleDescriptor, builtIns, irFiles) + generateUnboundSymbolsAsDependencies(irModuleFragment, symbolTable, builtIns) + return irModuleFragment + } + + private fun generateUnboundSymbolsAsDependencies( + irModule: IrModuleFragment, + symbolTable: SymbolTable, + builtIns: IrBuiltIns + ) { + ExternalDependenciesGenerator(irModule.descriptor, symbolTable, builtIns).generateUnboundSymbolsAsDependencies() + } +} \ No newline at end of file diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt new file mode 100644 index 00000000000..759c3ee68d4 --- /dev/null +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt @@ -0,0 +1,474 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.backend + +import org.jetbrains.kotlin.backend.common.descriptors.* +import org.jetbrains.kotlin.descriptors.DeclarationDescriptor +import org.jetbrains.kotlin.descriptors.Modality +import org.jetbrains.kotlin.descriptors.Visibilities +import org.jetbrains.kotlin.fir.FirSession +import org.jetbrains.kotlin.fir.declarations.* +import org.jetbrains.kotlin.fir.descriptors.FirModuleDescriptor +import org.jetbrains.kotlin.fir.descriptors.FirPackageFragmentDescriptor +import org.jetbrains.kotlin.fir.expressions.FirVariable +import org.jetbrains.kotlin.fir.render +import org.jetbrains.kotlin.fir.resolve.FirSymbolProvider +import org.jetbrains.kotlin.fir.service +import org.jetbrains.kotlin.fir.symbols.LibraryTypeParameterSymbol +import org.jetbrains.kotlin.fir.symbols.impl.* +import org.jetbrains.kotlin.ir.declarations.* +import org.jetbrains.kotlin.ir.declarations.impl.* +import org.jetbrains.kotlin.ir.expressions.IrExpression +import org.jetbrains.kotlin.ir.symbols.* +import org.jetbrains.kotlin.ir.types.IrType +import org.jetbrains.kotlin.ir.types.impl.IrSimpleTypeImpl +import org.jetbrains.kotlin.ir.util.SymbolTable +import org.jetbrains.kotlin.name.FqName +import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.psi.KtFunctionLiteral +import org.jetbrains.kotlin.types.Variance + +class Fir2IrDeclarationStorage( + private val session: FirSession, + private val irSymbolTable: SymbolTable, + private val moduleDescriptor: FirModuleDescriptor +) { + private val firSymbolProvider = session.service() + + private val fragmentCache = mutableMapOf() + + private val classCache = mutableMapOf() + + private val typeParameterCache = mutableMapOf() + + private val libraryTypeParameterCache = mutableMapOf() + + private val functionCache = mutableMapOf() + + private val constructorCache = mutableMapOf() + + private val propertyCache = mutableMapOf() + + private val localStorage = Fir2IrLocalStorage() + + fun enterScope(descriptor: DeclarationDescriptor) { + irSymbolTable.enterScope(descriptor) + if (descriptor is WrappedSimpleFunctionDescriptor || + descriptor is WrappedClassConstructorDescriptor || + descriptor is WrappedPropertyDescriptor + ) { + localStorage.enterCallable() + } + } + + fun leaveScope(descriptor: DeclarationDescriptor) { + if (descriptor is WrappedSimpleFunctionDescriptor || + descriptor is WrappedClassConstructorDescriptor || + descriptor is WrappedPropertyDescriptor + ) { + localStorage.leaveCallable() + } + irSymbolTable.leaveScope(descriptor) + } + + private fun getIrExternalPackageFragment(fqName: FqName): IrExternalPackageFragment { + return fragmentCache.getOrPut(fqName) { + // TODO: module descriptor is wrong here + return irSymbolTable.declareExternalPackageFragment(FirPackageFragmentDescriptor(fqName, moduleDescriptor)) + } + } + + private fun IrClass.declareThisReceiver() { + enterScope(descriptor) + val thisOrigin = IrDeclarationOrigin.INSTANCE_RECEIVER + val thisType = IrSimpleTypeImpl(symbol, false, emptyList(), emptyList()) + val parent = this + thisReceiver = irSymbolTable.declareValueParameter( + startOffset, endOffset, thisOrigin, WrappedValueParameterDescriptor(), thisType + ) { symbol -> + IrValueParameterImpl( + startOffset, endOffset, thisOrigin, symbol, + Name.special(""), -1, thisType, + varargElementType = null, isCrossinline = false, isNoinline = false + ).apply { this.parent = parent } + } + leaveScope(descriptor) + } + + fun getIrClass(regularClass: FirRegularClass, setParent: Boolean = true): IrClass { + fun create(): IrClass { + val descriptor = WrappedClassDescriptor() + val origin = IrDeclarationOrigin.DEFINED + val modality = regularClass.modality!! + return regularClass.convertWithOffsets { startOffset, endOffset -> + irSymbolTable.declareClass(startOffset, endOffset, origin, descriptor, modality) { symbol -> + IrClassImpl( + startOffset, endOffset, origin, symbol, + regularClass.name, regularClass.classKind, + regularClass.visibility, modality, + regularClass.isCompanion, regularClass.isInner, + regularClass.isData, false, regularClass.isInline + ).apply { + descriptor.bind(this) + if (setParent) { + val classId = regularClass.classId + val parentId = classId.outerClassId + if (parentId != null) { + val parentFirSymbol = firSymbolProvider.getClassLikeSymbolByFqName(parentId) + if (parentFirSymbol is FirClassSymbol) { + val parentIrSymbol = getIrClassSymbol(parentFirSymbol) + parent = parentIrSymbol.owner + } + } else { + val packageFqName = classId.packageFqName + parent = getIrExternalPackageFragment(packageFqName) + } + } + declareThisReceiver() + } + } + } + } + + if (regularClass.visibility == Visibilities.LOCAL) { + val cached = localStorage.getLocalClass(regularClass) + if (cached != null) return cached + val created = create() + localStorage.putLocalClass(regularClass, created) + return created + } + return classCache.getOrPut(regularClass, ::create) + } + + fun getIrAnonymousObject(anonymousObject: FirAnonymousObject): IrClass { + val descriptor = WrappedClassDescriptor() + val origin = IrDeclarationOrigin.DEFINED + val modality = Modality.FINAL + return anonymousObject.convertWithOffsets { startOffset, endOffset -> + irSymbolTable.declareClass(startOffset, endOffset, origin, descriptor, modality) { symbol -> + IrClassImpl( + startOffset, endOffset, origin, symbol, + Name.special(""), anonymousObject.classKind, + Visibilities.LOCAL, modality, + isCompanion = false, isInner = false, isData = false, isExternal = false, isInline = false + ).apply { + descriptor.bind(this) + declareThisReceiver() + } + } + } + } + + fun getIrTypeParameter(typeParameter: FirTypeParameter, index: Int = 0): IrTypeParameter { + return typeParameterCache.getOrPut(typeParameter) { + val descriptor = WrappedTypeParameterDescriptor() + val origin = IrDeclarationOrigin.DEFINED + typeParameter.convertWithOffsets { startOffset, endOffset -> + irSymbolTable.declareGlobalTypeParameter(startOffset, endOffset, origin, descriptor) { symbol -> + IrTypeParameterImpl( + startOffset, endOffset, origin, symbol, + typeParameter.name, index, + typeParameter.isReified, + typeParameter.variance + ).apply { + descriptor.bind(this) + } + } + } + } + } + + private fun IrDeclaration.setParentByOwnFir(firMember: FirCallableMemberDeclaration) { + val firBasedSymbol = firMember.symbol + val callableId = firBasedSymbol.callableId + val parentClassId = callableId.classId + if (parentClassId != null) { + val parentFirSymbol = firSymbolProvider.getClassLikeSymbolByFqName(parentClassId) + if (parentFirSymbol is FirClassSymbol) { + val parentIrSymbol = getIrClassSymbol(parentFirSymbol) + val parentIrClass = parentIrSymbol.owner + parent = parentIrClass + // TODO: parentIrClass.declarations += this (probably needed for external stuff) + } + } else { + val packageFqName = callableId.packageName + val parentIrPackageFragment = getIrExternalPackageFragment(packageFqName) + parent = parentIrPackageFragment + parentIrPackageFragment.declarations += this + } + } + + fun T.declareParameters(function: FirFunction) { + val parent = this + for ((index, valueParameter) in function.valueParameters.withIndex()) { + valueParameters += createAndSaveIrParameter(valueParameter, index).apply { this.parent = parent } + } + } + + private fun T.bindAndDeclareParameters( + function: FirFunction, + descriptor: WrappedCallableDescriptor, + setParent: Boolean, + shouldLeaveScope: Boolean + ): T { + descriptor.bind(this) + if (setParent) { + setParentByOwnFir(function as FirCallableMemberDeclaration) + } + enterScope(descriptor) + declareParameters(function) + if (shouldLeaveScope) { + leaveScope(descriptor) + } + return this + } + + private fun T.enterLocalScope(function: FirFunction): T { + enterScope(descriptor) + for ((firParameter, irParameter) in function.valueParameters.zip(valueParameters)) { + irSymbolTable.introduceValueParameter(irParameter) + localStorage.putParameter(firParameter, irParameter) + } + return this + } + + fun getIrFunction( + function: FirNamedFunction, + setParent: Boolean = true, + shouldLeaveScope: Boolean = false, + origin: IrDeclarationOrigin = IrDeclarationOrigin.DEFINED + ): IrSimpleFunction { + fun create(): IrSimpleFunction { + val descriptor = WrappedSimpleFunctionDescriptor() + return function.convertWithOffsets { startOffset, endOffset -> + irSymbolTable.declareSimpleFunction(startOffset, endOffset, origin, descriptor) { symbol -> + IrFunctionImpl( + startOffset, endOffset, origin, symbol, + function.name, function.visibility, function.modality!!, + function.returnTypeRef.toIrType(session, this), + function.isInline, function.isExternal, + function.isTailRec, function.isSuspend + ) + } + }.bindAndDeclareParameters(function, descriptor, setParent, shouldLeaveScope) + } + + if (function.visibility == Visibilities.LOCAL) { + val cached = localStorage.getLocalFunction(function) + if (cached != null) { + return if (shouldLeaveScope) cached else cached.enterLocalScope(function) + } + val created = create() + localStorage.putLocalFunction(function, created) + return created + } + val cached = functionCache[function] + if (cached != null) { + return if (shouldLeaveScope) cached else cached.enterLocalScope(function) + } + val created = create() + functionCache[function] = created + return created + } + + fun getIrLocalFunction(function: FirAnonymousFunction): IrSimpleFunction { + val descriptor = WrappedSimpleFunctionDescriptor() + val isLambda = function.psi is KtFunctionLiteral + val origin = if (isLambda) IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA else IrDeclarationOrigin.DEFINED + return function.convertWithOffsets { startOffset, endOffset -> + irSymbolTable.declareSimpleFunction(startOffset, endOffset, origin, descriptor) { symbol -> + IrFunctionImpl( + startOffset, endOffset, origin, symbol, + if (isLambda) Name.special("") else Name.special(""), + Visibilities.LOCAL, Modality.FINAL, + function.returnTypeRef.toIrType(session, this), + isInline = false, isExternal = false, isTailrec = false, + // TODO: suspend lambda + isSuspend = false + ) + }.bindAndDeclareParameters(function, descriptor, setParent = false, shouldLeaveScope = false) + } + } + + fun getIrConstructor(constructor: FirConstructor, setParent: Boolean = true, shouldLeaveScope: Boolean = false): IrConstructor { + return constructorCache.getOrPut(constructor) { + val descriptor = WrappedClassConstructorDescriptor() + val origin = IrDeclarationOrigin.DEFINED + val isPrimary = constructor.isPrimary + return constructor.convertWithOffsets { startOffset, endOffset -> + irSymbolTable.declareConstructor(startOffset, endOffset, origin, descriptor) { symbol -> + IrConstructorImpl( + startOffset, endOffset, origin, symbol, + constructor.name, constructor.visibility, + constructor.returnTypeRef.toIrType(session, this), + false, false, isPrimary + ).bindAndDeclareParameters(constructor, descriptor, setParent, shouldLeaveScope) + } + } + + } + } + + fun getIrProperty(property: FirProperty, setParent: Boolean = true): IrProperty { + return propertyCache.getOrPut(property) { + val descriptor = WrappedPropertyDescriptor() + val origin = IrDeclarationOrigin.DEFINED + property.convertWithOffsets { startOffset, endOffset -> + irSymbolTable.declareProperty( + startOffset, endOffset, + origin, descriptor, property.delegate != null + ) { symbol -> + IrPropertyImpl( + startOffset, endOffset, origin, symbol, + property.name, property.visibility, property.modality!!, + property.isVar, property.isConst, property.isLateInit, + property.delegate != null, + // TODO + isExternal = false + ).apply { + descriptor.bind(this) + if (setParent) { + setParentByOwnFir(property) + } + } + } + } + } + } + + private fun createAndSaveIrParameter(valueParameter: FirValueParameter, index: Int = -1): IrValueParameter { + val descriptor = WrappedValueParameterDescriptor() + val origin = IrDeclarationOrigin.DEFINED + val type = valueParameter.returnTypeRef.toIrType(session, this) + val irParameter = valueParameter.convertWithOffsets { startOffset, endOffset -> + irSymbolTable.declareValueParameter( + startOffset, endOffset, origin, descriptor, type + ) { symbol -> + IrValueParameterImpl( + startOffset, endOffset, origin, symbol, + valueParameter.name, index, type, + null, valueParameter.isCrossinline, valueParameter.isNoinline + ).apply { + descriptor.bind(this) + } + } + } + localStorage.putParameter(valueParameter, irParameter) + return irParameter + } + + private var lastTemporaryIndex: Int = 0 + private fun nextTemporaryIndex(): Int = lastTemporaryIndex++ + + private fun getNameForTemporary(nameHint: String?): String { + val index = nextTemporaryIndex() + return if (nameHint != null) "tmp${index}_$nameHint" else "tmp$index" + } + + private fun declareIrVariable( + startOffset: Int, endOffset: Int, + origin: IrDeclarationOrigin, name: Name, type: IrType, + isVar: Boolean, isConst: Boolean, isLateinit: Boolean + ): IrVariable { + val descriptor = WrappedVariableDescriptor() + return irSymbolTable.declareVariable(startOffset, endOffset, origin, descriptor, type) { symbol -> + IrVariableImpl( + startOffset, endOffset, origin, symbol, name, type, + isVar, isConst, isLateinit + ).apply { + descriptor.bind(this) + } + } + } + + fun createAndSaveIrVariable(variable: FirVariable): IrVariable { + val type = variable.returnTypeRef.toIrType(session, this) + val irVariable = variable.convertWithOffsets { startOffset, endOffset -> + declareIrVariable( + startOffset, endOffset, IrDeclarationOrigin.DEFINED, + variable.name, type, variable.isVar, isConst = false, isLateinit = false + ) + } + localStorage.putVariable(variable, irVariable) + return irVariable + } + + fun declareTemporaryVariable(base: IrExpression, nameHint: String? = null): IrVariable { + return declareIrVariable( + base.startOffset, base.endOffset, IrDeclarationOrigin.IR_TEMPORARY_VARIABLE, + Name.identifier(getNameForTemporary(nameHint)), base.type, + isVar = false, isConst = false, isLateinit = false + ) + } + + fun getIrClassSymbol(firClassSymbol: FirClassSymbol): IrClassSymbol { + val irClass = getIrClass(firClassSymbol.fir) + return irSymbolTable.referenceClass(irClass.descriptor) + } + + fun getIrTypeParameterSymbol(firTypeParameterSymbol: FirTypeParameterSymbol): IrTypeParameterSymbol { + val irTypeParameter = getIrTypeParameter(firTypeParameterSymbol.fir) + return irSymbolTable.referenceTypeParameter(irTypeParameter.descriptor) + } + + fun getIrTypeParameterSymbol(typeParameterSymbol: LibraryTypeParameterSymbol): IrTypeParameterSymbol { + val irTypeParameter = libraryTypeParameterCache.getOrPut(typeParameterSymbol) { + val descriptor = WrappedTypeParameterDescriptor() + val origin = IrDeclarationOrigin.DEFINED + irSymbolTable.declareGlobalTypeParameter(-1, -1, origin, descriptor) { symbol -> + IrTypeParameterImpl( + -1, -1, origin, symbol, + typeParameterSymbol.name, -1, + false, + Variance.INVARIANT + ).apply { + descriptor.bind(this) + } + } + } + return irSymbolTable.referenceTypeParameter(irTypeParameter.descriptor) + } + + fun getIrFunctionSymbol(firFunctionSymbol: FirFunctionSymbol): IrFunctionSymbol { + return when (val firDeclaration = firFunctionSymbol.fir) { + is FirNamedFunction -> { + val irDeclaration = getIrFunction(firDeclaration, shouldLeaveScope = true) + irSymbolTable.referenceSimpleFunction(irDeclaration.descriptor) + } + is FirConstructor -> { + val irDeclaration = getIrConstructor(firDeclaration, shouldLeaveScope = true) + irSymbolTable.referenceConstructor(irDeclaration.descriptor) + } + else -> throw AssertionError("Should not be here") + } + } + + fun getIrPropertySymbol(firPropertySymbol: FirPropertySymbol): IrPropertySymbol { + val irProperty = getIrProperty(firPropertySymbol.fir as FirProperty) + return irSymbolTable.referenceProperty(irProperty.descriptor) + } + + private fun getIrVariableSymbol(firVariable: FirVariable): IrVariableSymbol { + val irDeclaration = localStorage.getVariable(firVariable) + ?: throw IllegalArgumentException("Cannot find variable ${firVariable.render()} in local storage") + return irSymbolTable.referenceVariable(irDeclaration.descriptor) + } + + fun getIrValueSymbol(firVariableSymbol: FirVariableSymbol): IrValueSymbol { + return when (val firDeclaration = firVariableSymbol.fir) { + is FirValueParameter -> { + val irDeclaration = localStorage.getParameter(firDeclaration) + // catch parameter is FirValueParameter in FIR but IrVariable in IR + ?: return getIrVariableSymbol(firDeclaration) + irSymbolTable.referenceValueParameter(irDeclaration.descriptor) + } + is FirVariable -> { + getIrVariableSymbol(firDeclaration) + } + else -> throw AssertionError("Should not be here") + } + } +} \ No newline at end of file diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrLocalStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrLocalStorage.kt new file mode 100644 index 00000000000..6bf3d2695cf --- /dev/null +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrLocalStorage.kt @@ -0,0 +1,74 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.backend + +import org.jetbrains.kotlin.fir.declarations.FirClass +import org.jetbrains.kotlin.fir.declarations.FirFunction +import org.jetbrains.kotlin.fir.declarations.FirValueParameter +import org.jetbrains.kotlin.fir.expressions.FirVariable +import org.jetbrains.kotlin.ir.declarations.* + +class Fir2IrLocalStorage { + + private val cacheStack = mutableListOf() + + fun enterCallable() { + cacheStack += Fir2IrCallableCache() + } + + fun leaveCallable() { + cacheStack.last().clear() + cacheStack.removeAt(cacheStack.size - 1) + } + + fun getParameter(parameter: FirValueParameter): IrValueParameter? { + for (cache in cacheStack.asReversed()) { + val local = cache.getParameter(parameter) + if (local != null) return local + } + return null + } + + fun getVariable(variable: FirVariable): IrVariable? { + for (cache in cacheStack.asReversed()) { + val local = cache.getVariable(variable) + if (local != null) return local + } + return null + } + + fun getLocalClass(localClass: FirClass): IrClass? { + for (cache in cacheStack.asReversed()) { + val local = cache.getLocalClass(localClass) + if (local != null) return local + } + return null + } + + fun getLocalFunction(localFunction: FirFunction): IrSimpleFunction? { + for (cache in cacheStack.asReversed()) { + val local = cache.getLocalFunction(localFunction) + if (local != null) return local + } + return null + } + + fun putParameter(firParameter: FirValueParameter, irParameter: IrValueParameter) { + cacheStack.last().putParameter(firParameter, irParameter) + } + + fun putVariable(firVariable: FirVariable, irVariable: IrVariable) { + cacheStack.last().putVariable(firVariable, irVariable) + } + + fun putLocalClass(firClass: FirClass, irClass: IrClass) { + cacheStack.last().putLocalClass(firClass, irClass) + } + + fun putLocalFunction(firFunction: FirFunction, irFunction: IrSimpleFunction) { + cacheStack.last().putLocalFunction(firFunction, irFunction) + } +} \ No newline at end of file diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt new file mode 100644 index 00000000000..b306a3cc033 --- /dev/null +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt @@ -0,0 +1,1108 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.backend + +import com.intellij.psi.PsiFile +import org.jetbrains.kotlin.backend.common.descriptors.* +import org.jetbrains.kotlin.descriptors.* +import org.jetbrains.kotlin.fir.* +import org.jetbrains.kotlin.fir.declarations.* +import org.jetbrains.kotlin.fir.declarations.impl.* +import org.jetbrains.kotlin.fir.descriptors.FirModuleDescriptor +import org.jetbrains.kotlin.fir.expressions.* +import org.jetbrains.kotlin.fir.expressions.impl.FirElseIfTrueCondition +import org.jetbrains.kotlin.fir.expressions.impl.FirUnitExpression +import org.jetbrains.kotlin.fir.expressions.impl.FirWhenSubjectExpression +import org.jetbrains.kotlin.fir.references.FirPropertyFromParameterCallableReference +import org.jetbrains.kotlin.fir.resolve.FirSymbolProvider +import org.jetbrains.kotlin.fir.resolve.buildUseSiteScope +import org.jetbrains.kotlin.fir.resolve.getCallableSymbols +import org.jetbrains.kotlin.fir.resolve.toSymbol +import org.jetbrains.kotlin.fir.scopes.ProcessorAction +import org.jetbrains.kotlin.fir.scopes.impl.FirClassSubstitutionScope +import org.jetbrains.kotlin.fir.symbols.CallableId +import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol +import org.jetbrains.kotlin.fir.symbols.impl.FirFunctionSymbol +import org.jetbrains.kotlin.fir.symbols.impl.FirTypeAliasSymbol +import org.jetbrains.kotlin.fir.types.ConeClassLikeType +import org.jetbrains.kotlin.fir.types.FirResolvedTypeRef +import org.jetbrains.kotlin.fir.types.FirTypeRef +import org.jetbrains.kotlin.fir.types.impl.* +import org.jetbrains.kotlin.fir.visitors.FirVisitor +import org.jetbrains.kotlin.ir.IrElement +import org.jetbrains.kotlin.ir.IrStatement +import org.jetbrains.kotlin.ir.builders.primitiveOp1 +import org.jetbrains.kotlin.ir.declarations.* +import org.jetbrains.kotlin.ir.declarations.impl.* +import org.jetbrains.kotlin.ir.descriptors.IrBuiltIns +import org.jetbrains.kotlin.ir.expressions.* +import org.jetbrains.kotlin.ir.expressions.impl.* +import org.jetbrains.kotlin.ir.symbols.* +import org.jetbrains.kotlin.ir.types.IrType +import org.jetbrains.kotlin.ir.types.classifierOrFail +import org.jetbrains.kotlin.ir.types.classifierOrNull +import org.jetbrains.kotlin.ir.types.impl.IrErrorTypeImpl +import org.jetbrains.kotlin.ir.types.makeNullable +import org.jetbrains.kotlin.ir.util.* +import org.jetbrains.kotlin.lexer.KtTokens +import org.jetbrains.kotlin.name.ClassId +import org.jetbrains.kotlin.name.FqName +import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.psi.* +import org.jetbrains.kotlin.psi2ir.PsiSourceManager +import org.jetbrains.kotlin.types.AbstractStrictEqualityTypeChecker +import org.jetbrains.kotlin.types.Variance +import java.util.* + +internal class Fir2IrVisitor( + private val session: FirSession, + private val moduleDescriptor: FirModuleDescriptor, + private val symbolTable: SymbolTable, + private val irBuiltIns: IrBuiltIns, + private val fakeOverrideMode: FakeOverrideMode +) : FirVisitor() { + companion object { + private val NEGATED_OPERATIONS: Set = EnumSet.of(FirOperation.NOT_EQ, FirOperation.NOT_IDENTITY) + + private val UNARY_OPERATIONS: Set = EnumSet.of(FirOperation.EXCL) + } + + private val typeContext = session.typeContext + + private val declarationStorage = Fir2IrDeclarationStorage(session, symbolTable, moduleDescriptor) + + private val nothingType = FirImplicitNothingTypeRef(session, null).toIrType(session, declarationStorage) + + private val unitType = FirImplicitUnitTypeRef(session, null).toIrType(session, declarationStorage) + + private val booleanType = FirImplicitBooleanTypeRef(session, null).toIrType(session, declarationStorage) + + private fun ModuleDescriptor.findPackageFragmentForFile(file: FirFile): PackageFragmentDescriptor = + getPackage(file.packageFqName).fragments.first() + + private val parentStack = mutableListOf() + + private fun T.withParent(f: T.() -> Unit): T { + parentStack += this + f() + parentStack.removeAt(parentStack.size - 1) + return this + } + + private fun T.setParentByParentStack(): T { + this.parent = parentStack.last() + return this + } + + private val functionStack = mutableListOf() + + private fun T.withFunction(f: T.() -> Unit): T { + functionStack += this + f() + functionStack.removeAt(functionStack.size - 1) + return this + } + + private val propertyStack = mutableListOf() + + private fun IrProperty.withProperty(f: IrProperty.() -> Unit): IrProperty { + propertyStack += this + f() + propertyStack.removeAt(propertyStack.size - 1) + return this + } + + private val classStack = mutableListOf() + + private fun IrClass.withClass(f: IrClass.() -> Unit): IrClass { + classStack += this + f() + classStack.removeAt(classStack.size - 1) + return this + } + + private val subjectVariableStack = mutableListOf() + + private fun IrVariable?.withSubject(f: () -> T): T { + if (this != null) subjectVariableStack += this + val result = f() + if (this != null) subjectVariableStack.removeAt(subjectVariableStack.size - 1) + return result + } + + override fun visitElement(element: FirElement, data: Any?): IrElement { + TODO("Should not be here: ${element.render()}") + } + + override fun visitFile(file: FirFile, data: Any?): IrFile { + return IrFileImpl( + PsiSourceManager.PsiFileEntry(file.psi as PsiFile), + moduleDescriptor.findPackageFragmentForFile(file) + ).withParent { + file.declarations.forEach { + val irDeclaration = it.toIrDeclaration() ?: return@forEach + declarations += irDeclaration + } + + file.annotations.forEach { + val irCall = it.accept(this@Fir2IrVisitor, data) as? IrCall ?: return@forEach + annotations += irCall + } + } + } + + private fun FirDeclaration.toIrDeclaration(): IrDeclaration? { + if (this is FirTypeAlias) return null + return accept(this@Fir2IrVisitor, null) as IrDeclaration + } + + private fun FirTypeRef.collectFunctionNamesFromThisAndSupertypes(result: MutableList = mutableListOf()): List { + if (this is FirResolvedTypeRef) { + val superType = type + if (superType is ConeClassLikeType) { + when (val superSymbol = superType.lookupTag.toSymbol(this@Fir2IrVisitor.session)) { + is FirClassSymbol -> { + val superClass = superSymbol.fir + for (declaration in superClass.declarations) { + if (declaration is FirNamedFunction) { + result += declaration.name + } + } + superClass.collectFunctionNamesFromSupertypes(result) + } + is FirTypeAliasSymbol -> { + val superAlias = superSymbol.fir + superAlias.expandedTypeRef.collectFunctionNamesFromThisAndSupertypes(result) + } + } + } + } + return result + } + + private fun FirClass.collectFunctionNamesFromSupertypes(result: MutableList = mutableListOf()): List { + for (superTypeRef in superTypeRefs) { + superTypeRef.collectFunctionNamesFromThisAndSupertypes(result) + } + return result + } + + private fun FirClass.getPrimaryConstructorIfAny(): FirConstructor? = + (declarations.firstOrNull() as? FirConstructor)?.takeIf { it.isPrimary } + + private fun IrClass.addFakeOverrides(klass: FirClass, processedFunctionNames: MutableList) { + if (fakeOverrideMode == FakeOverrideMode.NONE) return + val superTypesFunctionNames = klass.collectFunctionNamesFromSupertypes() + val useSiteScope = (klass as? FirRegularClass)?.buildUseSiteScope(session) ?: return + for (name in superTypesFunctionNames) { + if (name in processedFunctionNames) continue + processedFunctionNames += name + useSiteScope.processFunctionsByName(name) { functionSymbol -> + // TODO: think about overloaded functions. May be we should process all names. + if (functionSymbol is FirFunctionSymbol) { + val originalFunction = functionSymbol.fir as FirNamedFunction + val origin = IrDeclarationOrigin.FAKE_OVERRIDE + if (functionSymbol.isFakeOverride) { + // Substitution case + val irFunction = declarationStorage.getIrFunction(originalFunction, setParent = false, origin = origin) + val baseSymbol = functionSymbol.overriddenSymbol + declarations += irFunction.setParentByParentStack().withFunction { + setFunctionContent(irFunction.descriptor, originalFunction, firOverriddenSymbol = baseSymbol) + } + } else if (fakeOverrideMode != FakeOverrideMode.SUBSTITUTION) { + // Trivial fake override case + val fakeOverrideSymbol = FirClassSubstitutionScope.createFakeOverride(session, originalFunction, functionSymbol) + val fakeOverrideFunction = fakeOverrideSymbol.fir as FirNamedFunction + + val irFunction = declarationStorage.getIrFunction(fakeOverrideFunction, setParent = false, origin = origin) + declarations += irFunction.setParentByParentStack().withFunction { + setFunctionContent(irFunction.descriptor, fakeOverrideFunction, firOverriddenSymbol = functionSymbol) + } + } + } + ProcessorAction.STOP + } + } + } + + private fun IrClass.setClassContent(klass: FirClass) { + for (superTypeRef in klass.superTypeRefs) { + superTypes += superTypeRef.toIrType(session, declarationStorage) + } + if (klass is FirRegularClass) { + for ((index, typeParameter) in klass.typeParameters.withIndex()) { + typeParameters += declarationStorage.getIrTypeParameter(typeParameter, index).setParentByParentStack() + } + } + declarationStorage.enterScope(descriptor) + val primaryConstructor = klass.getPrimaryConstructorIfAny() + val irPrimaryConstructor = primaryConstructor?.accept(this@Fir2IrVisitor, null) as IrConstructor? + withClass { + if (irPrimaryConstructor != null) { + declarations += irPrimaryConstructor + } + val processedFunctionNames = mutableListOf() + klass.declarations.forEach { + if (it !is FirConstructor || !it.isPrimary) { + val irDeclaration = it.toIrDeclaration() ?: return@forEach + declarations += irDeclaration + if (it is FirNamedFunction) { + processedFunctionNames += it.name + } + } + } + addFakeOverrides(klass, processedFunctionNames) + klass.annotations.forEach { + val irCall = it.accept(this@Fir2IrVisitor, null) as? IrCall ?: return@forEach + annotations += irCall + } + } + if (irPrimaryConstructor != null) { + declarationStorage.leaveScope(irPrimaryConstructor.descriptor) + } + declarationStorage.leaveScope(descriptor) + } + + override fun visitRegularClass(regularClass: FirRegularClass, data: Any?): IrElement { + return declarationStorage.getIrClass(regularClass, setParent = false) + .setParentByParentStack() + .withParent { + setClassContent(regularClass) + } + } + + private fun T.setFunctionContent( + descriptor: FunctionDescriptor, + firFunction: FirFunction, + firOverriddenSymbol: FirFunctionSymbol? = null + ): T { + setParentByParentStack() + withParent { + if (firFunction is FirNamedFunction) { + for ((index, typeParameter) in firFunction.typeParameters.withIndex()) { + typeParameters += declarationStorage.getIrTypeParameter(typeParameter, index).setParentByParentStack() + } + } + val firFunctionSymbol = (firFunction as? FirNamedFunction)?.symbol + val lastClass = classStack.lastOrNull() + val containingClass = if (firOverriddenSymbol == null || firFunctionSymbol == null) { + lastClass + } else { + val callableId = firFunctionSymbol.callableId + val ownerClassId = callableId.classId + if (ownerClassId == null) { + lastClass + } else { + val classLikeSymbol = session.service().getClassLikeSymbolByFqName(ownerClassId) + if (classLikeSymbol !is FirClassSymbol) { + lastClass + } else { + val firClass = classLikeSymbol.fir + declarationStorage.getIrClass(firClass, setParent = false) + } + } + } + if (firFunction !is FirConstructor && containingClass != null) { + val thisOrigin = IrDeclarationOrigin.DEFINED + val thisType = containingClass.thisReceiver!!.type + dispatchReceiverParameter = symbolTable.declareValueParameter( + startOffset, endOffset, thisOrigin, WrappedValueParameterDescriptor(), + thisType + ) { symbol -> + IrValueParameterImpl( + startOffset, endOffset, thisOrigin, symbol, + Name.special(""), -1, thisType, + varargElementType = null, isCrossinline = false, isNoinline = false + ).setParentByParentStack() + } + } + for ((valueParameter, firValueParameter) in valueParameters.zip(firFunction.valueParameters)) { + valueParameter.setDefaultValue(firValueParameter) + } + if (firOverriddenSymbol != null && this is IrSimpleFunction && firFunctionSymbol != null) { + val overriddenSymbol = declarationStorage.getIrFunctionSymbol(firOverriddenSymbol) + if (overriddenSymbol is IrSimpleFunctionSymbol) { + overriddenSymbols += overriddenSymbol + } + } + body = firFunction.body?.convertToIrBlockBody() + if (this !is IrConstructor) { + // Scope for primary constructor should be left after class declaration + // Scope for secondary constructor should be left after delegating call + declarationStorage.leaveScope(descriptor) + } + } + return this + } + + override fun visitConstructor(constructor: FirConstructor, data: Any?): IrElement { + val irConstructor = declarationStorage.getIrConstructor(constructor, setParent = false) + return irConstructor.setParentByParentStack().withFunction { + setFunctionContent(irConstructor.descriptor, constructor) + }.withParent { + if (!parentAsClass.isAnnotationClass) { + val body = this.body as IrBlockBody? ?: IrBlockBodyImpl(startOffset, endOffset) + val delegatedConstructor = constructor.delegatedConstructor + if (delegatedConstructor != null) { + val irDelegatingConstructorCall = delegatedConstructor.toIrDelegatingConstructorCall() + body.statements += irDelegatingConstructorCall ?: delegatedConstructor.convertWithOffsets { startOffset, endOffset -> + IrErrorCallExpressionImpl( + startOffset, endOffset, irConstructor.returnType, "Cannot find delegated constructor call" + ) + } + } + if (delegatedConstructor?.isThis == false) { + val irClass = parent as IrClass + body.statements += IrInstanceInitializerCallImpl( + startOffset, endOffset, irClass.symbol, constructedClassType + ) + } + if (body.statements.isNotEmpty()) { + this.body = body + } + } + if (!constructor.isPrimary) { + declarationStorage.leaveScope(irConstructor.descriptor) + } + } + } + + override fun visitAnonymousInitializer(anonymousInitializer: FirAnonymousInitializer, data: Any?): IrElement { + val origin = IrDeclarationOrigin.DEFINED + val parent = parentStack.last() as IrClass + return anonymousInitializer.convertWithOffsets { startOffset, endOffset -> + symbolTable.declareAnonymousInitializer( + startOffset, endOffset, origin, parent.descriptor + ).apply { + declarationStorage.enterScope(descriptor) + body = anonymousInitializer.body!!.convertToIrBlockBody() + declarationStorage.leaveScope(descriptor) + } + } + } + + private fun FirDelegatedConstructorCall.toIrDelegatingConstructorCall(): IrDelegatingConstructorCall? { + val constructedClassSymbol = with(typeContext) { + (constructedTypeRef as FirResolvedTypeRef).type.typeConstructor() + } as? FirClassSymbol ?: return null + val constructedIrType = constructedTypeRef.toIrType(this@Fir2IrVisitor.session, declarationStorage) + // TODO: find delegated constructor correctly + val classId = constructedClassSymbol.classId + val constructorId = CallableId(classId.packageFqName, classId.relativeClassName, classId.shortClassName) + val constructorSymbol = this@Fir2IrVisitor.session.service().getCallableSymbols(constructorId).firstOrNull { + arguments.size <= ((it as FirFunctionSymbol).fir as FirFunction).valueParameters.size + } ?: return null + return convertWithOffsets { startOffset, endOffset -> + IrDelegatingConstructorCallImpl( + startOffset, endOffset, + constructedIrType, + declarationStorage.getIrFunctionSymbol(constructorSymbol as FirFunctionSymbol) as IrConstructorSymbol + ).apply { + for ((index, argument) in arguments.withIndex()) { + val argumentExpression = argument.toIrExpression() + putValueArgument(index, argumentExpression) + } + } + } + } + + override fun visitNamedFunction(namedFunction: FirNamedFunction, data: Any?): IrElement { + val irFunction = declarationStorage.getIrFunction(namedFunction, setParent = false) + return irFunction.setParentByParentStack().withFunction { + setFunctionContent(irFunction.descriptor, namedFunction) + } + } + + override fun visitAnonymousFunction(anonymousFunction: FirAnonymousFunction, data: Any?): IrElement { + val irFunction = declarationStorage.getIrLocalFunction(anonymousFunction) + irFunction.setParentByParentStack().withFunction { + setFunctionContent(irFunction.descriptor, anonymousFunction) + } + return anonymousFunction.convertWithOffsets { startOffset, endOffset -> + val type = anonymousFunction.typeRef.toIrType(session, declarationStorage) + val origin = when (anonymousFunction.psi) { + is KtFunctionLiteral -> IrStatementOrigin.LAMBDA + else -> IrStatementOrigin.ANONYMOUS_FUNCTION + } + IrBlockImpl( + startOffset, endOffset, type, origin, + listOf( + irFunction, IrFunctionReferenceImpl( + startOffset, endOffset, type, irFunction.symbol, irFunction.descriptor, 0, origin + ) + ) + ) + } + } + + private fun IrValueParameter.setDefaultValue(firValueParameter: FirValueParameter) { + val firDefaultValue = firValueParameter.defaultValue + if (firDefaultValue != null) { + this.defaultValue = IrExpressionBodyImpl(firDefaultValue.toIrExpression()) + } + } + + override fun visitVariable(variable: FirVariable, data: Any?): IrElement { + val irVariable = declarationStorage.createAndSaveIrVariable(variable) + return irVariable.setParentByParentStack().apply { + val initializer = variable.initializer + if (initializer != null) { + this.initializer = initializer.toIrExpression() + } + } + } + + private fun IrProperty.setPropertyContent(descriptor: PropertyDescriptor, property: FirProperty): IrProperty { + val initializer = property.initializer + val irParent = this.parent + val type = property.returnTypeRef.toIrType(session, declarationStorage) + // TODO: this checks are very preliminary, FIR resolve should determine backing field presence itself + if (property.modality != Modality.ABSTRACT && (irParent !is IrClass || !irParent.isInterface)) { + if (initializer != null || property.getter is FirDefaultPropertyGetter || + property.isVar && property.setter is FirDefaultPropertySetter + ) { + val backingOrigin = IrDeclarationOrigin.PROPERTY_BACKING_FIELD + backingField = symbolTable.declareField( + startOffset, endOffset, backingOrigin, descriptor, type + ) { symbol -> + IrFieldImpl( + startOffset, endOffset, backingOrigin, symbol, + property.name, type, property.visibility, + isFinal = property.isVal, isExternal = false, + isStatic = property.isStatic || irParent !is IrClass + ) + }.setParentByParentStack().withParent { + declarationStorage.enterScope(descriptor) + val initializerExpression = initializer?.toIrExpression() + this.initializer = initializerExpression?.let { IrExpressionBodyImpl(it) } + declarationStorage.leaveScope(descriptor) + } + } + } + getter = property.getter.accept(this@Fir2IrVisitor, type) as IrSimpleFunction + if (property.isVar) { + setter = property.setter.accept(this@Fir2IrVisitor, type) as IrSimpleFunction + } + property.annotations.forEach { + annotations += it.accept(this@Fir2IrVisitor, null) as IrCall + } + return this + } + + override fun visitProperty(property: FirProperty, data: Any?): IrProperty { + val irProperty = declarationStorage.getIrProperty(property, setParent = false) + return irProperty.setParentByParentStack().withProperty { setPropertyContent(irProperty.descriptor, property) } + } + + private fun IrFieldAccessExpression.setReceiver(declaration: IrDeclaration): IrFieldAccessExpression { + if (declaration is IrFunction) { + val dispatchReceiver = declaration.dispatchReceiverParameter + if (dispatchReceiver != null) { + receiver = IrGetValueImpl(startOffset, endOffset, dispatchReceiver.symbol) + } + } + return this + } + + private fun T.declareParameters(function: FirFunction) { + return with(declarationStorage) { + declareParameters(function) + } + } + + + private fun createPropertyAccessor( + propertyAccessor: FirPropertyAccessor, startOffset: Int, endOffset: Int, + correspondingProperty: IrProperty, isDefault: Boolean, propertyType: IrType + ): IrSimpleFunction { + val origin = when { + isDefault -> IrDeclarationOrigin.DEFAULT_PROPERTY_ACCESSOR + else -> IrDeclarationOrigin.DEFINED + } + val isSetter = propertyAccessor.isSetter + val prefix = if (isSetter) "set" else "get" + val descriptor = WrappedSimpleFunctionDescriptor() + return symbolTable.declareSimpleFunction( + startOffset, endOffset, origin, descriptor + ) { symbol -> + val accessorReturnType = propertyAccessor.returnTypeRef.toIrType(session, declarationStorage) + IrFunctionImpl( + startOffset, endOffset, origin, symbol, + Name.special("<$prefix-${correspondingProperty.name}>"), + propertyAccessor.visibility, correspondingProperty.modality, accessorReturnType, + isInline = false, isExternal = false, isTailrec = false, isSuspend = false + ).withFunction { + descriptor.bind(this) + declarationStorage.enterScope(descriptor) + if (!isDefault) { + declareParameters(propertyAccessor) + } + setFunctionContent(descriptor, propertyAccessor).apply { + correspondingPropertySymbol = symbolTable.referenceProperty(correspondingProperty.descriptor) + if (isDefault) { + withParent { + declarationStorage.enterScope(descriptor) + val backingField = correspondingProperty.backingField + if (isSetter) { + valueParameters += symbolTable.declareValueParameter( + startOffset, endOffset, origin, WrappedValueParameterDescriptor(), propertyType + ) { symbol -> + IrValueParameterImpl( + startOffset, endOffset, IrDeclarationOrigin.DEFINED, symbol, + Name.special(""), 0, propertyType, + varargElementType = null, + isCrossinline = false, isNoinline = false + ).setParentByParentStack() + } + } + val fieldSymbol = symbolTable.referenceField(correspondingProperty.descriptor) + val declaration = this + if (backingField != null) { + body = IrBlockBodyImpl( + startOffset, endOffset, + listOf( + if (isSetter) { + IrSetFieldImpl(startOffset, endOffset, fieldSymbol, accessorReturnType).apply { + setReceiver(declaration) + value = IrGetValueImpl(startOffset, endOffset, propertyType, valueParameters.first().symbol) + } + } else { + IrReturnImpl( + startOffset, endOffset, nothingType, symbol, + IrGetFieldImpl(startOffset, endOffset, fieldSymbol, propertyType).setReceiver(declaration) + ) + } + ) + ) + } + declarationStorage.leaveScope(descriptor) + } + } + } + } + } + } + + override fun visitPropertyAccessor(propertyAccessor: FirPropertyAccessor, data: Any?): IrElement { + val correspondingProperty = propertyStack.last() + return propertyAccessor.convertWithOffsets { startOffset, endOffset -> + createPropertyAccessor( + propertyAccessor, startOffset, endOffset, correspondingProperty, + isDefault = propertyAccessor is FirDefaultPropertyGetter || propertyAccessor is FirDefaultPropertySetter, + propertyType = data as IrType + ) + } + } + + override fun visitReturnExpression(returnExpression: FirReturnExpression, data: Any?): IrElement { + val firTarget = returnExpression.target.labeledElement + var irTarget = functionStack.last() + for (potentialTarget in functionStack.asReversed()) { + // TODO: remove comparison by name + if (potentialTarget.name == (firTarget as? FirNamedFunction)?.name) { + irTarget = potentialTarget + break + } + } + return returnExpression.convertWithOffsets { startOffset, endOffset -> + val result = returnExpression.result + IrReturnImpl( + startOffset, endOffset, nothingType, + symbolTable.referenceSimpleFunction(irTarget.descriptor), + result.toIrExpression() + ) + } + } + + override fun visitNamedArgumentExpression(namedArgumentExpression: FirNamedArgumentExpression, data: Any?): IrElement { + // TODO: change this temporary hack to something correct + return namedArgumentExpression.expression.toIrExpression() + } + + private fun FirQualifiedAccess.toIrExpression(typeRef: FirTypeRef): IrExpression { + val type = typeRef.toIrType(this@Fir2IrVisitor.session, declarationStorage) + val symbol = calleeReference.toSymbol(declarationStorage) + return typeRef.convertWithOffsets { startOffset, endOffset -> + when { + symbol is IrFunctionSymbol -> IrCallImpl(startOffset, endOffset, type, symbol) + symbol is IrPropertySymbol && symbol.isBound -> { + val getter = symbol.owner.getter + if (getter != null) { + IrCallImpl(startOffset, endOffset, type, getter.symbol) + } else { + IrErrorCallExpressionImpl(startOffset, endOffset, type, "No getter found for ${calleeReference.render()}") + } + } + symbol is IrValueSymbol -> IrGetValueImpl( + startOffset, endOffset, type, symbol, + if (calleeReference is FirPropertyFromParameterCallableReference) { + IrStatementOrigin.INITIALIZE_PROPERTY_FROM_PARAMETER + } else null + ) + else -> IrErrorCallExpressionImpl(startOffset, endOffset, type, "Unresolved reference: ${calleeReference.render()}") + } + } + } + + private fun FirAnnotationCall.toIrExpression(): IrExpression { + val type = (annotationTypeRef as? FirResolvedTypeRef)?.type?.toIrType(this@Fir2IrVisitor.session, declarationStorage) + val symbol = type?.classifierOrNull + return convertWithOffsets { startOffset, endOffset -> + when (symbol) { + is IrClassSymbol -> { + val irClass = symbol.owner + val irConstructor = irClass.constructors.firstOrNull() + if (irConstructor == null) { + IrErrorCallExpressionImpl(startOffset, endOffset, type, "No annotation constructor found: ${irClass.name}") + } else { + IrCallImpl(startOffset, endOffset, type, irConstructor.symbol) + } + + } + else -> IrErrorCallExpressionImpl(startOffset, endOffset, type ?: createErrorType(), "Unresolved reference: ${render()}") + } + } + } + + private fun IrExpression.applyCallArguments(call: FirCall): IrExpression { + return when (this) { + is IrCallImpl -> { + val argumentsCount = call.arguments.size + if (argumentsCount <= valueArgumentsCount) { + apply { + for ((index, argument) in call.arguments.withIndex()) { + val argumentExpression = argument.toIrExpression() + putValueArgument(index, argumentExpression) + } + } + } else { + IrErrorCallExpressionImpl( + startOffset, endOffset, type, + "Cannot bind $argumentsCount arguments to ${symbol.owner.name} call with $valueArgumentsCount parameters" + ).apply { + for (argument in call.arguments) { + addArgument(argument.toIrExpression()) + } + } + } + } + is IrErrorCallExpressionImpl -> apply { + for (argument in call.arguments) { + addArgument(argument.toIrExpression()) + } + } + else -> this + } + } + + override fun visitFunctionCall(functionCall: FirFunctionCall, data: Any?): IrElement { + return functionCall.toIrExpression(functionCall.typeRef).applyCallArguments(functionCall) + } + + override fun visitAnnotationCall(annotationCall: FirAnnotationCall, data: Any?): IrElement { + return annotationCall.toIrExpression().applyCallArguments(annotationCall) + } + + override fun visitQualifiedAccessExpression(qualifiedAccessExpression: FirQualifiedAccessExpression, data: Any?): IrElement { + return qualifiedAccessExpression.toIrExpression(qualifiedAccessExpression.typeRef) + } + + private fun generateErrorCallExpression(startOffset: Int, endOffset: Int, calleeReference: FirReference): IrErrorCallExpression { + return IrErrorCallExpressionImpl( + startOffset, endOffset, IrErrorTypeImpl(null, emptyList(), Variance.INVARIANT), + "Unresolved reference: ${calleeReference.render()}" + ) + } + + override fun visitVariableAssignment(variableAssignment: FirVariableAssignment, data: Any?): IrElement { + val calleeReference = variableAssignment.calleeReference + val symbol = calleeReference.toSymbol(declarationStorage) + return variableAssignment.convertWithOffsets { startOffset, endOffset -> + if (symbol != null && symbol.isBound) { + when (symbol) { + is IrFieldSymbol -> IrSetFieldImpl( + startOffset, endOffset, symbol, symbol.owner.type + ).apply { + value = variableAssignment.rValue.toIrExpression() + } + is IrPropertySymbol -> { + val irProperty = symbol.owner + val backingField = irProperty.backingField + if (backingField != null) { + IrSetFieldImpl( + startOffset, endOffset, backingField.symbol, backingField.symbol.owner.type + ).apply { + value = variableAssignment.rValue.toIrExpression() + } + } else { + generateErrorCallExpression(startOffset, endOffset, calleeReference) + } + } + else -> generateErrorCallExpression(startOffset, endOffset, calleeReference) + } + } else { + generateErrorCallExpression(startOffset, endOffset, calleeReference) + } + } + } + + override fun visitConstExpression(constExpression: FirConstExpression, data: Any?): IrElement { + return constExpression.convertWithOffsets { startOffset, endOffset -> + IrConstImpl( + startOffset, endOffset, + constExpression.typeRef.toIrType(session, declarationStorage), + constExpression.kind, constExpression.value + ) + } + } + + override fun visitAnonymousObject(anonymousObject: FirAnonymousObject, data: Any?): IrElement { + val anonymousClass = declarationStorage.getIrAnonymousObject(anonymousObject).setParentByParentStack().withParent { + setClassContent(anonymousObject) + } + val anonymousClassType = anonymousClass.thisReceiver!!.type + return anonymousObject.convertWithOffsets { startOffset, endOffset -> + IrBlockImpl( + startOffset, endOffset, anonymousClassType, IrStatementOrigin.OBJECT_LITERAL, + listOf( + anonymousClass, + IrCallImpl(startOffset, endOffset, anonymousClassType, anonymousClass.constructors.first().symbol) + ) + ) + } + } + + // ================================================================================== + + private fun FirStatement.toIrStatement(): IrStatement? { + if (this is FirTypeAlias) return null + return accept(this@Fir2IrVisitor, null) as IrStatement + } + + private fun FirExpression.toIrExpression(): IrExpression { + return when (this) { + is FirBlock -> convertToIrExpressionOrBlock() + is FirWhenSubjectExpression -> { + val lastSubjectVariable = subjectVariableStack.last() + convertWithOffsets { startOffset, endOffset -> + IrGetValueImpl(startOffset, endOffset, lastSubjectVariable.type, lastSubjectVariable.symbol) + } + } + is FirUnitExpression -> convertWithOffsets { startOffset, endOffset -> + IrGetObjectValueImpl( + startOffset, endOffset, unitType, + symbolTable.referenceClass(irBuiltIns.builtIns.unit) + ) + } + else -> accept(this@Fir2IrVisitor, null) as IrExpression + } + } + + private fun FirBlock.convertToIrBlockBody(): IrBlockBody { + return convertWithOffsets { startOffset, endOffset -> + val irStatements = statements.map { it.toIrStatement() } + IrBlockBodyImpl( + startOffset, endOffset, + if (irStatements.isNotEmpty()) { + irStatements.filterNotNull().takeIf { it.isNotEmpty() } + ?: listOf(IrBlockImpl(startOffset, endOffset, unitType, null, emptyList())) + } else { + emptyList() + } + ) + } + } + + private fun FirBlock.convertToIrExpressionOrBlock(): IrExpression { + if (statements.size == 1) { + val firStatement = statements.single() + if (firStatement is FirExpression) { + return firStatement.toIrExpression() + } + } + val type = + (statements.lastOrNull() as? FirExpression)?.typeRef?.toIrType(this@Fir2IrVisitor.session, declarationStorage) ?: unitType + return convertWithOffsets { startOffset, endOffset -> + IrBlockImpl( + startOffset, endOffset, type, null, + statements.mapNotNull { it.toIrStatement() } + ) + } + } + + override fun visitErrorExpression(errorExpression: FirErrorExpression, data: Any?): IrElement { + return errorExpression.convertWithOffsets { startOffset, endOffset -> + IrErrorExpressionImpl( + startOffset, endOffset, + errorExpression.typeRef.toIrType(session, declarationStorage), + errorExpression.reason + ) + } + } + + private fun generateWhenSubjectVariable(whenExpression: FirWhenExpression): IrVariable? { + val subjectVariable = whenExpression.subjectVariable + val subjectExpression = whenExpression.subject + return when { + subjectVariable != null -> subjectVariable.accept(this, null) as IrVariable + subjectExpression != null -> { + val irSubject = declarationStorage.declareTemporaryVariable(subjectExpression.toIrExpression(), "subject") + irSubject.setParentByParentStack() + } + else -> null + } + } + + override fun visitWhenExpression(whenExpression: FirWhenExpression, data: Any?): IrElement { + val subjectVariable = generateWhenSubjectVariable(whenExpression) + val origin = when (val psi = whenExpression.psi) { + is KtWhenExpression -> IrStatementOrigin.WHEN + is KtIfExpression -> IrStatementOrigin.IF + is KtBinaryExpression -> when (psi.operationToken) { + KtTokens.ELVIS -> IrStatementOrigin.ELVIS + KtTokens.OROR -> IrStatementOrigin.OROR + KtTokens.ANDAND -> IrStatementOrigin.ANDAND + else -> null + } + is KtUnaryExpression -> IrStatementOrigin.EXCLEXCL + else -> null + } + return subjectVariable.withSubject { + whenExpression.convertWithOffsets { startOffset, endOffset -> + val irWhen = IrWhenImpl( + startOffset, endOffset, + whenExpression.typeRef.toIrType(session, declarationStorage), + origin + ).apply { + for (branch in whenExpression.branches) { + if (branch.condition !is FirElseIfTrueCondition || branch.result.statements.isNotEmpty()) { + branches += branch.accept(this@Fir2IrVisitor, data) as IrBranch + } + } + } + if (subjectVariable == null) { + irWhen + } else { + IrBlockImpl(startOffset, endOffset, irWhen.type, origin, listOf(subjectVariable, irWhen)) + } + } + } + } + + override fun visitWhenBranch(whenBranch: FirWhenBranch, data: Any?): IrElement { + return whenBranch.convertWithOffsets { startOffset, endOffset -> + val condition = whenBranch.condition + val irResult = whenBranch.result.toIrExpression() + if (condition is FirElseIfTrueCondition) { + IrElseBranchImpl(IrConstImpl.boolean(irResult.startOffset, irResult.endOffset, booleanType, true), irResult) + } else { + IrBranchImpl(startOffset, endOffset, condition.toIrExpression(), irResult) + } + } + } + + private val loopMap = mutableMapOf() + + override fun visitDoWhileLoop(doWhileLoop: FirDoWhileLoop, data: Any?): IrElement { + return doWhileLoop.convertWithOffsets { startOffset, endOffset -> + IrDoWhileLoopImpl( + startOffset, endOffset, unitType, + IrStatementOrigin.DO_WHILE_LOOP + ).apply { + loopMap[doWhileLoop] = this + label = doWhileLoop.label?.name + condition = doWhileLoop.condition.toIrExpression() + body = doWhileLoop.block.convertToIrExpressionOrBlock() + loopMap.remove(doWhileLoop) + } + } + } + + override fun visitWhileLoop(whileLoop: FirWhileLoop, data: Any?): IrElement { + return whileLoop.convertWithOffsets { startOffset, endOffset -> + IrWhileLoopImpl( + startOffset, endOffset, unitType, + if (whileLoop.psi is KtForExpression) IrStatementOrigin.FOR_LOOP_INNER_WHILE + else IrStatementOrigin.WHILE_LOOP + ).apply { + loopMap[whileLoop] = this + label = whileLoop.label?.name + condition = whileLoop.condition.toIrExpression() + body = whileLoop.block.convertToIrExpressionOrBlock() + loopMap.remove(whileLoop) + } + } + } + + private fun FirJump.convertJumpWithOffsets( + f: (startOffset: Int, endOffset: Int, irLoop: IrLoop) -> IrBreakContinueBase + ): IrExpression { + return convertWithOffsets { startOffset, endOffset -> + val firLoop = target.labeledElement + val irLoop = loopMap[firLoop] + if (irLoop == null) { + IrErrorExpressionImpl(startOffset, endOffset, nothingType, "Unbound loop: ${render()}") + } else { + f(startOffset, endOffset, irLoop).apply { + label = irLoop.label.takeIf { target.labelName != null } + } + } + } + } + + override fun visitBreakExpression(breakExpression: FirBreakExpression, data: Any?): IrElement { + return breakExpression.convertJumpWithOffsets { startOffset, endOffset, irLoop -> + IrBreakImpl(startOffset, endOffset, nothingType, irLoop) + } + } + + override fun visitContinueExpression(continueExpression: FirContinueExpression, data: Any?): IrElement { + return continueExpression.convertJumpWithOffsets { startOffset, endOffset, irLoop -> + IrContinueImpl(startOffset, endOffset, nothingType, irLoop) + } + } + + override fun visitThrowExpression(throwExpression: FirThrowExpression, data: Any?): IrElement { + return throwExpression.convertWithOffsets { startOffset, endOffset -> + IrThrowImpl(startOffset, endOffset, nothingType, throwExpression.exception.toIrExpression()) + } + } + + override fun visitTryExpression(tryExpression: FirTryExpression, data: Any?): IrElement { + return tryExpression.convertWithOffsets { startOffset, endOffset -> + IrTryImpl( + startOffset, endOffset, tryExpression.typeRef.toIrType(session, declarationStorage), + tryExpression.tryBlock.convertToIrExpressionOrBlock(), + tryExpression.catches.map { it.accept(this, data) as IrCatch }, + tryExpression.finallyBlock?.convertToIrExpressionOrBlock() + ) + } + } + + override fun visitCatch(catch: FirCatch, data: Any?): IrElement { + return catch.convertWithOffsets { startOffset, endOffset -> + val catchParameter = declarationStorage.createAndSaveIrVariable(catch.parameter) + IrCatchImpl(startOffset, endOffset, catchParameter.setParentByParentStack()).apply { + result = catch.block.convertToIrExpressionOrBlock() + } + } + } + + private fun generateComparisonCall( + startOffset: Int, endOffset: Int, operation: FirOperation, first: FirExpression, second: FirExpression + ): IrExpression { + val firstType = first.typeRef as? FirResolvedTypeRef + val secondType = second.typeRef as? FirResolvedTypeRef + if (firstType == null || secondType == null) { + return IrErrorCallExpressionImpl(startOffset, endOffset, booleanType, "Comparison of arguments with unresolved types") + } + if (!AbstractStrictEqualityTypeChecker.strictEqualTypes(typeContext, firstType.type, secondType.type)) { + return IrErrorCallExpressionImpl( + startOffset, endOffset, booleanType, + "Comparison of arguments with different types: ${firstType.type.render()}, ${secondType.type.render()}" + ) + } + // TODO: it's temporary hack which should be refactored + val simpleType = when (val classId = (firstType.type as? ConeClassLikeType)?.lookupTag?.classId) { + ClassId(FqName("kotlin"), FqName("Long"), false) -> irBuiltIns.builtIns.longType + ClassId(FqName("kotlin"), FqName("Int"), false) -> irBuiltIns.builtIns.intType + ClassId(FqName("kotlin"), FqName("Float"), false) -> irBuiltIns.builtIns.floatType + ClassId(FqName("kotlin"), FqName("Double"), false) -> irBuiltIns.builtIns.doubleType + else -> { + return IrErrorCallExpressionImpl( + startOffset, endOffset, booleanType, "Comparison of arguments with unsupported type: $classId" + ) + } + } + val (symbol, origin) = when (operation) { + FirOperation.LT -> irBuiltIns.lessFunByOperandType[simpleType] to IrStatementOrigin.LT + FirOperation.GT -> irBuiltIns.greaterFunByOperandType[simpleType] to IrStatementOrigin.GT + FirOperation.LT_EQ -> irBuiltIns.lessOrEqualFunByOperandType[simpleType] to IrStatementOrigin.LTEQ + FirOperation.GT_EQ -> irBuiltIns.greaterOrEqualFunByOperandType[simpleType] to IrStatementOrigin.GTEQ + else -> throw AssertionError("Unexpected comparison operation: $operation") + } + return IrBinaryPrimitiveImpl( + startOffset, endOffset, booleanType, origin, symbol!!, + first.toIrExpression(), second.toIrExpression() + ) + } + + private fun generateOperatorCall( + startOffset: Int, endOffset: Int, operation: FirOperation, arguments: List + ): IrExpression { + if (operation in FirOperation.COMPARISONS) { + return generateComparisonCall(startOffset, endOffset, operation, arguments[0], arguments[1]) + } + val (type, symbol, origin) = when (operation) { + FirOperation.EQ -> Triple(booleanType, irBuiltIns.eqeqSymbol, IrStatementOrigin.EQEQ) + FirOperation.NOT_EQ -> Triple(booleanType, irBuiltIns.eqeqSymbol, IrStatementOrigin.EXCLEQ) + FirOperation.IDENTITY -> Triple(booleanType, irBuiltIns.eqeqeqSymbol, IrStatementOrigin.EQEQEQ) + FirOperation.NOT_IDENTITY -> Triple(booleanType, irBuiltIns.eqeqeqSymbol, IrStatementOrigin.EXCLEQEQ) + FirOperation.EXCL -> Triple(booleanType, irBuiltIns.booleanNotSymbol, IrStatementOrigin.EXCL) + FirOperation.LT, FirOperation.GT, + FirOperation.LT_EQ, FirOperation.GT_EQ, + FirOperation.OTHER, FirOperation.ASSIGN, FirOperation.PLUS_ASSIGN, + FirOperation.MINUS_ASSIGN, FirOperation.TIMES_ASSIGN, + FirOperation.DIV_ASSIGN, FirOperation.REM_ASSIGN, + FirOperation.IS, FirOperation.NOT_IS, + FirOperation.AS, FirOperation.SAFE_AS -> { + TODO("Should not be here: incompatible operation in FirOperatorCall: $operation") + } + } + val result = if (operation in UNARY_OPERATIONS) { + primitiveOp1(startOffset, endOffset, symbol, type, origin, arguments[0].toIrExpression()) + } else { + IrBinaryPrimitiveImpl( + startOffset, endOffset, type, origin, symbol, + arguments[0].toIrExpression(), arguments[1].toIrExpression() + ) + } + if (operation !in NEGATED_OPERATIONS) return result + return primitiveOp1(startOffset, endOffset, irBuiltIns.booleanNotSymbol, booleanType, origin, result) + } + + override fun visitOperatorCall(operatorCall: FirOperatorCall, data: Any?): IrElement { + return operatorCall.convertWithOffsets { startOffset, endOffset -> + generateOperatorCall(startOffset, endOffset, operatorCall.operation, operatorCall.arguments) + } + } + + override fun visitTypeOperatorCall(typeOperatorCall: FirTypeOperatorCall, data: Any?): IrElement { + return typeOperatorCall.convertWithOffsets { startOffset, endOffset -> + val irTypeOperand = typeOperatorCall.conversionTypeRef.toIrType(session, declarationStorage) + val (irType, irTypeOperator) = when (typeOperatorCall.operation) { + FirOperation.IS -> booleanType to IrTypeOperator.INSTANCEOF + FirOperation.NOT_IS -> booleanType to IrTypeOperator.NOT_INSTANCEOF + FirOperation.AS -> irTypeOperand to IrTypeOperator.CAST + FirOperation.SAFE_AS -> irTypeOperand.makeNullable() to IrTypeOperator.SAFE_CAST + else -> TODO("Should not be here: ${typeOperatorCall.operation} in type operator call") + } + + IrTypeOperatorCallImpl( + startOffset, endOffset, irType, irTypeOperator, irTypeOperand, + irTypeOperand.classifierOrFail, typeOperatorCall.argument.toIrExpression() + ) + } + } + + override fun visitGetClassCall(getClassCall: FirGetClassCall, data: Any?): IrElement { + return getClassCall.convertWithOffsets { startOffset, endOffset -> + IrGetClassImpl( + startOffset, endOffset, getClassCall.typeRef.toIrType(session, declarationStorage), + getClassCall.argument.toIrExpression() + ) + } + } + + override fun visitArraySetCall(arraySetCall: FirArraySetCall, data: Any?): IrElement { + return arraySetCall.convertWithOffsets { startOffset, endOffset -> + IrErrorCallExpressionImpl( + startOffset, endOffset, unitType, + "FirArraySetCall (resolve isn't supported yet)" + ) + } + } +} \ No newline at end of file diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/descriptors/FirModuleDescriptor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/descriptors/FirModuleDescriptor.kt new file mode 100644 index 00000000000..afd362b456c --- /dev/null +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/descriptors/FirModuleDescriptor.kt @@ -0,0 +1,74 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.descriptors + +import org.jetbrains.kotlin.builtins.DefaultBuiltIns +import org.jetbrains.kotlin.builtins.KotlinBuiltIns +import org.jetbrains.kotlin.descriptors.DeclarationDescriptor +import org.jetbrains.kotlin.descriptors.DeclarationDescriptorVisitor +import org.jetbrains.kotlin.descriptors.ModuleDescriptor +import org.jetbrains.kotlin.descriptors.PackageViewDescriptor +import org.jetbrains.kotlin.descriptors.annotations.Annotations +import org.jetbrains.kotlin.fir.FirSession +import org.jetbrains.kotlin.fir.resolve.FirSymbolProvider +import org.jetbrains.kotlin.name.FqName +import org.jetbrains.kotlin.name.Name + +class FirModuleDescriptor(val session: FirSession) : ModuleDescriptor { + override val builtIns: KotlinBuiltIns + get() = DefaultBuiltIns.Instance + + override fun shouldSeeInternalsOf(targetModule: ModuleDescriptor): Boolean { + return false + } + + override fun getPackage(fqName: FqName): PackageViewDescriptor { + val symbolProvider = FirSymbolProvider.getInstance(session) + if (symbolProvider.getPackage(fqName) != null) { + return FirPackageViewDescriptor(fqName, this) + } + TODO("Missing package reporting") + } + + override fun getSubPackagesOf(fqName: FqName, nameFilter: (Name) -> Boolean): Collection { + TODO("not implemented") + } + + override val allDependencyModules: List + get() = TODO("not implemented") + override val expectedByModules: List + get() = TODO("not implemented") + + override fun getCapability(capability: ModuleDescriptor.Capability): T? { + return null + } + + override val isValid: Boolean + get() = true + + override fun assertValid() { + + } + + override fun getOriginal(): DeclarationDescriptor { + return this + } + + override fun getName(): Name { + return Name.identifier("module for FIR session") + } + + override val stableName: Name? + get() = name + + override fun acceptVoid(visitor: DeclarationDescriptorVisitor?) { + TODO("not implemented") + } + + override val annotations: Annotations + get() = TODO("not implemented") + +} \ No newline at end of file diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/descriptors/FirPackageFragmentDescriptor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/descriptors/FirPackageFragmentDescriptor.kt new file mode 100644 index 00000000000..56fda4b3b69 --- /dev/null +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/descriptors/FirPackageFragmentDescriptor.kt @@ -0,0 +1,47 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.descriptors + +import org.jetbrains.kotlin.descriptors.* +import org.jetbrains.kotlin.descriptors.annotations.Annotations +import org.jetbrains.kotlin.name.FqName +import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.resolve.scopes.MemberScope + +class FirPackageFragmentDescriptor(override val fqName: FqName, val moduleDescriptor: ModuleDescriptor) : PackageFragmentDescriptor { + override fun getContainingDeclaration(): ModuleDescriptor { + return moduleDescriptor + } + + + override fun getMemberScope(): MemberScope { + TODO("not implemented") + } + + override fun getOriginal(): DeclarationDescriptorWithSource { + return this + } + + override fun getName(): Name { + return fqName.shortName() + } + + override fun accept(visitor: DeclarationDescriptorVisitor?, data: D): R { + TODO("not implemented") + } + + override fun getSource(): SourceElement { + TODO("not implemented") + } + + override fun acceptVoid(visitor: DeclarationDescriptorVisitor?) { + TODO("not implemented") + } + + override val annotations: Annotations + get() = TODO("not implemented") + +} \ No newline at end of file diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/descriptors/FirPackageViewDescriptor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/descriptors/FirPackageViewDescriptor.kt new file mode 100644 index 00000000000..fb128f1968b --- /dev/null +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/descriptors/FirPackageViewDescriptor.kt @@ -0,0 +1,45 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.descriptors + +import org.jetbrains.kotlin.descriptors.* +import org.jetbrains.kotlin.descriptors.annotations.Annotations +import org.jetbrains.kotlin.name.FqName +import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.resolve.scopes.MemberScope + +class FirPackageViewDescriptor(override val fqName: FqName, val moduleDescriptor: ModuleDescriptor) : PackageViewDescriptor { + override fun getContainingDeclaration(): PackageViewDescriptor? { + TODO("not implemented") + } + + override val memberScope: MemberScope + get() = TODO("not implemented") + override val module: ModuleDescriptor + get() = moduleDescriptor + override val fragments: List + get() = listOf(FirPackageFragmentDescriptor(fqName, moduleDescriptor)) + + override fun getOriginal(): DeclarationDescriptor { + TODO("not implemented") + } + + override fun getName(): Name { + TODO("not implemented") + } + + override fun accept(visitor: DeclarationDescriptorVisitor?, data: D): R { + TODO("not implemented") + } + + override fun acceptVoid(visitor: DeclarationDescriptorVisitor?) { + TODO("not implemented") + } + + override val annotations: Annotations + get() = TODO("not implemented") + +} \ No newline at end of file diff --git a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/AbstractFir2IrTextTest.kt b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/AbstractFir2IrTextTest.kt new file mode 100644 index 00000000000..cad2850c933 --- /dev/null +++ b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/AbstractFir2IrTextTest.kt @@ -0,0 +1,92 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir + +import com.intellij.openapi.extensions.Extensions +import com.intellij.openapi.project.Project +import com.intellij.psi.PsiElementFinder +import com.intellij.psi.search.GlobalSearchScope +import junit.framework.TestCase +import org.jetbrains.kotlin.asJava.finder.JavaElementFinder +import org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM +import org.jetbrains.kotlin.config.languageVersionSettings +import org.jetbrains.kotlin.fir.backend.Fir2IrConverter +import org.jetbrains.kotlin.fir.builder.RawFirBuilder +import org.jetbrains.kotlin.fir.resolve.FirProvider +import org.jetbrains.kotlin.fir.resolve.impl.FirProviderImpl +import org.jetbrains.kotlin.fir.resolve.transformers.FirTotalResolveTransformer +import org.jetbrains.kotlin.ir.AbstractIrTextTestCase +import org.jetbrains.kotlin.ir.declarations.IrModuleFragment +import java.io.File + +abstract class AbstractFir2IrTextTest : AbstractIrTextTestCase() { + + private fun prepareProjectExtensions(project: Project) { + Extensions.getArea(project) + .getExtensionPoint(PsiElementFinder.EP_NAME) + .unregisterExtension(JavaElementFinder::class.java) + } + + override fun doTest(filePath: String?) { + if (filePath != null) { + val originalTextPath = filePath.replace(".kt", ".txt") + val firTextPath = filePath.replace(".kt", ".fir.txt") + val originalText = File(originalTextPath) + val firText = File(firTextPath) + if (originalText.exists() && firText.exists()) { + val originalLines = originalText.readLines() + val firLines = firText.readLines() + TestCase.assertFalse( + "Dumps via FIR & via old FE are the same. Please delete .fir.txt dump and add // FIR_IDENTICAL to test source", + firLines.withIndex().all { (index, line) -> + val trimmed = line.trim() + val originalTrimmed = originalLines.getOrNull(index)?.trim() + trimmed.isEmpty() && originalTrimmed?.isEmpty() != false || trimmed == originalTrimmed + } && originalLines.withIndex().all { (index, line) -> + index < firLines.size || line.trim().isEmpty() + } + ) + } + } + super.doTest(filePath) + } + + override fun getExpectedTextFileName(testFile: TestFile, name: String): String { + // NB: replace with if (true) to make test against old FE results + if ("// FIR_IDENTICAL" in testFile.content.split("\n")) { + return super.getExpectedTextFileName(testFile, name) + } + return name.replace(".txt", ".fir.txt").replace(".kt", ".fir.txt") + } + + override fun generateIrModule(ignoreErrors: Boolean): IrModuleFragment { + val psiFiles = myFiles.psiFiles + + val project = psiFiles.first().project + prepareProjectExtensions(project) + + val scope = GlobalSearchScope.filesScope(project, psiFiles.map { it.virtualFile }) + .uniteWith(TopDownAnalyzerFacadeForJVM.AllJavaSourcesInProjectScope(project)) + val session = createSession(myEnvironment, scope) + + val builder = RawFirBuilder(session, stubMode = false) + + val resolveTransformer = FirTotalResolveTransformer() + val firFiles = psiFiles.map { + val firFile = builder.buildFirFile(it) + (session.service() as FirProviderImpl).recordFile(firFile) + firFile + }.also { + try { + resolveTransformer.processFiles(it) + } catch (e: Exception) { + throw e + } + } + + return Fir2IrConverter.createModuleFragment(session, firFiles, myEnvironment.configuration.languageVersionSettings) + } +} \ No newline at end of file diff --git a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java new file mode 100644 index 00000000000..ce391dbd90f --- /dev/null +++ b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java @@ -0,0 +1,1614 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; +import org.jetbrains.kotlin.test.KotlinTestUtils; +import org.jetbrains.kotlin.test.TargetBackend; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.runner.RunWith; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("compiler/testData/ir/irText") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInIrText() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/ir/irText"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("compiler/testData/ir/irText/classes") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Classes extends AbstractFir2IrTextTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + @TestMetadata("abstractMembers.kt") + public void testAbstractMembers() throws Exception { + runTest("compiler/testData/ir/irText/classes/abstractMembers.kt"); + } + + public void testAllFilesPresentInClasses() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/ir/irText/classes"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("annotationClasses.kt") + public void testAnnotationClasses() throws Exception { + runTest("compiler/testData/ir/irText/classes/annotationClasses.kt"); + } + + @TestMetadata("argumentReorderingInDelegatingConstructorCall.kt") + public void testArgumentReorderingInDelegatingConstructorCall() throws Exception { + runTest("compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.kt"); + } + + @TestMetadata("classMembers.kt") + public void testClassMembers() throws Exception { + runTest("compiler/testData/ir/irText/classes/classMembers.kt"); + } + + @TestMetadata("classes.kt") + public void testClasses() throws Exception { + runTest("compiler/testData/ir/irText/classes/classes.kt"); + } + + @TestMetadata("companionObject.kt") + public void testCompanionObject() throws Exception { + runTest("compiler/testData/ir/irText/classes/companionObject.kt"); + } + + @TestMetadata("dataClassWithArrayMembers.kt") + public void testDataClassWithArrayMembers() throws Exception { + runTest("compiler/testData/ir/irText/classes/dataClassWithArrayMembers.kt"); + } + + @TestMetadata("dataClasses.kt") + public void testDataClasses() throws Exception { + runTest("compiler/testData/ir/irText/classes/dataClasses.kt"); + } + + @TestMetadata("dataClassesGeneric.kt") + public void testDataClassesGeneric() throws Exception { + runTest("compiler/testData/ir/irText/classes/dataClassesGeneric.kt"); + } + + @TestMetadata("delegatedImplementation.kt") + public void testDelegatedImplementation() throws Exception { + runTest("compiler/testData/ir/irText/classes/delegatedImplementation.kt"); + } + + @TestMetadata("delegatedImplementationWithExplicitOverride.kt") + public void testDelegatedImplementationWithExplicitOverride() throws Exception { + runTest("compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.kt"); + } + + @TestMetadata("delegatingConstructorCallToTypeAliasConstructor.kt") + public void testDelegatingConstructorCallToTypeAliasConstructor() throws Exception { + runTest("compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.kt"); + } + + @TestMetadata("delegatingConstructorCallsInSecondaryConstructors.kt") + public void testDelegatingConstructorCallsInSecondaryConstructors() throws Exception { + runTest("compiler/testData/ir/irText/classes/delegatingConstructorCallsInSecondaryConstructors.kt"); + } + + @TestMetadata("enum.kt") + public void testEnum() throws Exception { + runTest("compiler/testData/ir/irText/classes/enum.kt"); + } + + @TestMetadata("enumClassModality.kt") + public void testEnumClassModality() throws Exception { + runTest("compiler/testData/ir/irText/classes/enumClassModality.kt"); + } + + @TestMetadata("enumWithSecondaryCtor.kt") + public void testEnumWithSecondaryCtor() throws Exception { + runTest("compiler/testData/ir/irText/classes/enumWithSecondaryCtor.kt"); + } + + @TestMetadata("initBlock.kt") + public void testInitBlock() throws Exception { + runTest("compiler/testData/ir/irText/classes/initBlock.kt"); + } + + @TestMetadata("initVal.kt") + public void testInitVal() throws Exception { + runTest("compiler/testData/ir/irText/classes/initVal.kt"); + } + + @TestMetadata("initVar.kt") + public void testInitVar() throws Exception { + runTest("compiler/testData/ir/irText/classes/initVar.kt"); + } + + @TestMetadata("inlineClass.kt") + public void testInlineClass() throws Exception { + runTest("compiler/testData/ir/irText/classes/inlineClass.kt"); + } + + @TestMetadata("innerClass.kt") + public void testInnerClass() throws Exception { + runTest("compiler/testData/ir/irText/classes/innerClass.kt"); + } + + @TestMetadata("innerClassWithDelegatingConstructor.kt") + public void testInnerClassWithDelegatingConstructor() throws Exception { + runTest("compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.kt"); + } + + @TestMetadata("lambdaInDataClassDefaultParameter.kt") + public void testLambdaInDataClassDefaultParameter() throws Exception { + runTest("compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.kt"); + } + + @TestMetadata("localClasses.kt") + public void testLocalClasses() throws Exception { + runTest("compiler/testData/ir/irText/classes/localClasses.kt"); + } + + @TestMetadata("objectLiteralExpressions.kt") + public void testObjectLiteralExpressions() throws Exception { + runTest("compiler/testData/ir/irText/classes/objectLiteralExpressions.kt"); + } + + @TestMetadata("objectWithInitializers.kt") + public void testObjectWithInitializers() throws Exception { + runTest("compiler/testData/ir/irText/classes/objectWithInitializers.kt"); + } + + @TestMetadata("outerClassAccess.kt") + public void testOuterClassAccess() throws Exception { + runTest("compiler/testData/ir/irText/classes/outerClassAccess.kt"); + } + + @TestMetadata("primaryConstructor.kt") + public void testPrimaryConstructor() throws Exception { + runTest("compiler/testData/ir/irText/classes/primaryConstructor.kt"); + } + + @TestMetadata("primaryConstructorWithSuperConstructorCall.kt") + public void testPrimaryConstructorWithSuperConstructorCall() throws Exception { + runTest("compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.kt"); + } + + @TestMetadata("qualifiedSuperCalls.kt") + public void testQualifiedSuperCalls() throws Exception { + runTest("compiler/testData/ir/irText/classes/qualifiedSuperCalls.kt"); + } + + @TestMetadata("sealedClasses.kt") + public void testSealedClasses() throws Exception { + runTest("compiler/testData/ir/irText/classes/sealedClasses.kt"); + } + + @TestMetadata("secondaryConstructorWithInitializersFromClassBody.kt") + public void testSecondaryConstructorWithInitializersFromClassBody() throws Exception { + runTest("compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.kt"); + } + + @TestMetadata("secondaryConstructors.kt") + public void testSecondaryConstructors() throws Exception { + runTest("compiler/testData/ir/irText/classes/secondaryConstructors.kt"); + } + + @TestMetadata("superCalls.kt") + public void testSuperCalls() throws Exception { + runTest("compiler/testData/ir/irText/classes/superCalls.kt"); + } + } + + @TestMetadata("compiler/testData/ir/irText/declarations") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Declarations extends AbstractFir2IrTextTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInDeclarations() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/ir/irText/declarations"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("catchParameterInTopLevelProperty.kt") + public void testCatchParameterInTopLevelProperty() throws Exception { + runTest("compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.kt"); + } + + @TestMetadata("classLevelProperties.kt") + public void testClassLevelProperties() throws Exception { + runTest("compiler/testData/ir/irText/declarations/classLevelProperties.kt"); + } + + @TestMetadata("constValInitializers.kt") + public void testConstValInitializers() throws Exception { + runTest("compiler/testData/ir/irText/declarations/constValInitializers.kt"); + } + + @TestMetadata("defaultArguments.kt") + public void testDefaultArguments() throws Exception { + runTest("compiler/testData/ir/irText/declarations/defaultArguments.kt"); + } + + @TestMetadata("delegatedProperties.kt") + public void testDelegatedProperties() throws Exception { + runTest("compiler/testData/ir/irText/declarations/delegatedProperties.kt"); + } + + @TestMetadata("extensionProperties.kt") + public void testExtensionProperties() throws Exception { + runTest("compiler/testData/ir/irText/declarations/extensionProperties.kt"); + } + + @TestMetadata("fakeOverrides.kt") + public void testFakeOverrides() throws Exception { + runTest("compiler/testData/ir/irText/declarations/fakeOverrides.kt"); + } + + @TestMetadata("fileWithAnnotations.kt") + public void testFileWithAnnotations() throws Exception { + runTest("compiler/testData/ir/irText/declarations/fileWithAnnotations.kt"); + } + + @TestMetadata("fileWithTypeAliasesOnly.kt") + public void testFileWithTypeAliasesOnly() throws Exception { + runTest("compiler/testData/ir/irText/declarations/fileWithTypeAliasesOnly.kt"); + } + + @TestMetadata("interfaceProperties.kt") + public void testInterfaceProperties() throws Exception { + runTest("compiler/testData/ir/irText/declarations/interfaceProperties.kt"); + } + + @TestMetadata("kt27005.kt") + public void testKt27005() throws Exception { + runTest("compiler/testData/ir/irText/declarations/kt27005.kt"); + } + + @TestMetadata("kt29833.kt") + public void testKt29833() throws Exception { + runTest("compiler/testData/ir/irText/declarations/kt29833.kt"); + } + + @TestMetadata("localClassWithOverrides.kt") + public void testLocalClassWithOverrides() throws Exception { + runTest("compiler/testData/ir/irText/declarations/localClassWithOverrides.kt"); + } + + @TestMetadata("localDelegatedProperties.kt") + public void testLocalDelegatedProperties() throws Exception { + runTest("compiler/testData/ir/irText/declarations/localDelegatedProperties.kt"); + } + + @TestMetadata("localVarInDoWhile.kt") + public void testLocalVarInDoWhile() throws Exception { + runTest("compiler/testData/ir/irText/declarations/localVarInDoWhile.kt"); + } + + @TestMetadata("packageLevelProperties.kt") + public void testPackageLevelProperties() throws Exception { + runTest("compiler/testData/ir/irText/declarations/packageLevelProperties.kt"); + } + + @TestMetadata("primaryCtorDefaultArguments.kt") + public void testPrimaryCtorDefaultArguments() throws Exception { + runTest("compiler/testData/ir/irText/declarations/primaryCtorDefaultArguments.kt"); + } + + @TestMetadata("primaryCtorProperties.kt") + public void testPrimaryCtorProperties() throws Exception { + runTest("compiler/testData/ir/irText/declarations/primaryCtorProperties.kt"); + } + + @TestMetadata("typeAlias.kt") + public void testTypeAlias() throws Exception { + runTest("compiler/testData/ir/irText/declarations/typeAlias.kt"); + } + + @TestMetadata("compiler/testData/ir/irText/declarations/annotations") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Annotations extends AbstractFir2IrTextTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInAnnotations() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/ir/irText/declarations/annotations"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("annotationsInAnnotationArguments.kt") + public void testAnnotationsInAnnotationArguments() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/annotationsInAnnotationArguments.kt"); + } + + @TestMetadata("annotationsWithDefaultParameterValues.kt") + public void testAnnotationsWithDefaultParameterValues() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/annotationsWithDefaultParameterValues.kt"); + } + + @TestMetadata("annotationsWithVarargParameters.kt") + public void testAnnotationsWithVarargParameters() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/annotationsWithVarargParameters.kt"); + } + + @TestMetadata("arrayInAnnotationArguments.kt") + public void testArrayInAnnotationArguments() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/arrayInAnnotationArguments.kt"); + } + + @TestMetadata("classLiteralInAnnotation.kt") + public void testClassLiteralInAnnotation() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/classLiteralInAnnotation.kt"); + } + + @TestMetadata("classesWithAnnotations.kt") + public void testClassesWithAnnotations() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.kt"); + } + + @TestMetadata("constExpressionsInAnnotationArguments.kt") + public void testConstExpressionsInAnnotationArguments() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.kt"); + } + + @TestMetadata("constructorsWithAnnotations.kt") + public void testConstructorsWithAnnotations() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/constructorsWithAnnotations.kt"); + } + + @TestMetadata("delegateFieldWithAnnotations.kt") + public void testDelegateFieldWithAnnotations() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.kt"); + } + + @TestMetadata("delegatedPropertyAccessorsWithAnnotations.kt") + public void testDelegatedPropertyAccessorsWithAnnotations() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.kt"); + } + + @TestMetadata("enumEntriesWithAnnotations.kt") + public void testEnumEntriesWithAnnotations() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.kt"); + } + + @TestMetadata("enumsInAnnotationArguments.kt") + public void testEnumsInAnnotationArguments() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.kt"); + } + + @TestMetadata("fieldsWithAnnotations.kt") + public void testFieldsWithAnnotations() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.kt"); + } + + @TestMetadata("fileAnnotations.kt") + public void testFileAnnotations() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/fileAnnotations.kt"); + } + + @TestMetadata("functionsWithAnnotations.kt") + public void testFunctionsWithAnnotations() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/functionsWithAnnotations.kt"); + } + + @TestMetadata("javaAnnotation.kt") + public void testJavaAnnotation() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/javaAnnotation.kt"); + } + + @TestMetadata("localDelegatedPropertiesWithAnnotations.kt") + public void testLocalDelegatedPropertiesWithAnnotations() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/localDelegatedPropertiesWithAnnotations.kt"); + } + + @TestMetadata("multipleAnnotationsInSquareBrackets.kt") + public void testMultipleAnnotationsInSquareBrackets() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/multipleAnnotationsInSquareBrackets.kt"); + } + + @TestMetadata("primaryConstructorParameterWithAnnotations.kt") + public void testPrimaryConstructorParameterWithAnnotations() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.kt"); + } + + @TestMetadata("propertiesWithAnnotations.kt") + public void testPropertiesWithAnnotations() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.kt"); + } + + @TestMetadata("propertyAccessorsFromClassHeaderWithAnnotations.kt") + public void testPropertyAccessorsFromClassHeaderWithAnnotations() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/propertyAccessorsFromClassHeaderWithAnnotations.kt"); + } + + @TestMetadata("propertyAccessorsWithAnnotations.kt") + public void testPropertyAccessorsWithAnnotations() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.kt"); + } + + @TestMetadata("propertySetterParameterWithAnnotations.kt") + public void testPropertySetterParameterWithAnnotations() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.kt"); + } + + @TestMetadata("receiverParameterWithAnnotations.kt") + public void testReceiverParameterWithAnnotations() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.kt"); + } + + @TestMetadata("spreadOperatorInAnnotationArguments.kt") + public void testSpreadOperatorInAnnotationArguments() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.kt"); + } + + @TestMetadata("typeAliasesWithAnnotations.kt") + public void testTypeAliasesWithAnnotations() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.kt"); + } + + @TestMetadata("typeParametersWithAnnotations.kt") + public void testTypeParametersWithAnnotations() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/typeParametersWithAnnotations.kt"); + } + + @TestMetadata("valueParametersWithAnnotations.kt") + public void testValueParametersWithAnnotations() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.kt"); + } + + @TestMetadata("varargsInAnnotationArguments.kt") + public void testVarargsInAnnotationArguments() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/varargsInAnnotationArguments.kt"); + } + + @TestMetadata("variablesWithAnnotations.kt") + public void testVariablesWithAnnotations() throws Exception { + runTest("compiler/testData/ir/irText/declarations/annotations/variablesWithAnnotations.kt"); + } + } + + @TestMetadata("compiler/testData/ir/irText/declarations/multiplatform") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Multiplatform extends AbstractFir2IrTextTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInMultiplatform() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/ir/irText/declarations/multiplatform"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("expectClassInherited.kt") + public void testExpectClassInherited() throws Exception { + runTest("compiler/testData/ir/irText/declarations/multiplatform/expectClassInherited.kt"); + } + + @TestMetadata("expectedEnumClass.kt") + public void testExpectedEnumClass() throws Exception { + runTest("compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass.kt"); + } + + @TestMetadata("expectedSealedClass.kt") + public void testExpectedSealedClass() throws Exception { + runTest("compiler/testData/ir/irText/declarations/multiplatform/expectedSealedClass.kt"); + } + } + + @TestMetadata("compiler/testData/ir/irText/declarations/parameters") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Parameters extends AbstractFir2IrTextTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInParameters() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/ir/irText/declarations/parameters"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("class.kt") + public void testClass() throws Exception { + runTest("compiler/testData/ir/irText/declarations/parameters/class.kt"); + } + + @TestMetadata("constructor.kt") + public void testConstructor() throws Exception { + runTest("compiler/testData/ir/irText/declarations/parameters/constructor.kt"); + } + + @TestMetadata("dataClassMembers.kt") + public void testDataClassMembers() throws Exception { + runTest("compiler/testData/ir/irText/declarations/parameters/dataClassMembers.kt"); + } + + @TestMetadata("defaultPropertyAccessors.kt") + public void testDefaultPropertyAccessors() throws Exception { + runTest("compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.kt"); + } + + @TestMetadata("delegatedMembers.kt") + public void testDelegatedMembers() throws Exception { + runTest("compiler/testData/ir/irText/declarations/parameters/delegatedMembers.kt"); + } + + @TestMetadata("fun.kt") + public void testFun() throws Exception { + runTest("compiler/testData/ir/irText/declarations/parameters/fun.kt"); + } + + @TestMetadata("genericInnerClass.kt") + public void testGenericInnerClass() throws Exception { + runTest("compiler/testData/ir/irText/declarations/parameters/genericInnerClass.kt"); + } + + @TestMetadata("lambdas.kt") + public void testLambdas() throws Exception { + runTest("compiler/testData/ir/irText/declarations/parameters/lambdas.kt"); + } + + @TestMetadata("localFun.kt") + public void testLocalFun() throws Exception { + runTest("compiler/testData/ir/irText/declarations/parameters/localFun.kt"); + } + + @TestMetadata("propertyAccessors.kt") + public void testPropertyAccessors() throws Exception { + runTest("compiler/testData/ir/irText/declarations/parameters/propertyAccessors.kt"); + } + + @TestMetadata("typeParameterBeforeBound.kt") + public void testTypeParameterBeforeBound() throws Exception { + runTest("compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.kt"); + } + + @TestMetadata("typeParameterBoundedBySubclass.kt") + public void testTypeParameterBoundedBySubclass() throws Exception { + runTest("compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.kt"); + } + } + + @TestMetadata("compiler/testData/ir/irText/declarations/provideDelegate") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ProvideDelegate extends AbstractFir2IrTextTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInProvideDelegate() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/ir/irText/declarations/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("differentReceivers.kt") + public void testDifferentReceivers() throws Exception { + runTest("compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.kt"); + } + + @TestMetadata("local.kt") + public void testLocal() throws Exception { + runTest("compiler/testData/ir/irText/declarations/provideDelegate/local.kt"); + } + + @TestMetadata("localDifferentReceivers.kt") + public void testLocalDifferentReceivers() throws Exception { + runTest("compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.kt"); + } + + @TestMetadata("member.kt") + public void testMember() throws Exception { + runTest("compiler/testData/ir/irText/declarations/provideDelegate/member.kt"); + } + + @TestMetadata("memberExtension.kt") + public void testMemberExtension() throws Exception { + runTest("compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.kt"); + } + + @TestMetadata("topLevel.kt") + public void testTopLevel() throws Exception { + runTest("compiler/testData/ir/irText/declarations/provideDelegate/topLevel.kt"); + } + } + } + + @TestMetadata("compiler/testData/ir/irText/errors") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Errors extends AbstractFir2IrTextTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInErrors() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/ir/irText/errors"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("suppressedNonPublicCall.kt") + public void testSuppressedNonPublicCall() throws Exception { + runTest("compiler/testData/ir/irText/errors/suppressedNonPublicCall.kt"); + } + + @TestMetadata("unresolvedReference.kt") + public void testUnresolvedReference() throws Exception { + runTest("compiler/testData/ir/irText/errors/unresolvedReference.kt"); + } + } + + @TestMetadata("compiler/testData/ir/irText/expressions") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Expressions extends AbstractFir2IrTextTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInExpressions() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/ir/irText/expressions"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("argumentMappedWithError.kt") + public void testArgumentMappedWithError() throws Exception { + runTest("compiler/testData/ir/irText/expressions/argumentMappedWithError.kt"); + } + + @TestMetadata("arrayAccess.kt") + public void testArrayAccess() throws Exception { + runTest("compiler/testData/ir/irText/expressions/arrayAccess.kt"); + } + + @TestMetadata("arrayAssignment.kt") + public void testArrayAssignment() throws Exception { + runTest("compiler/testData/ir/irText/expressions/arrayAssignment.kt"); + } + + @TestMetadata("arrayAugmentedAssignment1.kt") + public void testArrayAugmentedAssignment1() throws Exception { + runTest("compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.kt"); + } + + @TestMetadata("arrayAugmentedAssignment2.kt") + public void testArrayAugmentedAssignment2() throws Exception { + runTest("compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.kt"); + } + + @TestMetadata("assignments.kt") + public void testAssignments() throws Exception { + runTest("compiler/testData/ir/irText/expressions/assignments.kt"); + } + + @TestMetadata("augmentedAssignment1.kt") + public void testAugmentedAssignment1() throws Exception { + runTest("compiler/testData/ir/irText/expressions/augmentedAssignment1.kt"); + } + + @TestMetadata("augmentedAssignment2.kt") + public void testAugmentedAssignment2() throws Exception { + runTest("compiler/testData/ir/irText/expressions/augmentedAssignment2.kt"); + } + + @TestMetadata("augmentedAssignmentWithExpression.kt") + public void testAugmentedAssignmentWithExpression() throws Exception { + runTest("compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.kt"); + } + + @TestMetadata("badBreakContinue.kt") + public void testBadBreakContinue() throws Exception { + runTest("compiler/testData/ir/irText/expressions/badBreakContinue.kt"); + } + + @TestMetadata("bangbang.kt") + public void testBangbang() throws Exception { + runTest("compiler/testData/ir/irText/expressions/bangbang.kt"); + } + + @TestMetadata("booleanConstsInAndAndOrOr.kt") + public void testBooleanConstsInAndAndOrOr() throws Exception { + runTest("compiler/testData/ir/irText/expressions/booleanConstsInAndAndOrOr.kt"); + } + + @TestMetadata("booleanOperators.kt") + public void testBooleanOperators() throws Exception { + runTest("compiler/testData/ir/irText/expressions/booleanOperators.kt"); + } + + @TestMetadata("boundCallableReferences.kt") + public void testBoundCallableReferences() throws Exception { + runTest("compiler/testData/ir/irText/expressions/boundCallableReferences.kt"); + } + + @TestMetadata("boxOk.kt") + public void testBoxOk() throws Exception { + runTest("compiler/testData/ir/irText/expressions/boxOk.kt"); + } + + @TestMetadata("breakContinue.kt") + public void testBreakContinue() throws Exception { + runTest("compiler/testData/ir/irText/expressions/breakContinue.kt"); + } + + @TestMetadata("breakContinueInLoopHeader.kt") + public void testBreakContinueInLoopHeader() throws Exception { + runTest("compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.kt"); + } + + @TestMetadata("callWithReorderedArguments.kt") + public void testCallWithReorderedArguments() throws Exception { + runTest("compiler/testData/ir/irText/expressions/callWithReorderedArguments.kt"); + } + + @TestMetadata("callableRefToGenericMember.kt") + public void testCallableRefToGenericMember() throws Exception { + runTest("compiler/testData/ir/irText/expressions/callableRefToGenericMember.kt"); + } + + @TestMetadata("callableReferenceToImportedFromObject.kt") + public void testCallableReferenceToImportedFromObject() throws Exception { + runTest("compiler/testData/ir/irText/expressions/callableReferenceToImportedFromObject.kt"); + } + + @TestMetadata("callableReferenceTypeArguments.kt") + public void testCallableReferenceTypeArguments() throws Exception { + runTest("compiler/testData/ir/irText/expressions/callableReferenceTypeArguments.kt"); + } + + @TestMetadata("calls.kt") + public void testCalls() throws Exception { + runTest("compiler/testData/ir/irText/expressions/calls.kt"); + } + + @TestMetadata("castToTypeParameter.kt") + public void testCastToTypeParameter() throws Exception { + runTest("compiler/testData/ir/irText/expressions/castToTypeParameter.kt"); + } + + @TestMetadata("catchParameterAccess.kt") + public void testCatchParameterAccess() throws Exception { + runTest("compiler/testData/ir/irText/expressions/catchParameterAccess.kt"); + } + + @TestMetadata("chainOfSafeCalls.kt") + public void testChainOfSafeCalls() throws Exception { + runTest("compiler/testData/ir/irText/expressions/chainOfSafeCalls.kt"); + } + + @TestMetadata("classReference.kt") + public void testClassReference() throws Exception { + runTest("compiler/testData/ir/irText/expressions/classReference.kt"); + } + + @TestMetadata("coercionToUnit.kt") + public void testCoercionToUnit() throws Exception { + runTest("compiler/testData/ir/irText/expressions/coercionToUnit.kt"); + } + + @TestMetadata("complexAugmentedAssignment.kt") + public void testComplexAugmentedAssignment() throws Exception { + runTest("compiler/testData/ir/irText/expressions/complexAugmentedAssignment.kt"); + } + + @TestMetadata("contructorCall.kt") + public void testContructorCall() throws Exception { + runTest("compiler/testData/ir/irText/expressions/contructorCall.kt"); + } + + @TestMetadata("conventionComparisons.kt") + public void testConventionComparisons() throws Exception { + runTest("compiler/testData/ir/irText/expressions/conventionComparisons.kt"); + } + + @TestMetadata("destructuring1.kt") + public void testDestructuring1() throws Exception { + runTest("compiler/testData/ir/irText/expressions/destructuring1.kt"); + } + + @TestMetadata("destructuringWithUnderscore.kt") + public void testDestructuringWithUnderscore() throws Exception { + runTest("compiler/testData/ir/irText/expressions/destructuringWithUnderscore.kt"); + } + + @TestMetadata("dotQualified.kt") + public void testDotQualified() throws Exception { + runTest("compiler/testData/ir/irText/expressions/dotQualified.kt"); + } + + @TestMetadata("elvis.kt") + public void testElvis() throws Exception { + runTest("compiler/testData/ir/irText/expressions/elvis.kt"); + } + + @TestMetadata("enumEntryAsReceiver.kt") + public void testEnumEntryAsReceiver() throws Exception { + runTest("compiler/testData/ir/irText/expressions/enumEntryAsReceiver.kt"); + } + + @TestMetadata("enumEntryReferenceFromEnumEntryClass.kt") + public void testEnumEntryReferenceFromEnumEntryClass() throws Exception { + runTest("compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.kt"); + } + + @TestMetadata("equality.kt") + public void testEquality() throws Exception { + runTest("compiler/testData/ir/irText/expressions/equality.kt"); + } + + @TestMetadata("extFunInvokeAsFun.kt") + public void testExtFunInvokeAsFun() throws Exception { + runTest("compiler/testData/ir/irText/expressions/extFunInvokeAsFun.kt"); + } + + @TestMetadata("extFunSafeInvoke.kt") + public void testExtFunSafeInvoke() throws Exception { + runTest("compiler/testData/ir/irText/expressions/extFunSafeInvoke.kt"); + } + + @TestMetadata("extensionPropertyGetterCall.kt") + public void testExtensionPropertyGetterCall() throws Exception { + runTest("compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.kt"); + } + + @TestMetadata("field.kt") + public void testField() throws Exception { + runTest("compiler/testData/ir/irText/expressions/field.kt"); + } + + @TestMetadata("for.kt") + public void testFor() throws Exception { + runTest("compiler/testData/ir/irText/expressions/for.kt"); + } + + @TestMetadata("forWithBreakContinue.kt") + public void testForWithBreakContinue() throws Exception { + runTest("compiler/testData/ir/irText/expressions/forWithBreakContinue.kt"); + } + + @TestMetadata("forWithImplicitReceivers.kt") + public void testForWithImplicitReceivers() throws Exception { + runTest("compiler/testData/ir/irText/expressions/forWithImplicitReceivers.kt"); + } + + @TestMetadata("funImportedFromObject.kt") + public void testFunImportedFromObject() throws Exception { + runTest("compiler/testData/ir/irText/expressions/funImportedFromObject.kt"); + } + + @TestMetadata("genericPropertyCall.kt") + public void testGenericPropertyCall() throws Exception { + runTest("compiler/testData/ir/irText/expressions/genericPropertyCall.kt"); + } + + @TestMetadata("genericPropertyRef.kt") + public void testGenericPropertyRef() throws Exception { + runTest("compiler/testData/ir/irText/expressions/genericPropertyRef.kt"); + } + + @TestMetadata("identity.kt") + public void testIdentity() throws Exception { + runTest("compiler/testData/ir/irText/expressions/identity.kt"); + } + + @TestMetadata("ifElseIf.kt") + public void testIfElseIf() throws Exception { + runTest("compiler/testData/ir/irText/expressions/ifElseIf.kt"); + } + + @TestMetadata("implicitCastInReturnFromConstructor.kt") + public void testImplicitCastInReturnFromConstructor() throws Exception { + runTest("compiler/testData/ir/irText/expressions/implicitCastInReturnFromConstructor.kt"); + } + + @TestMetadata("implicitCastOnPlatformType.kt") + public void testImplicitCastOnPlatformType() throws Exception { + runTest("compiler/testData/ir/irText/expressions/implicitCastOnPlatformType.kt"); + } + + @TestMetadata("implicitCastToNonNull.kt") + public void testImplicitCastToNonNull() throws Exception { + runTest("compiler/testData/ir/irText/expressions/implicitCastToNonNull.kt"); + } + + @TestMetadata("implicitCastToTypeParameter.kt") + public void testImplicitCastToTypeParameter() throws Exception { + runTest("compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.kt"); + } + + @TestMetadata("in.kt") + public void testIn() throws Exception { + runTest("compiler/testData/ir/irText/expressions/in.kt"); + } + + @TestMetadata("incrementDecrement.kt") + public void testIncrementDecrement() throws Exception { + runTest("compiler/testData/ir/irText/expressions/incrementDecrement.kt"); + } + + @TestMetadata("interfaceThisRef.kt") + public void testInterfaceThisRef() throws Exception { + runTest("compiler/testData/ir/irText/expressions/interfaceThisRef.kt"); + } + + @TestMetadata("javaSyntheticPropertyAccess.kt") + public void testJavaSyntheticPropertyAccess() throws Exception { + runTest("compiler/testData/ir/irText/expressions/javaSyntheticPropertyAccess.kt"); + } + + @TestMetadata("jvmInstanceFieldReference.kt") + public void testJvmInstanceFieldReference() throws Exception { + runTest("compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.kt"); + } + + @TestMetadata("jvmStaticFieldReference.kt") + public void testJvmStaticFieldReference() throws Exception { + runTest("compiler/testData/ir/irText/expressions/jvmStaticFieldReference.kt"); + } + + @TestMetadata("kt16904.kt") + public void testKt16904() throws Exception { + runTest("compiler/testData/ir/irText/expressions/kt16904.kt"); + } + + @TestMetadata("kt16905.kt") + public void testKt16905() throws Exception { + runTest("compiler/testData/ir/irText/expressions/kt16905.kt"); + } + + @TestMetadata("kt23030.kt") + public void testKt23030() throws Exception { + runTest("compiler/testData/ir/irText/expressions/kt23030.kt"); + } + + @TestMetadata("kt24804.kt") + public void testKt24804() throws Exception { + runTest("compiler/testData/ir/irText/expressions/kt24804.kt"); + } + + @TestMetadata("kt27933.kt") + public void testKt27933() throws Exception { + runTest("compiler/testData/ir/irText/expressions/kt27933.kt"); + } + + @TestMetadata("kt28006.kt") + public void testKt28006() throws Exception { + runTest("compiler/testData/ir/irText/expressions/kt28006.kt"); + } + + @TestMetadata("kt28456.kt") + public void testKt28456() throws Exception { + runTest("compiler/testData/ir/irText/expressions/kt28456.kt"); + } + + @TestMetadata("kt28456a.kt") + public void testKt28456a() throws Exception { + runTest("compiler/testData/ir/irText/expressions/kt28456a.kt"); + } + + @TestMetadata("kt28456b.kt") + public void testKt28456b() throws Exception { + runTest("compiler/testData/ir/irText/expressions/kt28456b.kt"); + } + + @TestMetadata("kt30020.kt") + public void testKt30020() throws Exception { + runTest("compiler/testData/ir/irText/expressions/kt30020.kt"); + } + + @TestMetadata("lambdaInCAO.kt") + public void testLambdaInCAO() throws Exception { + runTest("compiler/testData/ir/irText/expressions/lambdaInCAO.kt"); + } + + @TestMetadata("literals.kt") + public void testLiterals() throws Exception { + runTest("compiler/testData/ir/irText/expressions/literals.kt"); + } + + @TestMetadata("memberTypeArguments.kt") + public void testMemberTypeArguments() throws Exception { + runTest("compiler/testData/ir/irText/expressions/memberTypeArguments.kt"); + } + + @TestMetadata("membersImportedFromObject.kt") + public void testMembersImportedFromObject() throws Exception { + runTest("compiler/testData/ir/irText/expressions/membersImportedFromObject.kt"); + } + + @TestMetadata("multipleThisReferences.kt") + public void testMultipleThisReferences() throws Exception { + runTest("compiler/testData/ir/irText/expressions/multipleThisReferences.kt"); + } + + @TestMetadata("objectAsCallable.kt") + public void testObjectAsCallable() throws Exception { + runTest("compiler/testData/ir/irText/expressions/objectAsCallable.kt"); + } + + @TestMetadata("objectClassReference.kt") + public void testObjectClassReference() throws Exception { + runTest("compiler/testData/ir/irText/expressions/objectClassReference.kt"); + } + + @TestMetadata("objectReference.kt") + public void testObjectReference() throws Exception { + runTest("compiler/testData/ir/irText/expressions/objectReference.kt"); + } + + @TestMetadata("objectReferenceInClosureInSuperConstructorCall.kt") + public void testObjectReferenceInClosureInSuperConstructorCall() throws Exception { + runTest("compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.kt"); + } + + @TestMetadata("objectReferenceInFieldInitializer.kt") + public void testObjectReferenceInFieldInitializer() throws Exception { + runTest("compiler/testData/ir/irText/expressions/objectReferenceInFieldInitializer.kt"); + } + + @TestMetadata("outerClassInstanceReference.kt") + public void testOuterClassInstanceReference() throws Exception { + runTest("compiler/testData/ir/irText/expressions/outerClassInstanceReference.kt"); + } + + @TestMetadata("primitiveComparisons.kt") + public void testPrimitiveComparisons() throws Exception { + runTest("compiler/testData/ir/irText/expressions/primitiveComparisons.kt"); + } + + @TestMetadata("primitivesImplicitConversions.kt") + public void testPrimitivesImplicitConversions() throws Exception { + runTest("compiler/testData/ir/irText/expressions/primitivesImplicitConversions.kt"); + } + + @TestMetadata("propertyReferences.kt") + public void testPropertyReferences() throws Exception { + runTest("compiler/testData/ir/irText/expressions/propertyReferences.kt"); + } + + @TestMetadata("references.kt") + public void testReferences() throws Exception { + runTest("compiler/testData/ir/irText/expressions/references.kt"); + } + + @TestMetadata("reflectionLiterals.kt") + public void testReflectionLiterals() throws Exception { + runTest("compiler/testData/ir/irText/expressions/reflectionLiterals.kt"); + } + + @TestMetadata("safeAssignment.kt") + public void testSafeAssignment() throws Exception { + runTest("compiler/testData/ir/irText/expressions/safeAssignment.kt"); + } + + @TestMetadata("safeCallWithIncrementDecrement.kt") + public void testSafeCallWithIncrementDecrement() throws Exception { + runTest("compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.kt"); + } + + @TestMetadata("safeCalls.kt") + public void testSafeCalls() throws Exception { + runTest("compiler/testData/ir/irText/expressions/safeCalls.kt"); + } + + @TestMetadata("setFieldWithImplicitCast.kt") + public void testSetFieldWithImplicitCast() throws Exception { + runTest("compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.kt"); + } + + @TestMetadata("signedToUnsignedConversions.kt") + public void testSignedToUnsignedConversions() throws Exception { + runTest("compiler/testData/ir/irText/expressions/signedToUnsignedConversions.kt"); + } + + @TestMetadata("simpleOperators.kt") + public void testSimpleOperators() throws Exception { + runTest("compiler/testData/ir/irText/expressions/simpleOperators.kt"); + } + + @TestMetadata("simpleUnaryOperators.kt") + public void testSimpleUnaryOperators() throws Exception { + runTest("compiler/testData/ir/irText/expressions/simpleUnaryOperators.kt"); + } + + @TestMetadata("smartCasts.kt") + public void testSmartCasts() throws Exception { + runTest("compiler/testData/ir/irText/expressions/smartCasts.kt"); + } + + @TestMetadata("smartCastsWithDestructuring.kt") + public void testSmartCastsWithDestructuring() throws Exception { + runTest("compiler/testData/ir/irText/expressions/smartCastsWithDestructuring.kt"); + } + + @TestMetadata("specializedTypeAliasConstructorCall.kt") + public void testSpecializedTypeAliasConstructorCall() throws Exception { + runTest("compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.kt"); + } + + @TestMetadata("stringComparisons.kt") + public void testStringComparisons() throws Exception { + runTest("compiler/testData/ir/irText/expressions/stringComparisons.kt"); + } + + @TestMetadata("stringPlus.kt") + public void testStringPlus() throws Exception { + runTest("compiler/testData/ir/irText/expressions/stringPlus.kt"); + } + + @TestMetadata("stringTemplates.kt") + public void testStringTemplates() throws Exception { + runTest("compiler/testData/ir/irText/expressions/stringTemplates.kt"); + } + + @TestMetadata("temporaryInEnumEntryInitializer.kt") + public void testTemporaryInEnumEntryInitializer() throws Exception { + runTest("compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.kt"); + } + + @TestMetadata("temporaryInInitBlock.kt") + public void testTemporaryInInitBlock() throws Exception { + runTest("compiler/testData/ir/irText/expressions/temporaryInInitBlock.kt"); + } + + @TestMetadata("thisOfGenericOuterClass.kt") + public void testThisOfGenericOuterClass() throws Exception { + runTest("compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.kt"); + } + + @TestMetadata("thisReferenceBeforeClassDeclared.kt") + public void testThisReferenceBeforeClassDeclared() throws Exception { + runTest("compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.kt"); + } + + @TestMetadata("throw.kt") + public void testThrow() throws Exception { + runTest("compiler/testData/ir/irText/expressions/throw.kt"); + } + + @TestMetadata("tryCatch.kt") + public void testTryCatch() throws Exception { + runTest("compiler/testData/ir/irText/expressions/tryCatch.kt"); + } + + @TestMetadata("tryCatchWithImplicitCast.kt") + public void testTryCatchWithImplicitCast() throws Exception { + runTest("compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.kt"); + } + + @TestMetadata("typeArguments.kt") + public void testTypeArguments() throws Exception { + runTest("compiler/testData/ir/irText/expressions/typeArguments.kt"); + } + + @TestMetadata("typeOperators.kt") + public void testTypeOperators() throws Exception { + runTest("compiler/testData/ir/irText/expressions/typeOperators.kt"); + } + + @TestMetadata("typeParameterClassLiteral.kt") + public void testTypeParameterClassLiteral() throws Exception { + runTest("compiler/testData/ir/irText/expressions/typeParameterClassLiteral.kt"); + } + + @TestMetadata("unsignedIntegerLiterals.kt") + public void testUnsignedIntegerLiterals() throws Exception { + runTest("compiler/testData/ir/irText/expressions/unsignedIntegerLiterals.kt"); + } + + @TestMetadata("useImportedMember.kt") + public void testUseImportedMember() throws Exception { + runTest("compiler/testData/ir/irText/expressions/useImportedMember.kt"); + } + + @TestMetadata("values.kt") + public void testValues() throws Exception { + runTest("compiler/testData/ir/irText/expressions/values.kt"); + } + + @TestMetadata("vararg.kt") + public void testVararg() throws Exception { + runTest("compiler/testData/ir/irText/expressions/vararg.kt"); + } + + @TestMetadata("varargWithImplicitCast.kt") + public void testVarargWithImplicitCast() throws Exception { + runTest("compiler/testData/ir/irText/expressions/varargWithImplicitCast.kt"); + } + + @TestMetadata("variableAsFunctionCall.kt") + public void testVariableAsFunctionCall() throws Exception { + runTest("compiler/testData/ir/irText/expressions/variableAsFunctionCall.kt"); + } + + @TestMetadata("variableAsFunctionCallWithGenerics.kt") + public void testVariableAsFunctionCallWithGenerics() throws Exception { + runTest("compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.kt"); + } + + @TestMetadata("when.kt") + public void testWhen() throws Exception { + runTest("compiler/testData/ir/irText/expressions/when.kt"); + } + + @TestMetadata("whenCoercedToUnit.kt") + public void testWhenCoercedToUnit() throws Exception { + runTest("compiler/testData/ir/irText/expressions/whenCoercedToUnit.kt"); + } + + @TestMetadata("whenElse.kt") + public void testWhenElse() throws Exception { + runTest("compiler/testData/ir/irText/expressions/whenElse.kt"); + } + + @TestMetadata("whenReturn.kt") + public void testWhenReturn() throws Exception { + runTest("compiler/testData/ir/irText/expressions/whenReturn.kt"); + } + + @TestMetadata("whenWithSubjectVariable.kt") + public void testWhenWithSubjectVariable() throws Exception { + runTest("compiler/testData/ir/irText/expressions/whenWithSubjectVariable.kt"); + } + + @TestMetadata("whileDoWhile.kt") + public void testWhileDoWhile() throws Exception { + runTest("compiler/testData/ir/irText/expressions/whileDoWhile.kt"); + } + + @TestMetadata("compiler/testData/ir/irText/expressions/floatingPointComparisons") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class FloatingPointComparisons extends AbstractFir2IrTextTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInFloatingPointComparisons() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/ir/irText/expressions/floatingPointComparisons"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("comparableWithDoubleOrFloat.kt") + public void testComparableWithDoubleOrFloat() throws Exception { + runTest("compiler/testData/ir/irText/expressions/floatingPointComparisons/comparableWithDoubleOrFloat.kt"); + } + + @TestMetadata("eqeqRhsConditionPossiblyAffectingLhs.kt") + public void testEqeqRhsConditionPossiblyAffectingLhs() throws Exception { + runTest("compiler/testData/ir/irText/expressions/floatingPointComparisons/eqeqRhsConditionPossiblyAffectingLhs.kt"); + } + + @TestMetadata("floatingPointCompareTo.kt") + public void testFloatingPointCompareTo() throws Exception { + runTest("compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.kt"); + } + + @TestMetadata("floatingPointEqeq.kt") + public void testFloatingPointEqeq() throws Exception { + runTest("compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.kt"); + } + + @TestMetadata("floatingPointEquals.kt") + public void testFloatingPointEquals() throws Exception { + runTest("compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.kt"); + } + + @TestMetadata("floatingPointExcleq.kt") + public void testFloatingPointExcleq() throws Exception { + runTest("compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.kt"); + } + + @TestMetadata("floatingPointLess.kt") + public void testFloatingPointLess() throws Exception { + runTest("compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointLess.kt"); + } + + @TestMetadata("nullableAnyAsIntToDouble.kt") + public void testNullableAnyAsIntToDouble() throws Exception { + runTest("compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableAnyAsIntToDouble.kt"); + } + + @TestMetadata("nullableFloatingPointEqeq.kt") + public void testNullableFloatingPointEqeq() throws Exception { + runTest("compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableFloatingPointEqeq.kt"); + } + + @TestMetadata("typeParameterWithPrimitiveNumericSupertype.kt") + public void testTypeParameterWithPrimitiveNumericSupertype() throws Exception { + runTest("compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.kt"); + } + + @TestMetadata("whenByFloatingPoint.kt") + public void testWhenByFloatingPoint() throws Exception { + runTest("compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.kt"); + } + } + + @TestMetadata("compiler/testData/ir/irText/expressions/sam") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Sam extends AbstractFir2IrTextTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInSam() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/ir/irText/expressions/sam"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("samConstructors.kt") + public void testSamConstructors() throws Exception { + runTest("compiler/testData/ir/irText/expressions/sam/samConstructors.kt"); + } + + @TestMetadata("samConversions.kt") + public void testSamConversions() throws Exception { + runTest("compiler/testData/ir/irText/expressions/sam/samConversions.kt"); + } + + @TestMetadata("samConversionsWithSmartCasts.kt") + public void testSamConversionsWithSmartCasts() throws Exception { + runTest("compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.kt"); + } + + @TestMetadata("samOperators.kt") + public void testSamOperators() throws Exception { + runTest("compiler/testData/ir/irText/expressions/sam/samOperators.kt"); + } + } + } + + @TestMetadata("compiler/testData/ir/irText/lambdas") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Lambdas extends AbstractFir2IrTextTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInLambdas() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/ir/irText/lambdas"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("anonymousFunction.kt") + public void testAnonymousFunction() throws Exception { + runTest("compiler/testData/ir/irText/lambdas/anonymousFunction.kt"); + } + + @TestMetadata("destructuringInLambda.kt") + public void testDestructuringInLambda() throws Exception { + runTest("compiler/testData/ir/irText/lambdas/destructuringInLambda.kt"); + } + + @TestMetadata("extensionLambda.kt") + public void testExtensionLambda() throws Exception { + runTest("compiler/testData/ir/irText/lambdas/extensionLambda.kt"); + } + + @TestMetadata("justLambda.kt") + public void testJustLambda() throws Exception { + runTest("compiler/testData/ir/irText/lambdas/justLambda.kt"); + } + + @TestMetadata("localFunction.kt") + public void testLocalFunction() throws Exception { + runTest("compiler/testData/ir/irText/lambdas/localFunction.kt"); + } + + @TestMetadata("multipleImplicitReceivers.kt") + public void testMultipleImplicitReceivers() throws Exception { + runTest("compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.kt"); + } + + @TestMetadata("nonLocalReturn.kt") + public void testNonLocalReturn() throws Exception { + runTest("compiler/testData/ir/irText/lambdas/nonLocalReturn.kt"); + } + + @TestMetadata("samAdapter.kt") + public void testSamAdapter() throws Exception { + runTest("compiler/testData/ir/irText/lambdas/samAdapter.kt"); + } + } + + @TestMetadata("compiler/testData/ir/irText/regressions") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Regressions extends AbstractFir2IrTextTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInRegressions() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/ir/irText/regressions"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("coercionInLoop.kt") + public void testCoercionInLoop() throws Exception { + runTest("compiler/testData/ir/irText/regressions/coercionInLoop.kt"); + } + + @TestMetadata("integerCoercionToT.kt") + public void testIntegerCoercionToT() throws Exception { + runTest("compiler/testData/ir/irText/regressions/integerCoercionToT.kt"); + } + + @TestMetadata("kt24114.kt") + public void testKt24114() throws Exception { + runTest("compiler/testData/ir/irText/regressions/kt24114.kt"); + } + + @TestMetadata("typeAliasCtorForGenericClass.kt") + public void testTypeAliasCtorForGenericClass() throws Exception { + runTest("compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.kt"); + } + + @TestMetadata("compiler/testData/ir/irText/regressions/newInference") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NewInference extends AbstractFir2IrTextTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInNewInference() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/ir/irText/regressions/newInference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("fixationOrder1.kt") + public void testFixationOrder1() throws Exception { + runTest("compiler/testData/ir/irText/regressions/newInference/fixationOrder1.kt"); + } + } + } + + @TestMetadata("compiler/testData/ir/irText/singletons") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Singletons extends AbstractFir2IrTextTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInSingletons() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/ir/irText/singletons"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("companion.kt") + public void testCompanion() throws Exception { + runTest("compiler/testData/ir/irText/singletons/companion.kt"); + } + + @TestMetadata("enumEntry.kt") + public void testEnumEntry() throws Exception { + runTest("compiler/testData/ir/irText/singletons/enumEntry.kt"); + } + + @TestMetadata("object.kt") + public void testObject() throws Exception { + runTest("compiler/testData/ir/irText/singletons/object.kt"); + } + } + + @TestMetadata("compiler/testData/ir/irText/stubs") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Stubs extends AbstractFir2IrTextTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInStubs() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/ir/irText/stubs"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("builtinMap.kt") + public void testBuiltinMap() throws Exception { + runTest("compiler/testData/ir/irText/stubs/builtinMap.kt"); + } + + @TestMetadata("constFromBuiltins.kt") + public void testConstFromBuiltins() throws Exception { + runTest("compiler/testData/ir/irText/stubs/constFromBuiltins.kt"); + } + + @TestMetadata("genericClassInDifferentModule.kt") + public void testGenericClassInDifferentModule() throws Exception { + runTest("compiler/testData/ir/irText/stubs/genericClassInDifferentModule.kt"); + } + + @TestMetadata("javaConstructorWithTypeParameters.kt") + public void testJavaConstructorWithTypeParameters() throws Exception { + runTest("compiler/testData/ir/irText/stubs/javaConstructorWithTypeParameters.kt"); + } + + @TestMetadata("javaEnum.kt") + public void testJavaEnum() throws Exception { + runTest("compiler/testData/ir/irText/stubs/javaEnum.kt"); + } + + @TestMetadata("javaInnerClass.kt") + public void testJavaInnerClass() throws Exception { + runTest("compiler/testData/ir/irText/stubs/javaInnerClass.kt"); + } + + @TestMetadata("javaMethod.kt") + public void testJavaMethod() throws Exception { + runTest("compiler/testData/ir/irText/stubs/javaMethod.kt"); + } + + @TestMetadata("javaNestedClass.kt") + public void testJavaNestedClass() throws Exception { + runTest("compiler/testData/ir/irText/stubs/javaNestedClass.kt"); + } + + @TestMetadata("javaStaticMethod.kt") + public void testJavaStaticMethod() throws Exception { + runTest("compiler/testData/ir/irText/stubs/javaStaticMethod.kt"); + } + + @TestMetadata("javaSyntheticProperty.kt") + public void testJavaSyntheticProperty() throws Exception { + runTest("compiler/testData/ir/irText/stubs/javaSyntheticProperty.kt"); + } + + @TestMetadata("jdkClassSyntheticProperty.kt") + public void testJdkClassSyntheticProperty() throws Exception { + runTest("compiler/testData/ir/irText/stubs/jdkClassSyntheticProperty.kt"); + } + + @TestMetadata("kotlinInnerClass.kt") + public void testKotlinInnerClass() throws Exception { + runTest("compiler/testData/ir/irText/stubs/kotlinInnerClass.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/testData/ir/irText/stubs/simple.kt"); + } + } + + @TestMetadata("compiler/testData/ir/irText/types") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Types extends AbstractFir2IrTextTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInTypes() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/ir/irText/types"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("intersectionType1.kt") + public void testIntersectionType1() throws Exception { + runTest("compiler/testData/ir/irText/types/intersectionType1.kt"); + } + + @TestMetadata("intersectionType2.kt") + public void testIntersectionType2() throws Exception { + runTest("compiler/testData/ir/irText/types/intersectionType2.kt"); + } + + @TestMetadata("intersectionType3.kt") + public void testIntersectionType3() throws Exception { + runTest("compiler/testData/ir/irText/types/intersectionType3.kt"); + } + + @TestMetadata("localVariableOfIntersectionType.kt") + public void testLocalVariableOfIntersectionType() throws Exception { + runTest("compiler/testData/ir/irText/types/localVariableOfIntersectionType.kt"); + } + } +} diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirClassSubstitutionScope.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirClassSubstitutionScope.kt index 3ce72f03d16..c59eaf61070 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirClassSubstitutionScope.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirClassSubstitutionScope.kt @@ -90,7 +90,7 @@ class FirClassSubstitutionScope( override fun processFunctionsByName(name: Name, processor: (ConeFunctionSymbol) -> ProcessorAction): ProcessorAction { useSiteScope.processFunctionsByName(name) process@{ original -> - val function = fakeOverrides.getOrPut(original) { createFakeOverride(original, name) } + val function = fakeOverrides.getOrPut(original) { createFakeOverride(original) } processor(function as ConeFunctionSymbol) } @@ -104,10 +104,7 @@ class FirClassSubstitutionScope( private val typeCalculator by lazy { ReturnTypeCalculatorWithJump(session) } - private fun createFakeOverride( - original: ConeFunctionSymbol, - name: Name - ): FirFunctionSymbol { + private fun createFakeOverride(original: ConeFunctionSymbol): FirFunctionSymbol { val member = original.firUnsafe() if (member is FirConstructor) return original as FirFunctionSymbol // TODO: substitution for constructors @@ -123,32 +120,45 @@ class FirClassSubstitutionScope( it.returnTypeRef.coneTypeUnsafe().substitute() } - val symbol = FirFunctionSymbol(original.callableId, true) - with(member) { - // TODO: consider using here some light-weight functions instead of pseudo-real FirMemberFunctionImpl - // As second alternative, we can invent some light-weight kind of FirRegularClass - FirMemberFunctionImpl( - this@FirClassSubstitutionScope.session, - psi, - symbol, - name, - member.receiverTypeRef?.withReplacedConeType(this@FirClassSubstitutionScope.session, newReceiverType), - member.returnTypeRef.withReplacedConeType(this@FirClassSubstitutionScope.session, newReturnType) - ).apply { - status = member.status as FirDeclarationStatusImpl - valueParameters += member.valueParameters.zip(newParameterTypes) { valueParameter, newType -> - with(valueParameter) { - FirValueParameterImpl( - this@FirClassSubstitutionScope.session, psi, - name, this.returnTypeRef.withReplacedConeType(this@FirClassSubstitutionScope.session, newType), - defaultValue, isCrossinline, isNoinline, isVararg, - FirVariableSymbol(valueParameter.symbol.callableId) - ) + return createFakeOverride(session, member, original as FirFunctionSymbol, newReceiverType, newReturnType, newParameterTypes) + } + + companion object { + fun createFakeOverride( + session: FirSession, + baseFunction: FirNamedFunction, + baseSymbol: FirFunctionSymbol, + newReceiverType: ConeKotlinType? = null, + newReturnType: ConeKotlinType? = null, + newParameterTypes: List? = null + ): FirFunctionSymbol { + val symbol = FirFunctionSymbol(baseSymbol.callableId, true, baseSymbol) + with(baseFunction) { + // TODO: consider using here some light-weight functions instead of pseudo-real FirMemberFunctionImpl + // As second alternative, we can invent some light-weight kind of FirRegularClass + FirMemberFunctionImpl( + session, + psi, symbol, name, + baseFunction.receiverTypeRef?.withReplacedConeType(session, newReceiverType), + baseFunction.returnTypeRef.withReplacedConeType(session, newReturnType) + ).apply { + status = baseFunction.status as FirDeclarationStatusImpl + valueParameters += baseFunction.valueParameters.zip( + newParameterTypes ?: List(baseFunction.valueParameters.size) { null } + ) { valueParameter, newType -> + with(valueParameter) { + FirValueParameterImpl( + session, psi, + name, this.returnTypeRef.withReplacedConeType(session, newType), + defaultValue, isCrossinline, isNoinline, isVararg, + FirVariableSymbol(valueParameter.symbol.callableId) + ) + } } } } + return symbol } - return symbol } } diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirOperation.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirOperation.kt index 025208be7c0..7bf517b0521 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirOperation.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirOperation.kt @@ -41,5 +41,7 @@ enum class FirOperation(val operator: String = "???") { val BOOLEANS: Set = EnumSet.of( EQ, NOT_EQ, IDENTITY, NOT_IDENTITY, LT, GT, LT_EQ, GT_EQ, IS, NOT_IS ) + + val COMPARISONS: Set = EnumSet.of(LT, GT, LT_EQ, GT_EQ) } } \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/symbols/impl/FirFunctionSymbol.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/symbols/impl/FirFunctionSymbol.kt index f5ad16f5183..5994b65edac 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/symbols/impl/FirFunctionSymbol.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/symbols/impl/FirFunctionSymbol.kt @@ -11,7 +11,9 @@ import org.jetbrains.kotlin.fir.types.ConeKotlinType class FirFunctionSymbol( override val callableId: CallableId, - val isFakeOverride: Boolean = false + val isFakeOverride: Boolean = false, + // Actual for fake override only + val overriddenSymbol: FirFunctionSymbol? = null ) : ConeFunctionSymbol, FirCallableSymbol() { override val parameters: List get() = emptyList() diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/impl/FirImplicitBuiltinTypeRef.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/impl/FirImplicitBuiltinTypeRef.kt index 5bd88cfbf97..7373cf7ff42 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/impl/FirImplicitBuiltinTypeRef.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/impl/FirImplicitBuiltinTypeRef.kt @@ -57,3 +57,9 @@ class FirImplicitBooleanTypeRef( session: FirSession, psi: PsiElement? ) : FirImplicitBuiltinTypeRef(session, psi, StandardClassIds.Boolean) + +class FirImplicitNothingTypeRef( + session: FirSession, + psi: PsiElement? +) : FirImplicitBuiltinTypeRef(session, psi, StandardClassIds.Nothing) + diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/SymbolTable.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/SymbolTable.kt index 8eb483df15a..e42d653420a 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/SymbolTable.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/SymbolTable.kt @@ -413,12 +413,15 @@ open class SymbolTable : ReferenceSymbolTable { origin: IrDeclarationOrigin, descriptor: ParameterDescriptor, type: IrType, - varargElementType: IrType? = null + varargElementType: IrType? = null, + valueParameterFactory: (IrValueParameterSymbol) -> IrValueParameter = { + IrValueParameterImpl(startOffset, endOffset, origin, it, type, varargElementType) + } ): IrValueParameter = valueParameterSymbolTable.declareLocal( descriptor, { IrValueParameterSymbolImpl(descriptor) }, - { IrValueParameterImpl(startOffset, endOffset, origin, it, type, varargElementType) } + valueParameterFactory ) fun introduceValueParameter(irValueParameter: IrValueParameter) { @@ -442,12 +445,16 @@ open class SymbolTable : ReferenceSymbolTable { endOffset: Int, origin: IrDeclarationOrigin, descriptor: VariableDescriptor, - type: IrType + type: IrType, + variableFactory: (IrVariableSymbol) -> IrVariable = { + IrVariableImpl(startOffset, endOffset, origin, it, type) + } + ): IrVariable = variableSymbolTable.declareLocal( descriptor, { IrVariableSymbolImpl(descriptor) }, - { IrVariableImpl(startOffset, endOffset, origin, it, type) } + variableFactory ) fun declareVariable( diff --git a/compiler/testData/ir/irText/classes/abstractMembers.kt b/compiler/testData/ir/irText/classes/abstractMembers.kt index 933599e2d4b..03220b5e185 100644 --- a/compiler/testData/ir/irText/classes/abstractMembers.kt +++ b/compiler/testData/ir/irText/classes/abstractMembers.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL + abstract class AbstractClass { abstract fun abstractFun() abstract val abstractVal: Int diff --git a/compiler/testData/ir/irText/classes/annotationClasses.fir.txt b/compiler/testData/ir/irText/classes/annotationClasses.fir.txt new file mode 100644 index 00000000000..6ebc0530e0b --- /dev/null +++ b/compiler/testData/ir/irText/classes/annotationClasses.fir.txt @@ -0,0 +1,115 @@ +FILE fqName: fileName:/annotationClasses.kt + CLASS ANNOTATION_CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test1 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .Test1.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test2 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .Test2.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test2) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test2' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:Test3 modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test3 + CONSTRUCTOR visibility:public <> (x:.Test1) returnType:.Test3 [primary] + VALUE_PARAMETER name:x index:0 type:.Test1 + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:.Test1 visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: .Test1 declared in .Test3.' type=.Test1 origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test3) returnType:.Test1 + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test3 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .Test1 declared in .Test3' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:.Test1 visibility:public [final] ' type=.Test1 origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.' type=.Test3 origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:Test4 modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test4 + CONSTRUCTOR visibility:public <> (xs:kotlin.Int) returnType:.Test4 [primary] + VALUE_PARAMETER name:xs index:0 type:kotlin.Int + PROPERTY name:xs visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'xs: kotlin.Int declared in .Test4.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test4) returnType:kotlin.Int + correspondingProperty: PROPERTY name:xs visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test4 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test4' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test4 declared in .Test4.' type=.Test4 origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.fir.txt b/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.fir.txt new file mode 100644 index 00000000000..da560ab9146 --- /dev/null +++ b/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.fir.txt @@ -0,0 +1,96 @@ +FILE fqName: fileName:/argumentReorderingInDelegatingConstructorCall.kt + CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.Base [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .Base.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Base) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Base + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Base' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Base declared in .Base.' type=.Base origin=null + PROPERTY name:y visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'y: kotlin.Int declared in .Base.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Base) returnType:kotlin.Int + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Base + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Base' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Base declared in .Base.' type=.Base origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 + CONSTRUCTOR visibility:public <> (xx:kotlin.Int, yy:kotlin.Int) returnType:.Test1 [primary] + VALUE_PARAMETER name:xx index:0 type:kotlin.Int + VALUE_PARAMETER name:yy index:1 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int, y: kotlin.Int) [primary] declared in .Base' + x: GET_VAR 'yy: kotlin.Int declared in .Test1.' type=kotlin.Int origin=null + y: GET_VAR 'xx: kotlin.Int declared in .Test1.' type=kotlin.Int origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.Base]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 + CONSTRUCTOR visibility:public <> (xx:kotlin.Int, yy:kotlin.Int) returnType:.Test2 + VALUE_PARAMETER name:xx index:0 type:kotlin.Int + VALUE_PARAMETER name:yy index:1 type:kotlin.Int + BLOCK_BODY + ERROR_CALL 'Cannot find delegated constructor call' type=.Test2 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.Base]' + CONSTRUCTOR visibility:public <> (xxx:kotlin.Int, yyy:kotlin.Int, a:kotlin.Any) returnType:.Test2 + VALUE_PARAMETER name:xxx index:0 type:kotlin.Int + VALUE_PARAMETER name:yyy index:1 type:kotlin.Int + VALUE_PARAMETER name:a index:2 type:kotlin.Any + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (xx: kotlin.Int, yy: kotlin.Int) declared in .Test2' + xx: GET_VAR 'yyy: kotlin.Int declared in .Test2.' type=kotlin.Int origin=null + yy: GET_VAR 'xxx: kotlin.Int declared in .Test2.' type=kotlin.Int origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/classMembers.fir.txt b/compiler/testData/ir/irText/classes/classMembers.fir.txt new file mode 100644 index 00000000000..cb57f0a9271 --- /dev/null +++ b/compiler/testData/ir/irText/classes/classMembers.fir.txt @@ -0,0 +1,173 @@ +FILE fqName: fileName:/classMembers.kt + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int, z:kotlin.Int) returnType:.C [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int + VALUE_PARAMETER name:z index:2 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:y visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'y: kotlin.Int declared in .C.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + PROPERTY name:z visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Int visibility:public + EXPRESSION_BODY + GET_VAR 'z: kotlin.Int declared in .C.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:z visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:z visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Int visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null + CONSTRUCTOR visibility:public <> () returnType:.C + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int, y: kotlin.Int, z: kotlin.Int) [primary] declared in .C' + x: CONST Int type=kotlin.Int value=0 + y: CONST Int type=kotlin.Int value=0 + z: CONST Int type=kotlin.Int value=0 + PROPERTY name:property visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:property type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:property visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:property type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + PROPERTY name:propertyWithGet visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:propertyWithGet visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + CONST Int type=kotlin.Int value=42 + PROPERTY name:propertyWithGetAndSet visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:propertyWithGetAndSet visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=null + FUN name: visibility:public modality:FINAL <> ($this:.C, value:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:propertyWithGetAndSet visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: GET_VAR 'value: kotlin.Int declared in .C.' type=kotlin.Int origin=null + FUN name:function visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="1" + FUN name:memberExtensionFunction visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="2" + CLASS CLASS name:NestedClass modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.NestedClass + CONSTRUCTOR visibility:public <> () returnType:.C.NestedClass [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:NestedClass modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:function visibility:public modality:FINAL <> ($this:.C.NestedClass) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C.NestedClass + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="3" + FUN name:memberExtensionFunction visibility:public modality:FINAL <> ($this:.C.NestedClass) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C.NestedClass + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="4" + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:NestedInterface modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.NestedInterface + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.C.NestedInterface) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C.NestedInterface + FUN name:bar visibility:public modality:OPEN <> ($this:.C.NestedInterface) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C.NestedInterface + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.Unit declared in .C.NestedInterface' + CALL 'public abstract fun foo (): kotlin.Unit declared in .C.NestedInterface' type=kotlin.Unit origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.Companion + CONSTRUCTOR visibility:private <> () returnType:.C.Companion [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/classes.fir.txt b/compiler/testData/ir/irText/classes/classes.fir.txt new file mode 100644 index 00000000000..932775140da --- /dev/null +++ b/compiler/testData/ir/irText/classes/classes.fir.txt @@ -0,0 +1,98 @@ +FILE fqName: fileName:/classes.kt + CLASS CLASS name:TestClass modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestClass + CONSTRUCTOR visibility:public <> () returnType:.TestClass [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestClass modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:TestInterface modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInterface + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS OBJECT name:TestObject modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestObject + CONSTRUCTOR visibility:private <> () returnType:.TestObject [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:TestObject modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:TestAnnotationClass modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnnotationClass + CONSTRUCTOR visibility:public <> () returnType:.TestAnnotationClass [primary] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ENUM_CLASS name:TestEnumClass modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnumClass + CONSTRUCTOR visibility:private <> () returnType:.TestEnumClass [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnumClass modality:FINAL visibility:public superTypes:[kotlin.Enum]' + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum diff --git a/compiler/testData/ir/irText/classes/companionObject.kt b/compiler/testData/ir/irText/classes/companionObject.kt index d0484272732..5ef8fb1d0c0 100644 --- a/compiler/testData/ir/irText/classes/companionObject.kt +++ b/compiler/testData/ir/irText/classes/companionObject.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL + class Test1 { companion object } diff --git a/compiler/testData/ir/irText/classes/dataClassWithArrayMembers.fir.txt b/compiler/testData/ir/irText/classes/dataClassWithArrayMembers.fir.txt new file mode 100644 index 00000000000..ee72e6fc46c --- /dev/null +++ b/compiler/testData/ir/irText/classes/dataClassWithArrayMembers.fir.txt @@ -0,0 +1,191 @@ +FILE fqName: fileName:/dataClassWithArrayMembers.kt + CLASS CLASS name:Test1 modality:FINAL visibility:public [data] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 + CONSTRUCTOR visibility:public <> (stringArray:kotlin.Array, charArray:kotlin.CharArray, booleanArray:kotlin.BooleanArray, byteArray:kotlin.ByteArray, shortArray:kotlin.ShortArray, intArray:kotlin.IntArray, longArray:kotlin.LongArray, floatArray:kotlin.FloatArray, doubleArray:kotlin.DoubleArray) returnType:.Test1 [primary] + VALUE_PARAMETER name:stringArray index:0 type:kotlin.Array + VALUE_PARAMETER name:charArray index:1 type:kotlin.CharArray + VALUE_PARAMETER name:booleanArray index:2 type:kotlin.BooleanArray + VALUE_PARAMETER name:byteArray index:3 type:kotlin.ByteArray + VALUE_PARAMETER name:shortArray index:4 type:kotlin.ShortArray + VALUE_PARAMETER name:intArray index:5 type:kotlin.IntArray + VALUE_PARAMETER name:longArray index:6 type:kotlin.LongArray + VALUE_PARAMETER name:floatArray index:7 type:kotlin.FloatArray + VALUE_PARAMETER name:doubleArray index:8 type:kotlin.DoubleArray + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' + PROPERTY name:stringArray visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:stringArray type:kotlin.Array visibility:public [final] + EXPRESSION_BODY + GET_VAR 'stringArray: kotlin.Array declared in .Test1.' type=kotlin.Array origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.Array + correspondingProperty: PROPERTY name:stringArray visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array declared in .Test1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:stringArray type:kotlin.Array visibility:public [final] ' type=kotlin.Array origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + PROPERTY name:charArray visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:charArray type:kotlin.CharArray visibility:public [final] + EXPRESSION_BODY + GET_VAR 'charArray: kotlin.CharArray declared in .Test1.' type=kotlin.CharArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.CharArray + correspondingProperty: PROPERTY name:charArray visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.CharArray declared in .Test1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:charArray type:kotlin.CharArray visibility:public [final] ' type=kotlin.CharArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + PROPERTY name:booleanArray visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:booleanArray type:kotlin.BooleanArray visibility:public [final] + EXPRESSION_BODY + GET_VAR 'booleanArray: kotlin.BooleanArray declared in .Test1.' type=kotlin.BooleanArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.BooleanArray + correspondingProperty: PROPERTY name:booleanArray visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.BooleanArray declared in .Test1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:booleanArray type:kotlin.BooleanArray visibility:public [final] ' type=kotlin.BooleanArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + PROPERTY name:byteArray visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:byteArray type:kotlin.ByteArray visibility:public [final] + EXPRESSION_BODY + GET_VAR 'byteArray: kotlin.ByteArray declared in .Test1.' type=kotlin.ByteArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.ByteArray + correspondingProperty: PROPERTY name:byteArray visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.ByteArray declared in .Test1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:byteArray type:kotlin.ByteArray visibility:public [final] ' type=kotlin.ByteArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + PROPERTY name:shortArray visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:shortArray type:kotlin.ShortArray visibility:public [final] + EXPRESSION_BODY + GET_VAR 'shortArray: kotlin.ShortArray declared in .Test1.' type=kotlin.ShortArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.ShortArray + correspondingProperty: PROPERTY name:shortArray visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.ShortArray declared in .Test1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:shortArray type:kotlin.ShortArray visibility:public [final] ' type=kotlin.ShortArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + PROPERTY name:intArray visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:intArray type:kotlin.IntArray visibility:public [final] + EXPRESSION_BODY + GET_VAR 'intArray: kotlin.IntArray declared in .Test1.' type=kotlin.IntArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.IntArray + correspondingProperty: PROPERTY name:intArray visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.IntArray declared in .Test1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:intArray type:kotlin.IntArray visibility:public [final] ' type=kotlin.IntArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + PROPERTY name:longArray visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:longArray type:kotlin.LongArray visibility:public [final] + EXPRESSION_BODY + GET_VAR 'longArray: kotlin.LongArray declared in .Test1.' type=kotlin.LongArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.LongArray + correspondingProperty: PROPERTY name:longArray visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.LongArray declared in .Test1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:longArray type:kotlin.LongArray visibility:public [final] ' type=kotlin.LongArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + PROPERTY name:floatArray visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:floatArray type:kotlin.FloatArray visibility:public [final] + EXPRESSION_BODY + GET_VAR 'floatArray: kotlin.FloatArray declared in .Test1.' type=kotlin.FloatArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.FloatArray + correspondingProperty: PROPERTY name:floatArray visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.FloatArray declared in .Test1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:floatArray type:kotlin.FloatArray visibility:public [final] ' type=kotlin.FloatArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + PROPERTY name:doubleArray visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:doubleArray type:kotlin.DoubleArray visibility:public [final] + EXPRESSION_BODY + GET_VAR 'doubleArray: kotlin.DoubleArray declared in .Test1.' type=kotlin.DoubleArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.DoubleArray + correspondingProperty: PROPERTY name:doubleArray visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.DoubleArray declared in .Test1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:doubleArray type:kotlin.DoubleArray visibility:public [final] ' type=kotlin.DoubleArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test2 modality:FINAL visibility:public [data] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> (genericArray:kotlin.Array.Test2>) returnType:.Test2.Test2> [primary] + VALUE_PARAMETER name:genericArray index:0 type:kotlin.Array.Test2> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' + PROPERTY name:genericArray visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:genericArray type:kotlin.Array.Test2> visibility:public [final] + EXPRESSION_BODY + GET_VAR 'genericArray: kotlin.Array.Test2> declared in .Test2.' type=kotlin.Array.Test2> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test2) returnType:kotlin.Array.Test2> + correspondingProperty: PROPERTY name:genericArray visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array.Test2> declared in .Test2' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:genericArray type:kotlin.Array.Test2> visibility:public [final] ' type=kotlin.Array.Test2> origin=null + receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test3 modality:FINAL visibility:public [data] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test3 + CONSTRUCTOR visibility:public <> (anyArrayN:kotlin.Array?) returnType:.Test3 [primary] + VALUE_PARAMETER name:anyArrayN index:0 type:kotlin.Array? + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test3 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' + PROPERTY name:anyArrayN visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:anyArrayN type:kotlin.Array? visibility:public [final] + EXPRESSION_BODY + GET_VAR 'anyArrayN: kotlin.Array? declared in .Test3.' type=kotlin.Array? origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test3) returnType:kotlin.Array? + correspondingProperty: PROPERTY name:anyArrayN visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test3 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array? declared in .Test3' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anyArrayN type:kotlin.Array? visibility:public [final] ' type=kotlin.Array? origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.' type=.Test3 origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/dataClasses.fir.txt b/compiler/testData/ir/irText/classes/dataClasses.fir.txt new file mode 100644 index 00000000000..0c5b3286752 --- /dev/null +++ b/compiler/testData/ir/irText/classes/dataClasses.fir.txt @@ -0,0 +1,154 @@ +FILE fqName: fileName:/dataClasses.kt + CLASS CLASS name:Test1 modality:FINAL visibility:public [data] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.String, z:kotlin.Any) returnType:.Test1 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.String + VALUE_PARAMETER name:z index:2 type:kotlin.Any + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .Test1.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + PROPERTY name:y visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'y: kotlin.String declared in .Test1.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.String + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Test1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + PROPERTY name:z visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:public [final] + EXPRESSION_BODY + GET_VAR 'z: kotlin.Any declared in .Test1.' type=kotlin.Any origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.Any + correspondingProperty: PROPERTY name:z visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in .Test1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:public [final] ' type=kotlin.Any origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test2 modality:FINAL visibility:public [data] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 + CONSTRUCTOR visibility:public <> (x:kotlin.Any?) returnType:.Test2 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Any? + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any? visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Any? declared in .Test2.' type=kotlin.Any? origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test2) returnType:kotlin.Any? + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any? declared in .Test2' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any? visibility:public [final] ' type=kotlin.Any? origin=null + receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test3 modality:FINAL visibility:public [data] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test3 + CONSTRUCTOR visibility:public <> (d:kotlin.Double, dn:kotlin.Double?, f:kotlin.Float, df:kotlin.Float?) returnType:.Test3 [primary] + VALUE_PARAMETER name:d index:0 type:kotlin.Double + VALUE_PARAMETER name:dn index:1 type:kotlin.Double? + VALUE_PARAMETER name:f index:2 type:kotlin.Float + VALUE_PARAMETER name:df index:3 type:kotlin.Float? + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test3 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' + PROPERTY name:d visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:d type:kotlin.Double visibility:public [final] + EXPRESSION_BODY + GET_VAR 'd: kotlin.Double declared in .Test3.' type=kotlin.Double origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test3) returnType:kotlin.Double + correspondingProperty: PROPERTY name:d visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test3 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Double declared in .Test3' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:d type:kotlin.Double visibility:public [final] ' type=kotlin.Double origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.' type=.Test3 origin=null + PROPERTY name:dn visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:dn type:kotlin.Double? visibility:public [final] + EXPRESSION_BODY + GET_VAR 'dn: kotlin.Double? declared in .Test3.' type=kotlin.Double? origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test3) returnType:kotlin.Double? + correspondingProperty: PROPERTY name:dn visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test3 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Double? declared in .Test3' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:dn type:kotlin.Double? visibility:public [final] ' type=kotlin.Double? origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.' type=.Test3 origin=null + PROPERTY name:f visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:f type:kotlin.Float visibility:public [final] + EXPRESSION_BODY + GET_VAR 'f: kotlin.Float declared in .Test3.' type=kotlin.Float origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test3) returnType:kotlin.Float + correspondingProperty: PROPERTY name:f visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test3 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Float declared in .Test3' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:f type:kotlin.Float visibility:public [final] ' type=kotlin.Float origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.' type=.Test3 origin=null + PROPERTY name:df visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:df type:kotlin.Float? visibility:public [final] + EXPRESSION_BODY + GET_VAR 'df: kotlin.Float? declared in .Test3.' type=kotlin.Float? origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test3) returnType:kotlin.Float? + correspondingProperty: PROPERTY name:df visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test3 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Float? declared in .Test3' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:df type:kotlin.Float? visibility:public [final] ' type=kotlin.Float? origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.' type=.Test3 origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/dataClassesGeneric.fir.txt b/compiler/testData/ir/irText/classes/dataClassesGeneric.fir.txt new file mode 100644 index 00000000000..62222f6dd0b --- /dev/null +++ b/compiler/testData/ir/irText/classes/dataClassesGeneric.fir.txt @@ -0,0 +1,128 @@ +FILE fqName: fileName:/dataClassesGeneric.kt + CLASS CLASS name:Test1 modality:FINAL visibility:public [data] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> (x:T of .Test1) returnType:.Test1.Test1> [primary] + VALUE_PARAMETER name:x index:0 type:T of .Test1 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test1 visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: T of .Test1 declared in .Test1.' type=T of .Test1 origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:T of .Test1 + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of .Test1 declared in .Test1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test1 visibility:public [final] ' type=T of .Test1 origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test2 modality:FINAL visibility:public [data] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> (x:T of .Test2) returnType:.Test2.Test2> [primary] + VALUE_PARAMETER name:x index:0 type:T of .Test2 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test2 visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: T of .Test2 declared in .Test2.' type=T of .Test2 origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test2) returnType:T of .Test2 + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of .Test2 declared in .Test2' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test2 visibility:public [final] ' type=T of .Test2 origin=null + receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test3 modality:FINAL visibility:public [data] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test3 + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> (x:kotlin.collections.List.Test3>) returnType:.Test3.Test3> [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.collections.List.Test3> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test3 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.collections.List.Test3> visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.collections.List.Test3> declared in .Test3.' type=kotlin.collections.List.Test3> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test3) returnType:kotlin.collections.List.Test3> + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test3 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.collections.List.Test3> declared in .Test3' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.collections.List.Test3> visibility:public [final] ' type=kotlin.collections.List.Test3> origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.' type=.Test3 origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test4 modality:FINAL visibility:public [data] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test4 + CONSTRUCTOR visibility:public <> (x:kotlin.collections.List) returnType:.Test4 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.collections.List + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test4 modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.collections.List visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.collections.List declared in .Test4.' type=kotlin.collections.List origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test4) returnType:kotlin.collections.List + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test4 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.collections.List declared in .Test4' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.collections.List visibility:public [final] ' type=kotlin.collections.List origin=null + receiver: GET_VAR ': .Test4 declared in .Test4.' type=.Test4 origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt new file mode 100644 index 00000000000..a52b62c3853 --- /dev/null +++ b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt @@ -0,0 +1,169 @@ +FILE fqName: fileName:/delegatedImplementation.kt + CLASS INTERFACE name:IBase modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IBase + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IBase, x:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IBase + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:s index:1 type:kotlin.String + FUN name:bar visibility:public modality:ABSTRACT <> ($this:.IBase) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.IBase + FUN name:qux visibility:public modality:ABSTRACT <> ($this:.IBase) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IBase + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS OBJECT name:BaseImpl modality:FINAL visibility:public superTypes:[.IBase] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BaseImpl + CONSTRUCTOR visibility:private <> () returnType:.BaseImpl [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:BaseImpl modality:FINAL visibility:public superTypes:[.IBase]' + FUN name:foo visibility:public modality:FINAL <> ($this:.BaseImpl, x:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.BaseImpl + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:s index:1 type:kotlin.String + BLOCK_BODY + FUN name:bar visibility:public modality:FINAL <> ($this:.BaseImpl) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.BaseImpl + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun bar (): kotlin.Int declared in .BaseImpl' + CONST Int type=kotlin.Int value=42 + FUN name:qux visibility:public modality:FINAL <> ($this:.BaseImpl) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.BaseImpl + BLOCK_BODY + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:IOther modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IOther + PROPERTY name:x visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.IOther + PROPERTY name:y visibility:public modality:ABSTRACT [var] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther) returnType:kotlin.Int + correspondingProperty: PROPERTY name:y visibility:public modality:ABSTRACT [var] + $this: VALUE_PARAMETER name: type:.IOther + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:y visibility:public modality:ABSTRACT [var] + $this: VALUE_PARAMETER name: type:.IOther + VALUE_PARAMETER name: index:0 type:kotlin.Int + PROPERTY name:z1 visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther) returnType:kotlin.Int + correspondingProperty: PROPERTY name:z1 visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.IOther + PROPERTY name:z2 visibility:public modality:ABSTRACT [var] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther) returnType:kotlin.Int + correspondingProperty: PROPERTY name:z2 visibility:public modality:ABSTRACT [var] + $this: VALUE_PARAMETER name: type:.IOther + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:z2 visibility:public modality:ABSTRACT [var] + $this: VALUE_PARAMETER name: type:.IOther + VALUE_PARAMETER name: index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:otherImpl visibility:public modality:FINAL <> (x0:kotlin.String, y0:kotlin.Int) returnType:.IOther + VALUE_PARAMETER name:x0 index:0 type:kotlin.String + VALUE_PARAMETER name:y0 index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun otherImpl (x0: kotlin.String, y0: kotlin.Int): .IOther declared in ' + BLOCK type=.otherImpl. origin=OBJECT_LITERAL + CLASS OBJECT name: modality:FINAL visibility:local superTypes:[.IOther] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.otherImpl. + CONSTRUCTOR visibility:private <> () returnType:IrErrorType [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name: modality:FINAL visibility:local superTypes:[.IOther]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x0: kotlin.String declared in .otherImpl' type=kotlin.String origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.otherImpl.) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.otherImpl. + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .otherImpl.' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .otherImpl. declared in .otherImpl..' type=.otherImpl. origin=null + PROPERTY name:y visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public + EXPRESSION_BODY + GET_VAR 'y0: kotlin.Int declared in .otherImpl' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.otherImpl.) returnType:kotlin.Int + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.otherImpl. + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .otherImpl.' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .otherImpl. declared in .otherImpl..' type=.otherImpl. origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.otherImpl., :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.otherImpl. + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .otherImpl. declared in .otherImpl..' type=.otherImpl. origin=null + value: GET_VAR ': kotlin.Int declared in .otherImpl..' type=kotlin.Int origin=null + PROPERTY name:z1 visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.otherImpl.) returnType:kotlin.Int + correspondingProperty: PROPERTY name:z1 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.otherImpl. + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .otherImpl.' + CONST Int type=kotlin.Int value=1 + PROPERTY name:z2 visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> ($this:.otherImpl.) returnType:kotlin.Int + correspondingProperty: PROPERTY name:z2 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.otherImpl. + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .otherImpl.' + CONST Int type=kotlin.Int value=2 + FUN name: visibility:public modality:FINAL <> ($this:.otherImpl., value:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:z2 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.otherImpl. + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY + CALL 'private constructor () [primary] declared in .otherImpl.' type=.otherImpl. origin=null + CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 + CONSTRUCTOR visibility:public <> () returnType:.Test1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[]' + CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 + CONSTRUCTOR visibility:public <> () returnType:.Test2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[]' diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.txt b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.txt new file mode 100644 index 00000000000..863ba4cf395 --- /dev/null +++ b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.txt @@ -0,0 +1,54 @@ +FILE fqName: fileName:/delegatedImplementationWithExplicitOverride.kt + CLASS INTERFACE name:IFooBar modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFooBar + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFooBar) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IFooBar + FUN name:bar visibility:public modality:ABSTRACT <> ($this:.IFooBar) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IFooBar + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS OBJECT name:FooBarImpl modality:FINAL visibility:public superTypes:[.IFooBar] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FooBarImpl + CONSTRUCTOR visibility:private <> () returnType:.FooBarImpl [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:FooBarImpl modality:FINAL visibility:public superTypes:[.IFooBar]' + FUN name:foo visibility:public modality:FINAL <> ($this:.FooBarImpl) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.FooBarImpl + BLOCK_BODY + FUN name:bar visibility:public modality:FINAL <> ($this:.FooBarImpl) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.FooBarImpl + BLOCK_BODY + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[]' + FUN name:bar visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY diff --git a/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.fir.txt b/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.fir.txt new file mode 100644 index 00000000000..41296ffd7cf --- /dev/null +++ b/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.fir.txt @@ -0,0 +1,73 @@ +FILE fqName: fileName:/delegatingConstructorCallToTypeAliasConstructor.kt + CLASS CLASS name:Cell modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Cell + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> (value:T of .Cell) returnType:.Cell.Cell> [primary] + VALUE_PARAMETER name:value index:0 type:T of .Cell + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Cell modality:OPEN visibility:public superTypes:[kotlin.Any]' + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:T of .Cell visibility:public [final] + EXPRESSION_BODY + GET_VAR 'value: T of .Cell declared in .Cell.' type=T of .Cell origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Cell) returnType:T of .Cell + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Cell + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of .Cell declared in .Cell' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Cell visibility:public [final] ' type=T of .Cell origin=null + receiver: GET_VAR ': .Cell declared in .Cell.' type=.Cell origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:C1 modality:FINAL visibility:public superTypes:[.Cell] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C1 + CONSTRUCTOR visibility:public <> () returnType:.C1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (value: T of .Cell) [primary] declared in .Cell' + value: CONST String type=kotlin.String value="O" + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C1 modality:FINAL visibility:public superTypes:[.Cell]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:C2 modality:FINAL visibility:public superTypes:[.Cell] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C2 + CONSTRUCTOR visibility:public <> () returnType:.C2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (value: T of .Cell) [primary] declared in .Cell' + value: CONST String type=kotlin.String value="K" + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C2 modality:FINAL visibility:public superTypes:[.Cell]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/delegatingConstructorCallsInSecondaryConstructors.fir.txt b/compiler/testData/ir/irText/classes/delegatingConstructorCallsInSecondaryConstructors.fir.txt new file mode 100644 index 00000000000..70f3c932fe1 --- /dev/null +++ b/compiler/testData/ir/irText/classes/delegatingConstructorCallsInSecondaryConstructors.fir.txt @@ -0,0 +1,48 @@ +FILE fqName: fileName:/delegatingConstructorCallsInSecondaryConstructors.kt + CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base + CONSTRUCTOR visibility:public <> () returnType:.Base [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test + CONSTRUCTOR visibility:public <> () returnType:.Test + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[.Base]' + CONSTRUCTOR visibility:public <> (xx:kotlin.Int) returnType:.Test + VALUE_PARAMETER name:xx index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[.Base]' + CONSTRUCTOR visibility:public <> (xx:kotlin.Short) returnType:.Test + VALUE_PARAMETER name:xx index:0 type:kotlin.Short + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Test' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/enum.fir.txt b/compiler/testData/ir/irText/classes/enum.fir.txt new file mode 100644 index 00000000000..3e72a19676d --- /dev/null +++ b/compiler/testData/ir/irText/classes/enum.fir.txt @@ -0,0 +1,489 @@ +FILE fqName: fileName:/enum.kt + CLASS ENUM_CLASS name:TestEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum1 + CONSTRUCTOR visibility:private <> () returnType:.TestEnum1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum]' + CLASS ENUM_ENTRY name:TEST1 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum1.TEST1 + CONSTRUCTOR visibility:public <> () returnType:.TestEnum1.TEST1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST1 modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum1.TEST2 + CONSTRUCTOR visibility:public <> () returnType:.TestEnum1.TEST2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + CLASS ENUM_CLASS name:TestEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum2 + CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestEnum2 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .TestEnum2.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestEnum2) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestEnum2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestEnum2' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .TestEnum2 declared in .TestEnum2.' type=.TestEnum2 origin=null + CLASS ENUM_ENTRY name:TEST1 modality:FINAL visibility:public superTypes:[.TestEnum2] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum2.TEST1 + CONSTRUCTOR visibility:public <> () returnType:.TestEnum2.TEST1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestEnum2' + x: CONST Int type=kotlin.Int value=1 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST1 modality:FINAL visibility:public superTypes:[.TestEnum2]' + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:public superTypes:[.TestEnum2] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum2.TEST2 + CONSTRUCTOR visibility:public <> () returnType:.TestEnum2.TEST2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestEnum2' + x: CONST Int type=kotlin.Int value=2 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:public superTypes:[.TestEnum2]' + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + CLASS ENUM_ENTRY name:TEST3 modality:FINAL visibility:public superTypes:[.TestEnum2] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum2.TEST3 + CONSTRUCTOR visibility:public <> () returnType:.TestEnum2.TEST3 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestEnum2' + x: CONST Int type=kotlin.Int value=3 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST3 modality:FINAL visibility:public superTypes:[.TestEnum2]' + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + CLASS ENUM_CLASS name:TestEnum3 modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum3 + CONSTRUCTOR visibility:private <> () returnType:.TestEnum3 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum3 modality:FINAL visibility:public superTypes:[kotlin.Enum]' + CLASS ENUM_ENTRY name:TEST modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum3.TEST + CONSTRUCTOR visibility:public <> () returnType:.TestEnum3.TEST [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL <> ($this:.TestEnum3.TEST) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TestEnum3.TEST + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="Hello, world!" + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.TestEnum3) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TestEnum3 + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + CLASS ENUM_CLASS name:TestEnum4 modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum4 + CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestEnum4 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum4 modality:FINAL visibility:public superTypes:[kotlin.Enum]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .TestEnum4.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestEnum4) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestEnum4 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestEnum4' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .TestEnum4 declared in .TestEnum4.' type=.TestEnum4 origin=null + CLASS ENUM_ENTRY name:TEST1 modality:FINAL visibility:public superTypes:[.TestEnum4] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum4.TEST1 + CONSTRUCTOR visibility:public <> () returnType:.TestEnum4.TEST1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestEnum4' + x: CONST Int type=kotlin.Int value=1 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST1 modality:FINAL visibility:public superTypes:[.TestEnum4]' + FUN name:foo visibility:public modality:FINAL <> ($this:.TestEnum4.TEST1) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TestEnum4.TEST1 + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:public superTypes:[.TestEnum4] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum4.TEST2 + CONSTRUCTOR visibility:public <> () returnType:.TestEnum4.TEST2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestEnum4' + x: CONST Int type=kotlin.Int value=2 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:public superTypes:[.TestEnum4]' + PROPERTY name:z visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Int visibility:public [final] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestEnum4.TEST2) returnType:kotlin.Int + correspondingProperty: PROPERTY name:z visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestEnum4.TEST2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestEnum4.TEST2' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .TestEnum4.TEST2 declared in .TestEnum4.TEST2.' type=.TestEnum4.TEST2 origin=null + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + value: CALL 'public final fun (): kotlin.Int declared in .TestEnum4' type=kotlin.Int origin=null + FUN name:foo visibility:public modality:FINAL <> ($this:.TestEnum4.TEST2) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TestEnum4.TEST2 + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.TestEnum4) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TestEnum4 + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + CLASS ENUM_CLASS name:TestEnum5 modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum5 + CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestEnum5 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum5 modality:FINAL visibility:public superTypes:[kotlin.Enum]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .TestEnum5.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestEnum5) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestEnum5 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestEnum5' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .TestEnum5 declared in .TestEnum5.' type=.TestEnum5 origin=null + CLASS ENUM_ENTRY name:TEST1 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum5.TEST1 + CONSTRUCTOR visibility:public <> () returnType:.TestEnum5.TEST1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST1 modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:public superTypes:[.TestEnum5] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum5.TEST2 + CONSTRUCTOR visibility:public <> () returnType:.TestEnum5.TEST2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestEnum5' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:public superTypes:[.TestEnum5]' + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + CLASS ENUM_ENTRY name:TEST3 modality:FINAL visibility:public superTypes:[.TestEnum5] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum5.TEST3 + CONSTRUCTOR visibility:public <> () returnType:.TestEnum5.TEST3 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestEnum5' + x: CONST Int type=kotlin.Int value=0 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST3 modality:FINAL visibility:public superTypes:[.TestEnum5]' + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum diff --git a/compiler/testData/ir/irText/classes/enumClassModality.fir.txt b/compiler/testData/ir/irText/classes/enumClassModality.fir.txt new file mode 100644 index 00000000000..ddff56ea791 --- /dev/null +++ b/compiler/testData/ir/irText/classes/enumClassModality.fir.txt @@ -0,0 +1,382 @@ +FILE fqName: fileName:/enumClassModality.kt + CLASS ENUM_CLASS name:TestFinalEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestFinalEnum1 + CONSTRUCTOR visibility:private <> () returnType:.TestFinalEnum1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestFinalEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum]' + CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestFinalEnum1.X1 + CONSTRUCTOR visibility:public <> () returnType:.TestFinalEnum1.X1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + CLASS ENUM_CLASS name:TestFinalEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestFinalEnum2 + CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestFinalEnum2 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestFinalEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .TestFinalEnum2.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestFinalEnum2) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestFinalEnum2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestFinalEnum2' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .TestFinalEnum2 declared in .TestFinalEnum2.' type=.TestFinalEnum2 origin=null + CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[.TestFinalEnum2] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestFinalEnum2.X1 + CONSTRUCTOR visibility:public <> () returnType:.TestFinalEnum2.X1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestFinalEnum2' + x: CONST Int type=kotlin.Int value=1 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[.TestFinalEnum2]' + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + CLASS ENUM_CLASS name:TestFinalEnum3 modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestFinalEnum3 + CONSTRUCTOR visibility:private <> () returnType:.TestFinalEnum3 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestFinalEnum3 modality:FINAL visibility:public superTypes:[kotlin.Enum]' + CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestFinalEnum3.X1 + CONSTRUCTOR visibility:public <> () returnType:.TestFinalEnum3.X1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:doStuff visibility:public modality:FINAL <> ($this:.TestFinalEnum3) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TestFinalEnum3 + BLOCK_BODY + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + CLASS ENUM_CLASS name:TestOpenEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestOpenEnum1 + CONSTRUCTOR visibility:private <> () returnType:.TestOpenEnum1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestOpenEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum]' + CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestOpenEnum1.X1 + CONSTRUCTOR visibility:public <> () returnType:.TestOpenEnum1.X1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:toString visibility:public modality:FINAL <> ($this:.TestOpenEnum1.X1) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.TestOpenEnum1.X1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun toString (): kotlin.String declared in .TestOpenEnum1.X1' + CONST String type=kotlin.String value="X1" + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + CLASS ENUM_CLASS name:TestOpenEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestOpenEnum2 + CONSTRUCTOR visibility:private <> () returnType:.TestOpenEnum2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestOpenEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum]' + CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestOpenEnum2.X1 + CONSTRUCTOR visibility:public <> () returnType:.TestOpenEnum2.X1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL <> ($this:.TestOpenEnum2.X1) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TestOpenEnum2.X1 + BLOCK_BODY + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:OPEN <> ($this:.TestOpenEnum2) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TestOpenEnum2 + BLOCK_BODY + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + CLASS ENUM_CLASS name:TestAbstractEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum1 + CONSTRUCTOR visibility:private <> () returnType:.TestAbstractEnum1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestAbstractEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum]' + CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum1.X1 + CONSTRUCTOR visibility:public <> () returnType:.TestAbstractEnum1.X1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL <> ($this:.TestAbstractEnum1.X1) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TestAbstractEnum1.X1 + BLOCK_BODY + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.TestAbstractEnum1) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TestAbstractEnum1 + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IFoo + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ENUM_CLASS name:TestAbstractEnum2 modality:FINAL visibility:public superTypes:[.IFoo] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum2 + CONSTRUCTOR visibility:private <> () returnType:.TestAbstractEnum2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestAbstractEnum2 modality:FINAL visibility:public superTypes:[.IFoo]' + CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum2.X1 + CONSTRUCTOR visibility:public <> () returnType:.TestAbstractEnum2.X1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL <> ($this:.TestAbstractEnum2.X1) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.TestAbstractEnum2.X1 + BLOCK_BODY + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit + overridden: + public abstract fun foo (): kotlin.Unit declared in .IFoo + $this: VALUE_PARAMETER name: type:.IFoo + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.txt b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.txt new file mode 100644 index 00000000000..8f7118b608c --- /dev/null +++ b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.txt @@ -0,0 +1,260 @@ +FILE fqName: fileName:/enumWithSecondaryCtor.kt + CLASS ENUM_CLASS name:Test0 modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test0 + CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.Test0 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test0 modality:FINAL visibility:public superTypes:[kotlin.Enum]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .Test0.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test0) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test0' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test0 declared in .Test0.' type=.Test0 origin=null + CLASS ENUM_ENTRY name:ZERO modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test0.ZERO + CONSTRUCTOR visibility:public <> () returnType:.Test0.ZERO [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ZERO modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR visibility:private <> () returnType:.Test0 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .Test0' + x: CONST Int type=kotlin.Int value=0 + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + CLASS ENUM_CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 + CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.Test1 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Enum]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .Test1.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + CLASS ENUM_ENTRY name:ZERO modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1.ZERO + CONSTRUCTOR visibility:public <> () returnType:.Test1.ZERO [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ZERO modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ENUM_ENTRY name:ONE modality:FINAL visibility:public superTypes:[.Test1] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1.ONE + CONSTRUCTOR visibility:public <> () returnType:.Test1.ONE [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .Test1' + x: CONST Int type=kotlin.Int value=1 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ONE modality:FINAL visibility:public superTypes:[.Test1]' + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + CONSTRUCTOR visibility:private <> () returnType:.Test1 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .Test1' + x: CONST Int type=kotlin.Int value=0 + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + CLASS ENUM_CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 + CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.Test2 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Enum]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .Test2.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test2) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test2' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null + CLASS ENUM_ENTRY name:ZERO modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2.ZERO + CONSTRUCTOR visibility:public <> () returnType:.Test2.ZERO [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ZERO modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL <> ($this:.Test2.ZERO) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Test2.ZERO + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="ZERO" + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ENUM_ENTRY name:ONE modality:FINAL visibility:public superTypes:[.Test2] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2.ONE + CONSTRUCTOR visibility:public <> () returnType:.Test2.ONE [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .Test2' + x: CONST Int type=kotlin.Int value=1 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ONE modality:FINAL visibility:public superTypes:[.Test2]' + FUN name:foo visibility:public modality:FINAL <> ($this:.Test2.ONE) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Test2.ONE + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="ONE" + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + CONSTRUCTOR visibility:private <> () returnType:.Test2 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .Test2' + x: CONST Int type=kotlin.Int value=0 + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.Test2) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Test2 + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum diff --git a/compiler/testData/ir/irText/classes/initBlock.fir.txt b/compiler/testData/ir/irText/classes/initBlock.fir.txt new file mode 100644 index 00000000000..88b28b6fae4 --- /dev/null +++ b/compiler/testData/ir/irText/classes/initBlock.fir.txt @@ -0,0 +1,152 @@ +FILE fqName: fileName:/initBlock.kt + CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 + CONSTRUCTOR visibility:public <> () returnType:.Test1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Any]' + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + CALL 'public final fun println (): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test2 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .Test2.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test2) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test2' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + CALL 'public final fun println (): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test3 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test3 + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + CALL 'public final fun println (): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null + CONSTRUCTOR visibility:public <> () returnType:.Test3 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test3 modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test4 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test4 + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="1" + CONSTRUCTOR visibility:public <> () returnType:.Test4 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test4 modality:FINAL visibility:public superTypes:[kotlin.Any]' + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="2" + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test5 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test5 + CONSTRUCTOR visibility:public <> () returnType:.Test5 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test5 modality:FINAL visibility:public superTypes:[kotlin.Any]' + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="1" + CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test5.TestInner + CONSTRUCTOR visibility:public <> () returnType:.Test5.TestInner [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="2" + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/initVal.fir.txt b/compiler/testData/ir/irText/classes/initVal.fir.txt new file mode 100644 index 00000000000..468691f7461 --- /dev/null +++ b/compiler/testData/ir/irText/classes/initVal.fir.txt @@ -0,0 +1,94 @@ +FILE fqName: fileName:/initVal.kt + CLASS CLASS name:TestInitValFromParameter modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInitValFromParameter + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.TestInitValFromParameter [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitValFromParameter modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .TestInitValFromParameter.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestInitValFromParameter) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestInitValFromParameter + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestInitValFromParameter' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .TestInitValFromParameter declared in .TestInitValFromParameter.' type=.TestInitValFromParameter origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:TestInitValInClass modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInitValInClass + CONSTRUCTOR visibility:public <> () returnType:.TestInitValInClass [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitValInClass modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestInitValInClass) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestInitValInClass + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestInitValInClass' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .TestInitValInClass declared in .TestInitValInClass.' type=.TestInitValInClass origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:TestInitValInInitBlock modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInitValInInitBlock + CONSTRUCTOR visibility:public <> () returnType:.TestInitValInInitBlock [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitValInInitBlock modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestInitValInInitBlock) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestInitValInInitBlock + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestInitValInInitBlock' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .TestInitValInInitBlock declared in .TestInitValInInitBlock.' type=.TestInitValInInitBlock origin=null + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=0 + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/initVar.fir.txt b/compiler/testData/ir/irText/classes/initVar.fir.txt new file mode 100644 index 00000000000..934e1d4d481 --- /dev/null +++ b/compiler/testData/ir/irText/classes/initVar.fir.txt @@ -0,0 +1,228 @@ +FILE fqName: fileName:/initVar.kt + CLASS CLASS name:TestInitVarFromParameter modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInitVarFromParameter + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.TestInitVarFromParameter [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitVarFromParameter modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .TestInitVarFromParameter.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestInitVarFromParameter) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.TestInitVarFromParameter + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestInitVarFromParameter' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .TestInitVarFromParameter declared in .TestInitVarFromParameter.' type=.TestInitVarFromParameter origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestInitVarFromParameter, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.TestInitVarFromParameter + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .TestInitVarFromParameter declared in .TestInitVarFromParameter.' type=.TestInitVarFromParameter origin=null + value: GET_VAR ': kotlin.Int declared in .TestInitVarFromParameter.' type=kotlin.Int origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:TestInitVarInClass modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInitVarInClass + CONSTRUCTOR visibility:public <> () returnType:.TestInitVarInClass [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitVarInClass modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestInitVarInClass) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.TestInitVarInClass + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestInitVarInClass' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .TestInitVarInClass declared in .TestInitVarInClass.' type=.TestInitVarInClass origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestInitVarInClass, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.TestInitVarInClass + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .TestInitVarInClass declared in .TestInitVarInClass.' type=.TestInitVarInClass origin=null + value: GET_VAR ': kotlin.Int declared in .TestInitVarInClass.' type=kotlin.Int origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:TestInitVarInInitBlock modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInitVarInInitBlock + CONSTRUCTOR visibility:public <> () returnType:.TestInitVarInInitBlock [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitVarInInitBlock modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestInitVarInInitBlock) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.TestInitVarInInitBlock + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestInitVarInInitBlock' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .TestInitVarInInitBlock declared in .TestInitVarInInitBlock.' type=.TestInitVarInInitBlock origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestInitVarInInitBlock, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.TestInitVarInInitBlock + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .TestInitVarInInitBlock declared in .TestInitVarInInitBlock.' type=.TestInitVarInInitBlock origin=null + value: GET_VAR ': kotlin.Int declared in .TestInitVarInInitBlock.' type=kotlin.Int origin=null + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=0 + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:TestInitVarWithCustomSetter modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInitVarWithCustomSetter + CONSTRUCTOR visibility:public <> () returnType:.TestInitVarWithCustomSetter [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitVarWithCustomSetter modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestInitVarWithCustomSetter) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.TestInitVarWithCustomSetter + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestInitVarWithCustomSetter' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .TestInitVarWithCustomSetter declared in .TestInitVarWithCustomSetter.' type=.TestInitVarWithCustomSetter origin=null + FUN name: visibility:public modality:FINAL <> ($this:.TestInitVarWithCustomSetter, value:IrErrorType) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.TestInitVarWithCustomSetter + VALUE_PARAMETER name:value index:0 type:IrErrorType + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:TestInitVarWithCustomSetterWithExplicitCtor modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInitVarWithCustomSetterWithExplicitCtor + PROPERTY name:x visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestInitVarWithCustomSetterWithExplicitCtor) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.TestInitVarWithCustomSetterWithExplicitCtor + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestInitVarWithCustomSetterWithExplicitCtor' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .TestInitVarWithCustomSetterWithExplicitCtor declared in .TestInitVarWithCustomSetterWithExplicitCtor.' type=.TestInitVarWithCustomSetterWithExplicitCtor origin=null + FUN name: visibility:public modality:FINAL <> ($this:.TestInitVarWithCustomSetterWithExplicitCtor, value:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.TestInitVarWithCustomSetterWithExplicitCtor + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=0 + CONSTRUCTOR visibility:public <> () returnType:.TestInitVarWithCustomSetterWithExplicitCtor + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitVarWithCustomSetterWithExplicitCtor modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:TestInitVarWithCustomSetterInCtor modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInitVarWithCustomSetterInCtor + PROPERTY name:x visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestInitVarWithCustomSetterInCtor) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.TestInitVarWithCustomSetterInCtor + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestInitVarWithCustomSetterInCtor' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .TestInitVarWithCustomSetterInCtor declared in .TestInitVarWithCustomSetterInCtor.' type=.TestInitVarWithCustomSetterInCtor origin=null + FUN name: visibility:public modality:FINAL <> ($this:.TestInitVarWithCustomSetterInCtor, value:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.TestInitVarWithCustomSetterInCtor + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONSTRUCTOR visibility:public <> () returnType:.TestInitVarWithCustomSetterInCtor + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=42 + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitVarWithCustomSetterInCtor modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/inlineClass.fir.txt b/compiler/testData/ir/irText/classes/inlineClass.fir.txt new file mode 100644 index 00000000000..e29c3a0dbeb --- /dev/null +++ b/compiler/testData/ir/irText/classes/inlineClass.fir.txt @@ -0,0 +1,32 @@ +FILE fqName: fileName:/inlineClass.kt + CLASS CLASS name:Test modality:FINAL visibility:public [inline] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public [inline] superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .Test.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test declared in .Test.' type=.Test origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/innerClass.fir.txt b/compiler/testData/ir/irText/classes/innerClass.fir.txt new file mode 100644 index 00000000000..118ed38cfec --- /dev/null +++ b/compiler/testData/ir/irText/classes/innerClass.fir.txt @@ -0,0 +1,58 @@ +FILE fqName: fileName:/innerClass.kt + CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer + CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' + CLASS CLASS name:TestInnerClass modality:OPEN visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.TestInnerClass + CONSTRUCTOR visibility:public <> () returnType:.Outer.TestInnerClass [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInnerClass modality:OPEN visibility:public [inner] superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:DerivedInnerClass modality:FINAL visibility:public [inner] superTypes:[.Outer.TestInnerClass] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.DerivedInnerClass + CONSTRUCTOR visibility:public <> () returnType:.Outer.DerivedInnerClass [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Outer.TestInnerClass' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DerivedInnerClass modality:FINAL visibility:public [inner] superTypes:[.Outer.TestInnerClass]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.fir.txt b/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.fir.txt new file mode 100644 index 00000000000..0870348b274 --- /dev/null +++ b/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.fir.txt @@ -0,0 +1,55 @@ +FILE fqName: fileName:/innerClassWithDelegatingConstructor.kt + CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer + CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' + CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Outer.Inner [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .Outer.Inner.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Outer.Inner) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Outer.Inner + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Outer.Inner' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Outer.Inner declared in .Outer.Inner.' type=.Outer.Inner origin=null + CONSTRUCTOR visibility:public <> () returnType:.Outer.Inner + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int) [primary] declared in .Outer.Inner' + x: CONST Int type=kotlin.Int value=0 + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.txt b/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.txt new file mode 100644 index 00000000000..f353413e481 --- /dev/null +++ b/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.txt @@ -0,0 +1,79 @@ +FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt + CLASS CLASS name:A modality:FINAL visibility:public [data] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> (runA:kotlin.Function2) returnType:.A [primary] + VALUE_PARAMETER name:runA index:0 type:kotlin.Function2 + EXPRESSION_BODY + BLOCK type=kotlin.Function2 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Function2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Function2 declared in .A.' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + FUNCTION_REFERENCE 'local final fun (): kotlin.Function2 declared in .A.' type=kotlin.Function2 origin=LAMBDA + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' + PROPERTY name:runA visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:runA type:kotlin.Function2 visibility:public [final] + EXPRESSION_BODY + GET_VAR 'runA: kotlin.Function2 declared in .A.' type=kotlin.Function2 origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Function2 + correspondingProperty: PROPERTY name:runA visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function2 declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:kotlin.Function2 visibility:public [final] ' type=kotlin.Function2 origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:B modality:FINAL visibility:public [data] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + CONSTRUCTOR visibility:public <> (x:kotlin.Any) returnType:.B [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Any + EXPRESSION_BODY + BLOCK type=.B.. origin=OBJECT_LITERAL + CLASS OBJECT name: modality:FINAL visibility:local superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B.. + CONSTRUCTOR visibility:private <> () returnType:IrErrorType [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name: modality:FINAL visibility:local superTypes:[kotlin.Any]' + CALL 'private constructor () [primary] declared in .B..' type=.B.. origin=null + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Any declared in .B.' type=kotlin.Any origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Any + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in .B' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any visibility:public [final] ' type=kotlin.Any origin=null + receiver: GET_VAR ': .B declared in .B.' type=.B origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/localClasses.fir.txt b/compiler/testData/ir/irText/classes/localClasses.fir.txt new file mode 100644 index 00000000000..d00b6d9180c --- /dev/null +++ b/compiler/testData/ir/irText/classes/localClasses.fir.txt @@ -0,0 +1,26 @@ +FILE fqName: fileName:/localClasses.kt + FUN name:outer visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CLASS CLASS name:LocalClass modality:FINAL visibility:local superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.outer.LocalClass + CONSTRUCTOR visibility:public <> () returnType:IrErrorType [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:LocalClass modality:FINAL visibility:local superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL <> ($this:.outer.LocalClass) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.outer.LocalClass + BLOCK_BODY + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CALL 'public final fun foo (): kotlin.Unit declared in .outer.LocalClass' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/classes/objectLiteralExpressions.fir.txt b/compiler/testData/ir/irText/classes/objectLiteralExpressions.fir.txt new file mode 100644 index 00000000000..3057eb28aa9 --- /dev/null +++ b/compiler/testData/ir/irText/classes/objectLiteralExpressions.fir.txt @@ -0,0 +1,130 @@ +FILE fqName: fileName:/objectLiteralExpressions.kt + CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IFoo + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:test1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test1 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + BLOCK type=.test1. origin=OBJECT_LITERAL + CLASS OBJECT name: modality:FINAL visibility:local superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.test1. + CONSTRUCTOR visibility:private <> () returnType:IrErrorType [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name: modality:FINAL visibility:local superTypes:[kotlin.Any]' + CALL 'private constructor () [primary] declared in .test1.' type=.test1. origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:test2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test2 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + BLOCK type=.test2. origin=OBJECT_LITERAL + CLASS OBJECT name: modality:FINAL visibility:local superTypes:[.IFoo] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.test2. + CONSTRUCTOR visibility:private <> () returnType:IrErrorType [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name: modality:FINAL visibility:local superTypes:[.IFoo]' + FUN name:foo visibility:public modality:FINAL <> ($this:.test2.) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.test2. + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="foo" + CALL 'private constructor () [primary] declared in .test2.' type=.test2. origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer + CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' + CLASS CLASS name:Inner modality:ABSTRACT visibility:public [inner] superTypes:[.IFoo] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner + CONSTRUCTOR visibility:public <> () returnType:.Outer.Inner [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:ABSTRACT visibility:public [inner] superTypes:[.IFoo]' + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit + overridden: + public abstract fun foo (): kotlin.Unit declared in .IFoo + $this: VALUE_PARAMETER name: type:.IFoo + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test3 visibility:public modality:FINAL <> ($this:.Outer) returnType:IrErrorType + $this: VALUE_PARAMETER name: type:.Outer + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (): IrErrorType declared in .Outer' + BLOCK type=.Outer.test3. origin=OBJECT_LITERAL + CLASS OBJECT name: modality:FINAL visibility:local superTypes:[.Outer.Inner] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.test3. + CONSTRUCTOR visibility:private <> () returnType:IrErrorType [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Outer.Inner' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name: modality:FINAL visibility:local superTypes:[.Outer.Inner]' + FUN name:foo visibility:public modality:FINAL <> ($this:.Outer.test3.) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Outer.test3. + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="foo" + CALL 'private constructor () [primary] declared in .Outer.test3.' type=.Outer.test3. origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test4 visibility:public modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (): IrErrorType declared in ' + BLOCK type=.test4. origin=OBJECT_LITERAL + CLASS OBJECT name: modality:FINAL visibility:local superTypes:[.Outer.Inner] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.test4. + CONSTRUCTOR visibility:private <> () returnType:IrErrorType [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Outer.Inner' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name: modality:FINAL visibility:local superTypes:[.Outer.Inner]' + FUN name:foo visibility:public modality:FINAL <> ($this:.test4.) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.test4. + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="foo" + CALL 'private constructor () [primary] declared in .test4.' type=.test4. origin=null diff --git a/compiler/testData/ir/irText/classes/objectWithInitializers.fir.txt b/compiler/testData/ir/irText/classes/objectWithInitializers.fir.txt new file mode 100644 index 00000000000..3c1a017b7ba --- /dev/null +++ b/compiler/testData/ir/irText/classes/objectWithInitializers.fir.txt @@ -0,0 +1,63 @@ +FILE fqName: fileName:/objectWithInitializers.kt + CLASS CLASS name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base + CONSTRUCTOR visibility:public <> () returnType:.Base [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS OBJECT name:Test modality:FINAL visibility:public superTypes:[.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test + CONSTRUCTOR visibility:private <> () returnType:.Test [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Base' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Test modality:FINAL visibility:public superTypes:[.Base]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test declared in .Test.' type=.Test origin=null + PROPERTY name:y visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public [final] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test) returnType:kotlin.Int + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test declared in .Test.' type=.Test origin=null + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + value: CALL 'public final fun (): kotlin.Int declared in .Test' type=kotlin.Int origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/outerClassAccess.fir.txt b/compiler/testData/ir/irText/classes/outerClassAccess.fir.txt new file mode 100644 index 00000000000..ed1ba7ed491 --- /dev/null +++ b/compiler/testData/ir/irText/classes/outerClassAccess.fir.txt @@ -0,0 +1,74 @@ +FILE fqName: fileName:/outerClassAccess.kt + CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer + CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL <> ($this:.Outer) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Outer + BLOCK_BODY + CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner + CONSTRUCTOR visibility:public <> () returnType:.Outer.Inner [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' + FUN name:test visibility:public modality:FINAL <> ($this:.Outer.Inner) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Outer.Inner + BLOCK_BODY + CALL 'public final fun foo (): kotlin.Unit declared in .Outer' type=kotlin.Unit origin=null + CLASS CLASS name:Inner2 modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner.Inner2 + CONSTRUCTOR visibility:public <> () returnType:.Outer.Inner.Inner2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner2 modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' + FUN name:test2 visibility:public modality:FINAL <> ($this:.Outer.Inner.Inner2) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Outer.Inner.Inner2 + BLOCK_BODY + CALL 'public final fun test (): kotlin.Unit declared in .Outer.Inner' type=kotlin.Unit origin=null + CALL 'public final fun foo (): kotlin.Unit declared in .Outer' type=kotlin.Unit origin=null + FUN name:test3 visibility:public modality:FINAL <> ($this:.Outer.Inner.Inner2) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Outer.Inner.Inner2 + BLOCK_BODY + CALL 'public final fun foo (): kotlin.Unit declared in .Outer' type=kotlin.Unit origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/primaryConstructor.fir.txt b/compiler/testData/ir/irText/classes/primaryConstructor.fir.txt new file mode 100644 index 00000000000..dcb8770fc71 --- /dev/null +++ b/compiler/testData/ir/irText/classes/primaryConstructor.fir.txt @@ -0,0 +1,132 @@ +FILE fqName: fileName:/primaryConstructor.kt + CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.Test1 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .Test1.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + PROPERTY name:y visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'y: kotlin.Int declared in .Test1.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.Int + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.Test2 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:y visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'y: kotlin.Int declared in .Test2.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test2) returnType:kotlin.Int + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test2' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:IrErrorType visibility:public [final] + EXPRESSION_BODY + ERROR_CALL 'No getter found for R|/Test2.x|' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test2) returnType:IrErrorType + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .Test2' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:IrErrorType visibility:public [final] ' type=IrErrorType origin=null + receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test3 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test3 + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.Test3 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test3 modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:y visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'y: kotlin.Int declared in .Test3.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test3) returnType:kotlin.Int + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test3 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test3' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.' type=.Test3 origin=null + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test3) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test3 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test3' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.' type=.Test3 origin=null + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + value: CALL 'public final fun (): kotlin.Int declared in .Test3' type=kotlin.Int origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.fir.txt b/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.fir.txt new file mode 100644 index 00000000000..e4fecb9cd76 --- /dev/null +++ b/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.fir.txt @@ -0,0 +1,107 @@ +FILE fqName: fileName:/primaryConstructorWithSuperConstructorCall.kt + CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base + CONSTRUCTOR visibility:public <> () returnType:.Base [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:TestImplicitPrimaryConstructor modality:FINAL visibility:public superTypes:[.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestImplicitPrimaryConstructor + CONSTRUCTOR visibility:public <> () returnType:.TestImplicitPrimaryConstructor [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Base' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestImplicitPrimaryConstructor modality:FINAL visibility:public superTypes:[.Base]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:TestExplicitPrimaryConstructor modality:FINAL visibility:public superTypes:[.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestExplicitPrimaryConstructor + CONSTRUCTOR visibility:public <> () returnType:.TestExplicitPrimaryConstructor [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Base' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestExplicitPrimaryConstructor modality:FINAL visibility:public superTypes:[.Base]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:TestWithDelegatingConstructor modality:FINAL visibility:public superTypes:[.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestWithDelegatingConstructor + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.TestWithDelegatingConstructor [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Base' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestWithDelegatingConstructor modality:FINAL visibility:public superTypes:[.Base]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .TestWithDelegatingConstructor.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestWithDelegatingConstructor) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestWithDelegatingConstructor + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestWithDelegatingConstructor' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .TestWithDelegatingConstructor declared in .TestWithDelegatingConstructor.' type=.TestWithDelegatingConstructor origin=null + PROPERTY name:y visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'y: kotlin.Int declared in .TestWithDelegatingConstructor.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestWithDelegatingConstructor) returnType:kotlin.Int + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestWithDelegatingConstructor + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestWithDelegatingConstructor' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .TestWithDelegatingConstructor declared in .TestWithDelegatingConstructor.' type=.TestWithDelegatingConstructor origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.TestWithDelegatingConstructor + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int, y: kotlin.Int) [primary] declared in .TestWithDelegatingConstructor' + x: GET_VAR 'x: kotlin.Int declared in .TestWithDelegatingConstructor.' type=kotlin.Int origin=null + y: CONST Int type=kotlin.Int value=0 + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/qualifiedSuperCalls.fir.txt b/compiler/testData/ir/irText/classes/qualifiedSuperCalls.fir.txt new file mode 100644 index 00000000000..f7cc111d3d1 --- /dev/null +++ b/compiler/testData/ir/irText/classes/qualifiedSuperCalls.fir.txt @@ -0,0 +1,83 @@ +FILE fqName: fileName:/qualifiedSuperCalls.kt + CLASS INTERFACE name:ILeft modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ILeft + FUN name:foo visibility:public modality:OPEN <> ($this:.ILeft) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.ILeft + BLOCK_BODY + PROPERTY name:bar visibility:public modality:OPEN [val] + FUN name: visibility:public modality:OPEN <> ($this:.ILeft) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:OPEN [val] + $this: VALUE_PARAMETER name: type:.ILeft + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .ILeft' + CONST Int type=kotlin.Int value=1 + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:IRight modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IRight + FUN name:foo visibility:public modality:OPEN <> ($this:.IRight) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IRight + BLOCK_BODY + PROPERTY name:bar visibility:public modality:OPEN [val] + FUN name: visibility:public modality:OPEN <> ($this:.IRight) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:OPEN [val] + $this: VALUE_PARAMETER name: type:.IRight + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .IRight' + CONST Int type=kotlin.Int value=2 + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:CBoth modality:FINAL visibility:public superTypes:[.ILeft; .IRight] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CBoth + CONSTRUCTOR visibility:public <> () returnType:.CBoth [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CBoth modality:FINAL visibility:public superTypes:[.ILeft; .IRight]' + FUN name:foo visibility:public modality:FINAL <> ($this:.CBoth) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.CBoth + BLOCK_BODY + CALL 'public final fun foo (): kotlin.Unit declared in .CBoth' type=kotlin.Unit origin=null + CALL 'public final fun foo (): kotlin.Unit declared in .CBoth' type=kotlin.Unit origin=null + PROPERTY name:bar visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.CBoth) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.CBoth + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .CBoth' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'No getter found for R|/CBoth.bar|' type=kotlin.Int + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/sealedClasses.fir.txt b/compiler/testData/ir/irText/classes/sealedClasses.fir.txt new file mode 100644 index 00000000000..7622ed5317f --- /dev/null +++ b/compiler/testData/ir/irText/classes/sealedClasses.fir.txt @@ -0,0 +1,113 @@ +FILE fqName: fileName:/sealedClasses.kt + CLASS CLASS name:Expr modality:SEALED visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Expr + CONSTRUCTOR visibility:private <> () returnType:.Expr [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Expr modality:SEALED visibility:public superTypes:[kotlin.Any]' + CLASS CLASS name:Const modality:FINAL visibility:public superTypes:[.Expr] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Expr.Const + CONSTRUCTOR visibility:public <> (number:kotlin.Double) returnType:.Expr.Const [primary] + VALUE_PARAMETER name:number index:0 type:kotlin.Double + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Expr' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Const modality:FINAL visibility:public superTypes:[.Expr]' + PROPERTY name:number visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:number type:kotlin.Double visibility:public [final] + EXPRESSION_BODY + GET_VAR 'number: kotlin.Double declared in .Expr.Const.' type=kotlin.Double origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Expr.Const) returnType:kotlin.Double + correspondingProperty: PROPERTY name:number visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Expr.Const + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Double declared in .Expr.Const' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:number type:kotlin.Double visibility:public [final] ' type=kotlin.Double origin=null + receiver: GET_VAR ': .Expr.Const declared in .Expr.Const.' type=.Expr.Const origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Sum modality:FINAL visibility:public superTypes:[.Expr] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Expr.Sum + CONSTRUCTOR visibility:public <> (e1:.Expr, e2:.Expr) returnType:.Expr.Sum [primary] + VALUE_PARAMETER name:e1 index:0 type:.Expr + VALUE_PARAMETER name:e2 index:1 type:.Expr + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Expr' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Sum modality:FINAL visibility:public superTypes:[.Expr]' + PROPERTY name:e1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:e1 type:.Expr visibility:public [final] + EXPRESSION_BODY + GET_VAR 'e1: .Expr declared in .Expr.Sum.' type=.Expr origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Expr.Sum) returnType:.Expr + correspondingProperty: PROPERTY name:e1 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Expr.Sum + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .Expr declared in .Expr.Sum' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:e1 type:.Expr visibility:public [final] ' type=.Expr origin=null + receiver: GET_VAR ': .Expr.Sum declared in .Expr.Sum.' type=.Expr.Sum origin=null + PROPERTY name:e2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:e2 type:.Expr visibility:public [final] + EXPRESSION_BODY + GET_VAR 'e2: .Expr declared in .Expr.Sum.' type=.Expr origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Expr.Sum) returnType:.Expr + correspondingProperty: PROPERTY name:e2 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Expr.Sum + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .Expr declared in .Expr.Sum' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:e2 type:.Expr visibility:public [final] ' type=.Expr origin=null + receiver: GET_VAR ': .Expr.Sum declared in .Expr.Sum.' type=.Expr.Sum origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS OBJECT name:NotANumber modality:FINAL visibility:public superTypes:[.Expr] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Expr.NotANumber + CONSTRUCTOR visibility:private <> () returnType:.Expr.NotANumber [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Expr' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:NotANumber modality:FINAL visibility:public superTypes:[.Expr]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.fir.txt b/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.fir.txt new file mode 100644 index 00000000000..a5e8e00f56a --- /dev/null +++ b/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.fir.txt @@ -0,0 +1,91 @@ +FILE fqName: fileName:/secondaryConstructorWithInitializersFromClassBody.kt + CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base + CONSTRUCTOR visibility:public <> () returnType:.Base [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:TestProperty modality:FINAL visibility:public superTypes:[.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestProperty + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestProperty) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestProperty + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestProperty' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .TestProperty declared in .TestProperty.' type=.TestProperty origin=null + CONSTRUCTOR visibility:public <> () returnType:.TestProperty + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestProperty modality:FINAL visibility:public superTypes:[.Base]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:TestInitBlock modality:FINAL visibility:public superTypes:[.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInitBlock + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestInitBlock) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestInitBlock + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestInitBlock' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .TestInitBlock declared in .TestInitBlock.' type=.TestInitBlock origin=null + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=0 + CONSTRUCTOR visibility:public <> () returnType:.TestInitBlock + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitBlock modality:FINAL visibility:public superTypes:[.Base]' + CONSTRUCTOR visibility:public <> (z:kotlin.Any) returnType:.TestInitBlock + VALUE_PARAMETER name:z index:0 type:kotlin.Any + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitBlock modality:FINAL visibility:public superTypes:[.Base]' + CONSTRUCTOR visibility:public <> (y:kotlin.Int) returnType:.TestInitBlock + VALUE_PARAMETER name:y index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .TestInitBlock' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/secondaryConstructors.kt b/compiler/testData/ir/irText/classes/secondaryConstructors.kt index 3e1c2c51c14..ba9236b13ec 100644 --- a/compiler/testData/ir/irText/classes/secondaryConstructors.kt +++ b/compiler/testData/ir/irText/classes/secondaryConstructors.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL + class C { constructor() : this(0) {} constructor(x: Int) {} diff --git a/compiler/testData/ir/irText/classes/superCalls.fir.txt b/compiler/testData/ir/irText/classes/superCalls.fir.txt new file mode 100644 index 00000000000..4930ed087bb --- /dev/null +++ b/compiler/testData/ir/irText/classes/superCalls.fir.txt @@ -0,0 +1,64 @@ +FILE fqName: fileName:/superCalls.kt + CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base + CONSTRUCTOR visibility:public <> () returnType:.Base [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:OPEN <> ($this:.Base) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Base + BLOCK_BODY + PROPERTY name:bar visibility:public modality:OPEN [val] + FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.String visibility:public [final] + EXPRESSION_BODY + CONST String type=kotlin.String value="" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.Base) returnType:kotlin.String + correspondingProperty: PROPERTY name:bar visibility:public modality:OPEN [val] + $this: VALUE_PARAMETER name: type:.Base + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Base' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .Base declared in .Base.' type=.Base origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived + CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Base' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.Base]' + FUN name:foo visibility:public modality:FINAL <> ($this:.Derived) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Derived + BLOCK_BODY + CALL 'public final fun foo (): kotlin.Unit declared in .Derived' type=kotlin.Unit origin=null + PROPERTY name:bar visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.Derived) returnType:kotlin.String + correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Derived + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Derived' + ERROR_CALL 'No getter found for R|/Derived.bar|' type=kotlin.String + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationsInAnnotationArguments.fir.txt b/compiler/testData/ir/irText/declarations/annotations/annotationsInAnnotationArguments.fir.txt new file mode 100644 index 00000000000..9a958c17934 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/annotationsInAnnotationArguments.fir.txt @@ -0,0 +1,87 @@ +FILE fqName: fileName:/annotationsInAnnotationArguments.kt + CLASS ANNOTATION_CLASS name:A1 modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A1 + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.A1 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .A1.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A1) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .A1 declared in .A1.' type=.A1 origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:A2 modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A2 + CONSTRUCTOR visibility:public <> (a:.A1) returnType:.A2 [primary] + VALUE_PARAMETER name:a index:0 type:.A1 + PROPERTY name:a visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:a type:.A1 visibility:public [final] + EXPRESSION_BODY + GET_VAR 'a: .A1 declared in .A2.' type=.A1 origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A2) returnType:.A1 + correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .A1 declared in .A2' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:.A1 visibility:public [final] ' type=.A1 origin=null + receiver: GET_VAR ': .A2 declared in .A2.' type=.A2 origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:AA modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AA + CONSTRUCTOR visibility:public <> (xs:kotlin.Array<.A1>) returnType:.AA [primary] + VALUE_PARAMETER name:xs index:0 type:kotlin.Array<.A1> + PROPERTY name:xs visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array<.A1> visibility:public [final] + EXPRESSION_BODY + GET_VAR 'xs: kotlin.Array<.A1> declared in .AA.' type=kotlin.Array<.A1> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.AA) returnType:kotlin.Array<.A1> + correspondingProperty: PROPERTY name:xs visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.AA + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array<.A1> declared in .AA' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array<.A1> visibility:public [final] ' type=kotlin.Array<.A1> origin=null + receiver: GET_VAR ': .AA declared in .AA.' type=.AA origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationsWithDefaultParameterValues.fir.txt b/compiler/testData/ir/irText/declarations/annotations/annotationsWithDefaultParameterValues.fir.txt new file mode 100644 index 00000000000..2c63c4d8f5d --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/annotationsWithDefaultParameterValues.fir.txt @@ -0,0 +1,55 @@ +FILE fqName: fileName:/annotationsWithDefaultParameterValues.kt + CLASS ANNOTATION_CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> (x:kotlin.String, y:kotlin.Int) returnType:.A [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + EXPRESSION_BODY + CONST String type=kotlin.String value="" + VALUE_PARAMETER name:y index:1 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=42 + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.String declared in .A.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + PROPERTY name:y visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'y: kotlin.Int declared in .A.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + FUN name:test4 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + FUN name:test5 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationsWithVarargParameters.fir.txt b/compiler/testData/ir/irText/declarations/annotations/annotationsWithVarargParameters.fir.txt new file mode 100644 index 00000000000..2630cf66ee6 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/annotationsWithVarargParameters.fir.txt @@ -0,0 +1,35 @@ +FILE fqName: fileName:/annotationsWithVarargParameters.kt + CLASS ANNOTATION_CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> (xs:kotlin.String) returnType:.A [primary] + VALUE_PARAMETER name:xs index:0 type:kotlin.String + PROPERTY name:xs visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'xs: kotlin.String declared in .A.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.String + correspondingProperty: PROPERTY name:xs visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/annotations/arrayInAnnotationArguments.fir.txt b/compiler/testData/ir/irText/declarations/annotations/arrayInAnnotationArguments.fir.txt new file mode 100644 index 00000000000..4e46632acce --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/arrayInAnnotationArguments.fir.txt @@ -0,0 +1,61 @@ +FILE fqName: fileName:/arrayInAnnotationArguments.kt + CLASS ANNOTATION_CLASS name:TestAnnWithIntArray modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnnWithIntArray + CONSTRUCTOR visibility:public <> (x:kotlin.IntArray) returnType:.TestAnnWithIntArray [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.IntArray + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.IntArray visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.IntArray declared in .TestAnnWithIntArray.' type=kotlin.IntArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestAnnWithIntArray) returnType:kotlin.IntArray + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestAnnWithIntArray + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.IntArray declared in .TestAnnWithIntArray' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.IntArray visibility:public [final] ' type=kotlin.IntArray origin=null + receiver: GET_VAR ': .TestAnnWithIntArray declared in .TestAnnWithIntArray.' type=.TestAnnWithIntArray origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:TestAnnWithStringArray modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnnWithStringArray + CONSTRUCTOR visibility:public <> (x:kotlin.Array) returnType:.TestAnnWithStringArray [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Array + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Array visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Array declared in .TestAnnWithStringArray.' type=kotlin.Array origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestAnnWithStringArray) returnType:kotlin.Array + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestAnnWithStringArray + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array declared in .TestAnnWithStringArray' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Array visibility:public [final] ' type=kotlin.Array origin=null + receiver: GET_VAR ': .TestAnnWithStringArray declared in .TestAnnWithStringArray.' type=.TestAnnWithStringArray origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/annotations/classLiteralInAnnotation.fir.txt b/compiler/testData/ir/irText/declarations/annotations/classLiteralInAnnotation.fir.txt new file mode 100644 index 00000000000..6a9f771ff3a --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/classLiteralInAnnotation.fir.txt @@ -0,0 +1,99 @@ +FILE fqName: fileName:/classLiteralInAnnotation.kt + CLASS ANNOTATION_CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> (klass:kotlin.reflect.KClass<*>) returnType:.A [primary] + VALUE_PARAMETER name:klass index:0 type:kotlin.reflect.KClass<*> + PROPERTY name:klass visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:klass type:kotlin.reflect.KClass<*> visibility:public [final] + EXPRESSION_BODY + GET_VAR 'klass: kotlin.reflect.KClass<*> declared in .A.' type=kotlin.reflect.KClass<*> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.reflect.KClass<*> + correspondingProperty: PROPERTY name:klass visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KClass<*> declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:klass type:kotlin.reflect.KClass<*> visibility:public [final] ' type=kotlin.reflect.KClass<*> origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + FUN name:test2 visibility:public modality:FINAL () returnType:IrErrorType [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (): IrErrorType [inline] declared in ' + BLOCK type=.test2. origin=OBJECT_LITERAL + CLASS OBJECT name: modality:FINAL visibility:local superTypes:[kotlin.Any] + annotations: + CALL 'public constructor (klass: kotlin.reflect.KClass<*>) [primary] declared in .A' type=.A origin=null + klass: GET_CLASS type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.test2. + CONSTRUCTOR visibility:private <> () returnType:IrErrorType [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name: modality:FINAL visibility:local superTypes:[kotlin.Any]' + CALL 'private constructor () [primary] declared in .test2.' type=.test2. origin=null + PROPERTY name:test3 visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + BLOCK type=.. origin=OBJECT_LITERAL + CLASS OBJECT name: modality:FINAL visibility:local superTypes:[kotlin.Any] + annotations: + CALL 'public constructor (klass: kotlin.reflect.KClass<*>) [primary] declared in .A' type=.A origin=null + klass: GET_CLASS type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.. + CONSTRUCTOR visibility:private <> () returnType:IrErrorType [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name: modality:FINAL visibility:local superTypes:[kotlin.Any]' + CALL 'private constructor () [primary] declared in ..' type=.. origin=null + FUN name: visibility:public modality:FINAL <> (v:IrErrorType) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [var] + VALUE_PARAMETER name:v index:0 type:IrErrorType + BLOCK_BODY + BLOCK type=.. origin=OBJECT_LITERAL + CLASS OBJECT name: modality:FINAL visibility:local superTypes:[kotlin.Any] + annotations: + CALL 'public constructor (klass: kotlin.reflect.KClass<*>) [primary] declared in .A' type=.A origin=null + klass: GET_CLASS type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.. + CONSTRUCTOR visibility:private <> () returnType:IrErrorType [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name: modality:FINAL visibility:local superTypes:[kotlin.Any]' + CALL 'private constructor () [primary] declared in ..' type=.. origin=null diff --git a/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.fir.txt new file mode 100644 index 00000000000..953c93d996b --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.fir.txt @@ -0,0 +1,182 @@ +FILE fqName: fileName:/classesWithAnnotations.kt + CLASS ANNOTATION_CLASS name:TestAnn modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.String declared in .TestAnn.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestAnn) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestAnn + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .TestAnn' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:TestClass modality:FINAL visibility:public superTypes:[kotlin.Any] + annotations: + CALL 'public constructor (x: kotlin.String) [primary] declared in .TestAnn' type=.TestAnn origin=null + x: CONST String type=kotlin.String value="class" + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestClass + CONSTRUCTOR visibility:public <> () returnType:.TestClass [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestClass modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:TestInterface modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + annotations: + CALL 'public constructor (x: kotlin.String) [primary] declared in .TestAnn' type=.TestAnn origin=null + x: CONST String type=kotlin.String value="interface" + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInterface + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS OBJECT name:TestObject modality:FINAL visibility:public superTypes:[kotlin.Any] + annotations: + CALL 'public constructor (x: kotlin.String) [primary] declared in .TestAnn' type=.TestAnn origin=null + x: CONST String type=kotlin.String value="object" + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestObject + CONSTRUCTOR visibility:private <> () returnType:.TestObject [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:TestObject modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host + CONSTRUCTOR visibility:public <> () returnType:.Host [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' + CLASS OBJECT name:TestCompanion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] + annotations: + CALL 'public constructor (x: kotlin.String) [primary] declared in .TestAnn' type=.TestAnn origin=null + x: CONST String type=kotlin.String value="companion" + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host.TestCompanion + CONSTRUCTOR visibility:private <> () returnType:.Host.TestCompanion [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:TestCompanion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ENUM_CLASS name:TestEnum modality:FINAL visibility:public superTypes:[kotlin.Enum] + annotations: + CALL 'public constructor (x: kotlin.String) [primary] declared in .TestAnn' type=.TestAnn origin=null + x: CONST String type=kotlin.String value="enum" + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum + CONSTRUCTOR visibility:private <> () returnType:.TestEnum [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum modality:FINAL visibility:public superTypes:[kotlin.Enum]' + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + CLASS ANNOTATION_CLASS name:TestAnnotation modality:FINAL visibility:public superTypes:[kotlin.Annotation] + annotations: + CALL 'public constructor (x: kotlin.String) [primary] declared in .TestAnn' type=.TestAnn origin=null + x: CONST String type=kotlin.String value="annotation" + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnnotation + CONSTRUCTOR visibility:public <> () returnType:.TestAnnotation [primary] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.fir.txt b/compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.fir.txt new file mode 100644 index 00000000000..ccfbc416755 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/constExpressionsInAnnotationArguments.fir.txt @@ -0,0 +1,42 @@ +FILE fqName: fileName:/constExpressionsInAnnotationArguments.kt + PROPERTY name:ONE visibility:public modality:FINAL [const,val] + FIELD PROPERTY_BACKING_FIELD name:ONE type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:ONE visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ONE type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + CLASS ANNOTATION_CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.A [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .A.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/annotations/constructorsWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/constructorsWithAnnotations.fir.txt new file mode 100644 index 00000000000..2b1d743811b --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/constructorsWithAnnotations.fir.txt @@ -0,0 +1,52 @@ +FILE fqName: fileName:/constructorsWithAnnotations.kt + CLASS ANNOTATION_CLASS name:TestAnn modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.TestAnn [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .TestAnn.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestAnn) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestAnn + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestAnn' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:TestClass modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestClass + CONSTRUCTOR visibility:public <> () returnType:.TestClass [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestClass modality:FINAL visibility:public superTypes:[kotlin.Any]' + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.TestClass + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .TestClass' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.fir.txt new file mode 100644 index 00000000000..80e01f13bc1 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.fir.txt @@ -0,0 +1,26 @@ +FILE fqName: fileName:/delegateFieldWithAnnotations.kt + CLASS ANNOTATION_CLASS name:Ann modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ann + CONSTRUCTOR visibility:public <> () returnType:.Ann [primary] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:test1 visibility:public modality:FINAL [delegated,val] + annotations: + CALL 'public constructor () [primary] declared in .Ann' type=.Ann origin=null + FIELD PROPERTY_BACKING_FIELD name:test1 type:IrErrorType visibility:public [final,static] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [delegated,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.txt new file mode 100644 index 00000000000..bc4d672a4c3 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.txt @@ -0,0 +1,125 @@ +FILE fqName: fileName:/delegatedPropertyAccessorsWithAnnotations.kt + CLASS ANNOTATION_CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.A [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.String declared in .A.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Cell modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Cell + CONSTRUCTOR visibility:public <> (value:kotlin.Int) returnType:.Cell [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Cell modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:value visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:public + EXPRESSION_BODY + GET_VAR 'value: kotlin.Int declared in .Cell.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Cell) returnType:kotlin.Int + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Cell + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Cell' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Cell declared in .Cell.' type=.Cell origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Cell, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Cell + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .Cell declared in .Cell.' type=.Cell origin=null + value: GET_VAR ': kotlin.Int declared in .Cell.' type=kotlin.Int origin=null + FUN name:getValue visibility:public modality:FINAL <> ($this:.Cell, thisRef:kotlin.Any?, kProp:kotlin.Any?) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.Cell + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:kProp index:1 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any?): kotlin.Int declared in .Cell' + CALL 'public final fun (): kotlin.Int declared in .Cell' type=kotlin.Int origin=null + FUN name:setValue visibility:public modality:FINAL <> ($this:.Cell, thisRef:kotlin.Any?, kProp:kotlin.Any?, newValue:kotlin.Int) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Cell + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:kProp index:1 type:kotlin.Any? + VALUE_PARAMETER name:newValue index:2 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: GET_VAR 'newValue: kotlin.Int declared in .Cell.setValue' type=kotlin.Int origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:test1 visibility:public modality:FINAL [delegated,val] + annotations: + CALL 'public constructor (x: kotlin.String) [primary] declared in .A' type=.A origin=null + x: CONST String type=IrErrorType value="test1.get" + FIELD PROPERTY_BACKING_FIELD name:test1 type:IrErrorType visibility:public [final,static] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [delegated,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:test2 visibility:public modality:FINAL [delegated,var] + annotations: + CALL 'public constructor (x: kotlin.String) [primary] declared in .A' type=.A origin=null + x: CONST String type=IrErrorType value="test2.get" + CALL 'public constructor (x: kotlin.String) [primary] declared in .A' type=.A origin=null + x: CONST String type=IrErrorType value="test2.set" + CALL 'public constructor (x: kotlin.String) [primary] declared in .A' type=.A origin=null + x: CONST String type=IrErrorType value="test2.set.param" + CALL 'public constructor (x: kotlin.String) [primary] declared in .A' type=.A origin=null + x: CONST String type=IrErrorType value="test2.get" + CALL 'public constructor (x: kotlin.String) [primary] declared in .A' type=.A origin=null + x: CONST String type=IrErrorType value="test2.set" + CALL 'public constructor (x: kotlin.String) [primary] declared in .A' type=.A origin=null + x: CONST String type=IrErrorType value="test2.set.param" + CALL 'public constructor (x: kotlin.String) [primary] declared in .A' type=.A origin=null + x: CONST String type=IrErrorType value="test2.get" + CALL 'public constructor (x: kotlin.String) [primary] declared in .A' type=.A origin=null + x: CONST String type=IrErrorType value="test2.set" + CALL 'public constructor (x: kotlin.String) [primary] declared in .A' type=.A origin=null + x: CONST String type=IrErrorType value="test2.set.param" + FIELD PROPERTY_BACKING_FIELD name:test2 type:IrErrorType visibility:public [static] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [delegated,var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:IrErrorType visibility:public [static] ' type=IrErrorType origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:IrErrorType) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [delegated,var] + VALUE_PARAMETER name: index:0 type:IrErrorType + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:IrErrorType visibility:public [static] ' type=kotlin.Unit origin=null + value: GET_VAR ': IrErrorType declared in .' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.txt new file mode 100644 index 00000000000..b9a1003f6fa --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.txt @@ -0,0 +1,112 @@ +FILE fqName: fileName:/enumEntriesWithAnnotations.kt + CLASS ANNOTATION_CLASS name:TestAnn modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.String declared in .TestAnn.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestAnn) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestAnn + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .TestAnn' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ENUM_CLASS name:TestEnum modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum + CONSTRUCTOR visibility:private <> () returnType:.TestEnum [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum modality:FINAL visibility:public superTypes:[kotlin.Enum]' + CLASS ENUM_ENTRY name:ENTRY1 modality:FINAL visibility:public superTypes:[kotlin.Any] + annotations: + CALL 'public constructor (x: kotlin.String) [primary] declared in .TestAnn' type=.TestAnn origin=null + x: CONST String type=kotlin.String value="ENTRY1" + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum.ENTRY1 + CONSTRUCTOR visibility:public <> () returnType:.TestEnum.ENTRY1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY1 modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ENUM_ENTRY name:ENTRY2 modality:FINAL visibility:public superTypes:[kotlin.Any] + annotations: + CALL 'public constructor (x: kotlin.String) [primary] declared in .TestAnn' type=.TestAnn origin=null + x: CONST String type=kotlin.String value="ENTRY2" + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum.ENTRY2 + CONSTRUCTOR visibility:public <> () returnType:.TestEnum.ENTRY2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY2 modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestEnum.ENTRY2) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestEnum.ENTRY2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestEnum.ENTRY2' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .TestEnum.ENTRY2 declared in .TestEnum.ENTRY2.' type=.TestEnum.ENTRY2 origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum diff --git a/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.fir.txt b/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.fir.txt new file mode 100644 index 00000000000..75bda3a419c --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.fir.txt @@ -0,0 +1,135 @@ +FILE fqName: fileName:/enumsInAnnotationArguments.kt + CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.En + CONSTRUCTOR visibility:private <> () returnType:.En [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum]' + CLASS ENUM_ENTRY name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.En.A + CONSTRUCTOR visibility:public <> () returnType:.En.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ENUM_ENTRY name:B modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.En.B + CONSTRUCTOR visibility:public <> () returnType:.En.B [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ENUM_ENTRY name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.En.C + CONSTRUCTOR visibility:public <> () returnType:.En.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ENUM_ENTRY name:D modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.En.D + CONSTRUCTOR visibility:public <> () returnType:.En.D [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:D modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + CLASS ANNOTATION_CLASS name:TestAnn modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn + CONSTRUCTOR visibility:public <> (x:.En) returnType:.TestAnn [primary] + VALUE_PARAMETER name:x index:0 type:.En + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:.En visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: .En declared in .TestAnn.' type=.En origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestAnn) returnType:.En + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestAnn + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .En declared in .TestAnn' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:.En visibility:public [final] ' type=.En origin=null + receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.fir.txt new file mode 100644 index 00000000000..69aef799e33 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/fieldsWithAnnotations.fir.txt @@ -0,0 +1,59 @@ +FILE fqName: fileName:/fieldsWithAnnotations.kt + CLASS ANNOTATION_CLASS name:TestAnn modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.String declared in .TestAnn.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestAnn) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestAnn + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .TestAnn' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:testVal visibility:public modality:FINAL [val] + annotations: + CALL 'public constructor (x: kotlin.String) [primary] declared in .TestAnn' type=.TestAnn origin=null + x: CONST String type=kotlin.String value="testVal.field" + FIELD PROPERTY_BACKING_FIELD name:testVal type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CONST String type=kotlin.String value="a val" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:testVal visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testVal type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + PROPERTY name:testVar visibility:public modality:FINAL [var] + annotations: + CALL 'public constructor (x: kotlin.String) [primary] declared in .TestAnn' type=.TestAnn origin=null + x: CONST String type=kotlin.String value="testVar.field" + FIELD PROPERTY_BACKING_FIELD name:testVar type:kotlin.String visibility:public [static] + EXPRESSION_BODY + CONST String type=kotlin.String value="a var" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:testVar visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testVar type:kotlin.String visibility:public [static] ' type=kotlin.String origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.String) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:testVar visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.String + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testVar type:kotlin.String visibility:public [static] ' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.String declared in .' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/declarations/annotations/fileAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/fileAnnotations.fir.txt new file mode 100644 index 00000000000..94a7432f7c8 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/fileAnnotations.fir.txt @@ -0,0 +1,32 @@ +FILE fqName:test fileName:/fileAnnotations.kt + annotations: + CALL 'public constructor (x: kotlin.String) [primary] declared in test.A' type=test.A origin=null + x: CONST String type=kotlin.String value="File annotation" + CLASS ANNOTATION_CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:test.A + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:test.A [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.String declared in test.A.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:test.A) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:test.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in test.A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': test.A declared in test.A.' type=test.A origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/annotations/functionsWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/functionsWithAnnotations.fir.txt new file mode 100644 index 00000000000..8bbdfdb920e --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/functionsWithAnnotations.fir.txt @@ -0,0 +1,31 @@ +FILE fqName: fileName:/functionsWithAnnotations.kt + CLASS ANNOTATION_CLASS name:TestAnn modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.TestAnn [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .TestAnn.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestAnn) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestAnn + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestAnn' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:testSimpleFunction visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/annotations/javaAnnotation.fir.txt b/compiler/testData/ir/irText/declarations/annotations/javaAnnotation.fir.txt new file mode 100644 index 00000000000..173cb184e09 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/javaAnnotation.fir.txt @@ -0,0 +1,7 @@ +FILE fqName: fileName:/javaAnnotation.kt + FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/annotations/localDelegatedPropertiesWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/localDelegatedPropertiesWithAnnotations.fir.txt new file mode 100644 index 00000000000..bf50222bb10 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/localDelegatedPropertiesWithAnnotations.fir.txt @@ -0,0 +1,33 @@ +FILE fqName: fileName:/localDelegatedPropertiesWithAnnotations.kt + CLASS ANNOTATION_CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.A [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.String declared in .A.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:FINAL <> (m:kotlin.collections.Map) returnType:kotlin.Unit + VALUE_PARAMETER name:m index:0 type:kotlin.collections.Map + BLOCK_BODY + VAR name:test type:IrErrorType [val] diff --git a/compiler/testData/ir/irText/declarations/annotations/multipleAnnotationsInSquareBrackets.fir.txt b/compiler/testData/ir/irText/declarations/annotations/multipleAnnotationsInSquareBrackets.fir.txt new file mode 100644 index 00000000000..72c59fc3669 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/multipleAnnotationsInSquareBrackets.fir.txt @@ -0,0 +1,51 @@ +FILE fqName: fileName:/multipleAnnotationsInSquareBrackets.kt + CLASS ANNOTATION_CLASS name:A1 modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A1 + CONSTRUCTOR visibility:public <> () returnType:.A1 [primary] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:A2 modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A2 + CONSTRUCTOR visibility:public <> () returnType:.A2 [primary] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:A3 modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A3 + CONSTRUCTOR visibility:public <> () returnType:.A3 [primary] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.fir.txt new file mode 100644 index 00000000000..7b9d1e2f25f --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.fir.txt @@ -0,0 +1,50 @@ +FILE fqName: fileName:/primaryConstructorParameterWithAnnotations.kt + CLASS ANNOTATION_CLASS name:Ann modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ann + CONSTRUCTOR visibility:public <> () returnType:.Ann [primary] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + annotations: + CALL 'public constructor () [primary] declared in .Ann' type=.Ann origin=null + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .Test.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test declared in .Test.' type=.Test origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.fir.txt new file mode 100644 index 00000000000..7a04f1d340b --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/propertiesWithAnnotations.fir.txt @@ -0,0 +1,41 @@ +FILE fqName: fileName:/propertiesWithAnnotations.kt + CLASS ANNOTATION_CLASS name:TestAnn modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.String declared in .TestAnn.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestAnn) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestAnn + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .TestAnn' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:testVal visibility:public modality:FINAL [val] + annotations: + CALL 'public constructor (x: kotlin.String) [primary] declared in .TestAnn' type=.TestAnn origin=null + x: CONST String type=kotlin.String value="testVal.property" + FIELD PROPERTY_BACKING_FIELD name:testVal type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CONST String type=kotlin.String value="" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:testVal visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testVal type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsFromClassHeaderWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsFromClassHeaderWithAnnotations.fir.txt new file mode 100644 index 00000000000..8b50a5e6a88 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsFromClassHeaderWithAnnotations.fir.txt @@ -0,0 +1,92 @@ +FILE fqName: fileName:/propertyAccessorsFromClassHeaderWithAnnotations.kt + CLASS ANNOTATION_CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.A [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.String declared in .A.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.C [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + annotations: + CALL 'public constructor (x: kotlin.String) [primary] declared in .A' type=.A origin=null + x: CONST String type=kotlin.Int value="C.x.get" + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .C.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + PROPERTY name:y visibility:public modality:FINAL [var] + annotations: + CALL 'public constructor (x: kotlin.String) [primary] declared in .A' type=.A origin=null + x: CONST String type=kotlin.Int value="C.y.get" + CALL 'public constructor (x: kotlin.String) [primary] declared in .A' type=.A origin=null + x: CONST String type=kotlin.Int value="C.y.set" + CALL 'public constructor (x: kotlin.String) [primary] declared in .A' type=.A origin=null + x: CONST String type=kotlin.Int value="C.y.get" + CALL 'public constructor (x: kotlin.String) [primary] declared in .A' type=.A origin=null + x: CONST String type=kotlin.Int value="C.y.set" + FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public + EXPRESSION_BODY + GET_VAR 'y: kotlin.Int declared in .C.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.fir.txt new file mode 100644 index 00000000000..06721d09fb4 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsWithAnnotations.fir.txt @@ -0,0 +1,81 @@ +FILE fqName: fileName:/propertyAccessorsWithAnnotations.kt + CLASS ANNOTATION_CLASS name:TestAnn modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.String declared in .TestAnn.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestAnn) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestAnn + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .TestAnn' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:test1 visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + CONST String type=kotlin.String value="" + PROPERTY name:test2 visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + CONST String type=kotlin.String value="" + FUN name: visibility:public modality:FINAL <> (value:kotlin.String) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var] + VALUE_PARAMETER name:value index:0 type:kotlin.String + BLOCK_BODY + PROPERTY name:test3 visibility:public modality:FINAL [val] + annotations: + CALL 'public constructor (x: kotlin.String) [primary] declared in .TestAnn' type=.TestAnn origin=null + x: CONST String type=kotlin.String value="test3.get" + FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CONST String type=kotlin.String value="" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + PROPERTY name:test4 visibility:public modality:FINAL [var] + annotations: + CALL 'public constructor (x: kotlin.String) [primary] declared in .TestAnn' type=.TestAnn origin=null + x: CONST String type=kotlin.String value="test4.get" + CALL 'public constructor (x: kotlin.String) [primary] declared in .TestAnn' type=.TestAnn origin=null + x: CONST String type=kotlin.String value="test4.set" + CALL 'public constructor (x: kotlin.String) [primary] declared in .TestAnn' type=.TestAnn origin=null + x: CONST String type=kotlin.String value="test4.get" + CALL 'public constructor (x: kotlin.String) [primary] declared in .TestAnn' type=.TestAnn origin=null + x: CONST String type=kotlin.String value="test4.set" + FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.String visibility:public [static] + EXPRESSION_BODY + CONST String type=kotlin.String value="" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.String visibility:public [static] ' type=kotlin.String origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.String) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.String + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.String visibility:public [static] ' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.String declared in .' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.fir.txt new file mode 100644 index 00000000000..e3113768d75 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.fir.txt @@ -0,0 +1,75 @@ +FILE fqName: fileName:/propertySetterParameterWithAnnotations.kt + CLASS ANNOTATION_CLASS name:AnnParam modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AnnParam + CONSTRUCTOR visibility:public <> () returnType:.AnnParam [primary] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:p visibility:public modality:FINAL [var] + annotations: + CALL 'public constructor () [primary] declared in .AnnParam' type=.AnnParam origin=null + FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public [static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public [static] ' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public [static] ' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> (p:kotlin.Int) returnType:.C [primary] + VALUE_PARAMETER name:p index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:p visibility:public modality:FINAL [var] + annotations: + CALL 'public constructor () [primary] declared in .AnnParam' type=.AnnParam origin=null + FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public + EXPRESSION_BODY + GET_VAR 'p: kotlin.Int declared in .C.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.fir.txt new file mode 100644 index 00000000000..6bf606306a9 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.fir.txt @@ -0,0 +1,58 @@ +FILE fqName: fileName:/receiverParameterWithAnnotations.kt + CLASS ANNOTATION_CLASS name:Ann modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ann + CONSTRUCTOR visibility:public <> () returnType:.Ann [primary] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:f visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun f (): kotlin.String declared in .A' + CONST String type=kotlin.String value="" + PROPERTY name:p visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.String + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .A' + CONST String type=kotlin.String value="" + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:topLevelF visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun topLevelF (): kotlin.String declared in ' + CONST String type=kotlin.String value="" + PROPERTY name:topLevelP visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:topLevelP visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + CONST String type=kotlin.String value="" diff --git a/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.fir.txt b/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.fir.txt new file mode 100644 index 00000000000..8dd71e5f8ab --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.fir.txt @@ -0,0 +1,31 @@ +FILE fqName: fileName:/spreadOperatorInAnnotationArguments.kt + CLASS ANNOTATION_CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> (xs:kotlin.String) returnType:.A [primary] + VALUE_PARAMETER name:xs index:0 type:kotlin.String + PROPERTY name:xs visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'xs: kotlin.String declared in .A.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.String + correspondingProperty: PROPERTY name:xs visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.fir.txt new file mode 100644 index 00000000000..690e8016165 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.fir.txt @@ -0,0 +1,29 @@ +FILE fqName: fileName:/typeAliasesWithAnnotations.kt + CLASS ANNOTATION_CLASS name:TestAnn modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.String declared in .TestAnn.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestAnn) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestAnn + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .TestAnn' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/annotations/typeParametersWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/typeParametersWithAnnotations.fir.txt new file mode 100644 index 00000000000..f9ffd632a69 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/typeParametersWithAnnotations.fir.txt @@ -0,0 +1,20 @@ +FILE fqName: fileName:/typeParametersWithAnnotations.kt + CLASS ANNOTATION_CLASS name:Anno modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Anno + CONSTRUCTOR visibility:public <> () returnType:.Anno [primary] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:FINAL () returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.fir.txt new file mode 100644 index 00000000000..b101a9ef5a6 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.fir.txt @@ -0,0 +1,63 @@ +FILE fqName: fileName:/valueParametersWithAnnotations.kt + CLASS ANNOTATION_CLASS name:TestAnn modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.String declared in .TestAnn.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestAnn) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestAnn + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .TestAnn' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:testFun visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + CLASS CLASS name:TestClassConstructor1 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestClassConstructor1 + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.TestClassConstructor1 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestClassConstructor1 modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:xx visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:xx type:IrErrorType visibility:public [final] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestClassConstructor1) returnType:IrErrorType + correspondingProperty: PROPERTY name:xx visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestClassConstructor1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .TestClassConstructor1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xx type:IrErrorType visibility:public [final] ' type=IrErrorType origin=null + receiver: GET_VAR ': .TestClassConstructor1 declared in .TestClassConstructor1.' type=.TestClassConstructor1 origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/annotations/varargsInAnnotationArguments.fir.txt b/compiler/testData/ir/irText/declarations/annotations/varargsInAnnotationArguments.fir.txt new file mode 100644 index 00000000000..6379d37aff0 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/varargsInAnnotationArguments.fir.txt @@ -0,0 +1,89 @@ +FILE fqName: fileName:/varargsInAnnotationArguments.kt + CLASS ANNOTATION_CLASS name:A1 modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A1 + CONSTRUCTOR visibility:public <> (xs:kotlin.Int) returnType:.A1 [primary] + VALUE_PARAMETER name:xs index:0 type:kotlin.Int + PROPERTY name:xs visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'xs: kotlin.Int declared in .A1.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A1) returnType:kotlin.Int + correspondingProperty: PROPERTY name:xs visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .A1 declared in .A1.' type=.A1 origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:A2 modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A2 + CONSTRUCTOR visibility:public <> (xs:kotlin.String) returnType:.A2 [primary] + VALUE_PARAMETER name:xs index:0 type:kotlin.String + PROPERTY name:xs visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'xs: kotlin.String declared in .A2.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A2) returnType:kotlin.String + correspondingProperty: PROPERTY name:xs visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .A2' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .A2 declared in .A2.' type=.A2 origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:AA modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AA + CONSTRUCTOR visibility:public <> (xs:.A1) returnType:.AA [primary] + VALUE_PARAMETER name:xs index:0 type:.A1 + PROPERTY name:xs visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:xs type:.A1 visibility:public [final] + EXPRESSION_BODY + GET_VAR 'xs: .A1 declared in .AA.' type=.A1 origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.AA) returnType:.A1 + correspondingProperty: PROPERTY name:xs visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.AA + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .A1 declared in .AA' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xs type:.A1 visibility:public [final] ' type=.A1 origin=null + receiver: GET_VAR ': .AA declared in .AA.' type=.AA origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/annotations/variablesWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/variablesWithAnnotations.fir.txt new file mode 100644 index 00000000000..9ce176748e0 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/annotations/variablesWithAnnotations.fir.txt @@ -0,0 +1,35 @@ +FILE fqName: fileName:/variablesWithAnnotations.kt + CLASS ANNOTATION_CLASS name:TestAnn modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.String declared in .TestAnn.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestAnn) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestAnn + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .TestAnn' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:testVal type:kotlin.String [val] + CONST String type=kotlin.String value="testVal" + VAR name:testVar type:kotlin.String [var] + CONST String type=kotlin.String value="testVar" diff --git a/compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.fir.txt b/compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.fir.txt new file mode 100644 index 00000000000..3434af7840c --- /dev/null +++ b/compiler/testData/ir/irText/declarations/catchParameterInTopLevelProperty.fir.txt @@ -0,0 +1,14 @@ +FILE fqName: fileName:/catchParameterInTopLevelProperty.kt + PROPERTY name:test visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + TRY type=IrErrorType + try: BLOCK type=kotlin.Unit origin=null + CATCH parameter=val e: kotlin.Throwable [val] declared in .test + VAR name:e type:kotlin.Throwable [val] + BLOCK type=kotlin.Unit origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/declarations/classLevelProperties.fir.txt b/compiler/testData/ir/irText/declarations/classLevelProperties.fir.txt new file mode 100644 index 00000000000..8a699d22ade --- /dev/null +++ b/compiler/testData/ir/irText/declarations/classLevelProperties.fir.txt @@ -0,0 +1,122 @@ +FILE fqName: fileName:/classLevelProperties.kt + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:test1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + PROPERTY name:test2 visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + CONST Int type=kotlin.Int value=0 + PROPERTY name:test3 visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:public + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null + PROPERTY name:test4 visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Int visibility:public + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + FUN name: visibility:public modality:FINAL <> ($this:.C, value:IrErrorType) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:value index:0 type:IrErrorType + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + PROPERTY name:test5 visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.Int visibility:public + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:test5 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + FUN name: visibility:private modality:FINAL <> ($this:.C, value:IrErrorType) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:test5 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:value index:0 type:IrErrorType + PROPERTY name:test6 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test6 type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:test6 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.C + PROPERTY name:test7 visibility:public modality:FINAL [delegated,val] + FIELD PROPERTY_BACKING_FIELD name:test7 type:IrErrorType visibility:public [final] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:IrErrorType + correspondingProperty: PROPERTY name:test7 visibility:public modality:FINAL [delegated,val] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test7 type:IrErrorType visibility:public [final] ' type=IrErrorType origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] + FIELD PROPERTY_BACKING_FIELD name:test8 type:IrErrorType visibility:public + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:IrErrorType + correspondingProperty: PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test8 type:IrErrorType visibility:public ' type=IrErrorType origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C, :IrErrorType) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name: index:0 type:IrErrorType + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test8 type:IrErrorType visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + value: GET_VAR ': IrErrorType declared in .C.' type=IrErrorType origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/constValInitializers.fir.txt b/compiler/testData/ir/irText/declarations/constValInitializers.fir.txt new file mode 100644 index 00000000000..57f492a3b8a --- /dev/null +++ b/compiler/testData/ir/irText/declarations/constValInitializers.fir.txt @@ -0,0 +1,68 @@ +FILE fqName: fileName:/constValInitializers.kt + PROPERTY name:I0 visibility:public modality:FINAL [const,val] + FIELD PROPERTY_BACKING_FIELD name:I0 type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:I0 visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:I0 type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + PROPERTY name:I1 visibility:public modality:FINAL [const,val] + FIELD PROPERTY_BACKING_FIELD name:I1 type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:I1 visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:I1 type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + PROPERTY name:I2 visibility:public modality:FINAL [const,val] + FIELD PROPERTY_BACKING_FIELD name:I2 type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin' type=kotlin.String origin=null + other: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:I2 visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:I2 type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + PROPERTY name:STR1 visibility:public modality:FINAL [const,val] + FIELD PROPERTY_BACKING_FIELD name:STR1 type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CONST String type=kotlin.String value="String1" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:STR1 visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:STR1 type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + PROPERTY name:STR2 visibility:public modality:FINAL [const,val] + FIELD PROPERTY_BACKING_FIELD name:STR2 type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + other: CONST String type=kotlin.String value="2" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:STR2 visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:STR2 type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + PROPERTY name:STR3 visibility:public modality:FINAL [const,val] + FIELD PROPERTY_BACKING_FIELD name:STR3 type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + other: CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:STR3 visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:STR3 type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + PROPERTY name:STR4 visibility:public modality:FINAL [const,val] + FIELD PROPERTY_BACKING_FIELD name:STR4 type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + other: CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:STR4 visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:STR4 type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/declarations/defaultArguments.kt b/compiler/testData/ir/irText/declarations/defaultArguments.kt index 947d4f3620d..0876934ebff 100644 --- a/compiler/testData/ir/irText/declarations/defaultArguments.kt +++ b/compiler/testData/ir/irText/declarations/defaultArguments.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL + fun test1(x: Int, y: Int = 0, z: String = "abc") { fun local(xx: Int = x, yy: Int = y, zz: String = z) {} } diff --git a/compiler/testData/ir/irText/declarations/delegatedProperties.fir.txt b/compiler/testData/ir/irText/declarations/delegatedProperties.fir.txt new file mode 100644 index 00000000000..f5d33bf1a29 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/delegatedProperties.fir.txt @@ -0,0 +1,78 @@ +FILE fqName: fileName:/delegatedProperties.kt + PROPERTY name:test1 visibility:public modality:FINAL [delegated,val] + FIELD PROPERTY_BACKING_FIELD name:test1 type:IrErrorType visibility:public [final,static] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [delegated,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> (map:kotlin.collections.MutableMap) returnType:.C [primary] + VALUE_PARAMETER name:map index:0 type:kotlin.collections.MutableMap + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:map visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.MutableMap visibility:public [final] + EXPRESSION_BODY + GET_VAR 'map: kotlin.collections.MutableMap declared in .C.' type=kotlin.collections.MutableMap origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.collections.MutableMap + correspondingProperty: PROPERTY name:map visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.collections.MutableMap declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.MutableMap visibility:public [final] ' type=kotlin.collections.MutableMap origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + PROPERTY name:test2 visibility:public modality:FINAL [delegated,val] + FIELD PROPERTY_BACKING_FIELD name:test2 type:IrErrorType visibility:public [final] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:IrErrorType + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [delegated,val] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:IrErrorType visibility:public [final] ' type=IrErrorType origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + PROPERTY name:test3 visibility:public modality:FINAL [delegated,var] + FIELD PROPERTY_BACKING_FIELD name:test3 type:IrErrorType visibility:public + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:IrErrorType + correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [delegated,var] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:IrErrorType visibility:public ' type=IrErrorType origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C, :IrErrorType) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [delegated,var] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name: index:0 type:IrErrorType + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:IrErrorType visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + value: GET_VAR ': IrErrorType declared in .C.' type=IrErrorType origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:test4 visibility:public modality:FINAL [delegated,var] + FIELD PROPERTY_BACKING_FIELD name:test4 type:IrErrorType visibility:public [static] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [delegated,var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:IrErrorType visibility:public [static] ' type=IrErrorType origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:IrErrorType) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [delegated,var] + VALUE_PARAMETER name: index:0 type:IrErrorType + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:IrErrorType visibility:public [static] ' type=kotlin.Unit origin=null + value: GET_VAR ': IrErrorType declared in .' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/declarations/extensionProperties.fir.txt b/compiler/testData/ir/irText/declarations/extensionProperties.fir.txt new file mode 100644 index 00000000000..40e76b22956 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/extensionProperties.fir.txt @@ -0,0 +1,55 @@ +FILE fqName: fileName:/extensionProperties.kt + PROPERTY name:test1 visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + CONST Int type=kotlin.Int value=42 + PROPERTY name:test2 visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + CONST Int type=kotlin.Int value=42 + FUN name: visibility:public modality:FINAL <> (value:IrErrorType) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var] + VALUE_PARAMETER name:value index:0 type:IrErrorType + BLOCK_BODY + CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host + CONSTRUCTOR visibility:public <> () returnType:.Host [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:test3 visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.Host) returnType:IrErrorType + correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .Host' + CONST Int type=kotlin.Int value=42 + PROPERTY name:test4 visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> ($this:.Host) returnType:IrErrorType + correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .Host' + CONST Int type=kotlin.Int value=42 + FUN name: visibility:public modality:FINAL <> ($this:.Host, value:IrErrorType) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Host + VALUE_PARAMETER name:value index:0 type:IrErrorType + BLOCK_BODY + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/fakeOverrides.fir.txt b/compiler/testData/ir/irText/declarations/fakeOverrides.fir.txt new file mode 100644 index 00000000000..f92babc54ca --- /dev/null +++ b/compiler/testData/ir/irText/declarations/fakeOverrides.fir.txt @@ -0,0 +1,115 @@ +FILE fqName: fileName:/fakeOverrides.kt + CLASS INTERFACE name:IFooStr modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFooStr + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFooStr, x:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IFooStr + VALUE_PARAMETER name:x index:0 type:kotlin.String + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:IBar modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IBar + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IBar) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.IBar + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:CFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CFoo + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> () returnType:.CFoo.CFoo> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL <> ($this:.CFoo, x:T of .CFoo) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.CFoo + VALUE_PARAMETER name:x index:0 type:T of .CFoo + BLOCK_BODY + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.CFoo; .IFooStr; .IBar] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 + CONSTRUCTOR visibility:public <> () returnType:.Test1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .CFoo' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.CFoo; .IFooStr; .IBar]' + PROPERTY name:bar visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.CFoo, x:kotlin.String) returnType:kotlin.Unit + overridden: + public final fun foo (x: T of .CFoo): kotlin.Unit declared in .CFoo + $this: VALUE_PARAMETER name: type:.CFoo + VALUE_PARAMETER name:x index:0 type:kotlin.String + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.IFooStr, x:kotlin.String) returnType:kotlin.Unit + overridden: + public abstract fun foo (x: kotlin.String): kotlin.Unit declared in .IFooStr + $this: VALUE_PARAMETER name: type:.IFooStr + VALUE_PARAMETER name:x index:0 type:kotlin.String + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/fileWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/fileWithAnnotations.fir.txt new file mode 100644 index 00000000000..6ef9676912e --- /dev/null +++ b/compiler/testData/ir/irText/declarations/fileWithAnnotations.fir.txt @@ -0,0 +1,12 @@ +FILE fqName: fileName:/fileWithAnnotations.kt + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + PROPERTY name:bar visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/declarations/fileWithTypeAliasesOnly.kt b/compiler/testData/ir/irText/declarations/fileWithTypeAliasesOnly.kt index cb118c6fc94..0b052a00bf4 100644 --- a/compiler/testData/ir/irText/declarations/fileWithTypeAliasesOnly.kt +++ b/compiler/testData/ir/irText/declarations/fileWithTypeAliasesOnly.kt @@ -1 +1,3 @@ +// FIR_IDENTICAL + typealias Bar = (T) -> String \ No newline at end of file diff --git a/compiler/testData/ir/irText/declarations/interfaceProperties.kt b/compiler/testData/ir/irText/declarations/interfaceProperties.kt index 6570c71d638..eec261e12ca 100644 --- a/compiler/testData/ir/irText/declarations/interfaceProperties.kt +++ b/compiler/testData/ir/irText/declarations/interfaceProperties.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // WITH_RUNTIME interface C { diff --git a/compiler/testData/ir/irText/declarations/kt27005.fir.txt b/compiler/testData/ir/irText/declarations/kt27005.fir.txt new file mode 100644 index 00000000000..61460830551 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/kt27005.fir.txt @@ -0,0 +1,13 @@ +FILE fqName: fileName:/kt27005.kt + FUN name:foo visibility:public modality:FINAL <> () returnType:T of .baz [suspend] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): T of .baz [suspend] declared in ' + CALL 'public final fun baz (): T of .baz [suspend] declared in ' type=T of .baz origin=null + FUN name:bar visibility:public modality:FINAL <> () returnType:T of .baz [suspend] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun bar (): T of .baz [suspend] declared in ' + CALL 'public final fun baz (): T of .baz [suspend] declared in ' type=T of .baz origin=null + FUN name:baz visibility:public modality:FINAL () returnType:T of .baz [suspend] + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + BLOCK_BODY + CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin' type=kotlin.Nothing origin=null diff --git a/compiler/testData/ir/irText/declarations/kt29833.fir.txt b/compiler/testData/ir/irText/declarations/kt29833.fir.txt new file mode 100644 index 00000000000..2de2cc101b7 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/kt29833.fir.txt @@ -0,0 +1,42 @@ +FILE fqName:interop fileName:/Definitions.kt + CLASS OBJECT name:Definitions modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:interop.Definitions + CONSTRUCTOR visibility:private <> () returnType:interop.Definitions [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Definitions modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:KT_CONSTANT visibility:public modality:FINAL [const,val] + FIELD PROPERTY_BACKING_FIELD name:KT_CONSTANT type:IrErrorType visibility:public [final] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:interop.Definitions) returnType:IrErrorType + correspondingProperty: PROPERTY name:KT_CONSTANT visibility:public modality:FINAL [const,val] + $this: VALUE_PARAMETER name: type:interop.Definitions + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in interop.Definitions' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:KT_CONSTANT type:IrErrorType visibility:public [final] ' type=IrErrorType origin=null + receiver: GET_VAR ': interop.Definitions declared in interop.Definitions.' type=interop.Definitions origin=null + PROPERTY name:ktValue visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:ktValue type:IrErrorType visibility:public [final] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:interop.Definitions) returnType:IrErrorType + correspondingProperty: PROPERTY name:ktValue visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:interop.Definitions + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in interop.Definitions' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ktValue type:IrErrorType visibility:public [final] ' type=IrErrorType origin=null + receiver: GET_VAR ': interop.Definitions declared in interop.Definitions.' type=interop.Definitions origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/localClassWithOverrides.fir.txt b/compiler/testData/ir/irText/declarations/localClassWithOverrides.fir.txt new file mode 100644 index 00000000000..4f652a5e5aa --- /dev/null +++ b/compiler/testData/ir/irText/declarations/localClassWithOverrides.fir.txt @@ -0,0 +1,75 @@ +FILE fqName: fileName:/localClassWithOverrides.kt + FUN name:outer visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CLASS CLASS name:ALocal modality:ABSTRACT visibility:local superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.outer.ALocal + CONSTRUCTOR visibility:public <> () returnType:IrErrorType [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ALocal modality:ABSTRACT visibility:local superTypes:[kotlin.Any]' + FUN name:afun visibility:public modality:ABSTRACT <> ($this:.outer.ALocal) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.outer.ALocal + PROPERTY name:aval visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.outer.ALocal) returnType:kotlin.Int + correspondingProperty: PROPERTY name:aval visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.outer.ALocal + PROPERTY name:avar visibility:public modality:ABSTRACT [var] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.outer.ALocal) returnType:kotlin.Int + correspondingProperty: PROPERTY name:avar visibility:public modality:ABSTRACT [var] + $this: VALUE_PARAMETER name: type:.outer.ALocal + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.outer.ALocal, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:avar visibility:public modality:ABSTRACT [var] + $this: VALUE_PARAMETER name: type:.outer.ALocal + VALUE_PARAMETER name: index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Local modality:FINAL visibility:local superTypes:[IrErrorType] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.outer.Local + CONSTRUCTOR visibility:public <> () returnType:IrErrorType [primary] + BLOCK_BODY + ERROR_CALL 'Cannot find delegated constructor call' type=IrErrorType + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Local modality:FINAL visibility:local superTypes:[IrErrorType]' + FUN name:afun visibility:public modality:FINAL <> ($this:.outer.Local) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.outer.Local + BLOCK_BODY + PROPERTY name:aval visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:aval type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.outer.Local) returnType:IrErrorType + correspondingProperty: PROPERTY name:aval visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.outer.Local + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .outer.Local' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:aval type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .outer.Local declared in .outer.Local.' type=.outer.Local origin=null + PROPERTY name:avar visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:avar type:kotlin.Int visibility:public + EXPRESSION_BODY + CONST Int type=kotlin.Int value=2 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.outer.Local) returnType:IrErrorType + correspondingProperty: PROPERTY name:avar visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.outer.Local + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .outer.Local' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:avar type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .outer.Local declared in .outer.Local.' type=.outer.Local origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.outer.Local, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:avar visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.outer.Local + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:avar type:kotlin.Int visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .outer.Local declared in .outer.Local.' type=.outer.Local origin=null + value: GET_VAR ': kotlin.Int declared in .outer.Local.' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.txt b/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.txt new file mode 100644 index 00000000000..eae4816d0ce --- /dev/null +++ b/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.txt @@ -0,0 +1,15 @@ +FILE fqName: fileName:/localDelegatedProperties.kt + FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:x type:IrErrorType [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val x: IrErrorType [val] declared in .test1' type=IrErrorType origin=null + FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:x type:IrErrorType [var] + ERROR_CALL 'Unresolved reference: R|/x|' type=IrErrorType + VAR name: type:IrErrorType [val] + GET_VAR 'var x: IrErrorType [var] declared in .test2' type=IrErrorType origin=null + ERROR_CALL 'Unresolved reference: R|/x|' type=IrErrorType + GET_VAR 'val : IrErrorType [val] declared in .test2' type=IrErrorType origin=null + ERROR_CALL 'Unresolved reference: R|/x|' type=IrErrorType diff --git a/compiler/testData/ir/irText/declarations/localVarInDoWhile.fir.txt b/compiler/testData/ir/irText/declarations/localVarInDoWhile.fir.txt new file mode 100644 index 00000000000..c8c4dfcdfeb --- /dev/null +++ b/compiler/testData/ir/irText/declarations/localVarInDoWhile.fir.txt @@ -0,0 +1,11 @@ +FILE fqName: fileName:/localVarInDoWhile.kt + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + DO_WHILE label=null origin=DO_WHILE_LOOP + body: BLOCK type=kotlin.Unit origin=null + VAR name:x type:kotlin.Int [val] + CONST Int type=kotlin.Int value=42 + condition: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + arg1: CONST Int type=kotlin.Unit value=42 diff --git a/compiler/testData/ir/irText/declarations/multiplatform/expectClassInherited.fir.txt b/compiler/testData/ir/irText/declarations/multiplatform/expectClassInherited.fir.txt new file mode 100644 index 00000000000..c4db6bb995b --- /dev/null +++ b/compiler/testData/ir/irText/declarations/multiplatform/expectClassInherited.fir.txt @@ -0,0 +1,95 @@ +FILE fqName: fileName:/expectClassInherited.kt + CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:protected <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:B modality:OPEN visibility:public superTypes:[.A] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:.B [primary] + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:OPEN visibility:public superTypes:[.A]' + FUN name:foo visibility:public modality:OPEN <> ($this:.B) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B + FUN name:bar visibility:public modality:OPEN <> ($this:.B, s:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B + VALUE_PARAMETER name:s index:0 type:kotlin.String + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:protected <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:B modality:OPEN visibility:public superTypes:[.A] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:.B [primary] + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () [primary] declared in .A' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:OPEN visibility:public superTypes:[.A]' + FUN name:foo visibility:public modality:OPEN <> ($this:.B) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + FUN name:bar visibility:public modality:OPEN <> ($this:.B, s:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass.fir.txt b/compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass.fir.txt new file mode 100644 index 00000000000..d92ea8342d7 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass.fir.txt @@ -0,0 +1,152 @@ +FILE fqName: fileName:/expectedEnumClass.kt + CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum + CONSTRUCTOR visibility:private <> () returnType:.MyEnum [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public superTypes:[kotlin.Enum]' + CLASS ENUM_ENTRY name:FOO modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum.FOO + CONSTRUCTOR visibility:public <> () returnType:.MyEnum.FOO [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:FOO modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ENUM_ENTRY name:BAR modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum.BAR + CONSTRUCTOR visibility:public <> () returnType:.MyEnum.BAR [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:BAR modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum + CONSTRUCTOR visibility:private <> () returnType:.MyEnum [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public superTypes:[kotlin.Enum]' + CLASS ENUM_ENTRY name:FOO modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum.FOO + CONSTRUCTOR visibility:public <> () returnType:.MyEnum.FOO [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:FOO modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ENUM_ENTRY name:BAR modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum.BAR + CONSTRUCTOR visibility:public <> () returnType:.MyEnum.BAR [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:BAR modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ENUM_ENTRY name:BAZ modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum.BAZ + CONSTRUCTOR visibility:public <> () returnType:.MyEnum.BAZ [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:BAZ modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum diff --git a/compiler/testData/ir/irText/declarations/multiplatform/expectedSealedClass.fir.txt b/compiler/testData/ir/irText/declarations/multiplatform/expectedSealedClass.fir.txt new file mode 100644 index 00000000000..186a3640261 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/multiplatform/expectedSealedClass.fir.txt @@ -0,0 +1,77 @@ +FILE fqName: fileName:/expectedSealedClass.kt + CLASS CLASS name:Ops modality:SEALED visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ops + CONSTRUCTOR visibility:private <> () returnType:.Ops [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Ops modality:SEALED visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Add modality:FINAL visibility:public superTypes:[.Ops] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Add + CONSTRUCTOR visibility:public <> () returnType:.Add [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Add modality:FINAL visibility:public superTypes:[.Ops]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Ops modality:SEALED visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ops + CONSTRUCTOR visibility:private <> () returnType:.Ops [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Ops modality:SEALED visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Add modality:FINAL visibility:public superTypes:[.Ops] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Add + CONSTRUCTOR visibility:public <> () returnType:.Add [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Ops' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Add modality:FINAL visibility:public superTypes:[.Ops]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.txt b/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.txt new file mode 100644 index 00000000000..45c1571445d --- /dev/null +++ b/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.txt @@ -0,0 +1,83 @@ +FILE fqName: fileName:/packageLevelProperties.kt + PROPERTY name:test1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + PROPERTY name:test2 visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=0 + PROPERTY name:test3 visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:public [static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:public [static] ' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:public [static] ' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null + PROPERTY name:test4 visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Int visibility:public [static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Int visibility:public [static] ' type=kotlin.Int origin=null + FUN name: visibility:public modality:FINAL <> (value:IrErrorType) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [var] + VALUE_PARAMETER name:value index:0 type:IrErrorType + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + PROPERTY name:test5 visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.Int visibility:public [static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test5 visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.Int visibility:public [static] ' type=kotlin.Int origin=null + FUN name: visibility:private modality:FINAL <> (value:IrErrorType) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:test5 visibility:public modality:FINAL [var] + VALUE_PARAMETER name:value index:0 type:IrErrorType + PROPERTY name:test6 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test6 type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test6 visibility:public modality:FINAL [val] + PROPERTY name:test7 visibility:public modality:FINAL [delegated,val] + FIELD PROPERTY_BACKING_FIELD name:test7 type:IrErrorType visibility:public [final,static] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test7 visibility:public modality:FINAL [delegated,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test7 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] + FIELD PROPERTY_BACKING_FIELD name:test8 type:IrErrorType visibility:public [static] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test8 type:IrErrorType visibility:public [static] ' type=IrErrorType origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:IrErrorType) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] + VALUE_PARAMETER name: index:0 type:IrErrorType + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test8 type:IrErrorType visibility:public [static] ' type=kotlin.Unit origin=null + value: GET_VAR ': IrErrorType declared in .' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/declarations/parameters/class.fir.txt b/compiler/testData/ir/irText/declarations/parameters/class.fir.txt new file mode 100644 index 00000000000..da15dc2017b --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/class.fir.txt @@ -0,0 +1,93 @@ +FILE fqName: fileName:/class.kt + CLASS INTERFACE name:TestInterface modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInterface + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + CLASS INTERFACE name:TestNestedInterface modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInterface.TestNestedInterface + TYPE_PARAMETER name:TT index:0 variance: superTypes:[] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test + TYPE_PARAMETER name:T0 index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> () returnType:.Test.Test> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any]' + CLASS CLASS name:TestNested modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test.TestNested + TYPE_PARAMETER name:T1 index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> () returnType:.Test.TestNested.Test.TestNested> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestNested modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test.TestInner + TYPE_PARAMETER name:T2 index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> () returnType:.Test.TestInner.Test.TestInner> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/parameters/constructor.fir.txt b/compiler/testData/ir/irText/declarations/parameters/constructor.fir.txt new file mode 100644 index 00000000000..68d019ba3cb --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/constructor.fir.txt @@ -0,0 +1,202 @@ +FILE fqName: fileName:/constructor.kt + CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 + TYPE_PARAMETER name:T1 index:0 variance: superTypes:[] + TYPE_PARAMETER name:T2 index:1 variance: superTypes:[] + CONSTRUCTOR visibility:public <> (x:T1 of .Test1, y:T2 of .Test1) returnType:.Test1.Test1, T2 of .Test1> [primary] + VALUE_PARAMETER name:x index:0 type:T1 of .Test1 + VALUE_PARAMETER name:y index:1 type:T2 of .Test1 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:T1 of .Test1 visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: T1 of .Test1 declared in .Test1.' type=T1 of .Test1 origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:T1 of .Test1 + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T1 of .Test1 declared in .Test1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T1 of .Test1 visibility:public [final] ' type=T1 of .Test1 origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + PROPERTY name:y visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:y type:T2 of .Test1 visibility:public [final] + EXPRESSION_BODY + GET_VAR 'y: T2 of .Test1 declared in .Test1.' type=T2 of .Test1 origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:T2 of .Test1 + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T2 of .Test1 declared in .Test1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:T2 of .Test1 visibility:public [final] ' type=T2 of .Test1 origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.String) returnType:.Test2 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:y visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'y: kotlin.String declared in .Test2.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test2) returnType:kotlin.String + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Test2' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null + CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2.TestInner + TYPE_PARAMETER name:Z index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> (z:Z of .Test2.TestInner) returnType:.Test2.TestInner.Test2.TestInner> [primary] + VALUE_PARAMETER name:z index:0 type:Z of .Test2.TestInner + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' + PROPERTY name:z visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:z type:Z of .Test2.TestInner visibility:public [final] + EXPRESSION_BODY + GET_VAR 'z: Z of .Test2.TestInner declared in .Test2.TestInner.' type=Z of .Test2.TestInner origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test2.TestInner) returnType:Z of .Test2.TestInner + correspondingProperty: PROPERTY name:z visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test2.TestInner + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): Z of .Test2.TestInner declared in .Test2.TestInner' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:Z of .Test2.TestInner visibility:public [final] ' type=Z of .Test2.TestInner origin=null + receiver: GET_VAR ': .Test2.TestInner declared in .Test2.TestInner.' type=.Test2.TestInner origin=null + CONSTRUCTOR visibility:public <> (z:Z of .Test2.TestInner, i:kotlin.Int) returnType:.Test2.TestInner.Test2.TestInner> + VALUE_PARAMETER name:z index:0 type:Z of .Test2.TestInner + VALUE_PARAMETER name:i index:1 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (z: Z of .Test2.TestInner) [primary] declared in .Test2.TestInner' + z: GET_VAR 'z: Z of .Test2.TestInner declared in .Test2.TestInner.' type=Z of .Test2.TestInner origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test3 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test3 + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.String) returnType:.Test3 [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.String + EXPRESSION_BODY + CONST String type=kotlin.String value="" + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test3 modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .Test3.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test3) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test3 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test3' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.' type=.Test3 origin=null + PROPERTY name:y visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'y: kotlin.String declared in .Test3.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test3) returnType:kotlin.String + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test3 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Test3' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.' type=.Test3 origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test4 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test4 + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test4.Test4> [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test4 modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .Test4.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test4) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test4 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test4' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test4 declared in .Test4.' type=.Test4 origin=null + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.Test4.Test4> + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=42 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int) [primary] declared in .Test4' + x: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'y: kotlin.Int declared in .Test4.' type=kotlin.Int origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.fir.txt b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.fir.txt new file mode 100644 index 00000000000..828e4a89048 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.fir.txt @@ -0,0 +1,47 @@ +FILE fqName: fileName:/dataClassMembers.kt + CLASS CLASS name:Test modality:FINAL visibility:public [data] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> (x:T of .Test, y:kotlin.String) returnType:.Test.Test> [primary] + VALUE_PARAMETER name:x index:0 type:T of .Test + VALUE_PARAMETER name:y index:1 type:kotlin.String + EXPRESSION_BODY + CONST String type=kotlin.String value="" + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: T of .Test declared in .Test.' type=T of .Test origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test) returnType:T of .Test + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of .Test declared in .Test' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test visibility:public [final] ' type=T of .Test origin=null + receiver: GET_VAR ': .Test declared in .Test.' type=.Test origin=null + PROPERTY name:y visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'y: kotlin.String declared in .Test.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test) returnType:kotlin.String + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Test' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .Test declared in .Test.' type=.Test origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.fir.txt b/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.fir.txt new file mode 100644 index 00000000000..6da959566cc --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.fir.txt @@ -0,0 +1,128 @@ +FILE fqName: fileName:/defaultPropertyAccessors.kt + PROPERTY name:test1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + PROPERTY name:test2 visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:public [static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:public [static] ' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:public [static] ' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null + CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host + CONSTRUCTOR visibility:public <> () returnType:.Host [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:testMember1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:testMember1 type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Int + correspondingProperty: PROPERTY name:testMember1 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Host' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testMember1 type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Host declared in .Host.' type=.Host origin=null + PROPERTY name:testMember2 visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:testMember2 type:kotlin.Int visibility:public + EXPRESSION_BODY + CONST Int type=kotlin.Int value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Int + correspondingProperty: PROPERTY name:testMember2 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Host' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testMember2 type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Host declared in .Host.' type=.Host origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:testMember2 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Host + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testMember2 type:kotlin.Int visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .Host declared in .Host.' type=.Host origin=null + value: GET_VAR ': kotlin.Int declared in .Host.' type=kotlin.Int origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:InPrimaryCtor modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.InPrimaryCtor + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> (testInPrimaryCtor1:T of .InPrimaryCtor, testInPrimaryCtor2:kotlin.Int) returnType:.InPrimaryCtor.InPrimaryCtor> [primary] + VALUE_PARAMETER name:testInPrimaryCtor1 index:0 type:T of .InPrimaryCtor + VALUE_PARAMETER name:testInPrimaryCtor2 index:1 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=42 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:InPrimaryCtor modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:testInPrimaryCtor1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:testInPrimaryCtor1 type:T of .InPrimaryCtor visibility:public [final] + EXPRESSION_BODY + GET_VAR 'testInPrimaryCtor1: T of .InPrimaryCtor declared in .InPrimaryCtor.' type=T of .InPrimaryCtor origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.InPrimaryCtor) returnType:T of .InPrimaryCtor + correspondingProperty: PROPERTY name:testInPrimaryCtor1 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.InPrimaryCtor + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of .InPrimaryCtor declared in .InPrimaryCtor' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testInPrimaryCtor1 type:T of .InPrimaryCtor visibility:public [final] ' type=T of .InPrimaryCtor origin=null + receiver: GET_VAR ': .InPrimaryCtor declared in .InPrimaryCtor.' type=.InPrimaryCtor origin=null + PROPERTY name:testInPrimaryCtor2 visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:testInPrimaryCtor2 type:kotlin.Int visibility:public + EXPRESSION_BODY + GET_VAR 'testInPrimaryCtor2: kotlin.Int declared in .InPrimaryCtor.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.InPrimaryCtor) returnType:kotlin.Int + correspondingProperty: PROPERTY name:testInPrimaryCtor2 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.InPrimaryCtor + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .InPrimaryCtor' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testInPrimaryCtor2 type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .InPrimaryCtor declared in .InPrimaryCtor.' type=.InPrimaryCtor origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.InPrimaryCtor, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:testInPrimaryCtor2 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.InPrimaryCtor + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testInPrimaryCtor2 type:kotlin.Int visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .InPrimaryCtor declared in .InPrimaryCtor.' type=.InPrimaryCtor origin=null + value: GET_VAR ': kotlin.Int declared in .InPrimaryCtor.' type=kotlin.Int origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.txt b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.txt new file mode 100644 index 00000000000..035d9c38eb9 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.txt @@ -0,0 +1,37 @@ +FILE fqName: fileName:/delegatedMembers.kt + CLASS INTERFACE name:IBase modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IBase + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IBase, x:kotlin.Int) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IBase + VALUE_PARAMETER name:x index:0 type:kotlin.Int + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IBase) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.IBase + FUN name:qux visibility:public modality:ABSTRACT ($this:.IBase, t:T of .IBase, x:X of .IBase.qux) returnType:kotlin.Unit + TYPE_PARAMETER name:X index:0 variance: superTypes:[] + $this: VALUE_PARAMETER name: type:.IBase + VALUE_PARAMETER name:t index:0 type:T of .IBase + VALUE_PARAMETER name:x index:1 type:X of .IBase.qux + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test + TYPE_PARAMETER name:TT index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> (impl:.IBase.Test>) returnType:.Test.Test> [primary] + VALUE_PARAMETER name:impl index:0 type:.IBase.Test> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[]' diff --git a/compiler/testData/ir/irText/declarations/parameters/fun.fir.txt b/compiler/testData/ir/irText/declarations/parameters/fun.fir.txt new file mode 100644 index 00000000000..9f2b0afcdff --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/fun.fir.txt @@ -0,0 +1,51 @@ +FILE fqName: fileName:/fun.kt + FUN name:test1 visibility:public modality:FINAL (i:kotlin.Int, j:T of .test1) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:j index:1 type:T of .test1 + BLOCK_BODY + FUN name:test2 visibility:public modality:FINAL <> (i:kotlin.Int, j:kotlin.String) returnType:kotlin.Unit + VALUE_PARAMETER name:i index:0 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + VALUE_PARAMETER name:j index:1 type:kotlin.String + EXPRESSION_BODY + CONST String type=kotlin.String value="" + BLOCK_BODY + FUN name:test3 visibility:public modality:FINAL <> (args:kotlin.String) returnType:kotlin.Unit + VALUE_PARAMETER name:args index:0 type:kotlin.String + BLOCK_BODY + FUN name:textExt1 visibility:public modality:FINAL <> (i:kotlin.Int, j:kotlin.String) returnType:kotlin.Unit + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:j index:1 type:kotlin.String + BLOCK_BODY + CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host + CONSTRUCTOR visibility:public <> () returnType:.Host [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:testMembetExt1 visibility:public modality:FINAL <> ($this:.Host, i:kotlin.Int, j:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Host + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:j index:1 type:kotlin.String + BLOCK_BODY + FUN name:testMembetExt2 visibility:public modality:FINAL ($this:.Host, i:kotlin.Int, j:T of .Host.testMembetExt2) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + $this: VALUE_PARAMETER name: type:.Host + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:j index:1 type:T of .Host.testMembetExt2 + BLOCK_BODY + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.fir.txt b/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.fir.txt new file mode 100644 index 00000000000..08ac07fc073 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.fir.txt @@ -0,0 +1,46 @@ +FILE fqName: fileName:/genericInnerClass.kt + CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer + TYPE_PARAMETER name:T1 index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> () returnType:.Outer.Outer> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' + CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner + TYPE_PARAMETER name:T2 index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> () returnType:.Outer.Inner.Outer.Inner> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL <> ($this:.Outer.Inner, x1:T1 of .Outer, x2:T2 of .Outer.Inner) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Outer.Inner + VALUE_PARAMETER name:x1 index:0 type:T1 of .Outer + VALUE_PARAMETER name:x2 index:1 type:T2 of .Outer.Inner + BLOCK_BODY + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/parameters/lambdas.fir.txt b/compiler/testData/ir/irText/declarations/parameters/lambdas.fir.txt new file mode 100644 index 00000000000..960c96c3e1d --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/lambdas.fir.txt @@ -0,0 +1,59 @@ +FILE fqName: fileName:/lambdas.kt + PROPERTY name:test1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function1 visibility:public [final,static] + EXPRESSION_BODY + BLOCK type=kotlin.Function1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Function1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Function1 declared in .test1' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUNCTION_REFERENCE 'local final fun (): kotlin.Function1 declared in .test1' type=kotlin.Function1 origin=LAMBDA + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function1 + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function1 declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function1 visibility:public [final,static] ' type=kotlin.Function1 origin=null + PROPERTY name:test2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Function2 visibility:public [final,static] + EXPRESSION_BODY + BLOCK type=kotlin.Function2 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Function2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Function2 declared in .test2' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUNCTION_REFERENCE 'local final fun (): kotlin.Function2 declared in .test2' type=kotlin.Function2 origin=LAMBDA + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function2 + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function2 declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Function2 visibility:public [final,static] ' type=kotlin.Function2 origin=null + PROPERTY name:test3 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test3 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (i:kotlin.Int, j:kotlin.Int) returnType:IrErrorType + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:j index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (i: kotlin.Int, j: kotlin.Int): IrErrorType declared in .test3' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + FUNCTION_REFERENCE 'local final fun (i: kotlin.Int, j: kotlin.Int): IrErrorType declared in .test3' type=IrErrorType origin=LAMBDA + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:test4 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test4 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + BLOCK type=IrErrorType origin=ANONYMOUS_FUNCTION + FUN name: visibility:local modality:FINAL <> (i:kotlin.Int, j:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:j index:1 type:kotlin.Int + BLOCK_BODY + FUNCTION_REFERENCE 'local final fun (i: kotlin.Int, j: kotlin.Int): kotlin.Unit declared in .test4' type=IrErrorType origin=ANONYMOUS_FUNCTION + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/declarations/parameters/localFun.fir.txt b/compiler/testData/ir/irText/declarations/parameters/localFun.fir.txt new file mode 100644 index 00000000000..1f98ae83730 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/localFun.fir.txt @@ -0,0 +1,24 @@ +FILE fqName: fileName:/localFun.kt + FUN name:outer visibility:public modality:FINAL () returnType:kotlin.Unit + TYPE_PARAMETER name:TT index:0 variance: superTypes:[] + BLOCK_BODY + FUN name:test1 visibility:local modality:FINAL (i:kotlin.Int, j:T of .outer.test1) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:j index:1 type:T of .outer.test1 + BLOCK_BODY + FUN name:test2 visibility:local modality:FINAL <> (i:kotlin.Int, j:kotlin.String) returnType:kotlin.Unit + VALUE_PARAMETER name:i index:0 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + VALUE_PARAMETER name:j index:1 type:kotlin.String + EXPRESSION_BODY + CONST String type=kotlin.String value="" + BLOCK_BODY + FUN name:test3 visibility:local modality:FINAL <> (args:kotlin.String) returnType:kotlin.Unit + VALUE_PARAMETER name:args index:0 type:kotlin.String + BLOCK_BODY + FUN name:textExt1 visibility:local modality:FINAL <> (i:kotlin.Int, j:TT of .outer) returnType:kotlin.Unit + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:j index:1 type:TT of .outer + BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.fir.txt b/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.fir.txt new file mode 100644 index 00000000000..73fe1274757 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.fir.txt @@ -0,0 +1,126 @@ +FILE fqName: fileName:/propertyAccessors.kt + PROPERTY name:test1 visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + CONST Int type=kotlin.Int value=42 + PROPERTY name:test2 visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + CONST Int type=kotlin.Int value=42 + FUN name: visibility:public modality:FINAL <> (value:IrErrorType) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var] + VALUE_PARAMETER name:value index:0 type:IrErrorType + BLOCK_BODY + PROPERTY name:testExt1 visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:testExt1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + CONST Int type=kotlin.Int value=42 + PROPERTY name:testExt2 visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:testExt2 visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + CONST Int type=kotlin.Int value=42 + FUN name: visibility:public modality:FINAL <> (value:IrErrorType) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:testExt2 visibility:public modality:FINAL [var] + VALUE_PARAMETER name:value index:0 type:IrErrorType + BLOCK_BODY + PROPERTY name:testExt3 visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:testExt3 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + CONST Int type=kotlin.Int value=42 + PROPERTY name:testExt4 visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:testExt4 visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + CONST Int type=kotlin.Int value=42 + FUN name: visibility:public modality:FINAL <> (value:IrErrorType) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:testExt4 visibility:public modality:FINAL [var] + VALUE_PARAMETER name:value index:0 type:IrErrorType + BLOCK_BODY + CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> () returnType:.Host.Host> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:testMem1 visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.Host) returnType:IrErrorType + correspondingProperty: PROPERTY name:testMem1 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .Host' + CONST Int type=kotlin.Int value=42 + PROPERTY name:testMem2 visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> ($this:.Host) returnType:IrErrorType + correspondingProperty: PROPERTY name:testMem2 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .Host' + CONST Int type=kotlin.Int value=42 + FUN name: visibility:public modality:FINAL <> ($this:.Host, value:IrErrorType) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:testMem2 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Host + VALUE_PARAMETER name:value index:0 type:IrErrorType + BLOCK_BODY + PROPERTY name:testMemExt1 visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.Host) returnType:IrErrorType + correspondingProperty: PROPERTY name:testMemExt1 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .Host' + CONST Int type=kotlin.Int value=42 + PROPERTY name:testMemExt2 visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> ($this:.Host) returnType:IrErrorType + correspondingProperty: PROPERTY name:testMemExt2 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .Host' + CONST Int type=kotlin.Int value=42 + FUN name: visibility:public modality:FINAL <> ($this:.Host, value:IrErrorType) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:testMemExt2 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Host + VALUE_PARAMETER name:value index:0 type:IrErrorType + BLOCK_BODY + PROPERTY name:testMemExt3 visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.Host) returnType:IrErrorType + correspondingProperty: PROPERTY name:testMemExt3 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .Host' + CONST Int type=kotlin.Int value=42 + PROPERTY name:testMemExt4 visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> ($this:.Host) returnType:IrErrorType + correspondingProperty: PROPERTY name:testMemExt4 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .Host' + CONST Int type=kotlin.Int value=42 + FUN name: visibility:public modality:FINAL <> ($this:.Host, value:IrErrorType) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:testMemExt4 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Host + VALUE_PARAMETER name:value index:0 type:IrErrorType + BLOCK_BODY + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.fir.txt b/compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.fir.txt new file mode 100644 index 00000000000..e53914bf4ef --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.fir.txt @@ -0,0 +1,34 @@ +FILE fqName: fileName:/typeParameterBeforeBound.kt + CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + TYPE_PARAMETER name:U index:1 variance: superTypes:[] + CONSTRUCTOR visibility:public <> () returnType:.Test1.Test1, U of .Test1> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test2 visibility:public modality:FINAL () returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + TYPE_PARAMETER name:U index:1 variance: superTypes:[] + BLOCK_BODY + PROPERTY name:test3 visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Unit + correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [var] + BLOCK_BODY + FUN name: visibility:public modality:FINAL <> (value:kotlin.Unit) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [var] + VALUE_PARAMETER name:value index:0 type:kotlin.Unit + BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.fir.txt b/compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.fir.txt new file mode 100644 index 00000000000..31fbcb6668f --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.fir.txt @@ -0,0 +1,88 @@ +FILE fqName: fileName:/typeParameterBoundedBySubclass.kt + CLASS CLASS name:Base1 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> () returnType:.Base1.Base1> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base1 modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[.Base1<.Derived1>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived1 + CONSTRUCTOR visibility:public <> () returnType:.Derived1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Base1' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[.Base1<.Derived1>]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Base2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base2 + CONSTRUCTOR visibility:public <> () returnType:.Base2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL ($this:.Base2, x:T of .Base2.foo) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + $this: VALUE_PARAMETER name: type:.Base2 + VALUE_PARAMETER name:x index:0 type:T of .Base2.foo + BLOCK_BODY + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Derived2 modality:FINAL visibility:public superTypes:[.Base2] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived2 + CONSTRUCTOR visibility:public <> () returnType:.Derived2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Base2' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived2 modality:FINAL visibility:public superTypes:[.Base2]' + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Base2, x:T of .Base2.foo) returnType:kotlin.Unit + overridden: + public final fun foo (x: T of .Base2.foo): kotlin.Unit declared in .Base2 + $this: VALUE_PARAMETER name: type:.Base2 + VALUE_PARAMETER name:x index:0 type:T of .Base2.foo + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/primaryCtorDefaultArguments.kt b/compiler/testData/ir/irText/declarations/primaryCtorDefaultArguments.kt index 600e99d57f9..db717afd929 100644 --- a/compiler/testData/ir/irText/declarations/primaryCtorDefaultArguments.kt +++ b/compiler/testData/ir/irText/declarations/primaryCtorDefaultArguments.kt @@ -1 +1,3 @@ +// FIR_IDENTICAL + class Test(val x: Int = 0) \ No newline at end of file diff --git a/compiler/testData/ir/irText/declarations/primaryCtorProperties.kt b/compiler/testData/ir/irText/declarations/primaryCtorProperties.kt index 5a322a49d6d..686d7225c5c 100644 --- a/compiler/testData/ir/irText/declarations/primaryCtorProperties.kt +++ b/compiler/testData/ir/irText/declarations/primaryCtorProperties.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL + class C( val test1: Int, var test2: Int diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.fir.txt new file mode 100644 index 00000000000..cb73912a127 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.fir.txt @@ -0,0 +1,68 @@ +FILE fqName: fileName:/differentReceivers.kt + CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyClass + CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.MyClass [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'value: kotlin.String declared in .MyClass.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyClass) returnType:kotlin.String + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.MyClass + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .MyClass' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .MyClass declared in .MyClass.' type=.MyClass origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:provideDelegate visibility:public modality:FINAL <> (host:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String + VALUE_PARAMETER name:host index:0 type:kotlin.Any? + VALUE_PARAMETER name:p index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun provideDelegate (host: kotlin.Any?, p: kotlin.Any): kotlin.String declared in ' + CALL 'public final fun (): kotlin.String declared in .MyClass' type=kotlin.String origin=null + FUN name:getValue visibility:public modality:FINAL <> (receiver:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String + VALUE_PARAMETER name:receiver index:0 type:kotlin.Any? + VALUE_PARAMETER name:p index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (receiver: kotlin.Any?, p: kotlin.Any): kotlin.String declared in ' + ERROR_CALL 'Unresolved reference: this#' type=kotlin.String + PROPERTY name:testO visibility:public modality:FINAL [delegated,val] + FIELD PROPERTY_BACKING_FIELD name:testO type:IrErrorType visibility:public [final,static] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:testO visibility:public modality:FINAL [delegated,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testO type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:testK visibility:public modality:FINAL [delegated,val] + FIELD PROPERTY_BACKING_FIELD name:testK type:IrErrorType visibility:public [final,static] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:testK visibility:public modality:FINAL [delegated,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testK type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:testOK visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:testOK type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CALL 'public final fun (): IrErrorType declared in ' type=IrErrorType origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:testOK visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testOK type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/local.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/local.fir.txt new file mode 100644 index 00000000000..84d7583f45e --- /dev/null +++ b/compiler/testData/ir/irText/declarations/provideDelegate/local.fir.txt @@ -0,0 +1,81 @@ +FILE fqName: fileName:/local.kt + CLASS CLASS name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegate + CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.Delegate [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'value: kotlin.String declared in .Delegate.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Delegate) returnType:kotlin.String + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Delegate + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Delegate' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .Delegate declared in .Delegate.' type=.Delegate origin=null + FUN name:getValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, property:kotlin.Any?) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.Delegate + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:property index:1 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, property: kotlin.Any?): kotlin.String declared in .Delegate' + CALL 'public final fun (): kotlin.String declared in .Delegate' type=kotlin.String origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:DelegateProvider modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DelegateProvider + CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.DelegateProvider [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DelegateProvider modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'value: kotlin.String declared in .DelegateProvider.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.DelegateProvider) returnType:kotlin.String + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.DelegateProvider + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .DelegateProvider' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .DelegateProvider declared in .DelegateProvider.' type=.DelegateProvider origin=null + FUN name:provideDelegate visibility:public modality:FINAL <> ($this:.DelegateProvider, thisRef:kotlin.Any?, property:kotlin.Any?) returnType:.Delegate + $this: VALUE_PARAMETER name: type:.DelegateProvider + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:property index:1 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): .Delegate declared in .DelegateProvider' + CALL 'public constructor (value: kotlin.String) [primary] declared in .Delegate' type=.Delegate origin=null + value: CALL 'public final fun (): kotlin.String declared in .DelegateProvider' type=kotlin.String origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:testMember type:IrErrorType [val] diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.fir.txt new file mode 100644 index 00000000000..96a0816ec9b --- /dev/null +++ b/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.fir.txt @@ -0,0 +1,53 @@ +FILE fqName: fileName:/localDifferentReceivers.kt + CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyClass + CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.MyClass [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'value: kotlin.String declared in .MyClass.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyClass) returnType:kotlin.String + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.MyClass + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .MyClass' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .MyClass declared in .MyClass.' type=.MyClass origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:provideDelegate visibility:public modality:FINAL <> (host:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String + VALUE_PARAMETER name:host index:0 type:kotlin.Any? + VALUE_PARAMETER name:p index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun provideDelegate (host: kotlin.Any?, p: kotlin.Any): kotlin.String declared in ' + CALL 'public final fun (): kotlin.String declared in .MyClass' type=kotlin.String origin=null + FUN name:getValue visibility:public modality:FINAL <> (receiver:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String + VALUE_PARAMETER name:receiver index:0 type:kotlin.Any? + VALUE_PARAMETER name:p index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (receiver: kotlin.Any?, p: kotlin.Any): kotlin.String declared in ' + ERROR_CALL 'Unresolved reference: this#' type=kotlin.String + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + VAR name:testO type:IrErrorType [val] + VAR name:testK type:IrErrorType [val] + VAR name:testOK type:IrErrorType [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val testK: IrErrorType [val] declared in .box' type=IrErrorType origin=null + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + GET_VAR 'val testOK: IrErrorType [val] declared in .box' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/member.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/member.fir.txt new file mode 100644 index 00000000000..76ef9890729 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/provideDelegate/member.fir.txt @@ -0,0 +1,106 @@ +FILE fqName: fileName:/member.kt + CLASS CLASS name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegate + CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.Delegate [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'value: kotlin.String declared in .Delegate.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Delegate) returnType:kotlin.String + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Delegate + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Delegate' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .Delegate declared in .Delegate.' type=.Delegate origin=null + FUN name:getValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, property:kotlin.Any?) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.Delegate + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:property index:1 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, property: kotlin.Any?): kotlin.String declared in .Delegate' + CALL 'public final fun (): kotlin.String declared in .Delegate' type=kotlin.String origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:DelegateProvider modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DelegateProvider + CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.DelegateProvider [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DelegateProvider modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'value: kotlin.String declared in .DelegateProvider.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.DelegateProvider) returnType:kotlin.String + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.DelegateProvider + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .DelegateProvider' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .DelegateProvider declared in .DelegateProvider.' type=.DelegateProvider origin=null + FUN name:provideDelegate visibility:public modality:FINAL <> ($this:.DelegateProvider, thisRef:kotlin.Any?, property:kotlin.Any?) returnType:.Delegate + $this: VALUE_PARAMETER name: type:.DelegateProvider + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:property index:1 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): .Delegate declared in .DelegateProvider' + CALL 'public constructor (value: kotlin.String) [primary] declared in .Delegate' type=.Delegate origin=null + value: CALL 'public final fun (): kotlin.String declared in .DelegateProvider' type=kotlin.String origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host + CONSTRUCTOR visibility:public <> () returnType:.Host [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:testMember visibility:public modality:FINAL [delegated,val] + FIELD PROPERTY_BACKING_FIELD name:testMember type:IrErrorType visibility:public [final] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host) returnType:IrErrorType + correspondingProperty: PROPERTY name:testMember visibility:public modality:FINAL [delegated,val] + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .Host' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testMember type:IrErrorType visibility:public [final] ' type=IrErrorType origin=null + receiver: GET_VAR ': .Host declared in .Host.' type=.Host origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt new file mode 100644 index 00000000000..d78a54d84eb --- /dev/null +++ b/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt @@ -0,0 +1,87 @@ +FILE fqName: fileName:/memberExtension.kt + CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host + CONSTRUCTOR visibility:private <> () returnType:.Host [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' + CLASS CLASS name:StringDelegate modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host.StringDelegate + CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:.Host.StringDelegate [primary] + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:StringDelegate modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:s visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 's: kotlin.String declared in .Host.StringDelegate.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host.StringDelegate) returnType:kotlin.String + correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Host.StringDelegate + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Host.StringDelegate' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .Host.StringDelegate declared in .Host.StringDelegate.' type=.Host.StringDelegate origin=null + FUN name:getValue visibility:public modality:FINAL <> ($this:.Host.StringDelegate, receiver:kotlin.String, p:kotlin.Any) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.Host.StringDelegate + VALUE_PARAMETER name:receiver index:0 type:kotlin.String + VALUE_PARAMETER name:p index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (receiver: kotlin.String, p: kotlin.Any): kotlin.String declared in .Host.StringDelegate' + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + other: CALL 'public final fun (): kotlin.String declared in .Host.StringDelegate' type=kotlin.String origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:provideDelegate visibility:public modality:FINAL <> ($this:.Host, host:kotlin.Any?, p:kotlin.Any) returnType:IrErrorType + $this: VALUE_PARAMETER name: type:.Host + VALUE_PARAMETER name:host index:0 type:kotlin.Any? + VALUE_PARAMETER name:p index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun provideDelegate (host: kotlin.Any?, p: kotlin.Any): IrErrorType declared in .Host' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: this#' type=kotlin.String + PROPERTY name:plusK visibility:public modality:FINAL [delegated,val] + FIELD PROPERTY_BACKING_FIELD name:plusK type:IrErrorType visibility:public [final] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host) returnType:IrErrorType + correspondingProperty: PROPERTY name:plusK visibility:public modality:FINAL [delegated,val] + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .Host' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:plusK type:IrErrorType visibility:public [final] ' type=IrErrorType origin=null + receiver: GET_VAR ': .Host declared in .Host.' type=.Host origin=null + PROPERTY name:ok visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:ok type:IrErrorType visibility:public [final] + EXPRESSION_BODY + CALL 'public final fun (): IrErrorType declared in .Host' type=IrErrorType origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host) returnType:IrErrorType + correspondingProperty: PROPERTY name:ok visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .Host' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ok type:IrErrorType visibility:public [final] ' type=IrErrorType origin=null + receiver: GET_VAR ': .Host declared in .Host.' type=.Host origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.fir.txt new file mode 100644 index 00000000000..458bc7f4659 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.fir.txt @@ -0,0 +1,85 @@ +FILE fqName: fileName:/topLevel.kt + CLASS CLASS name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegate + CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.Delegate [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'value: kotlin.String declared in .Delegate.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Delegate) returnType:kotlin.String + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Delegate + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Delegate' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .Delegate declared in .Delegate.' type=.Delegate origin=null + FUN name:getValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, property:kotlin.Any?) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.Delegate + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:property index:1 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, property: kotlin.Any?): kotlin.String declared in .Delegate' + CALL 'public final fun (): kotlin.String declared in .Delegate' type=kotlin.String origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:DelegateProvider modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DelegateProvider + CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.DelegateProvider [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DelegateProvider modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:public [final] + EXPRESSION_BODY + GET_VAR 'value: kotlin.String declared in .DelegateProvider.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.DelegateProvider) returnType:kotlin.String + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.DelegateProvider + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .DelegateProvider' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .DelegateProvider declared in .DelegateProvider.' type=.DelegateProvider origin=null + FUN name:provideDelegate visibility:public modality:FINAL <> ($this:.DelegateProvider, thisRef:kotlin.Any?, property:kotlin.Any?) returnType:.Delegate + $this: VALUE_PARAMETER name: type:.DelegateProvider + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:property index:1 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): .Delegate declared in .DelegateProvider' + CALL 'public constructor (value: kotlin.String) [primary] declared in .Delegate' type=.Delegate origin=null + value: CALL 'public final fun (): kotlin.String declared in .DelegateProvider' type=kotlin.String origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:testTopLevel visibility:public modality:FINAL [delegated,val] + FIELD PROPERTY_BACKING_FIELD name:testTopLevel type:IrErrorType visibility:public [final,static] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:testTopLevel visibility:public modality:FINAL [delegated,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testTopLevel type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/declarations/typeAlias.kt b/compiler/testData/ir/irText/declarations/typeAlias.kt index 78a67277d76..7019018490d 100644 --- a/compiler/testData/ir/irText/declarations/typeAlias.kt +++ b/compiler/testData/ir/irText/declarations/typeAlias.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL + typealias Test1 = String fun foo() { diff --git a/compiler/testData/ir/irText/errors/suppressedNonPublicCall.fir.txt b/compiler/testData/ir/irText/errors/suppressedNonPublicCall.fir.txt new file mode 100644 index 00000000000..febdf206764 --- /dev/null +++ b/compiler/testData/ir/irText/errors/suppressedNonPublicCall.fir.txt @@ -0,0 +1,26 @@ +FILE fqName: fileName:/suppressedNonPublicCall.kt + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:bar visibility:internal modality:FINAL <> ($this:.C) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit [inline] + BLOCK_BODY + CALL 'internal final fun bar (): kotlin.Unit declared in .C' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/errors/unresolvedReference.fir.txt b/compiler/testData/ir/irText/errors/unresolvedReference.fir.txt new file mode 100644 index 00000000000..1794515681b --- /dev/null +++ b/compiler/testData/ir/irText/errors/unresolvedReference.fir.txt @@ -0,0 +1,39 @@ +FILE fqName: fileName:/unresolvedReference.kt + PROPERTY name:test1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test1 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:test2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test2 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:test3 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test3 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST Int type=kotlin.Int value=56 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:test4 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test4 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_EXPR 'No right operand' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/expressions/argumentMappedWithError.fir.txt b/compiler/testData/ir/irText/expressions/argumentMappedWithError.fir.txt new file mode 100644 index 00000000000..a0f701167d7 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/argumentMappedWithError.fir.txt @@ -0,0 +1,17 @@ +FILE fqName: fileName:/argumentMappedWithError.kt + FUN name:convert visibility:public modality:FINAL () returnType:R of .convert + TYPE_PARAMETER name:R index:0 variance: superTypes:[] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun convert (): R of .convert declared in ' + CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin' type=kotlin.Nothing origin=null + FUN name:foo visibility:public modality:FINAL <> (arg:kotlin.Number) returnType:kotlin.Unit + VALUE_PARAMETER name:arg index:0 type:kotlin.Number + BLOCK_BODY + FUN name:main visibility:public modality:FINAL <> (args:kotlin.Array) returnType:kotlin.Unit + VALUE_PARAMETER name:args index:0 type:kotlin.Array + BLOCK_BODY + VAR name:x type:kotlin.Int [val] + CONST Int type=kotlin.Int value=0 + CALL 'public final fun foo (arg: kotlin.Number): kotlin.Unit declared in ' type=kotlin.Unit origin=null + arg: CALL 'public final fun convert (): R of .convert declared in ' type=R of .convert origin=null + : diff --git a/compiler/testData/ir/irText/expressions/arrayAccess.fir.txt b/compiler/testData/ir/irText/expressions/arrayAccess.fir.txt new file mode 100644 index 00000000000..bb59c8c7ad9 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/arrayAccess.fir.txt @@ -0,0 +1,21 @@ +FILE fqName: fileName:/arrayAccess.kt + PROPERTY name:p visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=1 + FUN name:test visibility:public modality:FINAL <> (a:kotlin.IntArray) returnType:kotlin.String + VALUE_PARAMETER name:a index:0 type:kotlin.IntArray + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test (a: kotlin.IntArray): kotlin.String declared in ' + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin' type=kotlin.String origin=null + other: CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=null + index: CALL 'public final fun foo (): kotlin.Int declared in ' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/arrayAssignment.fir.txt b/compiler/testData/ir/irText/expressions/arrayAssignment.fir.txt new file mode 100644 index 00000000000..25b5f268360 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/arrayAssignment.fir.txt @@ -0,0 +1,20 @@ +FILE fqName: fileName:/arrayAssignment.kt + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:x type:kotlin.IntArray [val] + ERROR_CALL 'Cannot bind 3 arguments to intArrayOf call with 1 parameters' type=kotlin.IntArray + CONST Int type=kotlin.Int value=1 + CONST Int type=kotlin.Int value=2 + CONST Int type=kotlin.Int value=3 + CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=null + index: CONST Int type=kotlin.Int value=1 + value: CONST Int type=kotlin.Int value=0 + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=1 + FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=null + index: CALL 'public final fun foo (): kotlin.Int declared in ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=1 diff --git a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.txt b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.txt new file mode 100644 index 00000000000..815458eb6d2 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.txt @@ -0,0 +1,64 @@ +FILE fqName: fileName:/arrayAugmentedAssignment1.kt + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.IntArray + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.IntArray declared in ' + ERROR_CALL 'Cannot bind 3 arguments to intArrayOf call with 1 parameters' type=kotlin.IntArray + CONST Int type=kotlin.Int value=1 + CONST Int type=kotlin.Int value=2 + CONST Int type=kotlin.Int value=3 + FUN name:bar visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun bar (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=42 + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> (x:kotlin.IntArray) returnType:.C [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.IntArray + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.IntArray visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.IntArray declared in .C.' type=kotlin.IntArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.IntArray + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.IntArray declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.IntArray visibility:public [final] ' type=kotlin.IntArray origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:testVariable visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:x type:kotlin.IntArray [var] + CALL 'public final fun foo (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=null + ERROR_CALL 'FirArraySetCall (resolve isn't supported yet)' type=kotlin.Unit + FUN name:testCall visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name: type:kotlin.IntArray [val] + CALL 'public final fun foo (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=null + ERROR_CALL 'FirArraySetCall (resolve isn't supported yet)' type=kotlin.Unit + FUN name:testMember visibility:public modality:FINAL <> (c:.C) returnType:kotlin.Unit + VALUE_PARAMETER name:c index:0 type:.C + BLOCK_BODY + VAR name: type:kotlin.Int [val] + CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=null + index: CONST Int type=kotlin.Int value=0 + CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=null + index: CONST Int type=kotlin.Int value=0 + value: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .testMember' type=kotlin.Int origin=null + GET_VAR 'val : kotlin.Int [val] declared in .testMember' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.fir.txt b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.fir.txt new file mode 100644 index 00000000000..530d0b13c9b --- /dev/null +++ b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment2.fir.txt @@ -0,0 +1,42 @@ +FILE fqName: fileName:/arrayAugmentedAssignment2.kt + CLASS INTERFACE name:IA modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IA + FUN name:get visibility:public modality:ABSTRACT <> ($this:.IA, index:kotlin.String) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.IA + VALUE_PARAMETER name:index index:0 type:kotlin.String + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:IB modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IB + FUN name:set visibility:public modality:ABSTRACT <> ($this:.IB, index:kotlin.String, value:kotlin.Int) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IB + VALUE_PARAMETER name:index index:0 type:kotlin.String + VALUE_PARAMETER name:value index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> (a:.IA) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:.IA + BLOCK_BODY + ERROR_CALL 'FirArraySetCall (resolve isn't supported yet)' type=kotlin.Unit diff --git a/compiler/testData/ir/irText/expressions/assignments.fir.txt b/compiler/testData/ir/irText/expressions/assignments.fir.txt new file mode 100644 index 00000000000..9374ad70c3e --- /dev/null +++ b/compiler/testData/ir/irText/expressions/assignments.fir.txt @@ -0,0 +1,51 @@ +FILE fqName: fileName:/assignments.kt + CLASS CLASS name:Ref modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ref + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Ref [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Ref modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .Ref.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Ref) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Ref + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Ref' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Ref declared in .Ref.' type=.Ref origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Ref, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Ref + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .Ref declared in .Ref.' type=.Ref origin=null + value: GET_VAR ': kotlin.Int declared in .Ref.' type=kotlin.Int origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:x type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + ERROR_CALL 'Unresolved reference: R|/x|' type=IrErrorType + ERROR_CALL 'Unresolved reference: R|/x|' type=IrErrorType + FUN name:test2 visibility:public modality:FINAL <> (r:.Ref) returnType:kotlin.Unit + VALUE_PARAMETER name:r index:0 type:.Ref + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=0 diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignment1.fir.txt b/compiler/testData/ir/irText/expressions/augmentedAssignment1.fir.txt new file mode 100644 index 00000000000..59ee4f3895d --- /dev/null +++ b/compiler/testData/ir/irText/expressions/augmentedAssignment1.fir.txt @@ -0,0 +1,37 @@ +FILE fqName: fileName:/augmentedAssignment1.kt + PROPERTY name:p visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public [static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public [static] ' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public [static] ' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null + FUN name:testVariable visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:x type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + ERROR_CALL 'Unresolved reference: R|/x|' type=IrErrorType + ERROR_CALL 'Unresolved reference: R|/x|' type=IrErrorType + ERROR_CALL 'Unresolved reference: R|/x|' type=IrErrorType + ERROR_CALL 'Unresolved reference: R|/x|' type=IrErrorType + ERROR_CALL 'Unresolved reference: R|/x|' type=IrErrorType + FUN name:testProperty visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public [static] ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=1 + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public [static] ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=2 + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public [static] ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=3 + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public [static] ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=4 + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public [static] ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=5 diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignment2.fir.txt b/compiler/testData/ir/irText/expressions/augmentedAssignment2.fir.txt new file mode 100644 index 00000000000..61146d58d16 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/augmentedAssignment2.fir.txt @@ -0,0 +1,65 @@ +FILE fqName: fileName:/augmentedAssignment2.kt + CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:plusAssign visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + FUN name:minusAssign visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + FUN name:timesAssign visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + FUN name:divAssign visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + FUN name:remAssign visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + PROPERTY name:p visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:p type:.A visibility:public [final,static] + EXPRESSION_BODY + CALL 'public constructor () [primary] declared in .A' type=.A origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.A + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .A declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:.A visibility:public [final,static] ' type=.A origin=null + FUN name:testVariable visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:a type:.A [val] + CALL 'public constructor () [primary] declared in .A' type=.A origin=null + ERROR_CALL 'Unresolved reference: R|/a|' type=IrErrorType + ERROR_CALL 'Unresolved reference: R|/a|' type=IrErrorType + ERROR_CALL 'Unresolved reference: R|/a|' type=IrErrorType + ERROR_CALL 'Unresolved reference: R|/a|' type=IrErrorType + ERROR_CALL 'Unresolved reference: R|/a|' type=IrErrorType + FUN name:testProperty visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:.A visibility:public [final,static] ' type=.A origin=null + value: CONST String type=kotlin.String value="+=" + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:.A visibility:public [final,static] ' type=.A origin=null + value: CONST String type=kotlin.String value="-=" + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:.A visibility:public [final,static] ' type=.A origin=null + value: CONST String type=kotlin.String value="*=" + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:.A visibility:public [final,static] ' type=.A origin=null + value: CONST String type=kotlin.String value="/=" + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:.A visibility:public [final,static] ' type=.A origin=null + value: CONST String type=kotlin.String value="%=" diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.fir.txt b/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.fir.txt new file mode 100644 index 00000000000..6a6b0270e1e --- /dev/null +++ b/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.fir.txt @@ -0,0 +1,46 @@ +FILE fqName: fileName:/augmentedAssignmentWithExpression.kt + CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host + CONSTRUCTOR visibility:public <> () returnType:.Host [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:plusAssign visibility:public modality:FINAL <> ($this:.Host, x:kotlin.Int) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Host + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + FUN name:test1 visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + ERROR_CALL 'Unresolved reference: this#' type=IrErrorType + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:FINAL <> () returnType:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): .Host declared in ' + CALL 'public constructor () [primary] declared in .Host' type=.Host origin=null + FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + ERROR_CALL 'Unresolved reference: this#' type=IrErrorType + FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name: type:.Host [val] + CALL 'public final fun foo (): .Host declared in ' type=.Host origin=null + ERROR_CALL 'Unresolved reference: R|/|' type=IrErrorType + FUN name:test4 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Function0 + BLOCK_BODY + VAR name: type:IrErrorType [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: R|/|' type=IrErrorType diff --git a/compiler/testData/ir/irText/expressions/badBreakContinue.fir.txt b/compiler/testData/ir/irText/expressions/badBreakContinue.fir.txt new file mode 100644 index 00000000000..47177edb249 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/badBreakContinue.fir.txt @@ -0,0 +1,34 @@ +FILE fqName: fileName:/badBreakContinue.kt + FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + ERROR_EXPR 'Unbound loop: break@@@[ERROR_EXPR(Cannot bind unlabeled jump to a loop)] ' type=kotlin.Nothing + ERROR_EXPR 'Unbound loop: continue@@@[ERROR_EXPR(Cannot bind unlabeled jump to a loop)] ' type=kotlin.Nothing + FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + WHILE label=L1 origin=WHILE_LOOP + condition: CONST Boolean type=kotlin.Boolean value=true + body: BLOCK type=IrErrorType origin=null + ERROR_EXPR 'Unbound loop: break@@@[ERROR_EXPR(Cannot bind label ERROR to a loop)] ' type=kotlin.Nothing + ERROR_EXPR 'Unbound loop: continue@@@[ERROR_EXPR(Cannot bind label ERROR to a loop)] ' type=kotlin.Nothing + FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + WHILE label=L1 origin=WHILE_LOOP + condition: CONST Boolean type=kotlin.Boolean value=true + body: BLOCK type=kotlin.Unit origin=null + VAR name:lambda type:IrErrorType [val] + BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .test3' + BLOCK type=IrErrorType origin=null + BREAK label=L1 loop.label=L1 + CONTINUE label=L1 loop.label=L1 + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .test3' type=IrErrorType origin=LAMBDA + FUN name:test4 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + WHILE label=null origin=WHILE_LOOP + condition: ERROR_EXPR 'Unbound loop: break@@@[ERROR_EXPR(Cannot bind unlabeled jump to a loop)] ' type=kotlin.Nothing + body: BLOCK type=kotlin.Unit origin=null + WHILE label=null origin=WHILE_LOOP + condition: ERROR_EXPR 'Unbound loop: continue@@@[ERROR_EXPR(Cannot bind unlabeled jump to a loop)] ' type=kotlin.Nothing + body: BLOCK type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/expressions/bangbang.fir.txt b/compiler/testData/ir/irText/expressions/bangbang.fir.txt new file mode 100644 index 00000000000..523bb7a9895 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/bangbang.fir.txt @@ -0,0 +1,35 @@ +FILE fqName: fileName:/bangbang.kt + FUN name:test1 visibility:public modality:FINAL <> (a:kotlin.Any?) returnType:IrErrorType + VALUE_PARAMETER name:a index:0 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (a: kotlin.Any?): IrErrorType declared in ' + BLOCK type=IrErrorType origin=EXCLEXCL + VAR name: type:kotlin.Any? [val] + GET_VAR 'a: kotlin.Any? declared in .test1' type=kotlin.Any? origin=null + WHEN type=IrErrorType origin=EXCLEXCL + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val : kotlin.Any? [val] declared in .test1' type=kotlin.Any? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: THROW type=kotlin.Nothing + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val : kotlin.Any? [val] declared in .test1' type=kotlin.Any? origin=null + FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Any?) returnType:IrErrorType + VALUE_PARAMETER name:a index:0 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (a: kotlin.Any?): IrErrorType declared in ' + BLOCK type=IrErrorType origin=EXCLEXCL + VAR name: type:kotlin.Int [val] + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + WHEN type=IrErrorType origin=EXCLEXCL + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val : kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: THROW type=kotlin.Nothing + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val : kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/booleanConstsInAndAndOrOr.fir.txt b/compiler/testData/ir/irText/expressions/booleanConstsInAndAndOrOr.fir.txt new file mode 100644 index 00000000000..3d8810084cc --- /dev/null +++ b/compiler/testData/ir/irText/expressions/booleanConstsInAndAndOrOr.fir.txt @@ -0,0 +1,23 @@ +FILE fqName: fileName:/booleanConstsInAndAndOrOr.kt + FUN name:test1 visibility:public modality:FINAL <> (b:kotlin.Boolean) returnType:kotlin.Unit + VALUE_PARAMETER name:b index:0 type:kotlin.Boolean + BLOCK_BODY + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: GET_VAR 'b: kotlin.Boolean declared in .test1' type=kotlin.Boolean origin=null + then: RETURN type=kotlin.Nothing from='public final fun test1 (b: kotlin.Boolean): kotlin.Unit declared in ' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test2 visibility:public modality:FINAL <> (b:kotlin.Boolean) returnType:kotlin.Unit + VALUE_PARAMETER name:b index:0 type:kotlin.Boolean + BLOCK_BODY + WHEN type=kotlin.Boolean origin=OROR + BRANCH + if: GET_VAR 'b: kotlin.Boolean declared in .test2' type=kotlin.Boolean origin=null + then: CONST Boolean type=kotlin.Boolean value=true + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: RETURN type=kotlin.Nothing from='public final fun test2 (b: kotlin.Boolean): kotlin.Unit declared in ' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit diff --git a/compiler/testData/ir/irText/expressions/booleanOperators.fir.txt b/compiler/testData/ir/irText/expressions/booleanOperators.fir.txt new file mode 100644 index 00000000000..549dd848863 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/booleanOperators.fir.txt @@ -0,0 +1,39 @@ +FILE fqName: fileName:/booleanOperators.kt + FUN name:test1 visibility:public modality:FINAL <> (a:kotlin.Boolean, b:kotlin.Boolean) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Boolean + VALUE_PARAMETER name:b index:1 type:kotlin.Boolean + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (a: kotlin.Boolean, b: kotlin.Boolean): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: GET_VAR 'a: kotlin.Boolean declared in .test1' type=kotlin.Boolean origin=null + then: GET_VAR 'b: kotlin.Boolean declared in .test1' type=kotlin.Boolean origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Boolean, b:kotlin.Boolean) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Boolean + VALUE_PARAMETER name:b index:1 type:kotlin.Boolean + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (a: kotlin.Boolean, b: kotlin.Boolean): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=OROR + BRANCH + if: GET_VAR 'a: kotlin.Boolean declared in .test2' type=kotlin.Boolean origin=null + then: CONST Boolean type=kotlin.Boolean value=true + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'b: kotlin.Boolean declared in .test2' type=kotlin.Boolean origin=null + FUN name:test1x visibility:public modality:FINAL <> (a:kotlin.Boolean, b:kotlin.Boolean) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Boolean + VALUE_PARAMETER name:b index:1 type:kotlin.Boolean + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1x (a: kotlin.Boolean, b: kotlin.Boolean): kotlin.Boolean declared in ' + CALL 'public final fun and (other: kotlin.Boolean): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=null + other: GET_VAR 'b: kotlin.Boolean declared in .test1x' type=kotlin.Boolean origin=null + FUN name:test2x visibility:public modality:FINAL <> (a:kotlin.Boolean, b:kotlin.Boolean) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Boolean + VALUE_PARAMETER name:b index:1 type:kotlin.Boolean + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2x (a: kotlin.Boolean, b: kotlin.Boolean): kotlin.Boolean declared in ' + CALL 'public final fun or (other: kotlin.Boolean): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=null + other: GET_VAR 'b: kotlin.Boolean declared in .test2x' type=kotlin.Boolean origin=null diff --git a/compiler/testData/ir/irText/expressions/boundCallableReferences.fir.txt b/compiler/testData/ir/irText/expressions/boundCallableReferences.fir.txt new file mode 100644 index 00000000000..ebb6696b645 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/boundCallableReferences.fir.txt @@ -0,0 +1,63 @@ +FILE fqName: fileName:/boundCallableReferences.kt + CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + PROPERTY name:bar visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:qux visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + PROPERTY name:test1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test1 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:test2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun (): kotlin.Int declared in .A' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + PROPERTY name:test3 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test3 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/expressions/boxOk.kt b/compiler/testData/ir/irText/expressions/boxOk.kt index 06a959d3cb6..c1b6c32b886 100644 --- a/compiler/testData/ir/irText/expressions/boxOk.kt +++ b/compiler/testData/ir/irText/expressions/boxOk.kt @@ -1 +1,3 @@ +// FIR_IDENTICAL + fun box(): String = "OK" diff --git a/compiler/testData/ir/irText/expressions/breakContinue.fir.txt b/compiler/testData/ir/irText/expressions/breakContinue.fir.txt new file mode 100644 index 00000000000..3614399c376 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/breakContinue.fir.txt @@ -0,0 +1,51 @@ +FILE fqName: fileName:/breakContinue.kt + FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + WHILE label=null origin=WHILE_LOOP + condition: CONST Boolean type=kotlin.Boolean value=true + body: BREAK label=null loop.label=null + DO_WHILE label=null origin=DO_WHILE_LOOP + body: BREAK label=null loop.label=null + condition: CONST Boolean type=kotlin.Boolean value=true + WHILE label=null origin=WHILE_LOOP + condition: CONST Boolean type=kotlin.Boolean value=true + body: CONTINUE label=null loop.label=null + DO_WHILE label=null origin=DO_WHILE_LOOP + body: CONTINUE label=null loop.label=null + condition: CONST Boolean type=kotlin.Boolean value=true + FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + WHILE label=OUTER origin=WHILE_LOOP + condition: CONST Boolean type=kotlin.Boolean value=true + body: BLOCK type=IrErrorType origin=null + WHILE label=INNER origin=WHILE_LOOP + condition: CONST Boolean type=kotlin.Boolean value=true + body: BLOCK type=IrErrorType origin=null + BREAK label=INNER loop.label=INNER + BREAK label=OUTER loop.label=OUTER + BREAK label=OUTER loop.label=OUTER + WHILE label=OUTER origin=WHILE_LOOP + condition: CONST Boolean type=kotlin.Boolean value=true + body: BLOCK type=IrErrorType origin=null + WHILE label=INNER origin=WHILE_LOOP + condition: CONST Boolean type=kotlin.Boolean value=true + body: BLOCK type=IrErrorType origin=null + CONTINUE label=INNER loop.label=INNER + CONTINUE label=OUTER loop.label=OUTER + CONTINUE label=OUTER loop.label=OUTER + FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + WHILE label=L origin=WHILE_LOOP + condition: CONST Boolean type=kotlin.Boolean value=true + body: BLOCK type=IrErrorType origin=null + WHILE label=L origin=WHILE_LOOP + condition: CONST Boolean type=kotlin.Boolean value=true + body: BREAK label=L loop.label=L + BREAK label=L loop.label=L + WHILE label=L origin=WHILE_LOOP + condition: CONST Boolean type=kotlin.Boolean value=true + body: BLOCK type=IrErrorType origin=null + WHILE label=L origin=WHILE_LOOP + condition: CONST Boolean type=kotlin.Boolean value=true + body: CONTINUE label=L loop.label=L + CONTINUE label=L loop.label=L diff --git a/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt b/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt new file mode 100644 index 00000000000..8d849af37d8 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt @@ -0,0 +1,125 @@ +FILE fqName: fileName:/breakContinueInLoopHeader.kt + FUN name:test1 visibility:public modality:FINAL <> (c:kotlin.Boolean?) returnType:kotlin.Unit + VALUE_PARAMETER name:c index:0 type:kotlin.Boolean? + BLOCK_BODY + WHILE label=L origin=WHILE_LOOP + condition: CONST Boolean type=kotlin.Boolean value=true + body: BLOCK type=kotlin.Unit origin=null + WHILE label=L2 origin=WHILE_LOOP + condition: BLOCK type=kotlin.Unit origin=ELVIS + VAR name: type:kotlin.Boolean? [val] + GET_VAR 'c: kotlin.Boolean? declared in .test1' type=kotlin.Boolean? origin=null + WHEN type=kotlin.Unit origin=ELVIS + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val : kotlin.Boolean? [val] declared in .test1' type=kotlin.Boolean? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: BREAK label=null loop.label=L + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val : kotlin.Boolean? [val] declared in .test1' type=kotlin.Boolean? origin=null + body: BLOCK type=kotlin.Unit origin=null + FUN name:test2 visibility:public modality:FINAL <> (c:kotlin.Boolean?) returnType:kotlin.Unit + VALUE_PARAMETER name:c index:0 type:kotlin.Boolean? + BLOCK_BODY + WHILE label=L origin=WHILE_LOOP + condition: CONST Boolean type=kotlin.Boolean value=true + body: BLOCK type=kotlin.Unit origin=null + WHILE label=L2 origin=WHILE_LOOP + condition: BLOCK type=kotlin.Unit origin=ELVIS + VAR name: type:kotlin.Boolean? [val] + GET_VAR 'c: kotlin.Boolean? declared in .test2' type=kotlin.Boolean? origin=null + WHEN type=kotlin.Unit origin=ELVIS + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val : kotlin.Boolean? [val] declared in .test2' type=kotlin.Boolean? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONTINUE label=null loop.label=L + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val : kotlin.Boolean? [val] declared in .test2' type=kotlin.Boolean? origin=null + body: BLOCK type=kotlin.Unit origin=null + FUN name:test3 visibility:public modality:FINAL <> (ss:kotlin.collections.List?) returnType:kotlin.Unit + VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List? + BLOCK_BODY + WHILE label=L origin=WHILE_LOOP + condition: CONST Boolean type=kotlin.Boolean value=true + body: BLOCK type=kotlin.Unit origin=null + VAR name: type:IrErrorType [val] + BLOCK type=IrErrorType origin=ELVIS + VAR name: type:kotlin.collections.List? [val] + GET_VAR 'ss: kotlin.collections.List? declared in .test3' type=kotlin.collections.List? origin=null + WHEN type=IrErrorType origin=ELVIS + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val : kotlin.collections.List? [val] declared in .test3' type=kotlin.collections.List? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONTINUE label=null loop.label=L + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val : kotlin.collections.List? [val] declared in .test3' type=kotlin.collections.List? origin=null + VAR name: type:IrErrorType [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + WHILE label=L2 origin=FOR_LOOP_INNER_WHILE + condition: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + body: BLOCK type=kotlin.Unit origin=null + VAR name:s type:IrErrorType [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN name:test4 visibility:public modality:FINAL <> (ss:kotlin.collections.List?) returnType:kotlin.Unit + VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List? + BLOCK_BODY + WHILE label=L origin=WHILE_LOOP + condition: CONST Boolean type=kotlin.Boolean value=true + body: BLOCK type=kotlin.Unit origin=null + VAR name: type:IrErrorType [val] + BLOCK type=IrErrorType origin=ELVIS + VAR name: type:kotlin.collections.List? [val] + GET_VAR 'ss: kotlin.collections.List? declared in .test4' type=kotlin.collections.List? origin=null + WHEN type=IrErrorType origin=ELVIS + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val : kotlin.collections.List? [val] declared in .test4' type=kotlin.collections.List? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: BREAK label=null loop.label=L + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val : kotlin.collections.List? [val] declared in .test4' type=kotlin.collections.List? origin=null + VAR name: type:IrErrorType [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + WHILE label=L2 origin=FOR_LOOP_INNER_WHILE + condition: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + body: BLOCK type=kotlin.Unit origin=null + VAR name:s type:IrErrorType [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN name:test5 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:i type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + WHILE label=Outer origin=WHILE_LOOP + condition: CONST Boolean type=kotlin.Boolean value=true + body: BLOCK type=kotlin.Unit origin=null + VAR name: type:kotlin.Int [val] + GET_VAR 'var i: kotlin.Int [var] declared in .test5' type=kotlin.Int origin=null + ERROR_CALL 'Unresolved reference: R|/i|' type=IrErrorType + GET_VAR 'var i: kotlin.Int [var] declared in .test5' type=kotlin.Int origin=null + VAR name:j type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + DO_WHILE label=Inner origin=DO_WHILE_LOOP + body: BLOCK type=kotlin.Int origin=null + VAR name: type:kotlin.Int [val] + GET_VAR 'var j: kotlin.Int [var] declared in .test5' type=kotlin.Int origin=null + ERROR_CALL 'Unresolved reference: R|/j|' type=IrErrorType + GET_VAR 'var j: kotlin.Int [var] declared in .test5' type=kotlin.Int origin=null + condition: WHEN type=kotlin.Unit origin=IF + BRANCH + if: ERROR_CALL 'Comparison of arguments with different types: kotlin/Int, kotlin/Unit' type=kotlin.Boolean + then: CONST Boolean type=kotlin.Boolean value=false + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: BREAK label=null loop.label=Outer + WHEN type=kotlin.Unit origin=IF + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'var i: kotlin.Int [var] declared in .test5' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Unit value=3 + then: BREAK label=null loop.label=Outer diff --git a/compiler/testData/ir/irText/expressions/callWithReorderedArguments.fir.txt b/compiler/testData/ir/irText/expressions/callWithReorderedArguments.fir.txt new file mode 100644 index 00000000000..6b7dcb6ba07 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callWithReorderedArguments.fir.txt @@ -0,0 +1,32 @@ +FILE fqName: fileName:/callWithReorderedArguments.kt + FUN name:foo visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Int + VALUE_PARAMETER name:b index:1 type:kotlin.Int + BLOCK_BODY + FUN name:noReorder1 visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun noReorder1 (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=1 + FUN name:noReorder2 visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun noReorder2 (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=2 + FUN name:reordered1 visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun reordered1 (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=1 + FUN name:reordered2 visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun reordered2 (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=2 + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun foo (a: kotlin.Int, b: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null + a: CALL 'public final fun noReorder1 (): kotlin.Int declared in ' type=kotlin.Int origin=null + b: CALL 'public final fun noReorder2 (): kotlin.Int declared in ' type=kotlin.Int origin=null + CALL 'public final fun foo (a: kotlin.Int, b: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null + a: CALL 'public final fun reordered1 (): kotlin.Int declared in ' type=kotlin.Int origin=null + b: CALL 'public final fun reordered2 (): kotlin.Int declared in ' type=kotlin.Int origin=null + CALL 'public final fun foo (a: kotlin.Int, b: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null + a: CONST Int type=kotlin.Int value=1 + b: CALL 'public final fun reordered2 (): kotlin.Int declared in ' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/callableRefToGenericMember.fir.txt b/compiler/testData/ir/irText/expressions/callableRefToGenericMember.fir.txt new file mode 100644 index 00000000000..b7277be95f2 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callableRefToGenericMember.fir.txt @@ -0,0 +1,53 @@ +FILE fqName: fileName:/callableRefToGenericMember.kt + CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> () returnType:.A.A> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + PROPERTY name:bar visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:test1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test1 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:test2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun (): kotlin.Int declared in .A' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/callableReferenceToImportedFromObject.fir.txt b/compiler/testData/ir/irText/expressions/callableReferenceToImportedFromObject.fir.txt new file mode 100644 index 00000000000..8e792f0edb8 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callableReferenceToImportedFromObject.fir.txt @@ -0,0 +1,72 @@ +FILE fqName:test fileName:/callableReferenceToImportedFromObject.kt + CLASS OBJECT name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:test.Foo + CONSTRUCTOR visibility:private <> () returnType:test.Foo [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:a visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:public [final] + EXPRESSION_BODY + CONST String type=kotlin.String value="" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:test.Foo) returnType:kotlin.String + correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:test.Foo + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in test.Foo' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': test.Foo declared in test.Foo.' type=test.Foo origin=null + FUN name:foo visibility:public modality:FINAL <> ($this:test.Foo) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:test.Foo + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in test.Foo' + CONST String type=kotlin.String value="" + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:test1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun (): kotlin.String declared in test.Foo' type=kotlin.String origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in test' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + PROPERTY name:test1a visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test1a type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun (): kotlin.String declared in test.Foo' type=kotlin.String origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:test1a visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in test' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1a type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + PROPERTY name:test2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test2 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in test' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:test2a visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test2a type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test2a visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in test' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2a type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/expressions/callableReferenceTypeArguments.fir.txt b/compiler/testData/ir/irText/expressions/callableReferenceTypeArguments.fir.txt new file mode 100644 index 00000000000..08bde467fc3 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/callableReferenceTypeArguments.fir.txt @@ -0,0 +1,60 @@ +FILE fqName: fileName:/callableReferenceTypeArguments.kt + CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host + CONSTRUCTOR visibility:private <> () returnType:.Host [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:objectMember visibility:public modality:FINAL ($this:.Host, x:T of .Host.objectMember) returnType:kotlin.Unit [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + $this: VALUE_PARAMETER name: type:.Host + VALUE_PARAMETER name:x index:0 type:T of .Host.objectMember + BLOCK_BODY + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:topLevel1 visibility:public modality:FINAL (x:T of .topLevel1) returnType:kotlin.Unit [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + VALUE_PARAMETER name:x index:0 type:T of .topLevel1 + BLOCK_BODY + FUN name:topLevel2 visibility:public modality:FINAL (x:kotlin.collections.List.topLevel2>) returnType:kotlin.Unit [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + VALUE_PARAMETER name:x index:0 type:kotlin.collections.List.topLevel2> + BLOCK_BODY + PROPERTY name:test1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function1 visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function1 + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function1 declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function1 visibility:public [final,static] ' type=kotlin.Function1 origin=null + PROPERTY name:test2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Function1 visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function1 + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function1 declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Function1 visibility:public [final,static] ' type=kotlin.Function1 origin=null + PROPERTY name:test3 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Function1 visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function1 + correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function1 declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Function1 visibility:public [final,static] ' type=kotlin.Function1 origin=null diff --git a/compiler/testData/ir/irText/expressions/calls.fir.txt b/compiler/testData/ir/irText/expressions/calls.fir.txt new file mode 100644 index 00000000000..3e06b886c5d --- /dev/null +++ b/compiler/testData/ir/irText/expressions/calls.fir.txt @@ -0,0 +1,41 @@ +FILE fqName: fileName:/calls.kt + FUN name:foo visibility:public modality:FINAL <> (x:kotlin.Int, y:kotlin.Int) returnType:kotlin.Int + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (x: kotlin.Int, y: kotlin.Int): kotlin.Int declared in ' + GET_VAR 'x: kotlin.Int declared in .foo' type=kotlin.Int origin=null + FUN name:bar visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.Int + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun bar (x: kotlin.Int): kotlin.Int declared in ' + CALL 'public final fun foo (x: kotlin.Int, y: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null + x: GET_VAR 'x: kotlin.Int declared in .bar' type=kotlin.Int origin=null + y: CONST Int type=kotlin.Int value=1 + FUN name:qux visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.Int + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun qux (x: kotlin.Int): kotlin.Int declared in ' + CALL 'public final fun foo (x: kotlin.Int, y: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null + x: CALL 'public final fun foo (x: kotlin.Int, y: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null + x: GET_VAR 'x: kotlin.Int declared in .qux' type=kotlin.Int origin=null + y: GET_VAR 'x: kotlin.Int declared in .qux' type=kotlin.Int origin=null + y: GET_VAR 'x: kotlin.Int declared in .qux' type=kotlin.Int origin=null + FUN name:ext1 visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun ext1 (): kotlin.Int declared in ' + ERROR_CALL 'Unresolved reference: this#' type=kotlin.Int + FUN name:ext2 visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.Int + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun ext2 (x: kotlin.Int): kotlin.Int declared in ' + CALL 'public final fun foo (x: kotlin.Int, y: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null + x: ERROR_CALL 'Unresolved reference: this#' type=kotlin.Int + y: GET_VAR 'x: kotlin.Int declared in .ext2' type=kotlin.Int origin=null + FUN name:ext3 visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.Int + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun ext3 (x: kotlin.Int): kotlin.Int declared in ' + CALL 'public final fun foo (x: kotlin.Int, y: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null + x: CALL 'public final fun ext1 (): kotlin.Int declared in ' type=kotlin.Int origin=null + y: GET_VAR 'x: kotlin.Int declared in .ext3' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/castToTypeParameter.fir.txt b/compiler/testData/ir/irText/expressions/castToTypeParameter.fir.txt new file mode 100644 index 00000000000..acc3bffd6b9 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/castToTypeParameter.fir.txt @@ -0,0 +1,85 @@ +FILE fqName: fileName:/castToTypeParameter.kt + FUN name:castFun visibility:public modality:FINAL (x:kotlin.Any) returnType:T of .castFun + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun castFun (x: kotlin.Any): T of .castFun declared in ' + TYPE_OP type=T of .castFun origin=CAST typeOperand=T of .castFun + GET_VAR 'x: kotlin.Any declared in .castFun' type=kotlin.Any origin=null + FUN name:castExtFun visibility:public modality:FINAL () returnType:T of .castExtFun + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun castExtFun (): T of .castExtFun declared in ' + TYPE_OP type=T of .castExtFun origin=CAST typeOperand=T of .castExtFun + ERROR_CALL 'Unresolved reference: this#' type=kotlin.Any + PROPERTY name:castExtVal visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:castExtVal visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + TYPE_OP type=T of origin=CAST typeOperand=T of + ERROR_CALL 'Unresolved reference: this#' type=IrErrorType + CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> () returnType:.Host.Host> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:castMemberFun visibility:public modality:FINAL <> ($this:.Host, x:kotlin.Any) returnType:T of .Host + $this: VALUE_PARAMETER name: type:.Host + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun castMemberFun (x: kotlin.Any): T of .Host declared in .Host' + TYPE_OP type=T of .Host origin=CAST typeOperand=T of .Host + GET_VAR 'x: kotlin.Any declared in .Host.castMemberFun' type=kotlin.Any origin=null + FUN name:castGenericMemberFun visibility:public modality:FINAL ($this:.Host, x:kotlin.Any) returnType:TF of .Host.castGenericMemberFun + TYPE_PARAMETER name:TF index:0 variance: superTypes:[] + $this: VALUE_PARAMETER name: type:.Host + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun castGenericMemberFun (x: kotlin.Any): TF of .Host.castGenericMemberFun declared in .Host' + TYPE_OP type=TF of .Host.castGenericMemberFun origin=CAST typeOperand=TF of .Host.castGenericMemberFun + GET_VAR 'x: kotlin.Any declared in .Host.castGenericMemberFun' type=kotlin.Any origin=null + FUN name:castMemberExtFun visibility:public modality:FINAL <> ($this:.Host) returnType:T of .Host + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun castMemberExtFun (): T of .Host declared in .Host' + TYPE_OP type=T of .Host origin=CAST typeOperand=T of .Host + ERROR_CALL 'Unresolved reference: this#' type=kotlin.Any + FUN name:castGenericMemberExtFun visibility:public modality:FINAL ($this:.Host) returnType:TF of .Host.castGenericMemberExtFun + TYPE_PARAMETER name:TF index:0 variance: superTypes:[] + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun castGenericMemberExtFun (): TF of .Host.castGenericMemberExtFun declared in .Host' + TYPE_OP type=TF of .Host.castGenericMemberExtFun origin=CAST typeOperand=TF of .Host.castGenericMemberExtFun + ERROR_CALL 'Unresolved reference: this#' type=kotlin.Any + PROPERTY name:castMemberExtVal visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.Host) returnType:IrErrorType + correspondingProperty: PROPERTY name:castMemberExtVal visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .Host' + TYPE_OP type=T of .Host origin=CAST typeOperand=T of .Host + ERROR_CALL 'Unresolved reference: this#' type=.Host.Host> + PROPERTY name:castGenericMemberExtVal visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.Host) returnType:IrErrorType + correspondingProperty: PROPERTY name:castGenericMemberExtVal visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .Host' + TYPE_OP type=TV of origin=CAST typeOperand=TV of + ERROR_CALL 'Unresolved reference: this#' type=.Host.Host> + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/catchParameterAccess.fir.txt b/compiler/testData/ir/irText/expressions/catchParameterAccess.fir.txt new file mode 100644 index 00000000000..3aefd89066f --- /dev/null +++ b/compiler/testData/ir/irText/expressions/catchParameterAccess.fir.txt @@ -0,0 +1,11 @@ +FILE fqName: fileName:/catchParameterAccess.kt + FUN name:test visibility:public modality:FINAL <> (f:kotlin.Function0) returnType:IrErrorType + VALUE_PARAMETER name:f index:0 type:kotlin.Function0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test (f: kotlin.Function0): IrErrorType declared in ' + TRY type=IrErrorType + try: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CATCH parameter=val e: java.lang.Exception [val] declared in .test + VAR name:e type:java.lang.Exception [val] + THROW type=kotlin.Nothing + GET_VAR 'val e: java.lang.Exception [val] declared in .test' type=java.lang.Exception origin=null diff --git a/compiler/testData/ir/irText/expressions/chainOfSafeCalls.fir.txt b/compiler/testData/ir/irText/expressions/chainOfSafeCalls.fir.txt new file mode 100644 index 00000000000..1291aa7146d --- /dev/null +++ b/compiler/testData/ir/irText/expressions/chainOfSafeCalls.fir.txt @@ -0,0 +1,35 @@ +FILE fqName: fileName:/chainOfSafeCalls.kt + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL <> ($this:.C) returnType:.C + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): .C declared in .C' + ERROR_CALL 'Unresolved reference: this#' type=.C + FUN name:bar visibility:public modality:FINAL <> ($this:.C) returnType:.C? + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun bar (): .C? declared in .C' + ERROR_CALL 'Unresolved reference: this#' type=.C + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> (nc:.C?) returnType:.C + VALUE_PARAMETER name:nc index:0 type:.C? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test (nc: .C?): .C declared in ' + CALL 'public final fun foo (): .C declared in .C' type=.C origin=null diff --git a/compiler/testData/ir/irText/expressions/classReference.fir.txt b/compiler/testData/ir/irText/expressions/classReference.fir.txt new file mode 100644 index 00000000000..a54941909de --- /dev/null +++ b/compiler/testData/ir/irText/expressions/classReference.fir.txt @@ -0,0 +1,28 @@ +FILE fqName: fileName:/classReference.kt + CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + GET_CLASS type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_CLASS type=IrErrorType + CALL 'public constructor () [primary] declared in .A' type=.A origin=null + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType diff --git a/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt b/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt new file mode 100644 index 00000000000..4e7d65d021e --- /dev/null +++ b/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt @@ -0,0 +1,26 @@ +FILE fqName: fileName:/coercionToUnit.kt + PROPERTY name:test1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function0 visibility:public [final,static] + EXPRESSION_BODY + BLOCK type=kotlin.Function0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Function0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Function0 declared in .test1' + CONST Int type=kotlin.Function0 value=42 + FUNCTION_REFERENCE 'local final fun (): kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=LAMBDA + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function0 + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function0 declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function0 visibility:public [final,static] ' type=kotlin.Function0 origin=null + FUN name:test2 visibility:public modality:FINAL <> (mc:kotlin.collections.MutableCollection) returnType:kotlin.Unit + VALUE_PARAMETER name:mc index:0 type:kotlin.collections.MutableCollection + BLOCK_BODY + CALL 'public abstract fun add (element: E of ): kotlin.Boolean declared in kotlin.collections.MutableCollection' type=kotlin.Boolean origin=null + element: CONST String type=kotlin.String value="" + FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="Hello," + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="world!" diff --git a/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.txt b/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.txt new file mode 100644 index 00000000000..8027817e660 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.txt @@ -0,0 +1,220 @@ +FILE fqName: fileName:/complexAugmentedAssignment.kt + CLASS OBJECT name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X1 + CONSTRUCTOR visibility:private <> () returnType:.X1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x1 visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:x1 type:kotlin.Int visibility:public + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.X1) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x1 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.X1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .X1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x1 type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .X1 declared in .X1.' type=.X1 origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.X1, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:x1 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.X1 + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x1 type:kotlin.Int visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .X1 declared in .X1.' type=.X1 origin=null + value: GET_VAR ': kotlin.Int declared in .X1.' type=kotlin.Int origin=null + CLASS OBJECT name:X2 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X1.X2 + CONSTRUCTOR visibility:private <> () returnType:.X1.X2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:X2 modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x2 visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:x2 type:kotlin.Int visibility:public + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.X1.X2) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x2 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.X1.X2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .X1.X2' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x2 type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .X1.X2 declared in .X1.X2.' type=.X1.X2 origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.X1.X2, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:x2 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.X1.X2 + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x2 type:kotlin.Int visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .X1.X2 declared in .X1.X2.' type=.X1.X2 origin=null + value: GET_VAR ': kotlin.Int declared in .X1.X2.' type=kotlin.Int origin=null + CLASS OBJECT name:X3 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X1.X2.X3 + CONSTRUCTOR visibility:private <> () returnType:.X1.X2.X3 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:X3 modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x3 visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:x3 type:kotlin.Int visibility:public + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.X1.X2.X3) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x3 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.X1.X2.X3 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .X1.X2.X3' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x3 type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .X1.X2.X3 declared in .X1.X2.X3.' type=.X1.X2.X3 origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.X1.X2.X3, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:x3 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.X1.X2.X3 + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x3 type:kotlin.Int visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .X1.X2.X3 declared in .X1.X2.X3.' type=.X1.X2.X3 origin=null + value: GET_VAR ': kotlin.Int declared in .X1.X2.X3.' type=kotlin.Int origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL <> (a:kotlin.IntArray) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.IntArray + BLOCK_BODY + VAR name:i type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + VAR name: type:kotlin.Int [val] + CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=null + index: BLOCK type=kotlin.Int origin=null + VAR name: type:kotlin.Int [val] + GET_VAR 'var i: kotlin.Int [var] declared in .test1' type=kotlin.Int origin=null + ERROR_CALL 'Unresolved reference: R|/i|' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .test1' type=kotlin.Int origin=null + CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=null + index: BLOCK type=kotlin.Int origin=null + VAR name: type:kotlin.Int [val] + GET_VAR 'var i: kotlin.Int [var] declared in .test1' type=kotlin.Int origin=null + ERROR_CALL 'Unresolved reference: R|/i|' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .test1' type=kotlin.Int origin=null + value: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .test1' type=kotlin.Int origin=null + GET_VAR 'val : kotlin.Int [val] declared in .test1' type=kotlin.Int origin=null + FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name: type:IrErrorType [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val : IrErrorType [val] declared in .test2' type=IrErrorType origin=null + VAR name: type:IrErrorType [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val : IrErrorType [val] declared in .test2' type=IrErrorType origin=null + VAR name: type:IrErrorType [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val : IrErrorType [val] declared in .test2' type=IrErrorType origin=null + CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + CONSTRUCTOR visibility:public <> (s:kotlin.Int) returnType:.B [primary] + VALUE_PARAMETER name:s index:0 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:s visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.Int visibility:public + EXPRESSION_BODY + GET_VAR 's: kotlin.Int declared in .B.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Int + correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .B' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .B declared in .B.' type=.B origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.B, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.B + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.Int visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .B declared in .B.' type=.B origin=null + value: GET_VAR ': kotlin.Int declared in .B.' type=kotlin.Int origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host + CONSTRUCTOR visibility:private <> () returnType:.Host [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:plusAssign visibility:public modality:FINAL <> ($this:.Host, b:.B) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Host + VALUE_PARAMETER name:b index:0 type:.B + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CALL 'public final fun (): kotlin.Int declared in .B' type=kotlin.Int origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test3 visibility:public modality:FINAL <> (v:.B) returnType:kotlin.Unit + VALUE_PARAMETER name:v index:0 type:.B + BLOCK_BODY + ERROR_CALL 'Unresolved reference: R|/v|' type=IrErrorType diff --git a/compiler/testData/ir/irText/expressions/contructorCall.kt b/compiler/testData/ir/irText/expressions/contructorCall.kt index 06e20e8e32a..4fdd87aabd5 100644 --- a/compiler/testData/ir/irText/expressions/contructorCall.kt +++ b/compiler/testData/ir/irText/expressions/contructorCall.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL + class A val test = A() \ No newline at end of file diff --git a/compiler/testData/ir/irText/expressions/conventionComparisons.fir.txt b/compiler/testData/ir/irText/expressions/conventionComparisons.fir.txt new file mode 100644 index 00000000000..d9482429d46 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/conventionComparisons.fir.txt @@ -0,0 +1,58 @@ +FILE fqName: fileName:/conventionComparisons.kt + CLASS INTERFACE name:IA modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IA + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:IB modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IB + FUN name:compareTo visibility:public modality:ABSTRACT <> ($this:.IB, other:.IA) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.IB + VALUE_PARAMETER name:other index:0 type:.IA + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL <> (a1:.IA, a2:.IA) returnType:kotlin.Boolean + VALUE_PARAMETER name:a1 index:0 type:.IA + VALUE_PARAMETER name:a2 index:1 type:.IA + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (a1: .IA, a2: .IA): kotlin.Boolean declared in ' + ERROR_CALL 'Comparison of arguments with unsupported type: /IA' type=kotlin.Boolean + FUN name:test2 visibility:public modality:FINAL <> (a1:.IA, a2:.IA) returnType:kotlin.Boolean + VALUE_PARAMETER name:a1 index:0 type:.IA + VALUE_PARAMETER name:a2 index:1 type:.IA + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (a1: .IA, a2: .IA): kotlin.Boolean declared in ' + ERROR_CALL 'Comparison of arguments with unsupported type: /IA' type=kotlin.Boolean + FUN name:test3 visibility:public modality:FINAL <> (a1:.IA, a2:.IA) returnType:kotlin.Boolean + VALUE_PARAMETER name:a1 index:0 type:.IA + VALUE_PARAMETER name:a2 index:1 type:.IA + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (a1: .IA, a2: .IA): kotlin.Boolean declared in ' + ERROR_CALL 'Comparison of arguments with unsupported type: /IA' type=kotlin.Boolean + FUN name:test4 visibility:public modality:FINAL <> (a1:.IA, a2:.IA) returnType:kotlin.Boolean + VALUE_PARAMETER name:a1 index:0 type:.IA + VALUE_PARAMETER name:a2 index:1 type:.IA + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (a1: .IA, a2: .IA): kotlin.Boolean declared in ' + ERROR_CALL 'Comparison of arguments with unsupported type: /IA' type=kotlin.Boolean diff --git a/compiler/testData/ir/irText/expressions/destructuring1.fir.txt b/compiler/testData/ir/irText/expressions/destructuring1.fir.txt new file mode 100644 index 00000000000..cfffb0342a2 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/destructuring1.fir.txt @@ -0,0 +1,57 @@ +FILE fqName: fileName:/destructuring1.kt + CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:private <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS OBJECT name:B modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + CONSTRUCTOR visibility:private <> () returnType:.B [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:component1 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int declared in .B' + CONST Int type=kotlin.Int value=1 + FUN name:component2 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component2 (): kotlin.Int declared in .B' + CONST Int type=kotlin.Int value=2 + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name: type:IrErrorType [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + VAR name:x type:kotlin.Int [val] + CALL 'public final fun component1 (): kotlin.Int declared in .B' type=kotlin.Int origin=null + VAR name:y type:kotlin.Int [val] + CALL 'public final fun component2 (): kotlin.Int declared in .B' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/destructuringWithUnderscore.fir.txt b/compiler/testData/ir/irText/expressions/destructuringWithUnderscore.fir.txt new file mode 100644 index 00000000000..d9f9f5189e4 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/destructuringWithUnderscore.fir.txt @@ -0,0 +1,64 @@ +FILE fqName: fileName:/destructuringWithUnderscore.kt + CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:private <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS OBJECT name:B modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + CONSTRUCTOR visibility:private <> () returnType:.B [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:component1 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int declared in .B' + CONST Int type=kotlin.Int value=1 + FUN name:component2 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component2 (): kotlin.Int declared in .B' + CONST Int type=kotlin.Int value=2 + FUN name:component3 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component3 (): kotlin.Int declared in .B' + CONST Int type=kotlin.Int value=3 + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name: type:IrErrorType [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + VAR name:x type:kotlin.Int [val] + CALL 'public final fun component1 (): kotlin.Int declared in .B' type=kotlin.Int origin=null + VAR name:_ type:kotlin.Int [val] + CALL 'public final fun component2 (): kotlin.Int declared in .B' type=kotlin.Int origin=null + VAR name:z type:kotlin.Int [val] + CALL 'public final fun component3 (): kotlin.Int declared in .B' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/dotQualified.fir.txt b/compiler/testData/ir/irText/expressions/dotQualified.fir.txt new file mode 100644 index 00000000000..1526c60b015 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/dotQualified.fir.txt @@ -0,0 +1,11 @@ +FILE fqName: fileName:/dotQualified.kt + FUN name:length visibility:public modality:FINAL <> (s:kotlin.String) returnType:IrErrorType + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun length (s: kotlin.String): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN name:lengthN visibility:public modality:FINAL <> (s:kotlin.String?) returnType:IrErrorType + VALUE_PARAMETER name:s index:0 type:kotlin.String? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun lengthN (s: kotlin.String?): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType diff --git a/compiler/testData/ir/irText/expressions/elvis.fir.txt b/compiler/testData/ir/irText/expressions/elvis.fir.txt new file mode 100644 index 00000000000..89f8eff02d3 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/elvis.fir.txt @@ -0,0 +1,109 @@ +FILE fqName: fileName:/elvis.kt + PROPERTY name:p visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Any? visibility:public [final,static] + EXPRESSION_BODY + CONST Null type=kotlin.Nothing? value=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Any? + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any? declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Any? visibility:public [final,static] ' type=kotlin.Any? origin=null + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Any? declared in ' + CONST Null type=kotlin.Nothing? value=null + FUN name:test1 visibility:public modality:FINAL <> (a:kotlin.Any?, b:kotlin.Any) returnType:kotlin.Any + VALUE_PARAMETER name:a index:0 type:kotlin.Any? + VALUE_PARAMETER name:b index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (a: kotlin.Any?, b: kotlin.Any): kotlin.Any declared in ' + BLOCK type=kotlin.Any origin=ELVIS + VAR name: type:kotlin.Any? [val] + GET_VAR 'a: kotlin.Any? declared in .test1' type=kotlin.Any? origin=null + WHEN type=kotlin.Any origin=ELVIS + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val : kotlin.Any? [val] declared in .test1' type=kotlin.Any? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: GET_VAR 'b: kotlin.Any declared in .test1' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val : kotlin.Any? [val] declared in .test1' type=kotlin.Any? origin=null + FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.String?, b:kotlin.Any) returnType:kotlin.Any + VALUE_PARAMETER name:a index:0 type:kotlin.String? + VALUE_PARAMETER name:b index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (a: kotlin.String?, b: kotlin.Any): kotlin.Any declared in ' + BLOCK type=kotlin.Any origin=ELVIS + VAR name: type:kotlin.String? [val] + GET_VAR 'a: kotlin.String? declared in .test2' type=kotlin.String? origin=null + WHEN type=kotlin.Any origin=ELVIS + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val : kotlin.String? [val] declared in .test2' type=kotlin.String? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: GET_VAR 'b: kotlin.Any declared in .test2' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val : kotlin.String? [val] declared in .test2' type=kotlin.String? origin=null + FUN name:test3 visibility:public modality:FINAL <> (a:kotlin.Any?, b:kotlin.Any?) returnType:kotlin.String + VALUE_PARAMETER name:a index:0 type:kotlin.Any? + VALUE_PARAMETER name:b index:1 type:kotlin.Any? + BLOCK_BODY + WHEN type=kotlin.String origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.String + GET_VAR 'b: kotlin.Any? declared in .test3' type=kotlin.Any? origin=null + then: RETURN type=kotlin.Nothing from='public final fun test3 (a: kotlin.Any?, b: kotlin.Any?): kotlin.String declared in ' + CONST String type=kotlin.String value="" + WHEN type=kotlin.String origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.String? + GET_VAR 'a: kotlin.Any? declared in .test3' type=kotlin.Any? origin=null + then: RETURN type=kotlin.Nothing from='public final fun test3 (a: kotlin.Any?, b: kotlin.Any?): kotlin.String declared in ' + CONST String type=kotlin.String value="" + RETURN type=kotlin.Nothing from='public final fun test3 (a: kotlin.Any?, b: kotlin.Any?): kotlin.String declared in ' + BLOCK type=kotlin.String origin=ELVIS + VAR name: type:kotlin.Any? [val] + GET_VAR 'a: kotlin.Any? declared in .test3' type=kotlin.Any? origin=null + WHEN type=kotlin.String origin=ELVIS + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val : kotlin.Any? [val] declared in .test3' type=kotlin.Any? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: GET_VAR 'b: kotlin.Any? declared in .test3' type=kotlin.Any? origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val : kotlin.Any? [val] declared in .test3' type=kotlin.Any? origin=null + FUN name:test4 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Any + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (x: kotlin.Any): kotlin.Any declared in ' + BLOCK type=kotlin.Any origin=ELVIS + VAR name: type:kotlin.Any? [val] + CALL 'public final fun (): kotlin.Any? declared in ' type=kotlin.Any? origin=null + WHEN type=kotlin.Any origin=ELVIS + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val : kotlin.Any? [val] declared in .test4' type=kotlin.Any? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: GET_VAR 'x: kotlin.Any declared in .test4' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val : kotlin.Any? [val] declared in .test4' type=kotlin.Any? origin=null + FUN name:test5 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Any + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5 (x: kotlin.Any): kotlin.Any declared in ' + BLOCK type=kotlin.Any origin=ELVIS + VAR name: type:kotlin.Any? [val] + CALL 'public final fun foo (): kotlin.Any? declared in ' type=kotlin.Any? origin=null + WHEN type=kotlin.Any origin=ELVIS + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val : kotlin.Any? [val] declared in .test5' type=kotlin.Any? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: GET_VAR 'x: kotlin.Any declared in .test5' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val : kotlin.Any? [val] declared in .test5' type=kotlin.Any? origin=null diff --git a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt new file mode 100644 index 00000000000..333b349fead --- /dev/null +++ b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt @@ -0,0 +1,84 @@ +FILE fqName: fileName:/enumEntryAsReceiver.kt + CLASS ENUM_CLASS name:X modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X + CONSTRUCTOR visibility:private <> () returnType:.X [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:X modality:FINAL visibility:public superTypes:[kotlin.Enum]' + CLASS ENUM_ENTRY name:B modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X.B + CONSTRUCTOR visibility:public <> () returnType:.X.B [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:value2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.String visibility:public [final] + EXPRESSION_BODY + CONST String type=kotlin.String value="OK" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.X.B) returnType:kotlin.String + correspondingProperty: PROPERTY name:value2 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.X.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .X.B' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .X.B declared in .X.B.' type=.X.B origin=null + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:IrErrorType visibility:public [final] + EXPRESSION_BODY + BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($this:.X.B) returnType:IrErrorType + $this: VALUE_PARAMETER name: type:.X.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .X.B.value' + CALL 'public final fun (): kotlin.String declared in .X.B' type=kotlin.String origin=null + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .X.B.value' type=IrErrorType origin=LAMBDA + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.X.B) returnType:IrErrorType + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.X.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .X.B' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:IrErrorType visibility:public [final] ' type=IrErrorType origin=null + receiver: GET_VAR ': .X.B declared in .X.B.' type=.X.B origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:value visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.X) returnType:kotlin.Function0 + correspondingProperty: PROPERTY name:value visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.X + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType diff --git a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt new file mode 100644 index 00000000000..a322cfc4203 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt @@ -0,0 +1,125 @@ +FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt + CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum + CONSTRUCTOR visibility:private <> () returnType:.MyEnum [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public superTypes:[kotlin.Enum]' + CLASS ENUM_ENTRY name:Z modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum.Z + CONSTRUCTOR visibility:public <> () returnType:.MyEnum.Z [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:counter visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyEnum.Z) returnType:kotlin.Int + correspondingProperty: PROPERTY name:counter visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.MyEnum.Z + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .MyEnum.Z' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z.' type=.MyEnum.Z origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyEnum.Z, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:counter visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.MyEnum.Z + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z.' type=.MyEnum.Z origin=null + value: GET_VAR ': kotlin.Int declared in .MyEnum.Z.' type=kotlin.Int origin=null + FUN name:foo visibility:public modality:FINAL <> ($this:.MyEnum.Z) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.MyEnum.Z + BLOCK_BODY + FUN name:bar visibility:public modality:FINAL <> ($this:.MyEnum.Z) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.MyEnum.Z + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null + PROPERTY name:aLambda visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:aLambda type:IrErrorType visibility:public [final] + EXPRESSION_BODY + BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($this:.MyEnum.Z) returnType:IrErrorType + $this: VALUE_PARAMETER name: type:.MyEnum.Z + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .MyEnum.Z.aLambda' + BLOCK type=kotlin.Unit origin=null + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .MyEnum.Z.aLambda' type=IrErrorType origin=LAMBDA + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyEnum.Z) returnType:IrErrorType + correspondingProperty: PROPERTY name:aLambda visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.MyEnum.Z + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .MyEnum.Z' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:aLambda type:IrErrorType visibility:public [final] ' type=IrErrorType origin=null + receiver: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z.' type=.MyEnum.Z origin=null + PROPERTY name:anObject visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:anObject type:IrErrorType visibility:public [final] + EXPRESSION_BODY + BLOCK type=.MyEnum.Z.anObject. origin=OBJECT_LITERAL + CLASS OBJECT name: modality:FINAL visibility:local superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum.Z.anObject. + CONSTRUCTOR visibility:private <> () returnType:IrErrorType [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name: modality:FINAL visibility:local superTypes:[kotlin.Any]' + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null + FUN name:test visibility:public modality:FINAL <> ($this:.MyEnum.Z.anObject.) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.MyEnum.Z.anObject. + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null + CALL 'private constructor () [primary] declared in .MyEnum.Z.anObject.' type=.MyEnum.Z.anObject. origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyEnum.Z) returnType:IrErrorType + correspondingProperty: PROPERTY name:anObject visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.MyEnum.Z + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .MyEnum.Z' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anObject type:IrErrorType visibility:public [final] ' type=IrErrorType origin=null + receiver: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z.' type=.MyEnum.Z origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum diff --git a/compiler/testData/ir/irText/expressions/equality.kt b/compiler/testData/ir/irText/expressions/equality.kt index bc3b2ccfb80..876165ac1a8 100644 --- a/compiler/testData/ir/irText/expressions/equality.kt +++ b/compiler/testData/ir/irText/expressions/equality.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL + fun test1(a: Int, b: Int) = a == b fun test2(a: Int, b: Int) = a != b fun test3(a: Any?, b: Any?) = a == b diff --git a/compiler/testData/ir/irText/expressions/extFunInvokeAsFun.fir.txt b/compiler/testData/ir/irText/expressions/extFunInvokeAsFun.fir.txt new file mode 100644 index 00000000000..a6f7db0c9fc --- /dev/null +++ b/compiler/testData/ir/irText/expressions/extFunInvokeAsFun.fir.txt @@ -0,0 +1,14 @@ +FILE fqName: fileName:/extFunInvokeAsFun.kt + FUN name:with1 visibility:public modality:FINAL <> (receiver:kotlin.Any?, block:kotlin.Function1) returnType:IrErrorType + VALUE_PARAMETER name:receiver index:0 type:kotlin.Any? + VALUE_PARAMETER name:block index:1 type:kotlin.Function1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun with1 (receiver: kotlin.Any?, block: kotlin.Function1): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'receiver: kotlin.Any? declared in .with1' type=kotlin.Any? origin=null + FUN name:with2 visibility:public modality:FINAL <> (receiver:kotlin.Any?, block:kotlin.Function1) returnType:IrErrorType + VALUE_PARAMETER name:receiver index:0 type:kotlin.Any? + VALUE_PARAMETER name:block index:1 type:kotlin.Function1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun with2 (receiver: kotlin.Any?, block: kotlin.Function1): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType diff --git a/compiler/testData/ir/irText/expressions/extFunSafeInvoke.fir.txt b/compiler/testData/ir/irText/expressions/extFunSafeInvoke.fir.txt new file mode 100644 index 00000000000..6e2efc14595 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/extFunSafeInvoke.fir.txt @@ -0,0 +1,9 @@ +FILE fqName: fileName:/extFunSafeInvoke.kt + FUN name:test visibility:public modality:FINAL <> (receiver:kotlin.Any?, fn:kotlin.Function3) returnType:IrErrorType + VALUE_PARAMETER name:receiver index:0 type:kotlin.Any? + VALUE_PARAMETER name:fn index:1 type:kotlin.Function3 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test (receiver: kotlin.Any?, fn: kotlin.Function3): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST Int type=kotlin.Int value=42 + CONST String type=kotlin.String value="Hello" diff --git a/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.fir.txt b/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.fir.txt new file mode 100644 index 00000000000..b84e82e168d --- /dev/null +++ b/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.fir.txt @@ -0,0 +1,11 @@ +FILE fqName: fileName:/extensionPropertyGetterCall.kt + PROPERTY name:okext visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:okext visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + CONST String type=kotlin.String value="OK" + FUN name:test5 visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5 (): kotlin.String declared in ' + CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/expressions/field.fir.txt b/compiler/testData/ir/irText/expressions/field.fir.txt new file mode 100644 index 00000000000..9dcf27818fa --- /dev/null +++ b/compiler/testData/ir/irText/expressions/field.fir.txt @@ -0,0 +1,29 @@ +FILE fqName: fileName:/field.kt + PROPERTY name:testSimple visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:testSimple type:kotlin.Int visibility:public [static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:testSimple visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testSimple type:kotlin.Int visibility:public [static] ' type=kotlin.Int origin=null + FUN name: visibility:public modality:FINAL <> (value:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:testSimple visibility:public modality:FINAL [var] + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + PROPERTY name:testAugmented visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:testAugmented type:kotlin.Int visibility:public [static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:testAugmented visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testAugmented type:kotlin.Int visibility:public [static] ' type=kotlin.Int origin=null + FUN name: visibility:public modality:FINAL <> (value:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:testAugmented visibility:public modality:FINAL [var] + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/comparableWithDoubleOrFloat.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/comparableWithDoubleOrFloat.fir.txt new file mode 100644 index 00000000000..e7fee32f93d --- /dev/null +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/comparableWithDoubleOrFloat.fir.txt @@ -0,0 +1,41 @@ +FILE fqName: fileName:/comparableWithDoubleOrFloat.kt + FUN name:testD visibility:public modality:FINAL <> (x:kotlin.Comparable, y:kotlin.Comparable) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Comparable + VALUE_PARAMETER name:y index:1 type:kotlin.Comparable + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testD (x: kotlin.Comparable, y: kotlin.Comparable): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Comparable declared in .testD' type=kotlin.Comparable origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Comparable declared in .testD' type=kotlin.Comparable origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: ERROR_CALL 'Comparison of arguments with unsupported type: kotlin/Comparable' type=kotlin.Boolean + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:testF visibility:public modality:FINAL <> (x:kotlin.Comparable, y:kotlin.Comparable) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Comparable + VALUE_PARAMETER name:y index:1 type:kotlin.Comparable + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testF (x: kotlin.Comparable, y: kotlin.Comparable): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Comparable declared in .testF' type=kotlin.Comparable origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Comparable declared in .testF' type=kotlin.Comparable origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: ERROR_CALL 'Comparison of arguments with unsupported type: kotlin/Comparable' type=kotlin.Boolean + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/eqeqRhsConditionPossiblyAffectingLhs.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/eqeqRhsConditionPossiblyAffectingLhs.fir.txt new file mode 100644 index 00000000000..abac7f5f067 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/eqeqRhsConditionPossiblyAffectingLhs.fir.txt @@ -0,0 +1,27 @@ +FILE fqName: fileName:/eqeqRhsConditionPossiblyAffectingLhs.kt + FUN name:test visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test (x: kotlin.Any): kotlin.Boolean declared in ' + CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Any declared in .test' type=kotlin.Any origin=null + arg1: WHEN type=IrErrorType origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .test' type=kotlin.Any origin=null + then: BLOCK type=IrErrorType origin=EXCLEXCL + VAR name: type:kotlin.Nothing? [val] + CONST Null type=kotlin.Nothing? value=null + WHEN type=IrErrorType origin=EXCLEXCL + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val : kotlin.Nothing? [val] declared in .test' type=kotlin.Nothing? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: THROW type=kotlin.Nothing + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val : kotlin.Nothing? [val] declared in .test' type=kotlin.Nothing? origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'x: kotlin.Any declared in .test' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.fir.txt new file mode 100644 index 00000000000..b5486ad2190 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.fir.txt @@ -0,0 +1,175 @@ +FILE fqName: fileName:/floatingPointCompareTo.kt + FUN name:test1d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double) returnType:IrErrorType + VALUE_PARAMETER name:x index:0 type:kotlin.Double + VALUE_PARAMETER name:y index:1 type:kotlin.Double + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1d (x: kotlin.Double, y: kotlin.Double): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'y: kotlin.Double declared in .test1d' type=kotlin.Double origin=null + FUN name:test2d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Double + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2d (x: kotlin.Double, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .test2d' type=kotlin.Any origin=null + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'y: kotlin.Any declared in .test2d' type=kotlin.Any origin=null + arg1: CONST Int type=kotlin.Boolean value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test3d visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3d (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .test3d' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .test3d' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'y: kotlin.Any declared in .test3d' type=kotlin.Any origin=null + arg1: CONST Int type=kotlin.Boolean value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:IrErrorType + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Float + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1f (x: kotlin.Float, y: kotlin.Float): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'y: kotlin.Float declared in .test1f' type=kotlin.Float origin=null + FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test2f' type=kotlin.Any origin=null + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'y: kotlin.Any declared in .test2f' type=kotlin.Any origin=null + arg1: CONST Int type=kotlin.Boolean value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3f (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .test3f' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test3f' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'y: kotlin.Any declared in .test3f' type=kotlin.Any origin=null + arg1: CONST Int type=kotlin.Boolean value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testFD (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + arg1: CONST Int type=kotlin.Boolean value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:testDF visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testDF (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .testDF' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .testDF' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'y: kotlin.Any declared in .testDF' type=kotlin.Any origin=null + arg1: CONST Int type=kotlin.Boolean value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test1fr visibility:public modality:FINAL <> (x:kotlin.Float) returnType:IrErrorType + VALUE_PARAMETER name:x index:0 type:kotlin.Float + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1fr (x: kotlin.Float): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'x: kotlin.Float declared in .test1fr' type=kotlin.Float origin=null + FUN name:test2fr visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2fr (x: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .test2fr' type=kotlin.Any origin=null + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'x: kotlin.Any declared in .test2fr' type=kotlin.Any origin=null + arg1: CONST Int type=kotlin.Boolean value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test3fr visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3fr (x: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .test3fr' type=kotlin.Any origin=null + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'x: kotlin.Any declared in .test3fr' type=kotlin.Any origin=null + arg1: CONST Int type=kotlin.Boolean value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.fir.txt new file mode 100644 index 00000000000..2cce99e9c1e --- /dev/null +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEqeq.fir.txt @@ -0,0 +1,183 @@ +FILE fqName: fileName:/floatingPointEqeq.kt + FUN name:test1d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Double + VALUE_PARAMETER name:y index:1 type:kotlin.Double + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1d (x: kotlin.Double, y: kotlin.Double): kotlin.Boolean declared in ' + CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Double declared in .test1d' type=kotlin.Double origin=null + arg1: GET_VAR 'y: kotlin.Double declared in .test1d' type=kotlin.Double origin=null + FUN name:test2d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double?) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Double + VALUE_PARAMETER name:y index:1 type:kotlin.Double? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2d (x: kotlin.Double, y: kotlin.Double?): kotlin.Boolean declared in ' + CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Double declared in .test2d' type=kotlin.Double origin=null + arg1: GET_VAR 'y: kotlin.Double? declared in .test2d' type=kotlin.Double? origin=null + FUN name:test3d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Double + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3d (x: kotlin.Double, y: kotlin.Any): kotlin.Boolean declared in ' + CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Double declared in .test3d' type=kotlin.Double origin=null + arg1: GET_VAR 'y: kotlin.Any declared in .test3d' type=kotlin.Any origin=null + FUN name:test4d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Number) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Double + VALUE_PARAMETER name:y index:1 type:kotlin.Number + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4d (x: kotlin.Double, y: kotlin.Number): kotlin.Boolean declared in ' + CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Double declared in .test4d' type=kotlin.Double origin=null + arg1: GET_VAR 'y: kotlin.Number declared in .test4d' type=kotlin.Number origin=null + FUN name:test5d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Double + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5d (x: kotlin.Double, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .test5d' type=kotlin.Any origin=null + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Double declared in .test5d' type=kotlin.Double origin=null + arg1: GET_VAR 'y: kotlin.Any declared in .test5d' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test6d visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test6d (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .test6d' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .test6d' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Any declared in .test6d' type=kotlin.Any origin=null + arg1: GET_VAR 'y: kotlin.Any declared in .test6d' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Float + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1f (x: kotlin.Float, y: kotlin.Float): kotlin.Boolean declared in ' + CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Float declared in .test1f' type=kotlin.Float origin=null + arg1: GET_VAR 'y: kotlin.Float declared in .test1f' type=kotlin.Float origin=null + FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float?) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Float? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2f (x: kotlin.Float, y: kotlin.Float?): kotlin.Boolean declared in ' + CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Float declared in .test2f' type=kotlin.Float origin=null + arg1: GET_VAR 'y: kotlin.Float? declared in .test2f' type=kotlin.Float? origin=null + FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' + CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Float declared in .test3f' type=kotlin.Float origin=null + arg1: GET_VAR 'y: kotlin.Any declared in .test3f' type=kotlin.Any origin=null + FUN name:test4f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Number) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Number + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4f (x: kotlin.Float, y: kotlin.Number): kotlin.Boolean declared in ' + CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Float declared in .test4f' type=kotlin.Float origin=null + arg1: GET_VAR 'y: kotlin.Number declared in .test4f' type=kotlin.Number origin=null + FUN name:test5f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Float declared in .test5f' type=kotlin.Float origin=null + arg1: GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test6f visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test6f (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .test6f' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test6f' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Any declared in .test6f' type=kotlin.Any origin=null + arg1: GET_VAR 'y: kotlin.Any declared in .test6f' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testFD (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + arg1: GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:testDF visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testDF (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .testDF' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .testDF' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Any declared in .testDF' type=kotlin.Any origin=null + arg1: GET_VAR 'y: kotlin.Any declared in .testDF' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.fir.txt new file mode 100644 index 00000000000..e551f0ee663 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.fir.txt @@ -0,0 +1,219 @@ +FILE fqName: fileName:/floatingPointEquals.kt + FUN name:test1d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double) returnType:IrErrorType + VALUE_PARAMETER name:x index:0 type:kotlin.Double + VALUE_PARAMETER name:y index:1 type:kotlin.Double + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1d (x: kotlin.Double, y: kotlin.Double): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'y: kotlin.Double declared in .test1d' type=kotlin.Double origin=null + FUN name:test2d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double?) returnType:IrErrorType + VALUE_PARAMETER name:x index:0 type:kotlin.Double + VALUE_PARAMETER name:y index:1 type:kotlin.Double? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2d (x: kotlin.Double, y: kotlin.Double?): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'y: kotlin.Double? declared in .test2d' type=kotlin.Double? origin=null + FUN name:test3d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:IrErrorType + VALUE_PARAMETER name:x index:0 type:kotlin.Double + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3d (x: kotlin.Double, y: kotlin.Any): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'y: kotlin.Any declared in .test3d' type=kotlin.Any origin=null + FUN name:test4d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Number) returnType:IrErrorType + VALUE_PARAMETER name:x index:0 type:kotlin.Double + VALUE_PARAMETER name:y index:1 type:kotlin.Number + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4d (x: kotlin.Double, y: kotlin.Number): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'y: kotlin.Number declared in .test4d' type=kotlin.Number origin=null + FUN name:test5d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Double + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5d (x: kotlin.Double, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .test5d' type=kotlin.Any origin=null + then: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'y: kotlin.Any declared in .test5d' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test6d visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test6d (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .test6d' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .test6d' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null + other: GET_VAR 'y: kotlin.Any declared in .test6d' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:IrErrorType + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Float + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1f (x: kotlin.Float, y: kotlin.Float): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'y: kotlin.Float declared in .test1f' type=kotlin.Float origin=null + FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float?) returnType:IrErrorType + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Float? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2f (x: kotlin.Float, y: kotlin.Float?): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'y: kotlin.Float? declared in .test2f' type=kotlin.Float? origin=null + FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:IrErrorType + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3f (x: kotlin.Float, y: kotlin.Any): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'y: kotlin.Any declared in .test3f' type=kotlin.Any origin=null + FUN name:test4f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Number) returnType:IrErrorType + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Number + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4f (x: kotlin.Float, y: kotlin.Number): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'y: kotlin.Number declared in .test4f' type=kotlin.Number origin=null + FUN name:test5f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null + then: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test6f visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test6f (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .test6f' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test6f' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null + other: GET_VAR 'y: kotlin.Any declared in .test6f' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testFD (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null + other: GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:testDF visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testDF (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .testDF' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .testDF' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null + other: GET_VAR 'y: kotlin.Any declared in .testDF' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test1fr visibility:public modality:FINAL <> (x:kotlin.Float) returnType:IrErrorType + VALUE_PARAMETER name:x index:0 type:kotlin.Float + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1fr (x: kotlin.Float): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'x: kotlin.Float declared in .test1fr' type=kotlin.Float origin=null + FUN name:test2fr visibility:public modality:FINAL <> (x:kotlin.Float?) returnType:IrErrorType + VALUE_PARAMETER name:x index:0 type:kotlin.Float? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2fr (x: kotlin.Float?): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'x: kotlin.Float? declared in .test2fr' type=kotlin.Float? origin=null + FUN name:test3fr visibility:public modality:FINAL <> (x:kotlin.Any) returnType:IrErrorType + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3fr (x: kotlin.Any): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'x: kotlin.Any declared in .test3fr' type=kotlin.Any origin=null + FUN name:test4fr visibility:public modality:FINAL <> (x:kotlin.Number) returnType:IrErrorType + VALUE_PARAMETER name:x index:0 type:kotlin.Number + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4fr (x: kotlin.Number): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'x: kotlin.Number declared in .test4fr' type=kotlin.Number origin=null + FUN name:test5fr visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5fr (x: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .test5fr' type=kotlin.Any origin=null + then: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'x: kotlin.Any declared in .test5fr' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test6fr visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test6fr (x: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .test6fr' type=kotlin.Any origin=null + then: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'x: kotlin.Any declared in .test6fr' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.fir.txt new file mode 100644 index 00000000000..cc344f3852f --- /dev/null +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointExcleq.fir.txt @@ -0,0 +1,197 @@ +FILE fqName: fileName:/floatingPointExcleq.kt + FUN name:test1d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Double + VALUE_PARAMETER name:y index:1 type:kotlin.Double + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1d (x: kotlin.Double, y: kotlin.Double): kotlin.Boolean declared in ' + CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: GET_VAR 'x: kotlin.Double declared in .test1d' type=kotlin.Double origin=null + arg1: GET_VAR 'y: kotlin.Double declared in .test1d' type=kotlin.Double origin=null + FUN name:test2d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double?) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Double + VALUE_PARAMETER name:y index:1 type:kotlin.Double? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2d (x: kotlin.Double, y: kotlin.Double?): kotlin.Boolean declared in ' + CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: GET_VAR 'x: kotlin.Double declared in .test2d' type=kotlin.Double origin=null + arg1: GET_VAR 'y: kotlin.Double? declared in .test2d' type=kotlin.Double? origin=null + FUN name:test3d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Double + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3d (x: kotlin.Double, y: kotlin.Any): kotlin.Boolean declared in ' + CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: GET_VAR 'x: kotlin.Double declared in .test3d' type=kotlin.Double origin=null + arg1: GET_VAR 'y: kotlin.Any declared in .test3d' type=kotlin.Any origin=null + FUN name:test4d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Number) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Double + VALUE_PARAMETER name:y index:1 type:kotlin.Number + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4d (x: kotlin.Double, y: kotlin.Number): kotlin.Boolean declared in ' + CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: GET_VAR 'x: kotlin.Double declared in .test4d' type=kotlin.Double origin=null + arg1: GET_VAR 'y: kotlin.Number declared in .test4d' type=kotlin.Number origin=null + FUN name:test5d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Double + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5d (x: kotlin.Double, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .test5d' type=kotlin.Any origin=null + then: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: GET_VAR 'x: kotlin.Double declared in .test5d' type=kotlin.Double origin=null + arg1: GET_VAR 'y: kotlin.Any declared in .test5d' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test6d visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test6d (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .test6d' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .test6d' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: GET_VAR 'x: kotlin.Any declared in .test6d' type=kotlin.Any origin=null + arg1: GET_VAR 'y: kotlin.Any declared in .test6d' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Float + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1f (x: kotlin.Float, y: kotlin.Float): kotlin.Boolean declared in ' + CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: GET_VAR 'x: kotlin.Float declared in .test1f' type=kotlin.Float origin=null + arg1: GET_VAR 'y: kotlin.Float declared in .test1f' type=kotlin.Float origin=null + FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float?) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Float? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2f (x: kotlin.Float, y: kotlin.Float?): kotlin.Boolean declared in ' + CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: GET_VAR 'x: kotlin.Float declared in .test2f' type=kotlin.Float origin=null + arg1: GET_VAR 'y: kotlin.Float? declared in .test2f' type=kotlin.Float? origin=null + FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' + CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: GET_VAR 'x: kotlin.Float declared in .test3f' type=kotlin.Float origin=null + arg1: GET_VAR 'y: kotlin.Any declared in .test3f' type=kotlin.Any origin=null + FUN name:test4f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Number) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Number + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4f (x: kotlin.Float, y: kotlin.Number): kotlin.Boolean declared in ' + CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: GET_VAR 'x: kotlin.Float declared in .test4f' type=kotlin.Float origin=null + arg1: GET_VAR 'y: kotlin.Number declared in .test4f' type=kotlin.Number origin=null + FUN name:test5f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null + then: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: GET_VAR 'x: kotlin.Float declared in .test5f' type=kotlin.Float origin=null + arg1: GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test6f visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test6f (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .test6f' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test6f' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: GET_VAR 'x: kotlin.Any declared in .test6f' type=kotlin.Any origin=null + arg1: GET_VAR 'y: kotlin.Any declared in .test6f' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testFD (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + arg1: GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:testDF visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testDF (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .testDF' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .testDF' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: GET_VAR 'x: kotlin.Any declared in .testDF' type=kotlin.Any origin=null + arg1: GET_VAR 'y: kotlin.Any declared in .testDF' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointLess.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointLess.fir.txt new file mode 100644 index 00000000000..447460b2bfa --- /dev/null +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointLess.fir.txt @@ -0,0 +1,123 @@ +FILE fqName: fileName:/floatingPointLess.kt + FUN name:test1d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Double + VALUE_PARAMETER name:y index:1 type:kotlin.Double + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1d (x: kotlin.Double, y: kotlin.Double): kotlin.Boolean declared in ' + CALL 'public final fun less (arg0: kotlin.Double, arg1: kotlin.Double): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT + arg0: GET_VAR 'x: kotlin.Double declared in .test1d' type=kotlin.Double origin=null + arg1: GET_VAR 'y: kotlin.Double declared in .test1d' type=kotlin.Double origin=null + FUN name:test2d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Double + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2d (x: kotlin.Double, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .test2d' type=kotlin.Any origin=null + then: ERROR_CALL 'Comparison of arguments with different types: kotlin/Double, kotlin/Any' type=kotlin.Boolean + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test3d visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3d (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .test3d' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .test3d' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: ERROR_CALL 'Comparison of arguments with unsupported type: kotlin/Any' type=kotlin.Boolean + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Float + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1f (x: kotlin.Float, y: kotlin.Float): kotlin.Boolean declared in ' + CALL 'public final fun less (arg0: kotlin.Float, arg1: kotlin.Float): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT + arg0: GET_VAR 'x: kotlin.Float declared in .test1f' type=kotlin.Float origin=null + arg1: GET_VAR 'y: kotlin.Float declared in .test1f' type=kotlin.Float origin=null + FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Float + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test2f' type=kotlin.Any origin=null + then: ERROR_CALL 'Comparison of arguments with different types: kotlin/Float, kotlin/Any' type=kotlin.Boolean + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3f (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .test3f' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .test3f' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: ERROR_CALL 'Comparison of arguments with unsupported type: kotlin/Any' type=kotlin.Boolean + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testFD (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: ERROR_CALL 'Comparison of arguments with unsupported type: kotlin/Any' type=kotlin.Boolean + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:testDF visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testDF (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .testDF' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .testDF' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: ERROR_CALL 'Comparison of arguments with unsupported type: kotlin/Any' type=kotlin.Boolean + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableAnyAsIntToDouble.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableAnyAsIntToDouble.fir.txt new file mode 100644 index 00000000000..f80078702d0 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableAnyAsIntToDouble.fir.txt @@ -0,0 +1,14 @@ +FILE fqName: fileName:/nullableAnyAsIntToDouble.kt + FUN name:test visibility:public modality:FINAL <> (x:kotlin.Any?, y:kotlin.Double) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any? + VALUE_PARAMETER name:y index:1 type:kotlin.Double + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test (x: kotlin.Any?, y: kotlin.Double): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int + GET_VAR 'x: kotlin.Any? declared in .test' type=kotlin.Any? origin=null + then: ERROR_CALL 'Comparison of arguments with different types: kotlin/Any, kotlin/Double' type=kotlin.Boolean + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableFloatingPointEqeq.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableFloatingPointEqeq.fir.txt new file mode 100644 index 00000000000..ed8974b496d --- /dev/null +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/nullableFloatingPointEqeq.fir.txt @@ -0,0 +1,61 @@ +FILE fqName: fileName:/nullableFloatingPointEqeq.kt + FUN name:testDD visibility:public modality:FINAL <> (x:kotlin.Double?, y:kotlin.Double?) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Double? + VALUE_PARAMETER name:y index:1 type:kotlin.Double? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testDD (x: kotlin.Double?, y: kotlin.Double?): kotlin.Boolean declared in ' + CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Double? declared in .testDD' type=kotlin.Double? origin=null + arg1: GET_VAR 'y: kotlin.Double? declared in .testDD' type=kotlin.Double? origin=null + FUN name:testDF visibility:public modality:FINAL <> (x:kotlin.Double?, y:kotlin.Any?) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Double? + VALUE_PARAMETER name:y index:1 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testDF (x: kotlin.Double?, y: kotlin.Any?): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float? + GET_VAR 'y: kotlin.Any? declared in .testDF' type=kotlin.Any? origin=null + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Double? declared in .testDF' type=kotlin.Double? origin=null + arg1: GET_VAR 'y: kotlin.Any? declared in .testDF' type=kotlin.Any? origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:testDI visibility:public modality:FINAL <> (x:kotlin.Double?, y:kotlin.Any?) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Double? + VALUE_PARAMETER name:y index:1 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testDI (x: kotlin.Double?, y: kotlin.Any?): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int? + GET_VAR 'y: kotlin.Any? declared in .testDI' type=kotlin.Any? origin=null + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Double? declared in .testDI' type=kotlin.Double? origin=null + arg1: GET_VAR 'y: kotlin.Any? declared in .testDI' type=kotlin.Any? origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:testDI2 visibility:public modality:FINAL <> (x:kotlin.Any?, y:kotlin.Any?) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any? + VALUE_PARAMETER name:y index:1 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testDI2 (x: kotlin.Any?, y: kotlin.Any?): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int? + GET_VAR 'x: kotlin.Any? declared in .testDI2' type=kotlin.Any? origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any? declared in .testDI2' type=kotlin.Any? origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Any? declared in .testDI2' type=kotlin.Any? origin=null + arg1: GET_VAR 'y: kotlin.Any? declared in .testDI2' type=kotlin.Any? origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.fir.txt new file mode 100644 index 00000000000..fddd0c3d1fc --- /dev/null +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/typeParameterWithPrimitiveNumericSupertype.fir.txt @@ -0,0 +1,150 @@ +FILE fqName: fileName:/typeParameterWithPrimitiveNumericSupertype.kt + FUN name:test0 visibility:public modality:FINAL (x:kotlin.Any, y:T of .test0) returnType:kotlin.Boolean + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:T of .test0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test0 (x: kotlin.Any, y: T of .test0): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int + GET_VAR 'x: kotlin.Any declared in .test0' type=kotlin.Any origin=null + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Any declared in .test0' type=kotlin.Any origin=null + arg1: GET_VAR 'y: T of .test0 declared in .test0' type=T of .test0 origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test1 visibility:public modality:FINAL (x:kotlin.Any, y:T of .test1) returnType:kotlin.Boolean + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:T of .test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (x: kotlin.Any, y: T of .test1): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .test1' type=kotlin.Any origin=null + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Any declared in .test1' type=kotlin.Any origin=null + arg1: GET_VAR 'y: T of .test1 declared in .test1' type=T of .test1 origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test2 visibility:public modality:FINAL (x:kotlin.Any, y:T of .test2) returnType:kotlin.Boolean + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:T of .test2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (x: kotlin.Any, y: T of .test2): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'x: kotlin.Any declared in .test2' type=kotlin.Any origin=null + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Any declared in .test2' type=kotlin.Any origin=null + arg1: GET_VAR 'y: T of .test2 declared in .test2' type=T of .test2 origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test3 visibility:public modality:FINAL (x:kotlin.Any, y:T of .test3) returnType:kotlin.Boolean + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:T of .test3 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (x: kotlin.Any, y: T of .test3): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int + GET_VAR 'x: kotlin.Any declared in .test3' type=kotlin.Any origin=null + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Any declared in .test3' type=kotlin.Any origin=null + arg1: GET_VAR 'y: T of .test3 declared in .test3' type=T of .test3 origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test4 visibility:public modality:FINAL (x:kotlin.Any, y:T of .test4) returnType:kotlin.Boolean + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:T of .test4 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (x: kotlin.Any, y: T of .test4): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int + GET_VAR 'x: kotlin.Any declared in .test4' type=kotlin.Any origin=null + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Any declared in .test4' type=kotlin.Any origin=null + arg1: GET_VAR 'y: T of .test4 declared in .test4' type=T of .test4 origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test5 visibility:public modality:FINAL (x:kotlin.Any, y:R of .test5) returnType:kotlin.Boolean + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + TYPE_PARAMETER name:R index:0 variance: superTypes:[] + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:R of .test5 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5 (x: kotlin.Any, y: R of .test5): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int + GET_VAR 'x: kotlin.Any declared in .test5' type=kotlin.Any origin=null + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Any declared in .test5' type=kotlin.Any origin=null + arg1: GET_VAR 'y: R of .test5 declared in .test5' type=R of .test5 origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:test6 visibility:public modality:FINAL (x:kotlin.Any, y:T of .test6) returnType:kotlin.Boolean + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:T of .test6 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test6 (x: kotlin.Any, y: T of .test6): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int + GET_VAR 'x: kotlin.Any declared in .test6' type=kotlin.Any origin=null + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Any declared in .test6' type=kotlin.Any origin=null + arg1: GET_VAR 'y: T of .test6 declared in .test6' type=T of .test6 origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + CLASS CLASS name:F modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.F + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> () returnType:.F.F> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:F modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:testCapturedType visibility:public modality:FINAL <> ($this:.F, x:T of .F, y:kotlin.Any) returnType:kotlin.Boolean + $this: VALUE_PARAMETER name: type:.F + VALUE_PARAMETER name:x index:0 type:T of .F + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testCapturedType (x: T of .F, y: kotlin.Any): kotlin.Boolean declared in .F' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .F.testCapturedType' type=kotlin.Any origin=null + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: T of .F declared in .F.testCapturedType' type=T of .F origin=null + arg1: GET_VAR 'y: kotlin.Any declared in .F.testCapturedType' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.fir.txt new file mode 100644 index 00000000000..f364569b3ce --- /dev/null +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.fir.txt @@ -0,0 +1,140 @@ +FILE fqName: fileName:/whenByFloatingPoint.kt + FUN name:testSimple visibility:public modality:FINAL <> (x:kotlin.Double) returnType:kotlin.Int + VALUE_PARAMETER name:x index:0 type:kotlin.Double + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testSimple (x: kotlin.Double): kotlin.Int declared in ' + BLOCK type=kotlin.Int origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp0_subject type:kotlin.Double [val] + WHEN type=kotlin.Int origin=WHEN + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp0_subject: kotlin.Double [val] declared in .testSimple' type=kotlin.Double origin=null + arg1: CONST Double type=kotlin.Int value=0.0 + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Int type=kotlin.Int value=1 + FUN name:testSmartCastInWhenSubject visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Int + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + WHEN type=kotlin.Int origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .testSmartCastInWhenSubject' type=kotlin.Any origin=null + then: RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenSubject (x: kotlin.Any): kotlin.Int declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST Int type=kotlin.Int value=1 + RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenSubject (x: kotlin.Any): kotlin.Int declared in ' + BLOCK type=kotlin.Int origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp1_subject type:kotlin.Any [val] + WHEN type=kotlin.Int origin=WHEN + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp1_subject: kotlin.Any [val] declared in .testSmartCastInWhenSubject' type=kotlin.Any origin=null + arg1: CONST Double type=kotlin.Int value=0.0 + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Int type=kotlin.Int value=1 + FUN name:testSmartCastInWhenCondition visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Int + VALUE_PARAMETER name:x index:0 type:kotlin.Double + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + WHEN type=kotlin.Int origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'y: kotlin.Any declared in .testSmartCastInWhenCondition' type=kotlin.Any origin=null + then: RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenCondition (x: kotlin.Double, y: kotlin.Any): kotlin.Int declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST Int type=kotlin.Int value=1 + RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenCondition (x: kotlin.Double, y: kotlin.Any): kotlin.Int declared in ' + BLOCK type=kotlin.Int origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp2_subject type:kotlin.Double [val] + WHEN type=kotlin.Int origin=WHEN + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp2_subject: kotlin.Double [val] declared in .testSmartCastInWhenCondition' type=kotlin.Double origin=null + arg1: GET_VAR 'y: kotlin.Any declared in .testSmartCastInWhenCondition' type=kotlin.Any origin=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Int type=kotlin.Int value=1 + FUN name:testSmartCastInWhenConditionInBranch visibility:public modality:FINAL <> (x:kotlin.Any) returnType:IrErrorType + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenConditionInBranch (x: kotlin.Any): IrErrorType declared in ' + BLOCK type=IrErrorType origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp3_subject type:kotlin.Any [val] + WHEN type=IrErrorType origin=WHEN + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'val tmp3_subject: kotlin.Any [val] declared in .testSmartCastInWhenConditionInBranch' type=kotlin.Any origin=null + then: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST Int type=kotlin.Int value=1 + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp3_subject: kotlin.Any [val] declared in .testSmartCastInWhenConditionInBranch' type=kotlin.Any origin=null + arg1: CONST Double type=IrErrorType value=0.0 + then: CONST Int type=IrErrorType value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Int type=IrErrorType value=1 + FUN name:testSmartCastToDifferentTypes visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Int + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + WHEN type=kotlin.Int origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .testSmartCastToDifferentTypes' type=kotlin.Any origin=null + then: RETURN type=kotlin.Nothing from='public final fun testSmartCastToDifferentTypes (x: kotlin.Any, y: kotlin.Any): kotlin.Int declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST Int type=kotlin.Int value=1 + WHEN type=kotlin.Int origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Float + GET_VAR 'y: kotlin.Any declared in .testSmartCastToDifferentTypes' type=kotlin.Any origin=null + then: RETURN type=kotlin.Nothing from='public final fun testSmartCastToDifferentTypes (x: kotlin.Any, y: kotlin.Any): kotlin.Int declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST Int type=kotlin.Int value=1 + RETURN type=kotlin.Nothing from='public final fun testSmartCastToDifferentTypes (x: kotlin.Any, y: kotlin.Any): kotlin.Int declared in ' + BLOCK type=kotlin.Int origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp4_subject type:kotlin.Any [val] + WHEN type=kotlin.Int origin=WHEN + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp4_subject: kotlin.Any [val] declared in .testSmartCastToDifferentTypes' type=kotlin.Any origin=null + arg1: GET_VAR 'y: kotlin.Any declared in .testSmartCastToDifferentTypes' type=kotlin.Any origin=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Int type=kotlin.Int value=1 + FUN name:foo visibility:public modality:FINAL <> (x:kotlin.Double) returnType:kotlin.Double + VALUE_PARAMETER name:x index:0 type:kotlin.Double + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (x: kotlin.Double): kotlin.Double declared in ' + GET_VAR 'x: kotlin.Double declared in .foo' type=kotlin.Double origin=null + FUN name:testWithPrematureExitInConditionSubexpression visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Int + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testWithPrematureExitInConditionSubexpression (x: kotlin.Any): kotlin.Int declared in ' + BLOCK type=kotlin.Int origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp5_subject type:kotlin.Any [val] + WHEN type=kotlin.Int origin=WHEN + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp5_subject: kotlin.Any [val] declared in .testWithPrematureExitInConditionSubexpression' type=kotlin.Any origin=null + arg1: CALL 'public final fun foo (x: kotlin.Double): kotlin.Double declared in ' type=kotlin.Double origin=null + x: WHEN type=kotlin.Int origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Double + GET_VAR 'x: kotlin.Any declared in .testWithPrematureExitInConditionSubexpression' type=kotlin.Any origin=null + then: RETURN type=kotlin.Nothing from='public final fun testWithPrematureExitInConditionSubexpression (x: kotlin.Any): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=42 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'x: kotlin.Any declared in .testWithPrematureExitInConditionSubexpression' type=kotlin.Any origin=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Int type=kotlin.Int value=1 diff --git a/compiler/testData/ir/irText/expressions/for.fir.txt b/compiler/testData/ir/irText/expressions/for.fir.txt new file mode 100644 index 00000000000..42c7f0cfbf2 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/for.fir.txt @@ -0,0 +1,47 @@ +FILE fqName: fileName:/for.kt + FUN name:testEmpty visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit + VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List + BLOCK_BODY + VAR name: type:kotlin.collections.List [val] + GET_VAR 'ss: kotlin.collections.List declared in .testEmpty' type=kotlin.collections.List origin=null + VAR name: type:kotlin.collections.Iterator> [val] + CALL 'public abstract fun iterator (): kotlin.collections.Iterator> declared in kotlin.collections.List' type=kotlin.collections.Iterator> origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null + body: BLOCK type=kotlin.Unit origin=null + VAR name:s type:T of [val] + CALL 'public abstract fun next (): T of declared in kotlin.collections.Iterator' type=T of origin=null + FUN name:testIterable visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit + VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List + BLOCK_BODY + VAR name: type:kotlin.collections.List [val] + GET_VAR 'ss: kotlin.collections.List declared in .testIterable' type=kotlin.collections.List origin=null + VAR name: type:kotlin.collections.Iterator> [val] + CALL 'public abstract fun iterator (): kotlin.collections.Iterator> declared in kotlin.collections.List' type=kotlin.collections.Iterator> origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null + body: BLOCK type=IrErrorType origin=null + VAR name:s type:T of [val] + CALL 'public abstract fun next (): T of declared in kotlin.collections.Iterator' type=T of origin=null + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val s: T of [val] declared in .testIterable' type=T of origin=null + FUN name:testDestructuring visibility:public modality:FINAL <> (pp:kotlin.collections.List>) returnType:kotlin.Unit + VALUE_PARAMETER name:pp index:0 type:kotlin.collections.List> + BLOCK_BODY + VAR name: type:kotlin.collections.List> [val] + GET_VAR 'pp: kotlin.collections.List> declared in .testDestructuring' type=kotlin.collections.List> origin=null + VAR name: type:kotlin.collections.Iterator> [val] + CALL 'public abstract fun iterator (): kotlin.collections.Iterator> declared in kotlin.collections.List' type=kotlin.collections.Iterator> origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null + body: BLOCK type=IrErrorType origin=null + VAR name: type:T of [val] + CALL 'public abstract fun next (): T of declared in kotlin.collections.Iterator' type=T of origin=null + VAR name:i type:IrErrorType [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + VAR name:s type:IrErrorType [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val i: IrErrorType [val] declared in .testDestructuring' type=IrErrorType origin=null + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val s: IrErrorType [val] declared in .testDestructuring' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/expressions/forWithBreakContinue.fir.txt b/compiler/testData/ir/irText/expressions/forWithBreakContinue.fir.txt new file mode 100644 index 00000000000..ae814c99472 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/forWithBreakContinue.fir.txt @@ -0,0 +1,77 @@ +FILE fqName: fileName:/forWithBreakContinue.kt + FUN name:testForBreak1 visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit + VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List + BLOCK_BODY + VAR name: type:kotlin.collections.List [val] + GET_VAR 'ss: kotlin.collections.List declared in .testForBreak1' type=kotlin.collections.List origin=null + VAR name: type:kotlin.collections.Iterator> [val] + CALL 'public abstract fun iterator (): kotlin.collections.Iterator> declared in kotlin.collections.List' type=kotlin.collections.Iterator> origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null + body: BLOCK type=IrErrorType origin=null + VAR name:s type:T of [val] + CALL 'public abstract fun next (): T of declared in kotlin.collections.Iterator' type=T of origin=null + BREAK label=null loop.label=null + FUN name:testForBreak2 visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit + VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List + BLOCK_BODY + VAR name: type:kotlin.collections.List [val] + GET_VAR 'ss: kotlin.collections.List declared in .testForBreak2' type=kotlin.collections.List origin=null + VAR name: type:kotlin.collections.Iterator> [val] + CALL 'public abstract fun iterator (): kotlin.collections.Iterator> declared in kotlin.collections.List' type=kotlin.collections.Iterator> origin=null + WHILE label=OUTER origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null + body: BLOCK type=IrErrorType origin=null + VAR name:s1 type:T of [val] + CALL 'public abstract fun next (): T of declared in kotlin.collections.Iterator' type=T of origin=null + VAR name: type:kotlin.collections.List [val] + GET_VAR 'ss: kotlin.collections.List declared in .testForBreak2' type=kotlin.collections.List origin=null + VAR name: type:kotlin.collections.Iterator> [val] + CALL 'public abstract fun iterator (): kotlin.collections.Iterator> declared in kotlin.collections.List' type=kotlin.collections.Iterator> origin=null + WHILE label=INNER origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null + body: BLOCK type=IrErrorType origin=null + VAR name:s2 type:T of [val] + CALL 'public abstract fun next (): T of declared in kotlin.collections.Iterator' type=T of origin=null + BREAK label=OUTER loop.label=OUTER + BREAK label=INNER loop.label=INNER + BREAK label=null loop.label=INNER + BREAK label=OUTER loop.label=OUTER + FUN name:testForContinue1 visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit + VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List + BLOCK_BODY + VAR name: type:kotlin.collections.List [val] + GET_VAR 'ss: kotlin.collections.List declared in .testForContinue1' type=kotlin.collections.List origin=null + VAR name: type:kotlin.collections.Iterator> [val] + CALL 'public abstract fun iterator (): kotlin.collections.Iterator> declared in kotlin.collections.List' type=kotlin.collections.Iterator> origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null + body: BLOCK type=IrErrorType origin=null + VAR name:s type:T of [val] + CALL 'public abstract fun next (): T of declared in kotlin.collections.Iterator' type=T of origin=null + CONTINUE label=null loop.label=null + FUN name:testForContinue2 visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit + VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List + BLOCK_BODY + VAR name: type:kotlin.collections.List [val] + GET_VAR 'ss: kotlin.collections.List declared in .testForContinue2' type=kotlin.collections.List origin=null + VAR name: type:kotlin.collections.Iterator> [val] + CALL 'public abstract fun iterator (): kotlin.collections.Iterator> declared in kotlin.collections.List' type=kotlin.collections.Iterator> origin=null + WHILE label=OUTER origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null + body: BLOCK type=IrErrorType origin=null + VAR name:s1 type:T of [val] + CALL 'public abstract fun next (): T of declared in kotlin.collections.Iterator' type=T of origin=null + VAR name: type:kotlin.collections.List [val] + GET_VAR 'ss: kotlin.collections.List declared in .testForContinue2' type=kotlin.collections.List origin=null + VAR name: type:kotlin.collections.Iterator> [val] + CALL 'public abstract fun iterator (): kotlin.collections.Iterator> declared in kotlin.collections.List' type=kotlin.collections.Iterator> origin=null + WHILE label=INNER origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null + body: BLOCK type=IrErrorType origin=null + VAR name:s2 type:T of [val] + CALL 'public abstract fun next (): T of declared in kotlin.collections.Iterator' type=T of origin=null + CONTINUE label=OUTER loop.label=OUTER + CONTINUE label=INNER loop.label=INNER + CONTINUE label=null loop.label=INNER + CONTINUE label=OUTER loop.label=OUTER diff --git a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt new file mode 100644 index 00000000000..619da7b065e --- /dev/null +++ b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt @@ -0,0 +1,109 @@ +FILE fqName: fileName:/forWithImplicitReceivers.kt + CLASS OBJECT name:FiveTimes modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FiveTimes + CONSTRUCTOR visibility:private <> () returnType:.FiveTimes [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:FiveTimes modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:IntCell modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IntCell + CONSTRUCTOR visibility:public <> (value:kotlin.Int) returnType:.IntCell [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IntCell modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:value visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:public + EXPRESSION_BODY + GET_VAR 'value: kotlin.Int declared in .IntCell.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.IntCell) returnType:kotlin.Int + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.IntCell + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .IntCell' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .IntCell declared in .IntCell.' type=.IntCell origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.IntCell, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.IntCell + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .IntCell declared in .IntCell.' type=.IntCell origin=null + value: GET_VAR ': kotlin.Int declared in .IntCell.' type=kotlin.Int origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:IReceiver modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IReceiver + FUN name:iterator visibility:public modality:OPEN <> ($this:.IReceiver) returnType:.IntCell + $this: VALUE_PARAMETER name: type:.IReceiver + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun iterator (): .IntCell declared in .IReceiver' + CALL 'public constructor (value: kotlin.Int) [primary] declared in .IntCell' type=.IntCell origin=null + value: CONST Int type=kotlin.Int value=5 + FUN name:hasNext visibility:public modality:OPEN <> ($this:.IReceiver) returnType:kotlin.Boolean + $this: VALUE_PARAMETER name: type:.IReceiver + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hasNext (): kotlin.Boolean declared in .IReceiver' + ERROR_CALL 'Comparison of arguments with different types: kotlin/Int, kotlin/Boolean' type=kotlin.Boolean + FUN name:next visibility:public modality:OPEN <> ($this:.IReceiver) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.IReceiver + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun next (): kotlin.Int declared in .IReceiver' + BLOCK type=kotlin.Int origin=null + VAR name: type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in .IntCell' type=kotlin.Int origin=null + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .IReceiver.next' type=kotlin.Int origin=null + GET_VAR 'val : kotlin.Int [val] declared in .IReceiver.next' type=kotlin.Int origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name: type:IrErrorType [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + VAR name: type:.IntCell [val] + CALL 'public open fun iterator (): .IntCell declared in .IReceiver' type=.IntCell origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public open fun hasNext (): kotlin.Boolean declared in .IReceiver' type=kotlin.Boolean origin=null + body: BLOCK type=IrErrorType origin=null + VAR name:i type:kotlin.Int [val] + CALL 'public open fun next (): kotlin.Int declared in .IReceiver' type=kotlin.Int origin=null + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val i: kotlin.Int [val] declared in .test' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/funImportedFromObject.fir.txt b/compiler/testData/ir/irText/expressions/funImportedFromObject.fir.txt new file mode 100644 index 00000000000..02870fa7d78 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/funImportedFromObject.fir.txt @@ -0,0 +1,31 @@ +FILE fqName:test fileName:/funImportedFromObject.kt + CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:test.Host + CONSTRUCTOR visibility:private <> () returnType:test.Host [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL ($this:test.Host) returnType:kotlin.String [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + $this: VALUE_PARAMETER name: type:test.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String [inline] declared in test.Host' + CONST String type=kotlin.String value="OK" + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test (): kotlin.String declared in test' + CALL 'public final fun foo (): kotlin.String [inline] declared in test.Host' type=kotlin.String origin=null + : diff --git a/compiler/testData/ir/irText/expressions/genericPropertyCall.fir.txt b/compiler/testData/ir/irText/expressions/genericPropertyCall.fir.txt new file mode 100644 index 00000000000..4c77b7e4417 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/genericPropertyCall.fir.txt @@ -0,0 +1,16 @@ +FILE fqName: fileName:/genericPropertyCall.kt + PROPERTY name:id visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:id visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: this#' type=IrErrorType + PROPERTY name:test visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun (): IrErrorType declared in ' type=IrErrorType origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.txt b/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.txt new file mode 100644 index 00000000000..fee0bb06311 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.txt @@ -0,0 +1,171 @@ +FILE fqName: fileName:/genericPropertyRef.kt + CLASS CLASS name:Value modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Value + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> (value:T of .Value, text:kotlin.String?) returnType:.Value.Value> [primary] + VALUE_PARAMETER name:value index:0 type:T of .Value + EXPRESSION_BODY + TYPE_OP type=T of .Value origin=CAST typeOperand=T of .Value + CONST Null type=kotlin.Nothing? value=null + VALUE_PARAMETER name:text index:1 type:kotlin.String? + EXPRESSION_BODY + CONST Null type=kotlin.Nothing? value=null + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Value modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:value visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:value type:T of .Value visibility:public + EXPRESSION_BODY + GET_VAR 'value: T of .Value declared in .Value.' type=T of .Value origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Value) returnType:T of .Value + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Value + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of .Value declared in .Value' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Value visibility:public ' type=T of .Value origin=null + receiver: GET_VAR ': .Value declared in .Value.' type=.Value origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Value, :T of .Value) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Value + VALUE_PARAMETER name: index:0 type:T of .Value + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Value visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .Value declared in .Value.' type=.Value origin=null + value: GET_VAR ': T of .Value declared in .Value.' type=T of .Value origin=null + PROPERTY name:text visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:text type:kotlin.String? visibility:public + EXPRESSION_BODY + GET_VAR 'text: kotlin.String? declared in .Value.' type=kotlin.String? origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Value) returnType:kotlin.String? + correspondingProperty: PROPERTY name:text visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Value + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String? declared in .Value' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:text type:kotlin.String? visibility:public ' type=kotlin.String? origin=null + receiver: GET_VAR ': .Value declared in .Value.' type=.Value origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Value, :kotlin.String?) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:text visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Value + VALUE_PARAMETER name: index:0 type:kotlin.String? + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:text type:kotlin.String? visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .Value declared in .Value.' type=.Value origin=null + value: GET_VAR ': kotlin.String? declared in .Value.' type=kotlin.String? origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] + FIELD PROPERTY_BACKING_FIELD name:additionalText type:IrErrorType visibility:public [final,static] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:additionalText type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:additionalValue visibility:public modality:FINAL [delegated,val] + FIELD PROPERTY_BACKING_FIELD name:additionalValue type:IrErrorType visibility:public [final,static] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:additionalValue visibility:public modality:FINAL [delegated,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:additionalValue type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + CLASS CLASS name:DVal modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DVal + CONSTRUCTOR visibility:public <> (kmember:kotlin.Any) returnType:.DVal [primary] + VALUE_PARAMETER name:kmember index:0 type:kotlin.Any + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DVal modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:kmember visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:kmember type:kotlin.Any visibility:public [final] + EXPRESSION_BODY + GET_VAR 'kmember: kotlin.Any declared in .DVal.' type=kotlin.Any origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.DVal) returnType:kotlin.Any + correspondingProperty: PROPERTY name:kmember visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.DVal + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in .DVal' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:kmember type:kotlin.Any visibility:public [final] ' type=kotlin.Any origin=null + receiver: GET_VAR ': .DVal declared in .DVal.' type=.DVal origin=null + FUN name:getValue visibility:public modality:FINAL <> ($this:.DVal, t:kotlin.Any?, p:kotlin.Any) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.DVal + VALUE_PARAMETER name:t index:0 type:kotlin.Any? + VALUE_PARAMETER name:p index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (t: kotlin.Any?, p: kotlin.Any): kotlin.Int declared in .DVal' + CONST Int type=kotlin.Int value=42 + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:recivier visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:recivier type:kotlin.Any? visibility:public [static] + EXPRESSION_BODY + CONST String type=kotlin.Any? value="fail" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Any? + correspondingProperty: PROPERTY name:recivier visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any? declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:recivier type:kotlin.Any? visibility:public [static] ' type=kotlin.Any? origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Any?) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:recivier visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.Any? + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:recivier type:kotlin.Any? visibility:public [static] ' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.Any? declared in .' type=kotlin.Any? origin=null + PROPERTY name:value2 visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.Any? visibility:public [static] + EXPRESSION_BODY + CONST String type=kotlin.Any? value="fail2" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Any? + correspondingProperty: PROPERTY name:value2 visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any? declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.Any? visibility:public [static] ' type=kotlin.Any? origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Any?) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:value2 visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.Any? + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.Any? visibility:public [static] ' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.Any? declared in .' type=kotlin.Any? origin=null + PROPERTY name:bar visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> () returnType:T of + correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of declared in ' + ERROR_CALL 'Unresolved reference: this#' type=IrErrorType + FUN name: visibility:public modality:FINAL <> (value:T of ) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [var] + VALUE_PARAMETER name:value index:0 type:T of + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:recivier type:kotlin.Any? visibility:public [static] ' type=kotlin.Any? origin=null + value: ERROR_CALL 'Unresolved reference: this#' type=IrErrorType + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.Any? visibility:public [static] ' type=kotlin.Any? origin=null + value: GET_VAR 'value: T of declared in .' type=T of origin=null + PROPERTY name:barRef visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:barRef type:T of visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun (): T of declared in ' type=T of origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:T of + correspondingProperty: PROPERTY name:barRef visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:barRef type:T of visibility:public [final,static] ' type=T of origin=null diff --git a/compiler/testData/ir/irText/expressions/identity.kt b/compiler/testData/ir/irText/expressions/identity.kt index c527823783b..633b59935fe 100644 --- a/compiler/testData/ir/irText/expressions/identity.kt +++ b/compiler/testData/ir/irText/expressions/identity.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL + fun test1(a: Int, b: Int) = a === b fun test2(a: Int, b: Int) = a !== b fun test3(a: Any?, b: Any?) = a === b diff --git a/compiler/testData/ir/irText/expressions/ifElseIf.fir.txt b/compiler/testData/ir/irText/expressions/ifElseIf.fir.txt new file mode 100644 index 00000000000..98820fb9e73 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/ifElseIf.fir.txt @@ -0,0 +1,23 @@ +FILE fqName: fileName:/ifElseIf.kt + FUN name:test visibility:public modality:FINAL <> (i:kotlin.Int) returnType:kotlin.Int + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test (i: kotlin.Int): kotlin.Int declared in ' + WHEN type=kotlin.Int origin=IF + BRANCH + if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT + arg0: GET_VAR 'i: kotlin.Int declared in .test' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=0 + then: CONST Int type=kotlin.Int value=1 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: WHEN type=IrErrorType origin=IF + BRANCH + if: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT + arg0: GET_VAR 'i: kotlin.Int declared in .test' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=0 + then: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST Int type=kotlin.Int value=1 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Int type=kotlin.Int value=0 diff --git a/compiler/testData/ir/irText/expressions/implicitCastInReturnFromConstructor.fir.txt b/compiler/testData/ir/irText/expressions/implicitCastInReturnFromConstructor.fir.txt new file mode 100644 index 00000000000..77f279040fc --- /dev/null +++ b/compiler/testData/ir/irText/expressions/implicitCastInReturnFromConstructor.fir.txt @@ -0,0 +1,30 @@ +FILE fqName: fileName:/implicitCastInReturnFromConstructor.kt + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + CONSTRUCTOR visibility:public <> (x:kotlin.Any?) returnType:.C + VALUE_PARAMETER name:x index:0 type:kotlin.Any? + BLOCK_BODY + WHEN type=kotlin.Any? origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Unit + GET_VAR 'x: kotlin.Any? declared in .C.' type=kotlin.Any? origin=null + then: RETURN type=kotlin.Nothing from='public final fun (x: kotlin.Any?): .C declared in .C' + GET_VAR 'x: kotlin.Any? declared in .C.' type=kotlin.Any? origin=null + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .C' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/implicitCastOnPlatformType.fir.txt b/compiler/testData/ir/irText/expressions/implicitCastOnPlatformType.fir.txt new file mode 100644 index 00000000000..2a5ffc674ab --- /dev/null +++ b/compiler/testData/ir/irText/expressions/implicitCastOnPlatformType.fir.txt @@ -0,0 +1,6 @@ +FILE fqName: fileName:/implicitCastOnPlatformType.kt + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test (): kotlin.String declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="test" diff --git a/compiler/testData/ir/irText/expressions/implicitCastToNonNull.fir.txt b/compiler/testData/ir/irText/expressions/implicitCastToNonNull.fir.txt new file mode 100644 index 00000000000..45163b9ce59 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/implicitCastToNonNull.fir.txt @@ -0,0 +1,68 @@ +FILE fqName: fileName:/implicitCastToNonNull.kt + FUN name:test1 visibility:public modality:FINAL <> (x:kotlin.String?) returnType:kotlin.Int + VALUE_PARAMETER name:x index:0 type:kotlin.String? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (x: kotlin.String?): kotlin.Int declared in ' + WHEN type=kotlin.Int origin=IF + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.String? declared in .test1' type=kotlin.String? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN name:test2 visibility:public modality:FINAL (x:T of .test2) returnType:kotlin.Int + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + VALUE_PARAMETER name:x index:0 type:T of .test2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (x: T of .test2): kotlin.Int declared in ' + WHEN type=kotlin.Int origin=IF + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: T of .test2 declared in .test2' type=T of .test2 origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN name:test3 visibility:public modality:FINAL (x:kotlin.Any) returnType:kotlin.Int [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (x: kotlin.Any): kotlin.Int [inline] declared in ' + WHEN type=kotlin.Int origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=T of .test3 + GET_VAR 'x: kotlin.Any declared in .test3' type=kotlin.Any origin=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN name:test4 visibility:public modality:FINAL (x:kotlin.Any?) returnType:kotlin.Int [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + VALUE_PARAMETER name:x index:0 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (x: kotlin.Any?): kotlin.Int [inline] declared in ' + WHEN type=kotlin.Int origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=T of .test4 + GET_VAR 'x: kotlin.Any? declared in .test4' type=kotlin.Any? origin=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN name:test5 visibility:public modality:FINAL (x:T of .test5, fn:kotlin.Function1) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + TYPE_PARAMETER name:S index:1 variance: superTypes:[] + VALUE_PARAMETER name:x index:0 type:T of .test5 + VALUE_PARAMETER name:fn index:1 type:kotlin.Function1 + BLOCK_BODY + WHEN type=kotlin.Unit origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: GET_VAR 'x: T of .test5 declared in .test5' type=T of .test5 origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'x: T of .test5 declared in .test5' type=T of .test5 origin=null diff --git a/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.txt b/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.txt new file mode 100644 index 00000000000..d18261a8a91 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.txt @@ -0,0 +1,74 @@ +FILE fqName: fileName:/implicitCastToTypeParameter.kt + FUN name:test1 visibility:public modality:FINAL () returnType:T of .test1? [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (): T of .test1? [inline] declared in ' + WHEN type=T of .test1? origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=T of .test1 + ERROR_CALL 'Unresolved reference: this#' type=kotlin.Any + then: ERROR_CALL 'Unresolved reference: this#' type=kotlin.Any + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Null type=kotlin.Nothing? value=null + CLASS INTERFACE name:Foo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:asT visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> () returnType:T of ? + correspondingProperty: PROPERTY name:asT visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of ? declared in ' + WHEN type=T of ? origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=T of + ERROR_CALL 'Unresolved reference: this#' type=IrErrorType + then: ERROR_CALL 'Unresolved reference: this#' type=IrErrorType + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Null type=kotlin.Nothing? value=null + CLASS CLASS name:Bar modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Bar + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> () returnType:.Bar.Bar> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Bar modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:test visibility:public modality:FINAL <> ($this:.Bar, arg:kotlin.Any) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Bar + VALUE_PARAMETER name:arg index:0 type:kotlin.Any + BLOCK_BODY + TYPE_OP type=T of .Bar origin=CAST typeOperand=T of .Bar + GET_VAR 'arg: kotlin.Any declared in .Bar.test' type=kotlin.Any origin=null + CALL 'public final fun useT (t: T of .Bar): kotlin.Unit declared in .Bar' type=kotlin.Unit origin=null + t: GET_VAR 'arg: kotlin.Any declared in .Bar.test' type=kotlin.Any origin=null + FUN name:useT visibility:public modality:FINAL <> ($this:.Bar, t:T of .Bar) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Bar + VALUE_PARAMETER name:t index:0 type:T of .Bar + BLOCK_BODY + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/in.fir.txt b/compiler/testData/ir/irText/expressions/in.fir.txt new file mode 100644 index 00000000000..43e6290d64f --- /dev/null +++ b/compiler/testData/ir/irText/expressions/in.fir.txt @@ -0,0 +1,29 @@ +FILE fqName: fileName:/in.kt + FUN name:test1 visibility:public modality:FINAL <> (a:kotlin.Any, x:kotlin.collections.Collection) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Any + VALUE_PARAMETER name:x index:1 type:kotlin.collections.Collection + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (a: kotlin.Any, x: kotlin.collections.Collection): kotlin.Boolean declared in ' + CALL 'public abstract fun contains (element: E of ): kotlin.Boolean declared in kotlin.collections.Collection' type=kotlin.Boolean origin=null + element: GET_VAR 'a: kotlin.Any declared in .test1' type=kotlin.Any origin=null + FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Any, x:kotlin.collections.Collection) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Any + VALUE_PARAMETER name:x index:1 type:kotlin.collections.Collection + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (a: kotlin.Any, x: kotlin.collections.Collection): kotlin.Boolean declared in ' + CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=null + FUN name:test3 visibility:public modality:FINAL (a:T of .test3, x:kotlin.collections.Collection.test3>) returnType:kotlin.Boolean + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + VALUE_PARAMETER name:a index:0 type:T of .test3 + VALUE_PARAMETER name:x index:1 type:kotlin.collections.Collection.test3> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (a: T of .test3, x: kotlin.collections.Collection.test3>): kotlin.Boolean declared in ' + CALL 'public abstract fun contains (element: E of ): kotlin.Boolean declared in kotlin.collections.Collection' type=kotlin.Boolean origin=null + element: GET_VAR 'a: T of .test3 declared in .test3' type=T of .test3 origin=null + FUN name:test4 visibility:public modality:FINAL (a:T of .test4, x:kotlin.collections.Collection.test4>) returnType:kotlin.Boolean + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + VALUE_PARAMETER name:a index:0 type:T of .test4 + VALUE_PARAMETER name:x index:1 type:kotlin.collections.Collection.test4> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (a: T of .test4, x: kotlin.collections.Collection.test4>): kotlin.Boolean declared in ' + CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=null diff --git a/compiler/testData/ir/irText/expressions/incrementDecrement.fir.txt b/compiler/testData/ir/irText/expressions/incrementDecrement.fir.txt new file mode 100644 index 00000000000..4455c905957 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/incrementDecrement.fir.txt @@ -0,0 +1,144 @@ +FILE fqName: fileName:/incrementDecrement.kt + PROPERTY name:p visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public [static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public [static] ' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public [static] ' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null + PROPERTY name:arr visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:arr type:kotlin.IntArray visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Cannot bind 3 arguments to intArrayOf call with 1 parameters' type=kotlin.IntArray + CONST Int type=kotlin.Int value=1 + CONST Int type=kotlin.Int value=2 + CONST Int type=kotlin.Int value=3 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.IntArray + correspondingProperty: PROPERTY name:arr visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.IntArray declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:arr type:kotlin.IntArray visibility:public [final,static] ' type=kotlin.IntArray origin=null + FUN name:testVarPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:x type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + VAR name:x1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR name: type:kotlin.Int [val] + GET_VAR 'var x: kotlin.Int [var] declared in .testVarPrefix' type=kotlin.Int origin=null + ERROR_CALL 'Unresolved reference: R|/x|' type=IrErrorType + GET_VAR 'var x: kotlin.Int [var] declared in .testVarPrefix' type=kotlin.Int origin=null + VAR name:x2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR name: type:kotlin.Int [val] + GET_VAR 'var x: kotlin.Int [var] declared in .testVarPrefix' type=kotlin.Int origin=null + ERROR_CALL 'Unresolved reference: R|/x|' type=IrErrorType + GET_VAR 'var x: kotlin.Int [var] declared in .testVarPrefix' type=kotlin.Int origin=null + FUN name:testVarPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:x type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + VAR name:x1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR name: type:kotlin.Int [val] + GET_VAR 'var x: kotlin.Int [var] declared in .testVarPostfix' type=kotlin.Int origin=null + ERROR_CALL 'Unresolved reference: R|/x|' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .testVarPostfix' type=kotlin.Int origin=null + VAR name:x2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR name: type:kotlin.Int [val] + GET_VAR 'var x: kotlin.Int [var] declared in .testVarPostfix' type=kotlin.Int origin=null + ERROR_CALL 'Unresolved reference: R|/x|' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .testVarPostfix' type=kotlin.Int origin=null + FUN name:testPropPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:p1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR name: type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public [static] ' type=kotlin.Int origin=null + value: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .testPropPrefix' type=kotlin.Int origin=null + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null + VAR name:p2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR name: type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public [static] ' type=kotlin.Int origin=null + value: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .testPropPrefix' type=kotlin.Int origin=null + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null + FUN name:testPropPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:p1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR name: type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public [static] ' type=kotlin.Int origin=null + value: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .testPropPostfix' type=kotlin.Int origin=null + GET_VAR 'val : kotlin.Int [val] declared in .testPropPostfix' type=kotlin.Int origin=null + VAR name:p2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR name: type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public [static] ' type=kotlin.Int origin=null + value: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .testPropPostfix' type=kotlin.Int origin=null + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null + FUN name:testArrayPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:a1 type:IrErrorType [val] + BLOCK type=IrErrorType origin=null + VAR name: type:kotlin.Int [val] + CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=null + index: CONST Int type=kotlin.Int value=0 + VAR name: type:IrErrorType [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null + CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=null + index: CONST Int type=kotlin.Int value=0 + value: GET_VAR 'val : IrErrorType [val] declared in .testArrayPrefix' type=IrErrorType origin=null + GET_VAR 'val : IrErrorType [val] declared in .testArrayPrefix' type=IrErrorType origin=null + VAR name:a2 type:IrErrorType [val] + BLOCK type=IrErrorType origin=null + VAR name: type:kotlin.Int [val] + CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=null + index: CONST Int type=kotlin.Int value=0 + VAR name: type:IrErrorType [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null + CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=null + index: CONST Int type=kotlin.Int value=0 + value: GET_VAR 'val : IrErrorType [val] declared in .testArrayPrefix' type=IrErrorType origin=null + GET_VAR 'val : IrErrorType [val] declared in .testArrayPrefix' type=IrErrorType origin=null + FUN name:testArrayPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:a1 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR name: type:kotlin.Int [val] + CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=null + index: CONST Int type=kotlin.Int value=0 + CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=null + index: CONST Int type=kotlin.Int value=0 + value: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null + GET_VAR 'val : kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null + VAR name:a2 type:kotlin.Int [val] + BLOCK type=kotlin.Int origin=null + VAR name: type:kotlin.Int [val] + CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=null + index: CONST Int type=kotlin.Int value=0 + CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=null + index: CONST Int type=kotlin.Int value=0 + value: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null + GET_VAR 'val : kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/interfaceThisRef.fir.txt b/compiler/testData/ir/irText/expressions/interfaceThisRef.fir.txt new file mode 100644 index 00000000000..4f7bff7a073 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/interfaceThisRef.fir.txt @@ -0,0 +1,22 @@ +FILE fqName: fileName:/interfaceThisRef.kt + CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IFoo + FUN name:bar visibility:public modality:OPEN <> ($this:.IFoo) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IFoo + BLOCK_BODY + CALL 'public abstract fun foo (): kotlin.Unit declared in .IFoo' type=kotlin.Unit origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/javaSyntheticPropertyAccess.fir.txt b/compiler/testData/ir/irText/expressions/javaSyntheticPropertyAccess.fir.txt new file mode 100644 index 00000000000..cf7ca3fd1e9 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/javaSyntheticPropertyAccess.fir.txt @@ -0,0 +1,11 @@ +FILE fqName: fileName:/javaSyntheticPropertyAccess.kt + FUN name:test visibility:public modality:FINAL <> (j:.J) returnType:kotlin.Unit + VALUE_PARAMETER name:j index:0 type:.J + BLOCK_BODY + ERROR_CALL 'No getter found for R|/J.foo|' type=kotlin.Int + ERROR_CALL 'Unresolved reference: R|/J.foo|' type=IrErrorType + VAR name: type:kotlin.Int [val] + ERROR_CALL 'No getter found for R|/J.foo|' type=kotlin.Int + ERROR_CALL 'Unresolved reference: R|/J.foo|' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .test' type=kotlin.Int origin=null + ERROR_CALL 'Unresolved reference: R|/J.foo|' type=IrErrorType diff --git a/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.fir.txt b/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.fir.txt new file mode 100644 index 00000000000..5601d576409 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.fir.txt @@ -0,0 +1,62 @@ +FILE fqName: fileName:/Derived.kt + CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived + CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] + BLOCK_BODY + ERROR_CALL 'Cannot find delegated constructor call' type=.Derived + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.Base]' + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + ERROR_CALL 'Unresolved reference: R|/Base.value|' type=IrErrorType + FUN name:getValue visibility:public modality:FINAL <> ($this:.Derived) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.Derived + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (): kotlin.Int declared in .Derived' + ERROR_CALL 'No getter found for R|/Base.value|' type=kotlin.Int + FUN name:setValue visibility:public modality:FINAL <> ($this:.Derived, value:kotlin.Int) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Derived + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY + ERROR_CALL 'Unresolved reference: R|/Base.value|' type=IrErrorType + FUN FAKE_OVERRIDE name:registerNatives visibility:private modality:OPEN <> ($this:.Object) returnType:kotlin.Unit + overridden: + private open fun registerNatives (): kotlin.Unit declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:getClass visibility:public modality:FINAL <> ($this:.Object) returnType:java.lang.Class<*>? + overridden: + public final fun getClass (): java.lang.Class<*>? declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:.Object) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:.Object, obj:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (obj: kotlin.Any?): kotlin.Boolean declared in .Object + $this: VALUE_PARAMETER name: type:.Object + VALUE_PARAMETER name:obj index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:clone visibility:protected/*protected and package*/ modality:OPEN <> ($this:.Object) returnType:kotlin.Any? + overridden: + protected/*protected and package*/ open fun clone (): kotlin.Any? declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:.Object) returnType:kotlin.String? + overridden: + public open fun toString (): kotlin.String? declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:notify visibility:public modality:FINAL <> ($this:.Object) returnType:kotlin.Unit + overridden: + public final fun notify (): kotlin.Unit declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:notifyAll visibility:public modality:FINAL <> ($this:.Object) returnType:kotlin.Unit + overridden: + public final fun notifyAll (): kotlin.Unit declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:wait visibility:public modality:FINAL <> ($this:.Object, :kotlin.Long) returnType:kotlin.Unit + overridden: + public final fun wait (: kotlin.Long): kotlin.Unit declared in .Object + $this: VALUE_PARAMETER name: type:.Object + VALUE_PARAMETER name: index:0 type:kotlin.Long + FUN FAKE_OVERRIDE name:finalize visibility:protected/*protected and package*/ modality:OPEN <> ($this:.Object) returnType:kotlin.Unit + overridden: + protected/*protected and package*/ open fun finalize (): kotlin.Unit declared in .Object + $this: VALUE_PARAMETER name: type:.Object diff --git a/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.fir.txt b/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.fir.txt new file mode 100644 index 00000000000..9d8f6b5a6d6 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.fir.txt @@ -0,0 +1,59 @@ +FILE fqName: fileName:/jvmStaticFieldReference.kt + FUN name:testFun visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="testFun" + PROPERTY name:testProp visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Any + correspondingProperty: PROPERTY name:testProp visibility:public modality:FINAL [var] + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="testProp/get" + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in ' + CONST Int type=kotlin.Any value=42 + FUN name: visibility:public modality:FINAL <> (value:kotlin.Any) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:testProp visibility:public modality:FINAL [var] + VALUE_PARAMETER name:value index:0 type:kotlin.Any + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="testProp/set" + CLASS CLASS name:TestClass modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestClass + CONSTRUCTOR visibility:public <> () returnType:.TestClass [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestClass modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:test visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + WHEN type=kotlin.Int origin=WHEN + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: BLOCK type=kotlin.Int origin=null + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="TestClass/test" + CONST Int type=kotlin.Int value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestClass) returnType:kotlin.Int + correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestClass + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestClass' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .TestClass declared in .TestClass.' type=.TestClass origin=null + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="TestClass/init" + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/kt16904.fir.txt b/compiler/testData/ir/irText/expressions/kt16904.fir.txt new file mode 100644 index 00000000000..cefd62804a2 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt16904.fir.txt @@ -0,0 +1,147 @@ +FILE fqName: fileName:/kt16904.kt + CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:.B visibility:public [final] + EXPRESSION_BODY + CALL 'public constructor () [primary] declared in .B' type=.B origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:.B + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .B declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:.B visibility:public [final] ' type=.B origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + PROPERTY name:y visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + value: GET_VAR ': kotlin.Int declared in .A.' type=kotlin.Int origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + CONSTRUCTOR visibility:public <> () returnType:.B [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:plusAssign visibility:public modality:FINAL <> ($this:.B, x:kotlin.Int) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.A] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 + CONSTRUCTOR visibility:public <> () returnType:.Test1 + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:.B visibility:public [final] ' type=.B origin=null + value: CONST Int type=kotlin.Int value=42 + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=42 + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.A]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.J] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 + CONSTRUCTOR visibility:public <> () returnType:.Test2 [primary] + BLOCK_BODY + ERROR_CALL 'Cannot find delegated constructor call' type=.Test2 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.J]' + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + ERROR_CALL 'Unresolved reference: R|/J.field|' type=IrErrorType + FUN FAKE_OVERRIDE name:registerNatives visibility:private modality:OPEN <> ($this:.Object) returnType:kotlin.Unit + overridden: + private open fun registerNatives (): kotlin.Unit declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:getClass visibility:public modality:FINAL <> ($this:.Object) returnType:java.lang.Class<*>? + overridden: + public final fun getClass (): java.lang.Class<*>? declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:.Object) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:.Object, obj:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (obj: kotlin.Any?): kotlin.Boolean declared in .Object + $this: VALUE_PARAMETER name: type:.Object + VALUE_PARAMETER name:obj index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:clone visibility:protected/*protected and package*/ modality:OPEN <> ($this:.Object) returnType:kotlin.Any? + overridden: + protected/*protected and package*/ open fun clone (): kotlin.Any? declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:.Object) returnType:kotlin.String? + overridden: + public open fun toString (): kotlin.String? declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:notify visibility:public modality:FINAL <> ($this:.Object) returnType:kotlin.Unit + overridden: + public final fun notify (): kotlin.Unit declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:notifyAll visibility:public modality:FINAL <> ($this:.Object) returnType:kotlin.Unit + overridden: + public final fun notifyAll (): kotlin.Unit declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:wait visibility:public modality:FINAL <> ($this:.Object, :kotlin.Long) returnType:kotlin.Unit + overridden: + public final fun wait (: kotlin.Long): kotlin.Unit declared in .Object + $this: VALUE_PARAMETER name: type:.Object + VALUE_PARAMETER name: index:0 type:kotlin.Long + FUN FAKE_OVERRIDE name:finalize visibility:protected/*protected and package*/ modality:OPEN <> ($this:.Object) returnType:kotlin.Unit + overridden: + protected/*protected and package*/ open fun finalize (): kotlin.Unit declared in .Object + $this: VALUE_PARAMETER name: type:.Object diff --git a/compiler/testData/ir/irText/expressions/kt16905.fir.txt b/compiler/testData/ir/irText/expressions/kt16905.fir.txt new file mode 100644 index 00000000000..f84d6667490 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt16905.fir.txt @@ -0,0 +1,81 @@ +FILE fqName: fileName:/kt16905.kt + CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer + CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' + CLASS CLASS name:Inner modality:OPEN visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner + CONSTRUCTOR visibility:public <> () returnType:.Outer.Inner [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:OPEN visibility:public [inner] superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:InnerDerived0 modality:FINAL visibility:public [inner] superTypes:[.Outer.Inner] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.InnerDerived0 + CONSTRUCTOR visibility:public <> () returnType:.Outer.InnerDerived0 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Outer.Inner' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:InnerDerived0 modality:FINAL visibility:public [inner] superTypes:[.Outer.Inner]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:InnerDerived1 modality:FINAL visibility:public [inner] superTypes:[.Outer.Inner] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.InnerDerived1 + CONSTRUCTOR visibility:public <> () returnType:.Outer.InnerDerived1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Outer.Inner' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:InnerDerived1 modality:FINAL visibility:public [inner] superTypes:[.Outer.Inner]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test (): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType diff --git a/compiler/testData/ir/irText/expressions/kt23030.fir.txt b/compiler/testData/ir/irText/expressions/kt23030.fir.txt new file mode 100644 index 00000000000..8026afccf4d --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt23030.fir.txt @@ -0,0 +1,107 @@ +FILE fqName: fileName:/kt23030.kt + FUN name:compareTo visibility:public modality:FINAL <> (c:kotlin.Char) returnType:kotlin.Int + VALUE_PARAMETER name:c index:0 type:kotlin.Char + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun compareTo (c: kotlin.Char): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=0 + FUN name:testOverloadedCompareToCall visibility:public modality:FINAL <> (x:kotlin.Int, y:kotlin.Char) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Char + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testOverloadedCompareToCall (x: kotlin.Int, y: kotlin.Char): kotlin.Boolean declared in ' + ERROR_CALL 'Comparison of arguments with different types: kotlin/Int, kotlin/Char' type=kotlin.Boolean + FUN name:testOverloadedCompareToCallWithSmartCast visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testOverloadedCompareToCallWithSmartCast (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int + GET_VAR 'x: kotlin.Any declared in .testOverloadedCompareToCallWithSmartCast' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Char + GET_VAR 'y: kotlin.Any declared in .testOverloadedCompareToCallWithSmartCast' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: ERROR_CALL 'Comparison of arguments with unsupported type: kotlin/Any' type=kotlin.Boolean + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN name:testEqualsWithSmartCast visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testEqualsWithSmartCast (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int + GET_VAR 'x: kotlin.Any declared in .testEqualsWithSmartCast' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Char + GET_VAR 'y: kotlin.Any declared in .testEqualsWithSmartCast' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Any declared in .testEqualsWithSmartCast' type=kotlin.Any origin=null + arg1: GET_VAR 'y: kotlin.Any declared in .testEqualsWithSmartCast' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:compareTo visibility:public modality:FINAL <> ($this:.C, c:kotlin.Char) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:c index:0 type:kotlin.Char + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun compareTo (c: kotlin.Char): kotlin.Int declared in .C' + CONST Int type=kotlin.Int value=0 + FUN name:testMemberExtensionCompareToCall visibility:public modality:FINAL <> ($this:.C, x:kotlin.Int, y:kotlin.Char) returnType:kotlin.Boolean + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Char + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testMemberExtensionCompareToCall (x: kotlin.Int, y: kotlin.Char): kotlin.Boolean declared in .C' + ERROR_CALL 'Comparison of arguments with different types: kotlin/Int, kotlin/Char' type=kotlin.Boolean + FUN name:testMemberExtensionCompareToCallWithSmartCast visibility:public modality:FINAL <> ($this:.C, x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Boolean + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:x index:0 type:kotlin.Any + VALUE_PARAMETER name:y index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testMemberExtensionCompareToCallWithSmartCast (x: kotlin.Any, y: kotlin.Any): kotlin.Boolean declared in .C' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int + GET_VAR 'x: kotlin.Any declared in .C.testMemberExtensionCompareToCallWithSmartCast' type=kotlin.Any origin=null + then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Char + GET_VAR 'y: kotlin.Any declared in .C.testMemberExtensionCompareToCallWithSmartCast' type=kotlin.Any origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: ERROR_CALL 'Comparison of arguments with unsupported type: kotlin/Any' type=kotlin.Boolean + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/kt24804.fir.txt b/compiler/testData/ir/irText/expressions/kt24804.fir.txt new file mode 100644 index 00000000000..f4681b226f2 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt24804.fir.txt @@ -0,0 +1,36 @@ +FILE fqName: fileName:/kt24804.kt + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Boolean [inline] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Boolean [inline] declared in ' + CONST Boolean type=kotlin.Boolean value=false + FUN name:run visibility:public modality:FINAL <> (x:kotlin.Boolean, y:kotlin.Boolean) returnType:kotlin.String + VALUE_PARAMETER name:x index:0 type:kotlin.Boolean + VALUE_PARAMETER name:y index:1 type:kotlin.Boolean + BLOCK_BODY + VAR name:z type:kotlin.Int [var] + CONST Int type=kotlin.Int value=10 + DO_WHILE label=l2 origin=DO_WHILE_LOOP + body: BLOCK type=kotlin.String origin=null + ERROR_CALL 'Unresolved reference: R|/z|' type=IrErrorType + WHEN type=kotlin.String origin=IF + BRANCH + if: ERROR_CALL 'Comparison of arguments with different types: kotlin/Int, kotlin/String' type=kotlin.Boolean + then: RETURN type=kotlin.Nothing from='public final fun run (x: kotlin.Boolean, y: kotlin.Boolean): kotlin.String declared in ' + CONST String type=kotlin.String value="NOT_OK" + WHEN type=kotlin.String origin=IF + BRANCH + if: GET_VAR 'x: kotlin.Boolean declared in .run' type=kotlin.Boolean origin=null + then: ERROR_EXPR 'Unbound loop: continue@@@[ERROR_EXPR(Cannot bind label l1 to a loop)] ' type=kotlin.Nothing + WHEN type=kotlin.String origin=IF + BRANCH + if: GET_VAR 'y: kotlin.Boolean declared in .run' type=kotlin.Boolean origin=null + then: CONTINUE label=l2 loop.label=l2 + condition: CALL 'public final fun foo (): kotlin.Boolean [inline] declared in ' type=kotlin.Boolean origin=null + RETURN type=kotlin.Nothing from='public final fun run (x: kotlin.Boolean, y: kotlin.Boolean): kotlin.String declared in ' + CONST String type=kotlin.String value="OK" + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CALL 'public final fun run (x: kotlin.Boolean, y: kotlin.Boolean): kotlin.String declared in ' type=kotlin.String origin=null + x: CONST Boolean type=kotlin.Boolean value=true + y: CONST Boolean type=kotlin.Boolean value=true diff --git a/compiler/testData/ir/irText/expressions/kt27933.fir.txt b/compiler/testData/ir/irText/expressions/kt27933.fir.txt new file mode 100644 index 00000000000..8f3fe7cf9dd --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt27933.fir.txt @@ -0,0 +1,25 @@ +FILE fqName: fileName:/kt27933.kt + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + VAR name:r type:kotlin.String [var] + CONST String type=kotlin.String value="" + WHEN type=kotlin.String origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: GET_VAR 'var r: kotlin.String [var] declared in .box' type=kotlin.String origin=null + arg1: CONST String type=kotlin.String value="" + then: BLOCK type=kotlin.Unit origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: BLOCK type=kotlin.Unit origin=null + ERROR_CALL 'Unresolved reference: R|/r|' type=IrErrorType + WHEN type=kotlin.String origin=IF + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'var r: kotlin.String [var] declared in .box' type=kotlin.String origin=null + arg1: CONST String type=kotlin.String value="O" + then: BLOCK type=kotlin.Unit origin=null + ERROR_CALL 'Unresolved reference: R|/r|' type=IrErrorType + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + GET_VAR 'var r: kotlin.String [var] declared in .box' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/expressions/kt28006.fir.txt b/compiler/testData/ir/irText/expressions/kt28006.fir.txt new file mode 100644 index 00000000000..1045b22722c --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt28006.fir.txt @@ -0,0 +1,75 @@ +FILE fqName: fileName:/kt28006.kt + PROPERTY name:test1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CONST String type=kotlin.String value="\uD83E\uDD17" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + PROPERTY name:test2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CONST String type=kotlin.String value="\uD83E\uDD17\uD83E\uDD17" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + PROPERTY name:testConst1 visibility:public modality:FINAL [const,val] + FIELD PROPERTY_BACKING_FIELD name:testConst1 type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CONST String type=kotlin.String value="\uD83E\uDD17" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:testConst1 visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testConst1 type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + PROPERTY name:testConst2 visibility:public modality:FINAL [const,val] + FIELD PROPERTY_BACKING_FIELD name:testConst2 type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CONST String type=kotlin.String value="\uD83E\uDD17\uD83E\uDD17" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:testConst2 visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testConst2 type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + PROPERTY name:testConst3 visibility:public modality:FINAL [const,val] + FIELD PROPERTY_BACKING_FIELD name:testConst3 type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + other: CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:testConst3 visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testConst3 type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + PROPERTY name:testConst4 visibility:public modality:FINAL [const,val] + FIELD PROPERTY_BACKING_FIELD name:testConst4 type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + other: CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:testConst4 visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testConst4 type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + FUN name:test1 visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.String + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (x: kotlin.Int): kotlin.String declared in ' + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + other: GET_VAR 'x: kotlin.Int declared in .test1' type=kotlin.Int origin=null + FUN name:test2 visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.String + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (x: kotlin.Int): kotlin.String declared in ' + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin' type=kotlin.String origin=null + other: CONST String type=kotlin.String value="\uDD17" + FUN name:test3 visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.String + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (x: kotlin.Int): kotlin.String declared in ' + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + other: GET_VAR 'x: kotlin.Int declared in .test3' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/kt28456.fir.txt b/compiler/testData/ir/irText/expressions/kt28456.fir.txt new file mode 100644 index 00000000000..c9c7d9bed6d --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt28456.fir.txt @@ -0,0 +1,56 @@ +FILE fqName: fileName:/kt28456.kt + CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:get visibility:public modality:FINAL <> (xs:kotlin.Int) returnType:kotlin.Int + VALUE_PARAMETER name:xs index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun get (xs: kotlin.Int): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=0 + FUN name:set visibility:public modality:FINAL <> (i:kotlin.Int, j:kotlin.Int, v:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:j index:1 type:kotlin.Int + VALUE_PARAMETER name:v index:2 type:kotlin.Int + BLOCK_BODY + FUN name:testSimpleAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:.A + BLOCK_BODY + CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null + i: CONST Int type=kotlin.Int value=1 + j: CONST Int type=kotlin.Int value=2 + v: CONST Int type=kotlin.Int value=0 + FUN name:testPostfixIncrement visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Int + VALUE_PARAMETER name:a index:0 type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testPostfixIncrement (a: .A): kotlin.Int declared in ' + BLOCK type=kotlin.Int origin=null + VAR name: type:kotlin.Int [val] + ERROR_CALL 'Cannot bind 2 arguments to get call with 1 parameters' type=kotlin.Int + CONST Int type=kotlin.Int value=1 + CONST Int type=kotlin.Int value=2 + CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null + i: CONST Int type=kotlin.Int value=1 + j: CONST Int type=kotlin.Int value=2 + v: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .testPostfixIncrement' type=kotlin.Int origin=null + GET_VAR 'val : kotlin.Int [val] declared in .testPostfixIncrement' type=kotlin.Int origin=null + FUN name:testCompoundAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:.A + BLOCK_BODY + ERROR_CALL 'FirArraySetCall (resolve isn't supported yet)' type=kotlin.Unit diff --git a/compiler/testData/ir/irText/expressions/kt28456a.fir.txt b/compiler/testData/ir/irText/expressions/kt28456a.fir.txt new file mode 100644 index 00000000000..82d5b52f355 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt28456a.fir.txt @@ -0,0 +1,32 @@ +FILE fqName: fileName:/kt28456a.kt + CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:set visibility:public modality:FINAL <> (i:kotlin.Int, v:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:v index:1 type:kotlin.Int + BLOCK_BODY + FUN name:testSimpleAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:.A + BLOCK_BODY + ERROR_CALL 'Cannot bind 4 arguments to set call with 2 parameters' type=kotlin.Unit + CONST Int type=kotlin.Int value=1 + CONST Int type=kotlin.Int value=2 + CONST Int type=kotlin.Int value=3 + CONST Int type=kotlin.Int value=0 diff --git a/compiler/testData/ir/irText/expressions/kt28456b.fir.txt b/compiler/testData/ir/irText/expressions/kt28456b.fir.txt new file mode 100644 index 00000000000..693c7e1af22 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt28456b.fir.txt @@ -0,0 +1,67 @@ +FILE fqName: fileName:/kt28456b.kt + CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:get visibility:public modality:FINAL <> (i:kotlin.Int, a:kotlin.Int, b:kotlin.Int, c:kotlin.Int, d:kotlin.Int) returnType:kotlin.Int + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:a index:1 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + VALUE_PARAMETER name:b index:2 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=2 + VALUE_PARAMETER name:c index:3 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=3 + VALUE_PARAMETER name:d index:4 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=4 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun get (i: kotlin.Int, a: kotlin.Int, b: kotlin.Int, c: kotlin.Int, d: kotlin.Int): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=0 + FUN name:set visibility:public modality:FINAL <> (i:kotlin.Int, j:kotlin.Int, v:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER name:i index:0 type:kotlin.Int + VALUE_PARAMETER name:j index:1 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=42 + VALUE_PARAMETER name:v index:2 type:kotlin.Int + BLOCK_BODY + FUN name:testSimpleAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:.A + BLOCK_BODY + CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null + i: CONST Int type=kotlin.Int value=1 + j: CONST Int type=kotlin.Int value=0 + FUN name:testPostfixIncrement visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Int + VALUE_PARAMETER name:a index:0 type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testPostfixIncrement (a: .A): kotlin.Int declared in ' + BLOCK type=kotlin.Int origin=null + VAR name: type:kotlin.Int [val] + CALL 'public final fun get (i: kotlin.Int, a: kotlin.Int, b: kotlin.Int, c: kotlin.Int, d: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null + i: CONST Int type=kotlin.Int value=1 + CALL 'public final fun set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null + i: CONST Int type=kotlin.Int value=1 + j: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .testPostfixIncrement' type=kotlin.Int origin=null + GET_VAR 'val : kotlin.Int [val] declared in .testPostfixIncrement' type=kotlin.Int origin=null + FUN name:testCompoundAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:.A + BLOCK_BODY + ERROR_CALL 'FirArraySetCall (resolve isn't supported yet)' type=kotlin.Unit diff --git a/compiler/testData/ir/irText/expressions/kt30020.fir.txt b/compiler/testData/ir/irText/expressions/kt30020.fir.txt new file mode 100644 index 00000000000..8ba4c80395b --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt30020.fir.txt @@ -0,0 +1,245 @@ +FILE fqName: fileName:/kt30020.kt + CLASS INTERFACE name:X modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.X + PROPERTY name:xs visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.X) returnType:kotlin.collections.MutableList + correspondingProperty: PROPERTY name:xs visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.X + FUN name:f visibility:public modality:ABSTRACT <> ($this:.X) returnType:kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:.X + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> (x:.X, nx:.X?) returnType:kotlin.Unit + VALUE_PARAMETER name:x index:0 type:.X + VALUE_PARAMETER name:nx index:1 type:.X? + BLOCK_BODY + ERROR_CALL 'Unresolved reference: R|/X.xs|' type=IrErrorType + VAR name: type:kotlin.collections.MutableList [val] + CALL 'public abstract fun f (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=null + ERROR_CALL 'Unresolved reference: R|/|' type=IrErrorType + VAR name: type:kotlin.collections.MutableList [val] + TYPE_OP type=kotlin.collections.MutableList origin=CAST typeOperand=kotlin.collections.MutableList + CALL 'public abstract fun (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=null + ERROR_CALL 'Unresolved reference: R|/|' type=IrErrorType + VAR name: type:kotlin.collections.MutableList [val] + TYPE_OP type=kotlin.collections.MutableList origin=CAST typeOperand=kotlin.collections.MutableList + CALL 'public abstract fun f (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=null + ERROR_CALL 'Unresolved reference: R|/|' type=IrErrorType + VAR name: type:IrErrorType [val] + BLOCK type=IrErrorType origin=EXCLEXCL + VAR name: type:kotlin.collections.MutableList [val] + CALL 'public abstract fun (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=null + WHEN type=IrErrorType origin=EXCLEXCL + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val : kotlin.collections.MutableList [val] declared in .test' type=kotlin.collections.MutableList origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: THROW type=kotlin.Nothing + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val : kotlin.collections.MutableList [val] declared in .test' type=kotlin.collections.MutableList origin=null + ERROR_CALL 'Unresolved reference: R|/|' type=IrErrorType + VAR name: type:IrErrorType [val] + BLOCK type=IrErrorType origin=EXCLEXCL + VAR name: type:kotlin.collections.MutableList [val] + CALL 'public abstract fun f (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=null + WHEN type=IrErrorType origin=EXCLEXCL + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val : kotlin.collections.MutableList [val] declared in .test' type=kotlin.collections.MutableList origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: THROW type=kotlin.Nothing + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val : kotlin.collections.MutableList [val] declared in .test' type=kotlin.collections.MutableList origin=null + ERROR_CALL 'Unresolved reference: R|/|' type=IrErrorType + FUN name:testExtensionReceiver visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + ERROR_CALL 'Unresolved reference: this#' type=IrErrorType + CLASS CLASS name:AML modality:ABSTRACT visibility:public superTypes:[kotlin.collections.MutableList] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AML + CONSTRUCTOR visibility:public <> () returnType:.AML [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:AML modality:ABSTRACT visibility:public superTypes:[kotlin.collections.MutableList]' + FUN name:testExplicitThis visibility:public modality:FINAL <> ($this:.AML) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.AML + BLOCK_BODY + ERROR_CALL 'Unresolved reference: this#' type=IrErrorType + CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AML.Inner + CONSTRUCTOR visibility:public <> () returnType:.AML.Inner [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' + FUN name:testOuterThis visibility:public modality:FINAL <> ($this:.AML.Inner) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.AML.Inner + BLOCK_BODY + ERROR_CALL 'Unresolved reference: this@AML' type=IrErrorType + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:add visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, element:E of ) returnType:kotlin.Boolean + overridden: + public abstract fun add (element: E of ): kotlin.Boolean declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList + VALUE_PARAMETER name:element index:0 type:E of + FUN FAKE_OVERRIDE name:addAll visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, index:kotlin.Int, elements:kotlin.collections.Collection>) returnType:kotlin.Boolean + overridden: + public abstract fun addAll (index: kotlin.Int, elements: kotlin.collections.Collection>): kotlin.Boolean declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:elements index:1 type:kotlin.collections.Collection> + FUN FAKE_OVERRIDE name:clear visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList) returnType:kotlin.Unit + overridden: + public abstract fun clear (): kotlin.Unit declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList + FUN FAKE_OVERRIDE name:listIterator visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList) returnType:kotlin.collections.MutableListIterator> + overridden: + public abstract fun listIterator (): kotlin.collections.MutableListIterator> declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList + FUN FAKE_OVERRIDE name:remove visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, element:E of ) returnType:kotlin.Boolean + overridden: + public abstract fun remove (element: E of ): kotlin.Boolean declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList + VALUE_PARAMETER name:element index:0 type:E of + FUN FAKE_OVERRIDE name:removeAll visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, elements:kotlin.collections.Collection>) returnType:kotlin.Boolean + overridden: + public abstract fun removeAll (elements: kotlin.collections.Collection>): kotlin.Boolean declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection> + FUN FAKE_OVERRIDE name:removeAt visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, index:kotlin.Int) returnType:E of + overridden: + public abstract fun removeAt (index: kotlin.Int): E of declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList + VALUE_PARAMETER name:index index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:retainAll visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, elements:kotlin.collections.Collection>) returnType:kotlin.Boolean + overridden: + public abstract fun retainAll (elements: kotlin.collections.Collection>): kotlin.Boolean declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection> + FUN FAKE_OVERRIDE name:set visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, index:kotlin.Int, element:E of ) returnType:E of + overridden: + public abstract fun set (index: kotlin.Int, element: E of ): E of declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:element index:1 type:E of + FUN FAKE_OVERRIDE name:subList visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableList, fromIndex:kotlin.Int, toIndex:kotlin.Int) returnType:kotlin.collections.MutableList> + overridden: + public abstract fun subList (fromIndex: kotlin.Int, toIndex: kotlin.Int): kotlin.collections.MutableList> declared in kotlin.collections.MutableList + $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList + VALUE_PARAMETER name:fromIndex index:0 type:kotlin.Int + VALUE_PARAMETER name:toIndex index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:contains visibility:public modality:ABSTRACT <> ($this:.List, element:E of ) returnType:kotlin.Boolean + overridden: + public abstract fun contains (element: E of ): kotlin.Boolean declared in .List + $this: VALUE_PARAMETER name: type:.List + VALUE_PARAMETER name:element index:0 type:E of + FUN FAKE_OVERRIDE name:contains visibility:public modality:ABSTRACT <> ($this:kotlin.collections.Collection, element:E of ) returnType:kotlin.Boolean + overridden: + public abstract fun contains (element: E of ): kotlin.Boolean declared in kotlin.collections.Collection + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection + VALUE_PARAMETER name:element index:0 type:E of + FUN FAKE_OVERRIDE name:containsAll visibility:public modality:ABSTRACT <> ($this:.List, elements:kotlin.collections.Collection>) returnType:kotlin.Boolean + overridden: + public abstract fun containsAll (elements: kotlin.collections.Collection>): kotlin.Boolean declared in .List + $this: VALUE_PARAMETER name: type:.List + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection> + FUN FAKE_OVERRIDE name:containsAll visibility:public modality:ABSTRACT <> ($this:kotlin.collections.Collection, elements:kotlin.collections.Collection>) returnType:kotlin.Boolean + overridden: + public abstract fun containsAll (elements: kotlin.collections.Collection>): kotlin.Boolean declared in kotlin.collections.Collection + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection + VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection> + FUN FAKE_OVERRIDE name:get visibility:public modality:ABSTRACT <> ($this:.List, index:kotlin.Int) returnType:E of + overridden: + public abstract fun get (index: kotlin.Int): E of declared in .List + $this: VALUE_PARAMETER name: type:.List + VALUE_PARAMETER name:index index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:indexOf visibility:public modality:ABSTRACT <> ($this:.List, element:E of ) returnType:kotlin.Int + overridden: + public abstract fun indexOf (element: E of ): kotlin.Int declared in .List + $this: VALUE_PARAMETER name: type:.List + VALUE_PARAMETER name:element index:0 type:E of + FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:ABSTRACT <> ($this:.List) returnType:kotlin.Boolean + overridden: + public abstract fun isEmpty (): kotlin.Boolean declared in .List + $this: VALUE_PARAMETER name: type:.List + FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:ABSTRACT <> ($this:kotlin.collections.Collection) returnType:kotlin.Boolean + overridden: + public abstract fun isEmpty (): kotlin.Boolean declared in kotlin.collections.Collection + $this: VALUE_PARAMETER name: type:kotlin.collections.Collection + FUN FAKE_OVERRIDE name:iterator visibility:public modality:ABSTRACT <> ($this:.List) returnType:kotlin.collections.Iterator> + overridden: + public abstract fun iterator (): kotlin.collections.Iterator> declared in .List + $this: VALUE_PARAMETER name: type:.List + FUN FAKE_OVERRIDE name:iterator visibility:public modality:ABSTRACT <> ($this:.MutableCollection) returnType:kotlin.collections.MutableIterator> + overridden: + public abstract fun iterator (): kotlin.collections.MutableIterator> declared in .MutableCollection + $this: VALUE_PARAMETER name: type:.MutableCollection + FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:ABSTRACT <> ($this:.List, element:E of ) returnType:kotlin.Int + overridden: + public abstract fun lastIndexOf (element: E of ): kotlin.Int declared in .List + $this: VALUE_PARAMETER name: type:.List + VALUE_PARAMETER name:element index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.txt b/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.txt new file mode 100644 index 00000000000..e0fb7ab27cf --- /dev/null +++ b/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.txt @@ -0,0 +1,42 @@ +FILE fqName: fileName:/lambdaInCAO.kt + FUN name:plusAssign visibility:public modality:FINAL <> (lambda:kotlin.Function0) returnType:kotlin.Unit + VALUE_PARAMETER name:lambda index:0 type:kotlin.Function0 + BLOCK_BODY + FUN name:get visibility:public modality:FINAL <> (index:kotlin.Function0) returnType:kotlin.Int + VALUE_PARAMETER name:index index:0 type:kotlin.Function0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun get (index: kotlin.Function0): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=42 + FUN name:set visibility:public modality:FINAL <> (index:kotlin.Function0, value:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER name:index index:0 type:kotlin.Function0 + VALUE_PARAMETER name:value index:1 type:kotlin.Int + BLOCK_BODY + FUN name:test1 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Any + BLOCK_BODY + ERROR_CALL 'Unresolved reference: R|/a|' type=IrErrorType + FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Any + BLOCK_BODY + ERROR_CALL 'FirArraySetCall (resolve isn't supported yet)' type=kotlin.Unit + FUN name:test3 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Any + BLOCK_BODY + VAR name: type:kotlin.Int [val] + CALL 'public final fun get (index: kotlin.Function0): kotlin.Int declared in ' type=kotlin.Int origin=null + index: BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .test3' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .test3' type=IrErrorType origin=LAMBDA + CALL 'public final fun set (index: kotlin.Function0, value: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null + index: BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .test3' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .test3' type=IrErrorType origin=LAMBDA + value: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .test3' type=kotlin.Int origin=null + GET_VAR 'val : kotlin.Int [val] declared in .test3' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/literals.fir.txt b/compiler/testData/ir/irText/expressions/literals.fir.txt new file mode 100644 index 00000000000..c2bb4e21455 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/literals.fir.txt @@ -0,0 +1,158 @@ +FILE fqName: fileName:/literals.kt + PROPERTY name:test1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + PROPERTY name:test2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test2 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:test3 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Boolean visibility:public [final,static] + EXPRESSION_BODY + CONST Boolean type=kotlin.Boolean value=true + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Boolean + correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Boolean declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Boolean visibility:public [final,static] ' type=kotlin.Boolean origin=null + PROPERTY name:test4 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Boolean visibility:public [final,static] + EXPRESSION_BODY + CONST Boolean type=kotlin.Boolean value=false + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Boolean + correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Boolean declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Boolean visibility:public [final,static] ' type=kotlin.Boolean origin=null + PROPERTY name:test5 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CONST String type=kotlin.String value="abc" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:test5 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + PROPERTY name:test6 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test6 type:kotlin.Nothing? visibility:public [final,static] + EXPRESSION_BODY + CONST Null type=kotlin.Nothing? value=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Nothing? + correspondingProperty: PROPERTY name:test6 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Nothing? declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test6 type:kotlin.Nothing? visibility:public [final,static] ' type=kotlin.Nothing? origin=null + PROPERTY name:test7 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test7 type:kotlin.Long visibility:public [final,static] + EXPRESSION_BODY + CONST Long type=kotlin.Long value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Long + correspondingProperty: PROPERTY name:test7 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Long declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test7 type:kotlin.Long visibility:public [final,static] ' type=kotlin.Long origin=null + PROPERTY name:test8 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test8 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST Long type=kotlin.Long value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test8 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test8 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:test9 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test9 type:kotlin.Double visibility:public [final,static] + EXPRESSION_BODY + CONST Double type=kotlin.Double value=1.0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Double + correspondingProperty: PROPERTY name:test9 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Double declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test9 type:kotlin.Double visibility:public [final,static] ' type=kotlin.Double origin=null + PROPERTY name:test10 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test10 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST Double type=kotlin.Double value=1.0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test10 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test10 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:test11 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test11 type:kotlin.Float visibility:public [final,static] + EXPRESSION_BODY + CONST Float type=kotlin.Float value=1.0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Float + correspondingProperty: PROPERTY name:test11 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Float declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test11 type:kotlin.Float visibility:public [final,static] ' type=kotlin.Float origin=null + PROPERTY name:test12 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test12 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST Float type=kotlin.Float value=1.0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test12 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test12 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:test13 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test13 type:kotlin.Char visibility:public [final,static] + EXPRESSION_BODY + CONST Char type=kotlin.Char value='a' + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Char + correspondingProperty: PROPERTY name:test13 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Char declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test13 type:kotlin.Char visibility:public [final,static] ' type=kotlin.Char origin=null + PROPERTY name:testB visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:testB type:kotlin.Byte visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Byte value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Byte + correspondingProperty: PROPERTY name:testB visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Byte declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testB type:kotlin.Byte visibility:public [final,static] ' type=kotlin.Byte origin=null + PROPERTY name:testS visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:testS type:kotlin.Short visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Short value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Short + correspondingProperty: PROPERTY name:testS visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Short declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testS type:kotlin.Short visibility:public [final,static] ' type=kotlin.Short origin=null + PROPERTY name:testI visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:testI type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:testI visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testI type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + PROPERTY name:testL visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:testL type:kotlin.Long visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Long value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Long + correspondingProperty: PROPERTY name:testL visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Long declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testL type:kotlin.Long visibility:public [final,static] ' type=kotlin.Long origin=null diff --git a/compiler/testData/ir/irText/expressions/memberTypeArguments.fir.txt b/compiler/testData/ir/irText/expressions/memberTypeArguments.fir.txt new file mode 100644 index 00000000000..7d680b574ca --- /dev/null +++ b/compiler/testData/ir/irText/expressions/memberTypeArguments.fir.txt @@ -0,0 +1,40 @@ +FILE fqName: fileName:/memberTypeArguments.kt + CLASS CLASS name:GenericClass modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.GenericClass + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> (value:T of .GenericClass) returnType:.GenericClass.GenericClass> [primary] + VALUE_PARAMETER name:value index:0 type:T of .GenericClass + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:GenericClass modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:T of .GenericClass visibility:public [final] + EXPRESSION_BODY + GET_VAR 'value: T of .GenericClass declared in .GenericClass.' type=T of .GenericClass origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.GenericClass) returnType:T of .GenericClass + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.GenericClass + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of .GenericClass declared in .GenericClass' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .GenericClass visibility:public [final] ' type=T of .GenericClass origin=null + receiver: GET_VAR ': .GenericClass declared in .GenericClass.' type=.GenericClass origin=null + FUN name:withNewValue visibility:public modality:FINAL <> ($this:.GenericClass, newValue:T of .GenericClass) returnType:.GenericClass.GenericClass> + $this: VALUE_PARAMETER name: type:.GenericClass + VALUE_PARAMETER name:newValue index:0 type:T of .GenericClass + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun withNewValue (newValue: T of .GenericClass): .GenericClass.GenericClass> declared in .GenericClass' + CALL 'public constructor (value: T of .GenericClass) [primary] declared in .GenericClass' type=.GenericClass.GenericClass> origin=null + value: GET_VAR 'newValue: T of .GenericClass declared in .GenericClass.withNewValue' type=T of .GenericClass origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/membersImportedFromObject.fir.txt b/compiler/testData/ir/irText/expressions/membersImportedFromObject.fir.txt new file mode 100644 index 00000000000..bb59e7612b4 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/membersImportedFromObject.fir.txt @@ -0,0 +1,84 @@ +FILE fqName: fileName:/membersImportedFromObject.kt + CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:private <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in .A' + CONST Int type=kotlin.Int value=1 + FUN name:fooExt visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun fooExt (): kotlin.Int declared in .A' + CONST Int type=kotlin.Int value=2 + PROPERTY name:bar visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + PROPERTY name:barExt visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.A) returnType:IrErrorType + correspondingProperty: PROPERTY name:barExt visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .A' + CONST Int type=IrErrorType value=43 + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:test1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun foo (): kotlin.Int declared in .A' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + PROPERTY name:test2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun (): kotlin.Int declared in .A' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + PROPERTY name:test3 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun fooExt (): kotlin.Int declared in .A' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + PROPERTY name:test4 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test4 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun (): IrErrorType declared in .A' type=IrErrorType origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/expressions/multipleThisReferences.fir.txt b/compiler/testData/ir/irText/expressions/multipleThisReferences.fir.txt new file mode 100644 index 00000000000..2e92b74b3bd --- /dev/null +++ b/compiler/testData/ir/irText/expressions/multipleThisReferences.fir.txt @@ -0,0 +1,107 @@ +FILE fqName: fileName:/multipleThisReferences.kt + CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer + CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' + CLASS CLASS name:Inner modality:OPEN visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Outer.Inner [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:OPEN visibility:public [inner] superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .Outer.Inner.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Outer.Inner) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Outer.Inner + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Outer.Inner' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Outer.Inner declared in .Outer.Inner.' type=.Outer.Inner origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host + CONSTRUCTOR visibility:public <> (y:kotlin.Int) returnType:.Host [primary] + VALUE_PARAMETER name:y index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:y visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'y: kotlin.Int declared in .Host.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Int + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Host' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Host declared in .Host.' type=.Host origin=null + FUN name:test visibility:public modality:FINAL <> ($this:.Host) returnType:IrErrorType + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test (): IrErrorType declared in .Host' + BLOCK type=.Host.test. origin=OBJECT_LITERAL + CLASS OBJECT name: modality:FINAL visibility:local superTypes:[.Outer.Inner] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host.test. + CONSTRUCTOR visibility:private <> () returnType:IrErrorType [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int) [primary] declared in .Outer.Inner' + x: CONST Int type=IrErrorType value=42 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name: modality:FINAL visibility:local superTypes:[.Outer.Inner]' + PROPERTY name:xx visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:xx type:kotlin.String visibility:public [final] + EXPRESSION_BODY + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin' type=kotlin.String origin=null + other: CALL 'public final fun (): kotlin.Int declared in .Host' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host.test.) returnType:kotlin.String + correspondingProperty: PROPERTY name:xx visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Host.test. + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Host.test.' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xx type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .Host.test. declared in .Host.test..' type=.Host.test. origin=null + CALL 'private constructor () [primary] declared in .Host.test.' type=.Host.test. origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/objectAsCallable.fir.txt b/compiler/testData/ir/irText/expressions/objectAsCallable.fir.txt new file mode 100644 index 00000000000..f09bbc258bd --- /dev/null +++ b/compiler/testData/ir/irText/expressions/objectAsCallable.fir.txt @@ -0,0 +1,97 @@ +FILE fqName: fileName:/objectAsCallable.kt + CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:private <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.En + CONSTRUCTOR visibility:private <> () returnType:.En [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum]' + CLASS ENUM_ENTRY name:X modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.En.X + CONSTRUCTOR visibility:public <> () returnType:.En.X [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN name:invoke visibility:public modality:FINAL <> (i:kotlin.Int) returnType:kotlin.Int + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun invoke (i: kotlin.Int): kotlin.Int declared in ' + GET_VAR 'i: kotlin.Int declared in .invoke' type=kotlin.Int origin=null + FUN name:invoke visibility:public modality:FINAL <> (i:kotlin.Int) returnType:kotlin.Int + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun invoke (i: kotlin.Int): kotlin.Int declared in ' + GET_VAR 'i: kotlin.Int declared in .invoke' type=kotlin.Int origin=null + PROPERTY name:test1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test1 type:.A visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Cannot bind 1 arguments to call with 0 parameters' type=.A + CONST Int type=kotlin.Int value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.A + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .A declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:.A visibility:public [final,static] ' type=.A origin=null + PROPERTY name:test2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test2 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST Int type=kotlin.Int value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/expressions/objectClassReference.fir.txt b/compiler/testData/ir/irText/expressions/objectClassReference.fir.txt new file mode 100644 index 00000000000..f239a9bb8e5 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/objectClassReference.fir.txt @@ -0,0 +1,25 @@ +FILE fqName: fileName:/objectClassReference.kt + CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:private <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + GET_CLASS type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType diff --git a/compiler/testData/ir/irText/expressions/objectReference.fir.txt b/compiler/testData/ir/irText/expressions/objectReference.fir.txt new file mode 100644 index 00000000000..fac3e22a9c6 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/objectReference.fir.txt @@ -0,0 +1,153 @@ +FILE fqName: fileName:/objectReference.kt + CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z + CONSTRUCTOR visibility:private <> () returnType:.Z [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:counter visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Int + correspondingProperty: PROPERTY name:counter visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Z + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Z' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Z declared in .Z.' type=.Z origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Z, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:counter visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Z + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .Z declared in .Z.' type=.Z origin=null + value: GET_VAR ': kotlin.Int declared in .Z.' type=kotlin.Int origin=null + FUN name:foo visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z + BLOCK_BODY + FUN name:bar visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + CLASS CLASS name:Nested modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.Nested + CONSTRUCTOR visibility:public <> () returnType:.Z.Nested [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Nested modality:FINAL visibility:public superTypes:[kotlin.Any]' + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + FUN name:test visibility:public modality:FINAL <> ($this:.Z.Nested) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z.Nested + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:aLambda visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:aLambda type:IrErrorType visibility:public [final] + EXPRESSION_BODY + BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($this:.Z) returnType:IrErrorType + $this: VALUE_PARAMETER name: type:.Z + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .Z.aLambda' + BLOCK type=kotlin.Unit origin=null + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .Z.aLambda' type=IrErrorType origin=LAMBDA + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Z) returnType:IrErrorType + correspondingProperty: PROPERTY name:aLambda visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Z + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .Z' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:aLambda type:IrErrorType visibility:public [final] ' type=IrErrorType origin=null + receiver: GET_VAR ': .Z declared in .Z.' type=.Z origin=null + PROPERTY name:anObject visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:anObject type:IrErrorType visibility:public [final] + EXPRESSION_BODY + BLOCK type=.Z.anObject. origin=OBJECT_LITERAL + CLASS OBJECT name: modality:FINAL visibility:local superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.anObject. + CONSTRUCTOR visibility:private <> () returnType:IrErrorType [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name: modality:FINAL visibility:local superTypes:[kotlin.Any]' + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + FUN name:test visibility:public modality:FINAL <> ($this:.Z.anObject.) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z.anObject. + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + CALL 'private constructor () [primary] declared in .Z.anObject.' type=.Z.anObject. origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Z) returnType:IrErrorType + correspondingProperty: PROPERTY name:anObject visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Z + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .Z' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anObject type:IrErrorType visibility:public [final] ' type=IrErrorType origin=null + receiver: GET_VAR ': .Z declared in .Z.' type=.Z origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.fir.txt b/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.fir.txt new file mode 100644 index 00000000000..0ae59989be3 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.fir.txt @@ -0,0 +1,57 @@ +FILE fqName: fileName:/objectReferenceInClosureInSuperConstructorCall.kt + CLASS CLASS name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base + CONSTRUCTOR visibility:public <> (lambda:kotlin.Function0) returnType:.Base [primary] + VALUE_PARAMETER name:lambda index:0 type:kotlin.Function0 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' + PROPERTY name:lambda visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:lambda type:kotlin.Function0 visibility:public [final] + EXPRESSION_BODY + GET_VAR 'lambda: kotlin.Function0 declared in .Base.' type=kotlin.Function0 origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Base) returnType:kotlin.Function0 + correspondingProperty: PROPERTY name:lambda visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Base + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function0 declared in .Base' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:lambda type:kotlin.Function0 visibility:public [final] ' type=kotlin.Function0 origin=null + receiver: GET_VAR ': .Base declared in .Base.' type=.Base origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS OBJECT name:Test modality:FINAL visibility:public superTypes:[.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test + CONSTRUCTOR visibility:private <> () returnType:.Test [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (lambda: kotlin.Function0) [primary] declared in .Base' + lambda: BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .Test.' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .Test.' type=IrErrorType origin=LAMBDA + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Test modality:FINAL visibility:public superTypes:[.Base]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/objectReferenceInFieldInitializer.fir.txt b/compiler/testData/ir/irText/expressions/objectReferenceInFieldInitializer.fir.txt new file mode 100644 index 00000000000..8af0b9a8b4f --- /dev/null +++ b/compiler/testData/ir/irText/expressions/objectReferenceInFieldInitializer.fir.txt @@ -0,0 +1,54 @@ +FILE fqName: fileName:/objectReferenceInFieldInitializer.kt + CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:private <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:a visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final] + EXPRESSION_BODY + CONST String type=kotlin.String value="$" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.A) returnType:kotlin.String + correspondingProperty: PROPERTY name:a visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.String declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + PROPERTY name:b visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:b type:kotlin.String visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + other: CALL 'private final fun (): kotlin.String declared in .A' type=kotlin.String origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.A) returnType:kotlin.String + correspondingProperty: PROPERTY name:b visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.String declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:kotlin.String visibility:private [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + PROPERTY name:c visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.Int visibility:private [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=10000 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.A) returnType:kotlin.Int + correspondingProperty: PROPERTY name:c visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.Int declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.Int visibility:private [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/outerClassInstanceReference.fir.txt b/compiler/testData/ir/irText/expressions/outerClassInstanceReference.fir.txt new file mode 100644 index 00000000000..7818da550c3 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/outerClassInstanceReference.fir.txt @@ -0,0 +1,47 @@ +FILE fqName: fileName:/outerClassInstanceReference.kt + CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer + CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:outer visibility:public modality:FINAL <> ($this:.Outer) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Outer + BLOCK_BODY + CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner + CONSTRUCTOR visibility:public <> () returnType:.Outer.Inner [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' + FUN name:inner visibility:public modality:FINAL <> ($this:.Outer.Inner) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Outer.Inner + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun inner (): kotlin.Unit declared in .Outer.Inner' + CALL 'public final fun outer (): kotlin.Unit declared in .Outer' type=kotlin.Unit origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/primitiveComparisons.fir.txt b/compiler/testData/ir/irText/expressions/primitiveComparisons.fir.txt new file mode 100644 index 00000000000..e4cd920d1c8 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/primitiveComparisons.fir.txt @@ -0,0 +1,177 @@ +FILE fqName: fileName:/primitiveComparisons.kt + FUN name:btest1 visibility:public modality:FINAL <> (a:kotlin.Byte, b:kotlin.Byte) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Byte + VALUE_PARAMETER name:b index:1 type:kotlin.Byte + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun btest1 (a: kotlin.Byte, b: kotlin.Byte): kotlin.Boolean declared in ' + ERROR_CALL 'Comparison of arguments with unsupported type: kotlin/Byte' type=kotlin.Boolean + FUN name:btest2 visibility:public modality:FINAL <> (a:kotlin.Byte, b:kotlin.Byte) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Byte + VALUE_PARAMETER name:b index:1 type:kotlin.Byte + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun btest2 (a: kotlin.Byte, b: kotlin.Byte): kotlin.Boolean declared in ' + ERROR_CALL 'Comparison of arguments with unsupported type: kotlin/Byte' type=kotlin.Boolean + FUN name:btest3 visibility:public modality:FINAL <> (a:kotlin.Byte, b:kotlin.Byte) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Byte + VALUE_PARAMETER name:b index:1 type:kotlin.Byte + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun btest3 (a: kotlin.Byte, b: kotlin.Byte): kotlin.Boolean declared in ' + ERROR_CALL 'Comparison of arguments with unsupported type: kotlin/Byte' type=kotlin.Boolean + FUN name:btest4 visibility:public modality:FINAL <> (a:kotlin.Byte, b:kotlin.Byte) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Byte + VALUE_PARAMETER name:b index:1 type:kotlin.Byte + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun btest4 (a: kotlin.Byte, b: kotlin.Byte): kotlin.Boolean declared in ' + ERROR_CALL 'Comparison of arguments with unsupported type: kotlin/Byte' type=kotlin.Boolean + FUN name:stest1 visibility:public modality:FINAL <> (a:kotlin.Short, b:kotlin.Short) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Short + VALUE_PARAMETER name:b index:1 type:kotlin.Short + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun stest1 (a: kotlin.Short, b: kotlin.Short): kotlin.Boolean declared in ' + ERROR_CALL 'Comparison of arguments with unsupported type: kotlin/Short' type=kotlin.Boolean + FUN name:stest2 visibility:public modality:FINAL <> (a:kotlin.Short, b:kotlin.Short) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Short + VALUE_PARAMETER name:b index:1 type:kotlin.Short + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun stest2 (a: kotlin.Short, b: kotlin.Short): kotlin.Boolean declared in ' + ERROR_CALL 'Comparison of arguments with unsupported type: kotlin/Short' type=kotlin.Boolean + FUN name:stest3 visibility:public modality:FINAL <> (a:kotlin.Short, b:kotlin.Short) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Short + VALUE_PARAMETER name:b index:1 type:kotlin.Short + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun stest3 (a: kotlin.Short, b: kotlin.Short): kotlin.Boolean declared in ' + ERROR_CALL 'Comparison of arguments with unsupported type: kotlin/Short' type=kotlin.Boolean + FUN name:stest4 visibility:public modality:FINAL <> (a:kotlin.Short, b:kotlin.Short) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Short + VALUE_PARAMETER name:b index:1 type:kotlin.Short + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun stest4 (a: kotlin.Short, b: kotlin.Short): kotlin.Boolean declared in ' + ERROR_CALL 'Comparison of arguments with unsupported type: kotlin/Short' type=kotlin.Boolean + FUN name:itest1 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Int + VALUE_PARAMETER name:b index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun itest1 (a: kotlin.Int, b: kotlin.Int): kotlin.Boolean declared in ' + CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT + arg0: GET_VAR 'a: kotlin.Int declared in .itest1' type=kotlin.Int origin=null + arg1: GET_VAR 'b: kotlin.Int declared in .itest1' type=kotlin.Int origin=null + FUN name:itest2 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Int + VALUE_PARAMETER name:b index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun itest2 (a: kotlin.Int, b: kotlin.Int): kotlin.Boolean declared in ' + CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT + arg0: GET_VAR 'a: kotlin.Int declared in .itest2' type=kotlin.Int origin=null + arg1: GET_VAR 'b: kotlin.Int declared in .itest2' type=kotlin.Int origin=null + FUN name:itest3 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Int + VALUE_PARAMETER name:b index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun itest3 (a: kotlin.Int, b: kotlin.Int): kotlin.Boolean declared in ' + CALL 'public final fun greaterOrEqual (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GTEQ + arg0: GET_VAR 'a: kotlin.Int declared in .itest3' type=kotlin.Int origin=null + arg1: GET_VAR 'b: kotlin.Int declared in .itest3' type=kotlin.Int origin=null + FUN name:itest4 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Int + VALUE_PARAMETER name:b index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun itest4 (a: kotlin.Int, b: kotlin.Int): kotlin.Boolean declared in ' + CALL 'public final fun lessOrEqual (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LTEQ + arg0: GET_VAR 'a: kotlin.Int declared in .itest4' type=kotlin.Int origin=null + arg1: GET_VAR 'b: kotlin.Int declared in .itest4' type=kotlin.Int origin=null + FUN name:ltest1 visibility:public modality:FINAL <> (a:kotlin.Long, b:kotlin.Long) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Long + VALUE_PARAMETER name:b index:1 type:kotlin.Long + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun ltest1 (a: kotlin.Long, b: kotlin.Long): kotlin.Boolean declared in ' + CALL 'public final fun greater (arg0: kotlin.Long, arg1: kotlin.Long): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT + arg0: GET_VAR 'a: kotlin.Long declared in .ltest1' type=kotlin.Long origin=null + arg1: GET_VAR 'b: kotlin.Long declared in .ltest1' type=kotlin.Long origin=null + FUN name:ltest2 visibility:public modality:FINAL <> (a:kotlin.Long, b:kotlin.Long) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Long + VALUE_PARAMETER name:b index:1 type:kotlin.Long + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun ltest2 (a: kotlin.Long, b: kotlin.Long): kotlin.Boolean declared in ' + CALL 'public final fun less (arg0: kotlin.Long, arg1: kotlin.Long): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT + arg0: GET_VAR 'a: kotlin.Long declared in .ltest2' type=kotlin.Long origin=null + arg1: GET_VAR 'b: kotlin.Long declared in .ltest2' type=kotlin.Long origin=null + FUN name:ltest3 visibility:public modality:FINAL <> (a:kotlin.Long, b:kotlin.Long) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Long + VALUE_PARAMETER name:b index:1 type:kotlin.Long + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun ltest3 (a: kotlin.Long, b: kotlin.Long): kotlin.Boolean declared in ' + CALL 'public final fun greaterOrEqual (arg0: kotlin.Long, arg1: kotlin.Long): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GTEQ + arg0: GET_VAR 'a: kotlin.Long declared in .ltest3' type=kotlin.Long origin=null + arg1: GET_VAR 'b: kotlin.Long declared in .ltest3' type=kotlin.Long origin=null + FUN name:ltest4 visibility:public modality:FINAL <> (a:kotlin.Long, b:kotlin.Long) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Long + VALUE_PARAMETER name:b index:1 type:kotlin.Long + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun ltest4 (a: kotlin.Long, b: kotlin.Long): kotlin.Boolean declared in ' + CALL 'public final fun lessOrEqual (arg0: kotlin.Long, arg1: kotlin.Long): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LTEQ + arg0: GET_VAR 'a: kotlin.Long declared in .ltest4' type=kotlin.Long origin=null + arg1: GET_VAR 'b: kotlin.Long declared in .ltest4' type=kotlin.Long origin=null + FUN name:ftest1 visibility:public modality:FINAL <> (a:kotlin.Float, b:kotlin.Float) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Float + VALUE_PARAMETER name:b index:1 type:kotlin.Float + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun ftest1 (a: kotlin.Float, b: kotlin.Float): kotlin.Boolean declared in ' + CALL 'public final fun greater (arg0: kotlin.Float, arg1: kotlin.Float): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT + arg0: GET_VAR 'a: kotlin.Float declared in .ftest1' type=kotlin.Float origin=null + arg1: GET_VAR 'b: kotlin.Float declared in .ftest1' type=kotlin.Float origin=null + FUN name:ftest2 visibility:public modality:FINAL <> (a:kotlin.Float, b:kotlin.Float) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Float + VALUE_PARAMETER name:b index:1 type:kotlin.Float + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun ftest2 (a: kotlin.Float, b: kotlin.Float): kotlin.Boolean declared in ' + CALL 'public final fun less (arg0: kotlin.Float, arg1: kotlin.Float): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT + arg0: GET_VAR 'a: kotlin.Float declared in .ftest2' type=kotlin.Float origin=null + arg1: GET_VAR 'b: kotlin.Float declared in .ftest2' type=kotlin.Float origin=null + FUN name:ftest3 visibility:public modality:FINAL <> (a:kotlin.Float, b:kotlin.Float) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Float + VALUE_PARAMETER name:b index:1 type:kotlin.Float + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun ftest3 (a: kotlin.Float, b: kotlin.Float): kotlin.Boolean declared in ' + CALL 'public final fun greaterOrEqual (arg0: kotlin.Float, arg1: kotlin.Float): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GTEQ + arg0: GET_VAR 'a: kotlin.Float declared in .ftest3' type=kotlin.Float origin=null + arg1: GET_VAR 'b: kotlin.Float declared in .ftest3' type=kotlin.Float origin=null + FUN name:ftest4 visibility:public modality:FINAL <> (a:kotlin.Float, b:kotlin.Float) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Float + VALUE_PARAMETER name:b index:1 type:kotlin.Float + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun ftest4 (a: kotlin.Float, b: kotlin.Float): kotlin.Boolean declared in ' + CALL 'public final fun lessOrEqual (arg0: kotlin.Float, arg1: kotlin.Float): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LTEQ + arg0: GET_VAR 'a: kotlin.Float declared in .ftest4' type=kotlin.Float origin=null + arg1: GET_VAR 'b: kotlin.Float declared in .ftest4' type=kotlin.Float origin=null + FUN name:dtest1 visibility:public modality:FINAL <> (a:kotlin.Double, b:kotlin.Double) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Double + VALUE_PARAMETER name:b index:1 type:kotlin.Double + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun dtest1 (a: kotlin.Double, b: kotlin.Double): kotlin.Boolean declared in ' + CALL 'public final fun greater (arg0: kotlin.Double, arg1: kotlin.Double): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT + arg0: GET_VAR 'a: kotlin.Double declared in .dtest1' type=kotlin.Double origin=null + arg1: GET_VAR 'b: kotlin.Double declared in .dtest1' type=kotlin.Double origin=null + FUN name:dtest2 visibility:public modality:FINAL <> (a:kotlin.Double, b:kotlin.Double) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Double + VALUE_PARAMETER name:b index:1 type:kotlin.Double + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun dtest2 (a: kotlin.Double, b: kotlin.Double): kotlin.Boolean declared in ' + CALL 'public final fun less (arg0: kotlin.Double, arg1: kotlin.Double): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT + arg0: GET_VAR 'a: kotlin.Double declared in .dtest2' type=kotlin.Double origin=null + arg1: GET_VAR 'b: kotlin.Double declared in .dtest2' type=kotlin.Double origin=null + FUN name:dtest3 visibility:public modality:FINAL <> (a:kotlin.Double, b:kotlin.Double) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Double + VALUE_PARAMETER name:b index:1 type:kotlin.Double + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun dtest3 (a: kotlin.Double, b: kotlin.Double): kotlin.Boolean declared in ' + CALL 'public final fun greaterOrEqual (arg0: kotlin.Double, arg1: kotlin.Double): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GTEQ + arg0: GET_VAR 'a: kotlin.Double declared in .dtest3' type=kotlin.Double origin=null + arg1: GET_VAR 'b: kotlin.Double declared in .dtest3' type=kotlin.Double origin=null + FUN name:dtest4 visibility:public modality:FINAL <> (a:kotlin.Double, b:kotlin.Double) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.Double + VALUE_PARAMETER name:b index:1 type:kotlin.Double + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun dtest4 (a: kotlin.Double, b: kotlin.Double): kotlin.Boolean declared in ' + CALL 'public final fun lessOrEqual (arg0: kotlin.Double, arg1: kotlin.Double): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LTEQ + arg0: GET_VAR 'a: kotlin.Double declared in .dtest4' type=kotlin.Double origin=null + arg1: GET_VAR 'b: kotlin.Double declared in .dtest4' type=kotlin.Double origin=null diff --git a/compiler/testData/ir/irText/expressions/primitivesImplicitConversions.fir.txt b/compiler/testData/ir/irText/expressions/primitivesImplicitConversions.fir.txt new file mode 100644 index 00000000000..c8b949d5a5f --- /dev/null +++ b/compiler/testData/ir/irText/expressions/primitivesImplicitConversions.fir.txt @@ -0,0 +1,110 @@ +FILE fqName: fileName:/primitivesImplicitConversions.kt + PROPERTY name:test1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Long visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Long value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Long + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Long declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Long visibility:public [final,static] ' type=kotlin.Long origin=null + PROPERTY name:test2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Short visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Short value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Short + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Short declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Short visibility:public [final,static] ' type=kotlin.Short origin=null + PROPERTY name:test3 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Byte visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Byte value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Byte + correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Byte declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Byte visibility:public [final,static] ' type=kotlin.Byte origin=null + PROPERTY name:test4 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Long visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Long + correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Long declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Long visibility:public [final,static] ' type=kotlin.Long origin=null + PROPERTY name:test5 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.Short visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Short + correspondingProperty: PROPERTY name:test5 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Short declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.Short visibility:public [final,static] ' type=kotlin.Short origin=null + PROPERTY name:test6 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test6 type:kotlin.Byte visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Byte + correspondingProperty: PROPERTY name:test6 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Byte declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test6 type:kotlin.Byte visibility:public [final,static] ' type=kotlin.Byte origin=null + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:test1 type:kotlin.Int? [val] + CONST Int type=kotlin.Int? value=42 + VAR name:test2 type:kotlin.Long [val] + CONST Int type=kotlin.Long value=42 + VAR name:test3 type:kotlin.Long? [val] + CONST Int type=kotlin.Long? value=42 + VAR name:test4 type:kotlin.Long? [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST Int type=kotlin.Int value=1 + VAR name:test5 type:kotlin.Long? [val] + CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + VAR name:test6 type:kotlin.Short? [val] + CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + VAR name:test7 type:kotlin.Byte? [val] + CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + FUN name:testImplicitArguments visibility:public modality:FINAL <> (x:kotlin.Long) returnType:kotlin.Unit + VALUE_PARAMETER name:x index:0 type:kotlin.Long + EXPRESSION_BODY + CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + BLOCK_BODY + CLASS CLASS name:TestImplicitArguments modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestImplicitArguments + CONSTRUCTOR visibility:public <> (x:kotlin.Long) returnType:.TestImplicitArguments [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Long + EXPRESSION_BODY + CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestImplicitArguments modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Long visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Long declared in .TestImplicitArguments.' type=kotlin.Long origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestImplicitArguments) returnType:kotlin.Long + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestImplicitArguments + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Long declared in .TestImplicitArguments' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Long visibility:public [final] ' type=kotlin.Long origin=null + receiver: GET_VAR ': .TestImplicitArguments declared in .TestImplicitArguments.' type=.TestImplicitArguments origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/propertyReferences.fir.txt b/compiler/testData/ir/irText/expressions/propertyReferences.fir.txt new file mode 100644 index 00000000000..2f78f3c4021 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/propertyReferences.fir.txt @@ -0,0 +1,273 @@ +FILE fqName: fileName:/propertyReferences.kt + CLASS OBJECT name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegate + CONSTRUCTOR visibility:private <> () returnType:.Delegate [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:getValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, kProp:kotlin.Any) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.Delegate + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:kProp index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any): kotlin.Int declared in .Delegate' + CONST Int type=kotlin.Int value=1 + FUN name:setValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, kProp:kotlin.Any, value:kotlin.Int) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Delegate + VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? + VALUE_PARAMETER name:kProp index:1 type:kotlin.Any + VALUE_PARAMETER name:value index:2 type:kotlin.Int + BLOCK_BODY + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:C modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:OPEN visibility:public superTypes:[kotlin.Any]' + PROPERTY name:varWithPrivateSet visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:varWithPrivateSet type:kotlin.Int visibility:public + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:varWithPrivateSet visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:varWithPrivateSet type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + FUN name: visibility:private modality:FINAL <> ($this:.C, value:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:varWithPrivateSet visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:value index:0 type:kotlin.Int + PROPERTY name:varWithProtectedSet visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:varWithProtectedSet type:kotlin.Int visibility:public + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:varWithProtectedSet visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:varWithProtectedSet type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + FUN name: visibility:protected modality:FINAL <> ($this:.C, value:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:varWithProtectedSet visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:value index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:valWithBackingField visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:valWithBackingField type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:valWithBackingField visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:valWithBackingField type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + PROPERTY name:test_valWithBackingField visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test_valWithBackingField type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test_valWithBackingField visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test_valWithBackingField type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + PROPERTY name:varWithBackingField visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:varWithBackingField type:kotlin.Int visibility:public [static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:varWithBackingField visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:varWithBackingField type:kotlin.Int visibility:public [static] ' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:varWithBackingField visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:varWithBackingField type:kotlin.Int visibility:public [static] ' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null + PROPERTY name:test_varWithBackingField visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test_varWithBackingField type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test_varWithBackingField visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test_varWithBackingField type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + PROPERTY name:varWithBackingFieldAndAccessors visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:varWithBackingFieldAndAccessors type:kotlin.Int visibility:public [static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:varWithBackingFieldAndAccessors visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN name: visibility:public modality:FINAL <> (value:IrErrorType) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:varWithBackingFieldAndAccessors visibility:public modality:FINAL [var] + VALUE_PARAMETER name:value index:0 type:IrErrorType + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + PROPERTY name:test_varWithBackingFieldAndAccessors visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test_varWithBackingFieldAndAccessors type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test_varWithBackingFieldAndAccessors visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test_varWithBackingFieldAndAccessors type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + PROPERTY name:valWithAccessors visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:valWithAccessors visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + CONST Int type=IrErrorType value=1 + PROPERTY name:test_valWithAccessors visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test_valWithAccessors type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun (): IrErrorType declared in ' type=IrErrorType origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test_valWithAccessors visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test_valWithAccessors type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:varWithAccessors visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:varWithAccessors visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + CONST Int type=IrErrorType value=1 + FUN name: visibility:public modality:FINAL <> (value:IrErrorType) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:varWithAccessors visibility:public modality:FINAL [var] + VALUE_PARAMETER name:value index:0 type:IrErrorType + BLOCK_BODY + PROPERTY name:test_varWithAccessors visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test_varWithAccessors type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun (): IrErrorType declared in ' type=IrErrorType origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test_varWithAccessors visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test_varWithAccessors type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:delegatedVal visibility:public modality:FINAL [delegated,val] + FIELD PROPERTY_BACKING_FIELD name:delegatedVal type:IrErrorType visibility:public [final,static] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:delegatedVal visibility:public modality:FINAL [delegated,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegatedVal type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:test_delegatedVal visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test_delegatedVal type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun (): IrErrorType declared in ' type=IrErrorType origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test_delegatedVal visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test_delegatedVal type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:delegatedVar visibility:public modality:FINAL [delegated,var] + FIELD PROPERTY_BACKING_FIELD name:delegatedVar type:IrErrorType visibility:public [static] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:delegatedVar visibility:public modality:FINAL [delegated,var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegatedVar type:IrErrorType visibility:public [static] ' type=IrErrorType origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:IrErrorType) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:delegatedVar visibility:public modality:FINAL [delegated,var] + VALUE_PARAMETER name: index:0 type:IrErrorType + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegatedVar type:IrErrorType visibility:public [static] ' type=kotlin.Unit origin=null + value: GET_VAR ': IrErrorType declared in .' type=IrErrorType origin=null + PROPERTY name:test_delegatedVar visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test_delegatedVar type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun (): IrErrorType declared in ' type=IrErrorType origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test_delegatedVar visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test_delegatedVar type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:constVal visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:constVal type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:constVal visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:constVal type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + PROPERTY name:test_constVal visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test_constVal type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test_constVal visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test_constVal type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + PROPERTY name:test_J_CONST visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test_J_CONST type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test_J_CONST visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test_J_CONST type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:test_J_nonConst visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test_J_nonConst type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test_J_nonConst visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test_J_nonConst type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:test_varWithPrivateSet visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test_varWithPrivateSet type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test_varWithPrivateSet visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test_varWithPrivateSet type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:test_varWithProtectedSet visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test_varWithProtectedSet type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test_varWithProtectedSet visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test_varWithProtectedSet type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/expressions/references.fir.txt b/compiler/testData/ir/irText/expressions/references.fir.txt new file mode 100644 index 00000000000..a2b243740a5 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/references.fir.txt @@ -0,0 +1,54 @@ +FILE fqName: fileName:/references.kt + PROPERTY name:ok visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:ok type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CONST String type=kotlin.String value="OK" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:ok visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ok type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + PROPERTY name:ok2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:ok2 type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:ok2 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ok2 type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + PROPERTY name:ok3 visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:ok3 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + CONST String type=kotlin.String value="OK" + FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.String declared in ' + CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=null + FUN name:test2 visibility:public modality:FINAL <> (x:kotlin.String) returnType:kotlin.String + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (x: kotlin.String): kotlin.String declared in ' + GET_VAR 'x: kotlin.String declared in .test2' type=kotlin.String origin=null + FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + VAR name:x type:kotlin.String [val] + CONST String type=kotlin.String value="OK" + RETURN type=kotlin.Nothing from='public final fun test3 (): kotlin.String declared in ' + GET_VAR 'val x: kotlin.String [val] declared in .test3' type=kotlin.String origin=null + FUN name:test4 visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (): kotlin.String declared in ' + CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=null + PROPERTY name:okext visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:okext visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + CONST String type=kotlin.String value="OK" + FUN name:test5 visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5 (): kotlin.String declared in ' + CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/expressions/reflectionLiterals.fir.txt b/compiler/testData/ir/irText/expressions/reflectionLiterals.fir.txt new file mode 100644 index 00000000000..75a40ccc0ba --- /dev/null +++ b/compiler/testData/ir/irText/expressions/reflectionLiterals.fir.txt @@ -0,0 +1,90 @@ +FILE fqName: fileName:/reflectionLiterals.kt + CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + PROPERTY name:qux visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:qux type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:qux visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:qux type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + PROPERTY name:test1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test1 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + GET_CLASS type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:test2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test2 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + GET_CLASS type=IrErrorType + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:test3 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test3 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:test4 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test4 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:test5 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test5 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test5 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test5 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:test6 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test6 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test6 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test6 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/expressions/safeAssignment.fir.txt b/compiler/testData/ir/irText/expressions/safeAssignment.fir.txt new file mode 100644 index 00000000000..6f5556cce3a --- /dev/null +++ b/compiler/testData/ir/irText/expressions/safeAssignment.fir.txt @@ -0,0 +1,45 @@ +FILE fqName: fileName:/safeAssignment.kt + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.C [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .C.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> (nc:.C?) returnType:kotlin.Unit + VALUE_PARAMETER name:nc index:0 type:.C? + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=42 diff --git a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt new file mode 100644 index 00000000000..fbbf58a65a1 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt @@ -0,0 +1,61 @@ +FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:test.C + CONSTRUCTOR visibility:public <> () returnType:test.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:p visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' + CONST Int type=kotlin.Int value=42 + FUN name: visibility:public modality:FINAL <> (value:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY + FUN name:inc visibility:public modality:FINAL <> () returnType:kotlin.Int? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun inc (): kotlin.Int? declared in test' + CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + FUN name:get visibility:public modality:FINAL <> (index:kotlin.Int) returnType:kotlin.Int + VALUE_PARAMETER name:index index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun get (index: kotlin.Int): kotlin.Int declared in test' + CONST Int type=kotlin.Int value=42 + FUN name:set visibility:public modality:FINAL <> (index:kotlin.Int, value:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:value index:1 type:kotlin.Int + BLOCK_BODY + FUN name:testProperty visibility:public modality:FINAL <> (nc:test.C?) returnType:kotlin.Unit + VALUE_PARAMETER name:nc index:0 type:test.C? + BLOCK_BODY + VAR name: type:kotlin.Int [val] + CALL 'public final fun (): kotlin.Int declared in test' type=kotlin.Int origin=null + ERROR_CALL 'Unresolved reference: R|test/p|' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in test.testProperty' type=kotlin.Int origin=null + FUN name:testArrayAccess visibility:public modality:FINAL <> (nc:test.C?) returnType:kotlin.Unit + VALUE_PARAMETER name:nc index:0 type:test.C? + BLOCK_BODY + VAR name: type:kotlin.Int [val] + CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in test' type=kotlin.Int origin=null + index: CONST Int type=kotlin.Int value=0 + CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in test' type=kotlin.Unit origin=null + index: CONST Int type=kotlin.Int value=0 + value: ERROR_CALL 'Cannot bind 1 arguments to inc call with 0 parameters' type=kotlin.Int? + GET_VAR 'val : kotlin.Int [val] declared in test.testArrayAccess' type=kotlin.Int origin=null + GET_VAR 'val : kotlin.Int [val] declared in test.testArrayAccess' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/safeCalls.fir.txt b/compiler/testData/ir/irText/expressions/safeCalls.fir.txt new file mode 100644 index 00000000000..1142c93e425 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/safeCalls.fir.txt @@ -0,0 +1,94 @@ +FILE fqName: fileName:/safeCalls.kt + CLASS CLASS name:Ref modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ref + CONSTRUCTOR visibility:public <> (value:kotlin.Int) returnType:.Ref [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Ref modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:value visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:public + EXPRESSION_BODY + GET_VAR 'value: kotlin.Int declared in .Ref.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Ref) returnType:kotlin.Int + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Ref + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Ref' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Ref declared in .Ref.' type=.Ref origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Ref, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Ref + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .Ref declared in .Ref.' type=.Ref origin=null + value: GET_VAR ': kotlin.Int declared in .Ref.' type=kotlin.Int origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:IHost modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IHost + FUN name:extLength visibility:public modality:OPEN <> ($this:.IHost) returnType:IrErrorType + $this: VALUE_PARAMETER name: type:.IHost + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun extLength (): IrErrorType declared in .IHost' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL <> (x:kotlin.String?) returnType:IrErrorType + VALUE_PARAMETER name:x index:0 type:kotlin.String? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (x: kotlin.String?): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN name:test2 visibility:public modality:FINAL <> (x:kotlin.String?) returnType:IrErrorType + VALUE_PARAMETER name:x index:0 type:kotlin.String? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (x: kotlin.String?): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN name:test3 visibility:public modality:FINAL <> (x:kotlin.String?, y:kotlin.Any?) returnType:IrErrorType + VALUE_PARAMETER name:x index:0 type:kotlin.String? + VALUE_PARAMETER name:y index:1 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (x: kotlin.String?, y: kotlin.Any?): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'y: kotlin.Any? declared in .test3' type=kotlin.Any? origin=null + FUN name:test4 visibility:public modality:FINAL <> (x:.Ref?) returnType:kotlin.Unit + VALUE_PARAMETER name:x index:0 type:.Ref? + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=0 + FUN name:test5 visibility:public modality:FINAL <> (s:kotlin.String?) returnType:IrErrorType + VALUE_PARAMETER name:s index:0 type:kotlin.String? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5 (s: kotlin.String?): IrErrorType declared in ' + CALL 'public open fun extLength (): IrErrorType declared in .IHost' type=IrErrorType origin=null + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=239 + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun foo (): kotlin.Int declared in ' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.txt new file mode 100644 index 00000000000..d84e1a07013 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.txt @@ -0,0 +1,37 @@ +FILE fqName: fileName:/samConstructors.kt + FUN name:test1 visibility:public modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .test1' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .test1' type=IrErrorType origin=LAMBDA + FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:IrErrorType + VALUE_PARAMETER name:a index:0 type:kotlin.Function0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (a: kotlin.Function0): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'a: kotlin.Function0 declared in .test2' type=kotlin.Function0 origin=null + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + FUN name:test3 visibility:public modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN name:test4 visibility:public modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (a:IrErrorType, b:IrErrorType) returnType:IrErrorType + VALUE_PARAMETER name:a index:0 type:IrErrorType + VALUE_PARAMETER name:b index:1 type:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (a: IrErrorType, b: IrErrorType): IrErrorType declared in .test4' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'b: IrErrorType declared in .test4.' type=IrErrorType origin=null + FUNCTION_REFERENCE 'local final fun (a: IrErrorType, b: IrErrorType): IrErrorType declared in .test4' type=IrErrorType origin=LAMBDA diff --git a/compiler/testData/ir/irText/expressions/sam/samConversions.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversions.fir.txt new file mode 100644 index 00000000000..e0f7bd7c04c --- /dev/null +++ b/compiler/testData/ir/irText/expressions/sam/samConversions.fir.txt @@ -0,0 +1,45 @@ +FILE fqName: fileName:/samConversions.kt + FUN name:test0 visibility:public modality:FINAL <> (a:java.lang.Runnable) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:java.lang.Runnable + BLOCK_BODY + CALL 'public open fun runStatic (r: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + r: GET_VAR 'a: java.lang.Runnable declared in .test0' type=java.lang.Runnable origin=null + CALL 'public open fun runIt (r: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + r: GET_VAR 'a: java.lang.Runnable declared in .test0' type=java.lang.Runnable origin=null + FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .test1' + CALL 'public final fun test1 (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .test1' type=IrErrorType origin=LAMBDA + FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public open fun runIt (r: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + r: BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .test2' + CALL 'public final fun test1 (): kotlin.Unit declared in ' type=kotlin.Unit origin=null + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .test2' type=IrErrorType origin=LAMBDA + FUN name:test3 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Function0 + BLOCK_BODY + CALL 'public open fun run2 (r1: java.lang.Runnable?, r2: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + r1: GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null + r2: GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null + FUN name:test4 visibility:public modality:FINAL <> (a:kotlin.Function0, b:kotlin.Function0, flag:kotlin.Boolean) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Function0 + VALUE_PARAMETER name:b index:1 type:kotlin.Function0 + VALUE_PARAMETER name:flag index:2 type:kotlin.Boolean + BLOCK_BODY + CALL 'public open fun runIt (r: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + r: WHEN type=kotlin.Function0 origin=IF + BRANCH + if: GET_VAR 'flag: kotlin.Boolean declared in .test4' type=kotlin.Boolean origin=null + then: GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'b: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt new file mode 100644 index 00000000000..17a4af1597a --- /dev/null +++ b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt @@ -0,0 +1,85 @@ +FILE fqName: fileName:/samConversionsWithSmartCasts.kt + FUN name:test1 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Function0 + BLOCK_BODY + WHEN type=kotlin.Unit origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=java.lang.Runnable + GET_VAR 'a: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=null + then: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'a: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=null + FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Function0 + BLOCK_BODY + WHEN type=kotlin.Unit origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=java.lang.Runnable + GET_VAR 'a: kotlin.Function0 declared in .test2' type=kotlin.Function0 origin=null + then: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'a: kotlin.Function0 declared in .test2' type=kotlin.Function0 origin=null + FUN name:test3 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Function0 + BLOCK_BODY + WHEN type=kotlin.Unit origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=java.lang.Runnable + GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null + then: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null + GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null + FUN name:test4 visibility:public modality:FINAL <> (a:kotlin.Function0, b:kotlin.Function0) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Function0 + VALUE_PARAMETER name:b index:1 type:kotlin.Function0 + BLOCK_BODY + WHEN type=kotlin.Unit origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=java.lang.Runnable + GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null + then: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null + GET_VAR 'b: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null + FUN name:test5 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Any + BLOCK_BODY + WHEN type=kotlin.Unit origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=java.lang.Runnable + GET_VAR 'a: kotlin.Any declared in .test5' type=kotlin.Any origin=null + then: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'a: kotlin.Any declared in .test5' type=kotlin.Any origin=null + FUN name:test5x visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Any + BLOCK_BODY + WHEN type=kotlin.Unit origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=java.lang.Runnable + GET_VAR 'a: kotlin.Any declared in .test5x' type=kotlin.Any origin=null + then: BLOCK type=IrErrorType origin=null + TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 + GET_VAR 'a: kotlin.Any declared in .test5x' type=kotlin.Any origin=null + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'a: kotlin.Any declared in .test5x' type=kotlin.Any origin=null + FUN name:test6 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Any + BLOCK_BODY + TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 + GET_VAR 'a: kotlin.Any declared in .test6' type=kotlin.Any origin=null + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'a: kotlin.Any declared in .test6' type=kotlin.Any origin=null + FUN name:test7 visibility:public modality:FINAL <> (a:kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Function1 + BLOCK_BODY + TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 + GET_VAR 'a: kotlin.Function1 declared in .test7' type=kotlin.Function1 origin=null + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'a: kotlin.Function1 declared in .test7' type=kotlin.Function1 origin=null + FUN name:test8 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Function0 + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'a: kotlin.Function0 declared in .test8' type=kotlin.Function0 origin=null + FUN name:test9 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType diff --git a/compiler/testData/ir/irText/expressions/sam/samOperators.fir.txt b/compiler/testData/ir/irText/expressions/sam/samOperators.fir.txt new file mode 100644 index 00000000000..23cf554bcd0 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/sam/samOperators.fir.txt @@ -0,0 +1,23 @@ +FILE fqName: fileName:/samOperators.kt + FUN name:f visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public open fun get (k: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + k: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CALL 'public open fun get (k: java.lang.Runnable?, m: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + k: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + m: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public open fun set (k: java.lang.Runnable?, v: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + k: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + v: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CALL 'public open fun set (k: java.lang.Runnable?, m: java.lang.Runnable?, v: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + k: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + m: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + v: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + ERROR_CALL 'Unresolved reference: this#' type=IrErrorType + ERROR_CALL 'Unresolved reference: this#' type=IrErrorType diff --git a/compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.fir.txt b/compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.fir.txt new file mode 100644 index 00000000000..ad7657a9f19 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/setFieldWithImplicitCast.fir.txt @@ -0,0 +1,59 @@ +FILE fqName: fileName:/Derived.kt + CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived + CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] + BLOCK_BODY + ERROR_CALL 'Cannot find delegated constructor call' type=.Derived + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.Base]' + FUN name:setValue visibility:public modality:FINAL <> ($this:.Derived, v:kotlin.Any) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Derived + VALUE_PARAMETER name:v index:0 type:kotlin.Any + BLOCK_BODY + WHEN type=kotlin.Unit origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.String + GET_VAR 'v: kotlin.Any declared in .Derived.setValue' type=kotlin.Any origin=null + then: BLOCK type=kotlin.Unit origin=null + ERROR_CALL 'Unresolved reference: R|/Base.value|' type=IrErrorType + FUN FAKE_OVERRIDE name:registerNatives visibility:private modality:OPEN <> ($this:.Object) returnType:kotlin.Unit + overridden: + private open fun registerNatives (): kotlin.Unit declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:getClass visibility:public modality:FINAL <> ($this:.Object) returnType:java.lang.Class<*>? + overridden: + public final fun getClass (): java.lang.Class<*>? declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:.Object) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:.Object, obj:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (obj: kotlin.Any?): kotlin.Boolean declared in .Object + $this: VALUE_PARAMETER name: type:.Object + VALUE_PARAMETER name:obj index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:clone visibility:protected/*protected and package*/ modality:OPEN <> ($this:.Object) returnType:kotlin.Any? + overridden: + protected/*protected and package*/ open fun clone (): kotlin.Any? declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:.Object) returnType:kotlin.String? + overridden: + public open fun toString (): kotlin.String? declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:notify visibility:public modality:FINAL <> ($this:.Object) returnType:kotlin.Unit + overridden: + public final fun notify (): kotlin.Unit declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:notifyAll visibility:public modality:FINAL <> ($this:.Object) returnType:kotlin.Unit + overridden: + public final fun notifyAll (): kotlin.Unit declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:wait visibility:public modality:FINAL <> ($this:.Object, :kotlin.Long) returnType:kotlin.Unit + overridden: + public final fun wait (: kotlin.Long): kotlin.Unit declared in .Object + $this: VALUE_PARAMETER name: type:.Object + VALUE_PARAMETER name: index:0 type:kotlin.Long + FUN FAKE_OVERRIDE name:finalize visibility:protected/*protected and package*/ modality:OPEN <> ($this:.Object) returnType:kotlin.Unit + overridden: + protected/*protected and package*/ open fun finalize (): kotlin.Unit declared in .Object + $this: VALUE_PARAMETER name: type:.Object diff --git a/compiler/testData/ir/irText/expressions/signedToUnsignedConversions_annotation.fir.txt b/compiler/testData/ir/irText/expressions/signedToUnsignedConversions_annotation.fir.txt new file mode 100644 index 00000000000..1cbe8c04053 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/signedToUnsignedConversions_annotation.fir.txt @@ -0,0 +1,17 @@ +FILE fqName:kotlin.internal fileName:/signedToUnsignedConversions_annotation.kt + CLASS ANNOTATION_CLASS name:ImplicitIntegerCoercion modality:FINAL visibility:public superTypes:[kotlin.Annotation] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:kotlin.internal.ImplicitIntegerCoercion + CONSTRUCTOR visibility:public <> () returnType:kotlin.internal.ImplicitIntegerCoercion [primary] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/signedToUnsignedConversions_test.fir.txt b/compiler/testData/ir/irText/expressions/signedToUnsignedConversions_test.fir.txt new file mode 100644 index 00000000000..0193a72e323 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/signedToUnsignedConversions_test.fir.txt @@ -0,0 +1,105 @@ +FILE fqName: fileName:/signedToUnsignedConversions_test.kt + PROPERTY name:IMPLICIT_INT visibility:public modality:FINAL [const,val] + annotations: + CALL 'public constructor () [primary] declared in kotlin.internal.ImplicitIntegerCoercion' type=kotlin.internal.ImplicitIntegerCoercion origin=null + FIELD PROPERTY_BACKING_FIELD name:IMPLICIT_INT type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=255 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:IMPLICIT_INT visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:IMPLICIT_INT type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + PROPERTY name:EXPLICIT_INT visibility:public modality:FINAL [const,val] + annotations: + CALL 'public constructor () [primary] declared in kotlin.internal.ImplicitIntegerCoercion' type=kotlin.internal.ImplicitIntegerCoercion origin=null + FIELD PROPERTY_BACKING_FIELD name:EXPLICIT_INT type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=255 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:EXPLICIT_INT visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:EXPLICIT_INT type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + PROPERTY name:LONG_CONST visibility:public modality:FINAL [const,val] + annotations: + CALL 'public constructor () [primary] declared in kotlin.internal.ImplicitIntegerCoercion' type=kotlin.internal.ImplicitIntegerCoercion origin=null + FIELD PROPERTY_BACKING_FIELD name:LONG_CONST type:kotlin.Long visibility:public [final,static] + EXPRESSION_BODY + CONST Long type=kotlin.Long value=255 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Long + correspondingProperty: PROPERTY name:LONG_CONST visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Long declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:LONG_CONST type:kotlin.Long visibility:public [final,static] ' type=kotlin.Long origin=null + PROPERTY name:NON_CONST visibility:public modality:FINAL [val] + annotations: + CALL 'public constructor () [primary] declared in kotlin.internal.ImplicitIntegerCoercion' type=kotlin.internal.ImplicitIntegerCoercion origin=null + FIELD PROPERTY_BACKING_FIELD name:NON_CONST type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=255 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:NON_CONST visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:NON_CONST type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + PROPERTY name:BIGGER_THAN_UBYTE visibility:public modality:FINAL [const,val] + annotations: + CALL 'public constructor () [primary] declared in kotlin.internal.ImplicitIntegerCoercion' type=kotlin.internal.ImplicitIntegerCoercion origin=null + FIELD PROPERTY_BACKING_FIELD name:BIGGER_THAN_UBYTE type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=256 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:BIGGER_THAN_UBYTE visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:BIGGER_THAN_UBYTE type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + PROPERTY name:UINT_CONST visibility:public modality:FINAL [const,val] + annotations: + CALL 'public constructor () [primary] declared in kotlin.internal.ImplicitIntegerCoercion' type=kotlin.internal.ImplicitIntegerCoercion origin=null + FIELD PROPERTY_BACKING_FIELD name:UINT_CONST type:kotlin.Long visibility:public [final,static] + EXPRESSION_BODY + CONST Long type=kotlin.Long value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Long + correspondingProperty: PROPERTY name:UINT_CONST visibility:public modality:FINAL [const,val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Long declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:UINT_CONST type:kotlin.Long visibility:public [final,static] ' type=kotlin.Long origin=null + FUN name:takeUByte visibility:public modality:FINAL <> (u:kotlin.UByte) returnType:kotlin.Unit + VALUE_PARAMETER name:u index:0 type:kotlin.UByte + BLOCK_BODY + FUN name:takeUShort visibility:public modality:FINAL <> (u:kotlin.UShort) returnType:kotlin.Unit + VALUE_PARAMETER name:u index:0 type:kotlin.UShort + BLOCK_BODY + FUN name:takeUInt visibility:public modality:FINAL <> (u:kotlin.UInt) returnType:kotlin.Unit + VALUE_PARAMETER name:u index:0 type:kotlin.UInt + BLOCK_BODY + FUN name:takeULong visibility:public modality:FINAL <> (u:kotlin.ULong) returnType:kotlin.Unit + VALUE_PARAMETER name:u index:0 type:kotlin.ULong + BLOCK_BODY + FUN name:takeUBytes visibility:public modality:FINAL <> (u:kotlin.UByte) returnType:kotlin.Unit + VALUE_PARAMETER name:u index:0 type:kotlin.UByte + BLOCK_BODY + FUN name:takeLong visibility:public modality:FINAL <> (l:kotlin.Long) returnType:kotlin.Unit + VALUE_PARAMETER name:l index:0 type:kotlin.Long + BLOCK_BODY + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun takeUByte (u: kotlin.UByte): kotlin.Unit declared in ' type=kotlin.Unit origin=null + u: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null + CALL 'public final fun takeUByte (u: kotlin.UByte): kotlin.Unit declared in ' type=kotlin.Unit origin=null + u: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null + CALL 'public final fun takeUShort (u: kotlin.UShort): kotlin.Unit declared in ' type=kotlin.Unit origin=null + u: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null + CALL 'public final fun takeUShort (u: kotlin.UShort): kotlin.Unit declared in ' type=kotlin.Unit origin=null + u: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null + CALL 'public final fun takeUInt (u: kotlin.UInt): kotlin.Unit declared in ' type=kotlin.Unit origin=null + u: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null + CALL 'public final fun takeULong (u: kotlin.ULong): kotlin.Unit declared in ' type=kotlin.Unit origin=null + u: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null + ERROR_CALL 'Cannot bind 3 arguments to takeUBytes call with 1 parameters' type=kotlin.Unit + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null + CONST Long type=kotlin.Long value=42 + CALL 'public final fun takeLong (l: kotlin.Long): kotlin.Unit declared in ' type=kotlin.Unit origin=null + l: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/simpleOperators.fir.txt b/compiler/testData/ir/irText/expressions/simpleOperators.fir.txt new file mode 100644 index 00000000000..8b85d056980 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/simpleOperators.fir.txt @@ -0,0 +1,78 @@ +FILE fqName: fileName:/simpleOperators.kt + FUN name:test1 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:IrErrorType + VALUE_PARAMETER name:a index:0 type:kotlin.Int + VALUE_PARAMETER name:b index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (a: kotlin.Int, b: kotlin.Int): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'b: kotlin.Int declared in .test1' type=kotlin.Int origin=null + FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:IrErrorType + VALUE_PARAMETER name:a index:0 type:kotlin.Int + VALUE_PARAMETER name:b index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (a: kotlin.Int, b: kotlin.Int): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'b: kotlin.Int declared in .test2' type=kotlin.Int origin=null + FUN name:test3 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:IrErrorType + VALUE_PARAMETER name:a index:0 type:kotlin.Int + VALUE_PARAMETER name:b index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (a: kotlin.Int, b: kotlin.Int): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'b: kotlin.Int declared in .test3' type=kotlin.Int origin=null + FUN name:test4 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:IrErrorType + VALUE_PARAMETER name:a index:0 type:kotlin.Int + VALUE_PARAMETER name:b index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (a: kotlin.Int, b: kotlin.Int): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'b: kotlin.Int declared in .test4' type=kotlin.Int origin=null + FUN name:test5 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:IrErrorType + VALUE_PARAMETER name:a index:0 type:kotlin.Int + VALUE_PARAMETER name:b index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5 (a: kotlin.Int, b: kotlin.Int): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'b: kotlin.Int declared in .test5' type=kotlin.Int origin=null + FUN name:test6 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:IrErrorType + VALUE_PARAMETER name:a index:0 type:kotlin.Int + VALUE_PARAMETER name:b index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test6 (a: kotlin.Int, b: kotlin.Int): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'b: kotlin.Int declared in .test6' type=kotlin.Int origin=null + FUN name:test1x visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:IrErrorType + VALUE_PARAMETER name:a index:0 type:kotlin.Int + VALUE_PARAMETER name:b index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1x (a: kotlin.Int, b: kotlin.Int): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'b: kotlin.Int declared in .test1x' type=kotlin.Int origin=null + FUN name:test2x visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:IrErrorType + VALUE_PARAMETER name:a index:0 type:kotlin.Int + VALUE_PARAMETER name:b index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2x (a: kotlin.Int, b: kotlin.Int): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'b: kotlin.Int declared in .test2x' type=kotlin.Int origin=null + FUN name:test3x visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:IrErrorType + VALUE_PARAMETER name:a index:0 type:kotlin.Int + VALUE_PARAMETER name:b index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3x (a: kotlin.Int, b: kotlin.Int): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'b: kotlin.Int declared in .test3x' type=kotlin.Int origin=null + FUN name:test4x visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:IrErrorType + VALUE_PARAMETER name:a index:0 type:kotlin.Int + VALUE_PARAMETER name:b index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4x (a: kotlin.Int, b: kotlin.Int): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'b: kotlin.Int declared in .test4x' type=kotlin.Int origin=null + FUN name:test5x visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:IrErrorType + VALUE_PARAMETER name:a index:0 type:kotlin.Int + VALUE_PARAMETER name:b index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5x (a: kotlin.Int, b: kotlin.Int): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'b: kotlin.Int declared in .test5x' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/simpleUnaryOperators.fir.txt b/compiler/testData/ir/irText/expressions/simpleUnaryOperators.fir.txt new file mode 100644 index 00000000000..f7512de4111 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/simpleUnaryOperators.fir.txt @@ -0,0 +1,34 @@ +FILE fqName: fileName:/simpleUnaryOperators.kt + FUN name:test1 visibility:public modality:FINAL <> (x:kotlin.Int) returnType:IrErrorType + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (x: kotlin.Int): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'x: kotlin.Int declared in .test1' type=kotlin.Int origin=null + FUN name:test2 visibility:public modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST Int type=kotlin.Int value=42 + FUN name:test3 visibility:public modality:FINAL <> (x:kotlin.Int) returnType:IrErrorType + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (x: kotlin.Int): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'x: kotlin.Int declared in .test3' type=kotlin.Int origin=null + FUN name:test4 visibility:public modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST Int type=kotlin.Int value=42 + FUN name:test5 visibility:public modality:FINAL <> (x:kotlin.Boolean) returnType:IrErrorType + VALUE_PARAMETER name:x index:0 type:kotlin.Boolean + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5 (x: kotlin.Boolean): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'x: kotlin.Boolean declared in .test5' type=kotlin.Boolean origin=null + FUN name:test6 visibility:public modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test6 (): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST Boolean type=kotlin.Boolean value=true diff --git a/compiler/testData/ir/irText/expressions/smartCasts.fir.txt b/compiler/testData/ir/irText/expressions/smartCasts.fir.txt new file mode 100644 index 00000000000..5023061551a --- /dev/null +++ b/compiler/testData/ir/irText/expressions/smartCasts.fir.txt @@ -0,0 +1,58 @@ +FILE fqName: fileName:/smartCasts.kt + FUN name:expectsString visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + FUN name:expectsInt visibility:public modality:FINAL <> (i:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + FUN name:overloaded visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.String + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun overloaded (s: kotlin.String): kotlin.String declared in ' + GET_VAR 's: kotlin.String declared in .overloaded' type=kotlin.String origin=null + FUN name:overloaded visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Any + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun overloaded (x: kotlin.Any): kotlin.Any declared in ' + GET_VAR 'x: kotlin.Any declared in .overloaded' type=kotlin.Any origin=null + FUN name:test1 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + WHEN type=kotlin.Unit origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.String + GET_VAR 'x: kotlin.Any declared in .test1' type=kotlin.Any origin=null + then: RETURN type=kotlin.Nothing from='public final fun test1 (x: kotlin.Any): kotlin.Unit declared in ' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CALL 'public final fun expectsString (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null + s: GET_VAR 'x: kotlin.Any declared in .test1' type=kotlin.Any origin=null + CALL 'public final fun expectsInt (i: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null + i: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CALL 'public final fun expectsString (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null + s: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'x: kotlin.Any declared in .test1' type=kotlin.Any origin=null + FUN name:test2 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.String + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + WHEN type=kotlin.String origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.String + GET_VAR 'x: kotlin.Any declared in .test2' type=kotlin.Any origin=null + then: RETURN type=kotlin.Nothing from='public final fun test2 (x: kotlin.Any): kotlin.String declared in ' + CONST String type=kotlin.String value="" + RETURN type=kotlin.Nothing from='public final fun test2 (x: kotlin.Any): kotlin.String declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'x: kotlin.Any declared in .test2' type=kotlin.Any origin=null + FUN name:test3 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.String + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + WHEN type=kotlin.String origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.String + GET_VAR 'x: kotlin.Any declared in .test3' type=kotlin.Any origin=null + then: RETURN type=kotlin.Nothing from='public final fun test3 (x: kotlin.Any): kotlin.String declared in ' + CONST String type=kotlin.String value="" + RETURN type=kotlin.Nothing from='public final fun test3 (x: kotlin.Any): kotlin.String declared in ' + GET_VAR 'x: kotlin.Any declared in .test3' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/expressions/smartCastsWithDestructuring.fir.txt b/compiler/testData/ir/irText/expressions/smartCastsWithDestructuring.fir.txt new file mode 100644 index 00000000000..89c9b517946 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/smartCastsWithDestructuring.fir.txt @@ -0,0 +1,54 @@ +FILE fqName: fileName:/smartCastsWithDestructuring.kt + CLASS INTERFACE name:I1 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I1 + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:I2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I2 + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:component1 visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=1 + FUN name:component2 visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component2 (): kotlin.String declared in ' + CONST String type=kotlin.String value="" + FUN name:test visibility:public modality:FINAL <> (x:.I1) returnType:kotlin.Unit + VALUE_PARAMETER name:x index:0 type:.I1 + BLOCK_BODY + WHEN type=kotlin.Unit origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.I2 + GET_VAR 'x: .I1 declared in .test' type=.I1 origin=null + then: RETURN type=kotlin.Nothing from='public final fun test (x: .I1): kotlin.Unit declared in ' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + VAR name: type:.I1 [val] + GET_VAR 'x: .I1 declared in .test' type=.I1 origin=null + VAR name:c1 type:kotlin.Int [val] + CALL 'public final fun component1 (): kotlin.Int declared in ' type=kotlin.Int origin=null + VAR name:c2 type:kotlin.String [val] + CALL 'public final fun component2 (): kotlin.String declared in ' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.fir.txt b/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.fir.txt new file mode 100644 index 00000000000..e9a03c3abc3 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.fir.txt @@ -0,0 +1,38 @@ +FILE fqName: fileName:/specializedTypeAliasConstructorCall.kt + CLASS CLASS name:Cell modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Cell + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> (value:T of .Cell) returnType:.Cell.Cell> [primary] + VALUE_PARAMETER name:value index:0 type:T of .Cell + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Cell modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:T of .Cell visibility:public [final] + EXPRESSION_BODY + GET_VAR 'value: T of .Cell declared in .Cell.' type=T of .Cell origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Cell) returnType:T of .Cell + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Cell + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of .Cell declared in .Cell' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Cell visibility:public [final] ' type=T of .Cell origin=null + receiver: GET_VAR ': .Cell declared in .Cell.' type=.Cell origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test (): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST Int type=kotlin.Int value=42 diff --git a/compiler/testData/ir/irText/expressions/stringComparisons.fir.txt b/compiler/testData/ir/irText/expressions/stringComparisons.fir.txt new file mode 100644 index 00000000000..c2b5f66e84b --- /dev/null +++ b/compiler/testData/ir/irText/expressions/stringComparisons.fir.txt @@ -0,0 +1,25 @@ +FILE fqName: fileName:/stringComparisons.kt + FUN name:test1 visibility:public modality:FINAL <> (a:kotlin.String, b:kotlin.String) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.String + VALUE_PARAMETER name:b index:1 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (a: kotlin.String, b: kotlin.String): kotlin.Boolean declared in ' + ERROR_CALL 'Comparison of arguments with unsupported type: kotlin/String' type=kotlin.Boolean + FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.String, b:kotlin.String) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.String + VALUE_PARAMETER name:b index:1 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (a: kotlin.String, b: kotlin.String): kotlin.Boolean declared in ' + ERROR_CALL 'Comparison of arguments with unsupported type: kotlin/String' type=kotlin.Boolean + FUN name:test3 visibility:public modality:FINAL <> (a:kotlin.String, b:kotlin.String) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.String + VALUE_PARAMETER name:b index:1 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (a: kotlin.String, b: kotlin.String): kotlin.Boolean declared in ' + ERROR_CALL 'Comparison of arguments with unsupported type: kotlin/String' type=kotlin.Boolean + FUN name:test4 visibility:public modality:FINAL <> (a:kotlin.String, b:kotlin.String) returnType:kotlin.Boolean + VALUE_PARAMETER name:a index:0 type:kotlin.String + VALUE_PARAMETER name:b index:1 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (a: kotlin.String, b: kotlin.String): kotlin.Boolean declared in ' + ERROR_CALL 'Comparison of arguments with unsupported type: kotlin/String' type=kotlin.Boolean diff --git a/compiler/testData/ir/irText/expressions/stringPlus.fir.txt b/compiler/testData/ir/irText/expressions/stringPlus.fir.txt new file mode 100644 index 00000000000..d6994608d30 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/stringPlus.fir.txt @@ -0,0 +1,22 @@ +FILE fqName: fileName:/stringPlus.kt + FUN name:test1 visibility:public modality:FINAL <> (a:kotlin.String, b:kotlin.Any) returnType:kotlin.String + VALUE_PARAMETER name:a index:0 type:kotlin.String + VALUE_PARAMETER name:b index:1 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (a: kotlin.String, b: kotlin.Any): kotlin.String declared in ' + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + other: GET_VAR 'b: kotlin.Any declared in .test1' type=kotlin.Any origin=null + FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.String, b:kotlin.Int) returnType:kotlin.String + VALUE_PARAMETER name:a index:0 type:kotlin.String + VALUE_PARAMETER name:b index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (a: kotlin.String, b: kotlin.Int): kotlin.String declared in ' + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + other: GET_VAR 'b: kotlin.Int declared in .test2' type=kotlin.Int origin=null + FUN name:test3 visibility:public modality:FINAL <> (a:kotlin.String, b:kotlin.Int) returnType:kotlin.String + VALUE_PARAMETER name:a index:0 type:kotlin.String + VALUE_PARAMETER name:b index:1 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (a: kotlin.String, b: kotlin.Int): kotlin.String declared in ' + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + other: GET_VAR 'a: kotlin.String declared in .test3' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/expressions/stringTemplates.fir.txt b/compiler/testData/ir/irText/expressions/stringTemplates.fir.txt new file mode 100644 index 00000000000..c9a6a540f83 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/stringTemplates.fir.txt @@ -0,0 +1,96 @@ +FILE fqName: fileName:/stringTemplates.kt + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in ' + CONST String type=kotlin.String value="" + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + PROPERTY name:test1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CONST String type=kotlin.String value="" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + PROPERTY name:test2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CONST String type=kotlin.String value="abc" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + PROPERTY name:test3 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CONST String type=kotlin.String value="" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + PROPERTY name:test4 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CONST String type=kotlin.String value="abc" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + PROPERTY name:test5 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CONST String type=kotlin.String value="\nabc\n" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:test5 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + PROPERTY name:test6 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test6 type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + other: CALL 'public final fun foo (): kotlin.String declared in ' type=kotlin.String origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:test6 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test6 type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + PROPERTY name:test7 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test7 type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:test7 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test7 type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + PROPERTY name:test8 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test8 type:kotlin.String visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun foo (): kotlin.String declared in ' type=kotlin.String origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:test8 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test8 type:kotlin.String visibility:public [final,static] ' type=kotlin.String origin=null + PROPERTY name:test9 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test9 type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:test9 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test9 type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt new file mode 100644 index 00000000000..80c422b3bc5 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt @@ -0,0 +1,79 @@ +FILE fqName: fileName:/temporaryInEnumEntryInitializer.kt + PROPERTY name:n visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:n type:kotlin.Any? visibility:public [final,static] + EXPRESSION_BODY + CONST Null type=kotlin.Nothing? value=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Any? + correspondingProperty: PROPERTY name:n visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any? declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:n type:kotlin.Any? visibility:public [final,static] ' type=kotlin.Any? origin=null + CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.En + CONSTRUCTOR visibility:private <> (x:kotlin.String?) returnType:.En [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String? + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String? visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.String? declared in .En.' type=kotlin.String? origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.En) returnType:kotlin.String? + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.En + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String? declared in .En' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String? visibility:public [final] ' type=kotlin.String? origin=null + receiver: GET_VAR ': .En declared in .En.' type=.En origin=null + CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:public superTypes:[.En] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.En.ENTRY + CONSTRUCTOR visibility:public <> () returnType:.En.ENTRY [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.String?) [primary] declared in .En' + x: CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:public superTypes:[.En]' + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum diff --git a/compiler/testData/ir/irText/expressions/temporaryInInitBlock.fir.txt b/compiler/testData/ir/irText/expressions/temporaryInInitBlock.fir.txt new file mode 100644 index 00000000000..07e7e625cea --- /dev/null +++ b/compiler/testData/ir/irText/expressions/temporaryInInitBlock.fir.txt @@ -0,0 +1,34 @@ +FILE fqName: fileName:/temporaryInInitBlock.kt + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> (x:kotlin.Any?) returnType:.C [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Any? + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:s visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String? visibility:public [final] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.String? + correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String? declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String? visibility:public [final] ' type=kotlin.String? origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String? visibility:public [final] ' type=kotlin.String? origin=null + value: CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.txt b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.txt new file mode 100644 index 00000000000..7bd41ed29be --- /dev/null +++ b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.txt @@ -0,0 +1,88 @@ +FILE fqName: fileName:/thisOfGenericOuterClass.kt + CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> (x:T of .Outer) returnType:.Outer.Outer> [primary] + VALUE_PARAMETER name:x index:0 type:T of .Outer + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:T of .Outer visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: T of .Outer declared in .Outer.' type=T of .Outer origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Outer) returnType:T of .Outer + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Outer + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of .Outer declared in .Outer' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Outer visibility:public [final] ' type=T of .Outer origin=null + receiver: GET_VAR ': .Outer declared in .Outer.' type=.Outer origin=null + CLASS CLASS name:Inner modality:OPEN visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner + CONSTRUCTOR visibility:public <> (y:kotlin.Int) returnType:.Outer.Inner [primary] + VALUE_PARAMETER name:y index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:OPEN visibility:public [inner] superTypes:[kotlin.Any]' + PROPERTY name:y visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'y: kotlin.Int declared in .Outer.Inner.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Outer.Inner) returnType:kotlin.Int + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Outer.Inner + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Outer.Inner' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .Outer.Inner declared in .Outer.Inner.' type=.Outer.Inner origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test (): IrErrorType declared in ' + BLOCK type=.test. origin=OBJECT_LITERAL + CLASS OBJECT name: modality:FINAL visibility:local superTypes:[.Outer.Inner] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.test. + CONSTRUCTOR visibility:private <> () returnType:IrErrorType [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (y: kotlin.Int) [primary] declared in .Outer.Inner' + y: CONST Int type=IrErrorType value=42 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name: modality:FINAL visibility:local superTypes:[.Outer.Inner]' + PROPERTY name:xx visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:xx type:kotlin.String visibility:public [final] + EXPRESSION_BODY + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin' type=kotlin.String origin=null + other: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.test.) returnType:kotlin.String + correspondingProperty: PROPERTY name:xx visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.test. + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .test.' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xx type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null + receiver: GET_VAR ': .test. declared in .test..' type=.test. origin=null + CALL 'private constructor () [primary] declared in .test.' type=.test. origin=null diff --git a/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.fir.txt b/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.fir.txt new file mode 100644 index 00000000000..00e85f24b7f --- /dev/null +++ b/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.fir.txt @@ -0,0 +1,67 @@ +FILE fqName: fileName:/thisReferenceBeforeClassDeclared.kt + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:test1 type:IrErrorType [val] + BLOCK type=.test. origin=OBJECT_LITERAL + CLASS OBJECT name: modality:FINAL visibility:local superTypes:[.WithCompanion] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.test. + CONSTRUCTOR visibility:private <> () returnType:IrErrorType [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (a: .WithCompanion.Companion) [primary] declared in .WithCompanion' + a: ERROR_CALL 'Unresolved reference: this#' type=.WithCompanion + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name: modality:FINAL visibility:local superTypes:[.WithCompanion]' + CALL 'private constructor () [primary] declared in .test.' type=.test. origin=null + VAR name:test2 type:IrErrorType [val] + BLOCK type=.test. origin=OBJECT_LITERAL + CLASS OBJECT name: modality:FINAL visibility:local superTypes:[.WithCompanion] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.test. + CONSTRUCTOR visibility:private <> () returnType:IrErrorType [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (a: .WithCompanion.Companion) [primary] declared in .WithCompanion' + a: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name: modality:FINAL visibility:local superTypes:[.WithCompanion]' + CALL 'private constructor () [primary] declared in .test.' type=.test. origin=null + CLASS CLASS name:WithCompanion modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.WithCompanion + CONSTRUCTOR visibility:public <> (a:.WithCompanion.Companion) returnType:.WithCompanion [primary] + VALUE_PARAMETER name:a index:0 type:.WithCompanion.Companion + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:WithCompanion modality:OPEN visibility:public superTypes:[kotlin.Any]' + CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.WithCompanion.Companion + CONSTRUCTOR visibility:private <> () returnType:.WithCompanion.Companion [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL <> ($this:.WithCompanion.Companion) returnType:.WithCompanion.Companion + $this: VALUE_PARAMETER name: type:.WithCompanion.Companion + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): .WithCompanion.Companion declared in .WithCompanion.Companion' + ERROR_CALL 'Unresolved reference: this#' type=.WithCompanion.Companion + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/throw.fir.txt b/compiler/testData/ir/irText/expressions/throw.fir.txt new file mode 100644 index 00000000000..eaa20039994 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/throw.fir.txt @@ -0,0 +1,14 @@ +FILE fqName: fileName:/throw.kt + FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + THROW type=kotlin.Nothing + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN name:testImplicitCast visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Any + BLOCK_BODY + WHEN type=kotlin.Unit origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Throwable + GET_VAR 'a: kotlin.Any declared in .testImplicitCast' type=kotlin.Any origin=null + then: THROW type=kotlin.Nothing + GET_VAR 'a: kotlin.Any declared in .testImplicitCast' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/expressions/tryCatch.fir.txt b/compiler/testData/ir/irText/expressions/tryCatch.fir.txt new file mode 100644 index 00000000000..079070b16f8 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/tryCatch.fir.txt @@ -0,0 +1,24 @@ +FILE fqName: fileName:/tryCatch.kt + FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + TRY type=IrErrorType + try: CALL 'public final fun println (): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null + CATCH parameter=val e: kotlin.Throwable [val] declared in .test1 + VAR name:e type:kotlin.Throwable [val] + CALL 'public final fun println (): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null + finally: CALL 'public final fun println (): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null + FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (): kotlin.Int declared in ' + TRY type=IrErrorType + try: BLOCK type=kotlin.Int origin=null + CALL 'public final fun println (): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null + CONST Int type=kotlin.Int value=42 + CATCH parameter=val e: kotlin.Throwable [val] declared in .test2 + VAR name:e type:kotlin.Throwable [val] + BLOCK type=kotlin.Int origin=null + CALL 'public final fun println (): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null + CONST Int type=kotlin.Int value=24 + finally: BLOCK type=kotlin.Int origin=null + CALL 'public final fun println (): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null + CONST Int type=kotlin.Int value=555 diff --git a/compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.fir.txt b/compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.fir.txt new file mode 100644 index 00000000000..e05983c615b --- /dev/null +++ b/compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.fir.txt @@ -0,0 +1,16 @@ +FILE fqName: fileName:/tryCatchWithImplicitCast.kt + FUN name:testImplicitCast visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:kotlin.Any + BLOCK_BODY + WHEN type=kotlin.Unit origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.String + GET_VAR 'a: kotlin.Any declared in .testImplicitCast' type=kotlin.Any origin=null + then: RETURN type=kotlin.Nothing from='public final fun testImplicitCast (a: kotlin.Any): kotlin.Unit declared in ' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + VAR name:t type:kotlin.String [val] + TRY type=IrErrorType + try: GET_VAR 'a: kotlin.Any declared in .testImplicitCast' type=kotlin.Any origin=null + CATCH parameter=val e: kotlin.Throwable [val] declared in .testImplicitCast + VAR name:e type:kotlin.Throwable [val] + CONST String type=kotlin.String value="" diff --git a/compiler/testData/ir/irText/expressions/typeArguments.fir.txt b/compiler/testData/ir/irText/expressions/typeArguments.fir.txt new file mode 100644 index 00000000000..403ba68b1cd --- /dev/null +++ b/compiler/testData/ir/irText/expressions/typeArguments.fir.txt @@ -0,0 +1,13 @@ +FILE fqName: fileName:/typeArguments.kt + FUN name:test1 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (x: kotlin.Any): kotlin.Boolean declared in ' + WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Array<*> + GET_VAR 'x: kotlin.Any declared in .test1' type=kotlin.Any origin=null + then: CALL 'public final fun isArrayOf (): kotlin.Boolean declared in kotlin.jvm' type=kotlin.Boolean origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false diff --git a/compiler/testData/ir/irText/expressions/typeOperators.kt b/compiler/testData/ir/irText/expressions/typeOperators.kt index cc1d67f214d..eac8843928e 100644 --- a/compiler/testData/ir/irText/expressions/typeOperators.kt +++ b/compiler/testData/ir/irText/expressions/typeOperators.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL + interface IThing fun test1(x: Any) = x is IThing diff --git a/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.fir.txt b/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.fir.txt new file mode 100644 index 00000000000..2e9b66dda83 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.fir.txt @@ -0,0 +1,61 @@ +FILE fqName: fileName:/typeParameterClassLiteral.kt + FUN name:classRefFun visibility:public modality:FINAL () returnType:IrErrorType [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun classRefFun (): IrErrorType [inline] declared in ' + GET_CLASS type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN name:classRefExtFun visibility:public modality:FINAL () returnType:IrErrorType [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun classRefExtFun (): IrErrorType [inline] declared in ' + GET_CLASS type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + PROPERTY name:classRefExtVal visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:classRefExtVal visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_CLASS type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host + CONSTRUCTOR visibility:public <> () returnType:.Host [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:classRefGenericMemberFun visibility:public modality:FINAL ($this:.Host) returnType:IrErrorType [inline] + TYPE_PARAMETER name:TF index:0 variance: superTypes:[] + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun classRefGenericMemberFun (): IrErrorType [inline] declared in .Host' + GET_CLASS type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN name:classRefGenericMemberExtFun visibility:public modality:FINAL ($this:.Host) returnType:IrErrorType [inline] + TYPE_PARAMETER name:TF index:0 variance: superTypes:[] + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun classRefGenericMemberExtFun (): IrErrorType [inline] declared in .Host' + GET_CLASS type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + PROPERTY name:classRefGenericMemberExtVal visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.Host) returnType:IrErrorType + correspondingProperty: PROPERTY name:classRefGenericMemberExtVal visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Host + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .Host' + GET_CLASS type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/unsignedIntegerLiterals.fir.txt b/compiler/testData/ir/irText/expressions/unsignedIntegerLiterals.fir.txt new file mode 100644 index 00000000000..56e1066e2a1 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/unsignedIntegerLiterals.fir.txt @@ -0,0 +1,91 @@ +FILE fqName: fileName:/unsignedIntegerLiterals.kt + PROPERTY name:testSimpleUIntLiteral visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:testSimpleUIntLiteral type:kotlin.Long visibility:public [final,static] + EXPRESSION_BODY + CONST Long type=kotlin.Long value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Long + correspondingProperty: PROPERTY name:testSimpleUIntLiteral visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Long declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testSimpleUIntLiteral type:kotlin.Long visibility:public [final,static] ' type=kotlin.Long origin=null + PROPERTY name:testSimpleUIntLiteralWithOverflow visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:testSimpleUIntLiteralWithOverflow type:kotlin.Long visibility:public [final,static] + EXPRESSION_BODY + CONST Long type=kotlin.Long value=4294967295 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Long + correspondingProperty: PROPERTY name:testSimpleUIntLiteralWithOverflow visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Long declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testSimpleUIntLiteralWithOverflow type:kotlin.Long visibility:public [final,static] ' type=kotlin.Long origin=null + PROPERTY name:testUByteWithExpectedType visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:testUByteWithExpectedType type:kotlin.UByte visibility:public [final,static] + EXPRESSION_BODY + CONST Long type=kotlin.UByte value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.UByte + correspondingProperty: PROPERTY name:testUByteWithExpectedType visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.UByte declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testUByteWithExpectedType type:kotlin.UByte visibility:public [final,static] ' type=kotlin.UByte origin=null + PROPERTY name:testUShortWithExpectedType visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:testUShortWithExpectedType type:kotlin.UShort visibility:public [final,static] + EXPRESSION_BODY + CONST Long type=kotlin.UShort value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.UShort + correspondingProperty: PROPERTY name:testUShortWithExpectedType visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.UShort declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testUShortWithExpectedType type:kotlin.UShort visibility:public [final,static] ' type=kotlin.UShort origin=null + PROPERTY name:testUIntWithExpectedType visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:testUIntWithExpectedType type:kotlin.UInt visibility:public [final,static] + EXPRESSION_BODY + CONST Long type=kotlin.UInt value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.UInt + correspondingProperty: PROPERTY name:testUIntWithExpectedType visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.UInt declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testUIntWithExpectedType type:kotlin.UInt visibility:public [final,static] ' type=kotlin.UInt origin=null + PROPERTY name:testULongWithExpectedType visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:testULongWithExpectedType type:kotlin.ULong visibility:public [final,static] + EXPRESSION_BODY + CONST Long type=kotlin.ULong value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.ULong + correspondingProperty: PROPERTY name:testULongWithExpectedType visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.ULong declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testULongWithExpectedType type:kotlin.ULong visibility:public [final,static] ' type=kotlin.ULong origin=null + PROPERTY name:testToUByte visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:testToUByte type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:testToUByte visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testToUByte type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:testToUShort visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:testToUShort type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:testToUShort visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testToUShort type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:testToUInt visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:testToUInt type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:testToUInt visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testToUInt type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:testToULong visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:testToULong type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:testToULong visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testToULong type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt b/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt new file mode 100644 index 00000000000..e4b6ef66b43 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt @@ -0,0 +1,239 @@ +FILE fqName: fileName:/useImportedMember.kt + CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I + TYPE_PARAMETER name:G index:0 variance: superTypes:[] + FUN name:fromInterface visibility:public modality:OPEN ($this:.I) returnType:T of .I.fromInterface + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + $this: VALUE_PARAMETER name: type:.I + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun fromInterface (): T of .I.fromInterface declared in .I' + ERROR_CALL 'Unresolved reference: this#' type=T of .I.fromInterface + FUN name:genericFromSuper visibility:public modality:OPEN <> ($this:.I, g:G of .I) returnType:G of .I + $this: VALUE_PARAMETER name: type:.I + VALUE_PARAMETER name:g index:0 type:G of .I + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun genericFromSuper (g: G of .I): G of .I declared in .I' + GET_VAR 'g: G of .I declared in .I.genericFromSuper' type=G of .I origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:BaseClass modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BaseClass + CONSTRUCTOR visibility:public <> () returnType:.BaseClass [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:BaseClass modality:OPEN visibility:public superTypes:[kotlin.Any]' + PROPERTY name:fromClass visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.BaseClass) returnType:T of + correspondingProperty: PROPERTY name:fromClass visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.BaseClass + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of declared in .BaseClass' + ERROR_CALL 'Unresolved reference: this#' type=.BaseClass + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS OBJECT name:C modality:FINAL visibility:public superTypes:[.BaseClass; .I] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:private <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .BaseClass' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:C modality:FINAL visibility:public superTypes:[.BaseClass; .I]' + FUN name:f visibility:public modality:FINAL <> ($this:.C, s:kotlin.Int) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:s index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun f (s: kotlin.Int): kotlin.Int declared in .C' + CONST Int type=kotlin.Int value=1 + FUN name:f visibility:public modality:FINAL <> ($this:.C, s:kotlin.String) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:s index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun f (s: kotlin.String): kotlin.Int declared in .C' + CONST Int type=kotlin.Int value=2 + FUN name:f visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun f (): kotlin.Int declared in .C' + CONST Int type=kotlin.Int value=3 + PROPERTY name:p visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public + EXPRESSION_BODY + CONST Int type=kotlin.Int value=4 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .C declared in .C.' type=.C origin=null + value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null + PROPERTY name:ext visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + correspondingProperty: PROPERTY name:ext visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + CONST Int type=kotlin.Int value=6 + FUN name:g1 visibility:public modality:FINAL ($this:.C, t:T of .C.g1) returnType:T of .C.g1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + $this: VALUE_PARAMETER name: type:.C + VALUE_PARAMETER name:t index:0 type:T of .C.g1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun g1 (t: T of .C.g1): T of .C.g1 declared in .C' + GET_VAR 't: T of .C.g1 declared in .C.g1' type=T of .C.g1 origin=null + PROPERTY name:g2 visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.C) returnType:T of + correspondingProperty: PROPERTY name:g2 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of declared in .C' + ERROR_CALL 'Unresolved reference: this#' type=.C + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:fromInterface visibility:public modality:OPEN <> ($this:.I) returnType:T of .I.fromInterface + overridden: + public open fun fromInterface (): T of .I.fromInterface declared in .I + $this: VALUE_PARAMETER name: type:.I + FUN FAKE_OVERRIDE name:genericFromSuper visibility:public modality:OPEN <> ($this:.I, g:kotlin.String) returnType:kotlin.String + overridden: + public open fun genericFromSuper (g: G of .I): G of .I declared in .I + $this: VALUE_PARAMETER name: type:.I + VALUE_PARAMETER name:g index:0 type:kotlin.String + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + WHEN type=kotlin.String origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST Int type=kotlin.Int value=1 + arg1: CONST Int type=kotlin.String value=1 + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="1" + WHEN type=kotlin.String origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="s" + arg1: CONST Int type=kotlin.String value=2 + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="2" + WHEN type=kotlin.String origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'public final fun f (): kotlin.Int declared in .C' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.String value=3 + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="3" + WHEN type=kotlin.String origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.String value=4 + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="4" + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public ' type=kotlin.Int origin=null + value: CONST Int type=kotlin.Int value=5 + WHEN type=kotlin.String origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.String value=5 + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="5" + WHEN type=kotlin.String origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.String value=6 + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="6" + WHEN type=kotlin.String origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'public final fun g1 (t: T of .C.g1): T of .C.g1 declared in .C' type=T of .C.g1 origin=null + : + t: CONST String type=kotlin.String value="7" + arg1: CONST String type=kotlin.String value="7" + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="7" + WHEN type=kotlin.String origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'public final fun (): T of declared in .C' type=T of origin=null + arg1: CONST String type=kotlin.String value="8" + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="8" + WHEN type=kotlin.String origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + arg1: CONST Int type=kotlin.String value=9 + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="9" + WHEN type=kotlin.String origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + arg1: CONST String type=kotlin.String value="10" + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="10" + WHEN type=kotlin.String origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="11" + arg1: CONST String type=kotlin.String value="11" + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="11" + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="OK" diff --git a/compiler/testData/ir/irText/expressions/values.fir.txt b/compiler/testData/ir/irText/expressions/values.fir.txt new file mode 100644 index 00000000000..cf0f2ebd25d --- /dev/null +++ b/compiler/testData/ir/irText/expressions/values.fir.txt @@ -0,0 +1,130 @@ +FILE fqName: fileName:/values.kt + CLASS ENUM_CLASS name:Enum modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Enum + CONSTRUCTOR visibility:private <> () returnType:.Enum [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Enum modality:FINAL visibility:public superTypes:[kotlin.Enum]' + CLASS ENUM_ENTRY name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Enum.A + CONSTRUCTOR visibility:public <> () returnType:.Enum.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:private <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:a visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.Int visibility:public [final,static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.Int visibility:public [final,static] ' type=kotlin.Int origin=null + CLASS CLASS name:Z modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z + CONSTRUCTOR visibility:public <> () returnType:.Z [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' + CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.Companion + CONSTRUCTOR visibility:private <> () returnType:.Z.Companion [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN name:test2 visibility:public modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (): kotlin.Int declared in ' + CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null + FUN name:test4 visibility:public modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType diff --git a/compiler/testData/ir/irText/expressions/vararg.fir.txt b/compiler/testData/ir/irText/expressions/vararg.fir.txt new file mode 100644 index 00000000000..0228db3e7fe --- /dev/null +++ b/compiler/testData/ir/irText/expressions/vararg.fir.txt @@ -0,0 +1,35 @@ +FILE fqName: fileName:/vararg.kt + PROPERTY name:test1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Array> visibility:public [final,static] + EXPRESSION_BODY + CALL 'public final fun arrayOf (elements: kotlin.Array>): kotlin.Array> [inline] declared in kotlin' type=kotlin.Array> origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Array> + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array> declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Array> visibility:public [final,static] ' type=kotlin.Array> origin=null + PROPERTY name:test2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Array> visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Cannot bind 3 arguments to arrayOf call with 1 parameters' type=kotlin.Array> + CONST String type=kotlin.String value="1" + CONST String type=kotlin.String value="2" + CONST String type=kotlin.String value="3" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Array> + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array> declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Array> visibility:public [final,static] ' type=kotlin.Array> origin=null + PROPERTY name:test3 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Array> visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Cannot bind 4 arguments to arrayOf call with 1 parameters' type=kotlin.Array> + CONST String type=kotlin.String value="0" + CALL 'public final fun (): kotlin.Array> declared in ' type=kotlin.Array> origin=null + CALL 'public final fun (): kotlin.Array> declared in ' type=kotlin.Array> origin=null + CONST String type=kotlin.String value="4" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Array> + correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array> declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Array> visibility:public [final,static] ' type=kotlin.Array> origin=null diff --git a/compiler/testData/ir/irText/expressions/varargWithImplicitCast.fir.txt b/compiler/testData/ir/irText/expressions/varargWithImplicitCast.fir.txt new file mode 100644 index 00000000000..0b8917e398e --- /dev/null +++ b/compiler/testData/ir/irText/expressions/varargWithImplicitCast.fir.txt @@ -0,0 +1,25 @@ +FILE fqName: fileName:/varargWithImplicitCast.kt + FUN name:testScalar visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.IntArray + VALUE_PARAMETER name:a index:0 type:kotlin.Any + BLOCK_BODY + WHEN type=kotlin.IntArray origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Int + GET_VAR 'a: kotlin.Any declared in .testScalar' type=kotlin.Any origin=null + then: RETURN type=kotlin.Nothing from='public final fun testScalar (a: kotlin.Any): kotlin.IntArray declared in ' + CALL 'public final fun intArrayOf (elements: kotlin.IntArray): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null + RETURN type=kotlin.Nothing from='public final fun testScalar (a: kotlin.Any): kotlin.IntArray declared in ' + CALL 'public final fun intArrayOf (elements: kotlin.IntArray): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null + elements: GET_VAR 'a: kotlin.Any declared in .testScalar' type=kotlin.Any origin=null + FUN name:testSpread visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.IntArray + VALUE_PARAMETER name:a index:0 type:kotlin.Any + BLOCK_BODY + WHEN type=kotlin.IntArray origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.IntArray + GET_VAR 'a: kotlin.Any declared in .testSpread' type=kotlin.Any origin=null + then: RETURN type=kotlin.Nothing from='public final fun testSpread (a: kotlin.Any): kotlin.IntArray declared in ' + CALL 'public final fun intArrayOf (elements: kotlin.IntArray): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null + RETURN type=kotlin.Nothing from='public final fun testSpread (a: kotlin.Any): kotlin.IntArray declared in ' + CALL 'public final fun intArrayOf (elements: kotlin.IntArray): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null + elements: GET_VAR 'a: kotlin.Any declared in .testSpread' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt new file mode 100644 index 00000000000..371a50a4c21 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt @@ -0,0 +1,30 @@ +FILE fqName: fileName:/variableAsFunctionCall.kt + FUN name:k visibility:public modality:FINAL <> () returnType:kotlin.Function0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun k (): kotlin.Function0 declared in ' + BLOCK type=kotlin.Function0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Function0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Function0 declared in .k' + ERROR_CALL 'Unresolved reference: this#' type=kotlin.String + FUNCTION_REFERENCE 'local final fun (): kotlin.Function0 declared in .k' type=kotlin.Function0 origin=LAMBDA + FUN name:test1 visibility:public modality:FINAL <> (f:kotlin.Function0) returnType:IrErrorType + VALUE_PARAMETER name:f index:0 type:kotlin.Function0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (f: kotlin.Function0): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN name:test2 visibility:public modality:FINAL <> (f:kotlin.Function1) returnType:IrErrorType + VALUE_PARAMETER name:f index:0 type:kotlin.Function1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (f: kotlin.Function1): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN name:test3 visibility:public modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CALL 'public final fun k (): kotlin.Function0 declared in ' type=kotlin.Function0 origin=null + FUN name:test4 visibility:public modality:FINAL <> (ns:kotlin.String?) returnType:IrErrorType + VALUE_PARAMETER name:ns index:0 type:kotlin.String? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (ns: kotlin.String?): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType diff --git a/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.fir.txt b/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.fir.txt new file mode 100644 index 00000000000..82a588c82e8 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.fir.txt @@ -0,0 +1,32 @@ +FILE fqName: fileName:/variableAsFunctionCallWithGenerics.kt + PROPERTY name:gk visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Function0 + correspondingProperty: PROPERTY name:gk visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function0 declared in ' + BLOCK type=kotlin.Function0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Function0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Function0 declared in .' + ERROR_CALL 'Unresolved reference: this#' type=IrErrorType + FUNCTION_REFERENCE 'local final fun (): kotlin.Function0 declared in .' type=kotlin.Function0 origin=LAMBDA + FUN name:testGeneric1 visibility:public modality:FINAL <> (x:kotlin.String) returnType:IrErrorType + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testGeneric1 (x: kotlin.String): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + PROPERTY name:kt26531Val visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Function0 + correspondingProperty: PROPERTY name:kt26531Val visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function0 declared in ' + BLOCK type=kotlin.Function0 origin=ANONYMOUS_FUNCTION + FUN name: visibility:local modality:FINAL <> () returnType:kotlin.Function0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Function0 declared in .' + ERROR_CALL 'Unresolved reference: this#' type=IrErrorType + FUNCTION_REFERENCE 'local final fun (): kotlin.Function0 declared in .' type=kotlin.Function0 origin=ANONYMOUS_FUNCTION + FUN name:kt26531 visibility:public modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun kt26531 (): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType diff --git a/compiler/testData/ir/irText/expressions/when.fir.txt b/compiler/testData/ir/irText/expressions/when.fir.txt new file mode 100644 index 00000000000..f4e6c42e3f6 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/when.fir.txt @@ -0,0 +1,155 @@ +FILE fqName: fileName:/when.kt + CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:private <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:testWithSubject visibility:public modality:FINAL <> (x:kotlin.Any?) returnType:kotlin.String + VALUE_PARAMETER name:x index:0 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testWithSubject (x: kotlin.Any?): kotlin.String declared in ' + BLOCK type=kotlin.String origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp0_subject type:kotlin.Any? [val] + WHEN type=kotlin.String origin=WHEN + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp0_subject: kotlin.Any? [val] declared in .testWithSubject' type=kotlin.Any? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST String type=kotlin.String value="null" + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp0_subject: kotlin.Any? [val] declared in .testWithSubject' type=kotlin.Any? origin=null + arg1: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + then: CONST String type=kotlin.String value="A" + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.String + GET_VAR 'val tmp0_subject: kotlin.Any? [val] declared in .testWithSubject' type=kotlin.Any? origin=null + then: CONST String type=kotlin.String value="String" + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Number + GET_VAR 'val tmp0_subject: kotlin.Any? [val] declared in .testWithSubject' type=kotlin.Any? origin=null + then: CONST String type=kotlin.String value="!Number" + BRANCH + if: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val tmp0_subject: kotlin.Any? [val] declared in .testWithSubject' type=kotlin.Any? origin=null + then: CONST String type=kotlin.String value="nothingness?" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST String type=kotlin.String value="something" + FUN name:test visibility:public modality:FINAL <> (x:kotlin.Any?) returnType:kotlin.String + VALUE_PARAMETER name:x index:0 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test (x: kotlin.Any?): kotlin.String declared in ' + WHEN type=kotlin.String origin=WHEN + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Any? declared in .test' type=kotlin.Any? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST String type=kotlin.String value="null" + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'x: kotlin.Any? declared in .test' type=kotlin.Any? origin=null + arg1: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + then: CONST String type=kotlin.String value="A" + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.String + GET_VAR 'x: kotlin.Any? declared in .test' type=kotlin.Any? origin=null + then: CONST String type=kotlin.String value="String" + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Number + GET_VAR 'x: kotlin.Any? declared in .test' type=kotlin.Any? origin=null + then: CONST String type=kotlin.String value="!Number" + BRANCH + if: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'x: kotlin.Any? declared in .test' type=kotlin.Any? origin=null + then: CONST String type=kotlin.String value="nothingness?" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST String type=kotlin.String value="something" + FUN name:testComma visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.String + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testComma (x: kotlin.Int): kotlin.String declared in ' + BLOCK type=kotlin.String origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp1_subject type:kotlin.Int [val] + WHEN type=kotlin.String origin=WHEN + BRANCH + if: WHEN type=kotlin.Boolean origin=null + BRANCH + if: WHEN type=kotlin.Boolean origin=null + BRANCH + if: WHEN type=kotlin.Boolean origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp1_subject: kotlin.Int [val] declared in .testComma' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.String value=1 + then: CONST Boolean type=kotlin.Boolean value=true + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp1_subject: kotlin.Int [val] declared in .testComma' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.String value=2 + then: CONST Boolean type=kotlin.Boolean value=true + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp1_subject: kotlin.Int [val] declared in .testComma' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.String value=3 + then: CONST Boolean type=kotlin.Boolean value=true + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp1_subject: kotlin.Int [val] declared in .testComma' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.String value=4 + then: CONST String type=kotlin.String value="1234" + BRANCH + if: WHEN type=kotlin.Boolean origin=null + BRANCH + if: WHEN type=kotlin.Boolean origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp1_subject: kotlin.Int [val] declared in .testComma' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.String value=5 + then: CONST Boolean type=kotlin.Boolean value=true + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp1_subject: kotlin.Int [val] declared in .testComma' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.String value=6 + then: CONST Boolean type=kotlin.Boolean value=true + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp1_subject: kotlin.Int [val] declared in .testComma' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.String value=7 + then: CONST String type=kotlin.String value="567" + BRANCH + if: WHEN type=kotlin.Boolean origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp1_subject: kotlin.Int [val] declared in .testComma' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.String value=8 + then: CONST Boolean type=kotlin.Boolean value=true + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp1_subject: kotlin.Int [val] declared in .testComma' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.String value=9 + then: CONST String type=kotlin.String value="89" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST String type=kotlin.String value="?" diff --git a/compiler/testData/ir/irText/expressions/whenCoercedToUnit.fir.txt b/compiler/testData/ir/irText/expressions/whenCoercedToUnit.fir.txt new file mode 100644 index 00000000000..51fa78a739b --- /dev/null +++ b/compiler/testData/ir/irText/expressions/whenCoercedToUnit.fir.txt @@ -0,0 +1,12 @@ +FILE fqName: fileName:/whenCoercedToUnit.kt + FUN name:foo visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER name:x index:0 type:kotlin.Int + BLOCK_BODY + BLOCK type=kotlin.Unit origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp0_subject type:kotlin.Int [val] + WHEN type=kotlin.Unit origin=WHEN + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp0_subject: kotlin.Int [val] declared in .foo' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Unit value=0 + then: CONST Int type=kotlin.Unit value=0 diff --git a/compiler/testData/ir/irText/expressions/whenElse.kt b/compiler/testData/ir/irText/expressions/whenElse.kt index 2bf2ee9ffd0..9a7f02362e6 100644 --- a/compiler/testData/ir/irText/expressions/whenElse.kt +++ b/compiler/testData/ir/irText/expressions/whenElse.kt @@ -1 +1,3 @@ +// FIR_IDENTICAL + fun test() = when { else -> 42 } \ No newline at end of file diff --git a/compiler/testData/ir/irText/expressions/whenReturn.fir.txt b/compiler/testData/ir/irText/expressions/whenReturn.fir.txt new file mode 100644 index 00000000000..bcb2357efa5 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/whenReturn.fir.txt @@ -0,0 +1,37 @@ +FILE fqName: fileName:/whenReturn.kt + FUN name:toString visibility:public modality:FINAL <> (grade:kotlin.String) returnType:kotlin.String + VALUE_PARAMETER name:grade index:0 type:kotlin.String + BLOCK_BODY + BLOCK type=kotlin.String origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp0_subject type:kotlin.String [val] + WHEN type=kotlin.String origin=WHEN + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp0_subject: kotlin.String [val] declared in .toString' type=kotlin.String origin=null + arg1: CONST String type=kotlin.String value="A" + then: RETURN type=kotlin.Nothing from='public final fun toString (grade: kotlin.String): kotlin.String declared in ' + CONST String type=kotlin.String value="Excellent" + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp0_subject: kotlin.String [val] declared in .toString' type=kotlin.String origin=null + arg1: CONST String type=kotlin.String value="B" + then: RETURN type=kotlin.Nothing from='public final fun toString (grade: kotlin.String): kotlin.String declared in ' + CONST String type=kotlin.String value="Good" + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp0_subject: kotlin.String [val] declared in .toString' type=kotlin.String origin=null + arg1: CONST String type=kotlin.String value="C" + then: RETURN type=kotlin.Nothing from='public final fun toString (grade: kotlin.String): kotlin.String declared in ' + CONST String type=kotlin.String value="Mediocre" + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp0_subject: kotlin.String [val] declared in .toString' type=kotlin.String origin=null + arg1: CONST String type=kotlin.String value="D" + then: RETURN type=kotlin.Nothing from='public final fun toString (grade: kotlin.String): kotlin.String declared in ' + CONST String type=kotlin.String value="Fair" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: RETURN type=kotlin.Nothing from='public final fun toString (grade: kotlin.String): kotlin.String declared in ' + CONST String type=kotlin.String value="Failure" + RETURN type=kotlin.Nothing from='public final fun toString (grade: kotlin.String): kotlin.String declared in ' + CONST String type=kotlin.String value="???" diff --git a/compiler/testData/ir/irText/expressions/whenWithSubjectVariable.fir.txt b/compiler/testData/ir/irText/expressions/whenWithSubjectVariable.fir.txt new file mode 100644 index 00000000000..bfdda98628b --- /dev/null +++ b/compiler/testData/ir/irText/expressions/whenWithSubjectVariable.fir.txt @@ -0,0 +1,37 @@ +FILE fqName: fileName:/whenWithSubjectVariable.kt + FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Any + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Any declared in ' + CONST Int type=kotlin.Any value=1 + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test (): kotlin.Int declared in ' + BLOCK type=kotlin.Int origin=WHEN + VAR name:y type:kotlin.Any [val] + CALL 'public final fun foo (): kotlin.Any declared in ' type=kotlin.Any origin=null + WHEN type=kotlin.Int origin=WHEN + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val y: kotlin.Any [val] declared in .test' type=kotlin.Any origin=null + arg1: CONST Int type=kotlin.Int value=42 + then: CONST Int type=kotlin.Int value=1 + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.String + GET_VAR 'val y: kotlin.Any [val] declared in .test' type=kotlin.Any origin=null + then: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Int + GET_VAR 'val y: kotlin.Any [val] declared in .test' type=kotlin.Any origin=null + then: CONST Int type=kotlin.Int value=2 + BRANCH + if: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val y: kotlin.Any [val] declared in .test' type=kotlin.Any origin=null + then: CONST Int type=kotlin.Int value=3 + BRANCH + if: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val y: kotlin.Any [val] declared in .test' type=kotlin.Any origin=null + then: CONST Int type=kotlin.Int value=4 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST Int type=kotlin.Int value=1 diff --git a/compiler/testData/ir/irText/expressions/whileDoWhile.fir.txt b/compiler/testData/ir/irText/expressions/whileDoWhile.fir.txt new file mode 100644 index 00000000000..c56cd22c7c9 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/whileDoWhile.fir.txt @@ -0,0 +1,54 @@ +FILE fqName: fileName:/whileDoWhile.kt + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:x type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + WHILE label=null origin=WHILE_LOOP + condition: ERROR_CALL 'Comparison of arguments with different types: kotlin/Int, kotlin/Unit' type=kotlin.Boolean + body: BLOCK type=kotlin.Unit origin=null + WHILE label=null origin=WHILE_LOOP + condition: ERROR_CALL 'Comparison of arguments with different types: kotlin/Int, kotlin/Unit' type=kotlin.Boolean + body: BLOCK type=kotlin.Int origin=null + VAR name: type:kotlin.Int [val] + GET_VAR 'var x: kotlin.Int [var] declared in .test' type=kotlin.Int origin=null + ERROR_CALL 'Unresolved reference: R|/x|' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .test' type=kotlin.Int origin=null + WHILE label=null origin=WHILE_LOOP + condition: ERROR_CALL 'Comparison of arguments with different types: kotlin/Int, kotlin/Unit' type=kotlin.Boolean + body: BLOCK type=kotlin.Int origin=null + VAR name: type:kotlin.Int [val] + GET_VAR 'var x: kotlin.Int [var] declared in .test' type=kotlin.Int origin=null + ERROR_CALL 'Unresolved reference: R|/x|' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .test' type=kotlin.Int origin=null + DO_WHILE label=null origin=DO_WHILE_LOOP + body: BLOCK type=kotlin.Unit origin=null + condition: ERROR_CALL 'Comparison of arguments with different types: kotlin/Int, kotlin/Unit' type=kotlin.Boolean + DO_WHILE label=null origin=DO_WHILE_LOOP + body: BLOCK type=kotlin.Int origin=null + VAR name: type:kotlin.Int [val] + GET_VAR 'var x: kotlin.Int [var] declared in .test' type=kotlin.Int origin=null + ERROR_CALL 'Unresolved reference: R|/x|' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .test' type=kotlin.Int origin=null + condition: ERROR_CALL 'Comparison of arguments with different types: kotlin/Int, kotlin/Unit' type=kotlin.Boolean + DO_WHILE label=null origin=DO_WHILE_LOOP + body: BLOCK type=kotlin.Int origin=null + VAR name: type:kotlin.Int [val] + GET_VAR 'var x: kotlin.Int [var] declared in .test' type=kotlin.Int origin=null + ERROR_CALL 'Unresolved reference: R|/x|' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .test' type=kotlin.Int origin=null + condition: ERROR_CALL 'Comparison of arguments with different types: kotlin/Int, kotlin/Unit' type=kotlin.Boolean + FUN name:testSmartcastInCondition visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:a type:kotlin.Any? [val] + CONST Null type=kotlin.Nothing? value=null + WHEN type=kotlin.Unit origin=IF + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Boolean + GET_VAR 'val a: kotlin.Any? [val] declared in .testSmartcastInCondition' type=kotlin.Any? origin=null + then: BLOCK type=kotlin.Unit origin=null + WHILE label=null origin=WHILE_LOOP + condition: GET_VAR 'val a: kotlin.Any? [val] declared in .testSmartcastInCondition' type=kotlin.Any? origin=null + body: BLOCK type=kotlin.Unit origin=null + DO_WHILE label=null origin=DO_WHILE_LOOP + body: BLOCK type=kotlin.Unit origin=null + condition: GET_VAR 'val a: kotlin.Any? [val] declared in .testSmartcastInCondition' type=kotlin.Any? origin=null diff --git a/compiler/testData/ir/irText/lambdas/anonymousFunction.fir.txt b/compiler/testData/ir/irText/lambdas/anonymousFunction.fir.txt new file mode 100644 index 00000000000..d085f2d719f --- /dev/null +++ b/compiler/testData/ir/irText/lambdas/anonymousFunction.fir.txt @@ -0,0 +1,14 @@ +FILE fqName: fileName:/anonymousFunction.kt + PROPERTY name:anonymous visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:anonymous type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + BLOCK type=IrErrorType origin=ANONYMOUS_FUNCTION + FUN name: visibility:local modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun println (): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null + FUNCTION_REFERENCE 'local final fun (): kotlin.Unit declared in .anonymous' type=IrErrorType origin=ANONYMOUS_FUNCTION + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:anonymous visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anonymous type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.txt b/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.txt new file mode 100644 index 00000000000..b8d98148f3d --- /dev/null +++ b/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.txt @@ -0,0 +1,71 @@ +FILE fqName: fileName:/destructuringInLambda.kt + CLASS CLASS name:A modality:FINAL visibility:public [data] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.A [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:y index:1 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: kotlin.Int declared in .A.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + PROPERTY name:y visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'y: kotlin.Int declared in .A.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int + correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:fn visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:fn type:kotlin.Function1 visibility:public [static] + EXPRESSION_BODY + BLOCK type=kotlin.Function1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (:IrErrorType) returnType:kotlin.Function1 + VALUE_PARAMETER name: index:0 type:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (: IrErrorType): kotlin.Function1 declared in .fn' + BLOCK type=IrErrorType origin=null + VAR name:_ type:IrErrorType [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + VAR name:y type:IrErrorType [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val y: IrErrorType [val] declared in .fn.' type=IrErrorType origin=null + FUNCTION_REFERENCE 'local final fun (: IrErrorType): kotlin.Function1 declared in .fn' type=kotlin.Function1 origin=LAMBDA + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function1 + correspondingProperty: PROPERTY name:fn visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function1 declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:fn type:kotlin.Function1 visibility:public [static] ' type=kotlin.Function1 origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Function1) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:fn visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.Function1 + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:fn type:kotlin.Function1 visibility:public [static] ' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.Function1 declared in .' type=kotlin.Function1 origin=null diff --git a/compiler/testData/ir/irText/lambdas/extensionLambda.fir.txt b/compiler/testData/ir/irText/lambdas/extensionLambda.fir.txt new file mode 100644 index 00000000000..b1b2d77afe5 --- /dev/null +++ b/compiler/testData/ir/irText/lambdas/extensionLambda.fir.txt @@ -0,0 +1,11 @@ +FILE fqName: fileName:/extensionLambda.kt + FUN name:test1 visibility:public modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .test1' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .test1' type=IrErrorType origin=LAMBDA diff --git a/compiler/testData/ir/irText/lambdas/justLambda.fir.txt b/compiler/testData/ir/irText/lambdas/justLambda.fir.txt new file mode 100644 index 00000000000..6c554094487 --- /dev/null +++ b/compiler/testData/ir/irText/lambdas/justLambda.fir.txt @@ -0,0 +1,29 @@ +FILE fqName: fileName:/justLambda.kt + PROPERTY name:test1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test1 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .test1' + CONST Int type=IrErrorType value=42 + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .test1' type=IrErrorType origin=LAMBDA + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + PROPERTY name:test2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test2 type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .test2' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .test2' type=IrErrorType origin=LAMBDA + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/lambdas/localFunction.fir.txt b/compiler/testData/ir/irText/lambdas/localFunction.fir.txt new file mode 100644 index 00000000000..a778ba6d3b1 --- /dev/null +++ b/compiler/testData/ir/irText/lambdas/localFunction.fir.txt @@ -0,0 +1,12 @@ +FILE fqName: fileName:/localFunction.kt + FUN name:outer visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:x type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + FUN name:local visibility:local modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name: type:kotlin.Int [val] + GET_VAR 'var x: kotlin.Int [var] declared in .outer' type=kotlin.Int origin=null + ERROR_CALL 'Unresolved reference: R|/x|' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .outer.local' type=kotlin.Int origin=null + CALL 'local final fun local (): kotlin.Unit declared in ' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt new file mode 100644 index 00000000000..4ccda38f405 --- /dev/null +++ b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt @@ -0,0 +1,107 @@ +FILE fqName: fileName:/multipleImplicitReceivers.kt + CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:private <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS OBJECT name:B modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + CONSTRUCTOR visibility:private <> () returnType:.B [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo + PROPERTY name:foo visibility:public modality:OPEN [val] + FUN name: visibility:public modality:OPEN <> ($this:.IFoo) returnType:.B + correspondingProperty: PROPERTY name:foo visibility:public modality:OPEN [val] + $this: VALUE_PARAMETER name: type:.IFoo + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): .B declared in .IFoo' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:IInvoke modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IInvoke + FUN name:invoke visibility:public modality:OPEN <> ($this:.IInvoke) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.IInvoke + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun invoke (): kotlin.Int declared in .IInvoke' + CONST Int type=kotlin.Int value=42 + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> (fooImpl:.IFoo, invokeImpl:.IInvoke) returnType:kotlin.Unit + VALUE_PARAMETER name:fooImpl index:0 type:.IFoo + VALUE_PARAMETER name:invokeImpl index:1 type:.IInvoke + BLOCK_BODY + CALL 'public final fun with (receiver: T of , block: kotlin.Function1, R of >): R of [inline] declared in kotlin' type=R of origin=null + receiver: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + block: BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .test' + CALL 'public final fun with (receiver: T of , block: kotlin.Function1, R of >): R of [inline] declared in kotlin' type=R of origin=null + receiver: GET_VAR 'fooImpl: .IFoo declared in .test' type=.IFoo origin=null + block: BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .test.' + CALL 'public final fun with (receiver: T of , block: kotlin.Function1, R of >): R of [inline] declared in kotlin' type=R of origin=null + receiver: GET_VAR 'invokeImpl: .IInvoke declared in .test' type=.IInvoke origin=null + block: BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .test..' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .test..' type=IrErrorType origin=LAMBDA + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .test.' type=IrErrorType origin=LAMBDA + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .test' type=IrErrorType origin=LAMBDA diff --git a/compiler/testData/ir/irText/lambdas/nonLocalReturn.fir.txt b/compiler/testData/ir/irText/lambdas/nonLocalReturn.fir.txt new file mode 100644 index 00000000000..2fb0d9816fd --- /dev/null +++ b/compiler/testData/ir/irText/lambdas/nonLocalReturn.fir.txt @@ -0,0 +1,85 @@ +FILE fqName: fileName:/nonLocalReturn.kt + FUN name:test0 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .test0' + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .test0' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .test0' type=IrErrorType origin=LAMBDA + FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .test1' + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .test1' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .test1' type=IrErrorType origin=LAMBDA + FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .test2' + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .test2' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .test2' type=IrErrorType origin=LAMBDA + FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .test3' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .test3.' + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .test3.' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .test3.' type=IrErrorType origin=LAMBDA + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .test3' type=IrErrorType origin=LAMBDA + FUN name:testLrmFoo1 visibility:public modality:FINAL <> (ints:kotlin.collections.List) returnType:kotlin.Unit + VALUE_PARAMETER name:ints index:0 type:kotlin.collections.List + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .testLrmFoo1' + BLOCK type=IrErrorType origin=null + WHEN type=IrErrorType origin=IF + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + arg1: CONST Int type=kotlin.Int value=0 + then: RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .testLrmFoo1' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .testLrmFoo1' type=IrErrorType origin=LAMBDA + FUN name:testLrmFoo2 visibility:public modality:FINAL <> (ints:kotlin.collections.List) returnType:kotlin.Unit + VALUE_PARAMETER name:ints index:0 type:kotlin.collections.List + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .testLrmFoo2' + BLOCK type=IrErrorType origin=null + WHEN type=IrErrorType origin=IF + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + arg1: CONST Int type=kotlin.Int value=0 + then: RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .testLrmFoo2' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .testLrmFoo2' type=IrErrorType origin=LAMBDA diff --git a/compiler/testData/ir/irText/lambdas/samAdapter.fir.txt b/compiler/testData/ir/irText/lambdas/samAdapter.fir.txt new file mode 100644 index 00000000000..e1211a6db2c --- /dev/null +++ b/compiler/testData/ir/irText/lambdas/samAdapter.fir.txt @@ -0,0 +1,13 @@ +FILE fqName: fileName:/samAdapter.kt + FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:hello type:IrErrorType [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .test1' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST String type=kotlin.String value="Hello, world!" + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .test1' type=IrErrorType origin=LAMBDA + ERROR_CALL 'Unresolved reference: #' type=IrErrorType diff --git a/compiler/testData/ir/irText/regressions/coercionInLoop.fir.txt b/compiler/testData/ir/irText/regressions/coercionInLoop.fir.txt new file mode 100644 index 00000000000..c38c9eb94d7 --- /dev/null +++ b/compiler/testData/ir/irText/regressions/coercionInLoop.fir.txt @@ -0,0 +1,29 @@ +FILE fqName: fileName:/coercionInLoop.kt + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + VAR name:a type:IrErrorType [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST Int type=kotlin.Int value=5 + VAR name:x type:IrErrorType [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + VAR name:i type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + WHILE label=null origin=WHILE_LOOP + condition: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + body: BLOCK type=kotlin.Int origin=null + WHEN type=kotlin.String origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'var i: kotlin.Int [var] declared in .box' type=kotlin.Int origin=null + arg1: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + other: GET_VAR 'var i: kotlin.Int [var] declared in .box' type=kotlin.Int origin=null + VAR name: type:kotlin.Int [val] + GET_VAR 'var i: kotlin.Int [var] declared in .box' type=kotlin.Int origin=null + ERROR_CALL 'Unresolved reference: R|/i|' type=IrErrorType + GET_VAR 'val : kotlin.Int [val] declared in .box' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="OK" diff --git a/compiler/testData/ir/irText/regressions/integerCoercionToT.fir.txt b/compiler/testData/ir/irText/regressions/integerCoercionToT.fir.txt new file mode 100644 index 00000000000..20e534bc2f9 --- /dev/null +++ b/compiler/testData/ir/irText/regressions/integerCoercionToT.fir.txt @@ -0,0 +1,87 @@ +FILE fqName: fileName:/integerCoercionToT.kt + CLASS INTERFACE name:CPointed modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CPointed + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:reinterpret visibility:public modality:FINAL () returnType:T of .reinterpret [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun reinterpret (): T of .reinterpret [inline] declared in ' + CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin' type=kotlin.Nothing origin=null + CLASS CLASS name:CInt32VarX modality:FINAL visibility:public superTypes:[.CPointed] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CInt32VarX + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> () returnType:.CInt32VarX.CInt32VarX> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CInt32VarX modality:FINAL visibility:public superTypes:[.CPointed]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:value visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> () returnType:T_INT of + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T_INT of declared in ' + CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin' type=kotlin.Nothing origin=null + FUN name: visibility:public modality:FINAL <> (value:T_INT of ) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] + VALUE_PARAMETER name:value index:0 type:T_INT of + BLOCK_BODY + CLASS CLASS name:IdType modality:FINAL visibility:public superTypes:[.CPointed] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IdType + CONSTRUCTOR visibility:public <> (value:kotlin.Int) returnType:.IdType [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IdType modality:FINAL visibility:public superTypes:[.CPointed]' + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + GET_VAR 'value: kotlin.Int declared in .IdType.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.IdType) returnType:kotlin.Int + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.IdType + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .IdType' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:public [final] ' type=kotlin.Int origin=null + receiver: GET_VAR ': .IdType declared in .IdType.' type=.IdType origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:foo visibility:public modality:FINAL <> (value:.IdType, cv:.CInt32VarX) returnType:kotlin.Unit + VALUE_PARAMETER name:value index:0 type:.IdType + VALUE_PARAMETER name:cv index:1 type:.CInt32VarX + BLOCK_BODY + ERROR_CALL 'Unresolved reference: R|/value|' type=IrErrorType diff --git a/compiler/testData/ir/irText/regressions/kt24114.fir.txt b/compiler/testData/ir/irText/regressions/kt24114.fir.txt new file mode 100644 index 00000000000..56df4d12b33 --- /dev/null +++ b/compiler/testData/ir/irText/regressions/kt24114.fir.txt @@ -0,0 +1,57 @@ +FILE fqName: fileName:/kt24114.kt + FUN name:one visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun one (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=1 + FUN name:two visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun two (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=2 + FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + WHILE label=null origin=WHILE_LOOP + condition: CONST Boolean type=kotlin.Boolean value=true + body: BLOCK type=kotlin.Int origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp0_subject type:kotlin.Int [val] + WHEN type=kotlin.Int origin=WHEN + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp0_subject: kotlin.Int [val] declared in .test1' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=1 + then: BLOCK type=kotlin.Int origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp1_subject type:kotlin.Int [val] + WHEN type=kotlin.Int origin=WHEN + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp1_subject: kotlin.Int [val] declared in .test1' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=2 + then: RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=2 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=3 + FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Int + BLOCK_BODY + WHILE label=null origin=WHILE_LOOP + condition: CONST Boolean type=kotlin.Boolean value=true + body: BLOCK type=kotlin.Int origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp2_subject type:kotlin.Int [val] + WHEN type=kotlin.Int origin=WHEN + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp2_subject: kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=1 + then: BLOCK type=kotlin.Int origin=WHEN + VAR IR_TEMPORARY_VARIABLE name:tmp3_subject type:kotlin.Int [val] + WHEN type=kotlin.Int origin=WHEN + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp3_subject: kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=2 + then: RETURN type=kotlin.Nothing from='public final fun test2 (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=2 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: RETURN type=kotlin.Nothing from='public final fun test2 (): kotlin.Int declared in ' + CONST Int type=kotlin.Int value=3 diff --git a/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.fir.txt b/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.fir.txt new file mode 100644 index 00000000000..ddff228a4cf --- /dev/null +++ b/compiler/testData/ir/irText/regressions/newInference/fixationOrder1.fir.txt @@ -0,0 +1,50 @@ +FILE fqName: fileName:/fixationOrder1.kt + FUN name:foo visibility:public modality:FINAL () returnType:kotlin.Function1 + TYPE_PARAMETER name:X index:0 variance: superTypes:[] + TYPE_PARAMETER name:Y index:1 variance: superTypes:[] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Function1 declared in ' + CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin' type=kotlin.Nothing origin=null + CLASS INTERFACE name:Inv2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Inv2 + TYPE_PARAMETER name:A index:0 variance: superTypes:[] + TYPE_PARAMETER name:B index:1 variance: superTypes:[] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:check visibility:public modality:FINAL (x:T of .check, y:R of .check, f:kotlin.Function1) returnType:.Inv2.check, R of .check> + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + TYPE_PARAMETER name:R index:0 variance: superTypes:[] + VALUE_PARAMETER name:x index:0 type:T of .check + VALUE_PARAMETER name:y index:1 type:R of .check + VALUE_PARAMETER name:f index:2 type:kotlin.Function1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun check (x: T of .check, y: R of .check, f: kotlin.Function1): .Inv2.check, R of .check> declared in ' + CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin' type=kotlin.Nothing origin=null + FUN name:test visibility:public modality:FINAL <> () returnType:.Inv2.check, R of .check> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test (): .Inv2.check, R of .check> declared in ' + CALL 'public final fun check (x: T of .check, y: R of .check, f: kotlin.Function1): .Inv2.check, R of .check> declared in ' type=.Inv2.check, R of .check> origin=null + : + : + x: CONST String type=kotlin.String value="" + y: CONST Int type=kotlin.Int value=1 + f: CALL 'public final fun foo (): kotlin.Function1 declared in ' type=kotlin.Function1 origin=null + : + : + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + VAR name:x type:.Inv2 [val] + CALL 'public final fun test (): .Inv2.check, R of .check> declared in ' type=.Inv2.check, R of .check> origin=null + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="OK" diff --git a/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.fir.txt b/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.fir.txt new file mode 100644 index 00000000000..c79263ae4a1 --- /dev/null +++ b/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.fir.txt @@ -0,0 +1,41 @@ +FILE fqName: fileName:/typeAliasCtorForGenericClass.kt + CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + TYPE_PARAMETER name:Q index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> (q:Q of .A) returnType:.A.A> [primary] + VALUE_PARAMETER name:q index:0 type:Q of .A + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:q visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:q type:Q of .A visibility:public [final] + EXPRESSION_BODY + GET_VAR 'q: Q of .A declared in .A.' type=Q of .A origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:Q of .A + correspondingProperty: PROPERTY name:q visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): Q of .A declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:q type:Q of .A visibility:public [final] ' type=Q of .A origin=null + receiver: GET_VAR ': .A declared in .A.' type=.A origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:bar visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:b type:IrErrorType [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST Int type=kotlin.Int value=2 + VAR name:b2 type:IrErrorType [val] + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'val b: IrErrorType [val] declared in .bar' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/singletons/companion.fir.txt b/compiler/testData/ir/irText/singletons/companion.fir.txt new file mode 100644 index 00000000000..617bff3161e --- /dev/null +++ b/compiler/testData/ir/irText/singletons/companion.fir.txt @@ -0,0 +1,46 @@ +FILE fqName: fileName:/companion.kt + CLASS CLASS name:Z modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z + CONSTRUCTOR visibility:public <> () returnType:.Z [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:test2 visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.Companion + CONSTRUCTOR visibility:private <> () returnType:.Z.Companion [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' + FUN name:test visibility:public modality:FINAL <> ($this:.Z.Companion) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z.Companion + BLOCK_BODY + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/singletons/enumEntry.fir.txt b/compiler/testData/ir/irText/singletons/enumEntry.fir.txt new file mode 100644 index 00000000000..037172d3750 --- /dev/null +++ b/compiler/testData/ir/irText/singletons/enumEntry.fir.txt @@ -0,0 +1,74 @@ +FILE fqName: fileName:/enumEntry.kt + CLASS ENUM_CLASS name:Z modality:FINAL visibility:public superTypes:[kotlin.Enum] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z + CONSTRUCTOR visibility:private <> () returnType:.Z [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Z modality:FINAL visibility:public superTypes:[kotlin.Enum]' + CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.ENTRY + CONSTRUCTOR visibility:public <> () returnType:.Z.ENTRY [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:test visibility:public modality:FINAL <> ($this:.Z.ENTRY) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z.ENTRY + BLOCK_BODY + CLASS CLASS name:A modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.ENTRY.A + CONSTRUCTOR visibility:public <> () returnType:.Z.ENTRY.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' + FUN name:test2 visibility:public modality:FINAL <> ($this:.Z.ENTRY.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z.ENTRY.A + BLOCK_BODY + CALL 'public final fun test (): kotlin.Unit declared in .Z.ENTRY' type=kotlin.Unit origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:E of ) returnType:kotlin.Int + overridden: + public final fun compareTo (other: E of ): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:E of + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum diff --git a/compiler/testData/ir/irText/singletons/object.fir.txt b/compiler/testData/ir/irText/singletons/object.fir.txt new file mode 100644 index 00000000000..c63edc83044 --- /dev/null +++ b/compiler/testData/ir/irText/singletons/object.fir.txt @@ -0,0 +1,46 @@ +FILE fqName: fileName:/object.kt + CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z + CONSTRUCTOR visibility:private <> () returnType:.Z [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:test visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z + BLOCK_BODY + CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.A + CONSTRUCTOR visibility:public <> () returnType:.Z.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:test2 visibility:public modality:FINAL <> ($this:.Z.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Z.A + BLOCK_BODY + CALL 'public final fun test (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/stubs/builtinMap.fir.txt b/compiler/testData/ir/irText/stubs/builtinMap.fir.txt new file mode 100644 index 00000000000..8bcac7fe11f --- /dev/null +++ b/compiler/testData/ir/irText/stubs/builtinMap.fir.txt @@ -0,0 +1,23 @@ +FILE fqName: fileName:/builtinMap.kt + FUN name:plus visibility:public modality:FINAL (pair:kotlin.Pair.plus, V1 of .plus>) returnType:kotlin.collections.Map.plus, V1 of .plus> + TYPE_PARAMETER name:K1 index:0 variance: superTypes:[] + TYPE_PARAMETER name:V1 index:0 variance: superTypes:[] + VALUE_PARAMETER name:pair index:0 type:kotlin.Pair.plus, V1 of .plus> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun plus (pair: kotlin.Pair.plus, V1 of .plus>): kotlin.collections.Map.plus, V1 of .plus> declared in ' + WHEN type=kotlin.collections.Map.plus, V1 of .plus> origin=IF + BRANCH + if: CALL 'public abstract fun isEmpty (): kotlin.Boolean declared in kotlin.collections.Map' type=kotlin.Boolean origin=null + then: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + GET_VAR 'pair: kotlin.Pair.plus, V1 of .plus> declared in .plus' type=kotlin.Pair.plus, V1 of .plus> origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun apply (block: kotlin.Function1, kotlin.Unit>): T of [inline] declared in kotlin' type=T of origin=null + block: BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .plus' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .plus' type=IrErrorType origin=LAMBDA diff --git a/compiler/testData/ir/irText/stubs/constFromBuiltins.fir.txt b/compiler/testData/ir/irText/stubs/constFromBuiltins.fir.txt new file mode 100644 index 00000000000..12c9c8f8d05 --- /dev/null +++ b/compiler/testData/ir/irText/stubs/constFromBuiltins.fir.txt @@ -0,0 +1,10 @@ +FILE fqName: fileName:/constFromBuiltins.kt + PROPERTY name:test visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m1.fir.txt b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m1.fir.txt new file mode 100644 index 00000000000..2332c722129 --- /dev/null +++ b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m1.fir.txt @@ -0,0 +1,53 @@ +FILE fqName: fileName:/genericClassInDifferentModule_m1.kt + CLASS CLASS name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> (x:T of .Base) returnType:.Base.Base> [primary] + VALUE_PARAMETER name:x index:0 type:T of .Base + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:x type:T of .Base visibility:public [final] + EXPRESSION_BODY + GET_VAR 'x: T of .Base declared in .Base.' type=T of .Base origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Base) returnType:T of .Base + correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Base + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of .Base declared in .Base' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Base visibility:public [final] ' type=T of .Base origin=null + receiver: GET_VAR ': .Base declared in .Base.' type=.Base origin=null + FUN name:foo visibility:public modality:ABSTRACT ($this:.Base, y:Y of .Base.foo) returnType:T of .Base + TYPE_PARAMETER name:Y index:0 variance: superTypes:[] + $this: VALUE_PARAMETER name: type:.Base + VALUE_PARAMETER name:y index:0 type:Y of .Base.foo + PROPERTY name:bar visibility:public modality:ABSTRACT [var] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Base) returnType:T of .Base + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [var] + $this: VALUE_PARAMETER name: type:.Base + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Base, :T of .Base) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [var] + $this: VALUE_PARAMETER name: type:.Base + VALUE_PARAMETER name: index:0 type:T of .Base + PROPERTY name:exn visibility:public modality:ABSTRACT [var] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Base) returnType:T of .Base + correspondingProperty: PROPERTY name:exn visibility:public modality:ABSTRACT [var] + $this: VALUE_PARAMETER name: type:.Base + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Base, :T of .Base) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:exn visibility:public modality:ABSTRACT [var] + $this: VALUE_PARAMETER name: type:.Base + VALUE_PARAMETER name: index:0 type:T of .Base + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt new file mode 100644 index 00000000000..a6a312a127f --- /dev/null +++ b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt @@ -0,0 +1,61 @@ +FILE fqName: fileName:/genericClassInDifferentModule_m2.kt + CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[.Base.Derived1>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + CONSTRUCTOR visibility:public <> (x:T of .Derived1) returnType:.Derived1.Derived1> [primary] + VALUE_PARAMETER name:x index:0 type:T of .Derived1 + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor (x: T of .Base) [primary] declared in .Base' + x: GET_VAR 'x: T of .Derived1 declared in .Derived1.' type=T of .Derived1 origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[.Base.Derived1>]' + FUN name:foo visibility:public modality:FINAL ($this:.Derived1, y:Y of .Derived1.foo) returnType:T of .Derived1 + TYPE_PARAMETER name:Y index:0 variance: superTypes:[] + $this: VALUE_PARAMETER name: type:.Derived1 + VALUE_PARAMETER name:y index:0 type:Y of .Derived1.foo + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (y: Y of .Derived1.foo): T of .Derived1 declared in .Derived1' + CALL 'public final fun (): T of .Base declared in .Base' type=T of .Base origin=null + PROPERTY name:bar visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:bar type:T of .Derived1 visibility:public + EXPRESSION_BODY + CALL 'public final fun (): T of .Base declared in .Base' type=T of .Base origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Derived1) returnType:T of .Derived1 + correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Derived1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of .Derived1 declared in .Derived1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:T of .Derived1 visibility:public ' type=T of .Derived1 origin=null + receiver: GET_VAR ': .Derived1 declared in .Derived1.' type=.Derived1 origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Derived1, :T of .Derived1) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Derived1 + VALUE_PARAMETER name: index:0 type:T of .Derived1 + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:T of .Derived1 visibility:public ' type=kotlin.Unit origin=null + receiver: GET_VAR ': .Derived1 declared in .Derived1.' type=.Derived1 origin=null + value: GET_VAR ': T of .Derived1 declared in .Derived1.' type=T of .Derived1 origin=null + PROPERTY name:exn visibility:public modality:FINAL [var] + FUN name: visibility:public modality:FINAL <> ($this:.Derived1) returnType:T of .Derived1 + correspondingProperty: PROPERTY name:exn visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Derived1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of .Derived1 declared in .Derived1' + CALL 'public final fun (): T of .Base declared in .Base' type=T of .Base origin=null + FUN name: visibility:public modality:FINAL <> ($this:.Derived1, value:T of .Derived1) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:exn visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Derived1 + VALUE_PARAMETER name:value index:0 type:T of .Derived1 + BLOCK_BODY + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/stubs/javaConstructorWithTypeParameters.fir.txt b/compiler/testData/ir/irText/stubs/javaConstructorWithTypeParameters.fir.txt new file mode 100644 index 00000000000..17f1d421c14 --- /dev/null +++ b/compiler/testData/ir/irText/stubs/javaConstructorWithTypeParameters.fir.txt @@ -0,0 +1,21 @@ +FILE fqName: fileName:/javaConstructorWithTypeParameters.kt + FUN name:test1 visibility:public modality:FINAL <> () returnType:.J1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (): .J1 declared in ' + CALL 'public constructor () declared in .J1' type=.J1 origin=null + FUN name:test2 visibility:public modality:FINAL <> () returnType:.J1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (): .J1 declared in ' + CALL 'public constructor (x1: IrErrorType) declared in .J1' type=.J1 origin=null + x1: CONST Int type=kotlin.Int value=1 + FUN name:test3 visibility:public modality:FINAL <> (j1:.J1) returnType:IrErrorType + VALUE_PARAMETER name:j1 index:0 type:.J1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (j1: .J1): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN name:test4 visibility:public modality:FINAL <> (j1:.J1) returnType:IrErrorType + VALUE_PARAMETER name:j1 index:0 type:.J1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (j1: .J1): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST Int type=kotlin.Int value=1 diff --git a/compiler/testData/ir/irText/stubs/javaEnum.fir.txt b/compiler/testData/ir/irText/stubs/javaEnum.fir.txt new file mode 100644 index 00000000000..e970e786100 --- /dev/null +++ b/compiler/testData/ir/irText/stubs/javaEnum.fir.txt @@ -0,0 +1,10 @@ +FILE fqName: fileName:/javaEnum.kt + PROPERTY name:test visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/stubs/javaInnerClass.fir.txt b/compiler/testData/ir/irText/stubs/javaInnerClass.fir.txt new file mode 100644 index 00000000000..2ddfd17968d --- /dev/null +++ b/compiler/testData/ir/irText/stubs/javaInnerClass.fir.txt @@ -0,0 +1,64 @@ +FILE fqName: fileName:/javaInnerClass.kt + CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.J] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 + CONSTRUCTOR visibility:public <> () returnType:.Test1 [primary] + BLOCK_BODY + ERROR_CALL 'Cannot find delegated constructor call' type=.Test1 + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.J]' + PROPERTY name:test visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test type:IrErrorType visibility:public [final] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:IrErrorType + correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .Test1' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test type:IrErrorType visibility:public [final] ' type=IrErrorType origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN <> ($this:.J) returnType:kotlin.Unit + overridden: + public open fun bar (): kotlin.Unit declared in .J + $this: VALUE_PARAMETER name: type:.J + FUN FAKE_OVERRIDE name:registerNatives visibility:private modality:OPEN <> ($this:.Object) returnType:kotlin.Unit + overridden: + private open fun registerNatives (): kotlin.Unit declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:getClass visibility:public modality:FINAL <> ($this:.Object) returnType:java.lang.Class<*>? + overridden: + public final fun getClass (): java.lang.Class<*>? declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:.Object) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:.Object, obj:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (obj: kotlin.Any?): kotlin.Boolean declared in .Object + $this: VALUE_PARAMETER name: type:.Object + VALUE_PARAMETER name:obj index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:clone visibility:protected/*protected and package*/ modality:OPEN <> ($this:.Object) returnType:kotlin.Any? + overridden: + protected/*protected and package*/ open fun clone (): kotlin.Any? declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:.Object) returnType:kotlin.String? + overridden: + public open fun toString (): kotlin.String? declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:notify visibility:public modality:FINAL <> ($this:.Object) returnType:kotlin.Unit + overridden: + public final fun notify (): kotlin.Unit declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:notifyAll visibility:public modality:FINAL <> ($this:.Object) returnType:kotlin.Unit + overridden: + public final fun notifyAll (): kotlin.Unit declared in .Object + $this: VALUE_PARAMETER name: type:.Object + FUN FAKE_OVERRIDE name:wait visibility:public modality:FINAL <> ($this:.Object, :kotlin.Long) returnType:kotlin.Unit + overridden: + public final fun wait (: kotlin.Long): kotlin.Unit declared in .Object + $this: VALUE_PARAMETER name: type:.Object + VALUE_PARAMETER name: index:0 type:kotlin.Long + FUN FAKE_OVERRIDE name:finalize visibility:protected/*protected and package*/ modality:OPEN <> ($this:.Object) returnType:kotlin.Unit + overridden: + protected/*protected and package*/ open fun finalize (): kotlin.Unit declared in .Object + $this: VALUE_PARAMETER name: type:.Object diff --git a/compiler/testData/ir/irText/stubs/javaMethod.fir.txt b/compiler/testData/ir/irText/stubs/javaMethod.fir.txt new file mode 100644 index 00000000000..a40854895a3 --- /dev/null +++ b/compiler/testData/ir/irText/stubs/javaMethod.fir.txt @@ -0,0 +1,6 @@ +FILE fqName: fileName:/javaMethod.kt + FUN name:test visibility:public modality:FINAL <> (j:.J) returnType:kotlin.Unit + VALUE_PARAMETER name:j index:0 type:.J + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test (j: .J): kotlin.Unit declared in ' + CALL 'public open fun bar (): kotlin.Unit declared in .J' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/stubs/javaNestedClass.fir.txt b/compiler/testData/ir/irText/stubs/javaNestedClass.fir.txt new file mode 100644 index 00000000000..0f6fbd7ab0b --- /dev/null +++ b/compiler/testData/ir/irText/stubs/javaNestedClass.fir.txt @@ -0,0 +1,6 @@ +FILE fqName: fileName:/javaNestedClass.kt + FUN name:test visibility:public modality:FINAL <> (jj:.J.JJ) returnType:kotlin.Unit + VALUE_PARAMETER name:jj index:0 type:.J.JJ + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test (jj: .J.JJ): kotlin.Unit declared in ' + CALL 'public open fun foo (): kotlin.Unit declared in .J.JJ' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/stubs/javaStaticMethod.fir.txt b/compiler/testData/ir/irText/stubs/javaStaticMethod.fir.txt new file mode 100644 index 00000000000..894a1569077 --- /dev/null +++ b/compiler/testData/ir/irText/stubs/javaStaticMethod.fir.txt @@ -0,0 +1,5 @@ +FILE fqName: fileName:/javaStaticMethod.kt + FUN name:test visibility:public modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test (): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType diff --git a/compiler/testData/ir/irText/stubs/javaSyntheticProperty.fir.txt b/compiler/testData/ir/irText/stubs/javaSyntheticProperty.fir.txt new file mode 100644 index 00000000000..08c98da22e9 --- /dev/null +++ b/compiler/testData/ir/irText/stubs/javaSyntheticProperty.fir.txt @@ -0,0 +1,10 @@ +FILE fqName: fileName:/javaSyntheticProperty.kt + PROPERTY name:test visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/stubs/jdkClassSyntheticProperty.fir.txt b/compiler/testData/ir/irText/stubs/jdkClassSyntheticProperty.fir.txt new file mode 100644 index 00000000000..e36a194a51b --- /dev/null +++ b/compiler/testData/ir/irText/stubs/jdkClassSyntheticProperty.fir.txt @@ -0,0 +1,7 @@ +FILE fqName: fileName:/jdkClassSyntheticProperty.kt + PROPERTY name:test visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType diff --git a/compiler/testData/ir/irText/stubs/kotlinInnerClass.fir.txt b/compiler/testData/ir/irText/stubs/kotlinInnerClass.fir.txt new file mode 100644 index 00000000000..16c4bcf8924 --- /dev/null +++ b/compiler/testData/ir/irText/stubs/kotlinInnerClass.fir.txt @@ -0,0 +1,6 @@ +FILE fqName: fileName:/kotlinInnerClass.kt + FUN name:test visibility:public modality:FINAL <> (inner:.Outer.Inner) returnType:kotlin.Unit + VALUE_PARAMETER name:inner index:0 type:.Outer.Inner + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test (inner: .Outer.Inner): kotlin.Unit declared in ' + CALL 'public final fun foo (): kotlin.Unit declared in .Outer.Inner' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/stubs/simple.fir.txt b/compiler/testData/ir/irText/stubs/simple.fir.txt new file mode 100644 index 00000000000..0de84d8c320 --- /dev/null +++ b/compiler/testData/ir/irText/stubs/simple.fir.txt @@ -0,0 +1,11 @@ +FILE fqName: fileName:/simple.kt + PROPERTY name:test visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:test type:IrErrorType visibility:public [final,static] + EXPRESSION_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + CONST Int type=kotlin.Int value=2 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/types/intersectionType1.fir.txt b/compiler/testData/ir/irText/types/intersectionType1.fir.txt new file mode 100644 index 00000000000..83ff88b281d --- /dev/null +++ b/compiler/testData/ir/irText/types/intersectionType1.fir.txt @@ -0,0 +1,55 @@ +FILE fqName: fileName:/intersectionType1.kt + CLASS CLASS name:In modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.In + TYPE_PARAMETER name:I index:0 variance:in superTypes:[] + CONSTRUCTOR visibility:public <> () returnType:.In.In> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:In modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:select visibility:public modality:FINAL (x:S of .select, y:S of .select) returnType:S of .select + TYPE_PARAMETER name:S index:0 variance: superTypes:[] + VALUE_PARAMETER name:x index:0 type:S of .select + VALUE_PARAMETER name:y index:1 type:S of .select + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun select (x: S of .select, y: S of .select): S of .select declared in ' + GET_VAR 'x: S of .select declared in .select' type=S of .select origin=null + FUN name:foo visibility:public modality:FINAL (a:kotlin.Array<.In.foo>>, b:kotlin.Array<.In>) returnType:kotlin.Boolean + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + VALUE_PARAMETER name:a index:0 type:kotlin.Array<.In.foo>> + VALUE_PARAMETER name:b index:1 type:kotlin.Array<.In> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (a: kotlin.Array<.In.foo>>, b: kotlin.Array<.In>): kotlin.Boolean declared in ' + CALL 'public final fun ofType (y: kotlin.Any?): kotlin.Boolean [inline] declared in ' type=kotlin.Boolean origin=null + y: CONST Boolean type=kotlin.Boolean value=true + FUN name:ofType visibility:public modality:FINAL (y:kotlin.Any?) returnType:kotlin.Boolean [inline] + TYPE_PARAMETER name:K index:0 variance: superTypes:[] + VALUE_PARAMETER name:y index:0 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun ofType (y: kotlin.Any?): kotlin.Boolean [inline] declared in ' + TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=K of .ofType + GET_VAR 'y: kotlin.Any? declared in .ofType' type=kotlin.Any? origin=null + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + VAR name:a1 type:kotlin.Array> [val] + CALL 'public final fun arrayOf (elements: kotlin.Array>): kotlin.Array> [inline] declared in kotlin' type=kotlin.Array> origin=null + elements: CALL 'public constructor () [primary] declared in .In' type=.In.In> origin=null + VAR name:a2 type:kotlin.Array> [val] + CALL 'public final fun arrayOf (elements: kotlin.Array>): kotlin.Array> [inline] declared in kotlin' type=kotlin.Array> origin=null + elements: CALL 'public constructor () [primary] declared in .In' type=.In.In> origin=null + CALL 'public final fun foo (a: kotlin.Array<.In.foo>>, b: kotlin.Array<.In>): kotlin.Boolean declared in ' type=kotlin.Boolean origin=null + : + a: GET_VAR 'val a1: kotlin.Array> [val] declared in .test' type=kotlin.Array> origin=null + b: GET_VAR 'val a2: kotlin.Array> [val] declared in .test' type=kotlin.Array> origin=null diff --git a/compiler/testData/ir/irText/types/intersectionType2.fir.txt b/compiler/testData/ir/irText/types/intersectionType2.fir.txt new file mode 100644 index 00000000000..944a1423605 --- /dev/null +++ b/compiler/testData/ir/irText/types/intersectionType2.fir.txt @@ -0,0 +1,100 @@ +FILE fqName: fileName:/intersectionType2.kt + CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + TYPE_PARAMETER name:T index:0 variance:out superTypes:[] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:Foo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:B modality:OPEN visibility:public superTypes:[.Foo; .A<.B>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + CONSTRUCTOR visibility:public <> () returnType:.B [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:OPEN visibility:public superTypes:[.Foo; .A<.B>]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:C modality:OPEN visibility:public superTypes:[.Foo; .A<.C>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:OPEN visibility:public superTypes:[.Foo; .A<.C>]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:run visibility:public modality:FINAL (fn:kotlin.Function0) returnType:IrErrorType + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun run (fn: kotlin.Function0): IrErrorType declared in ' + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + FUN name:foo visibility:public modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): IrErrorType declared in ' + CALL 'public final fun run (fn: kotlin.Function0): IrErrorType declared in ' type=IrErrorType origin=null + : + fn: BLOCK type=IrErrorType origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): IrErrorType declared in .foo' + BLOCK type=.B origin=null + VAR name:mm type:.B [val] + CALL 'public constructor () [primary] declared in .B' type=.B origin=null + VAR name:nn type:.C [val] + CALL 'public constructor () [primary] declared in .C' type=.C origin=null + VAR name:c type:.B [val] + WHEN type=.B origin=IF + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val mm: .B [val] declared in .foo.' type=.B origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val nn: .C [val] declared in .foo.' type=.C origin=null + GET_VAR 'val c: .B [val] declared in .foo.' type=.B origin=null + FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .foo' type=IrErrorType origin=LAMBDA diff --git a/compiler/testData/ir/irText/types/intersectionType3.fir.txt b/compiler/testData/ir/irText/types/intersectionType3.fir.txt new file mode 100644 index 00000000000..ee538d63b58 --- /dev/null +++ b/compiler/testData/ir/irText/types/intersectionType3.fir.txt @@ -0,0 +1,167 @@ +FILE fqName: fileName:/intersectionType3.kt + CLASS INTERFACE name:In modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.In + TYPE_PARAMETER name:T index:0 variance:in superTypes:[] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:isT visibility:public modality:FINAL () returnType:kotlin.Boolean [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun isT (): kotlin.Boolean [inline] declared in ' + TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=T of .isT + ERROR_CALL 'Unresolved reference: this#' type=.In.isT> + FUN name:asT visibility:public modality:FINAL () returnType:kotlin.Unit [inline] + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + BLOCK_BODY + TYPE_OP type=T of .asT origin=CAST typeOperand=T of .asT + ERROR_CALL 'Unresolved reference: this#' type=.In.asT> + FUN name:sel visibility:public modality:FINAL (x:S of .sel, y:S of .sel) returnType:S of .sel + TYPE_PARAMETER name:S index:0 variance: superTypes:[] + VALUE_PARAMETER name:x index:0 type:S of .sel + VALUE_PARAMETER name:y index:1 type:S of .sel + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun sel (x: S of .sel, y: S of .sel): S of .sel declared in ' + GET_VAR 'x: S of .sel declared in .sel' type=S of .sel origin=null + CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:B modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:A1 modality:ABSTRACT visibility:public superTypes:[.A] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A1 + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:A2 modality:ABSTRACT visibility:public superTypes:[.A] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A2 + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:Z1 modality:ABSTRACT visibility:public superTypes:[.A; .B] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z1 + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:Z2 modality:ABSTRACT visibility:public superTypes:[.A; .B] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z2 + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:testInIs1 visibility:public modality:FINAL <> (x:.In<.A>, y:.In<.B>) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:.In<.A> + VALUE_PARAMETER name:y index:1 type:.In<.B> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testInIs1 (x: .In<.A>, y: .In<.B>): kotlin.Boolean declared in ' + CALL 'public final fun isT (): kotlin.Boolean [inline] declared in ' type=kotlin.Boolean origin=null + : + FUN name:testInIs2 visibility:public modality:FINAL <> (x:.In<.Z1>, y:.In<.Z2>) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:.In<.Z1> + VALUE_PARAMETER name:y index:1 type:.In<.Z2> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testInIs2 (x: .In<.Z1>, y: .In<.Z2>): kotlin.Boolean declared in ' + CALL 'public final fun isT (): kotlin.Boolean [inline] declared in ' type=kotlin.Boolean origin=null + : + FUN name:testInIs3 visibility:public modality:FINAL <> (x:.In<.A1>, y:.In<.A2>) returnType:kotlin.Boolean + VALUE_PARAMETER name:x index:0 type:.In<.A1> + VALUE_PARAMETER name:y index:1 type:.In<.A2> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testInIs3 (x: .In<.A1>, y: .In<.A2>): kotlin.Boolean declared in ' + CALL 'public final fun isT (): kotlin.Boolean [inline] declared in ' type=kotlin.Boolean origin=null + : + FUN name:testInAs1 visibility:public modality:FINAL <> (x:.In<.A>, y:.In<.B>) returnType:kotlin.Unit + VALUE_PARAMETER name:x index:0 type:.In<.A> + VALUE_PARAMETER name:y index:1 type:.In<.B> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testInAs1 (x: .In<.A>, y: .In<.B>): kotlin.Unit declared in ' + CALL 'public final fun asT (): kotlin.Unit [inline] declared in ' type=kotlin.Unit origin=null + : + FUN name:testInAs2 visibility:public modality:FINAL <> (x:.In<.Z1>, y:.In<.Z2>) returnType:kotlin.Unit + VALUE_PARAMETER name:x index:0 type:.In<.Z1> + VALUE_PARAMETER name:y index:1 type:.In<.Z2> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testInAs2 (x: .In<.Z1>, y: .In<.Z2>): kotlin.Unit declared in ' + CALL 'public final fun asT (): kotlin.Unit [inline] declared in ' type=kotlin.Unit origin=null + : + FUN name:testInAs3 visibility:public modality:FINAL <> (x:.In<.A1>, y:.In<.A2>) returnType:kotlin.Unit + VALUE_PARAMETER name:x index:0 type:.In<.A1> + VALUE_PARAMETER name:y index:1 type:.In<.A2> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testInAs3 (x: .In<.A1>, y: .In<.A2>): kotlin.Unit declared in ' + CALL 'public final fun asT (): kotlin.Unit [inline] declared in ' type=kotlin.Unit origin=null + : diff --git a/compiler/testData/ir/irText/types/localVariableOfIntersectionType.fir.txt b/compiler/testData/ir/irText/types/localVariableOfIntersectionType.fir.txt new file mode 100644 index 00000000000..8229289074a --- /dev/null +++ b/compiler/testData/ir/irText/types/localVariableOfIntersectionType.fir.txt @@ -0,0 +1,102 @@ +FILE fqName: fileName:/localVariableOfIntersectionType.kt + CLASS INTERFACE name:In modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.In + TYPE_PARAMETER name:T index:0 variance:in superTypes:[] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:Inv modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Inv + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + PROPERTY name:t visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Inv) returnType:T of .Inv + correspondingProperty: PROPERTY name:t visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.Inv + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:Z modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z + FUN name:create visibility:public modality:ABSTRACT ($this:.Z, x:.In.Z.create>, y:.In.Z.create>) returnType:.Inv.Z.create> + TYPE_PARAMETER name:T index:0 variance: superTypes:[] + $this: VALUE_PARAMETER name: type:.Z + VALUE_PARAMETER name:x index:0 type:.In.Z.create> + VALUE_PARAMETER name:y index:1 type:.In.Z.create> + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:IA modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IA + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IA) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IA + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:IB modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IB + FUN name:bar visibility:public modality:ABSTRACT <> ($this:.IB) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.IB + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> (a:.In<.IA>, b:.In<.IB>, z:.Z) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:.In<.IA> + VALUE_PARAMETER name:b index:1 type:.In<.IB> + VALUE_PARAMETER name:z index:2 type:.Z + BLOCK_BODY + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + VAR name:t type:T of .Inv [val] + CALL 'public abstract fun (): T of .Inv declared in .Inv' type=T of .Inv origin=null + ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType diff --git a/compiler/tests-common/build.gradle.kts b/compiler/tests-common/build.gradle.kts index 5e07b513b1c..16e837c8406 100644 --- a/compiler/tests-common/build.gradle.kts +++ b/compiler/tests-common/build.gradle.kts @@ -12,6 +12,7 @@ dependencies { testCompile(project(":compiler:backend")) testCompile(project(":compiler:fir:tree")) testCompile(project(":compiler:fir:psi2fir")) + testCompile(project(":compiler:fir:fir2ir")) testCompile(project(":compiler:fir:cones")) testCompile(project(":compiler:fir:resolve")) testCompile(project(":compiler:fir:java")) diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/ir/AbstractIrGeneratorTestCase.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/ir/AbstractIrGeneratorTestCase.kt index b6b5f1ed9f3..2d86c51668d 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/ir/AbstractIrGeneratorTestCase.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/ir/AbstractIrGeneratorTestCase.kt @@ -83,7 +83,7 @@ abstract class AbstractIrGeneratorTestCase : CodegenTestCase() { protected abstract fun doTest(wholeFile: File, testFiles: List) - protected fun generateIrModule(ignoreErrors: Boolean = false): IrModuleFragment { + protected open fun generateIrModule(ignoreErrors: Boolean = false): IrModuleFragment { assert(myFiles != null) { "myFiles not initialized" } assert(myEnvironment != null) { "myEnvironment not initialized" } return doGenerateIrModule(Psi2IrTranslator(myEnvironment.configuration.languageVersionSettings, Psi2IrConfiguration(ignoreErrors))) diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/ir/AbstractIrTextTestCase.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/ir/AbstractIrTextTestCase.kt index 4016b4ac777..27d09479d49 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/ir/AbstractIrTextTestCase.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/ir/AbstractIrTextTestCase.kt @@ -285,6 +285,29 @@ abstract class AbstractIrTextTestCase : AbstractIrGeneratorTestCase() { internal class IrTreeFileLabel(val expectedTextFile: File, val lineNumber: Int) + protected open fun getExpectedTextFileName(testFile: TestFile, name: String = testFile.name): String = name.replace(".kt", ".txt") + + private fun parseExpectations(dir: File, testFile: TestFile): Expectations { + val regexps = + testFile.content.matchLinesWith(EXPECTED_OCCURRENCES_PATTERN) { + RegexpInText(it.groupValues[1], it.groupValues[2].trim()) + } + + var treeFiles = + testFile.content.matchLinesWith(IR_FILE_TXT_PATTERN) { + val fileName = it.groupValues[1].trim() + val file = createExpectedTextFile(testFile, dir, getExpectedTextFileName(testFile, fileName)) + IrTreeFileLabel(file, 0) + } + + if (treeFiles.isEmpty()) { + val file = createExpectedTextFile(testFile, dir, getExpectedTextFileName(testFile)) + treeFiles = listOf(IrTreeFileLabel(file, 0)) + } + + return Expectations(regexps, treeFiles) + } + companion object { private val EXPECTED_OCCURRENCES_PATTERN = Regex("""^\s*//\s*(\d+)\s*(.*)$""") private val IR_FILE_TXT_PATTERN = Regex("""// IR_FILE: (.*)$""") @@ -301,27 +324,6 @@ abstract class AbstractIrTextTestCase : AbstractIrGeneratorTestCase() { internal fun TestFile.isExternalFile() = EXTERNAL_FILE_PATTERN.containsMatchIn(content) - - internal fun parseExpectations(dir: File, testFile: TestFile): Expectations { - val regexps = - testFile.content.matchLinesWith(EXPECTED_OCCURRENCES_PATTERN) { - RegexpInText(it.groupValues[1], it.groupValues[2].trim()) - } - - var treeFiles = - testFile.content.matchLinesWith(IR_FILE_TXT_PATTERN) { - val fileName = it.groupValues[1].trim() - val file = createExpectedTextFile(testFile, dir, fileName) - IrTreeFileLabel(file, 0) - } - - if (treeFiles.isEmpty()) { - val file = createExpectedTextFile(testFile, dir, testFile.name.replace(".kt", ".txt")) - treeFiles = listOf(IrTreeFileLabel(file, 0)) - } - - return Expectations(regexps, treeFiles) - } } } diff --git a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt index 30eb36c7590..005d7e8357d 100644 --- a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt +++ b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt @@ -19,6 +19,7 @@ import org.jetbrains.kotlin.codegen.flags.AbstractWriteFlagsTest import org.jetbrains.kotlin.codegen.ir.* import org.jetbrains.kotlin.fir.AbstractFirDiagnosticsSmokeTest import org.jetbrains.kotlin.fir.AbstractFirLoadCompiledKotlin +import org.jetbrains.kotlin.fir.AbstractFir2IrTextTest import org.jetbrains.kotlin.fir.AbstractFirResolveTestCase import org.jetbrains.kotlin.fir.AbstractFirResolveTestCaseWithStdlib import org.jetbrains.kotlin.fir.builder.AbstractRawFirBuilderTestCase @@ -419,11 +420,17 @@ fun main(args: Array) { } } - testGroup("compiler/fir/resolve/tests", "compiler/testData") { testClass { model("diagnostics/tests") } } + + testGroup("compiler/fir/fir2ir/tests", "compiler/testData") { + testClass { + model("ir/irText") + } + } + } diff --git a/idea/build.gradle.kts b/idea/build.gradle.kts index f2bc4359b44..009b57560cb 100644 --- a/idea/build.gradle.kts +++ b/idea/build.gradle.kts @@ -35,6 +35,7 @@ dependencies { compile(project(":j2k")) compile(project(":idea:formatter")) compile(project(":idea:fir-view")) + compile(project(":compiler:fir:fir2ir")) compile(project(":compiler:fir:resolve")) compile(project(":compiler:fir:java")) compile(project(":idea:idea-core")) diff --git a/idea/testData/gradle/highlighting/complexBuildGradleKts/build.gradle.kts b/idea/testData/gradle/highlighting/complexBuildGradleKts/build.gradle.kts index 0dea94e75a8..a7b6bc08259 100644 --- a/idea/testData/gradle/highlighting/complexBuildGradleKts/build.gradle.kts +++ b/idea/testData/gradle/highlighting/complexBuildGradleKts/build.gradle.kts @@ -118,7 +118,8 @@ extra["compilerModules"] = arrayOf( ":compiler:fir:cones", ":compiler:fir:resolve", ":compiler:fir:tree", - ":compiler:fir:psi2fir" + ":compiler:fir:psi2fir", + ":compiler:fir:fir2ir" ) } else { emptyArray() diff --git a/prepare/idea-plugin/build.gradle.kts b/prepare/idea-plugin/build.gradle.kts index 1e8d945290b..52a10d62fc7 100644 --- a/prepare/idea-plugin/build.gradle.kts +++ b/prepare/idea-plugin/build.gradle.kts @@ -38,6 +38,7 @@ val projectsToShadow by extra(listOf( ":compiler:fir:tree", ":compiler:fir:java", ":compiler:fir:psi2fir", + ":compiler:fir:fir2ir", ":idea:fir-view" ) } else { diff --git a/settings.gradle b/settings.gradle index 1214bca0168..a3fdbbb8777 100644 --- a/settings.gradle +++ b/settings.gradle @@ -32,6 +32,7 @@ include ":kotlin-build-common", ":compiler:fir:tree", ":compiler:fir:tree:visitors-generator", ":compiler:fir:psi2fir", + ":compiler:fir:fir2ir", ":compiler:fir:resolve", ":compiler:fir:java", ":compiler:frontend",