[Psi2Ir, Fir2Ir] Generate toString, hashCode, equals methods for MF VC
This commit is contained in:
committed by
Space
parent
c7edc353d3
commit
e97ca2ada4
+1
-1
@@ -47,7 +47,7 @@ val EXTERNAL_FUN = createBooleanFlagToModifier(Flags.IS_EXTERNAL_FUNCTION, KtTok
|
||||
val EXTERNAL_PROPERTY = createBooleanFlagToModifier(Flags.IS_EXTERNAL_PROPERTY, KtTokens.EXTERNAL_KEYWORD)
|
||||
val EXTERNAL_CLASS = createBooleanFlagToModifier(Flags.IS_EXTERNAL_CLASS, KtTokens.EXTERNAL_KEYWORD)
|
||||
val INLINE = createBooleanFlagToModifier(Flags.IS_INLINE, KtTokens.INLINE_KEYWORD)
|
||||
val VALUE_CLASS = createBooleanFlagToModifier(Flags.IS_INLINE_CLASS, KtTokens.VALUE_KEYWORD)
|
||||
val VALUE_CLASS = createBooleanFlagToModifier(Flags.IS_VALUE_CLASS, KtTokens.VALUE_KEYWORD)
|
||||
val FUN_INTERFACE = createBooleanFlagToModifier(Flags.IS_FUN_INTERFACE, KtTokens.FUN_KEYWORD)
|
||||
val TAILREC = createBooleanFlagToModifier(Flags.IS_TAILREC, KtTokens.TAILREC_KEYWORD)
|
||||
val SUSPEND = createBooleanFlagToModifier(Flags.IS_SUSPEND, KtTokens.SUSPEND_KEYWORD)
|
||||
|
||||
+5
-2
@@ -15,7 +15,10 @@ import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.declarations.builder.*
|
||||
import org.jetbrains.kotlin.fir.declarations.comparators.FirMemberDeclarationComparator
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirResolvedDeclarationStatusImpl
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.*
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.addDeclarations
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.isCompanion
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.moduleName
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.sourceElement
|
||||
import org.jetbrains.kotlin.fir.expressions.FirAnnotation
|
||||
import org.jetbrains.kotlin.fir.scopes.FirScopeProvider
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeTypeParameterLookupTag
|
||||
@@ -65,7 +68,7 @@ fun deserializeClassToSymbol(
|
||||
isCompanion = kind == ProtoBuf.Class.Kind.COMPANION_OBJECT
|
||||
isInner = Flags.IS_INNER.get(flags)
|
||||
isData = Flags.IS_DATA.get(classProto.flags)
|
||||
isInline = Flags.IS_INLINE_CLASS.get(classProto.flags)
|
||||
isInline = Flags.IS_VALUE_CLASS.get(classProto.flags)
|
||||
isExternal = Flags.IS_EXTERNAL_CLASS.get(classProto.flags)
|
||||
isFun = Flags.IS_FUN_INTERFACE.get(classProto.flags)
|
||||
}
|
||||
|
||||
@@ -287,7 +287,7 @@ class Fir2IrClassifierStorage(
|
||||
isInner = regularClass.isInner,
|
||||
isData = regularClass.isData,
|
||||
isExternal = regularClass.isExternal,
|
||||
isInline = regularClass.isInline && regularClass.primaryConstructorIfAny(session)?.valueParameterSymbols?.size == 1,
|
||||
isValue = regularClass.isInline,
|
||||
isExpect = regularClass.isExpect,
|
||||
isFun = regularClass.isFun
|
||||
).apply {
|
||||
|
||||
@@ -18,7 +18,6 @@ import org.jetbrains.kotlin.fir.backend.generators.DataClassMembersGenerator
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.isLocal
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.isSynthetic
|
||||
import org.jetbrains.kotlin.fir.declarations.primaryConstructorIfAny
|
||||
import org.jetbrains.kotlin.fir.descriptors.FirModuleDescriptor
|
||||
import org.jetbrains.kotlin.fir.extensions.declarationGenerators
|
||||
import org.jetbrains.kotlin.fir.extensions.extensionService
|
||||
@@ -30,7 +29,9 @@ import org.jetbrains.kotlin.fir.psi
|
||||
import org.jetbrains.kotlin.fir.resolve.ScopeSession
|
||||
import org.jetbrains.kotlin.fir.signaturer.FirBasedSignatureComposer
|
||||
import org.jetbrains.kotlin.fir.signaturer.FirMangler
|
||||
import org.jetbrains.kotlin.ir.*
|
||||
import org.jetbrains.kotlin.ir.IrBuiltIns
|
||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.PsiIrFileEntry
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.declarations.impl.IrFileImpl
|
||||
import org.jetbrains.kotlin.ir.declarations.impl.IrModuleFragmentImpl
|
||||
@@ -250,11 +251,14 @@ class Fir2IrConverter(
|
||||
allDeclarations += delegatedMembers(irClass)
|
||||
// Add synthetic members *before* fake override generations.
|
||||
// Otherwise, redundant members, e.g., synthetic toString _and_ fake override toString, will be added.
|
||||
if (irConstructor != null && (irClass.isInline || irClass.isData)) {
|
||||
if (irConstructor != null && (irClass.isValue || irClass.isData)) {
|
||||
declarationStorage.enterScope(irConstructor)
|
||||
val dataClassMembersGenerator = DataClassMembersGenerator(components)
|
||||
if (irClass.isInline) {
|
||||
allDeclarations += dataClassMembersGenerator.generateInlineClassMembers(regularClass, irClass)
|
||||
if (irClass.isSingleFieldValueClass) {
|
||||
allDeclarations += dataClassMembersGenerator.generateSingleFieldValueClassMembers(regularClass, irClass)
|
||||
}
|
||||
if (irClass.isMultiFieldValueClass) {
|
||||
allDeclarations += dataClassMembersGenerator.generateMultiFieldValueClassMembers(regularClass, irClass)
|
||||
}
|
||||
if (irClass.isData) {
|
||||
allDeclarations += dataClassMembersGenerator.generateDataClassMembers(regularClass, irClass)
|
||||
|
||||
@@ -666,7 +666,7 @@ class IrBuiltInsOverFir(
|
||||
build()
|
||||
irFactory.createClass(
|
||||
startOffset, endOffset, origin, symbol, name, kind, visibility, modality,
|
||||
isCompanion, isInner, isData, isExternal, isInline, isExpect, isFun
|
||||
isCompanion, isInner, isData, isExternal, isValue, isExpect, isFun
|
||||
)
|
||||
}.also {
|
||||
it.parent = parent
|
||||
@@ -701,7 +701,7 @@ class IrBuiltInsOverFir(
|
||||
vararg supertypes: IrType,
|
||||
classKind: ClassKind = ClassKind.CLASS,
|
||||
classModality: Modality = Modality.OPEN,
|
||||
classIsInline: Boolean = false,
|
||||
classIsValue: Boolean = false,
|
||||
builderBlock: IrClassBuilder.() -> Unit = {},
|
||||
block: IrClass.() -> Unit = {}
|
||||
): IrClassSymbol {
|
||||
@@ -709,7 +709,7 @@ class IrBuiltInsOverFir(
|
||||
|
||||
return this.createClass(
|
||||
signature, *supertypes,
|
||||
classKind = classKind, classModality = classModality, classIsInline = classIsInline, builderBlock = builderBlock, block = block
|
||||
classKind = classKind, classModality = classModality, classIsValue = classIsValue, builderBlock = builderBlock, block = block
|
||||
)
|
||||
}
|
||||
|
||||
@@ -718,7 +718,7 @@ class IrBuiltInsOverFir(
|
||||
vararg supertypes: IrType,
|
||||
classKind: ClassKind = ClassKind.CLASS,
|
||||
classModality: Modality = Modality.OPEN,
|
||||
classIsInline: Boolean = false,
|
||||
classIsValue: Boolean = false,
|
||||
builderBlock: IrClassBuilder.() -> Unit = {},
|
||||
block: IrClass.() -> Unit = {}
|
||||
): IrClassSymbol = components.symbolTable.declareClass(
|
||||
@@ -729,12 +729,12 @@ class IrBuiltInsOverFir(
|
||||
name = Name.identifier(signature.shortName)
|
||||
kind = classKind
|
||||
modality = classModality
|
||||
isInline = classIsInline
|
||||
isValue = classIsValue
|
||||
origin = IrDeclarationOrigin.IR_EXTERNAL_DECLARATION_STUB
|
||||
builderBlock()
|
||||
irFactory.createClass(
|
||||
startOffset, endOffset, origin, symbol, name, kind, visibility, modality,
|
||||
isCompanion, isInner, isData, isExternal, isInline, isExpect, isFun
|
||||
isCompanion, isInner, isData, isExternal, isValue, isExpect, isFun
|
||||
)
|
||||
}.also {
|
||||
it.parent = this
|
||||
|
||||
+7
-2
@@ -59,8 +59,13 @@ import org.jetbrains.kotlin.util.OperatorNameConventions.TO_STRING
|
||||
*/
|
||||
class DataClassMembersGenerator(val components: Fir2IrComponents) {
|
||||
|
||||
fun generateInlineClassMembers(klass: FirClass, irClass: IrClass): List<FirDeclaration> =
|
||||
MyDataClassMethodsGenerator(irClass, klass.symbol.toLookupTag(), IrDeclarationOrigin.GENERATED_INLINE_CLASS_MEMBER).generate(klass)
|
||||
fun generateSingleFieldValueClassMembers(klass: FirClass, irClass: IrClass): List<FirDeclaration> =
|
||||
MyDataClassMethodsGenerator(irClass, klass.symbol.toLookupTag(), IrDeclarationOrigin.GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER)
|
||||
.generate(klass)
|
||||
|
||||
fun generateMultiFieldValueClassMembers(klass: FirClass, irClass: IrClass): List<FirDeclaration> =
|
||||
MyDataClassMethodsGenerator(irClass, klass.symbol.toLookupTag(), IrDeclarationOrigin.GENERATED_MULTI_FIELD_VALUE_CLASS_MEMBER)
|
||||
.generate(klass)
|
||||
|
||||
fun generateDataClassMembers(klass: FirClass, irClass: IrClass): List<FirDeclaration> =
|
||||
MyDataClassMethodsGenerator(irClass, klass.symbol.toLookupTag(), IrDeclarationOrigin.GENERATED_DATA_CLASS_MEMBER).generate(klass)
|
||||
|
||||
@@ -11,7 +11,6 @@ import org.jetbrains.kotlin.fir.backend.*
|
||||
import org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin
|
||||
import org.jetbrains.kotlin.fir.declarations.FirRegularClass
|
||||
import org.jetbrains.kotlin.fir.declarations.FirSimpleFunction
|
||||
import org.jetbrains.kotlin.fir.declarations.primaryConstructorIfAny
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.*
|
||||
import org.jetbrains.kotlin.fir.dispatchReceiverClassOrNull
|
||||
import org.jetbrains.kotlin.fir.isNewPlaceForBodyGeneration
|
||||
@@ -94,8 +93,8 @@ class Fir2IrLazyClass(
|
||||
override val isExternal: Boolean
|
||||
get() = fir.isExternal
|
||||
|
||||
override val isInline: Boolean
|
||||
get() = fir.isInline && fir.primaryConstructorIfAny(session)?.valueParameterSymbols?.size == 1
|
||||
override val isValue: Boolean
|
||||
get() = fir.isInline
|
||||
|
||||
override val isExpect: Boolean
|
||||
get() = fir.isExpect
|
||||
|
||||
+2
-4
@@ -37,17 +37,15 @@ import org.jetbrains.kotlin.resolve.lazy.LazyClassContext
|
||||
import org.jetbrains.kotlin.resolve.lazy.declarations.ClassMemberDeclarationProvider
|
||||
import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter
|
||||
import org.jetbrains.kotlin.resolve.scopes.LexicalScope
|
||||
import org.jetbrains.kotlin.resolve.scopes.MemberScope
|
||||
import org.jetbrains.kotlin.resolve.scopes.MemberScope.Companion.ALL_NAME_FILTER
|
||||
import org.jetbrains.kotlin.storage.NotNullLazyValue
|
||||
import org.jetbrains.kotlin.storage.NullableLazyValue
|
||||
import org.jetbrains.kotlin.storage.getValue
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.TypeRefinement
|
||||
import org.jetbrains.kotlin.types.checker.KotlinTypeRefiner
|
||||
import org.jetbrains.kotlin.types.checker.NewKotlinTypeCheckerImpl
|
||||
import org.jetbrains.kotlin.types.TypeRefinement
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.flatMapToNullable
|
||||
import java.util.*
|
||||
|
||||
open class LazyClassMemberScope(
|
||||
c: LazyClassContext,
|
||||
@@ -293,7 +291,7 @@ open class LazyClassMemberScope(
|
||||
name: Name,
|
||||
fromSupertypes: List<SimpleFunctionDescriptor>
|
||||
) {
|
||||
if (!thisDescriptor.isInlineClass()) return
|
||||
if (!thisDescriptor.isInlineOrValueClass()) return
|
||||
FunctionsFromAny.addFunctionFromAnyIfNeeded(thisDescriptor, result, name, fromSupertypes)
|
||||
}
|
||||
|
||||
|
||||
+2
-5
@@ -11,10 +11,7 @@ import org.jetbrains.kotlin.ir.IrElement
|
||||
import org.jetbrains.kotlin.ir.builders.IrBuilderWithScope
|
||||
import org.jetbrains.kotlin.ir.builders.irCall
|
||||
import org.jetbrains.kotlin.ir.builders.irString
|
||||
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||
import org.jetbrains.kotlin.ir.declarations.IrConstructor
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFile
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.expressions.IrCall
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||
@@ -91,7 +88,7 @@ interface InlineClassesUtils {
|
||||
/**
|
||||
* Should this class be treated as inline class?
|
||||
*/
|
||||
fun isClassInlineLike(klass: IrClass): Boolean = klass.isInline
|
||||
fun isClassInlineLike(klass: IrClass): Boolean = klass.isSingleFieldValueClass
|
||||
|
||||
/**
|
||||
* Unlike [org.jetbrains.kotlin.ir.util.getInlineClassUnderlyingType], doesn't use [IrClass.inlineClassRepresentation] because
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ internal fun IrFactory.buildClass(builder: IrClassBuilder): IrClass = with(build
|
||||
startOffset, endOffset, origin,
|
||||
IrClassSymbolImpl(),
|
||||
name, kind, visibility, modality,
|
||||
isCompanion, isInner, isData, isExternal, isInline, isExpect, isFun
|
||||
isCompanion, isInner, isData, isExternal, isValue, isExpect, isFun
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -211,7 +211,7 @@ class ExportModelGenerator(
|
||||
}
|
||||
}
|
||||
|
||||
if (klass.isInline)
|
||||
if (klass.isSingleFieldValueClass)
|
||||
return Exportability.Prohibited("Inline class ${klass.fqNameWhenAvailable}")
|
||||
|
||||
return Exportability.Allowed
|
||||
|
||||
+1
-1
@@ -186,7 +186,7 @@ class EqualityAndComparisonCallsTransformer(context: JsIrBackendContext) : Calls
|
||||
isBuiltin() && this != PrimitiveType.FLOATING_POINT_NUMBER
|
||||
|
||||
private fun IrType.isDefaultEqualsMethod() =
|
||||
findEqualsMethod()?.origin === IrDeclarationOrigin.GENERATED_INLINE_CLASS_MEMBER
|
||||
findEqualsMethod()?.origin === IrDeclarationOrigin.GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER
|
||||
|
||||
private fun IrExpression.isBoxIntrinsic() =
|
||||
this is IrCall && symbol == icUtils.boxIntrinsic
|
||||
|
||||
+4
-2
@@ -21,7 +21,9 @@ import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrGetValue
|
||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||
import org.jetbrains.kotlin.ir.types.*
|
||||
import org.jetbrains.kotlin.ir.util.*
|
||||
import org.jetbrains.kotlin.ir.util.file
|
||||
import org.jetbrains.kotlin.ir.util.isSuspend
|
||||
import org.jetbrains.kotlin.ir.util.parentAsClass
|
||||
import org.jetbrains.kotlin.psi.KtElement
|
||||
import org.jetbrains.org.objectweb.asm.MethodVisitor
|
||||
import org.jetbrains.org.objectweb.asm.Type
|
||||
@@ -125,7 +127,7 @@ private fun IrSimpleFunction.overridesReturningDifferentType(returnType: IrType)
|
||||
val owner = overridden.owner
|
||||
val overriddenReturnType = owner.returnType
|
||||
|
||||
if (!overriddenReturnType.erasedUpperBound.isInline) return true
|
||||
if (!overriddenReturnType.erasedUpperBound.isSingleFieldValueClass) return true
|
||||
|
||||
if (overriddenReturnType.isNullable() &&
|
||||
overriddenReturnType.makeNotNull().unboxInlineClass().isNullable()
|
||||
|
||||
+1
-1
@@ -1473,7 +1473,7 @@ class ExpressionCodegen(
|
||||
companion object {
|
||||
internal fun generateClassInstance(v: InstructionAdapter, classType: IrType, typeMapper: IrTypeMapper) {
|
||||
val asmType = typeMapper.mapType(classType)
|
||||
if (classType.getClass()?.isInline == true || !isPrimitive(asmType)) {
|
||||
if (classType.getClass()?.isSingleFieldValueClass == true || !isPrimitive(asmType)) {
|
||||
v.aconst(typeMapper.boxType(classType))
|
||||
} else {
|
||||
v.getstatic(boxType(asmType).internalName, "TYPE", "Ljava/lang/Class;")
|
||||
|
||||
+1
-1
@@ -318,7 +318,7 @@ class FunctionCodegen(private val irFunction: IrFunction, private val classCodeg
|
||||
IrDeclarationOrigin.FUNCTION_FOR_DEFAULT_PARAMETER,
|
||||
JvmLoweredDeclarationOrigin.SYNTHETIC_ACCESSOR,
|
||||
IrDeclarationOrigin.ENUM_CLASS_SPECIAL_MEMBER,
|
||||
IrDeclarationOrigin.GENERATED_INLINE_CLASS_MEMBER,
|
||||
IrDeclarationOrigin.GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER,
|
||||
IrDeclarationOrigin.BRIDGE,
|
||||
IrDeclarationOrigin.BRIDGE_SPECIAL,
|
||||
JvmLoweredDeclarationOrigin.ABSTRACT_BRIDGE_STUB,
|
||||
|
||||
+2
-1
@@ -12,6 +12,7 @@ import org.jetbrains.kotlin.backend.jvm.mapping.IrTypeMapper
|
||||
import org.jetbrains.kotlin.codegen.AsmUtil
|
||||
import org.jetbrains.kotlin.codegen.StackValue
|
||||
import org.jetbrains.kotlin.ir.declarations.IrTypeParameter
|
||||
import org.jetbrains.kotlin.ir.declarations.isSingleFieldValueClass
|
||||
import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.ir.types.*
|
||||
import org.jetbrains.kotlin.ir.util.isTypeParameter
|
||||
@@ -42,7 +43,7 @@ abstract class PromisedValue(val codegen: ExpressionCodegen, val type: Type, val
|
||||
if (!isFromTypeUnboxed && isToTypeUnboxed) {
|
||||
val boxed = typeMapper.mapType(erasedTargetType, TypeMappingMode.CLASS_DECLARATION)
|
||||
val irClass = codegen.irFunction.parentAsClass
|
||||
if (irClass.isInline && irClass.symbol == irType.classifierOrNull && !irType.isNullable()) {
|
||||
if (irClass.isSingleFieldValueClass && irClass.symbol == irType.classifierOrNull && !irType.isNullable()) {
|
||||
// Use getfield instead of unbox-impl inside inline classes
|
||||
codegen.mv.getfield(boxed.internalName, irClass.inlineClassFieldName.asString(), target.descriptor)
|
||||
} else {
|
||||
|
||||
+1
-6
@@ -5,7 +5,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.backend.jvm.codegen
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.backend.common.ir.allOverridden
|
||||
import org.jetbrains.kotlin.backend.common.ir.ir2string
|
||||
import org.jetbrains.kotlin.backend.jvm.JvmBackendContext
|
||||
@@ -27,14 +26,11 @@ import org.jetbrains.kotlin.codegen.SourceInfo
|
||||
import org.jetbrains.kotlin.codegen.inline.SourceMapper
|
||||
import org.jetbrains.kotlin.codegen.signature.BothSignatureWriter
|
||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.descriptors.DeclarationDescriptorWithSource
|
||||
import org.jetbrains.kotlin.descriptors.DescriptorVisibilities
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.expressions.IrCall
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpressionBody
|
||||
import org.jetbrains.kotlin.ir.expressions.IrMemberAccessExpression
|
||||
import org.jetbrains.kotlin.ir.symbols.IrClassSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrSymbol
|
||||
import org.jetbrains.kotlin.ir.types.IrSimpleType
|
||||
@@ -45,7 +41,6 @@ import org.jetbrains.kotlin.load.java.JavaDescriptorVisibilities
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.resolve.jvm.AsmTypes
|
||||
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmClassSignature
|
||||
import org.jetbrains.kotlin.resolve.source.PsiSourceElement
|
||||
import org.jetbrains.kotlin.utils.addIfNotNull
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
import org.jetbrains.org.objectweb.asm.Opcodes
|
||||
@@ -166,7 +161,7 @@ private fun IrDeclarationWithVisibility.specialCaseVisibility(kind: OwnerKind?):
|
||||
return Opcodes.ACC_PUBLIC
|
||||
}
|
||||
|
||||
if (this is IrConstructor && parentAsClass.isInline && kind === OwnerKind.IMPLEMENTATION) {
|
||||
if (this is IrConstructor && parentAsClass.isSingleFieldValueClass && kind === OwnerKind.IMPLEMENTATION) {
|
||||
return Opcodes.ACC_PRIVATE
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -16,6 +16,7 @@ import org.jetbrains.kotlin.codegen.DescriptorAsmUtil.genAreEqualCall
|
||||
import org.jetbrains.kotlin.codegen.StackValue
|
||||
import org.jetbrains.kotlin.codegen.intrinsics.IntrinsicMethods
|
||||
import org.jetbrains.kotlin.config.LanguageFeature
|
||||
import org.jetbrains.kotlin.ir.declarations.isSingleFieldValueClass
|
||||
import org.jetbrains.kotlin.ir.descriptors.toIrBasedKotlinType
|
||||
import org.jetbrains.kotlin.ir.expressions.IrFunctionAccessExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||
@@ -70,7 +71,7 @@ class Equals(val operator: IElementType) : IntrinsicMethod() {
|
||||
if (a.isNullConst() || b.isNullConst()) {
|
||||
val irValue = if (a.isNullConst()) b else a
|
||||
val value = irValue.accept(codegen, data)
|
||||
return if (!isPrimitive(value.type) && (irValue.type.classOrNull?.owner?.isInline != true || irValue.type.isNullable()))
|
||||
return if (!isPrimitive(value.type) && (irValue.type.classOrNull?.owner?.isSingleFieldValueClass != true || irValue.type.isNullable()))
|
||||
BooleanNullCheck(value)
|
||||
else {
|
||||
value.discard()
|
||||
|
||||
+2
-1
@@ -11,6 +11,7 @@ import org.jetbrains.kotlin.backend.jvm.codegen.PromisedValue
|
||||
import org.jetbrains.kotlin.backend.jvm.codegen.materialize
|
||||
import org.jetbrains.kotlin.backend.jvm.mapping.mapTypeAsDeclaration
|
||||
import org.jetbrains.kotlin.codegen.AsmUtil
|
||||
import org.jetbrains.kotlin.ir.declarations.isSingleFieldValueClass
|
||||
import org.jetbrains.kotlin.ir.expressions.IrClassReference
|
||||
import org.jetbrains.kotlin.ir.expressions.IrFunctionAccessExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrGetClass
|
||||
@@ -76,7 +77,7 @@ object GetJavaPrimitiveType : IntrinsicMethod() {
|
||||
}
|
||||
|
||||
private fun IrType.isInlineClassType(): Boolean {
|
||||
return (classOrNull ?: return false).owner.isInline
|
||||
return (classOrNull ?: return false).owner.isSingleFieldValueClass
|
||||
}
|
||||
|
||||
private fun Type.isVoidOrPrimitiveWrapper(): Boolean =
|
||||
|
||||
+2
-1
@@ -37,7 +37,8 @@ object HashCode : IntrinsicMethod() {
|
||||
val target = context.state.target
|
||||
when {
|
||||
irFunction.origin == JvmLoweredDeclarationOrigin.INLINE_CLASS_GENERATED_IMPL_METHOD ||
|
||||
irFunction.origin == IrDeclarationOrigin.GENERATED_DATA_CLASS_MEMBER -> {
|
||||
irFunction.origin == IrDeclarationOrigin.GENERATED_DATA_CLASS_MEMBER ||
|
||||
irFunction.origin == IrDeclarationOrigin.GENERATED_MULTI_FIELD_VALUE_CLASS_MEMBER -> {
|
||||
// TODO generate or lower IR for data class / inline class 'hashCode'?
|
||||
DescriptorAsmUtil.genHashCode(mv, mv, receiverType, target)
|
||||
}
|
||||
|
||||
+2
-1
@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.backend.jvm.intrinsics
|
||||
import org.jetbrains.kotlin.backend.jvm.codegen.*
|
||||
import org.jetbrains.kotlin.codegen.AsmUtil.boxType
|
||||
import org.jetbrains.kotlin.codegen.AsmUtil.isPrimitive
|
||||
import org.jetbrains.kotlin.ir.declarations.isSingleFieldValueClass
|
||||
import org.jetbrains.kotlin.ir.expressions.IrFunctionAccessExpression
|
||||
import org.jetbrains.kotlin.ir.types.classOrNull
|
||||
import org.jetbrains.kotlin.resolve.jvm.AsmTypes
|
||||
@@ -33,7 +34,7 @@ object JavaClassProperty : IntrinsicMethod() {
|
||||
when {
|
||||
value.type == Type.VOID_TYPE ->
|
||||
invokeGetClass(value.materializedAt(AsmTypes.UNIT_TYPE, value.codegen.context.irBuiltIns.unitType))
|
||||
value.irType.classOrNull?.owner?.isInline == true ->
|
||||
value.irType.classOrNull?.owner?.isSingleFieldValueClass == true ->
|
||||
invokeGetClass(value.materializedAtBoxed(value.irType))
|
||||
isPrimitive(value.type) -> {
|
||||
value.discard()
|
||||
|
||||
+1
-1
@@ -142,7 +142,7 @@ internal class BridgeLowering(val context: JvmBackendContext) : FileLoweringPass
|
||||
|
||||
bridgeTargets.forEach { createBridges(declaration, it) }
|
||||
|
||||
if (declaration.isInline) {
|
||||
if (declaration.isSingleFieldValueClass) {
|
||||
// Inline class (implementing 'MutableCollection<T>', where T is Int or an inline class mapped to Int)
|
||||
// can contain a static replacement for a function 'remove', which forces value parameter boxing
|
||||
// in order to avoid signature clash with 'remove(int)' method in 'java.util.List'.
|
||||
|
||||
+2
-1
@@ -19,6 +19,7 @@ import org.jetbrains.kotlin.ir.builders.declarations.addConstructor
|
||||
import org.jetbrains.kotlin.ir.builders.irBlockBody
|
||||
import org.jetbrains.kotlin.ir.builders.irDelegatingConstructorCall
|
||||
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||
import org.jetbrains.kotlin.ir.declarations.isSingleFieldValueClass
|
||||
import org.jetbrains.kotlin.ir.util.constructors
|
||||
import org.jetbrains.kotlin.ir.util.hasDefaultValue
|
||||
|
||||
@@ -37,7 +38,7 @@ internal val jvmDefaultConstructorPhase = makeIrFilePhase(
|
||||
private class JvmDefaultConstructorLowering(val context: JvmBackendContext) : ClassLoweringPass {
|
||||
|
||||
override fun lower(irClass: IrClass) {
|
||||
if (irClass.kind != ClassKind.CLASS || irClass.visibility == DescriptorVisibilities.LOCAL || irClass.isInline || irClass.isInner ||
|
||||
if (irClass.kind != ClassKind.CLASS || irClass.visibility == DescriptorVisibilities.LOCAL || irClass.isSingleFieldValueClass || irClass.isInner ||
|
||||
irClass.modality == Modality.SEALED
|
||||
)
|
||||
return
|
||||
|
||||
+6
-6
@@ -85,7 +85,7 @@ private class JvmInlineClassLowering(private val context: JvmBackendContext) : F
|
||||
}
|
||||
}
|
||||
|
||||
if (declaration.isInline) {
|
||||
if (declaration.isSingleFieldValueClass) {
|
||||
val irConstructor = declaration.primaryConstructor!!
|
||||
// The field getter is used by reflection and cannot be removed here unless it is internal.
|
||||
declaration.declarations.removeIf {
|
||||
@@ -111,7 +111,7 @@ private class JvmInlineClassLowering(private val context: JvmBackendContext) : F
|
||||
}
|
||||
|
||||
private fun transformFunctionFlat(function: IrFunction): List<IrDeclaration>? {
|
||||
if (function is IrConstructor && function.isPrimary && function.constructedClass.isInline)
|
||||
if (function is IrConstructor && function.isPrimary && function.constructedClass.isSingleFieldValueClass)
|
||||
return null
|
||||
|
||||
val replacement = context.inlineClassReplacements.getReplacementFunction(function)
|
||||
@@ -166,7 +166,7 @@ private class JvmInlineClassLowering(private val context: JvmBackendContext) : F
|
||||
bridgeFunction.overriddenSymbols = replacement.overriddenSymbols
|
||||
|
||||
// Replace the function body with a wrapper
|
||||
if (!bridgeFunction.isFakeOverride || !bridgeFunction.parentAsClass.isInline) {
|
||||
if (!bridgeFunction.isFakeOverride || !bridgeFunction.parentAsClass.isSingleFieldValueClass) {
|
||||
createBridgeBody(bridgeFunction, replacement)
|
||||
} else {
|
||||
// Fake overrides redirect from the replacement to the original function, which is in turn replaced during interfacePhase.
|
||||
@@ -417,7 +417,7 @@ private class JvmInlineClassLowering(private val context: JvmBackendContext) : F
|
||||
if (symbol != context.irBuiltIns.eqeqSymbol)
|
||||
return false
|
||||
|
||||
val leftClass = getValueArgument(0)?.type?.classOrNull?.owner?.takeIf { it.isInline }
|
||||
val leftClass = getValueArgument(0)?.type?.classOrNull?.owner?.takeIf { it.isSingleFieldValueClass }
|
||||
?: return false
|
||||
|
||||
// Before version 1.4, we cannot rely on the Result.equals-impl0 method
|
||||
@@ -430,7 +430,7 @@ private class JvmInlineClassLowering(private val context: JvmBackendContext) : F
|
||||
val parent = field.parent
|
||||
if (field.origin == IrDeclarationOrigin.PROPERTY_BACKING_FIELD &&
|
||||
parent is IrClass &&
|
||||
parent.isInline &&
|
||||
parent.isSingleFieldValueClass &&
|
||||
field.name == parent.inlineClassFieldName) {
|
||||
val receiver = expression.receiver!!.transform(this, null)
|
||||
return coerceInlineClasses(receiver, receiver.type, field.type)
|
||||
@@ -492,7 +492,7 @@ private class JvmInlineClassLowering(private val context: JvmBackendContext) : F
|
||||
|
||||
// Anonymous initializers in inline classes are processed when building the primary constructor.
|
||||
override fun visitAnonymousInitializerNew(declaration: IrAnonymousInitializer): IrStatement {
|
||||
if (declaration.parent.safeAs<IrClass>()?.isInline == true)
|
||||
if (declaration.parent.safeAs<IrClass>()?.isSingleFieldValueClass == true)
|
||||
return declaration
|
||||
return super.visitAnonymousInitializerNew(declaration)
|
||||
}
|
||||
|
||||
-1
@@ -256,7 +256,6 @@ private class ScriptsToClassesLowering(val context: JvmBackendContext, val inner
|
||||
name = Name.identifier("RunnerKt")
|
||||
kind = ClassKind.CLASS
|
||||
modality = Modality.FINAL
|
||||
isInline = false
|
||||
}.apply {
|
||||
parent = scriptingJvmPackage
|
||||
createImplicitParameterDeclarationWithWrappedDescriptor()
|
||||
|
||||
+1
-1
@@ -369,7 +369,7 @@ private class SyntheticAccessorTransformer(
|
||||
|
||||
val constructedClass = constructedClass
|
||||
|
||||
if (!DescriptorVisibilities.isPrivate(visibility) && !constructedClass.isInline && hasMangledParameters &&
|
||||
if (!DescriptorVisibilities.isPrivate(visibility) && !constructedClass.isSingleFieldValueClass && hasMangledParameters &&
|
||||
!constructedClass.isAnonymousObject
|
||||
) return true
|
||||
|
||||
|
||||
+2
-2
@@ -577,7 +577,7 @@ internal class LambdaMetafactoryArgumentsBuilder(
|
||||
// All Kotlin inline classes are final,
|
||||
// and their supertypes are trivially mapped to reference types.
|
||||
val erasedAdapteeClass = getErasedClassForSignatureAdaptation(adapteeType)
|
||||
if (erasedAdapteeClass.isInline) {
|
||||
if (erasedAdapteeClass.isSingleFieldValueClass) {
|
||||
// Inline classes mapped to non-null reference types are a special case because they can't be boxed trivially.
|
||||
// TODO consider adding a special type annotation to force boxing on an inline class type regardless of its underlying type.
|
||||
val underlyingAdapteeType = getInlineClassUnderlyingType(erasedAdapteeClass)
|
||||
@@ -586,7 +586,7 @@ internal class LambdaMetafactoryArgumentsBuilder(
|
||||
}
|
||||
|
||||
val erasedExpectedClass = getErasedClassForSignatureAdaptation(expectedType)
|
||||
return if (erasedExpectedClass.isInline) {
|
||||
return if (erasedExpectedClass.isSingleFieldValueClass) {
|
||||
// LambdaMetafactory doesn't know about method mangling.
|
||||
TypeAdaptationConstraint.CONFLICT
|
||||
} else {
|
||||
|
||||
@@ -57,7 +57,7 @@ object InlineClassAbi {
|
||||
fun mangledNameFor(irFunction: IrFunction, mangleReturnTypes: Boolean, useOldMangleRules: Boolean): Name {
|
||||
if (irFunction is IrConstructor) {
|
||||
// Note that we might drop this convention and use standard mangling for constructors too, see KT-37186.
|
||||
assert(irFunction.constructedClass.isInline) {
|
||||
assert(irFunction.constructedClass.isSingleFieldValueClass) {
|
||||
"Should not mangle names of non-inline class constructors: ${irFunction.render()}"
|
||||
}
|
||||
return Name.identifier("constructor-impl")
|
||||
@@ -69,7 +69,7 @@ object InlineClassAbi {
|
||||
irFunction.returnType.takeIf { mangleReturnTypes && irFunction.hasMangledReturnType },
|
||||
irFunction.isSuspend
|
||||
)
|
||||
if (suffix == null && ((irFunction.parent as? IrClass)?.isInline != true || irFunction.origin == IrDeclarationOrigin.IR_BUILTINS_STUB)) {
|
||||
if (suffix == null && ((irFunction.parent as? IrClass)?.isSingleFieldValueClass != true || irFunction.origin == IrDeclarationOrigin.IR_BUILTINS_STUB)) {
|
||||
return irFunction.name
|
||||
}
|
||||
|
||||
@@ -121,16 +121,16 @@ object InlineClassAbi {
|
||||
val IrType.requiresMangling: Boolean
|
||||
get() {
|
||||
val irClass = erasedUpperBound
|
||||
return irClass.isInline && irClass.fqNameWhenAvailable != StandardNames.RESULT_FQ_NAME
|
||||
return irClass.isSingleFieldValueClass && irClass.fqNameWhenAvailable != StandardNames.RESULT_FQ_NAME
|
||||
}
|
||||
|
||||
val IrFunction.fullValueParameterList: List<IrValueParameter>
|
||||
get() = listOfNotNull(extensionReceiverParameter) + valueParameters
|
||||
|
||||
val IrFunction.hasMangledParameters: Boolean
|
||||
get() = dispatchReceiverParameter != null && parentAsClass.isInline ||
|
||||
get() = dispatchReceiverParameter != null && parentAsClass.isSingleFieldValueClass ||
|
||||
fullValueParameterList.any { it.type.requiresMangling } ||
|
||||
(this is IrConstructor && constructedClass.isInline)
|
||||
(this is IrConstructor && constructedClass.isSingleFieldValueClass)
|
||||
|
||||
val IrFunction.hasMangledReturnType: Boolean
|
||||
get() = returnType.isInlineClassType() && parentClassOrNull?.isFileClass != true
|
||||
@@ -139,5 +139,5 @@ val IrClass.inlineClassFieldName: Name
|
||||
get() = (inlineClassRepresentation ?: error("Not an inline class: ${render()}")).underlyingPropertyName
|
||||
|
||||
val IrFunction.isInlineClassFieldGetter: Boolean
|
||||
get() = (parent as? IrClass)?.isInline == true && this is IrSimpleFunction && extensionReceiverParameter == null &&
|
||||
get() = (parent as? IrClass)?.isSingleFieldValueClass == true && this is IrSimpleFunction && extensionReceiverParameter == null &&
|
||||
correspondingPropertySymbol?.let { it.owner.getter == this && it.owner.name == parentAsClass.inlineClassFieldName } == true
|
||||
|
||||
@@ -20,7 +20,6 @@ import org.jetbrains.kotlin.ir.types.defaultType
|
||||
import org.jetbrains.kotlin.ir.types.makeNullable
|
||||
import org.jetbrains.kotlin.ir.types.typeWith
|
||||
import org.jetbrains.kotlin.ir.util.defaultType
|
||||
import org.jetbrains.kotlin.ir.util.functions
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
|
||||
@@ -131,14 +130,14 @@ class JvmReflectSymbols(val context: JvmBackendContext) {
|
||||
fqName: FqName,
|
||||
classKind: ClassKind = ClassKind.CLASS,
|
||||
classModality: Modality = Modality.FINAL,
|
||||
classIsInline: Boolean = false,
|
||||
classIsValue: Boolean = false,
|
||||
block: (IrClass) -> Unit = {}
|
||||
): IrClassSymbol =
|
||||
context.irFactory.buildClass {
|
||||
name = fqName.shortName()
|
||||
kind = classKind
|
||||
modality = classModality
|
||||
isInline = classIsInline
|
||||
isValue = classIsValue
|
||||
}.apply {
|
||||
parent = javaLangReflectPackage
|
||||
createImplicitParameterDeclarationWithWrappedDescriptor()
|
||||
|
||||
@@ -84,14 +84,14 @@ class JvmSymbols(
|
||||
fqName: FqName,
|
||||
classKind: ClassKind = ClassKind.CLASS,
|
||||
classModality: Modality = Modality.FINAL,
|
||||
classIsInline: Boolean = false,
|
||||
classIsValue: Boolean = false,
|
||||
block: (IrClass) -> Unit = {}
|
||||
): IrClassSymbol =
|
||||
irFactory.buildClass {
|
||||
name = fqName.shortName()
|
||||
kind = classKind
|
||||
modality = classModality
|
||||
isInline = classIsInline
|
||||
isValue = classIsValue
|
||||
}.apply {
|
||||
parent = when (fqName.parent().asString()) {
|
||||
"kotlin" -> kotlinPackage
|
||||
@@ -271,7 +271,7 @@ class JvmSymbols(
|
||||
}
|
||||
|
||||
private val resultClassStub: IrClassSymbol =
|
||||
createClass(StandardNames.RESULT_FQ_NAME, classIsInline = true) { klass ->
|
||||
createClass(StandardNames.RESULT_FQ_NAME, classIsValue = true) { klass ->
|
||||
klass.addTypeParameter("T", irBuiltIns.anyNType, Variance.OUT_VARIANCE)
|
||||
klass.inlineClassRepresentation = InlineClassRepresentation(Name.identifier("value"), irBuiltIns.anyNType as IrSimpleType)
|
||||
}
|
||||
|
||||
+7
-7
@@ -63,7 +63,7 @@ class MemoizedInlineClassReplacements(
|
||||
null
|
||||
|
||||
// Mangle all functions in the body of an inline class
|
||||
it.parent.safeAs<IrClass>()?.isInline == true ->
|
||||
it.parent.safeAs<IrClass>()?.isSingleFieldValueClass == true ->
|
||||
when {
|
||||
it.isRemoveAtSpecialBuiltinStub() ->
|
||||
null
|
||||
@@ -93,7 +93,7 @@ class MemoizedInlineClassReplacements(
|
||||
if (this !is IrSimpleFunction) return false
|
||||
if (!this.isFakeOverride) return false
|
||||
val parentClass = parentClassOrNull ?: return false
|
||||
if (!parentClass.isInline) return false
|
||||
if (!parentClass.isSingleFieldValueClass) return false
|
||||
|
||||
val overridden = resolveFakeOverride() ?: return false
|
||||
if (!overridden.parentAsClass.isJvmInterface) return false
|
||||
@@ -113,7 +113,7 @@ class MemoizedInlineClassReplacements(
|
||||
*/
|
||||
val getBoxFunction: (IrClass) -> IrSimpleFunction =
|
||||
storageManager.createMemoizedFunction { irClass ->
|
||||
require(irClass.isInline)
|
||||
require(irClass.isSingleFieldValueClass)
|
||||
irFactory.buildFun {
|
||||
name = Name.identifier(KotlinTypeMapper.BOX_JVM_METHOD_NAME)
|
||||
origin = JvmLoweredDeclarationOrigin.SYNTHETIC_INLINE_CLASS_MEMBER
|
||||
@@ -134,7 +134,7 @@ class MemoizedInlineClassReplacements(
|
||||
*/
|
||||
val getUnboxFunction: (IrClass) -> IrSimpleFunction =
|
||||
storageManager.createMemoizedFunction { irClass ->
|
||||
require(irClass.isInline)
|
||||
require(irClass.isSingleFieldValueClass)
|
||||
irFactory.buildFun {
|
||||
name = Name.identifier(KotlinTypeMapper.UNBOX_JVM_METHOD_NAME)
|
||||
origin = JvmLoweredDeclarationOrigin.SYNTHETIC_INLINE_CLASS_MEMBER
|
||||
@@ -147,7 +147,7 @@ class MemoizedInlineClassReplacements(
|
||||
|
||||
private val specializedEqualsCache = storageManager.createCacheWithNotNullValues<IrClass, IrSimpleFunction>()
|
||||
fun getSpecializedEqualsMethod(irClass: IrClass, irBuiltIns: IrBuiltIns): IrSimpleFunction {
|
||||
require(irClass.isInline)
|
||||
require(irClass.isSingleFieldValueClass)
|
||||
return specializedEqualsCache.computeIfAbsent(irClass) {
|
||||
irFactory.buildFun {
|
||||
name = InlineClassDescriptorResolver.SPECIALIZED_EQUALS_NAME
|
||||
@@ -257,9 +257,9 @@ class MemoizedInlineClassReplacements(
|
||||
modality = Modality.OPEN
|
||||
}
|
||||
origin = when {
|
||||
function.origin == IrDeclarationOrigin.GENERATED_INLINE_CLASS_MEMBER ->
|
||||
function.origin == IrDeclarationOrigin.GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER ->
|
||||
JvmLoweredDeclarationOrigin.INLINE_CLASS_GENERATED_IMPL_METHOD
|
||||
function is IrConstructor && function.constructedClass.isInline ->
|
||||
function is IrConstructor && function.constructedClass.isSingleFieldValueClass ->
|
||||
JvmLoweredDeclarationOrigin.STATIC_INLINE_CLASS_CONSTRUCTOR
|
||||
else ->
|
||||
replacementOrigin
|
||||
|
||||
@@ -8,10 +8,7 @@ package org.jetbrains.kotlin.backend.jvm.ir
|
||||
import org.jetbrains.kotlin.backend.jvm.JvmBackendContext
|
||||
import org.jetbrains.kotlin.backend.jvm.unboxInlineClass
|
||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||
import org.jetbrains.kotlin.ir.declarations.IrScript
|
||||
import org.jetbrains.kotlin.ir.declarations.IrTypeParameter
|
||||
import org.jetbrains.kotlin.ir.declarations.IrTypeParametersContainer
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl
|
||||
import org.jetbrains.kotlin.ir.expressions.impl.IrConstImpl
|
||||
@@ -106,7 +103,7 @@ fun IrType.defaultValue(startOffset: Int, endOffset: Int, context: JvmBackendCon
|
||||
return classifier.owner.representativeUpperBound.defaultValue(startOffset, endOffset, context)
|
||||
}
|
||||
|
||||
if (this !is IrSimpleType || hasQuestionMark || classOrNull?.owner?.isInline != true)
|
||||
if (this !is IrSimpleType || hasQuestionMark || classOrNull?.owner?.isSingleFieldValueClass != true)
|
||||
return IrConstImpl.defaultValueForType(startOffset, endOffset, this)
|
||||
|
||||
val underlyingType = unboxInlineClass()
|
||||
@@ -119,7 +116,7 @@ fun IrType.defaultValue(startOffset: Int, endOffset: Int, context: JvmBackendCon
|
||||
}
|
||||
|
||||
fun IrType.isInlineClassType(): Boolean =
|
||||
erasedUpperBound.isInline
|
||||
erasedUpperBound.isSingleFieldValueClass
|
||||
|
||||
val IrType.upperBound: IrType
|
||||
get() = erasedUpperBound.symbol.starProjectedType
|
||||
|
||||
+2
-5
@@ -17,10 +17,7 @@ import org.jetbrains.kotlin.codegen.state.KotlinTypeMapperBase
|
||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.ClassifierDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor
|
||||
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFunction
|
||||
import org.jetbrains.kotlin.ir.declarations.IrPackageFragment
|
||||
import org.jetbrains.kotlin.ir.declarations.IrTypeParameter
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.symbols.IrClassSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrScriptSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol
|
||||
@@ -121,7 +118,7 @@ class IrTypeMapper(private val context: JvmBackendContext) : KotlinTypeMapperBas
|
||||
|
||||
fun boxType(irType: IrType): Type {
|
||||
val irClass = irType.classOrNull?.owner
|
||||
if (irClass != null && irClass.isInline) {
|
||||
if (irClass != null && irClass.isSingleFieldValueClass) {
|
||||
return mapTypeAsDeclaration(irType)
|
||||
}
|
||||
val type = AbstractTypeMapper.mapType(this, irType)
|
||||
|
||||
+1
-1
@@ -216,7 +216,7 @@ class MethodSignatureMapper(private val context: JvmBackendContext) {
|
||||
}
|
||||
|
||||
private fun isBoxMethodForInlineClass(function: IrFunction): Boolean =
|
||||
function.parent.let { it is IrClass && it.isInline } &&
|
||||
function.parent.let { it is IrClass && it.isSingleFieldValueClass } &&
|
||||
function.origin == JvmLoweredDeclarationOrigin.SYNTHETIC_INLINE_CLASS_MEMBER &&
|
||||
function.name.asString() == "box-impl"
|
||||
|
||||
|
||||
+1
-2
@@ -23,7 +23,6 @@ import org.jetbrains.kotlin.ir.expressions.IrSetValue
|
||||
import org.jetbrains.kotlin.ir.expressions.IrTypeOperator
|
||||
import org.jetbrains.kotlin.ir.expressions.impl.*
|
||||
import org.jetbrains.kotlin.ir.symbols.IrValueSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrVariableSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.impl.IrConstructorSymbolImpl
|
||||
import org.jetbrains.kotlin.ir.symbols.impl.IrFieldSymbolImpl
|
||||
import org.jetbrains.kotlin.ir.symbols.impl.IrVariableSymbolImpl
|
||||
@@ -151,7 +150,7 @@ class WasmSharedVariablesManager(val context: JsCommonBackendContext, val builtI
|
||||
isInner = false
|
||||
isData = false
|
||||
isExternal = false
|
||||
isInline = false
|
||||
isValue = false
|
||||
isExpect = false
|
||||
isFun = false
|
||||
}
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ internal class KClassProxy(
|
||||
override val isFun: Boolean
|
||||
get() = state.classReference.isFun
|
||||
override val isValue: Boolean
|
||||
get() = state.classReference.isInline
|
||||
get() = state.classReference.isValue
|
||||
|
||||
override fun isInstance(value: Any?): Boolean {
|
||||
verify(value is State) { "Cannot interpret `isInstance` method for $value" }
|
||||
|
||||
+12
-10
@@ -20,10 +20,6 @@ import org.jetbrains.kotlin.backend.common.CodegenUtil
|
||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.descriptors.annotations.AnnotationUseSiteTarget
|
||||
import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
||||
import org.jetbrains.kotlin.descriptors.impl.FieldDescriptorImpl
|
||||
import org.jetbrains.kotlin.descriptors.impl.PropertyDescriptorImpl
|
||||
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.descriptors.IrImplementingDelegateDescriptorImpl
|
||||
@@ -41,7 +37,6 @@ import org.jetbrains.kotlin.ir.util.SYNTHETIC_OFFSET
|
||||
import org.jetbrains.kotlin.ir.util.createIrClassFromDescriptor
|
||||
import org.jetbrains.kotlin.ir.util.declareSimpleFunctionWithOverrides
|
||||
import org.jetbrains.kotlin.ir.util.properties
|
||||
import org.jetbrains.kotlin.ir.util.referenceFunction
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.psi.KtClassOrObject
|
||||
import org.jetbrains.kotlin.psi.KtDelegatedSuperTypeEntry
|
||||
@@ -55,7 +50,6 @@ import org.jetbrains.kotlin.psi.synthetics.SyntheticClassOrObjectDescriptor
|
||||
import org.jetbrains.kotlin.psi.synthetics.findClassDescriptor
|
||||
import org.jetbrains.kotlin.resolve.BindingContext
|
||||
import org.jetbrains.kotlin.resolve.DelegationResolver
|
||||
import org.jetbrains.kotlin.resolve.DescriptorFactory
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.propertyIfAccessor
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.setSingleOverridden
|
||||
@@ -112,19 +106,23 @@ class ClassGenerator(
|
||||
|
||||
generateFakeOverrideMemberDeclarations(irClass, ktClassOrObject)
|
||||
|
||||
if (irClass.isInline && ktClassOrObject is KtClassOrObject) {
|
||||
if (irClass.isSingleFieldValueClass && ktClassOrObject is KtClassOrObject) {
|
||||
val representation = classDescriptor.inlineClassRepresentation
|
||||
?: error("Unknown representation for inline class: $classDescriptor")
|
||||
irClass.inlineClassRepresentation = representation.mapUnderlyingType { type ->
|
||||
type.toIrType() as? IrSimpleType ?: error("Inline class underlying type is not a simple type: $classDescriptor")
|
||||
}
|
||||
generateAdditionalMembersForInlineClasses(irClass, ktClassOrObject)
|
||||
generateAdditionalMembersForSingleFieldValueClasses(irClass, ktClassOrObject)
|
||||
}
|
||||
|
||||
if (irClass.isData && ktClassOrObject is KtClassOrObject) {
|
||||
generateAdditionalMembersForDataClass(irClass, ktClassOrObject)
|
||||
}
|
||||
|
||||
if (irClass.isMultiFieldValueClass && ktClassOrObject is KtClassOrObject) {
|
||||
generateAdditionalMembersForMultiFieldValueClasses(irClass, ktClassOrObject)
|
||||
}
|
||||
|
||||
if (DescriptorUtils.isEnumClass(classDescriptor)) {
|
||||
generateAdditionalMembersForEnumClass(irClass)
|
||||
}
|
||||
@@ -422,8 +420,12 @@ class ClassGenerator(
|
||||
return typeArguments
|
||||
}
|
||||
|
||||
private fun generateAdditionalMembersForInlineClasses(irClass: IrClass, ktClassOrObject: KtClassOrObject) {
|
||||
DataClassMembersGenerator(declarationGenerator).generateInlineClassMembers(ktClassOrObject, irClass)
|
||||
private fun generateAdditionalMembersForSingleFieldValueClasses(irClass: IrClass, ktClassOrObject: KtClassOrObject) {
|
||||
DataClassMembersGenerator(declarationGenerator).generateSingleFieldValueClassMembers(ktClassOrObject, irClass)
|
||||
}
|
||||
|
||||
private fun generateAdditionalMembersForMultiFieldValueClasses(irClass: IrClass, ktClassOrObject: KtClassOrObject) {
|
||||
DataClassMembersGenerator(declarationGenerator).generateMultiFieldValueClassMembers(ktClassOrObject, irClass)
|
||||
}
|
||||
|
||||
private fun generateAdditionalMembersForDataClass(irClass: IrClass, ktClassOrObject: KtClassOrObject) {
|
||||
|
||||
+6
-2
@@ -45,8 +45,12 @@ class DataClassMembersGenerator(
|
||||
declarationGenerator: DeclarationGenerator
|
||||
) : DeclarationGeneratorExtension(declarationGenerator) {
|
||||
|
||||
fun generateInlineClassMembers(ktClassOrObject: KtClassOrObject, irClass: IrClass) {
|
||||
MyDataClassMethodGenerator(ktClassOrObject, irClass, IrDeclarationOrigin.GENERATED_INLINE_CLASS_MEMBER).generate()
|
||||
fun generateSingleFieldValueClassMembers(ktClassOrObject: KtClassOrObject, irClass: IrClass) {
|
||||
MyDataClassMethodGenerator(ktClassOrObject, irClass, IrDeclarationOrigin.GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER).generate()
|
||||
}
|
||||
|
||||
fun generateMultiFieldValueClassMembers(ktClassOrObject: KtClassOrObject, irClass: IrClass) {
|
||||
MyDataClassMethodGenerator(ktClassOrObject, irClass, IrDeclarationOrigin.GENERATED_MULTI_FIELD_VALUE_CLASS_MEMBER).generate()
|
||||
}
|
||||
|
||||
fun generateDataClassMembers(ktClassOrObject: KtClassOrObject, irClass: IrClass) {
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ open class IrClassImpl(
|
||||
override var isInner: Boolean = false,
|
||||
override val isData: Boolean = false,
|
||||
override val isExternal: Boolean = false,
|
||||
override val isInline: Boolean = false,
|
||||
override val isValue: Boolean = false,
|
||||
override val isExpect: Boolean = false,
|
||||
override val isFun: Boolean = false,
|
||||
override val source: SourceElement = SourceElement.NO_SOURCE,
|
||||
|
||||
+2
-2
@@ -47,14 +47,14 @@ abstract class AbstractIrFactoryImpl : IrFactory {
|
||||
isInner: Boolean,
|
||||
isData: Boolean,
|
||||
isExternal: Boolean,
|
||||
isInline: Boolean,
|
||||
isValue: Boolean,
|
||||
isExpect: Boolean,
|
||||
isFun: Boolean,
|
||||
source: SourceElement,
|
||||
): IrClass =
|
||||
IrClassImpl(
|
||||
startOffset, endOffset, origin, symbol, name, kind, visibility, modality,
|
||||
isCompanion, isInner, isData, isExternal, isInline, isExpect, isFun, source,
|
||||
isCompanion, isInner, isData, isExternal, isValue, isExpect, isFun, source,
|
||||
factory = this
|
||||
)
|
||||
|
||||
|
||||
+2
-2
@@ -58,7 +58,7 @@ class IrFactoryImplForJsIC(override val stageController: StageController) : Abst
|
||||
isInner: Boolean,
|
||||
isData: Boolean,
|
||||
isExternal: Boolean,
|
||||
isInline: Boolean,
|
||||
isValue: Boolean,
|
||||
isExpect: Boolean,
|
||||
isFun: Boolean,
|
||||
source: SourceElement
|
||||
@@ -76,7 +76,7 @@ class IrFactoryImplForJsIC(override val stageController: StageController) : Abst
|
||||
isInner,
|
||||
isData,
|
||||
isExternal,
|
||||
isInline,
|
||||
isValue,
|
||||
isExpect,
|
||||
isFun,
|
||||
source,
|
||||
|
||||
+2
-2
@@ -17,7 +17,7 @@ class IrClassBuilder : IrDeclarationBuilder() {
|
||||
var isInner: Boolean = false
|
||||
var isData: Boolean = false
|
||||
var isExternal: Boolean = false
|
||||
var isInline: Boolean = false
|
||||
var isValue: Boolean = false
|
||||
var isExpect: Boolean = false
|
||||
var isFun: Boolean = false
|
||||
|
||||
@@ -30,7 +30,7 @@ class IrClassBuilder : IrDeclarationBuilder() {
|
||||
isInner = from.isInner
|
||||
isData = from.isData
|
||||
isExternal = from.isExternal
|
||||
isInline = from.isInline
|
||||
isValue = from.isValue
|
||||
isExpect = from.isExpect
|
||||
isFun = from.isFun
|
||||
}
|
||||
|
||||
@@ -21,8 +21,9 @@ import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.symbols.IrClassSymbol
|
||||
import org.jetbrains.kotlin.ir.types.IrSimpleType
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.util.transformInPlace
|
||||
import org.jetbrains.kotlin.ir.util.primaryConstructor
|
||||
import org.jetbrains.kotlin.ir.util.transformIfNeeded
|
||||
import org.jetbrains.kotlin.ir.util.transformInPlace
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
|
||||
@@ -39,7 +40,7 @@ abstract class IrClass :
|
||||
abstract val isCompanion: Boolean
|
||||
abstract val isInner: Boolean
|
||||
abstract val isData: Boolean
|
||||
abstract val isInline: Boolean
|
||||
abstract val isValue: Boolean
|
||||
abstract val isExpect: Boolean
|
||||
abstract val isFun: Boolean
|
||||
|
||||
@@ -69,6 +70,12 @@ abstract class IrClass :
|
||||
}
|
||||
}
|
||||
|
||||
val IrClass.isSingleFieldValueClass
|
||||
get() = this.isValue && (this.inlineClassRepresentation != null || this.primaryConstructor?.valueParameters?.size == 1)
|
||||
|
||||
val IrClass.isMultiFieldValueClass
|
||||
get() = this.isValue && !isSingleFieldValueClass
|
||||
|
||||
fun IrClass.addMember(member: IrDeclaration) {
|
||||
declarations.add(member)
|
||||
}
|
||||
|
||||
@@ -49,7 +49,8 @@ interface IrDeclarationOrigin {
|
||||
object SCRIPT_PROVIDED_PROPERTY : IrDeclarationOriginImpl("SCRIPT_PROVIDED_PROPERTY")
|
||||
object SCRIPT_RESULT_PROPERTY : IrDeclarationOriginImpl("SCRIPT_RESULT_PROPERTY")
|
||||
object GENERATED_DATA_CLASS_MEMBER : IrDeclarationOriginImpl("GENERATED_DATA_CLASS_MEMBER")
|
||||
object GENERATED_INLINE_CLASS_MEMBER : IrDeclarationOriginImpl("GENERATED_INLINE_CLASS_MEMBER")
|
||||
object GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER : IrDeclarationOriginImpl("GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER")
|
||||
object GENERATED_MULTI_FIELD_VALUE_CLASS_MEMBER : IrDeclarationOriginImpl("GENERATED_MULTI_FIELD_VALUE_CLASS_MEMBER")
|
||||
object LOCAL_FUNCTION : IrDeclarationOriginImpl("LOCAL_FUNCTION")
|
||||
object LOCAL_FUNCTION_FOR_LAMBDA : IrDeclarationOriginImpl("LOCAL_FUNCTION_FOR_LAMBDA")
|
||||
object CATCH_PARAMETER : IrDeclarationOriginImpl("CATCH_PARAMETER")
|
||||
|
||||
@@ -40,7 +40,7 @@ interface IrFactory {
|
||||
isInner: Boolean = false,
|
||||
isData: Boolean = false,
|
||||
isExternal: Boolean = false,
|
||||
isInline: Boolean = false,
|
||||
isValue: Boolean = false,
|
||||
isExpect: Boolean = false,
|
||||
isFun: Boolean = false,
|
||||
source: SourceElement = SourceElement.NO_SOURCE,
|
||||
|
||||
@@ -33,7 +33,7 @@ class IrLazyClass(
|
||||
override val isInner: Boolean,
|
||||
override val isData: Boolean,
|
||||
override val isExternal: Boolean,
|
||||
override val isInline: Boolean,
|
||||
override val isValue: Boolean,
|
||||
override val isExpect: Boolean,
|
||||
override val isFun: Boolean,
|
||||
override val stubGenerator: DeclarationStubGenerator,
|
||||
|
||||
@@ -33,7 +33,7 @@ class LazyIrFactory(
|
||||
isInner: Boolean,
|
||||
isData: Boolean,
|
||||
isExternal: Boolean,
|
||||
isInline: Boolean,
|
||||
isValue: Boolean,
|
||||
isExpect: Boolean,
|
||||
isFun: Boolean,
|
||||
source: SourceElement
|
||||
@@ -42,7 +42,7 @@ class LazyIrFactory(
|
||||
else
|
||||
delegate.createClass(
|
||||
startOffset, endOffset, origin, symbol, name, kind, visibility, modality,
|
||||
isCompanion, isInner, isData, isExternal, isInline, isExpect, isFun, source
|
||||
isCompanion, isInner, isData, isExternal, isValue, isExpect, isFun, source
|
||||
)
|
||||
|
||||
override fun createConstructor(
|
||||
|
||||
@@ -604,12 +604,11 @@ open class IrBasedClassDescriptor(owner: IrClass) : ClassDescriptor, IrBasedDecl
|
||||
|
||||
override fun isData() = owner.isData
|
||||
|
||||
override fun isInline() = owner.isInline
|
||||
override fun isInline() = owner.isSingleFieldValueClass
|
||||
|
||||
override fun isFun() = owner.isFun
|
||||
|
||||
// In IR, inline and value are synonyms
|
||||
override fun isValue() = owner.isInline
|
||||
override fun isValue() = owner.isValue
|
||||
|
||||
override fun getThisAsReceiverParameter() = owner.thisReceiver?.toIrBasedDescriptor() as ReceiverParameterDescriptor
|
||||
|
||||
|
||||
@@ -457,7 +457,7 @@ interface IrTypeSystemContext : TypeSystemContext, TypeSystemCommonSuperTypesCon
|
||||
this as? IrTypeParameterSymbol
|
||||
|
||||
override fun TypeConstructorMarker.isInlineClass(): Boolean =
|
||||
(this as? IrClassSymbol)?.owner?.isInline == true
|
||||
(this as? IrClassSymbol)?.owner?.isSingleFieldValueClass == true
|
||||
|
||||
override fun TypeConstructorMarker.isInnerClass(): Boolean =
|
||||
(this as? IrClassSymbol)?.owner?.isInner == true
|
||||
|
||||
@@ -128,7 +128,7 @@ abstract class DataClassMembersGenerator(
|
||||
fun generateEqualsMethodBody(properties: List<IrProperty>) {
|
||||
val irType = irClass.defaultType
|
||||
|
||||
if (!irClass.isInline) {
|
||||
if (!irClass.isSingleFieldValueClass) {
|
||||
+irIfThenReturnTrue(irEqeqeq(irThis(), irOther()))
|
||||
}
|
||||
+irIfThenReturnFalse(irNotIs(irOther(), irType))
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.impl.IrValueParameterSymbolImpl
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.isEffectivelyExternal
|
||||
import org.jetbrains.kotlin.resolve.isInlineClass
|
||||
import org.jetbrains.kotlin.resolve.isInlineOrValueClass
|
||||
import org.jetbrains.kotlin.resolve.scopes.getDescriptorsFiltered
|
||||
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
@@ -269,7 +269,7 @@ abstract class DeclarationStubGenerator(
|
||||
isInner = descriptor.isInner,
|
||||
isData = descriptor.isData,
|
||||
isExternal = descriptor.isEffectivelyExternal(),
|
||||
isInline = descriptor.isInlineClass(),
|
||||
isValue = descriptor.isInlineOrValueClass(),
|
||||
isExpect = descriptor.isExpect,
|
||||
isFun = descriptor.isFun,
|
||||
stubGenerator = this,
|
||||
|
||||
@@ -147,7 +147,7 @@ open class DeepCopyIrTreeWithSymbols(
|
||||
isInner = declaration.isInner,
|
||||
isData = declaration.isData,
|
||||
isExternal = declaration.isExternal,
|
||||
isInline = declaration.isInline,
|
||||
isValue = declaration.isValue,
|
||||
isExpect = declaration.isExpect,
|
||||
isFun = declaration.isFun
|
||||
).apply {
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.jetbrains.kotlin.ir.declarations.IrFactory
|
||||
import org.jetbrains.kotlin.ir.symbols.IrClassSymbol
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.isEffectivelyExternal
|
||||
import org.jetbrains.kotlin.resolve.isInlineClass
|
||||
import org.jetbrains.kotlin.resolve.isInlineOrValueClass
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
|
||||
val ParameterDescriptor.indexOrMinusOne: Int
|
||||
@@ -39,5 +39,5 @@ fun IrFactory.createIrClassFromDescriptor(
|
||||
): IrClass = createClass(
|
||||
startOffset, endOffset, origin, symbol, name, descriptor.kind, visibility, modality,
|
||||
descriptor.isCompanionObject, descriptor.isInner, descriptor.isData, descriptor.isEffectivelyExternal(),
|
||||
descriptor.isInlineClass(), descriptor.isExpect, descriptor.isFun, descriptor.source
|
||||
descriptor.isInlineOrValueClass(), descriptor.isExpect, descriptor.isFun, descriptor.source
|
||||
)
|
||||
|
||||
@@ -475,7 +475,7 @@ class RenderIrElementVisitor(private val normalizeNames: Boolean = false, privat
|
||||
"inner".takeIf { isInner },
|
||||
"data".takeIf { isData },
|
||||
"external".takeIf { isExternal },
|
||||
"inline".takeIf { isInline },
|
||||
"value".takeIf { isValue },
|
||||
"expect".takeIf { isExpect },
|
||||
"fun".takeIf { isFun }
|
||||
)
|
||||
|
||||
@@ -194,7 +194,8 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption
|
||||
isVararg = INAPPLICABLE,
|
||||
isSuspend = INAPPLICABLE,
|
||||
isInner,
|
||||
isInline,
|
||||
isInline = false,
|
||||
isValue,
|
||||
isData,
|
||||
isCompanion,
|
||||
isFun,
|
||||
@@ -254,6 +255,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption
|
||||
enum / annotation / fun // as a modifier in `fun interface`
|
||||
companion
|
||||
inline
|
||||
value
|
||||
infix
|
||||
operator
|
||||
data
|
||||
@@ -271,6 +273,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption
|
||||
isSuspend: Boolean,
|
||||
isInner: Boolean,
|
||||
isInline: Boolean,
|
||||
isValue: Boolean,
|
||||
isData: Boolean,
|
||||
isCompanion: Boolean,
|
||||
isFunInterface: Boolean,
|
||||
@@ -305,6 +308,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption
|
||||
p(isSuspend, "suspend")
|
||||
p(isInner, "inner")
|
||||
p(isInline, "inline")
|
||||
p(isValue, "value")
|
||||
p(isData, "data")
|
||||
p(isCompanion, "companion")
|
||||
p(isFunInterface, "fun")
|
||||
@@ -542,6 +546,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption
|
||||
isSuspend = INAPPLICABLE,
|
||||
isInner = INAPPLICABLE,
|
||||
isInline,
|
||||
isValue = INAPPLICABLE,
|
||||
isData = INAPPLICABLE,
|
||||
isCompanion = INAPPLICABLE,
|
||||
isFunInterface = INAPPLICABLE,
|
||||
@@ -597,6 +602,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption
|
||||
isSuspend,
|
||||
isInner = INAPPLICABLE,
|
||||
isInline,
|
||||
isValue = INAPPLICABLE,
|
||||
isData = INAPPLICABLE,
|
||||
isCompanion = INAPPLICABLE,
|
||||
isFunInterface = INAPPLICABLE,
|
||||
@@ -707,8 +713,9 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption
|
||||
isVararg = INAPPLICABLE,
|
||||
isSuspend = getter?.isSuspend == true,
|
||||
isInner = INAPPLICABLE,
|
||||
// could be used on property if all all accessors have same state, otherwise must be defined on each accessor
|
||||
// could be used on property if all accessors have same state, otherwise must be defined on each accessor
|
||||
isInline = false,
|
||||
isValue = INAPPLICABLE,
|
||||
isData = INAPPLICABLE,
|
||||
isCompanion = INAPPLICABLE,
|
||||
isFunInterface = INAPPLICABLE,
|
||||
@@ -797,6 +804,7 @@ private class KotlinLikeDumper(val p: Printer, val options: KotlinLikeDumpOption
|
||||
isSuspend = INAPPLICABLE,
|
||||
isInner = INAPPLICABLE,
|
||||
isInline = INAPPLICABLE,
|
||||
isValue = INAPPLICABLE,
|
||||
isData = INAPPLICABLE,
|
||||
isCompanion = INAPPLICABLE,
|
||||
isFunInterface = INAPPLICABLE,
|
||||
|
||||
+4
-2
@@ -311,7 +311,7 @@ class IrDeclarationDeserializer(
|
||||
flags.isInner,
|
||||
flags.isData,
|
||||
flags.isExternal || isEffectivelyExternal,
|
||||
flags.isInline,
|
||||
flags.isValue,
|
||||
flags.isExpect,
|
||||
flags.isFun,
|
||||
)
|
||||
@@ -331,11 +331,13 @@ class IrDeclarationDeserializer(
|
||||
thisReceiver = deserializeIrValueParameter(proto.thisReceiver, -1)
|
||||
|
||||
inlineClassRepresentation = when {
|
||||
!flags.isInline -> null
|
||||
!(flags.isValue && primaryConstructor?.valueParameters?.size == 1) -> null
|
||||
proto.hasInlineClassRepresentation() -> deserializeInlineClassRepresentation(proto.inlineClassRepresentation)
|
||||
else -> computeMissingInlineClassRepresentationForCompatibility(this)
|
||||
}
|
||||
|
||||
// todo something when value classes
|
||||
|
||||
sealedSubclasses = proto.sealedSubclassList.map { deserializeIrSymbol(it) as IrClassSymbol }
|
||||
|
||||
fakeOverrideBuilder.enqueueClass(this, signature, compatibilityMode)
|
||||
|
||||
+5
-4
@@ -8,8 +8,8 @@ package org.jetbrains.kotlin.backend.common.serialization.encodings
|
||||
import org.jetbrains.kotlin.backend.common.serialization.IrFlags
|
||||
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.metadata.ProtoBuf
|
||||
import org.jetbrains.kotlin.serialization.deserialization.ProtoEnumFlags
|
||||
@@ -27,7 +27,7 @@ value class ClassFlags(val flags: Long) {
|
||||
val isCompanion: Boolean get() = IrFlags.CLASS_KIND.get(flags.toInt()) == ProtoBuf.Class.Kind.COMPANION_OBJECT
|
||||
val isInner: Boolean get() = IrFlags.IS_INNER.get(flags.toInt())
|
||||
val isData: Boolean get() = IrFlags.IS_DATA.get(flags.toInt())
|
||||
val isInline: Boolean get() = IrFlags.IS_INLINE_CLASS.get(flags.toInt())
|
||||
val isValue: Boolean get() = IrFlags.IS_VALUE_CLASS.get(flags.toInt())
|
||||
val isExpect: Boolean get() = IrFlags.IS_EXPECT_CLASS.get(flags.toInt())
|
||||
val isExternal: Boolean get() = IrFlags.IS_EXTERNAL_CLASS.get(flags.toInt())
|
||||
val isFun: Boolean get() = IrFlags.IS_FUN_INTERFACE.get(flags.toInt())
|
||||
@@ -40,8 +40,9 @@ value class ClassFlags(val flags: Long) {
|
||||
val modality = ProtoEnumFlags.modality(modality)
|
||||
val kind = ProtoEnumFlags.classKind(kind, isCompanion)
|
||||
|
||||
val flags =
|
||||
IrFlags.getClassFlags(hasAnnotation, visibility, modality, kind, isInner, isData, isExternal, isExpect, isInline, isFun)
|
||||
val flags = IrFlags.getClassFlags(
|
||||
hasAnnotation, visibility, modality, kind, isInner, isData, isExternal, isExpect, isValue, isFun
|
||||
)
|
||||
|
||||
flags.toLong()
|
||||
}
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ class DescriptorSerializer private constructor(
|
||||
ProtoEnumFlags.modality(classDescriptor.modality),
|
||||
ProtoEnumFlags.classKind(classDescriptor.kind, classDescriptor.isCompanionObject),
|
||||
classDescriptor.isInner, classDescriptor.isData, classDescriptor.isExternal, classDescriptor.isExpect,
|
||||
classDescriptor.isInlineClass(), classDescriptor.isFun
|
||||
classDescriptor.isInlineOrValueClass(), classDescriptor.isFun
|
||||
)
|
||||
if (flags != builder.flags) {
|
||||
builder.flags = flags
|
||||
|
||||
+6
-6
@@ -49,7 +49,7 @@ fun box(): String {
|
||||
val f5 = F5(UInt.MAX_VALUE.dec())
|
||||
val f6 = F6("678")
|
||||
val a1 = A(f1, f2, f3, f4, f5, f6, 9, UInt.MAX_VALUE - 2U, "0")
|
||||
val a2 = a1
|
||||
val a2 = A(f1, f2, f3, f4, f5, f6, 9, UInt.MAX_VALUE - 2U, "0")
|
||||
val b = B(a1, a2)
|
||||
|
||||
assert(f1.x == 1)
|
||||
@@ -181,17 +181,17 @@ fun box(): String {
|
||||
assert(b.toString() == b.toString())
|
||||
assert(b.hashCode() == b.hashCode())
|
||||
|
||||
fun String.assertGoodBasicToString(expected: String) = assert(matches(Regex("^([_a-zA-Z]+[.])*$expected@[0-9a-f]+$"))) { this }
|
||||
|
||||
assert(f1.toString() == "F1(x=1)") { f1.toString() }
|
||||
assert(f2.toString() == "F2(x=4294967295)") { f2.toString() }
|
||||
f3.toString().assertGoodBasicToString("F3") // not data class yet
|
||||
assert(f3.toString() == "F3(x=F1(x=1), y=F2(x=4294967295))") { f3.toString() }
|
||||
assert(f4.toString() == "F4(x=5)") { f4.toString() }
|
||||
assert(f5.toString() == "F5(x=4294967294)") { f5.toString() }
|
||||
assert(f6.toString() == "F6(x=678)") { f6.toString() }
|
||||
a1.toString().assertGoodBasicToString("A") // not data class yet
|
||||
a2.toString().assertGoodBasicToString("A") // not data class yet
|
||||
assert(b.toString() == "OverridenBToString(a1 = $a1, a2 = $a2)") { b.toString() }
|
||||
val aStr = "A(f1=F1(x=1), f2=F2(x=4294967295), f3=F3(x=F1(x=1), y=F2(x=4294967295)), f4=F4(x=5), f5=F5(x=4294967294), f6=F6(x=678), f7=9, f8=4294967293, f9=0)"
|
||||
assert(a1.toString() == aStr) { a1.toString() }
|
||||
assert(a2.toString() == aStr) { a2.toString() }
|
||||
assert(b.toString() == "OverridenBToString(a1 = $aStr, a2 = $aStr)") { b.toString() }
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
+42
-42
@@ -46,9 +46,9 @@ package
|
||||
public constructor A4(/*0*/ x: B4, /*1*/ y: B4)
|
||||
public final val x: B4
|
||||
public final val y: B4
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Suppress(names = {"OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"}) @kotlin.jvm.JvmInline public final value class A5</*0*/ T : A5<T>> {
|
||||
@@ -63,27 +63,27 @@ package
|
||||
public constructor A6</*0*/ T : B6<T>>(/*0*/ x: T, /*1*/ y: T)
|
||||
public final val x: T
|
||||
public final val y: T
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Suppress(names = {"OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"}) @kotlin.jvm.JvmInline public final value class A7</*0*/ T : B7<T>> {
|
||||
public constructor A7</*0*/ T : B7<T>>(/*0*/ x: T, /*1*/ y: T)
|
||||
public final val x: T
|
||||
public final val y: T
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Suppress(names = {"OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"}) @kotlin.jvm.JvmInline public final value class A8</*0*/ T : B8<T>> {
|
||||
public constructor A8</*0*/ T : B8<T>>(/*0*/ x: T?, /*1*/ y: T?)
|
||||
public final val x: T?
|
||||
public final val y: T?
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Suppress(names = {"OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"}) @kotlin.jvm.JvmInline public final value class B : I1, I2 {
|
||||
@@ -99,18 +99,18 @@ package
|
||||
public constructor B1(/*0*/ x: B1, /*1*/ y: B1)
|
||||
public final val x: B1
|
||||
public final val y: B1
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Suppress(names = {"OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"}) @kotlin.jvm.JvmInline public final value class B2 {
|
||||
public constructor B2(/*0*/ x: A2, /*1*/ y: A2)
|
||||
public final val x: A2
|
||||
public final val y: A2
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Suppress(names = {"OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"}) @kotlin.jvm.JvmInline public final value class B3 {
|
||||
@@ -125,18 +125,18 @@ package
|
||||
public constructor B4(/*0*/ x: A4, /*1*/ y: A4)
|
||||
public final val x: A4
|
||||
public final val y: A4
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Suppress(names = {"OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"}) @kotlin.jvm.JvmInline public final value class B5</*0*/ T : B5<T>> {
|
||||
public constructor B5</*0*/ T : B5<T>>(/*0*/ x: T, /*1*/ y: T)
|
||||
public final val x: T
|
||||
public final val y: T
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Suppress(names = {"OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"}) @kotlin.jvm.JvmInline public final value class B6</*0*/ T : A6<T>> {
|
||||
@@ -151,18 +151,18 @@ package
|
||||
public constructor B7</*0*/ T : A7<T>>(/*0*/ x: T, /*1*/ y: T)
|
||||
public final val x: T
|
||||
public final val y: T
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Suppress(names = {"OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"}) @kotlin.jvm.JvmInline public final value class B8</*0*/ T : A8<T>> {
|
||||
public constructor B8</*0*/ T : A8<T>>(/*0*/ x: T?, /*1*/ y: T?)
|
||||
public final val x: T?
|
||||
public final val y: T?
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Suppress(names = {"OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"}) @kotlin.jvm.JvmInline public final value class C {
|
||||
@@ -178,36 +178,36 @@ package
|
||||
public constructor C4(/*0*/ x: D4?, /*1*/ y: D4?)
|
||||
public final val x: D4?
|
||||
public final val y: D4?
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Suppress(names = {"OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"}) @kotlin.jvm.JvmInline public final value class D4 {
|
||||
public constructor D4(/*0*/ x: D4?, /*1*/ y: C4?)
|
||||
public final val x: D4?
|
||||
public final val y: C4?
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Suppress(names = {"OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"}) @kotlin.jvm.JvmInline public final value class E4 {
|
||||
public constructor E4(/*0*/ x: E4?, /*1*/ y: kotlin.Int)
|
||||
public final val x: E4?
|
||||
public final val y: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Suppress(names = {"OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"}) @kotlin.jvm.JvmInline public final value class F4 {
|
||||
public constructor F4(/*0*/ x: kotlin.Int, /*1*/ y: F4?)
|
||||
public final val x: kotlin.Int
|
||||
public final val y: F4?
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface I1 {
|
||||
|
||||
+6
-6
@@ -45,17 +45,17 @@ package kotlin {
|
||||
public constructor A5(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int)
|
||||
public final val x: kotlin.Int
|
||||
public final val y: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmInline public final value class A6 {
|
||||
public constructor A6(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int)
|
||||
public final val y: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmInline public final value class A7 {
|
||||
|
||||
compiler/testData/diagnostics/tests/valueClasses/valueClassWithForbiddenUnderlyingTypeMultiField.txt
Vendored
+36
-36
@@ -4,54 +4,54 @@ package
|
||||
public constructor Bar(/*0*/ u: kotlin.Unit, /*1*/ y: kotlin.Unit)
|
||||
public final val u: kotlin.Unit
|
||||
public final val y: kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Suppress(names = {"OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"}) @kotlin.jvm.JvmInline public final value class BarNullable {
|
||||
public constructor BarNullable(/*0*/ u: kotlin.Unit?, /*1*/ y: kotlin.Unit?)
|
||||
public final val u: kotlin.Unit?
|
||||
public final val y: kotlin.Unit?
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Suppress(names = {"OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"}) @kotlin.jvm.JvmInline public final value class Baz {
|
||||
public constructor Baz(/*0*/ u: kotlin.Nothing, /*1*/ y: kotlin.Nothing)
|
||||
public final val u: kotlin.Nothing
|
||||
public final val y: kotlin.Nothing
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Suppress(names = {"OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"}) @kotlin.jvm.JvmInline public final value class Baz1 {
|
||||
public constructor Baz1(/*0*/ u: kotlin.Nothing, /*1*/ y: kotlin.Int)
|
||||
public final val u: kotlin.Nothing
|
||||
public final val y: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Suppress(names = {"OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"}) @kotlin.jvm.JvmInline public final value class Baz2 {
|
||||
public constructor Baz2(/*0*/ u: kotlin.Int, /*1*/ y: kotlin.Nothing)
|
||||
public final val u: kotlin.Int
|
||||
public final val y: kotlin.Nothing
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Suppress(names = {"OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"}) @kotlin.jvm.JvmInline public final value class BazNullable {
|
||||
public constructor BazNullable(/*0*/ u: kotlin.Nothing?, /*1*/ y: kotlin.Nothing?)
|
||||
public final val u: kotlin.Nothing?
|
||||
public final val y: kotlin.Nothing?
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Suppress(names = {"OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"}) @kotlin.jvm.JvmInline public final value class Empty</*0*/ T> {
|
||||
@@ -65,53 +65,53 @@ package
|
||||
public constructor Foo</*0*/ T>(/*0*/ x: T, /*1*/ y: T)
|
||||
public final val x: T
|
||||
public final val y: T
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Suppress(names = {"OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"}) @kotlin.jvm.JvmInline public final value class FooGenericArray</*0*/ T> {
|
||||
public constructor FooGenericArray</*0*/ T>(/*0*/ x: kotlin.Array<T>, /*1*/ y: kotlin.Array<T>)
|
||||
public final val x: kotlin.Array<T>
|
||||
public final val y: kotlin.Array<T>
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Suppress(names = {"OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"}) @kotlin.jvm.JvmInline public final value class FooGenericArray2</*0*/ T> {
|
||||
public constructor FooGenericArray2</*0*/ T>(/*0*/ x: kotlin.Array<kotlin.Array<T>>, /*1*/ y: kotlin.Array<kotlin.Array<T>>)
|
||||
public final val x: kotlin.Array<kotlin.Array<T>>
|
||||
public final val y: kotlin.Array<kotlin.Array<T>>
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Suppress(names = {"OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"}) @kotlin.jvm.JvmInline public final value class FooNullable</*0*/ T> {
|
||||
public constructor FooNullable</*0*/ T>(/*0*/ x: T?, /*1*/ y: T?)
|
||||
public final val x: T?
|
||||
public final val y: T?
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Suppress(names = {"OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"}) @kotlin.jvm.JvmInline public final value class FooStarProjectedArray {
|
||||
public constructor FooStarProjectedArray(/*0*/ x: kotlin.Array<*>, /*1*/ y: kotlin.Array<*>)
|
||||
public final val x: kotlin.Array<*>
|
||||
public final val y: kotlin.Array<*>
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.Suppress(names = {"OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"}) @kotlin.jvm.JvmInline public final value class FooStarProjectedArray2 {
|
||||
public constructor FooStarProjectedArray2(/*0*/ x: kotlin.Array<kotlin.Array<*>>, /*1*/ y: kotlin.Array<kotlin.Array<*>>)
|
||||
public final val x: kotlin.Array<kotlin.Array<*>>
|
||||
public final val y: kotlin.Array<kotlin.Array<*>>
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
|
||||
@@ -97,13 +97,13 @@ FILE fqName:<root> fileName:/kt31649.kt
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null
|
||||
receiver: GET_VAR '<this>: <root>.TestData declared in <root>.TestData.toString' type=<root>.TestData origin=null
|
||||
CONST String type=kotlin.String value=")"
|
||||
CLASS CLASS name:TestInline modality:FINAL visibility:public [inline] superTypes:[kotlin.Any]
|
||||
CLASS CLASS name:TestInline modality:FINAL visibility:public [value] superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestInline
|
||||
CONSTRUCTOR visibility:public <> (nn:kotlin.Nothing?) returnType:<root>.TestInline [primary]
|
||||
VALUE_PARAMETER name:nn index:0 type:kotlin.Nothing?
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInline modality:FINAL visibility:public [inline] superTypes:[kotlin.Any]'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInline modality:FINAL visibility:public [value] superTypes:[kotlin.Any]'
|
||||
PROPERTY name:nn visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
@@ -115,11 +115,11 @@ FILE fqName:<root> fileName:/kt31649.kt
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-nn> (): kotlin.Nothing? declared in <root>.TestInline'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null
|
||||
receiver: GET_VAR '<this>: <root>.TestInline declared in <root>.TestInline.<get-nn>' type=<root>.TestInline origin=null
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.TestInline, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.TestInline, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_INLINE_CLASS_MEMBER name:<this> type:<root>.TestInline
|
||||
VALUE_PARAMETER GENERATED_INLINE_CLASS_MEMBER name:other index:0 type:kotlin.Any?
|
||||
$this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:<this> type:<root>.TestInline
|
||||
VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:other index:0 type:kotlin.Any?
|
||||
BLOCK_BODY
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
@@ -142,10 +142,10 @@ FILE fqName:<root> fileName:/kt31649.kt
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.TestInline'
|
||||
CONST Boolean type=kotlin.Boolean value=true
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.TestInline) returnType:kotlin.Int
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.TestInline) returnType:kotlin.Int
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_INLINE_CLASS_MEMBER name:<this> type:<root>.TestInline
|
||||
$this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:<this> type:<root>.TestInline
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in <root>.TestInline'
|
||||
WHEN type=kotlin.Int origin=null
|
||||
@@ -160,10 +160,10 @@ FILE fqName:<root> fileName:/kt31649.kt
|
||||
then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null
|
||||
receiver: GET_VAR '<this>: <root>.TestInline declared in <root>.TestInline.hashCode' type=<root>.TestInline origin=null
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.TestInline) returnType:kotlin.String
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.TestInline) returnType:kotlin.String
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_INLINE_CLASS_MEMBER name:<this> type:<root>.TestInline
|
||||
$this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:<this> type:<root>.TestInline
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.TestInline'
|
||||
STRING_CONCATENATION type=kotlin.String
|
||||
|
||||
@@ -44,7 +44,7 @@ data class TestData {
|
||||
|
||||
}
|
||||
|
||||
inline class TestInline {
|
||||
value class TestInline {
|
||||
constructor(nn: Nothing?) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
@@ -78,3 +78,4 @@ inline class TestInline {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -97,13 +97,13 @@ FILE fqName:<root> fileName:/kt31649.kt
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.TestData'
|
||||
CONST Boolean type=kotlin.Boolean value=true
|
||||
CLASS CLASS name:TestInline modality:FINAL visibility:public [inline] superTypes:[kotlin.Any]
|
||||
CLASS CLASS name:TestInline modality:FINAL visibility:public [value] superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestInline
|
||||
CONSTRUCTOR visibility:public <> (nn:kotlin.Nothing?) returnType:<root>.TestInline [primary]
|
||||
VALUE_PARAMETER name:nn index:0 type:kotlin.Nothing?
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInline modality:FINAL visibility:public [inline] superTypes:[kotlin.Any]'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInline modality:FINAL visibility:public [value] superTypes:[kotlin.Any]'
|
||||
PROPERTY name:nn visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
@@ -115,7 +115,7 @@ FILE fqName:<root> fileName:/kt31649.kt
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-nn> (): kotlin.Nothing? declared in <root>.TestInline'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null
|
||||
receiver: GET_VAR '<this>: <root>.TestInline declared in <root>.TestInline.<get-nn>' type=<root>.TestInline origin=null
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.TestInline) returnType:kotlin.String
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.TestInline) returnType:kotlin.String
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.TestInline
|
||||
@@ -127,7 +127,7 @@ FILE fqName:<root> fileName:/kt31649.kt
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null
|
||||
receiver: GET_VAR '<this>: <root>.TestInline declared in <root>.TestInline.toString' type=<root>.TestInline origin=null
|
||||
CONST String type=kotlin.String value=")"
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.TestInline) returnType:kotlin.Int
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.TestInline) returnType:kotlin.Int
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.TestInline
|
||||
@@ -145,7 +145,7 @@ FILE fqName:<root> fileName:/kt31649.kt
|
||||
then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null
|
||||
receiver: GET_VAR '<this>: <root>.TestInline declared in <root>.TestInline.hashCode' type=<root>.TestInline origin=null
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.TestInline, other:kotlin.Any?) returnType:kotlin.Boolean [operator]
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.TestInline, other:kotlin.Any?) returnType:kotlin.Boolean [operator]
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.TestInline
|
||||
|
||||
@@ -44,7 +44,7 @@ data class TestData {
|
||||
|
||||
}
|
||||
|
||||
inline class TestInline {
|
||||
value class TestInline {
|
||||
constructor(nn: Nothing?) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
@@ -78,3 +78,4 @@ inline class TestInline {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
FILE fqName:<root> fileName:/inlineClass.kt
|
||||
CLASS CLASS name:Test modality:FINAL visibility:public [inline] superTypes:[kotlin.Any]
|
||||
CLASS CLASS name:Test modality:FINAL visibility:public [value] superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Test
|
||||
CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:<root>.Test [primary]
|
||||
VALUE_PARAMETER name:x index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public [inline] superTypes:[kotlin.Any]'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public [value] superTypes:[kotlin.Any]'
|
||||
PROPERTY name:x visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
@@ -17,11 +17,11 @@ FILE fqName:<root> fileName:/inlineClass.kt
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-x> (): kotlin.Int declared in <root>.Test'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test.<get-x>' type=<root>.Test origin=null
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.Test, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.Test, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_INLINE_CLASS_MEMBER name:<this> type:<root>.Test
|
||||
VALUE_PARAMETER GENERATED_INLINE_CLASS_MEMBER name:other index:0 type:kotlin.Any?
|
||||
$this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:<this> type:<root>.Test
|
||||
VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:other index:0 type:kotlin.Any?
|
||||
BLOCK_BODY
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
@@ -44,19 +44,19 @@ FILE fqName:<root> fileName:/inlineClass.kt
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Test'
|
||||
CONST Boolean type=kotlin.Boolean value=true
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.Test) returnType:kotlin.Int
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.Test) returnType:kotlin.Int
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_INLINE_CLASS_MEMBER name:<this> type:<root>.Test
|
||||
$this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:<this> type:<root>.Test
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in <root>.Test'
|
||||
CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test.hashCode' type=<root>.Test origin=null
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.Test) returnType:kotlin.String
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.Test) returnType:kotlin.String
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_INLINE_CLASS_MEMBER name:<this> type:<root>.Test
|
||||
$this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:<this> type:<root>.Test
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.Test'
|
||||
STRING_CONCATENATION type=kotlin.String
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
inline class Test {
|
||||
value class Test {
|
||||
constructor(x: Int) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
@@ -29,3 +29,4 @@ inline class Test {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -1,11 +1,11 @@
|
||||
FILE fqName:<root> fileName:/inlineClass.kt
|
||||
CLASS CLASS name:Test modality:FINAL visibility:public [inline] superTypes:[kotlin.Any]
|
||||
CLASS CLASS name:Test modality:FINAL visibility:public [value] superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Test
|
||||
CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:<root>.Test [primary]
|
||||
VALUE_PARAMETER name:x index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public [inline] superTypes:[kotlin.Any]'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public [value] superTypes:[kotlin.Any]'
|
||||
PROPERTY name:x visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
@@ -17,7 +17,7 @@ FILE fqName:<root> fileName:/inlineClass.kt
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-x> (): kotlin.Int declared in <root>.Test'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test.<get-x>' type=<root>.Test origin=null
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.Test) returnType:kotlin.String
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.Test) returnType:kotlin.String
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Test
|
||||
@@ -29,7 +29,7 @@ FILE fqName:<root> fileName:/inlineClass.kt
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test.toString' type=<root>.Test origin=null
|
||||
CONST String type=kotlin.String value=")"
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.Test) returnType:kotlin.Int
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.Test) returnType:kotlin.Int
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Test
|
||||
@@ -38,7 +38,7 @@ FILE fqName:<root> fileName:/inlineClass.kt
|
||||
CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test.hashCode' type=<root>.Test origin=null
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.Test, other:kotlin.Any?) returnType:kotlin.Boolean [operator]
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.Test, other:kotlin.Any?) returnType:kotlin.Boolean [operator]
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Test
|
||||
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
inline class Test {
|
||||
value class Test {
|
||||
constructor(x: Int) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
@@ -29,3 +29,4 @@ inline class Test {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -36,14 +36,14 @@ FILE fqName:<root> fileName:/inlineClassSyntheticMethods.kt
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
CLASS CLASS name:IC modality:FINAL visibility:public [inline] superTypes:[kotlin.Any]
|
||||
CLASS CLASS name:IC modality:FINAL visibility:public [value] superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.IC<TT of <root>.IC>
|
||||
TYPE_PARAMETER name:TT index:0 variance: superTypes:[kotlin.Any?]
|
||||
CONSTRUCTOR visibility:public <> (c:<root>.C<TT of <root>.IC>) returnType:<root>.IC<TT of <root>.IC> [primary]
|
||||
VALUE_PARAMETER name:c index:0 type:<root>.C<TT of <root>.IC>
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IC modality:FINAL visibility:public [inline] superTypes:[kotlin.Any]'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IC modality:FINAL visibility:public [value] superTypes:[kotlin.Any]'
|
||||
PROPERTY name:c visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:c type:<root>.C<TT of <root>.IC> visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
@@ -62,11 +62,11 @@ FILE fqName:<root> fileName:/inlineClassSyntheticMethods.kt
|
||||
CALL 'public final fun hashCode (): kotlin.Int declared in <root>.C' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-c> (): <root>.C<TT of <root>.IC> declared in <root>.IC' type=<root>.C<TT of <root>.IC> origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.IC<TT of <root>.IC> declared in <root>.IC.foo' type=<root>.IC<TT of <root>.IC> origin=null
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.IC<TT of <root>.IC>, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.IC<TT of <root>.IC>, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_INLINE_CLASS_MEMBER name:<this> type:<root>.IC<TT of <root>.IC>
|
||||
VALUE_PARAMETER GENERATED_INLINE_CLASS_MEMBER name:other index:0 type:kotlin.Any?
|
||||
$this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:<this> type:<root>.IC<TT of <root>.IC>
|
||||
VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:other index:0 type:kotlin.Any?
|
||||
BLOCK_BODY
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
@@ -89,19 +89,19 @@ FILE fqName:<root> fileName:/inlineClassSyntheticMethods.kt
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.IC'
|
||||
CONST Boolean type=kotlin.Boolean value=true
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.IC<TT of <root>.IC>) returnType:kotlin.Int
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.IC<TT of <root>.IC>) returnType:kotlin.Int
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_INLINE_CLASS_MEMBER name:<this> type:<root>.IC<TT of <root>.IC>
|
||||
$this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:<this> type:<root>.IC<TT of <root>.IC>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in <root>.IC'
|
||||
CALL 'public final fun hashCode (): kotlin.Int declared in <root>.C' type=kotlin.Int origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:<root>.C<TT of <root>.IC> visibility:private [final]' type=<root>.C<TT of <root>.IC> origin=null
|
||||
receiver: GET_VAR '<this>: <root>.IC<TT of <root>.IC> declared in <root>.IC.hashCode' type=<root>.IC<TT of <root>.IC> origin=null
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.IC<TT of <root>.IC>) returnType:kotlin.String
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.IC<TT of <root>.IC>) returnType:kotlin.String
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_INLINE_CLASS_MEMBER name:<this> type:<root>.IC<TT of <root>.IC>
|
||||
$this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:<this> type:<root>.IC<TT of <root>.IC>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.IC'
|
||||
STRING_CONCATENATION type=kotlin.String
|
||||
|
||||
@@ -15,7 +15,7 @@ class C<T : Any?> {
|
||||
|
||||
}
|
||||
|
||||
inline class IC<TT : Any?> {
|
||||
value class IC<TT : Any?> {
|
||||
constructor(c: C<TT>) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
@@ -58,3 +58,4 @@ fun box(): String {
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
|
||||
|
||||
@@ -36,14 +36,14 @@ FILE fqName:<root> fileName:/inlineClassSyntheticMethods.kt
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
CLASS CLASS name:IC modality:FINAL visibility:public [inline] superTypes:[kotlin.Any]
|
||||
CLASS CLASS name:IC modality:FINAL visibility:public [value] superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.IC<TT of <root>.IC>
|
||||
TYPE_PARAMETER name:TT index:0 variance: superTypes:[kotlin.Any?]
|
||||
CONSTRUCTOR visibility:public <> (c:<root>.C<TT of <root>.IC>) returnType:<root>.IC<TT of <root>.IC> [primary]
|
||||
VALUE_PARAMETER name:c index:0 type:<root>.C<TT of <root>.IC>
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IC modality:FINAL visibility:public [inline] superTypes:[kotlin.Any]'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IC modality:FINAL visibility:public [value] superTypes:[kotlin.Any]'
|
||||
PROPERTY name:c visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:c type:<root>.C<TT of <root>.IC> visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
@@ -62,7 +62,7 @@ FILE fqName:<root> fileName:/inlineClassSyntheticMethods.kt
|
||||
CALL 'public open fun hashCode (): kotlin.Int declared in <root>.C' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-c> (): <root>.C<TT of <root>.IC> declared in <root>.IC' type=<root>.C<TT of <root>.IC> origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.IC<TT of <root>.IC> declared in <root>.IC.foo' type=<root>.IC<TT of <root>.IC> origin=null
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.IC<TT of <root>.IC>) returnType:kotlin.String
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.IC<TT of <root>.IC>) returnType:kotlin.String
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.IC<TT of <root>.IC>
|
||||
@@ -74,7 +74,7 @@ FILE fqName:<root> fileName:/inlineClassSyntheticMethods.kt
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:<root>.C<TT of <root>.IC> visibility:private [final]' type=<root>.C<TT of <root>.IC> origin=null
|
||||
receiver: GET_VAR '<this>: <root>.IC<TT of <root>.IC> declared in <root>.IC.toString' type=<root>.IC<TT of <root>.IC> origin=null
|
||||
CONST String type=kotlin.String value=")"
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.IC<TT of <root>.IC>) returnType:kotlin.Int
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.IC<TT of <root>.IC>) returnType:kotlin.Int
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.IC<TT of <root>.IC>
|
||||
@@ -83,7 +83,7 @@ FILE fqName:<root> fileName:/inlineClassSyntheticMethods.kt
|
||||
CALL 'public open fun hashCode (): kotlin.Int declared in <root>.C' type=kotlin.Int origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:<root>.C<TT of <root>.IC> visibility:private [final]' type=<root>.C<TT of <root>.IC> origin=null
|
||||
receiver: GET_VAR '<this>: <root>.IC<TT of <root>.IC> declared in <root>.IC.hashCode' type=<root>.IC<TT of <root>.IC> origin=null
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.IC<TT of <root>.IC>, other:kotlin.Any?) returnType:kotlin.Boolean [operator]
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.IC<TT of <root>.IC>, other:kotlin.Any?) returnType:kotlin.Boolean [operator]
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.IC<TT of <root>.IC>
|
||||
|
||||
@@ -15,7 +15,7 @@ class C<T : Any?> {
|
||||
|
||||
}
|
||||
|
||||
inline class IC<TT : Any?> {
|
||||
value class IC<TT : Any?> {
|
||||
constructor(c: C<TT>) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
@@ -58,3 +58,4 @@ fun box(): String {
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
|
||||
|
||||
+18
-18
@@ -1,11 +1,11 @@
|
||||
FILE fqName:<root> fileName:/inlineCollectionOfInlineClass.kt
|
||||
CLASS CLASS name:IT modality:FINAL visibility:public [inline] superTypes:[kotlin.Any]
|
||||
CLASS CLASS name:IT modality:FINAL visibility:public [value] superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.IT
|
||||
CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:<root>.IT [primary]
|
||||
VALUE_PARAMETER name:x index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IT modality:FINAL visibility:public [inline] superTypes:[kotlin.Any]'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IT modality:FINAL visibility:public [value] superTypes:[kotlin.Any]'
|
||||
PROPERTY name:x visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
@@ -17,11 +17,11 @@ FILE fqName:<root> fileName:/inlineCollectionOfInlineClass.kt
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-x> (): kotlin.Int declared in <root>.IT'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.IT declared in <root>.IT.<get-x>' type=<root>.IT origin=null
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.IT, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.IT, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_INLINE_CLASS_MEMBER name:<this> type:<root>.IT
|
||||
VALUE_PARAMETER GENERATED_INLINE_CLASS_MEMBER name:other index:0 type:kotlin.Any?
|
||||
$this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:<this> type:<root>.IT
|
||||
VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:other index:0 type:kotlin.Any?
|
||||
BLOCK_BODY
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
@@ -44,19 +44,19 @@ FILE fqName:<root> fileName:/inlineCollectionOfInlineClass.kt
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.IT'
|
||||
CONST Boolean type=kotlin.Boolean value=true
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.IT) returnType:kotlin.Int
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.IT) returnType:kotlin.Int
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_INLINE_CLASS_MEMBER name:<this> type:<root>.IT
|
||||
$this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:<this> type:<root>.IT
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in <root>.IT'
|
||||
CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.IT declared in <root>.IT.hashCode' type=<root>.IT origin=null
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.IT) returnType:kotlin.String
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.IT) returnType:kotlin.String
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_INLINE_CLASS_MEMBER name:<this> type:<root>.IT
|
||||
$this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:<this> type:<root>.IT
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.IT'
|
||||
STRING_CONCATENATION type=kotlin.String
|
||||
@@ -65,13 +65,13 @@ FILE fqName:<root> fileName:/inlineCollectionOfInlineClass.kt
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.IT declared in <root>.IT.toString' type=<root>.IT origin=null
|
||||
CONST String type=kotlin.String value=")"
|
||||
CLASS CLASS name:InlineMutableSet modality:FINAL visibility:public [inline] superTypes:[kotlin.collections.MutableSet<<root>.IT>]
|
||||
CLASS CLASS name:InlineMutableSet modality:FINAL visibility:public [value] superTypes:[kotlin.collections.MutableSet<<root>.IT>]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.InlineMutableSet
|
||||
CONSTRUCTOR visibility:public <> (ms:kotlin.collections.MutableSet<<root>.IT>) returnType:<root>.InlineMutableSet [primary]
|
||||
VALUE_PARAMETER name:ms index:0 type:kotlin.collections.MutableSet<<root>.IT>
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:InlineMutableSet modality:FINAL visibility:public [inline] superTypes:[kotlin.collections.MutableSet<<root>.IT>]'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:InlineMutableSet modality:FINAL visibility:public [value] superTypes:[kotlin.collections.MutableSet<<root>.IT>]'
|
||||
PROPERTY name:ms visibility:private modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:ms type:kotlin.collections.MutableSet<<root>.IT> visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
@@ -199,11 +199,11 @@ FILE fqName:<root> fileName:/inlineCollectionOfInlineClass.kt
|
||||
$this: CALL 'private final fun <get-ms> (): kotlin.collections.MutableSet<<root>.IT> declared in <root>.InlineMutableSet' type=kotlin.collections.MutableSet<<root>.IT> origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.InlineMutableSet declared in <root>.InlineMutableSet.retainAll' type=<root>.InlineMutableSet origin=null
|
||||
elements: GET_VAR 'elements: kotlin.collections.Collection<<root>.IT> declared in <root>.InlineMutableSet.retainAll' type=kotlin.collections.Collection<<root>.IT> origin=null
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.InlineMutableSet, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.InlineMutableSet, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_INLINE_CLASS_MEMBER name:<this> type:<root>.InlineMutableSet
|
||||
VALUE_PARAMETER GENERATED_INLINE_CLASS_MEMBER name:other index:0 type:kotlin.Any?
|
||||
$this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:<this> type:<root>.InlineMutableSet
|
||||
VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:other index:0 type:kotlin.Any?
|
||||
BLOCK_BODY
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
@@ -226,19 +226,19 @@ FILE fqName:<root> fileName:/inlineCollectionOfInlineClass.kt
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.InlineMutableSet'
|
||||
CONST Boolean type=kotlin.Boolean value=true
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.InlineMutableSet) returnType:kotlin.Int
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.InlineMutableSet) returnType:kotlin.Int
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_INLINE_CLASS_MEMBER name:<this> type:<root>.InlineMutableSet
|
||||
$this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:<this> type:<root>.InlineMutableSet
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in <root>.InlineMutableSet'
|
||||
CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.collections.MutableSet' type=kotlin.Int origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ms type:kotlin.collections.MutableSet<<root>.IT> visibility:private [final]' type=kotlin.collections.MutableSet<<root>.IT> origin=null
|
||||
receiver: GET_VAR '<this>: <root>.InlineMutableSet declared in <root>.InlineMutableSet.hashCode' type=<root>.InlineMutableSet origin=null
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.InlineMutableSet) returnType:kotlin.String
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.InlineMutableSet) returnType:kotlin.String
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_INLINE_CLASS_MEMBER name:<this> type:<root>.InlineMutableSet
|
||||
$this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:<this> type:<root>.InlineMutableSet
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.InlineMutableSet'
|
||||
STRING_CONCATENATION type=kotlin.String
|
||||
|
||||
+3
-2
@@ -1,4 +1,4 @@
|
||||
inline class IT {
|
||||
value class IT {
|
||||
constructor(x: Int) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
@@ -30,7 +30,7 @@ inline class IT {
|
||||
|
||||
}
|
||||
|
||||
inline class InlineMutableSet : MutableSet<IT> {
|
||||
value class InlineMutableSet : MutableSet<IT> {
|
||||
constructor(ms: MutableSet<IT>) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
@@ -106,3 +106,4 @@ inline class InlineMutableSet : MutableSet<IT> {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
+10
-10
@@ -1,11 +1,11 @@
|
||||
FILE fqName:<root> fileName:/inlineCollectionOfInlineClass.kt
|
||||
CLASS CLASS name:IT modality:FINAL visibility:public [inline] superTypes:[kotlin.Any]
|
||||
CLASS CLASS name:IT modality:FINAL visibility:public [value] superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.IT
|
||||
CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:<root>.IT [primary]
|
||||
VALUE_PARAMETER name:x index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IT modality:FINAL visibility:public [inline] superTypes:[kotlin.Any]'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IT modality:FINAL visibility:public [value] superTypes:[kotlin.Any]'
|
||||
PROPERTY name:x visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
@@ -17,7 +17,7 @@ FILE fqName:<root> fileName:/inlineCollectionOfInlineClass.kt
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-x> (): kotlin.Int declared in <root>.IT'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.IT declared in <root>.IT.<get-x>' type=<root>.IT origin=null
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.IT) returnType:kotlin.String
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.IT) returnType:kotlin.String
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.IT
|
||||
@@ -29,7 +29,7 @@ FILE fqName:<root> fileName:/inlineCollectionOfInlineClass.kt
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.IT declared in <root>.IT.toString' type=<root>.IT origin=null
|
||||
CONST String type=kotlin.String value=")"
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.IT) returnType:kotlin.Int
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.IT) returnType:kotlin.Int
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.IT
|
||||
@@ -38,7 +38,7 @@ FILE fqName:<root> fileName:/inlineCollectionOfInlineClass.kt
|
||||
CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.IT declared in <root>.IT.hashCode' type=<root>.IT origin=null
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.IT, other:kotlin.Any?) returnType:kotlin.Boolean [operator]
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.IT, other:kotlin.Any?) returnType:kotlin.Boolean [operator]
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.IT
|
||||
@@ -65,13 +65,13 @@ FILE fqName:<root> fileName:/inlineCollectionOfInlineClass.kt
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.IT'
|
||||
CONST Boolean type=kotlin.Boolean value=true
|
||||
CLASS CLASS name:InlineMutableSet modality:FINAL visibility:public [inline] superTypes:[kotlin.collections.MutableSet<<root>.IT>]
|
||||
CLASS CLASS name:InlineMutableSet modality:FINAL visibility:public [value] superTypes:[kotlin.collections.MutableSet<<root>.IT>]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.InlineMutableSet
|
||||
CONSTRUCTOR visibility:public <> (ms:kotlin.collections.MutableSet<<root>.IT>) returnType:<root>.InlineMutableSet [primary]
|
||||
VALUE_PARAMETER name:ms index:0 type:kotlin.collections.MutableSet<<root>.IT>
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:InlineMutableSet modality:FINAL visibility:public [inline] superTypes:[kotlin.collections.MutableSet<<root>.IT>]'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:InlineMutableSet modality:FINAL visibility:public [value] superTypes:[kotlin.collections.MutableSet<<root>.IT>]'
|
||||
PROPERTY name:ms visibility:private modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:ms type:kotlin.collections.MutableSet<<root>.IT> visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
@@ -199,7 +199,7 @@ FILE fqName:<root> fileName:/inlineCollectionOfInlineClass.kt
|
||||
$this: CALL 'private final fun <get-ms> (): kotlin.collections.MutableSet<<root>.IT> declared in <root>.InlineMutableSet' type=kotlin.collections.MutableSet<<root>.IT> origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.InlineMutableSet declared in <root>.InlineMutableSet.retainAll' type=<root>.InlineMutableSet origin=null
|
||||
elements: GET_VAR 'elements: kotlin.collections.Collection<<root>.IT> declared in <root>.InlineMutableSet.retainAll' type=kotlin.collections.Collection<<root>.IT> origin=null
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.InlineMutableSet) returnType:kotlin.String
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.InlineMutableSet) returnType:kotlin.String
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String [fake_override] declared in kotlin.collections.MutableSet
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.InlineMutableSet
|
||||
@@ -211,7 +211,7 @@ FILE fqName:<root> fileName:/inlineCollectionOfInlineClass.kt
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ms type:kotlin.collections.MutableSet<<root>.IT> visibility:private [final]' type=kotlin.collections.MutableSet<<root>.IT> origin=null
|
||||
receiver: GET_VAR '<this>: <root>.InlineMutableSet declared in <root>.InlineMutableSet.toString' type=<root>.InlineMutableSet origin=null
|
||||
CONST String type=kotlin.String value=")"
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.InlineMutableSet) returnType:kotlin.Int
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.InlineMutableSet) returnType:kotlin.Int
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.collections.MutableSet
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.InlineMutableSet
|
||||
@@ -220,7 +220,7 @@ FILE fqName:<root> fileName:/inlineCollectionOfInlineClass.kt
|
||||
CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.collections.MutableSet' type=kotlin.Int origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ms type:kotlin.collections.MutableSet<<root>.IT> visibility:private [final]' type=kotlin.collections.MutableSet<<root>.IT> origin=null
|
||||
receiver: GET_VAR '<this>: <root>.InlineMutableSet declared in <root>.InlineMutableSet.hashCode' type=<root>.InlineMutableSet origin=null
|
||||
FUN GENERATED_INLINE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.InlineMutableSet, other:kotlin.Any?) returnType:kotlin.Boolean [operator]
|
||||
FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.InlineMutableSet, other:kotlin.Any?) returnType:kotlin.Boolean [operator]
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in kotlin.collections.MutableSet
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.InlineMutableSet
|
||||
|
||||
+3
-2
@@ -1,4 +1,4 @@
|
||||
inline class IT {
|
||||
value class IT {
|
||||
constructor(x: Int) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
@@ -30,7 +30,7 @@ inline class IT {
|
||||
|
||||
}
|
||||
|
||||
inline class InlineMutableSet : MutableSet<IT> {
|
||||
value class InlineMutableSet : MutableSet<IT> {
|
||||
constructor(ms: MutableSet<IT>) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
@@ -106,3 +106,4 @@ inline class InlineMutableSet : MutableSet<IT> {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ val JVM_INLINE_ANNOTATION_CLASS_ID = ClassId.topLevel(JVM_INLINE_ANNOTATION_FQ_N
|
||||
fun DeclarationDescriptor.isInlineClass(): Boolean = when {
|
||||
this !is ClassDescriptor -> false
|
||||
isInline -> true
|
||||
else -> isValue && (unsubstitutedPrimaryConstructor?.valueParameters?.size?.let { it == 1 } ?: true)
|
||||
else -> isValue && unsubstitutedPrimaryConstructor?.valueParameters?.size == 1
|
||||
}
|
||||
|
||||
fun DeclarationDescriptor.isValueClass(): Boolean =
|
||||
|
||||
+3
-8
@@ -23,14 +23,9 @@ import org.jetbrains.kotlin.resolve.scopes.MemberScope
|
||||
import org.jetbrains.kotlin.resolve.scopes.StaticScopeForKotlinEnum
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ContextClassReceiver
|
||||
import org.jetbrains.kotlin.serialization.deserialization.*
|
||||
import org.jetbrains.kotlin.types.AbstractClassTypeConstructor
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.SimpleType
|
||||
import org.jetbrains.kotlin.types.TypeConstructor
|
||||
import org.jetbrains.kotlin.types.*
|
||||
import org.jetbrains.kotlin.types.checker.KotlinTypeRefiner
|
||||
import org.jetbrains.kotlin.types.TypeRefinement
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.flatMapToNullable
|
||||
import java.util.*
|
||||
|
||||
class DeserializedClassDescriptor(
|
||||
outerContext: DeserializationContext,
|
||||
@@ -98,7 +93,7 @@ class DeserializedClassDescriptor(
|
||||
|
||||
override fun isData() = Flags.IS_DATA.get(classProto.flags)
|
||||
|
||||
override fun isInline() = Flags.IS_INLINE_CLASS.get(classProto.flags) && metadataVersion.isAtMost(1, 4, 1)
|
||||
override fun isInline() = Flags.IS_VALUE_CLASS.get(classProto.flags) && metadataVersion.isAtMost(1, 4, 1)
|
||||
|
||||
override fun isExpect() = Flags.IS_EXPECT_CLASS.get(classProto.flags)
|
||||
|
||||
@@ -108,7 +103,7 @@ class DeserializedClassDescriptor(
|
||||
|
||||
override fun isFun() = Flags.IS_FUN_INTERFACE.get(classProto.flags)
|
||||
|
||||
override fun isValue() = Flags.IS_INLINE_CLASS.get(classProto.flags) && metadataVersion.isAtLeast(1, 4, 2)
|
||||
override fun isValue() = Flags.IS_VALUE_CLASS.get(classProto.flags) && metadataVersion.isAtLeast(1, 4, 2)
|
||||
|
||||
override fun getUnsubstitutedMemberScope(kotlinTypeRefiner: KotlinTypeRefiner): MemberScope =
|
||||
memberScopeHolder.getScope(kotlinTypeRefiner)
|
||||
|
||||
@@ -30,8 +30,8 @@ public class Flags {
|
||||
public static final BooleanFlagField IS_DATA = FlagField.booleanAfter(IS_INNER);
|
||||
public static final BooleanFlagField IS_EXTERNAL_CLASS = FlagField.booleanAfter(IS_DATA);
|
||||
public static final BooleanFlagField IS_EXPECT_CLASS = FlagField.booleanAfter(IS_EXTERNAL_CLASS);
|
||||
public static final BooleanFlagField IS_INLINE_CLASS = FlagField.booleanAfter(IS_EXPECT_CLASS);
|
||||
public static final BooleanFlagField IS_FUN_INTERFACE = FlagField.booleanAfter(IS_INLINE_CLASS);
|
||||
public static final BooleanFlagField IS_VALUE_CLASS = FlagField.booleanAfter(IS_EXPECT_CLASS);
|
||||
public static final BooleanFlagField IS_FUN_INTERFACE = FlagField.booleanAfter(IS_VALUE_CLASS);
|
||||
|
||||
// Constructors
|
||||
|
||||
@@ -99,7 +99,7 @@ public class Flags {
|
||||
boolean isData,
|
||||
boolean isExternal,
|
||||
boolean isExpect,
|
||||
boolean isInline,
|
||||
boolean isValue,
|
||||
boolean isFun
|
||||
) {
|
||||
return HAS_ANNOTATIONS.toFlags(hasAnnotations)
|
||||
@@ -110,7 +110,7 @@ public class Flags {
|
||||
| IS_DATA.toFlags(isData)
|
||||
| IS_EXTERNAL_CLASS.toFlags(isExternal)
|
||||
| IS_EXPECT_CLASS.toFlags(isExpect)
|
||||
| IS_INLINE_CLASS.toFlags(isInline)
|
||||
| IS_VALUE_CLASS.toFlags(isValue)
|
||||
| IS_FUN_INTERFACE.toFlags(isFun)
|
||||
;
|
||||
}
|
||||
|
||||
+51
-51
@@ -139,62 +139,62 @@ internal class EnumSpecialDeclarationsFactory(val context: Context) {
|
||||
val endOffset = enumClass.endOffset
|
||||
|
||||
val implObject =
|
||||
IrClassImpl(
|
||||
startOffset, endOffset,
|
||||
DECLARATION_ORIGIN_ENUM,
|
||||
IrClassSymbolImpl(),
|
||||
"OBJECT".synthesizedName,
|
||||
ClassKind.OBJECT,
|
||||
DescriptorVisibilities.PUBLIC,
|
||||
Modality.FINAL,
|
||||
isCompanion = false,
|
||||
isInner = false,
|
||||
isData = false,
|
||||
isExternal = false,
|
||||
isInline = false,
|
||||
isExpect = false,
|
||||
isFun = false
|
||||
).apply {
|
||||
parent = enumClass
|
||||
createParameterDeclarations()
|
||||
}
|
||||
IrClassImpl(
|
||||
startOffset, endOffset,
|
||||
DECLARATION_ORIGIN_ENUM,
|
||||
IrClassSymbolImpl(),
|
||||
"OBJECT".synthesizedName,
|
||||
ClassKind.OBJECT,
|
||||
DescriptorVisibilities.PUBLIC,
|
||||
Modality.FINAL,
|
||||
isCompanion = false,
|
||||
isInner = false,
|
||||
isData = false,
|
||||
isExternal = false,
|
||||
isValue = false,
|
||||
isExpect = false,
|
||||
isFun = false
|
||||
).apply {
|
||||
parent = enumClass
|
||||
createParameterDeclarations()
|
||||
}
|
||||
|
||||
val valuesType = valuesArrayType(enumClass)
|
||||
val valuesField =
|
||||
IrFieldImpl(
|
||||
startOffset, endOffset,
|
||||
DECLARATION_ORIGIN_ENUM,
|
||||
IrFieldSymbolImpl(),
|
||||
"VALUES".synthesizedName,
|
||||
valuesType,
|
||||
DescriptorVisibilities.PRIVATE,
|
||||
isFinal = true,
|
||||
isExternal = false,
|
||||
isStatic = false,
|
||||
).apply {
|
||||
parent = implObject
|
||||
}
|
||||
IrFieldImpl(
|
||||
startOffset, endOffset,
|
||||
DECLARATION_ORIGIN_ENUM,
|
||||
IrFieldSymbolImpl(),
|
||||
"VALUES".synthesizedName,
|
||||
valuesType,
|
||||
DescriptorVisibilities.PRIVATE,
|
||||
isFinal = true,
|
||||
isExternal = false,
|
||||
isStatic = false,
|
||||
).apply {
|
||||
parent = implObject
|
||||
}
|
||||
|
||||
val valuesGetter =
|
||||
IrFunctionImpl(
|
||||
startOffset, endOffset,
|
||||
DECLARATION_ORIGIN_ENUM,
|
||||
IrSimpleFunctionSymbolImpl(),
|
||||
"get-VALUES".synthesizedName,
|
||||
DescriptorVisibilities.PUBLIC,
|
||||
Modality.FINAL,
|
||||
valuesType,
|
||||
isInline = false,
|
||||
isExternal = false,
|
||||
isTailrec = false,
|
||||
isSuspend = false,
|
||||
isExpect = false,
|
||||
isFakeOverride = false,
|
||||
isOperator = false,
|
||||
isInfix = false
|
||||
).apply {
|
||||
parent = implObject
|
||||
}
|
||||
IrFunctionImpl(
|
||||
startOffset, endOffset,
|
||||
DECLARATION_ORIGIN_ENUM,
|
||||
IrSimpleFunctionSymbolImpl(),
|
||||
"get-VALUES".synthesizedName,
|
||||
DescriptorVisibilities.PUBLIC,
|
||||
Modality.FINAL,
|
||||
valuesType,
|
||||
isInline = false,
|
||||
isExternal = false,
|
||||
isTailrec = false,
|
||||
isSuspend = false,
|
||||
isExpect = false,
|
||||
isFakeOverride = false,
|
||||
isOperator = false,
|
||||
isInfix = false
|
||||
).apply {
|
||||
parent = implObject
|
||||
}
|
||||
|
||||
val constructorOfAny = context.irBuiltIns.anyClass.owner.constructors.first()
|
||||
implObject.addSimpleDelegatingConstructor(
|
||||
|
||||
+2
-1
@@ -13,6 +13,7 @@ import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor
|
||||
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||
import org.jetbrains.kotlin.ir.declarations.IrProperty
|
||||
import org.jetbrains.kotlin.ir.declarations.isSingleFieldValueClass
|
||||
import org.jetbrains.kotlin.ir.symbols.IrClassSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
@@ -293,7 +294,7 @@ internal object IrTypeInlineClassesSupport : InlineClassesSupport<IrClass, IrTyp
|
||||
}
|
||||
}
|
||||
|
||||
override fun hasInlineModifier(clazz: IrClass): Boolean = clazz.isInline
|
||||
override fun hasInlineModifier(clazz: IrClass): Boolean = clazz.isSingleFieldValueClass
|
||||
|
||||
override fun getNativePointedSuperclass(clazz: IrClass): IrClass? {
|
||||
var superClass: IrClass? = clazz
|
||||
|
||||
+5
-2
@@ -9,7 +9,10 @@ import org.jetbrains.kotlin.backend.common.lower.irNot
|
||||
import org.jetbrains.kotlin.backend.konan.PrimitiveBinaryType
|
||||
import org.jetbrains.kotlin.backend.konan.RuntimeNames
|
||||
import org.jetbrains.kotlin.backend.konan.getObjCMethodInfo
|
||||
import org.jetbrains.kotlin.backend.konan.ir.*
|
||||
import org.jetbrains.kotlin.backend.konan.ir.KonanSymbols
|
||||
import org.jetbrains.kotlin.backend.konan.ir.buildSimpleAnnotation
|
||||
import org.jetbrains.kotlin.backend.konan.ir.getAnnotationArgumentValue
|
||||
import org.jetbrains.kotlin.backend.konan.ir.konanLibrary
|
||||
import org.jetbrains.kotlin.backend.konan.isObjCMetaClass
|
||||
import org.jetbrains.kotlin.backend.konan.lower.FunctionReferenceLowering
|
||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
@@ -1106,7 +1109,7 @@ private class ObjCBlockPointerValuePassing(
|
||||
Name.identifier(stubs.getUniqueKotlinFunctionReferenceClassName("BlockFunctionImpl")),
|
||||
ClassKind.CLASS, DescriptorVisibilities.PRIVATE, Modality.FINAL,
|
||||
isCompanion = false, isInner = false, isData = false, isExternal = false,
|
||||
isInline = false, isExpect = false, isFun = false
|
||||
isValue = false, isExpect = false, isFun = false
|
||||
)
|
||||
irClass.createParameterDeclarations()
|
||||
|
||||
|
||||
+8
-3
@@ -7,8 +7,10 @@ package org.jetbrains.kotlin.backend.konan.ir
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.ir.copyTo
|
||||
import org.jetbrains.kotlin.backend.common.ir.createDispatchReceiverParameter
|
||||
import org.jetbrains.kotlin.backend.konan.*
|
||||
import org.jetbrains.kotlin.backend.konan.BinaryType
|
||||
import org.jetbrains.kotlin.backend.konan.KonanBackendContext
|
||||
import org.jetbrains.kotlin.backend.konan.KonanFqNames
|
||||
import org.jetbrains.kotlin.backend.konan.computeBinaryType
|
||||
import org.jetbrains.kotlin.backend.konan.descriptors.getAnnotationStringValue
|
||||
import org.jetbrains.kotlin.descriptors.DescriptorVisibilities
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
@@ -16,10 +18,13 @@ import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin
|
||||
import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction
|
||||
import org.jetbrains.kotlin.ir.declarations.addMember
|
||||
import org.jetbrains.kotlin.ir.declarations.isSingleFieldValueClass
|
||||
import org.jetbrains.kotlin.ir.expressions.impl.IrConstImpl
|
||||
import org.jetbrains.kotlin.ir.symbols.impl.IrSimpleFunctionSymbolImpl
|
||||
import org.jetbrains.kotlin.ir.types.defaultType
|
||||
import org.jetbrains.kotlin.ir.util.*
|
||||
import org.jetbrains.kotlin.ir.util.deepCopyWithSymbols
|
||||
import org.jetbrains.kotlin.ir.util.functions
|
||||
import org.jetbrains.kotlin.ir.util.isAnnotationWithEqualFqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.util.OperatorNameConventions
|
||||
|
||||
@@ -64,7 +69,7 @@ internal class FunctionsWithoutBoundCheckGenerator(val context: KonanBackendCont
|
||||
fun generate() {
|
||||
symbols.arrays.forEach { classSymbol ->
|
||||
val underlyingClass = (classSymbol.defaultType.computeBinaryType() as BinaryType.Reference)
|
||||
.types.single().takeIf { classSymbol.owner.isInline }
|
||||
.types.single().takeIf { classSymbol.owner.isSingleFieldValueClass }
|
||||
val setFunction = classSymbol.owner.functions.single { it.name == OperatorNameConventions.SET }
|
||||
val setDelegatingToFunction = underlyingClass?.functions?.single { it.name == OperatorNameConventions.SET }
|
||||
classSymbol.owner.addMember(generateFunction(setFunction, setDelegatingToFunction, KonanNameConventions.setWithoutBoundCheck))
|
||||
|
||||
+6
-8
@@ -13,21 +13,19 @@ import org.jetbrains.kotlin.backend.common.lower.at
|
||||
import org.jetbrains.kotlin.backend.common.lower.irNot
|
||||
import org.jetbrains.kotlin.backend.konan.*
|
||||
import org.jetbrains.kotlin.ir.builders.*
|
||||
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFile
|
||||
import org.jetbrains.kotlin.ir.declarations.isSingleFieldValueClass
|
||||
import org.jetbrains.kotlin.ir.descriptors.IrBuiltinOperatorDescriptor
|
||||
import org.jetbrains.kotlin.ir.expressions.IrCall
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrTypeOperatorCall
|
||||
import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl
|
||||
import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol
|
||||
import org.jetbrains.kotlin.ir.builders.irGet
|
||||
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin
|
||||
import org.jetbrains.kotlin.ir.symbols.IrFunctionSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol
|
||||
import org.jetbrains.kotlin.ir.types.*
|
||||
import org.jetbrains.kotlin.ir.util.*
|
||||
import org.jetbrains.kotlin.ir.util.defaultOrNullableType
|
||||
import org.jetbrains.kotlin.ir.util.isNullConst
|
||||
import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid
|
||||
|
||||
/**
|
||||
@@ -125,7 +123,7 @@ internal class BuiltinOperatorLowering(val context: Context) : FileLoweringPass,
|
||||
}
|
||||
|
||||
private fun inlinedClassHasDefaultEquals(irClass: IrClass): Boolean {
|
||||
if (!irClass.isInline) {
|
||||
if (!irClass.isSingleFieldValueClass) {
|
||||
// Implicitly-inlined class, e.g. primitive one.
|
||||
return true
|
||||
}
|
||||
@@ -133,7 +131,7 @@ internal class BuiltinOperatorLowering(val context: Context) : FileLoweringPass,
|
||||
val equals = irClass.simpleFunctions()
|
||||
.single { it.name.asString() == "equals" && it.valueParameters.size == 1 && it.overrides(anyEquals) }
|
||||
|
||||
return equals.origin == IrDeclarationOrigin.GENERATED_INLINE_CLASS_MEMBER
|
||||
return equals.origin == IrDeclarationOrigin.GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER
|
||||
}
|
||||
|
||||
fun IrBuilderWithScope.genInlineClassEquals(
|
||||
|
||||
+27
-24
@@ -14,7 +14,9 @@ import org.jetbrains.kotlin.backend.common.push
|
||||
import org.jetbrains.kotlin.backend.konan.Context
|
||||
import org.jetbrains.kotlin.backend.konan.descriptors.synthesizedName
|
||||
import org.jetbrains.kotlin.backend.konan.llvm.computeFullName
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.descriptors.DescriptorVisibilities
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
import org.jetbrains.kotlin.ir.IrStatement
|
||||
import org.jetbrains.kotlin.ir.builders.*
|
||||
@@ -35,7 +37,7 @@ import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
|
||||
internal class FunctionReferenceLowering(val context: Context): FileLoweringPass {
|
||||
internal class FunctionReferenceLowering(val context: Context) : FileLoweringPass {
|
||||
|
||||
private object DECLARATION_ORIGIN_FUNCTION_REFERENCE_IMPL : IrDeclarationOriginImpl("FUNCTION_REFERENCE_IMPL")
|
||||
|
||||
@@ -46,7 +48,7 @@ internal class FunctionReferenceLowering(val context: Context): FileLoweringPass
|
||||
|
||||
override fun lower(irFile: IrFile) {
|
||||
var generatedClasses = mutableListOf<IrClass>()
|
||||
irFile.transform(object: IrElementTransformerVoidWithContext() {
|
||||
irFile.transform(object : IrElementTransformerVoidWithContext() {
|
||||
|
||||
private val stack = mutableListOf<IrElement>()
|
||||
|
||||
@@ -167,6 +169,7 @@ internal class FunctionReferenceLowering(val context: Context): FileLoweringPass
|
||||
val samSuperType: IrType? = null,
|
||||
) {
|
||||
data class BuiltFunctionReference(val functionReferenceClass: IrClass, val functionReferenceExpression: IrExpression)
|
||||
|
||||
private val irBuiltIns = context.irBuiltIns
|
||||
private val symbols = context.ir.symbols
|
||||
private val getContinuationSymbol = symbols.getContinuation
|
||||
@@ -193,28 +196,28 @@ internal class FunctionReferenceLowering(val context: Context): FileLoweringPass
|
||||
private val functionReferenceTarget = adaptedReferenceOriginalTarget ?: referencedFunction
|
||||
|
||||
private val functionReferenceClass: IrClass =
|
||||
IrClassImpl(
|
||||
startOffset,endOffset,
|
||||
DECLARATION_ORIGIN_FUNCTION_REFERENCE_IMPL,
|
||||
IrClassSymbolImpl(),
|
||||
"${functionReferenceTarget.name}\$FUNCTION_REFERENCE\$${context.functionReferenceCount++}".synthesizedName,
|
||||
ClassKind.CLASS,
|
||||
DescriptorVisibilities.PRIVATE,
|
||||
Modality.FINAL,
|
||||
isCompanion = false,
|
||||
isInner = false,
|
||||
isData = false,
|
||||
isExternal = false,
|
||||
isInline = false,
|
||||
isExpect = false,
|
||||
isFun = false
|
||||
).apply {
|
||||
parent = this@FunctionReferenceBuilder.parent
|
||||
createParameterDeclarations()
|
||||
IrClassImpl(
|
||||
startOffset, endOffset,
|
||||
DECLARATION_ORIGIN_FUNCTION_REFERENCE_IMPL,
|
||||
IrClassSymbolImpl(),
|
||||
"${functionReferenceTarget.name}\$FUNCTION_REFERENCE\$${context.functionReferenceCount++}".synthesizedName,
|
||||
ClassKind.CLASS,
|
||||
DescriptorVisibilities.PRIVATE,
|
||||
Modality.FINAL,
|
||||
isCompanion = false,
|
||||
isInner = false,
|
||||
isData = false,
|
||||
isExternal = false,
|
||||
isValue = false,
|
||||
isExpect = false,
|
||||
isFun = false
|
||||
).apply {
|
||||
parent = this@FunctionReferenceBuilder.parent
|
||||
createParameterDeclarations()
|
||||
|
||||
// copy the generated name for IrClass, partially solves KT-47194
|
||||
context.copyLocalClassName(functionReference, this)
|
||||
}
|
||||
// copy the generated name for IrClass, partially solves KT-47194
|
||||
context.copyLocalClassName(functionReference, this)
|
||||
}
|
||||
|
||||
private val functionReferenceThis = functionReferenceClass.thisReceiver!!
|
||||
|
||||
|
||||
+11
-8
@@ -7,13 +7,16 @@ package org.jetbrains.kotlin.backend.konan.lower
|
||||
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.FileLoweringPass
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.lower.*
|
||||
import org.jetbrains.kotlin.backend.konan.*
|
||||
import org.jetbrains.kotlin.ir.builders.*
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.expressions.*
|
||||
import org.jetbrains.kotlin.ir.visitors.*
|
||||
import org.jetbrains.kotlin.backend.common.lower.IrBuildingTransformer
|
||||
import org.jetbrains.kotlin.backend.common.lower.at
|
||||
import org.jetbrains.kotlin.backend.konan.Context
|
||||
import org.jetbrains.kotlin.ir.builders.irCall
|
||||
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFile
|
||||
import org.jetbrains.kotlin.ir.declarations.isSingleFieldValueClass
|
||||
import org.jetbrains.kotlin.ir.expressions.IrCall
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid
|
||||
|
||||
|
||||
/**
|
||||
@@ -39,7 +42,7 @@ private class InlineClassAccessorsTransformer(private val context: Context) : Ir
|
||||
val property = expression.symbol.owner.correspondingPropertySymbol?.owner ?: return expression
|
||||
|
||||
property.parent.let {
|
||||
if (it is IrClass && it.isInline && property.backingField != null) {
|
||||
if (it is IrClass && it.isSingleFieldValueClass && property.backingField != null) {
|
||||
expression.dispatchReceiver?.let { receiver ->
|
||||
return builder.at(expression)
|
||||
.irCall(symbols.reinterpret, expression.type, listOf(receiver.type, expression.type))
|
||||
|
||||
+1
-1
@@ -491,7 +491,7 @@ internal class TestProcessor (val context: Context) {
|
||||
isInner = false,
|
||||
isData = false,
|
||||
isExternal = false,
|
||||
isInline = false,
|
||||
isValue = false,
|
||||
isExpect = false,
|
||||
isFun = false
|
||||
).apply {
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
package kotlinx.metadata
|
||||
|
||||
import org.jetbrains.kotlin.metadata.ProtoBuf.*
|
||||
import org.jetbrains.kotlin.metadata.deserialization.Flags as F
|
||||
import org.jetbrains.kotlin.metadata.ProtoBuf.Class.Kind as ClassKind
|
||||
import org.jetbrains.kotlin.metadata.deserialization.Flags as F
|
||||
|
||||
/**
|
||||
* Represents a boolean flag that is either present or not in a Kotlin declaration. A "flag" is a boolean trait that is either present
|
||||
@@ -208,13 +208,13 @@ class Flag(private val offset: Int, private val bitWidth: Int, private val value
|
||||
level = DeprecationLevel.ERROR
|
||||
)
|
||||
@Suppress("unused")
|
||||
val IS_INLINE = Flag(F.IS_INLINE_CLASS)
|
||||
val IS_INLINE = Flag(F.IS_VALUE_CLASS)
|
||||
|
||||
/**
|
||||
* Signifies that the corresponding class is either a pre-Kotlin-1.5 `inline` class, or a 1.5+ `value` class.
|
||||
*/
|
||||
@JvmField
|
||||
val IS_VALUE = Flag(F.IS_INLINE_CLASS)
|
||||
val IS_VALUE = Flag(F.IS_VALUE_CLASS)
|
||||
|
||||
/**
|
||||
* Signifies that the corresponding class is a functional interface, i.e. marked with the keyword `fun`.
|
||||
|
||||
+2
-3
@@ -22,7 +22,6 @@ import org.jetbrains.kotlin.ir.types.*
|
||||
import org.jetbrains.kotlin.ir.util.defaultType
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.parcelize.ParcelizeNames
|
||||
import org.jetbrains.kotlin.parcelize.ParcelizeNames.CREATE_FROM_PARCEL_NAME
|
||||
import org.jetbrains.kotlin.parcelize.ParcelizeNames.NEW_ARRAY_NAME
|
||||
import org.jetbrains.kotlin.parcelize.ParcelizeNames.WRITE_TO_PARCEL_NAME
|
||||
@@ -521,12 +520,12 @@ class AndroidSymbols(
|
||||
shortName: String,
|
||||
classKind: ClassKind,
|
||||
classModality: Modality,
|
||||
isInlineClass: Boolean = false
|
||||
isValueClass: Boolean = false,
|
||||
): IrClassSymbol = irFactory.buildClass {
|
||||
name = Name.identifier(shortName)
|
||||
kind = classKind
|
||||
modality = classModality
|
||||
isInline = isInlineClass
|
||||
isValue = isValueClass
|
||||
}.apply {
|
||||
parent = irPackage
|
||||
createImplicitParameterDeclarationWithWrappedDescriptor()
|
||||
|
||||
Reference in New Issue
Block a user