From 3f2e996803037f0e6ad6ec64249e23330d5a11a5 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 17 Aug 2023 11:24:39 +0300 Subject: [PATCH] [FIR2IR] Load builtin classes instead of creating them on the fly This change uncovered KT-61282, which was hidden because of incorrect module fragments used as parent for builtin classes --- .../kotlin/fir/types/ConeBuiltinTypeUtils.kt | 1 + .../kotlin/fir/backend/Fir2IrConverter.kt | 4 +- .../kotlin/fir/backend/IrBuiltInsOverFir.kt | 1169 ++++------------- .../codegen/box/fullJdk/charBuffer.kt | 3 +- .../codegen/box/specialBuiltins/charBuffer.kt | 2 + .../classes/enumWithMultipleCtors.fir.ir.txt | 2 +- ...raysFromBuiltins.__kotlin.Array.fir.ir.txt | 64 +- ...sFromBuiltins.__kotlin.IntArray.fir.ir.txt | 66 +- .../constFromBuiltins.__kotlin.Int.fir.ir.txt | 637 +++++---- 9 files changed, 723 insertions(+), 1225 deletions(-) diff --git a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/ConeBuiltinTypeUtils.kt b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/ConeBuiltinTypeUtils.kt index 5f9a12c620e..f05e6a2334b 100644 --- a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/ConeBuiltinTypeUtils.kt +++ b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/ConeBuiltinTypeUtils.kt @@ -31,6 +31,7 @@ val ConeKotlinType.isThrowableOrNullableThrowable: Boolean get() = isAnyOfBuilti val ConeKotlinType.isChar: Boolean get() = isBuiltinType(StandardClassIds.Char, false) val ConeKotlinType.isCharOrNullableChar: Boolean get() = isAnyOfBuiltinType(setOf(StandardClassIds.Char)) val ConeKotlinType.isString: Boolean get() = isBuiltinType(StandardClassIds.String, false) +val ConeKotlinType.isNullableString: Boolean get() = isBuiltinType(StandardClassIds.String, true) val ConeKotlinType.isEnum: Boolean get() = isBuiltinType(StandardClassIds.Enum, false) 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 index 716931c57f2..dbc80b6a78c 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConverter.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConverter.kt @@ -564,8 +564,7 @@ class Fir2IrConverter( components.visibilityConverter = visibilityConverter components.typeConverter = Fir2IrTypeConverter(components) val irBuiltIns = initializedIrBuiltIns ?: IrBuiltInsOverFir( - components, fir2IrConfiguration.languageVersionSettings, moduleDescriptor, irMangler, - fir2IrConfiguration.languageVersionSettings.getFlag(AnalysisFlags.builtInsFromSources) || kotlinBuiltIns !== DefaultBuiltIns.Instance + components, fir2IrConfiguration.languageVersionSettings, moduleDescriptor, irMangler ) components.irBuiltIns = irBuiltIns val conversionScope = Fir2IrConversionScope() @@ -578,6 +577,7 @@ class Fir2IrConverter( components.annotationsFromPluginRegistrar = Fir2IrAnnotationsFromPluginRegistrar(components) fir2IrExtensions.registerDeclarations(commonMemberStorage.symbolTable) + irBuiltIns.initialize() val irModuleFragment = IrModuleFragmentImpl(moduleDescriptor, irBuiltIns) diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/IrBuiltInsOverFir.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/IrBuiltInsOverFir.kt index c7a081303ce..a2f5d314a04 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/IrBuiltInsOverFir.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/IrBuiltInsOverFir.kt @@ -5,375 +5,221 @@ package org.jetbrains.kotlin.fir.backend -import org.jetbrains.kotlin.backend.common.ir.addDispatchReceiver import org.jetbrains.kotlin.backend.common.serialization.signature.PublicIdSignatureComputer import org.jetbrains.kotlin.builtins.PrimitiveType import org.jetbrains.kotlin.builtins.UnsignedType import org.jetbrains.kotlin.config.LanguageVersionSettings -import org.jetbrains.kotlin.descriptors.ClassKind -import org.jetbrains.kotlin.descriptors.DescriptorVisibilities -import org.jetbrains.kotlin.descriptors.DescriptorVisibility import org.jetbrains.kotlin.descriptors.Modality -import org.jetbrains.kotlin.fir.declarations.FirResolvePhase +import org.jetbrains.kotlin.fir.FirSession +import org.jetbrains.kotlin.fir.containingClassLookupTag import org.jetbrains.kotlin.fir.descriptors.FirModuleDescriptor +import org.jetbrains.kotlin.fir.resolve.providers.FirSymbolProvider import org.jetbrains.kotlin.fir.resolve.providers.symbolProvider -import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol -import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol -import org.jetbrains.kotlin.fir.symbols.lazyDeclarationResolver -import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase +import org.jetbrains.kotlin.fir.scopes.getFunctions +import org.jetbrains.kotlin.fir.scopes.unsubstitutedScope +import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol +import org.jetbrains.kotlin.fir.symbols.impl.FirNamedFunctionSymbol +import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol +import org.jetbrains.kotlin.fir.types.* import org.jetbrains.kotlin.ir.BuiltInOperatorNames import org.jetbrains.kotlin.ir.IrBuiltIns import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET -import org.jetbrains.kotlin.ir.builders.declarations.* +import org.jetbrains.kotlin.ir.builders.declarations.IrFunctionBuilder +import org.jetbrains.kotlin.ir.builders.declarations.addValueParameter import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.declarations.impl.IrExternalPackageFragmentImpl -import org.jetbrains.kotlin.ir.expressions.IrConst import org.jetbrains.kotlin.ir.expressions.IrConstructorCall -import org.jetbrains.kotlin.ir.expressions.IrExpression -import org.jetbrains.kotlin.ir.expressions.impl.IrConstImpl import org.jetbrains.kotlin.ir.expressions.impl.IrConstructorCallImpl import org.jetbrains.kotlin.ir.symbols.* -import org.jetbrains.kotlin.ir.symbols.impl.* +import org.jetbrains.kotlin.ir.symbols.impl.IrSimpleFunctionPublicSymbolImpl +import org.jetbrains.kotlin.ir.symbols.impl.IrSimpleFunctionSymbolImpl +import org.jetbrains.kotlin.ir.symbols.impl.IrTypeParameterSymbolImpl import org.jetbrains.kotlin.ir.types.* import org.jetbrains.kotlin.ir.types.impl.IrSimpleTypeImpl -import org.jetbrains.kotlin.ir.util.* -import org.jetbrains.kotlin.name.* +import org.jetbrains.kotlin.ir.util.KotlinMangler +import org.jetbrains.kotlin.ir.util.constructors +import org.jetbrains.kotlin.ir.util.defaultType +import org.jetbrains.kotlin.ir.util.functions +import org.jetbrains.kotlin.name.ClassId +import org.jetbrains.kotlin.name.FqName +import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.name.StandardClassIds import org.jetbrains.kotlin.types.Variance import org.jetbrains.kotlin.util.OperatorNameConventions -import kotlin.reflect.KProperty class IrBuiltInsOverFir( private val components: Fir2IrComponents, override val languageVersionSettings: LanguageVersionSettings, private val moduleDescriptor: FirModuleDescriptor, - irMangler: KotlinMangler.IrMangler, - private val tryLoadBuiltInsFirst: Boolean = false + irMangler: KotlinMangler.IrMangler ) : IrBuiltIns() { + private var initialized: Boolean = false + + private val session: FirSession + get() = components.session + + private val symbolProvider: FirSymbolProvider + get() = session.symbolProvider override val irFactory: IrFactory = components.symbolTable.irFactory private val kotlinPackage = StandardClassIds.BASE_KOTLIN_PACKAGE - private val kotlinInternalPackage = StandardClassIds.BASE_INTERNAL_PACKAGE override val operatorsPackageFragment = createPackage(KOTLIN_INTERNAL_IR_FQN) - private val kotlinIrPackage = createPackage(kotlinPackage) - private val kotlinInternalIrPackage = createPackage(kotlinInternalPackage) private val irSignatureBuilder = PublicIdSignatureComputer(irMangler) - @OptIn(IrSymbolInternals::class) override val booleanNotSymbol: IrSimpleFunctionSymbol by lazy { - boolean.ensureLazyContentsCreated() - booleanClass.owner.functions.first { it.name == OperatorNameConventions.NOT && it.returnType == booleanType }.symbol + val firFunction = findFirMemberFunctions(StandardClassIds.Boolean, OperatorNameConventions.NOT) + .first { it.resolvedReturnType.isBoolean } + findFunction(firFunction) } - private val any by createClass(kotlinIrPackage, IdSignatureValues.any, build = { modality = Modality.OPEN }) { - createConstructor() - createMemberFunction("toString", stringType, modality = Modality.OPEN, isIntrinsicConst = false) - createMemberFunction("hashCode", intType, modality = Modality.OPEN, isIntrinsicConst = false) - createMemberFunction( - OperatorNameConventions.EQUALS, booleanType, "other" to anyNType, - modality = Modality.OPEN, isOperator = true, isIntrinsicConst = false + private fun findFirMemberFunctions(classId: ClassId, name: Name): List { + val klass = symbolProvider.getClassLikeSymbolByClassId(classId) as FirRegularClassSymbol + val scope = klass.unsubstitutedScope( + session, components.scopeSession, withForcedTypeCalculator = true, memberRequiredPhase = null ) + return scope.getFunctions(name) } - override val anyClass: IrClassSymbol get() = any.klass - override val anyType: IrType get() = any.type + + override val anyClass: IrClassSymbol by lazy { loadClass(StandardClassIds.Any) } + + override val anyType: IrType get() = anyClass.defaultTypeWithoutArguments override val anyNType by lazy { anyType.makeNullable() } - private val number by createClass(kotlinIrPackage, IdSignatureValues.number, build = { modality = Modality.ABSTRACT }) { - configureSuperTypes() - for (targetPrimitive in primitiveNumericIrTypes) { - createMemberFunction("to${targetPrimitive.classFqName!!.shortName().asString()}", targetPrimitive, modality = Modality.ABSTRACT) - } - createMemberFunction("toChar", charType, modality = Modality.OPEN) - finalizeClassDefinition() - } - override val numberClass: IrClassSymbol get() = number.klass - override val numberType: IrType get() = number.type + override val numberClass: IrClassSymbol by lazy { loadClass(StandardClassIds.Number) } + override val numberType: IrType get() = numberClass.defaultTypeWithoutArguments - private val nothing by createClass(kotlinIrPackage, IdSignatureValues.nothing) - override val nothingClass: IrClassSymbol get() = nothing.klass - override val nothingType: IrType get() = nothing.type + override val nothingClass: IrClassSymbol by lazy { loadClass(StandardClassIds.Nothing) } + override val nothingType: IrType get() = nothingClass.defaultTypeWithoutArguments override val nothingNType: IrType by lazy { nothingType.makeNullable() } - private val unit by createClass(kotlinIrPackage, IdSignatureValues.unit, build = { kind = ClassKind.OBJECT; modality = Modality.FINAL }) { - configureSuperTypes() - finalizeClassDefinition() - } - override val unitClass: IrClassSymbol get() = unit.klass - override val unitType: IrType get() = unit.type + override val unitClass: IrClassSymbol by lazy { loadClass(StandardClassIds.Unit) } + override val unitType: IrType get() = unitClass.defaultTypeWithoutArguments - private val boolean by createClass(kotlinIrPackage, IdSignatureValues._boolean) { - configureSuperTypes() - // TODO: dangerous dependency on call sequence, consider making extended BuiltInsClass to trigger lazy initialization - createMemberFunction(OperatorNameConventions.NOT, booleanType, isOperator = true).symbol - createMemberFunction(OperatorNameConventions.AND, booleanType, "other" to booleanType) { isInfix = true } - createMemberFunction(OperatorNameConventions.OR, booleanType, "other" to booleanType) { isInfix = true } - createMemberFunction(OperatorNameConventions.XOR, booleanType, "other" to booleanType) { isInfix = true } - createMemberFunction( - OperatorNameConventions.COMPARE_TO, - intType, - "other" to booleanType, - modality = Modality.OPEN, - isOperator = true - ) - createIntrinsicConstOfToStringAndEquals() - finalizeClassDefinition() - } - override val booleanType: IrType get() = boolean.type - override val booleanClass: IrClassSymbol get() = boolean.klass + override val booleanClass: IrClassSymbol by lazy { loadClass(StandardClassIds.Boolean) } + override val booleanType: IrType get() = booleanClass.defaultTypeWithoutArguments - @OptIn(IrSymbolInternals::class) - private val char by createClass(kotlinIrPackage, IdSignatureValues._char) { - configureSuperTypes(number) - createStandardNumericAndCharMembers(charType) - createMemberFunction(OperatorNameConventions.COMPARE_TO, intType, "other" to charType, modality = Modality.OPEN, isOperator = true) - createMemberFunction(OperatorNameConventions.PLUS, charType, "other" to intType, isOperator = true) - createMemberFunction(OperatorNameConventions.MINUS, charType, "other" to intType, isOperator = true) - createMemberFunction(OperatorNameConventions.MINUS, intType, "other" to charType, isOperator = true) - val charRange = referenceClassByClassId(StandardClassIds.CharRange)!!.owner.defaultType - createMemberFunction(OperatorNameConventions.RANGE_TO, charRange, "other" to charType, isIntrinsicConst = false) - createMemberFunction(OperatorNameConventions.RANGE_UNTIL, charRange, "other" to charType, isIntrinsicConst = false) - createIntrinsicConstOfToStringAndEquals() - finalizeClassDefinition() - } - override val charClass: IrClassSymbol get() = char.klass - override val charType: IrType get() = char.type + override val charClass: IrClassSymbol by lazy { loadClass(StandardClassIds.Char) } + override val charType: IrType get() = charClass.defaultTypeWithoutArguments - private val byte by kotlinIrPackage.createNumberClass(IdSignatureValues._byte) - override val byteType: IrType get() = byte.type - override val byteClass: IrClassSymbol get() = byte.klass + override val byteClass: IrClassSymbol by lazy { loadClass(StandardClassIds.Byte) } + override val byteType: IrType get() = byteClass.defaultTypeWithoutArguments - private val short by kotlinIrPackage.createNumberClass(IdSignatureValues._short) - override val shortType: IrType get() = short.type - override val shortClass: IrClassSymbol get() = short.klass + override val shortClass: IrClassSymbol by lazy { loadClass(StandardClassIds.Short) } + override val shortType: IrType get() = shortClass.defaultTypeWithoutArguments - private val int by kotlinIrPackage.createNumberClass(IdSignatureValues._int) - override val intType: IrType get() = int.type - override val intClass: IrClassSymbol get() = int.klass + override val intClass: IrClassSymbol by lazy { loadClass(StandardClassIds.Int) } + override val intType: IrType get() = intClass.defaultTypeWithoutArguments - private val long by kotlinIrPackage.createNumberClass(IdSignatureValues._long) - override val longType: IrType get() = long.type - override val longClass: IrClassSymbol get() = long.klass + override val longClass: IrClassSymbol by lazy { loadClass(StandardClassIds.Long) } + override val longType: IrType get() = longClass.defaultTypeWithoutArguments - private val float by kotlinIrPackage.createNumberClass(IdSignatureValues._float) - override val floatType: IrType get() = float.type - override val floatClass: IrClassSymbol get() = float.klass + override val floatClass: IrClassSymbol by lazy { loadClass(StandardClassIds.Float) } + override val floatType: IrType get() = floatClass.defaultTypeWithoutArguments - private val double by kotlinIrPackage.createNumberClass(IdSignatureValues._double) - override val doubleType: IrType get() = double.type - override val doubleClass: IrClassSymbol get() = double.klass + override val doubleClass: IrClassSymbol by lazy { loadClass(StandardClassIds.Double) } + override val doubleType: IrType get() = doubleClass.defaultTypeWithoutArguments - private val charSequence by createClass( - kotlinIrPackage, IdSignatureValues.charSequence, - build = { kind = ClassKind.INTERFACE; modality = Modality.OPEN } - ) { - configureSuperTypes() - createProperty("length", intType, modality = Modality.ABSTRACT) - createMemberFunction(OperatorNameConventions.GET, charType, "index" to intType, modality = Modality.ABSTRACT, isOperator = true, isIntrinsicConst = false) - createMemberFunction("subSequence", defaultType, "startIndex" to intType, "endIndex" to intType, modality = Modality.ABSTRACT, isIntrinsicConst = false) - finalizeClassDefinition() - } - override val charSequenceClass: IrClassSymbol get() = charSequence.klass + override val charSequenceClass: IrClassSymbol by lazy { loadClass(StandardClassIds.CharSequence) } - private val string by createClass(kotlinIrPackage, IdSignatureValues.string) { - configureSuperTypes(charSequence) - createProperty("length", intType, modality = Modality.OPEN, isIntrinsicConst = true) - createMemberFunction(OperatorNameConventions.GET, charType, "index" to intType, modality = Modality.OPEN, isOperator = true) - createMemberFunction( - "subSequence", - charSequenceClass.defaultType, - "startIndex" to intType, - "endIndex" to intType, - modality = Modality.OPEN, - isIntrinsicConst = false - ) - createMemberFunction( - OperatorNameConventions.COMPARE_TO, - intType, - "other" to defaultType, - modality = Modality.OPEN, - isOperator = true - ) - createMemberFunction(OperatorNameConventions.PLUS, defaultType, "other" to anyNType, isOperator = true) - createIntrinsicConstOfToStringAndEquals() - finalizeClassDefinition() - } - override val stringClass: IrClassSymbol get() = string.klass - override val stringType: IrType get() = string.type + override val stringClass: IrClassSymbol by lazy { loadClass(StandardClassIds.String) } + override val stringType: IrType get() = stringClass.defaultTypeWithoutArguments - private val intrinsicConstAnnotationFqName = kotlinInternalPackage.child(Name.identifier("IntrinsicConstEvaluation")) - @OptIn(IrSymbolInternals::class) - internal val intrinsicConst = kotlinInternalIrPackage.createClass(intrinsicConstAnnotationFqName).apply { - owner.createConstructor() - owner.finalizeClassDefinition() - } + internal val intrinsicConst by lazy { loadClass(StandardClassIds.Annotations.IntrinsicConstEvaluation) } - private val intrinsicConstAnnotation: IrConstructorCall = run { + private val intrinsicConstAnnotation: IrConstructorCall by lazy { val constructor = intrinsicConst.constructors.single() IrConstructorCallImpl.Companion.fromSymbolOwner(intrinsicConst.defaultType, constructor) } - private val iterator by loadClass(StandardClassIds.Iterator) - override val iteratorClass: IrClassSymbol get() = iterator.klass + override val iteratorClass: IrClassSymbol by lazy { loadClass(StandardClassIds.Iterator) } + override val arrayClass: IrClassSymbol by lazy { loadClass(StandardClassIds.Array) } - private val array by createClass(kotlinIrPackage, IdSignatureValues.array) { - configureSuperTypes() - val typeParameter = addTypeParameter("T", anyNType) - addArrayMembers(typeParameter.defaultType, iteratorClass.typeWith(typeParameter.defaultType)) - finalizeClassDefinition() + override val annotationClass: IrClassSymbol by lazy { loadClass(StandardClassIds.Annotation) } + override val annotationType: IrType get() = annotationClass.defaultTypeWithoutArguments + + override val collectionClass: IrClassSymbol by lazy { loadClass(StandardClassIds.Collection) } + override val setClass: IrClassSymbol by lazy { loadClass(StandardClassIds.Set) } + override val listClass: IrClassSymbol by lazy { loadClass(StandardClassIds.List) } + override val mapClass: IrClassSymbol by lazy { loadClass(StandardClassIds.Map) } + override val mapEntryClass: IrClassSymbol by lazy { loadClass(StandardClassIds.MapEntry) } + + override val iterableClass: IrClassSymbol by lazy { loadClass(StandardClassIds.Iterable) } + override val listIteratorClass: IrClassSymbol by lazy { loadClass(StandardClassIds.ListIterator) } + override val mutableCollectionClass: IrClassSymbol by lazy { loadClass(StandardClassIds.MutableCollection) } + override val mutableSetClass: IrClassSymbol by lazy { loadClass(StandardClassIds.MutableSet) } + override val mutableListClass: IrClassSymbol by lazy { loadClass(StandardClassIds.MutableList) } + override val mutableMapClass: IrClassSymbol by lazy { loadClass(StandardClassIds.MutableMap) } + override val mutableMapEntryClass: IrClassSymbol by lazy { loadClass(StandardClassIds.MutableMapEntry) } + + override val mutableIterableClass: IrClassSymbol by lazy { loadClass(StandardClassIds.MutableIterable) } + override val mutableIteratorClass: IrClassSymbol by lazy { loadClass(StandardClassIds.MutableIterator) } + override val mutableListIteratorClass: IrClassSymbol by lazy { loadClass(StandardClassIds.MutableListIterator) } + override val comparableClass: IrClassSymbol by lazy { loadClass(StandardClassIds.Comparable) } + override val throwableType: IrType by lazy { throwableClass.defaultTypeWithoutArguments } + override val throwableClass: IrClassSymbol by lazy { loadClass(StandardClassIds.Throwable) } + + override val kCallableClass: IrClassSymbol by lazy { loadClass(StandardClassIds.KCallable) } + override val kPropertyClass: IrClassSymbol by lazy { loadClass(StandardClassIds.KProperty) } + override val kClassClass: IrClassSymbol by lazy { loadClass(StandardClassIds.KClass) } + override val kTypeClass: IrClassSymbol by lazy { loadClass(StandardClassIds.KType) } + override val kProperty0Class: IrClassSymbol by lazy { loadClass(StandardClassIds.KProperty0) } + override val kProperty1Class: IrClassSymbol by lazy { loadClass(StandardClassIds.KProperty1) } + override val kProperty2Class: IrClassSymbol by lazy { loadClass(StandardClassIds.KProperty2) } + override val kMutableProperty0Class: IrClassSymbol by lazy { loadClass(StandardClassIds.KMutableProperty0) } + override val kMutableProperty1Class: IrClassSymbol by lazy { loadClass(StandardClassIds.KMutableProperty1) } + override val kMutableProperty2Class: IrClassSymbol by lazy { loadClass(StandardClassIds.KMutableProperty2) } + + override val functionClass: IrClassSymbol by lazy { loadClass(StandardClassIds.Function) } + override val kFunctionClass: IrClassSymbol by lazy { loadClass(StandardClassIds.KFunction) } + + override val primitiveTypeToIrType by lazy { + mapOf( + PrimitiveType.BOOLEAN to booleanType, + PrimitiveType.CHAR to charType, + PrimitiveType.BYTE to byteType, + PrimitiveType.SHORT to shortType, + PrimitiveType.INT to intType, + PrimitiveType.LONG to longType, + PrimitiveType.FLOAT to floatType, + PrimitiveType.DOUBLE to doubleType + ) } - override val arrayClass: IrClassSymbol get() = array.klass - @OptIn(IrSymbolInternals::class) - private val intRangeType by lazy { referenceClassByClassId(StandardClassIds.IntRange)!!.owner.defaultType } - @OptIn(IrSymbolInternals::class) - private val longRangeType by lazy { referenceClassByClassId(StandardClassIds.LongRange)!!.owner.defaultType } + private val primitiveIntegralIrTypes by lazy { listOf(byteType, shortType, intType, longType) } + override val primitiveFloatingPointIrTypes by lazy { listOf(floatType, doubleType) } + private val primitiveNumericIrTypes by lazy { primitiveIntegralIrTypes + primitiveFloatingPointIrTypes } + override val primitiveIrTypesWithComparisons by lazy { listOf(charType) + primitiveNumericIrTypes } + override val primitiveIrTypes by lazy { listOf(booleanType) + primitiveIrTypesWithComparisons } + private val baseIrTypes by lazy { primitiveIrTypes + stringType } - private val annotation by loadClass(StandardClassIds.Annotation) - override val annotationClass: IrClassSymbol get() = annotation.klass - override val annotationType: IrType get() = annotation.type + private fun primitiveIterator(primitiveType: PrimitiveType): IrClassSymbol { + return loadClass(ClassId(StandardClassIds.BASE_COLLECTIONS_PACKAGE, Name.identifier("${primitiveType.typeName}Iterator"))) + } - private val collection by loadClass(StandardClassIds.Collection) - override val collectionClass: IrClassSymbol get() = collection.klass - private val set by loadClass(StandardClassIds.Set) - override val setClass: IrClassSymbol get() = set.klass - private val list by loadClass(StandardClassIds.List) - override val listClass: IrClassSymbol get() = list.klass - private val map by loadClass(StandardClassIds.Map) - override val mapClass: IrClassSymbol get() = map.klass - private val mapEntry by BuiltInsClass({ true to referenceClassByClassId(StandardClassIds.MapEntry)!! }) - override val mapEntryClass: IrClassSymbol get() = mapEntry.klass + override val booleanIterator = primitiveIterator(PrimitiveType.BOOLEAN) + override val charIterator = primitiveIterator(PrimitiveType.CHAR) + override val byteIterator = primitiveIterator(PrimitiveType.BYTE) + override val shortIterator = primitiveIterator(PrimitiveType.SHORT) + override val intIterator = primitiveIterator(PrimitiveType.INT) + override val longIterator = primitiveIterator(PrimitiveType.LONG) + override val floatIterator = primitiveIterator(PrimitiveType.FLOAT) + override val doubleIterator = primitiveIterator(PrimitiveType.DOUBLE) - private val iterable by loadClass(StandardClassIds.Iterable) - override val iterableClass: IrClassSymbol get() = iterable.klass - private val listIterator by loadClass(StandardClassIds.ListIterator) - override val listIteratorClass: IrClassSymbol get() = listIterator.klass - private val mutableCollection by loadClass(StandardClassIds.MutableCollection) - override val mutableCollectionClass: IrClassSymbol get() = mutableCollection.klass - private val mutableSet by loadClass(StandardClassIds.MutableSet) - override val mutableSetClass: IrClassSymbol get() = mutableSet.klass - private val mutableList by loadClass(StandardClassIds.MutableList) - override val mutableListClass: IrClassSymbol get() = mutableList.klass - private val mutableMap by loadClass(StandardClassIds.MutableMap) - override val mutableMapClass: IrClassSymbol get() = mutableMap.klass - private val mutableMapEntry by BuiltInsClass({ true to referenceClassByClassId(StandardClassIds.MutableMapEntry)!! }) - override val mutableMapEntryClass: IrClassSymbol get() = mutableMapEntry.klass + private fun loadPrimitiveArray(primitiveType: PrimitiveType): IrClassSymbol { + return loadClass(ClassId(StandardClassIds.BASE_KOTLIN_PACKAGE, Name.identifier("${primitiveType.typeName}Array"))) + } - private val mutableIterable by loadClass(StandardClassIds.MutableIterable) - override val mutableIterableClass: IrClassSymbol get() = mutableIterable.klass - private val mutableIterator by loadClass(StandardClassIds.MutableIterator) - override val mutableIteratorClass: IrClassSymbol get() = mutableIterator.klass - private val mutableListIterator by loadClass(StandardClassIds.MutableListIterator) - override val mutableListIteratorClass: IrClassSymbol get() = mutableListIterator.klass - private val comparable by loadClass(StandardClassIds.Comparable) - override val comparableClass: IrClassSymbol get() = comparable.klass - override val throwableType: IrType by lazy { throwableClass.defaultType } - private val throwable by loadClass(StandardClassIds.Throwable) - override val throwableClass: IrClassSymbol get() = throwable.klass - - private val kCallable by loadClass(StandardClassIds.KCallable) - override val kCallableClass: IrClassSymbol get() = kCallable.klass - private val kProperty by loadClass(StandardClassIds.KProperty) - override val kPropertyClass: IrClassSymbol get() = kProperty.klass - private val kClass by loadClass(StandardClassIds.KClass) - override val kClassClass: IrClassSymbol get() = kClass.klass - private val kType by loadClass(StandardClassIds.KType) - override val kTypeClass: IrClassSymbol get() = kType.klass - private val kProperty0 by loadClass(StandardClassIds.KProperty0) - override val kProperty0Class: IrClassSymbol get() = kProperty0.klass - private val kProperty1 by loadClass(StandardClassIds.KProperty1) - override val kProperty1Class: IrClassSymbol get() = kProperty1.klass - private val kProperty2 by loadClass(StandardClassIds.KProperty2) - override val kProperty2Class: IrClassSymbol get() = kProperty2.klass - private val kMutableProperty0 by loadClass(StandardClassIds.KMutableProperty0) - override val kMutableProperty0Class: IrClassSymbol get() = kMutableProperty0.klass - private val kMutableProperty1 by loadClass(StandardClassIds.KMutableProperty1) - override val kMutableProperty1Class: IrClassSymbol get() = kMutableProperty1.klass - private val kMutableProperty2 by loadClass(StandardClassIds.KMutableProperty2) - override val kMutableProperty2Class: IrClassSymbol get() = kMutableProperty2.klass - - private val function by loadClass(StandardClassIds.Function) - override val functionClass: IrClassSymbol get() = function.klass - private val kFunction by loadClass(StandardClassIds.KFunction) - override val kFunctionClass: IrClassSymbol get() = kFunction.klass - - override val primitiveTypeToIrType = mapOf( - PrimitiveType.BOOLEAN to booleanType, - PrimitiveType.CHAR to charType, - PrimitiveType.BYTE to byteType, - PrimitiveType.SHORT to shortType, - PrimitiveType.INT to intType, - PrimitiveType.LONG to longType, - PrimitiveType.FLOAT to floatType, - PrimitiveType.DOUBLE to doubleType - ) - - private val primitiveIntegralIrTypes = listOf(byteType, shortType, intType, longType) - override val primitiveFloatingPointIrTypes = listOf(floatType, doubleType) - private val primitiveNumericIrTypes = primitiveIntegralIrTypes + primitiveFloatingPointIrTypes - override val primitiveIrTypesWithComparisons = listOf(charType) + primitiveNumericIrTypes - override val primitiveIrTypes = listOf(booleanType) + primitiveIrTypesWithComparisons - private val baseIrTypes = primitiveIrTypes + stringType - - private val bitwiseOperators = arrayOf(OperatorNameConventions.AND, OperatorNameConventions.OR, OperatorNameConventions.XOR) - private val shiftOperators = arrayOf(OperatorNameConventions.SHL, OperatorNameConventions.SHR, OperatorNameConventions.USHR) - private val arithmeticOperators = arrayOf( - OperatorNameConventions.PLUS, - OperatorNameConventions.MINUS, - OperatorNameConventions.TIMES, - OperatorNameConventions.DIV, - OperatorNameConventions.REM - ) - - private fun getPrimitiveArithmeticOperatorResultType(target: IrType, arg: IrType) = - when { - arg == doubleType -> arg - target in primitiveFloatingPointIrTypes -> target - arg in primitiveFloatingPointIrTypes -> arg - target == longType -> target - arg == longType -> arg - else -> intType - } - - private fun primitiveIterator(primitiveType: PrimitiveType) = - loadClass(ClassId(StandardClassIds.BASE_COLLECTIONS_PACKAGE, Name.identifier("${primitiveType.typeName}Iterator"))) - - private val _booleanIterator by primitiveIterator(PrimitiveType.BOOLEAN) - private val _charIterator by primitiveIterator(PrimitiveType.CHAR) - private val _byteIterator by primitiveIterator(PrimitiveType.BYTE) - private val _shortIterator by primitiveIterator(PrimitiveType.SHORT) - private val _intIterator by primitiveIterator(PrimitiveType.INT) - private val _longIterator by primitiveIterator(PrimitiveType.LONG) - private val _floatIterator by primitiveIterator(PrimitiveType.FLOAT) - private val _doubleIterator by primitiveIterator(PrimitiveType.DOUBLE) - - override val booleanIterator: IrClassSymbol get() = _booleanIterator.klass - override val charIterator: IrClassSymbol get() = _charIterator.klass - override val byteIterator: IrClassSymbol get() = _byteIterator.klass - override val shortIterator: IrClassSymbol get() = _shortIterator.klass - override val intIterator: IrClassSymbol get() = _intIterator.klass - override val longIterator: IrClassSymbol get() = _longIterator.klass - override val floatIterator: IrClassSymbol get() = _floatIterator.klass - override val doubleIterator: IrClassSymbol get() = _doubleIterator.klass - - private val _booleanArray by createPrimitiveArrayClass(kotlinIrPackage, PrimitiveType.BOOLEAN, _booleanIterator) - private val _charArray by createPrimitiveArrayClass(kotlinIrPackage, PrimitiveType.CHAR, _charIterator) - private val _byteArray by createPrimitiveArrayClass(kotlinIrPackage, PrimitiveType.BYTE, _byteIterator) - private val _shortArray by createPrimitiveArrayClass(kotlinIrPackage, PrimitiveType.SHORT, _shortIterator) - private val _intArray by createPrimitiveArrayClass(kotlinIrPackage, PrimitiveType.INT, _intIterator) - private val _longArray by createPrimitiveArrayClass(kotlinIrPackage, PrimitiveType.LONG, _longIterator) - private val _floatArray by createPrimitiveArrayClass(kotlinIrPackage, PrimitiveType.FLOAT, _floatIterator) - private val _doubleArray by createPrimitiveArrayClass(kotlinIrPackage, PrimitiveType.DOUBLE, _doubleIterator) - - override val booleanArray: IrClassSymbol get() = _booleanArray.klass - override val charArray: IrClassSymbol get() = _charArray.klass - override val byteArray: IrClassSymbol get() = _byteArray.klass - override val shortArray: IrClassSymbol get() = _shortArray.klass - override val intArray: IrClassSymbol get() = _intArray.klass - override val longArray: IrClassSymbol get() = _longArray.klass - override val floatArray: IrClassSymbol get() = _floatArray.klass - override val doubleArray: IrClassSymbol get() = _doubleArray.klass + override val booleanArray: IrClassSymbol = loadPrimitiveArray(PrimitiveType.BOOLEAN) + override val charArray: IrClassSymbol = loadPrimitiveArray(PrimitiveType.CHAR) + override val byteArray: IrClassSymbol = loadPrimitiveArray(PrimitiveType.BYTE) + override val shortArray: IrClassSymbol = loadPrimitiveArray(PrimitiveType.SHORT) + override val intArray: IrClassSymbol = loadPrimitiveArray(PrimitiveType.INT) + override val longArray: IrClassSymbol = loadPrimitiveArray(PrimitiveType.LONG) + override val floatArray: IrClassSymbol = loadPrimitiveArray(PrimitiveType.FLOAT) + override val doubleArray: IrClassSymbol = loadPrimitiveArray(PrimitiveType.DOUBLE) override val primitiveArraysToPrimitiveTypes: Map by lazy { mapOf( @@ -396,42 +242,44 @@ class IrBuiltInsOverFir( override val ieee754equalsFunByOperandType: MutableMap get() = _ieee754equalsFunByOperandType - override var eqeqeqSymbol: IrSimpleFunctionSymbol private set - override var eqeqSymbol: IrSimpleFunctionSymbol private set - override var throwCceSymbol: IrSimpleFunctionSymbol private set - override var throwIseSymbol: IrSimpleFunctionSymbol private set - override var andandSymbol: IrSimpleFunctionSymbol private set - override var ororSymbol: IrSimpleFunctionSymbol private set - override var noWhenBranchMatchedExceptionSymbol: IrSimpleFunctionSymbol private set - override var illegalArgumentExceptionSymbol: IrSimpleFunctionSymbol private set - override var dataClassArrayMemberHashCodeSymbol: IrSimpleFunctionSymbol private set - override var dataClassArrayMemberToStringSymbol: IrSimpleFunctionSymbol private set + override lateinit var eqeqeqSymbol: IrSimpleFunctionSymbol private set + override lateinit var eqeqSymbol: IrSimpleFunctionSymbol private set + override lateinit var throwCceSymbol: IrSimpleFunctionSymbol private set + override lateinit var throwIseSymbol: IrSimpleFunctionSymbol private set + override lateinit var andandSymbol: IrSimpleFunctionSymbol private set + override lateinit var ororSymbol: IrSimpleFunctionSymbol private set + override lateinit var noWhenBranchMatchedExceptionSymbol: IrSimpleFunctionSymbol private set + override lateinit var illegalArgumentExceptionSymbol: IrSimpleFunctionSymbol private set + override lateinit var dataClassArrayMemberHashCodeSymbol: IrSimpleFunctionSymbol private set + override lateinit var dataClassArrayMemberToStringSymbol: IrSimpleFunctionSymbol private set - override var checkNotNullSymbol: IrSimpleFunctionSymbol private set - @OptIn(IrSymbolInternals::class) + override lateinit var checkNotNullSymbol: IrSimpleFunctionSymbol private set override val arrayOfNulls: IrSimpleFunctionSymbol by lazy { - findFunctions(kotlinPackage, Name.identifier("arrayOfNulls")).first { - it.owner.dispatchReceiverParameter == null && it.owner.valueParameters.size == 1 && - it.owner.valueParameters[0].type == intType - } + val firSymbol = symbolProvider + .getTopLevelFunctionSymbols(kotlinPackage, Name.identifier("arrayOfNulls")).first { + it.fir.valueParameters.singleOrNull()?.returnTypeRef?.coneType?.isInt == true + } + findFunction(firSymbol) } override val linkageErrorSymbol: IrSimpleFunctionSymbol get() = TODO("Not yet implemented") - override var lessFunByOperandType: Map private set - override var lessOrEqualFunByOperandType: Map private set - override var greaterOrEqualFunByOperandType: Map private set - override var greaterFunByOperandType: Map private set + override lateinit var lessFunByOperandType: Map private set + override lateinit var lessOrEqualFunByOperandType: Map private set + override lateinit var greaterOrEqualFunByOperandType: Map private set + override lateinit var greaterFunByOperandType: Map private set - init { + internal fun initialize() { + if (initialized) return + initialized = true with(this.operatorsPackageFragment) { fun addBuiltinOperatorSymbol( name: String, returnType: IrType, vararg valueParameterTypes: Pair, - isIntrinsicConst: Boolean = false + isIntrinsicConst: Boolean = false, ) = createFunction(name, returnType, valueParameterTypes, origin = BUILTIN_OPERATOR, isIntrinsicConst = isIntrinsicConst).also { declarations.add(it) @@ -453,9 +301,21 @@ class IrBuiltInsOverFir( throwCceSymbol = addBuiltinOperatorSymbol(BuiltInOperatorNames.THROW_CCE, nothingType) throwIseSymbol = addBuiltinOperatorSymbol(BuiltInOperatorNames.THROW_ISE, nothingType) andandSymbol = - addBuiltinOperatorSymbol(BuiltInOperatorNames.ANDAND, booleanType, "" to booleanType, "" to booleanType, isIntrinsicConst = true) + addBuiltinOperatorSymbol( + BuiltInOperatorNames.ANDAND, + booleanType, + "" to booleanType, + "" to booleanType, + isIntrinsicConst = true + ) ororSymbol = - addBuiltinOperatorSymbol(BuiltInOperatorNames.OROR, booleanType, "" to booleanType, "" to booleanType, isIntrinsicConst = true) + addBuiltinOperatorSymbol( + BuiltInOperatorNames.OROR, + booleanType, + "" to booleanType, + "" to booleanType, + isIntrinsicConst = true + ) noWhenBranchMatchedExceptionSymbol = addBuiltinOperatorSymbol(BuiltInOperatorNames.NO_WHEN_BRANCH_MATCHED_EXCEPTION, nothingType) illegalArgumentExceptionSymbol = @@ -489,7 +349,15 @@ class IrBuiltInsOverFir( } fun List.defineComparisonOperatorForEachIrType(name: String) = - associate { it.classifierOrFail to addBuiltinOperatorSymbol(name, booleanType, "" to it, "" to it, isIntrinsicConst = true) } + associate { + it.classifierOrFail to addBuiltinOperatorSymbol( + name, + booleanType, + "" to it, + "" to it, + isIntrinsicConst = true + ) + } lessFunByOperandType = primitiveIrTypesWithComparisons.defineComparisonOperatorForEachIrType(BuiltInOperatorNames.LESS) lessOrEqualFunByOperandType = @@ -502,15 +370,15 @@ class IrBuiltInsOverFir( } override val unsignedTypesToUnsignedArrays: Map by lazy { - UnsignedType.values().mapNotNull { unsignedType -> - val array = referenceClassByClassId(unsignedType.arrayClassId) + UnsignedType.entries.mapNotNull { unsignedType -> + val array = loadClassSafe(unsignedType.arrayClassId) if (array == null) null else unsignedType to array }.toMap() } @OptIn(IrSymbolInternals::class) override val unsignedArraysElementTypes: Map by lazy { - unsignedTypesToUnsignedArrays.map { (k,v) -> v to referenceClassByClassId(k.classId)?.owner?.defaultType }.toMap() + unsignedTypesToUnsignedArrays.map { (k, v) -> v to loadClass(k.classId).owner.defaultType }.toMap() } override fun getKPropertyClass(mutable: Boolean, n: Int): IrClassSymbol = when (n) { @@ -520,8 +388,7 @@ class IrBuiltInsOverFir( else -> error("No KProperty for n=$n mutable=$mutable") } - private val enum by loadClass(StandardClassIds.Enum) - override val enumClass: IrClassSymbol get() = enum.klass + override val enumClass: IrClassSymbol by lazy { loadClass(StandardClassIds.Enum) } @OptIn(IrSymbolInternals::class) override val intPlusSymbol: IrSimpleFunctionSymbol @@ -541,35 +408,33 @@ class IrBuiltInsOverFir( it.owner.name == OperatorNameConventions.XOR && it.owner.valueParameters[0].type == intType } - @OptIn(IrSymbolInternals::class) override val extensionToString: IrSimpleFunctionSymbol by lazy { - findFunctions(kotlinPackage, OperatorNameConventions.TO_STRING).single { function -> - function.owner.extensionReceiverParameter?.let { receiver -> receiver.type == anyNType } ?: false + val firFunctionSymbol = symbolProvider.getTopLevelFunctionSymbols(kotlinPackage, OperatorNameConventions.TO_STRING).single { + it.receiverParameter?.typeRef?.coneType?.isNullableAny == true } + findFunction(firFunctionSymbol) } - @OptIn(IrSymbolInternals::class) override val memberToString: IrSimpleFunctionSymbol by lazy { - findBuiltInClassMemberFunctions(anyClass, OperatorNameConventions.TO_STRING).single { function -> - function.owner.valueParameters.isEmpty() + val firFunction = findFirMemberFunctions(StandardClassIds.Any, OperatorNameConventions.TO_STRING).single { + it.fir.valueParameters.isEmpty() } + findFunction(firFunction) } - @OptIn(IrSymbolInternals::class) override val extensionStringPlus: IrSimpleFunctionSymbol by lazy { - findFunctions(kotlinPackage, OperatorNameConventions.PLUS).single { function -> - val isStringExtension = - function.owner.extensionReceiverParameter?.let { receiver -> receiver.type == stringType.makeNullable() } - ?: false - isStringExtension && function.owner.valueParameters.size == 1 && function.owner.valueParameters[0].type == anyNType + val firFunction = symbolProvider.getTopLevelFunctionSymbols(kotlinPackage, OperatorNameConventions.PLUS).single { symbol -> + val isStringExtension = symbol.fir.receiverParameter?.typeRef?.coneType?.isNullableString == true + isStringExtension && symbol.fir.valueParameters.singleOrNull { it.returnTypeRef.coneType.isNullableAny } != null } + findFunction(firFunction) } - @OptIn(IrSymbolInternals::class) override val memberStringPlus: IrSimpleFunctionSymbol by lazy { - findBuiltInClassMemberFunctions(stringClass, OperatorNameConventions.PLUS).single { function -> - function.owner.valueParameters.size == 1 && function.owner.valueParameters[0].type == anyNType + val firFunction = findFirMemberFunctions(StandardClassIds.String, OperatorNameConventions.PLUS).single { + it.fir.valueParameters.singleOrNull()?.returnTypeRef?.coneType?.isNullableAny == true } + findFunction(firFunction) } override val arrayOf: IrSimpleFunctionSymbol by lazy { @@ -578,35 +443,31 @@ class IrBuiltInsOverFir( findFunctions(kotlinPackage, Name.identifier("arrayOf")).distinct().single() } - private fun getFunctionsByKey( + override fun getNonBuiltInFunctionsByExtensionReceiver( name: Name, vararg packageNameSegments: String, - makeKey: (IrSimpleFunctionSymbol) -> T? - ): Map { - val result = mutableMapOf() - for (fn in findFunctions(name, *packageNameSegments)) { - makeKey(fn)?.let { key -> - result[key] = fn - } - } - return result + ): Map { + return getFunctionsByKey( + name, + *packageNameSegments, + mapKey = { symbol -> + with(components) { symbol.fir.receiverParameter?.typeRef?.toIrType(typeConverter)?.classifierOrNull } + }, + mapValue = { _, irSymbol -> irSymbol } + ) } - @OptIn(IrSymbolInternals::class) - override fun getNonBuiltInFunctionsByExtensionReceiver( - name: Name, vararg packageNameSegments: String - ): Map = - getFunctionsByKey(name, *packageNameSegments) { fn -> - fn.owner.extensionReceiverParameter?.type?.classifierOrNull - } - - @OptIn(IrSymbolInternals::class) override fun getNonBuiltinFunctionsByReturnType( - name: Name, vararg packageNameSegments: String - ): Map = - getFunctionsByKey(name, *packageNameSegments) { fn -> - fn.owner.returnType.classOrNull - } + name: Name, + vararg packageNameSegments: String, + ): Map { + return getFunctionsByKey( + name, + *packageNameSegments, + mapKey = { with(components) { it.fir.returnTypeRef.toIrType(typeConverter).classifierOrNull } }, + mapValue = { _, irSymbol -> irSymbol } + ) + } private val functionNMap = mutableMapOf() private val kFunctionNMap = mutableMapOf() @@ -615,22 +476,22 @@ class IrBuiltInsOverFir( @OptIn(IrSymbolInternals::class) override fun functionN(arity: Int): IrClass = functionNMap.getOrPut(arity) { - referenceClassByClassId(StandardClassIds.FunctionN(arity))!!.owner + loadClass(StandardClassIds.FunctionN(arity)).owner } @OptIn(IrSymbolInternals::class) override fun kFunctionN(arity: Int): IrClass = kFunctionNMap.getOrPut(arity) { - referenceClassByClassId(StandardClassIds.KFunctionN(arity))!!.owner + loadClass(StandardClassIds.KFunctionN(arity)).owner } @OptIn(IrSymbolInternals::class) override fun suspendFunctionN(arity: Int): IrClass = suspendFunctionNMap.getOrPut(arity) { - referenceClassByClassId(StandardClassIds.SuspendFunctionN(arity))!!.owner + loadClass(StandardClassIds.SuspendFunctionN(arity)).owner } @OptIn(IrSymbolInternals::class) override fun kSuspendFunctionN(arity: Int): IrClass = kSuspendFunctionNMap.getOrPut(arity) { - referenceClassByClassId(StandardClassIds.KSuspendFunctionN(arity))!!.owner + loadClass(StandardClassIds.KSuspendFunctionN(arity)).owner } override fun findFunctions(name: Name, vararg packageNameSegments: String): Iterable = @@ -648,16 +509,12 @@ class IrBuiltInsOverFir( override fun findClass(name: Name, packageFqName: FqName): IrClassSymbol? = referenceClassByFqname(packageFqName, name) - private fun referenceClassByFqname(packageName: FqName, identifier: Name) = - referenceClassByClassId(ClassId(packageName, identifier)) - - private val builtInClasses by lazy { - setOf(anyClass) + private fun referenceClassByFqname(packageName: FqName, identifier: Name): IrClassSymbol? { + return loadClassSafe(ClassId(packageName, identifier)) } @OptIn(IrSymbolInternals::class) override fun findBuiltInClassMemberFunctions(builtInClass: IrClassSymbol, name: Name): Iterable { - require(builtInClass in builtInClasses) return builtInClass.functions.filter { it.owner.name == name }.asIterable() } @@ -677,102 +534,16 @@ class IrBuiltInsOverFir( // --------------- - class BuiltInClassValue( - private val generatedClass: IrClassSymbol, - private var lazyContents: (IrClass.() -> Unit)? - ) { - @OptIn(IrSymbolInternals::class) - fun ensureLazyContentsCreated() { - if (lazyContents != null) synchronized(this) { - lazyContents?.invoke(generatedClass.owner) - lazyContents = null - } - } - - val klass: IrClassSymbol - get() { - ensureLazyContentsCreated() - return generatedClass - } - - val type: IrType get() = generatedClass.defaultType + private fun referenceClassByFqname(topLevelFqName: FqName): IrClassSymbol? { + return loadClassSafe(ClassId.topLevel(topLevelFqName)) } - private inner class BuiltInsClass( - private var generator: (() -> Pair)?, - private var lazyContents: (IrClass.() -> Unit)? = null - ) { - - private var value: BuiltInClassValue? = null - - operator fun getValue(thisRef: Any?, property: KProperty<*>): BuiltInClassValue = value ?: run { - synchronized(this) { - if (value == null) { - val (isLoaded, symbol) = generator!!() - value = BuiltInClassValue(symbol, if (isLoaded) null else lazyContents) - generator = null - lazyContents = null - } - } - value!! - } + private fun loadClass(classId: ClassId): IrClassSymbol { + return loadClassSafe(classId) ?: error("Class not found: $classId") } - private fun loadClass(classId: ClassId) = BuiltInsClass({ true to referenceClassByClassId(classId)!! }) - - private fun createClass( - parent: IrDeclarationParent, - signature: IdSignature.CommonSignature, - build: IrClassBuilder.() -> Unit = {}, - lazyContents: (IrClass.() -> Unit) = { finalizeClassDefinition() } - ) = BuiltInsClass( - generator = { - val loaded = if (tryLoadBuiltInsFirst) { - referenceClassByClassId(ClassId(parent.kotlinFqName, Name.identifier(signature.shortName))) - } else null - (loaded != null) to (loaded ?: components.symbolTable.declareClass( - signature, - { IrClassPublicSymbolImpl(signature) }, - { symbol -> - IrClassBuilder().run { - name = Name.identifier(signature.shortName) - origin = IrDeclarationOrigin.IR_EXTERNAL_DECLARATION_STUB - build() - irFactory.createClass( - startOffset = startOffset, - endOffset = endOffset, - origin = origin, - name = name, - visibility = visibility, - symbol = symbol, - kind = kind, - modality = modality, - isExternal = isExternal, - isCompanion = isCompanion, - isInner = isInner, - isData = isData, - isValue = isValue, - isExpect = isExpect, - isFun = isFun, - ) - }.also { - it.parent = parent - it.createImplicitParameterDeclarationWithWrappedDescriptor() - components.symbolTable.declareClassWithSignature(irSignatureBuilder.computeSignature(it), it.symbol) - } - } - ).symbol) - }, - lazyContents = lazyContents - ) - - private fun referenceClassByFqname(topLevelFqName: FqName) = - referenceClassByClassId(ClassId.topLevel(topLevelFqName)) - - private fun referenceClassByClassId(classId: ClassId): IrClassSymbol? { - val firClassSymbol = components.session.symbolProvider.getClassLikeSymbolByClassId(classId) as? FirClassSymbol ?: return null - firClassSymbol.lazyResolveToPhaseWithoutContractCheck(FirResolvePhase.STATUS) - + private fun loadClassSafe(classId: ClassId): IrClassSymbol? { + val firClassSymbol = symbolProvider.getClassLikeSymbolByClassId(classId) as? FirRegularClassSymbol ?: return null return components.classifierStorage.getIrClassSymbol(firClassSymbol) } @@ -786,166 +557,6 @@ class IrBuiltInsOverFir( private fun createPackage(fqName: FqName): IrExternalPackageFragment = IrExternalPackageFragmentImpl.createEmptyExternalPackageFragment(moduleDescriptor, fqName) - private fun IrDeclarationParent.createClass( - fqName: FqName, - vararg supertypes: IrType, - classKind: ClassKind = ClassKind.CLASS, - classModality: Modality = Modality.OPEN, - builderBlock: IrClassBuilder.() -> Unit = {}, - block: IrClass.() -> Unit = {} - ): IrClassSymbol { - val signature = getPublicSignature(fqName.parent(), fqName.shortName().asString()) - - return this.createClass( - signature, *supertypes, - classKind = classKind, classModality = classModality, builderBlock = builderBlock, block = block - ) - } - - private fun IrDeclarationParent.createClass( - signature: IdSignature.CommonSignature, - vararg supertypes: IrType, - classKind: ClassKind = ClassKind.CLASS, - classModality: Modality = Modality.OPEN, - builderBlock: IrClassBuilder.() -> Unit = {}, - block: IrClass.() -> Unit = {} - ): IrClassSymbol = components.symbolTable.declareClass( - signature, - { IrClassPublicSymbolImpl(signature) }, - { symbol -> - IrClassBuilder().run { - name = Name.identifier(signature.shortName) - kind = classKind - modality = classModality - origin = IrDeclarationOrigin.IR_EXTERNAL_DECLARATION_STUB - builderBlock() - irFactory.createClass( - startOffset = startOffset, - endOffset = endOffset, - origin = origin, - name = name, - visibility = visibility, - symbol = symbol, - kind = kind, - modality = modality, - isExternal = isExternal, - isCompanion = isCompanion, - isInner = isInner, - isData = isData, - isValue = isValue, - isExpect = isExpect, - isFun = isFun, - ) - }.also { - it.parent = this - it.createImplicitParameterDeclarationWithWrappedDescriptor() - it.block() - it.superTypes = supertypes.asList() - } - } - ).symbol - - private fun IrClass.createConstructor( - origin: IrDeclarationOrigin = object : IrDeclarationOriginImpl("BUILTIN_CLASS_CONSTRUCTOR") {}, - isPrimary: Boolean = true, - visibility: DescriptorVisibility = DescriptorVisibilities.PUBLIC, - build: IrConstructor.() -> Unit = {} - ): IrConstructorSymbol { - val name = SpecialNames.INIT - val ctor = irFactory.createConstructor( - startOffset = UNDEFINED_OFFSET, - endOffset = UNDEFINED_OFFSET, - origin = origin, - name = name, - visibility = visibility, - isInline = false, - isExpect = false, - returnType = defaultType, - symbol = IrConstructorSymbolImpl(), - isPrimary = isPrimary, - isExternal = false, - ) - ctor.parent = this - ctor.build() - declarations.add(ctor) - components.symbolTable.declareConstructorWithSignature( - irSignatureBuilder.computeSignature(ctor), ctor.symbol - ) - return ctor.symbol - } - - private fun IrClass.forEachSuperClass(body: IrClass.() -> Unit) { - for (st in superTypes) { - st.getClass()?.let { - it.body() - it.forEachSuperClass(body) - } - } - } - - private fun IrClass.createMemberFunction( - name: String, returnType: IrType, vararg valueParameterTypes: Pair, - origin: IrDeclarationOrigin = object : IrDeclarationOriginImpl("BUILTIN_CLASS_METHOD") {}, - modality: Modality = Modality.FINAL, - isOperator: Boolean = false, - isInfix: Boolean = false, - isIntrinsicConst: Boolean = true, - build: IrFunctionBuilder.() -> Unit = {} - ) = createFunction( - name, returnType, valueParameterTypes, - origin = origin, modality = modality, isOperator = isOperator, isInfix = isInfix, isIntrinsicConst = isIntrinsicConst, - postBuild = { - addDispatchReceiver { type = this@createMemberFunction.defaultType } - }, - build = build - ).also { fn -> - // very simple and fragile logic, but works for all current usages - // TODO: replace with correct logic or explicit specification if cases become more complex - forEachSuperClass { - functions.find { - it.name == fn.name && it.typeParameters.count() == fn.typeParameters.count() && - it.valueParameters.count() == fn.valueParameters.count() && - it.valueParameters.zip(fn.valueParameters).all { (l, r) -> l.type == r.type } - }?.let { - assert(it.symbol != fn) { "Cannot add function $fn to its own overriddenSymbols" } - fn.overriddenSymbols += it.symbol - } - } - - declarations.add(fn) - } - - private fun IrClass.createMemberFunction( - name: Name, returnType: IrType, vararg valueParameterTypes: Pair, - origin: IrDeclarationOrigin = object : IrDeclarationOriginImpl("BUILTIN_CLASS_METHOD") {}, - modality: Modality = Modality.FINAL, - isOperator: Boolean = false, - isInfix: Boolean = false, - isIntrinsicConst: Boolean = true, - build: IrFunctionBuilder.() -> Unit = {} - ) = - createMemberFunction( - name.asString(), returnType, *valueParameterTypes, - origin = origin, modality = modality, isOperator = isOperator, isInfix = isInfix, - isIntrinsicConst = isIntrinsicConst, build = build - ) - - private fun IrClass.configureSuperTypes(vararg superTypes: BuiltInClassValue, defaultAny: Boolean = true) { - for (superType in superTypes) { - superType.ensureLazyContentsCreated() - } - if (!defaultAny || superTypes.contains(any) || this.superTypes.contains(anyType)) { - this.superTypes += superTypes.map { it.type } - } else { - any.ensureLazyContentsCreated() - this.superTypes += superTypes.map { it.type } + anyType - } - } - - private fun IrClass.finalizeClassDefinition() { - addFakeOverrides(IrTypeSystemContextImpl(this@IrBuiltInsOverFir)) - } - private fun IrDeclarationParent.createFunction( name: String, returnType: IrType, @@ -1002,260 +613,58 @@ class IrBuiltInsOverFir( val irFun4SignatureCalculation = makeWithSymbol(IrSimpleFunctionSymbolImpl()) val signature = irSignatureBuilder.computeSignature(irFun4SignatureCalculation) - return components.symbolTable.declareSimpleFunction(signature, { IrSimpleFunctionPublicSymbolImpl(signature, null) }, ::makeWithSymbol) - } - - private fun IrClass.addArrayMembers(elementType: IrType, iteratorType: IrType) { - addConstructor { - origin = object : IrDeclarationOriginImpl("BUILTIN_CLASS_CONSTRUCTOR") {} - returnType = defaultType - isPrimary = true - }.also { - it.addValueParameter("size", intType, object : IrDeclarationOriginImpl("BUILTIN_CLASS_CONSTRUCTOR") {}) - } - createMemberFunction(OperatorNameConventions.GET, elementType, "index" to intType, isOperator = true, isIntrinsicConst = false) - createMemberFunction(OperatorNameConventions.SET, unitType, "index" to intType, "value" to elementType, isOperator = true, isIntrinsicConst = false) - createProperty("size", intType) - createMemberFunction(OperatorNameConventions.ITERATOR, iteratorType, isOperator = true) - } - - @OptIn(IrSymbolInternals::class) - private fun IrClass.createProperty( - propertyName: String, returnType: IrType, - modality: Modality = Modality.FINAL, - isConst: Boolean = false, withGetter: Boolean = true, withField: Boolean = false, isIntrinsicConst: Boolean = false, - fieldInit: IrExpression? = null, - builder: IrProperty.() -> Unit = {} - ) { - addProperty { - this.name = Name.identifier(propertyName) - this.isConst = isConst - this.modality = modality - }.also { property -> - - // very simple and fragile logic, but works for all current usages - // TODO: replace with correct logic or explicit specification if cases become more complex - forEachSuperClass { - properties.find { it.name == property.name }?.let { - assert(property != it.symbol) { "Cannot add property $property to its own overriddenSymbols"} - property.overriddenSymbols += it.symbol - } - } - - if (isIntrinsicConst) { - property.annotations += intrinsicConstAnnotation - } - - if (withGetter) { - property.addGetter { - this.returnType = returnType - this.modality = modality - this.isOperator = false - }.also { getter -> - getter.addDispatchReceiver { type = this@createProperty.defaultType } - getter.overriddenSymbols = property.overriddenSymbols.mapNotNull { it.owner.getter?.symbol } - } - } - if (withField || fieldInit != null) { - property.addBackingField { - this.type = returnType - this.isFinal = isConst - }.also { - if (fieldInit != null) { - it.initializer = irFactory.createExpressionBody( - startOffset = 0, - endOffset = 0, - expression = fieldInit, - ) - } - } - } - property.builder() - components.symbolTable.declarePropertyWithSignature( - irSignatureBuilder.computeSignature(property), property.symbol - ) - property.getter?.let { - components.symbolTable.declareSimpleFunctionWithSignature( - irSignatureBuilder.computeSignature(it), it.symbol - ) - } - property.backingField?.let { - components.symbolTable.declareFieldWithSignature( - irSignatureBuilder.computeSignature(it), it.symbol - ) - } - } - } - - private class NumericConstantsExpressions( - val min: IrConst, - val max: IrConst, - val sizeBytes: IrConst, - val sizeBits: IrConst - ) - - private fun getNumericConstantsExpressions(type: IrType): NumericConstantsExpressions<*> { - val so = UNDEFINED_OFFSET - val eo = UNDEFINED_OFFSET - return when (type.getPrimitiveType()) { - PrimitiveType.CHAR -> NumericConstantsExpressions( - IrConstImpl.char(so, eo, type, Char.MIN_VALUE), IrConstImpl.char(so, eo, type, Char.MAX_VALUE), - IrConstImpl.int(so, eo, intType, Char.SIZE_BYTES), IrConstImpl.int(so, eo, intType, Char.SIZE_BITS) - ) - PrimitiveType.BYTE -> NumericConstantsExpressions( - IrConstImpl.byte(so, eo, type, Byte.MIN_VALUE), IrConstImpl.byte(so, eo, type, Byte.MAX_VALUE), - IrConstImpl.int(so, eo, intType, Byte.SIZE_BYTES), IrConstImpl.int(so, eo, intType, Byte.SIZE_BITS) - ) - PrimitiveType.SHORT -> NumericConstantsExpressions( - IrConstImpl.short(so, eo, type, Short.MIN_VALUE), IrConstImpl.short(so, eo, type, Short.MAX_VALUE), - IrConstImpl.int(so, eo, intType, Short.SIZE_BYTES), IrConstImpl.int(so, eo, intType, Short.SIZE_BITS) - ) - PrimitiveType.INT -> NumericConstantsExpressions( - IrConstImpl.int(so, eo, type, Int.MIN_VALUE), IrConstImpl.int(so, eo, type, Int.MAX_VALUE), - IrConstImpl.int(so, eo, intType, Int.SIZE_BYTES), IrConstImpl.int(so, eo, intType, Int.SIZE_BITS) - ) - PrimitiveType.LONG -> NumericConstantsExpressions( - IrConstImpl.long(so, eo, type, Long.MIN_VALUE), IrConstImpl.long(so, eo, type, Long.MAX_VALUE), - IrConstImpl.int(so, eo, intType, Long.SIZE_BYTES), IrConstImpl.int(so, eo, intType, Long.SIZE_BITS) - ) - PrimitiveType.FLOAT -> NumericConstantsExpressions( - IrConstImpl.float(so, eo, type, Float.MIN_VALUE), IrConstImpl.float(so, eo, type, Float.MAX_VALUE), - IrConstImpl.int(so, eo, intType, Float.SIZE_BYTES), IrConstImpl.int(so, eo, intType, Float.SIZE_BITS) - ) - PrimitiveType.DOUBLE -> NumericConstantsExpressions( - IrConstImpl.double(so, eo, type, Double.MIN_VALUE), IrConstImpl.double(so, eo, type, Double.MAX_VALUE), - IrConstImpl.int(so, eo, intType, Double.SIZE_BYTES), IrConstImpl.int(so, eo, intType, Double.SIZE_BITS) - ) - else -> error("unsupported type") - } - } - - private fun IrPackageFragment.createNumberClass( - signature: IdSignature.CommonSignature, - lazyContents: (IrClass.() -> Unit)? = null - ) = - createClass(this, signature) { - configureSuperTypes(number) - val thisType = defaultType - createStandardNumericAndCharMembers(thisType) - createStandardNumericMembers(thisType) - if (thisType in primitiveIntegralIrTypes) { - createStandardRangeMembers(thisType) - } - if (thisType == intType || thisType == longType) { - createStandardBitwiseOps(thisType) - } - lazyContents?.invoke(this) - createIntrinsicConstOfToStringAndEquals() - finalizeClassDefinition() - } - - private fun createPrimitiveArrayClass( - parent: IrDeclarationParent, - primitiveType: PrimitiveType, - primitiveIterator: BuiltInClassValue - ) = - createClass( - parent, - getPublicSignature(parent.kotlinFqName, primitiveType.arrayTypeName.asString()), - build = { modality = Modality.FINAL } - ) { - configureSuperTypes() - primitiveIterator.ensureLazyContentsCreated() - addArrayMembers(primitiveTypeToIrType[primitiveType]!!, primitiveIterator.type) - finalizeClassDefinition() - } - - @OptIn(IrSymbolInternals::class) - private fun IrClass.createCompanionObject(block: IrClass.() -> Unit = {}): IrClassSymbol = - this.createClass( - kotlinFqName.child(Name.identifier("Companion")), classKind = ClassKind.OBJECT, builderBlock = { - isCompanion = true - } - ).also { - it.owner.block() - declarations.add(it.owner) - } - - private fun IrClass.createStandardBitwiseOps(thisType: IrType) { - for (op in bitwiseOperators) { - createMemberFunction(op, thisType, "other" to thisType, isInfix = true) - } - for (op in shiftOperators) { - createMemberFunction(op, thisType, "bitCount" to intType, isInfix = true) - } - createMemberFunction(OperatorNameConventions.INV, thisType) - } - - private fun IrClass.createStandardRangeMembers(thisType: IrType) { - for (argType in primitiveIntegralIrTypes) { - createMemberFunction( - OperatorNameConventions.RANGE_TO, - if (thisType == longType || argType == longType) longRangeType else intRangeType, - "other" to argType, isOperator = true, isIntrinsicConst = false - ) - } - } - - private fun IrClass.createStandardNumericMembers(thisType: IrType) { - for (argument in primitiveNumericIrTypes) { - createMemberFunction( - OperatorNameConventions.COMPARE_TO, intType, "other" to argument, - modality = if (argument == thisType) Modality.OPEN else Modality.FINAL, - isOperator = true - ) - val targetArithmeticReturnType = getPrimitiveArithmeticOperatorResultType(thisType, argument) - for (op in arithmeticOperators) { - createMemberFunction(op, targetArithmeticReturnType, "other" to argument, isOperator = true) - } - } - val arithmeticReturnType = getPrimitiveArithmeticOperatorResultType(thisType, thisType) - createMemberFunction(OperatorNameConventions.UNARY_PLUS, arithmeticReturnType, isOperator = true) - createMemberFunction(OperatorNameConventions.UNARY_MINUS, arithmeticReturnType, isOperator = true) - } - - private fun IrClass.createStandardNumericAndCharMembers(thisType: IrType) { - createCompanionObject { - val constExprs = getNumericConstantsExpressions(thisType) - createProperty("MIN_VALUE", thisType, isConst = true, withGetter = false, fieldInit = constExprs.min) - createProperty("MAX_VALUE", thisType, isConst = true, withGetter = false, fieldInit = constExprs.max) - createProperty("SIZE_BYTES", intType, isConst = true, withGetter = false, fieldInit = constExprs.sizeBytes) - createProperty("SIZE_BITS", intType, isConst = true, withGetter = false, fieldInit = constExprs.sizeBits) - } - for (targetPrimitive in primitiveIrTypesWithComparisons) { - createMemberFunction("to${targetPrimitive.classFqName!!.shortName().asString()}", targetPrimitive, modality = Modality.OPEN) - } - createMemberFunction(OperatorNameConventions.INC, thisType, isOperator = true, isIntrinsicConst = false) - createMemberFunction(OperatorNameConventions.DEC, thisType, isOperator = true, isIntrinsicConst = false) - } - - private fun IrClass.createIntrinsicConstOfToStringAndEquals() { - createMemberFunction(OperatorNameConventions.TO_STRING, stringType) - createMemberFunction( - OperatorNameConventions.EQUALS, booleanType, "other" to anyNType, - modality = Modality.OPEN, isOperator = true + return components.symbolTable.declareSimpleFunction( + signature, + { IrSimpleFunctionPublicSymbolImpl(signature, null) }, + ::makeWithSymbol ) } private fun findFunctions(packageName: FqName, name: Name): List { - return components.session.symbolProvider.getTopLevelFunctionSymbols(packageName, name) - .onEach { it.lazyResolveToPhaseWithoutContractCheck(FirResolvePhase.STATUS) } - .mapNotNull { components.declarationStorage.getIrFunctionSymbol(it) as? IrSimpleFunctionSymbol } + return symbolProvider.getTopLevelFunctionSymbols(packageName, name).map { findFunction(it) } + } + + private inline fun getFunctionsByKey( + name: Name, + vararg packageNameSegments: String, + mapKey: (FirNamedFunctionSymbol) -> K?, + mapValue: (FirNamedFunctionSymbol, IrSimpleFunctionSymbol) -> T + ): Map { + val packageName = FqName.fromSegments(packageNameSegments.asList()) + val result = mutableMapOf() + for (functionSymbol in symbolProvider.getTopLevelFunctionSymbols(packageName, name)) { + val key = mapKey(functionSymbol) ?: continue + val irFunctionSymbol = findFunction(functionSymbol) + result[key] = mapValue(functionSymbol, irFunctionSymbol) + } + return result + } + + private fun findFunction(functionSymbol: FirNamedFunctionSymbol): IrSimpleFunctionSymbol { + val irParent = findIrParent(functionSymbol) + return components.declarationStorage.getOrCreateIrFunction(functionSymbol.fir, irParent).symbol } private fun findProperties(packageName: FqName, name: Name): List { - return components.session.symbolProvider.getTopLevelPropertySymbols(packageName, name) - .onEach { it.lazyResolveToPhaseWithoutContractCheck(FirResolvePhase.STATUS) } - .mapNotNull { components.declarationStorage.getIrPropertySymbol(it) as? IrPropertySymbol } - } - - private fun FirBasedSymbol<*>.lazyResolveToPhaseWithoutContractCheck(toPhase: FirResolvePhase) { - val session = moduleData.session - - // In the compiler, the declaration should have been already resolved. - // In the IDE, the contract check is not active. - session.lazyDeclarationResolver.disableLazyResolveContractChecksInside { - lazyResolveToPhase(toPhase) + return symbolProvider.getTopLevelPropertySymbols(packageName, name).map { firOpSymbol -> + val irParent = findIrParent(firOpSymbol) + components.declarationStorage.getOrCreateIrProperty(firOpSymbol.fir, irParent).symbol } } + + private fun findIrParent(firSymbol: FirCallableSymbol<*>): IrDeclarationParent? { + return when (val containingClassLookupTag = firSymbol.containingClassLookupTag()) { + null -> components.declarationStorage.getIrExternalPackageFragment(firSymbol.callableId.packageName) + else -> components.classifierStorage.findIrClass(containingClassLookupTag) + } + } + + private val IrClassSymbol.defaultTypeWithoutArguments: IrSimpleType + get() = IrSimpleTypeImpl( + kotlinType = null, + classifier = this, + nullability = SimpleTypeNullability.DEFINITELY_NOT_NULL, + arguments = emptyList(), + annotations = emptyList() + ) } diff --git a/compiler/testData/codegen/box/fullJdk/charBuffer.kt b/compiler/testData/codegen/box/fullJdk/charBuffer.kt index 7d7f2702e91..c54151255bb 100644 --- a/compiler/testData/codegen/box/fullJdk/charBuffer.kt +++ b/compiler/testData/codegen/box/fullJdk/charBuffer.kt @@ -1,5 +1,6 @@ // TARGET_BACKEND: JVM - +// IGNORE_BACKEND_K2: JVM_IR +// Ignore reason: KT-61282 // FULL_JDK import java.nio.CharBuffer diff --git a/compiler/testData/codegen/box/specialBuiltins/charBuffer.kt b/compiler/testData/codegen/box/specialBuiltins/charBuffer.kt index a9f98930c08..db57c72b187 100644 --- a/compiler/testData/codegen/box/specialBuiltins/charBuffer.kt +++ b/compiler/testData/codegen/box/specialBuiltins/charBuffer.kt @@ -1,4 +1,6 @@ // TARGET_BACKEND: JVM +// IGNORE_BACKEND_K2: JVM_IR +// Ignore reason: KT-61282 // MODULE: lib // FILE: CharBuffer.java diff --git a/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.ir.txt b/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.ir.txt index 333bb034c7f..04845b0feef 100644 --- a/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.ir.txt @@ -169,7 +169,7 @@ FILE fqName: fileName:/enumWithMultipleCtors.kt VALUE_PARAMETER name:x index:0 type:kotlin.Int BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'private constructor (arg: kotlin.String) declared in .A' - arg: CALL 'public final fun toString (): kotlin.String declared in kotlin.Int' type=kotlin.String origin=null + arg: CALL 'public open fun toString (): kotlin.String declared in kotlin.Int' type=kotlin.String origin=null $this: GET_VAR 'x: kotlin.Int declared in .A.' type=kotlin.Int origin=null CALL 'public final fun (: kotlin.String): kotlin.Unit declared in .A' type=kotlin.Unit origin=EQ $this: GET_VAR ': .A declared in .A' type=.A origin=null diff --git a/compiler/testData/ir/irText/stubs/arraysFromBuiltins.__kotlin.Array.fir.ir.txt b/compiler/testData/ir/irText/stubs/arraysFromBuiltins.__kotlin.Array.fir.ir.txt index 2e7d62c8acc..c1c661e229a 100644 --- a/compiler/testData/ir/irText/stubs/arraysFromBuiltins.__kotlin.Array.fir.ir.txt +++ b/compiler/testData/ir/irText/stubs/arraysFromBuiltins.__kotlin.Array.fir.ir.txt @@ -1,33 +1,43 @@ CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Array modality:FINAL visibility:public superTypes:[kotlin.Any; kotlin.Cloneable; java.io.Serializable] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:kotlin.Array TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR BUILTIN_CLASS_CONSTRUCTOR visibility:public <> (size:kotlin.Int) returnType:kotlin.Array [primary] - VALUE_PARAMETER BUILTIN_CLASS_CONSTRUCTOR name:size index:0 type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:get visibility:public modality:FINAL <> ($this:kotlin.Array, index:kotlin.Int) returnType:T of kotlin.Array [operator] - $this: VALUE_PARAMETER name:$this type:kotlin.Array - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:index index:0 type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:set visibility:public modality:FINAL <> ($this:kotlin.Array, index:kotlin.Int, value:T of kotlin.Array) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name:$this type:kotlin.Array - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:index index:0 type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:value index:1 type:T of kotlin.Array - PROPERTY name:size visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($this:kotlin.Array) returnType:kotlin.Int - correspondingProperty: PROPERTY name:size visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name:$this type:kotlin.Array - FUN BUILTIN_CLASS_METHOD name:iterator visibility:public modality:FINAL <> ($this:kotlin.Array) returnType:kotlin.collections.Iterator [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Array - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + CONSTRUCTOR IR_EXTERNAL_DECLARATION_STUB visibility:public <> (size:kotlin.Int, init:kotlin.Function1) returnType:kotlin.Array + VALUE_PARAMETER name:size index:0 type:kotlin.Int + VALUE_PARAMETER name:init index:1 type:kotlin.Function1 + FUN IR_EXTERNAL_DECLARATION_STUB name:get visibility:public modality:FINAL <> ($this:kotlin.Array, index:kotlin.Int) returnType:T of kotlin.Array [operator] + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Array + VALUE_PARAMETER name:index index:0 type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:iterator visibility:public modality:FINAL <> ($this:kotlin.Array) returnType:kotlin.collections.Iterator [operator] + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Array + FUN IR_EXTERNAL_DECLARATION_STUB name:set visibility:public modality:FINAL <> ($this:kotlin.Array, index:kotlin.Int, value:T of kotlin.Array) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Array + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:value index:1 type:T of kotlin.Array + PROPERTY IR_EXTERNAL_DECLARATION_STUB name:size visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:size type:kotlin.Int visibility:public [final] + FUN IR_EXTERNAL_DECLARATION_STUB name: visibility:public modality:FINAL <> ($this:kotlin.Array) returnType:kotlin.Int + correspondingProperty: PROPERTY IR_EXTERNAL_DECLARATION_STUB name:size visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Array + FUN IR_EXTERNAL_DECLARATION_STUB name:clone visibility:public modality:FINAL <> ($this:kotlin.Array) returnType:kotlin.Array overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name:$this type:kotlin.Any - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name:$this type:kotlin.Any - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + protected open fun clone (): kotlin.Any declared in kotlin.Cloneable + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Array + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Array, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name:$this type:kotlin.Any - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Any? + public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in kotlin.Cloneable + public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in java.io.Serializable + $this: VALUE_PARAMETER FAKE_OVERRIDE name: type:kotlin.Array + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Array) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Cloneable + public open fun hashCode (): kotlin.Int [fake_override] declared in java.io.Serializable + $this: VALUE_PARAMETER FAKE_OVERRIDE name: type:kotlin.Array + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Array) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + public open fun toString (): kotlin.String [fake_override] declared in kotlin.Cloneable + public open fun toString (): kotlin.String [fake_override] declared in java.io.Serializable + $this: VALUE_PARAMETER FAKE_OVERRIDE name: type:kotlin.Array diff --git a/compiler/testData/ir/irText/stubs/arraysFromBuiltins.__kotlin.IntArray.fir.ir.txt b/compiler/testData/ir/irText/stubs/arraysFromBuiltins.__kotlin.IntArray.fir.ir.txt index 3cc141c728b..ce345f57218 100644 --- a/compiler/testData/ir/irText/stubs/arraysFromBuiltins.__kotlin.IntArray.fir.ir.txt +++ b/compiler/testData/ir/irText/stubs/arraysFromBuiltins.__kotlin.IntArray.fir.ir.txt @@ -1,32 +1,44 @@ CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:IntArray modality:FINAL visibility:public superTypes:[kotlin.Any; kotlin.Cloneable; java.io.Serializable] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:kotlin.IntArray - CONSTRUCTOR BUILTIN_CLASS_CONSTRUCTOR visibility:public <> (size:kotlin.Int) returnType:kotlin.IntArray [primary] - VALUE_PARAMETER BUILTIN_CLASS_CONSTRUCTOR name:size index:0 type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:get visibility:public modality:FINAL <> ($this:kotlin.IntArray, index:kotlin.Int) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name:$this type:kotlin.IntArray - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:index index:0 type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:set visibility:public modality:FINAL <> ($this:kotlin.IntArray, index:kotlin.Int, value:kotlin.Int) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name:$this type:kotlin.IntArray - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:index index:0 type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:value index:1 type:kotlin.Int - PROPERTY name:size visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($this:kotlin.IntArray) returnType:kotlin.Int - correspondingProperty: PROPERTY name:size visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name:$this type:kotlin.IntArray - FUN BUILTIN_CLASS_METHOD name:iterator visibility:public modality:FINAL <> ($this:kotlin.IntArray) returnType:kotlin.collections.IntIterator [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.IntArray - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + CONSTRUCTOR IR_EXTERNAL_DECLARATION_STUB visibility:public <> (size:kotlin.Int, init:kotlin.Function1) returnType:kotlin.IntArray + VALUE_PARAMETER name:size index:0 type:kotlin.Int + VALUE_PARAMETER name:init index:1 type:kotlin.Function1 + CONSTRUCTOR IR_EXTERNAL_DECLARATION_STUB visibility:public <> (size:kotlin.Int) returnType:kotlin.IntArray [primary] + VALUE_PARAMETER name:size index:0 type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:get visibility:public modality:FINAL <> ($this:kotlin.IntArray, index:kotlin.Int) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.IntArray + VALUE_PARAMETER name:index index:0 type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:iterator visibility:public modality:FINAL <> ($this:kotlin.IntArray) returnType:kotlin.collections.IntIterator [operator] + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.IntArray + FUN IR_EXTERNAL_DECLARATION_STUB name:set visibility:public modality:FINAL <> ($this:kotlin.IntArray, index:kotlin.Int, value:kotlin.Int) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.IntArray + VALUE_PARAMETER name:index index:0 type:kotlin.Int + VALUE_PARAMETER name:value index:1 type:kotlin.Int + PROPERTY IR_EXTERNAL_DECLARATION_STUB name:size visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:size type:kotlin.Int visibility:public [final] + FUN IR_EXTERNAL_DECLARATION_STUB name: visibility:public modality:FINAL <> ($this:kotlin.IntArray) returnType:kotlin.Int + correspondingProperty: PROPERTY IR_EXTERNAL_DECLARATION_STUB name:size visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.IntArray + FUN IR_EXTERNAL_DECLARATION_STUB name:clone visibility:public modality:FINAL <> ($this:kotlin.IntArray) returnType:kotlin.IntArray overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name:$this type:kotlin.Any - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name:$this type:kotlin.Any - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + protected open fun clone (): kotlin.Any declared in kotlin.Cloneable + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.IntArray + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.IntArray, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name:$this type:kotlin.Any - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Any? + public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in kotlin.Cloneable + public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in java.io.Serializable + $this: VALUE_PARAMETER FAKE_OVERRIDE name: type:kotlin.IntArray + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.IntArray) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Cloneable + public open fun hashCode (): kotlin.Int [fake_override] declared in java.io.Serializable + $this: VALUE_PARAMETER FAKE_OVERRIDE name: type:kotlin.IntArray + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.IntArray) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + public open fun toString (): kotlin.String [fake_override] declared in kotlin.Cloneable + public open fun toString (): kotlin.String [fake_override] declared in java.io.Serializable + $this: VALUE_PARAMETER FAKE_OVERRIDE name: type:kotlin.IntArray diff --git a/compiler/testData/ir/irText/stubs/constFromBuiltins.__kotlin.Int.fir.ir.txt b/compiler/testData/ir/irText/stubs/constFromBuiltins.__kotlin.Int.fir.ir.txt index a84844060b9..4fcec384fc6 100644 --- a/compiler/testData/ir/irText/stubs/constFromBuiltins.__kotlin.Int.fir.ir.txt +++ b/compiler/testData/ir/irText/stubs/constFromBuiltins.__kotlin.Int.fir.ir.txt @@ -1,322 +1,385 @@ CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Int modality:FINAL visibility:public superTypes:[kotlin.Number; kotlin.Comparable; java.io.Serializable] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:kotlin.Int - CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:OPEN visibility:public [companion] superTypes:[] + CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:kotlin.Int.Companion - PROPERTY name:MIN_VALUE visibility:public modality:FINAL [const,val] - FIELD PROPERTY_BACKING_FIELD name:MIN_VALUE type:kotlin.Int visibility:public [final] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=-2147483648 - PROPERTY name:MAX_VALUE visibility:public modality:FINAL [const,val] + CONSTRUCTOR IR_EXTERNAL_DECLARATION_STUB visibility:private <> () returnType:kotlin.Int.Companion [primary] + PROPERTY IR_EXTERNAL_DECLARATION_STUB name:MAX_VALUE visibility:public modality:FINAL [const,val] FIELD PROPERTY_BACKING_FIELD name:MAX_VALUE type:kotlin.Int visibility:public [final] EXPRESSION_BODY CONST Int type=kotlin.Int value=2147483647 - PROPERTY name:SIZE_BYTES visibility:public modality:FINAL [const,val] - FIELD PROPERTY_BACKING_FIELD name:SIZE_BYTES type:kotlin.Int visibility:public [final] + FUN IR_EXTERNAL_DECLARATION_STUB name: visibility:public modality:FINAL <> ($this:kotlin.Int.Companion) returnType:kotlin.Int + correspondingProperty: PROPERTY IR_EXTERNAL_DECLARATION_STUB name:MAX_VALUE visibility:public modality:FINAL [const,val] + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int.Companion + PROPERTY IR_EXTERNAL_DECLARATION_STUB name:MIN_VALUE visibility:public modality:FINAL [const,val] + FIELD PROPERTY_BACKING_FIELD name:MIN_VALUE type:kotlin.Int visibility:public [final] EXPRESSION_BODY - CONST Int type=kotlin.Int value=4 - PROPERTY name:SIZE_BITS visibility:public modality:FINAL [const,val] + CONST Int type=kotlin.Int value=-2147483648 + FUN IR_EXTERNAL_DECLARATION_STUB name: visibility:public modality:FINAL <> ($this:kotlin.Int.Companion) returnType:kotlin.Int + correspondingProperty: PROPERTY IR_EXTERNAL_DECLARATION_STUB name:MIN_VALUE visibility:public modality:FINAL [const,val] + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int.Companion + PROPERTY IR_EXTERNAL_DECLARATION_STUB name:SIZE_BITS visibility:public modality:FINAL [const,val] + annotations: + SinceKotlin(version = '1.3') FIELD PROPERTY_BACKING_FIELD name:SIZE_BITS type:kotlin.Int visibility:public [final] EXPRESSION_BODY CONST Int type=kotlin.Int value=32 - FUN BUILTIN_CLASS_METHOD name:toChar visibility:public modality:OPEN <> ($this:kotlin.Int) returnType:kotlin.Char + FUN IR_EXTERNAL_DECLARATION_STUB name: visibility:public modality:FINAL <> ($this:kotlin.Int.Companion) returnType:kotlin.Int + correspondingProperty: PROPERTY IR_EXTERNAL_DECLARATION_STUB name:SIZE_BITS visibility:public modality:FINAL [const,val] + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int.Companion + PROPERTY IR_EXTERNAL_DECLARATION_STUB name:SIZE_BYTES visibility:public modality:FINAL [const,val] + annotations: + SinceKotlin(version = '1.3') + FIELD PROPERTY_BACKING_FIELD name:SIZE_BYTES type:kotlin.Int visibility:public [final] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=4 + FUN IR_EXTERNAL_DECLARATION_STUB name: visibility:public modality:FINAL <> ($this:kotlin.Int.Companion) returnType:kotlin.Int + correspondingProperty: PROPERTY IR_EXTERNAL_DECLARATION_STUB name:SIZE_BYTES visibility:public modality:FINAL [const,val] + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int.Companion + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Int.Companion, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER FAKE_OVERRIDE name: type:kotlin.Int.Companion + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Int.Companion) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER FAKE_OVERRIDE name: type:kotlin.Int.Companion + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Int.Companion) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER FAKE_OVERRIDE name: type:kotlin.Int.Companion + FUN IR_EXTERNAL_DECLARATION_STUB name:and visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [infix] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Byte) returnType:kotlin.Int [operator] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Byte + FUN IR_EXTERNAL_DECLARATION_STUB name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Double) returnType:kotlin.Int [operator] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Double + FUN IR_EXTERNAL_DECLARATION_STUB name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Float) returnType:kotlin.Int [operator] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Float + FUN IR_EXTERNAL_DECLARATION_STUB name:compareTo visibility:public modality:OPEN <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [operator] annotations: IntrinsicConstEvaluation overridden: - public open fun toChar (): kotlin.Char declared in kotlin.Number - $this: VALUE_PARAMETER name:$this type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:toByte visibility:public modality:OPEN <> ($this:kotlin.Int) returnType:kotlin.Byte + public abstract fun compareTo (other: T of kotlin.Comparable): kotlin.Int [operator] declared in kotlin.Comparable + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Long) returnType:kotlin.Int [operator] annotations: IntrinsicConstEvaluation - overridden: - public abstract fun toByte (): kotlin.Byte declared in kotlin.Number - $this: VALUE_PARAMETER name:$this type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:toShort visibility:public modality:OPEN <> ($this:kotlin.Int) returnType:kotlin.Short + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Long + FUN IR_EXTERNAL_DECLARATION_STUB name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Short) returnType:kotlin.Int [operator] annotations: IntrinsicConstEvaluation - overridden: - public abstract fun toShort (): kotlin.Short declared in kotlin.Number - $this: VALUE_PARAMETER name:$this type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:toInt visibility:public modality:OPEN <> ($this:kotlin.Int) returnType:kotlin.Int + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Short + FUN IR_EXTERNAL_DECLARATION_STUB name:dec visibility:public modality:FINAL <> ($this:kotlin.Int) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:div visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Byte) returnType:kotlin.Int [operator] annotations: IntrinsicConstEvaluation - overridden: - public abstract fun toInt (): kotlin.Int declared in kotlin.Number - $this: VALUE_PARAMETER name:$this type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:toLong visibility:public modality:OPEN <> ($this:kotlin.Int) returnType:kotlin.Long + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Byte + FUN IR_EXTERNAL_DECLARATION_STUB name:div visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Double) returnType:kotlin.Double [operator] annotations: IntrinsicConstEvaluation - overridden: - public abstract fun toLong (): kotlin.Long declared in kotlin.Number - $this: VALUE_PARAMETER name:$this type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:toFloat visibility:public modality:OPEN <> ($this:kotlin.Int) returnType:kotlin.Float + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Double + FUN IR_EXTERNAL_DECLARATION_STUB name:div visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Float) returnType:kotlin.Float [operator] annotations: IntrinsicConstEvaluation - overridden: - public abstract fun toFloat (): kotlin.Float declared in kotlin.Number - $this: VALUE_PARAMETER name:$this type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:toDouble visibility:public modality:OPEN <> ($this:kotlin.Int) returnType:kotlin.Double + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Float + FUN IR_EXTERNAL_DECLARATION_STUB name:div visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [operator] annotations: IntrinsicConstEvaluation - overridden: - public abstract fun toDouble (): kotlin.Double declared in kotlin.Number - $this: VALUE_PARAMETER name:$this type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:inc visibility:public modality:FINAL <> ($this:kotlin.Int) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name:$this type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:dec visibility:public modality:FINAL <> ($this:kotlin.Int) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name:$this type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Byte) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:div visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Long) returnType:kotlin.Long [operator] annotations: IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Byte - FUN BUILTIN_CLASS_METHOD name:plus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Byte) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Long + FUN IR_EXTERNAL_DECLARATION_STUB name:div visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Short) returnType:kotlin.Int [operator] annotations: IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Byte - FUN BUILTIN_CLASS_METHOD name:minus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Byte) returnType:kotlin.Int [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Byte - FUN BUILTIN_CLASS_METHOD name:times visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Byte) returnType:kotlin.Int [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Byte - FUN BUILTIN_CLASS_METHOD name:div visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Byte) returnType:kotlin.Int [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Byte - FUN BUILTIN_CLASS_METHOD name:rem visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Byte) returnType:kotlin.Int [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Byte - FUN BUILTIN_CLASS_METHOD name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Short) returnType:kotlin.Int [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Short - FUN BUILTIN_CLASS_METHOD name:plus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Short) returnType:kotlin.Int [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Short - FUN BUILTIN_CLASS_METHOD name:minus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Short) returnType:kotlin.Int [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Short - FUN BUILTIN_CLASS_METHOD name:times visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Short) returnType:kotlin.Int [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Short - FUN BUILTIN_CLASS_METHOD name:div visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Short) returnType:kotlin.Int [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Short - FUN BUILTIN_CLASS_METHOD name:rem visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Short) returnType:kotlin.Int [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Short - FUN BUILTIN_CLASS_METHOD name:compareTo visibility:public modality:OPEN <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:plus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:minus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:times visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:div visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:rem visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Long) returnType:kotlin.Int [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Long - FUN BUILTIN_CLASS_METHOD name:plus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Long) returnType:kotlin.Long [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Long - FUN BUILTIN_CLASS_METHOD name:minus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Long) returnType:kotlin.Long [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Long - FUN BUILTIN_CLASS_METHOD name:times visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Long) returnType:kotlin.Long [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Long - FUN BUILTIN_CLASS_METHOD name:div visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Long) returnType:kotlin.Long [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Long - FUN BUILTIN_CLASS_METHOD name:rem visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Long) returnType:kotlin.Long [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Long - FUN BUILTIN_CLASS_METHOD name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Float) returnType:kotlin.Int [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Float - FUN BUILTIN_CLASS_METHOD name:plus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Float) returnType:kotlin.Float [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Float - FUN BUILTIN_CLASS_METHOD name:minus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Float) returnType:kotlin.Float [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Float - FUN BUILTIN_CLASS_METHOD name:times visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Float) returnType:kotlin.Float [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Float - FUN BUILTIN_CLASS_METHOD name:div visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Float) returnType:kotlin.Float [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Float - FUN BUILTIN_CLASS_METHOD name:rem visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Float) returnType:kotlin.Float [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Float - FUN BUILTIN_CLASS_METHOD name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Double) returnType:kotlin.Int [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Double - FUN BUILTIN_CLASS_METHOD name:plus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Double) returnType:kotlin.Double [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Double - FUN BUILTIN_CLASS_METHOD name:minus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Double) returnType:kotlin.Double [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Double - FUN BUILTIN_CLASS_METHOD name:times visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Double) returnType:kotlin.Double [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Double - FUN BUILTIN_CLASS_METHOD name:div visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Double) returnType:kotlin.Double [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Double - FUN BUILTIN_CLASS_METHOD name:rem visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Double) returnType:kotlin.Double [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Double - FUN BUILTIN_CLASS_METHOD name:unaryPlus visibility:public modality:FINAL <> ($this:kotlin.Int) returnType:kotlin.Int [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:unaryMinus visibility:public modality:FINAL <> ($this:kotlin.Int) returnType:kotlin.Int [operator] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:rangeTo visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Byte) returnType:kotlin.ranges.IntRange [operator] - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Byte - FUN BUILTIN_CLASS_METHOD name:rangeTo visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Short) returnType:kotlin.ranges.IntRange [operator] - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Short - FUN BUILTIN_CLASS_METHOD name:rangeTo visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.ranges.IntRange [operator] - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:rangeTo visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Long) returnType:kotlin.ranges.LongRange [operator] - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Long - FUN BUILTIN_CLASS_METHOD name:and visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [infix] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:or visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [infix] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:xor visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [infix] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:shl visibility:public modality:FINAL <> ($this:kotlin.Int, bitCount:kotlin.Int) returnType:kotlin.Int [infix] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:bitCount index:0 type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:shr visibility:public modality:FINAL <> ($this:kotlin.Int, bitCount:kotlin.Int) returnType:kotlin.Int [infix] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:bitCount index:0 type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:ushr visibility:public modality:FINAL <> ($this:kotlin.Int, bitCount:kotlin.Int) returnType:kotlin.Int [infix] - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:bitCount index:0 type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:inv visibility:public modality:FINAL <> ($this:kotlin.Int) returnType:kotlin.Int - annotations: - IntrinsicConstEvaluation - $this: VALUE_PARAMETER name:$this type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:toString visibility:public modality:FINAL <> ($this:kotlin.Int) returnType:kotlin.String - annotations: - IntrinsicConstEvaluation - overridden: - public open fun toString (): kotlin.String [fake_override] declared in kotlin.Number - public open fun toString (): kotlin.String declared in kotlin.Any - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name:$this type:kotlin.Int - FUN BUILTIN_CLASS_METHOD name:equals visibility:public modality:OPEN <> ($this:kotlin.Int, other:kotlin.Any?) returnType:kotlin.Boolean [operator] + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Short + FUN IR_EXTERNAL_DECLARATION_STUB name:equals visibility:public modality:OPEN <> ($this:kotlin.Int, other:kotlin.Any?) returnType:kotlin.Boolean [operator] annotations: IntrinsicConstEvaluation overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in kotlin.Number - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name:$this type:kotlin.Int - VALUE_PARAMETER BUILTIN_CLASS_METHOD name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in kotlin.Comparable + public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in java.io.Serializable + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN IR_EXTERNAL_DECLARATION_STUB name:inc visibility:public modality:FINAL <> ($this:kotlin.Int) returnType:kotlin.Int [operator] + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:inv visibility:public modality:FINAL <> ($this:kotlin.Int) returnType:kotlin.Int + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:minus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Byte) returnType:kotlin.Int [operator] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Byte + FUN IR_EXTERNAL_DECLARATION_STUB name:minus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Double) returnType:kotlin.Double [operator] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Double + FUN IR_EXTERNAL_DECLARATION_STUB name:minus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Float) returnType:kotlin.Float [operator] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Float + FUN IR_EXTERNAL_DECLARATION_STUB name:minus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [operator] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:minus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Long) returnType:kotlin.Long [operator] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Long + FUN IR_EXTERNAL_DECLARATION_STUB name:minus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Short) returnType:kotlin.Int [operator] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Short + FUN IR_EXTERNAL_DECLARATION_STUB name:or visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [infix] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:plus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Byte) returnType:kotlin.Int [operator] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Byte + FUN IR_EXTERNAL_DECLARATION_STUB name:plus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Double) returnType:kotlin.Double [operator] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Double + FUN IR_EXTERNAL_DECLARATION_STUB name:plus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Float) returnType:kotlin.Float [operator] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Float + FUN IR_EXTERNAL_DECLARATION_STUB name:plus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [operator] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:plus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Long) returnType:kotlin.Long [operator] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Long + FUN IR_EXTERNAL_DECLARATION_STUB name:plus visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Short) returnType:kotlin.Int [operator] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Short + FUN IR_EXTERNAL_DECLARATION_STUB name:rangeTo visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Byte) returnType:kotlin.ranges.IntRange [operator] + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Byte + FUN IR_EXTERNAL_DECLARATION_STUB name:rangeTo visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.ranges.IntRange [operator] + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:rangeTo visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Long) returnType:kotlin.ranges.LongRange [operator] + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Long + FUN IR_EXTERNAL_DECLARATION_STUB name:rangeTo visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Short) returnType:kotlin.ranges.IntRange [operator] + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Short + FUN IR_EXTERNAL_DECLARATION_STUB name:rangeUntil visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Byte) returnType:kotlin.ranges.IntRange [operator] + annotations: + SinceKotlin(version = '1.9') + WasExperimental(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalStdlibApi modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Byte + FUN IR_EXTERNAL_DECLARATION_STUB name:rangeUntil visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.ranges.IntRange [operator] + annotations: + SinceKotlin(version = '1.9') + WasExperimental(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalStdlibApi modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:rangeUntil visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Long) returnType:kotlin.ranges.LongRange [operator] + annotations: + SinceKotlin(version = '1.9') + WasExperimental(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalStdlibApi modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Long + FUN IR_EXTERNAL_DECLARATION_STUB name:rangeUntil visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Short) returnType:kotlin.ranges.IntRange [operator] + annotations: + SinceKotlin(version = '1.9') + WasExperimental(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalStdlibApi modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Short + FUN IR_EXTERNAL_DECLARATION_STUB name:rem visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Byte) returnType:kotlin.Int [operator] + annotations: + SinceKotlin(version = '1.1') + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Byte + FUN IR_EXTERNAL_DECLARATION_STUB name:rem visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Double) returnType:kotlin.Double [operator] + annotations: + SinceKotlin(version = '1.1') + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Double + FUN IR_EXTERNAL_DECLARATION_STUB name:rem visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Float) returnType:kotlin.Float [operator] + annotations: + SinceKotlin(version = '1.1') + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Float + FUN IR_EXTERNAL_DECLARATION_STUB name:rem visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [operator] + annotations: + SinceKotlin(version = '1.1') + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:rem visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Long) returnType:kotlin.Long [operator] + annotations: + SinceKotlin(version = '1.1') + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Long + FUN IR_EXTERNAL_DECLARATION_STUB name:rem visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Short) returnType:kotlin.Int [operator] + annotations: + SinceKotlin(version = '1.1') + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Short + FUN IR_EXTERNAL_DECLARATION_STUB name:shl visibility:public modality:FINAL <> ($this:kotlin.Int, bitCount:kotlin.Int) returnType:kotlin.Int [infix] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:bitCount index:0 type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:shr visibility:public modality:FINAL <> ($this:kotlin.Int, bitCount:kotlin.Int) returnType:kotlin.Int [infix] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:bitCount index:0 type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:times visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Byte) returnType:kotlin.Int [operator] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Byte + FUN IR_EXTERNAL_DECLARATION_STUB name:times visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Double) returnType:kotlin.Double [operator] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Double + FUN IR_EXTERNAL_DECLARATION_STUB name:times visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Float) returnType:kotlin.Float [operator] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Float + FUN IR_EXTERNAL_DECLARATION_STUB name:times visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [operator] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:times visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Long) returnType:kotlin.Long [operator] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Long + FUN IR_EXTERNAL_DECLARATION_STUB name:times visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Short) returnType:kotlin.Int [operator] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Short + FUN IR_EXTERNAL_DECLARATION_STUB name:toByte visibility:public modality:OPEN <> ($this:kotlin.Int) returnType:kotlin.Byte + annotations: + IntrinsicConstEvaluation + overridden: + public abstract fun toByte (): kotlin.Byte declared in kotlin.Number + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:toChar visibility:public modality:OPEN <> ($this:kotlin.Int) returnType:kotlin.Char + annotations: + IntrinsicConstEvaluation + overridden: + public open fun toChar (): kotlin.Char declared in kotlin.Number + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:toDouble visibility:public modality:OPEN <> ($this:kotlin.Int) returnType:kotlin.Double + annotations: + IntrinsicConstEvaluation + overridden: + public abstract fun toDouble (): kotlin.Double declared in kotlin.Number + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:toFloat visibility:public modality:OPEN <> ($this:kotlin.Int) returnType:kotlin.Float + annotations: + IntrinsicConstEvaluation + overridden: + public abstract fun toFloat (): kotlin.Float declared in kotlin.Number + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:toInt visibility:public modality:OPEN <> ($this:kotlin.Int) returnType:kotlin.Int + annotations: + IntrinsicConstEvaluation + overridden: + public abstract fun toInt (): kotlin.Int declared in kotlin.Number + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:toLong visibility:public modality:OPEN <> ($this:kotlin.Int) returnType:kotlin.Long + annotations: + IntrinsicConstEvaluation + overridden: + public abstract fun toLong (): kotlin.Long declared in kotlin.Number + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:toShort visibility:public modality:OPEN <> ($this:kotlin.Int) returnType:kotlin.Short + annotations: + IntrinsicConstEvaluation + overridden: + public abstract fun toShort (): kotlin.Short declared in kotlin.Number + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:toString visibility:public modality:OPEN <> ($this:kotlin.Int) returnType:kotlin.String + annotations: + IntrinsicConstEvaluation + overridden: + public open fun toString (): kotlin.String [fake_override] declared in kotlin.Number + public open fun toString (): kotlin.String [fake_override] declared in kotlin.Comparable + public open fun toString (): kotlin.String [fake_override] declared in java.io.Serializable + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:unaryMinus visibility:public modality:FINAL <> ($this:kotlin.Int) returnType:kotlin.Int [operator] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:unaryPlus visibility:public modality:FINAL <> ($this:kotlin.Int) returnType:kotlin.Int [operator] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:ushr visibility:public modality:FINAL <> ($this:kotlin.Int, bitCount:kotlin.Int) returnType:kotlin.Int [infix] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:bitCount index:0 type:kotlin.Int + FUN IR_EXTERNAL_DECLARATION_STUB name:xor visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [infix] + annotations: + IntrinsicConstEvaluation + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:kotlin.Int + VALUE_PARAMETER name:other index:0 type:kotlin.Int + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Int) returnType:kotlin.Int [fake_override] overridden: public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Number - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name:$this type:kotlin.Any + public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Comparable + public open fun hashCode (): kotlin.Int [fake_override] declared in java.io.Serializable + $this: VALUE_PARAMETER FAKE_OVERRIDE name: type:kotlin.Int