diff --git a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java index 4e06cc2514c..a6b966d76b5 100644 --- a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java @@ -1722,6 +1722,11 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { runTest("compiler/testData/ir/irText/firProblems/candidateSymbol.kt"); } + @TestMetadata("ClashResolutionDescriptor.kt") + public void testClashResolutionDescriptor() throws Exception { + runTest("compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.kt"); + } + @TestMetadata("DeepCopyIrTree.kt") public void testDeepCopyIrTree() throws Exception { runTest("compiler/testData/ir/irText/firProblems/DeepCopyIrTree.kt"); diff --git a/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.fir.txt b/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.fir.txt new file mode 100644 index 00000000000..bc66ab5b44e --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.fir.txt @@ -0,0 +1,176 @@ +FILE fqName: fileName:/ClashResolutionDescriptor.kt + CLASS INTERFACE name:ComponentContainer modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ComponentContainer + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:PlatformSpecificExtension modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.PlatformSpecificExtension.PlatformSpecificExtension> + TYPE_PARAMETER name:S index:0 variance: superTypes:[.PlatformSpecificExtension.PlatformSpecificExtension>] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:ComponentDescriptor modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ComponentDescriptor + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:PlatformExtensionsClashResolver modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> + TYPE_PARAMETER name:E index:0 variance: superTypes:[.PlatformSpecificExtension.PlatformExtensionsClashResolver>] + CONSTRUCTOR visibility:public <> (applicableTo:java.lang.Class.PlatformExtensionsClashResolver>) returnType:.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> [primary] + VALUE_PARAMETER name:applicableTo index:0 type:java.lang.Class.PlatformExtensionsClashResolver> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:PlatformExtensionsClashResolver modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' + PROPERTY name:applicableTo visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:applicableTo type:java.lang.Class.PlatformExtensionsClashResolver> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'applicableTo: java.lang.Class.PlatformExtensionsClashResolver> declared in .PlatformExtensionsClashResolver.' type=java.lang.Class.PlatformExtensionsClashResolver> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver>) returnType:java.lang.Class.PlatformExtensionsClashResolver> + correspondingProperty: PROPERTY name:applicableTo visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): java.lang.Class.PlatformExtensionsClashResolver> declared in .PlatformExtensionsClashResolver' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:applicableTo type:java.lang.Class.PlatformExtensionsClashResolver> visibility:private [final]' type=java.lang.Class.PlatformExtensionsClashResolver> origin=null + receiver: GET_VAR ': .PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> declared in .PlatformExtensionsClashResolver.' type=.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:ClashResolutionDescriptor modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ClashResolutionDescriptor.ClashResolutionDescriptor> + TYPE_PARAMETER name:E index:0 variance: superTypes:[.PlatformSpecificExtension.ClashResolutionDescriptor>] + CONSTRUCTOR visibility:public <> (container:.ComponentContainer, resolver:.PlatformExtensionsClashResolver.ClashResolutionDescriptor>, clashedComponents:kotlin.collections.List<.ComponentDescriptor>) returnType:.ClashResolutionDescriptor.ClashResolutionDescriptor> [primary] + VALUE_PARAMETER name:container index:0 type:.ComponentContainer + VALUE_PARAMETER name:resolver index:1 type:.PlatformExtensionsClashResolver.ClashResolutionDescriptor> + VALUE_PARAMETER name:clashedComponents index:2 type:kotlin.collections.List<.ComponentDescriptor> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ClashResolutionDescriptor modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:resolver visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:resolver type:.PlatformExtensionsClashResolver.ClashResolutionDescriptor> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'resolver: .PlatformExtensionsClashResolver.ClashResolutionDescriptor> declared in .ClashResolutionDescriptor.' type=.PlatformExtensionsClashResolver.ClashResolutionDescriptor> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.ClashResolutionDescriptor.ClashResolutionDescriptor>) returnType:.PlatformExtensionsClashResolver.ClashResolutionDescriptor> + correspondingProperty: PROPERTY name:resolver visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.ClashResolutionDescriptor.ClashResolutionDescriptor> + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): .PlatformExtensionsClashResolver.ClashResolutionDescriptor> declared in .ClashResolutionDescriptor' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:resolver type:.PlatformExtensionsClashResolver.ClashResolutionDescriptor> visibility:private [final]' type=.PlatformExtensionsClashResolver.ClashResolutionDescriptor> origin=null + receiver: GET_VAR ': .ClashResolutionDescriptor.ClashResolutionDescriptor> declared in .ClashResolutionDescriptor.' type=.ClashResolutionDescriptor.ClashResolutionDescriptor> origin=null + PROPERTY name:clashedComponents visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:clashedComponents type:kotlin.collections.List<.ComponentDescriptor> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'clashedComponents: kotlin.collections.List<.ComponentDescriptor> declared in .ClashResolutionDescriptor.' type=kotlin.collections.List<.ComponentDescriptor> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.ClashResolutionDescriptor.ClashResolutionDescriptor>) returnType:kotlin.collections.List<.ComponentDescriptor> + correspondingProperty: PROPERTY name:clashedComponents visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.ClashResolutionDescriptor.ClashResolutionDescriptor> + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.collections.List<.ComponentDescriptor> declared in .ClashResolutionDescriptor' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:clashedComponents type:kotlin.collections.List<.ComponentDescriptor> visibility:private [final]' type=kotlin.collections.List<.ComponentDescriptor> origin=null + receiver: GET_VAR ': .ClashResolutionDescriptor.ClashResolutionDescriptor> declared in .ClashResolutionDescriptor.' type=.ClashResolutionDescriptor.ClashResolutionDescriptor> origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:registrationMap visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:registrationMap type:java.util.HashMap visibility:private [final,static] + EXPRESSION_BODY + CALL 'public final fun hashMapOf (): java.util.HashMap [inline] declared in kotlin.collections' type=java.util.HashMap origin=null + : java.lang.reflect.Type + : kotlin.Any + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> () returnType:java.util.HashMap + correspondingProperty: PROPERTY name:registrationMap visibility:private modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): java.util.HashMap declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:registrationMap type:java.util.HashMap visibility:private [final,static]' type=java.util.HashMap origin=null + FUN name:resolveClashesIfAny visibility:public modality:FINAL <> (container:.ComponentContainer, clashResolvers:kotlin.collections.List<.PlatformExtensionsClashResolver<*>>) returnType:kotlin.Unit + VALUE_PARAMETER name:container index:0 type:.ComponentContainer + VALUE_PARAMETER name:clashResolvers index:1 type:kotlin.collections.List<.PlatformExtensionsClashResolver<*>> + BLOCK_BODY + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_0 type:kotlin.collections.Iterator<.PlatformExtensionsClashResolver<*>> [val] + CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator<.PlatformExtensionsClashResolver<*>> origin=FOR_LOOP_ITERATOR + $this: GET_VAR 'clashResolvers: kotlin.collections.List<.PlatformExtensionsClashResolver<*>> declared in .resolveClashesIfAny' type=kotlin.collections.List<.PlatformExtensionsClashResolver<*>> origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_0: kotlin.collections.Iterator<.PlatformExtensionsClashResolver<*>> [val] declared in .resolveClashesIfAny' type=kotlin.collections.Iterator<.PlatformExtensionsClashResolver<*>> origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:resolver type:.PlatformExtensionsClashResolver<*> [val] + CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=.PlatformExtensionsClashResolver<*> origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_0: kotlin.collections.Iterator<.PlatformExtensionsClashResolver<*>> [val] declared in .resolveClashesIfAny' type=kotlin.collections.Iterator<.PlatformExtensionsClashResolver<*>> origin=null + VAR name:clashedComponents type:kotlin.collections.Collection<.ComponentDescriptor> [val] + BLOCK type=kotlin.collections.Collection<.ComponentDescriptor> origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.collections.Collection<.ComponentDescriptor>? [val] + TYPE_OP type=kotlin.collections.Collection<.ComponentDescriptor>? origin=SAFE_CAST typeOperand=kotlin.collections.Collection<.ComponentDescriptor> + CALL 'public open fun get (p0: kotlin.Any?): V of java.util.HashMap? [operator] declared in java.util.HashMap' type=kotlin.Any? origin=null + $this: CALL 'private final fun (): java.util.HashMap declared in ' type=java.util.HashMap origin=GET_PROPERTY + p0: CALL 'public final fun (): java.lang.Class.PlatformExtensionsClashResolver> declared in .PlatformExtensionsClashResolver' type=java.lang.Class<.PlatformSpecificExtension.PlatformExtensionsClashResolver>> origin=GET_PROPERTY + $this: GET_VAR 'val resolver: .PlatformExtensionsClashResolver<*> [val] declared in .resolveClashesIfAny' type=.PlatformExtensionsClashResolver<*> origin=null + WHEN type=kotlin.collections.Collection<.ComponentDescriptor> origin=ELVIS + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp_1: kotlin.collections.Collection<.ComponentDescriptor>? [val] declared in .resolveClashesIfAny' type=kotlin.collections.Collection<.ComponentDescriptor>? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONTINUE label=null loop.label=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: TYPE_OP type=kotlin.collections.Collection<.ComponentDescriptor> origin=IMPLICIT_CAST typeOperand=kotlin.collections.Collection<.ComponentDescriptor> + GET_VAR 'val tmp_1: kotlin.collections.Collection<.ComponentDescriptor>? [val] declared in .resolveClashesIfAny' type=kotlin.collections.Collection<.ComponentDescriptor>? origin=null + VAR name:substituteDescriptor type:.ClashResolutionDescriptor.PlatformSpecificExtension.PlatformExtensionsClashResolver>> [val] + CONSTRUCTOR_CALL 'public constructor (container: .ComponentContainer, resolver: .PlatformExtensionsClashResolver.ClashResolutionDescriptor>, clashedComponents: kotlin.collections.List<.ComponentDescriptor>) [primary] declared in .ClashResolutionDescriptor' type=.ClashResolutionDescriptor.PlatformSpecificExtension.PlatformExtensionsClashResolver>> origin=null + : .PlatformSpecificExtension.PlatformExtensionsClashResolver> + container: GET_VAR 'container: .ComponentContainer declared in .resolveClashesIfAny' type=.ComponentContainer origin=null + resolver: GET_VAR 'val resolver: .PlatformExtensionsClashResolver<*> [val] declared in .resolveClashesIfAny' type=.PlatformExtensionsClashResolver<*> origin=null + clashedComponents: CALL 'public final fun toList (): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List<.ComponentDescriptor> origin=null + : .ComponentDescriptor + $receiver: GET_VAR 'val clashedComponents: kotlin.collections.Collection<.ComponentDescriptor> [val] declared in .resolveClashesIfAny' type=kotlin.collections.Collection<.ComponentDescriptor> origin=null diff --git a/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.kt b/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.kt new file mode 100644 index 00000000000..6f4167a3881 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.kt @@ -0,0 +1,32 @@ +// FULL_JDK +// WITH_RUNTIME + +import java.lang.reflect.Type + +interface ComponentContainer + +interface PlatformSpecificExtension> + +interface ComponentDescriptor + +abstract class PlatformExtensionsClashResolver>( + val applicableTo: Class +) + +class ClashResolutionDescriptor>( + container: ComponentContainer, + private val resolver: PlatformExtensionsClashResolver, + private val clashedComponents: List +) + +private val registrationMap = hashMapOf() + +fun resolveClashesIfAny(container: ComponentContainer, clashResolvers: List>) { + for (resolver in clashResolvers) { + val clashedComponents = registrationMap[resolver.applicableTo] as? Collection ?: continue + + val substituteDescriptor = ClashResolutionDescriptor(container, resolver, clashedComponents.toList()) + } +} + + diff --git a/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.txt b/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.txt new file mode 100644 index 00000000000..523faf606fd --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.txt @@ -0,0 +1,176 @@ +FILE fqName: fileName:/ClashResolutionDescriptor.kt + CLASS INTERFACE name:ComponentContainer modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ComponentContainer + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:PlatformSpecificExtension modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.PlatformSpecificExtension.PlatformSpecificExtension> + TYPE_PARAMETER name:S index:0 variance: superTypes:[.PlatformSpecificExtension.PlatformSpecificExtension>] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:ComponentDescriptor modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ComponentDescriptor + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:PlatformExtensionsClashResolver modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> + TYPE_PARAMETER name:E index:0 variance: superTypes:[.PlatformSpecificExtension.PlatformExtensionsClashResolver>] + CONSTRUCTOR visibility:public <> (applicableTo:java.lang.Class.PlatformExtensionsClashResolver>) returnType:.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> [primary] + VALUE_PARAMETER name:applicableTo index:0 type:java.lang.Class.PlatformExtensionsClashResolver> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:PlatformExtensionsClashResolver modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' + PROPERTY name:applicableTo visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:applicableTo type:java.lang.Class.PlatformExtensionsClashResolver> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'applicableTo: java.lang.Class.PlatformExtensionsClashResolver> declared in .PlatformExtensionsClashResolver.' type=java.lang.Class.PlatformExtensionsClashResolver> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver>) returnType:java.lang.Class.PlatformExtensionsClashResolver> + correspondingProperty: PROPERTY name:applicableTo visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): java.lang.Class.PlatformExtensionsClashResolver> declared in .PlatformExtensionsClashResolver' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:applicableTo type:java.lang.Class.PlatformExtensionsClashResolver> visibility:private [final]' type=java.lang.Class.PlatformExtensionsClashResolver> origin=null + receiver: GET_VAR ': .PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> declared in .PlatformExtensionsClashResolver.' type=.PlatformExtensionsClashResolver.PlatformExtensionsClashResolver> origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:ClashResolutionDescriptor modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ClashResolutionDescriptor.ClashResolutionDescriptor> + TYPE_PARAMETER name:E index:0 variance: superTypes:[.PlatformSpecificExtension.ClashResolutionDescriptor>] + CONSTRUCTOR visibility:public <> (container:.ComponentContainer, resolver:.PlatformExtensionsClashResolver.ClashResolutionDescriptor>, clashedComponents:kotlin.collections.List<.ComponentDescriptor>) returnType:.ClashResolutionDescriptor.ClashResolutionDescriptor> [primary] + VALUE_PARAMETER name:container index:0 type:.ComponentContainer + VALUE_PARAMETER name:resolver index:1 type:.PlatformExtensionsClashResolver.ClashResolutionDescriptor> + VALUE_PARAMETER name:clashedComponents index:2 type:kotlin.collections.List<.ComponentDescriptor> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ClashResolutionDescriptor modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:resolver visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:resolver type:.PlatformExtensionsClashResolver.ClashResolutionDescriptor> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'resolver: .PlatformExtensionsClashResolver.ClashResolutionDescriptor> declared in .ClashResolutionDescriptor.' type=.PlatformExtensionsClashResolver.ClashResolutionDescriptor> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.ClashResolutionDescriptor.ClashResolutionDescriptor>) returnType:.PlatformExtensionsClashResolver.ClashResolutionDescriptor> + correspondingProperty: PROPERTY name:resolver visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.ClashResolutionDescriptor.ClashResolutionDescriptor> + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): .PlatformExtensionsClashResolver.ClashResolutionDescriptor> declared in .ClashResolutionDescriptor' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:resolver type:.PlatformExtensionsClashResolver.ClashResolutionDescriptor> visibility:private [final]' type=.PlatformExtensionsClashResolver.ClashResolutionDescriptor> origin=null + receiver: GET_VAR ': .ClashResolutionDescriptor.ClashResolutionDescriptor> declared in .ClashResolutionDescriptor.' type=.ClashResolutionDescriptor.ClashResolutionDescriptor> origin=null + PROPERTY name:clashedComponents visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:clashedComponents type:kotlin.collections.List<.ComponentDescriptor> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'clashedComponents: kotlin.collections.List<.ComponentDescriptor> declared in .ClashResolutionDescriptor.' type=kotlin.collections.List<.ComponentDescriptor> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.ClashResolutionDescriptor.ClashResolutionDescriptor>) returnType:kotlin.collections.List<.ComponentDescriptor> + correspondingProperty: PROPERTY name:clashedComponents visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.ClashResolutionDescriptor.ClashResolutionDescriptor> + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.collections.List<.ComponentDescriptor> declared in .ClashResolutionDescriptor' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:clashedComponents type:kotlin.collections.List<.ComponentDescriptor> visibility:private [final]' type=kotlin.collections.List<.ComponentDescriptor> origin=null + receiver: GET_VAR ': .ClashResolutionDescriptor.ClashResolutionDescriptor> declared in .ClashResolutionDescriptor.' type=.ClashResolutionDescriptor.ClashResolutionDescriptor> origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY name:registrationMap visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:registrationMap type:java.util.HashMap{ kotlin.collections.HashMap } visibility:private [final,static] + EXPRESSION_BODY + CALL 'public final fun hashMapOf (): java.util.HashMap{ kotlin.collections.HashMap } [inline] declared in kotlin.collections' type=java.util.HashMap{ kotlin.collections.HashMap } origin=null + : java.lang.reflect.Type + : kotlin.Any + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> () returnType:java.util.HashMap{ kotlin.collections.HashMap } + correspondingProperty: PROPERTY name:registrationMap visibility:private modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): java.util.HashMap{ kotlin.collections.HashMap } declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:registrationMap type:java.util.HashMap{ kotlin.collections.HashMap } visibility:private [final,static]' type=java.util.HashMap{ kotlin.collections.HashMap } origin=null + FUN name:resolveClashesIfAny visibility:public modality:FINAL <> (container:.ComponentContainer, clashResolvers:kotlin.collections.List<.PlatformExtensionsClashResolver<*>>) returnType:kotlin.Unit + VALUE_PARAMETER name:container index:0 type:.ComponentContainer + VALUE_PARAMETER name:clashResolvers index:1 type:kotlin.collections.List<.PlatformExtensionsClashResolver<*>> + BLOCK_BODY + BLOCK type=kotlin.Unit origin=FOR_LOOP + VAR FOR_LOOP_ITERATOR name:tmp_0 type:kotlin.collections.Iterator<.PlatformExtensionsClashResolver<*>> [val] + CALL 'public abstract fun iterator (): kotlin.collections.Iterator [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator<.PlatformExtensionsClashResolver<*>> origin=FOR_LOOP_ITERATOR + $this: GET_VAR 'clashResolvers: kotlin.collections.List<.PlatformExtensionsClashResolver<*>> declared in .resolveClashesIfAny' type=kotlin.collections.List<.PlatformExtensionsClashResolver<*>> origin=null + WHILE label=null origin=FOR_LOOP_INNER_WHILE + condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT + $this: GET_VAR 'val tmp_0: kotlin.collections.Iterator<.PlatformExtensionsClashResolver<*>> [val] declared in .resolveClashesIfAny' type=kotlin.collections.Iterator<.PlatformExtensionsClashResolver<*>> origin=null + body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE + VAR FOR_LOOP_VARIABLE name:resolver type:.PlatformExtensionsClashResolver<*> [val] + CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=.PlatformExtensionsClashResolver<*> origin=FOR_LOOP_NEXT + $this: GET_VAR 'val tmp_0: kotlin.collections.Iterator<.PlatformExtensionsClashResolver<*>> [val] declared in .resolveClashesIfAny' type=kotlin.collections.Iterator<.PlatformExtensionsClashResolver<*>> origin=null + BLOCK type=kotlin.Unit origin=null + VAR name:clashedComponents type:kotlin.collections.Collection<.ComponentDescriptor> [val] + BLOCK type=kotlin.collections.Collection<.ComponentDescriptor> origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.collections.Collection<.ComponentDescriptor>? [val] + TYPE_OP type=kotlin.collections.Collection<.ComponentDescriptor>? origin=SAFE_CAST typeOperand=kotlin.collections.Collection<.ComponentDescriptor> + CALL 'public open fun get (key: @[EnhancedNullability] K of java.util.HashMap): @[EnhancedNullability] V of java.util.HashMap? [operator] declared in java.util.HashMap' type=@[EnhancedNullability] kotlin.Any? origin=GET_ARRAY_ELEMENT + $this: CALL 'private final fun (): java.util.HashMap{ kotlin.collections.HashMap } declared in ' type=java.util.HashMap{ kotlin.collections.HashMap } origin=GET_PROPERTY + key: CALL 'public final fun (): java.lang.Class.PlatformExtensionsClashResolver> declared in .PlatformExtensionsClashResolver' type=java.lang.Class.PlatformSpecificExtension<*>> origin=GET_PROPERTY + $this: GET_VAR 'val resolver: .PlatformExtensionsClashResolver<*> [val] declared in .resolveClashesIfAny' type=.PlatformExtensionsClashResolver<*> origin=null + WHEN type=kotlin.collections.Collection<.ComponentDescriptor> origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp_1: kotlin.collections.Collection<.ComponentDescriptor>? [val] declared in .resolveClashesIfAny' type=kotlin.collections.Collection<.ComponentDescriptor>? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONTINUE label=null loop.label=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val tmp_1: kotlin.collections.Collection<.ComponentDescriptor>? [val] declared in .resolveClashesIfAny' type=kotlin.collections.Collection<.ComponentDescriptor>? origin=null + VAR name:substituteDescriptor type:.ClashResolutionDescriptor.PlatformSpecificExtension.PlatformSpecificExtension.PlatformSpecificExtension.PlatformSpecificExtension.PlatformSpecificExtension>>>>> [val] + CONSTRUCTOR_CALL 'public constructor (container: .ComponentContainer, resolver: .PlatformExtensionsClashResolver.ClashResolutionDescriptor>, clashedComponents: kotlin.collections.List<.ComponentDescriptor>) [primary] declared in .ClashResolutionDescriptor' type=.ClashResolutionDescriptor.PlatformSpecificExtension.PlatformSpecificExtension.PlatformSpecificExtension.PlatformSpecificExtension.PlatformSpecificExtension>>>>> origin=null + : .PlatformSpecificExtension.PlatformSpecificExtension.PlatformSpecificExtension.PlatformSpecificExtension.PlatformSpecificExtension>>>> + container: GET_VAR 'container: .ComponentContainer declared in .resolveClashesIfAny' type=.ComponentContainer origin=null + resolver: GET_VAR 'val resolver: .PlatformExtensionsClashResolver<*> [val] declared in .resolveClashesIfAny' type=.PlatformExtensionsClashResolver<*> origin=null + clashedComponents: CALL 'public final fun toList (): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List<.ComponentDescriptor> origin=null + : .ComponentDescriptor + $receiver: GET_VAR 'val clashedComponents: kotlin.collections.Collection<.ComponentDescriptor> [val] declared in .resolveClashesIfAny' type=kotlin.collections.Collection<.ComponentDescriptor> origin=null diff --git a/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java b/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java index 5bdde0fd673..396dfd0c29c 100644 --- a/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java @@ -1721,6 +1721,11 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase { runTest("compiler/testData/ir/irText/firProblems/candidateSymbol.kt"); } + @TestMetadata("ClashResolutionDescriptor.kt") + public void testClashResolutionDescriptor() throws Exception { + runTest("compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.kt"); + } + @TestMetadata("DeepCopyIrTree.kt") public void testDeepCopyIrTree() throws Exception { runTest("compiler/testData/ir/irText/firProblems/DeepCopyIrTree.kt");