From 83d0e1f44709900ddad4a206cf2dda00667aed82 Mon Sep 17 00:00:00 2001 From: "Aleksandra.Arsenteva" Date: Wed, 13 Mar 2024 11:58:39 +0100 Subject: [PATCH] [Test] KT-66152 Add tests for generic static function --- .../FirLightTreeJvmIrTextTestGenerated.java | 18 + .../ir/FirPsiJvmIrTextTestGenerated.java | 18 + ...onWithGenericOnComplexHierarchy.fir.ir.txt | 498 ++++++++++++++++++ ...onWithGenericOnComplexHierarchy.fir.kt.txt | 183 +++++++ ...ectionWithGenericOnComplexHierarchy.ir.txt | 498 ++++++++++++++++++ ...tersectionWithGenericOnComplexHierarchy.kt | 106 ++++ ...ectionWithGenericOnComplexHierarchy.kt.txt | 183 +++++++ ...onWithGenericOnComplexHierarchy.sig.kt.txt | 281 ++++++++++ .../intersectionWithGenericOverride.ir.txt | 238 +++++++++ .../intersectionWithGenericOverride.kt | 61 +++ .../intersectionWithGenericOverride.kt.txt | 86 +++ ...intersectionWithGenericOverride.sig.kt.txt | 143 +++++ .../substitutionStaticOverride.ir.txt | 214 ++++++++ .../javastatic/substitutionStaticOverride.kt | 52 ++ .../substitutionStaticOverride.kt.txt | 73 +++ .../substitutionStaticOverride.sig.kt.txt | 113 ++++ .../ir/ClassicJvmIrTextTestGenerated.java | 18 + 17 files changed, 2783 insertions(+) create mode 100644 compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.fir.ir.txt create mode 100644 compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.fir.kt.txt create mode 100644 compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.ir.txt create mode 100644 compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.kt create mode 100644 compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.kt.txt create mode 100644 compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.sig.kt.txt create mode 100644 compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOverride.ir.txt create mode 100644 compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOverride.kt create mode 100644 compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOverride.kt.txt create mode 100644 compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOverride.sig.kt.txt create mode 100644 compiler/testData/ir/irText/fakeOverrides/javastatic/substitutionStaticOverride.ir.txt create mode 100644 compiler/testData/ir/irText/fakeOverrides/javastatic/substitutionStaticOverride.kt create mode 100644 compiler/testData/ir/irText/fakeOverrides/javastatic/substitutionStaticOverride.kt.txt create mode 100644 compiler/testData/ir/irText/fakeOverrides/javastatic/substitutionStaticOverride.sig.kt.txt diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java index c41921b280d..fcde85f9bc7 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java @@ -3361,6 +3361,18 @@ public class FirLightTreeJvmIrTextTestGenerated extends AbstractFirLightTreeJvmI runTest("compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionOverrideOnStaticKJK.kt"); } + @Test + @TestMetadata("intersectionWithGenericOnComplexHierarchy.kt") + public void testIntersectionWithGenericOnComplexHierarchy() { + runTest("compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.kt"); + } + + @Test + @TestMetadata("intersectionWithGenericOverride.kt") + public void testIntersectionWithGenericOverride() { + runTest("compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOverride.kt"); + } + @Test @TestMetadata("staticOverrideOnComplexHierarchy.kt") public void testStaticOverrideOnComplexHierarchy() { @@ -3390,6 +3402,12 @@ public class FirLightTreeJvmIrTextTestGenerated extends AbstractFirLightTreeJvmI public void testStaticOverrideOnKJKJ() { runTest("compiler/testData/ir/irText/fakeOverrides/javastatic/staticOverrideOnKJKJ.kt"); } + + @Test + @TestMetadata("substitutionStaticOverride.kt") + public void testSubstitutionStaticOverride() { + runTest("compiler/testData/ir/irText/fakeOverrides/javastatic/substitutionStaticOverride.kt"); + } } @Nested diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java index ee6c566561c..0cde42e4e38 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java @@ -3361,6 +3361,18 @@ public class FirPsiJvmIrTextTestGenerated extends AbstractFirPsiJvmIrTextTest { runTest("compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionOverrideOnStaticKJK.kt"); } + @Test + @TestMetadata("intersectionWithGenericOnComplexHierarchy.kt") + public void testIntersectionWithGenericOnComplexHierarchy() { + runTest("compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.kt"); + } + + @Test + @TestMetadata("intersectionWithGenericOverride.kt") + public void testIntersectionWithGenericOverride() { + runTest("compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOverride.kt"); + } + @Test @TestMetadata("staticOverrideOnComplexHierarchy.kt") public void testStaticOverrideOnComplexHierarchy() { @@ -3390,6 +3402,12 @@ public class FirPsiJvmIrTextTestGenerated extends AbstractFirPsiJvmIrTextTest { public void testStaticOverrideOnKJKJ() { runTest("compiler/testData/ir/irText/fakeOverrides/javastatic/staticOverrideOnKJKJ.kt"); } + + @Test + @TestMetadata("substitutionStaticOverride.kt") + public void testSubstitutionStaticOverride() { + runTest("compiler/testData/ir/irText/fakeOverrides/javastatic/substitutionStaticOverride.kt"); + } } @Nested diff --git a/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.fir.ir.txt b/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.fir.ir.txt new file mode 100644 index 00000000000..a90590f8188 --- /dev/null +++ b/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.fir.ir.txt @@ -0,0 +1,498 @@ +FILE fqName: fileName:/1.kt + CLASS CLASS name:A modality:FINAL visibility:public superTypes:[.Java1; .Java2; .KotlinInterface] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Java1' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[.Java1; .Java2; .KotlinInterface]' + FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN ($this:.KotlinInterface) returnType:T of .A.bar [fake_override] + overridden: + public open fun bar (): T of .KotlinInterface.bar declared in .KotlinInterface + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.KotlinInterface + FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN () returnType:@[FlexibleNullability] T of .A.bar? [fake_override] + overridden: + public open fun bar (): @[FlexibleNullability] T of .Java1.bar? declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + 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 declared in .Java1 + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Java2 + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .KotlinInterface + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.KotlinInterface, t:kotlin.Number) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: kotlin.Number): kotlin.Unit declared in .KotlinInterface + $this: VALUE_PARAMETER name: type:.KotlinInterface + VALUE_PARAMETER name:t index:0 type:kotlin.Number + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.KotlinInterface, t:kotlin.Number, t2:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: kotlin.Number, t2: kotlin.Int): kotlin.Unit declared in .KotlinInterface + $this: VALUE_PARAMETER name: type:.KotlinInterface + VALUE_PARAMETER name:t index:0 type:kotlin.Number + VALUE_PARAMETER name:t2 index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN ($this:.KotlinInterface, t:T of .A.foo) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: T of .KotlinInterface.foo): kotlin.Unit declared in .KotlinInterface + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.KotlinInterface + VALUE_PARAMETER name:t index:0 type:T of .A.foo + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .A.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .A.foo? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .A.foo?, t2:@[FlexibleNullability] T of .A.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?, t2: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .A.foo? + VALUE_PARAMETER name:t2 index:1 type:@[FlexibleNullability] T of .A.foo? + 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 .Java1 + public open fun hashCode (): kotlin.Int declared in .Java2 + public open fun hashCode (): kotlin.Int declared in .KotlinInterface + $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 .Java1 + public open fun toString (): kotlin.String declared in .Java2 + public open fun toString (): kotlin.String declared in .KotlinInterface + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.Unit declared in .A' + CALL 'public open fun foo (t: kotlin.Number): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR ': .A declared in .A.test1' type=.A origin=null + t: CONST Int type=kotlin.Int value=1 + FUN name:test2 visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (): kotlin.Int declared in .A' + CALL 'public open fun bar (): T of .A.bar declared in .A' type=kotlin.Int origin=null + : kotlin.Int + $this: GET_VAR ': .A declared in .A.test2' type=.A origin=null + FUN name:test3 visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (): kotlin.Unit declared in .A' + CALL 'public open fun foo (t: T of .A.foo): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + : kotlin.String + $this: GET_VAR ': .A declared in .A.test3' type=.A origin=null + t: CONST String type=kotlin.String value="" + FUN name:test4 visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (): kotlin.Unit declared in .A' + CALL 'public open fun foo (t: kotlin.Number): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR ': .A declared in .A.test4' type=.A origin=null + t: CONST Double type=kotlin.Double value=1.5 + FUN name:test5 visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5 (): kotlin.Unit declared in .A' + CALL 'public open fun foo (t: kotlin.Number, t2: kotlin.Int): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR ': .A declared in .A.test5' type=.A origin=null + t: CONST Double type=kotlin.Double value=1.5 + t2: CONST Int type=kotlin.Int value=8 + CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.Java1; .Java2; .Java3] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + CONSTRUCTOR visibility:public <> () returnType:.B [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Java1' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.Java1; .Java2; .Java3]' + FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN <> ($this:.Java3) returnType:@[FlexibleNullability] kotlin.Number? [fake_override] + overridden: + public open fun bar (): @[FlexibleNullability] kotlin.Number? declared in .Java3 + $this: VALUE_PARAMETER name: type:.Java3 + FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN () returnType:@[FlexibleNullability] T of .B.bar? [fake_override] + overridden: + public open fun bar (): @[FlexibleNullability] T of .Java1.bar? declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + 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 declared in .Java1 + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Java2 + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Java3 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.Java3, t:@[FlexibleNullability] kotlin.Number?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] kotlin.Number?): kotlin.Unit declared in .Java3 + $this: VALUE_PARAMETER name: type:.Java3 + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] kotlin.Number? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.Java3, t:@[FlexibleNullability] kotlin.Number?, t2:@[FlexibleNullability] kotlin.Number?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] kotlin.Number?, t2: @[FlexibleNullability] kotlin.Number?): kotlin.Unit declared in .Java3 + $this: VALUE_PARAMETER name: type:.Java3 + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] kotlin.Number? + VALUE_PARAMETER name:t2 index:1 type:@[FlexibleNullability] kotlin.Number? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .B.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .B.foo? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .B.foo?, t2:@[FlexibleNullability] T of .B.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?, t2: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .B.foo? + VALUE_PARAMETER name:t2 index:1 type:@[FlexibleNullability] T of .B.foo? + 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 .Java1 + public open fun hashCode (): kotlin.Int declared in .Java2 + public open fun hashCode (): kotlin.Int declared in .Java3 + $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 .Java1 + public open fun toString (): kotlin.String declared in .Java2 + public open fun toString (): kotlin.String declared in .Java3 + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.Unit declared in .B' + CALL 'public open fun foo (t: @[FlexibleNullability] kotlin.Number?): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR ': .B declared in .B.test1' type=.B origin=null + t: CONST Int type=kotlin.Int value=1 + FUN name:test2 visibility:public modality:FINAL <> ($this:.B) returnType:@[FlexibleNullability] kotlin.Int? + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (): @[FlexibleNullability] kotlin.Int? declared in .B' + CALL 'public open fun bar (): @[FlexibleNullability] T of .Java1.bar? declared in .Java1' type=@[FlexibleNullability] kotlin.Int? origin=null + : @[FlexibleNullability] kotlin.Int? + FUN name:test3 visibility:public modality:FINAL <> ($this:.B) returnType:@[FlexibleNullability] kotlin.Number? + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (): @[FlexibleNullability] kotlin.Number? declared in .B' + CALL 'public open fun bar (): @[FlexibleNullability] kotlin.Number? declared in .B' type=@[FlexibleNullability] kotlin.Number? origin=null + $this: GET_VAR ': .B declared in .B.test3' type=.B origin=null + FUN name:test4 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (): kotlin.Unit declared in .B' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.String? + t: CONST String type=kotlin.String value="" + FUN name:test5 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5 (): kotlin.Unit declared in .B' + CALL 'public open fun foo (t: @[FlexibleNullability] kotlin.Number?): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR ': .B declared in .B.test5' type=.B origin=null + t: CONST Double type=kotlin.Double value=1.5 + FUN name:test6 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test6 (): kotlin.Unit declared in .B' + CALL 'public open fun foo (t: @[FlexibleNullability] kotlin.Number?, t2: @[FlexibleNullability] kotlin.Number?): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR ': .B declared in .B.test6' type=.B origin=null + t: CONST Double type=kotlin.Double value=1.5 + t2: CONST Int type=kotlin.Int value=8 + FUN name:test7 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test7 (): kotlin.Unit declared in .B' + CALL 'public open fun foo (t: @[FlexibleNullability] kotlin.Number?, t2: @[FlexibleNullability] kotlin.Number?): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR ': .B declared in .B.test7' type=.B origin=null + t: CONST Int type=kotlin.Int value=1 + t2: CONST Int type=kotlin.Int value=8 + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.KotlinClass; .Java2] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .KotlinClass' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.KotlinClass; .Java2]' + FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN () returnType:@[FlexibleNullability] T of .C.bar? [fake_override] + overridden: + public open fun bar (): @[FlexibleNullability] T of .KotlinClass.bar? declared in .KotlinClass + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + 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 declared in .KotlinClass + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Java2 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .C.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .KotlinClass.foo?): kotlin.Unit declared in .KotlinClass + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .C.foo? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .C.foo?, t2:@[FlexibleNullability] T of .C.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .KotlinClass.foo?, t2: @[FlexibleNullability] T of .KotlinClass.foo?): kotlin.Unit declared in .KotlinClass + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .C.foo? + VALUE_PARAMETER name:t2 index:1 type:@[FlexibleNullability] T of .C.foo? + 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 .KotlinClass + public open fun hashCode (): kotlin.Int declared in .Java2 + $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 .KotlinClass + public open fun toString (): kotlin.String declared in .Java2 + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.Unit declared in .C' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.Int? + t: CONST Int type=kotlin.Int value=1 + FUN name:test2 visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (): kotlin.Int declared in .C' + TYPE_OP type=kotlin.Int origin=IMPLICIT_NOTNULL typeOperand=kotlin.Int + CALL 'public open fun bar (): @[FlexibleNullability] T of .Java1.bar? declared in .Java1' type=@[FlexibleNullability] kotlin.Int? origin=null + : @[FlexibleNullability] kotlin.Int? + FUN name:test3 visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (): kotlin.Unit declared in .C' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.String? + t: CONST String type=kotlin.String value="" + FUN name:test4 visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (): kotlin.Unit declared in .C' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.Double? + t: CONST Double type=kotlin.Double value=1.5 + FUN name:test5 visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5 (): kotlin.Unit declared in .C' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?, t2: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1' type=kotlin.Unit origin=null + : kotlin.Any? + t: CONST Double type=kotlin.Double value=1.5 + t2: CONST Int type=kotlin.Int value=8 + FUN name:test6 visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test6 (): kotlin.Unit declared in .C' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?, t2: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.Int? + t: CONST Int type=kotlin.Int value=1 + t2: CONST Int type=kotlin.Int value=8 + CLASS CLASS name:D modality:FINAL visibility:public superTypes:[.Java4; .Java2] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.D + CONSTRUCTOR visibility:public <> () returnType:.D [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Java4' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:D modality:FINAL visibility:public superTypes:[.Java4; .Java2]' + FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN () returnType:@[FlexibleNullability] T of .D.bar? [fake_override] + overridden: + public open fun bar (): @[FlexibleNullability] T of .Java4.bar? declared in .Java4 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + 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 declared in .Java4 + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Java2 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .D.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .Java4.foo?): kotlin.Unit declared in .Java4 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .D.foo? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .D.foo?, t2:@[FlexibleNullability] T of .D.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .Java4.foo?, t2: @[FlexibleNullability] T of .Java4.foo?): kotlin.Unit declared in .Java4 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .D.foo? + VALUE_PARAMETER name:t2 index:1 type:@[FlexibleNullability] T of .D.foo? + 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 .Java4 + public open fun hashCode (): kotlin.Int declared in .Java2 + $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 .Java4 + public open fun toString (): kotlin.String declared in .Java2 + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL <> ($this:.D) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.D + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.Unit declared in .D' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java4.foo?): kotlin.Unit declared in .Java4' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.Int? + t: CONST Int type=kotlin.Int value=1 + FUN name:test2 visibility:public modality:FINAL <> ($this:.D) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.D + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (): kotlin.Int declared in .D' + TYPE_OP type=kotlin.Int origin=IMPLICIT_NOTNULL typeOperand=kotlin.Int + CALL 'public open fun bar (): @[FlexibleNullability] T of .Java4.bar? declared in .Java4' type=@[FlexibleNullability] kotlin.Int? origin=null + : @[FlexibleNullability] kotlin.Int? + FUN name:test3 visibility:public modality:FINAL <> ($this:.D) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.D + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (): kotlin.Unit declared in .D' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java4.foo?): kotlin.Unit declared in .Java4' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.String? + t: CONST String type=kotlin.String value="" + FUN name:test4 visibility:public modality:FINAL <> ($this:.D) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.D + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (): kotlin.Unit declared in .D' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java4.foo?): kotlin.Unit declared in .Java4' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.Double? + t: CONST Double type=kotlin.Double value=1.5 + FUN name:test5 visibility:public modality:FINAL <> ($this:.D) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.D + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5 (): kotlin.Unit declared in .D' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java4.foo?, t2: @[FlexibleNullability] T of .Java4.foo?): kotlin.Unit declared in .Java4' type=kotlin.Unit origin=null + : kotlin.Any? + t: CONST Double type=kotlin.Double value=1.5 + t2: CONST Int type=kotlin.Int value=8 + FUN name:test6 visibility:public modality:FINAL <> ($this:.D) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.D + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test6 (): kotlin.Unit declared in .D' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java4.foo?, t2: @[FlexibleNullability] T of .Java4.foo?): kotlin.Unit declared in .Java4' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.Int? + t: CONST Int type=kotlin.Int value=1 + t2: CONST Int type=kotlin.Int value=8 + CLASS CLASS name:KotlinClass modality:OPEN visibility:public superTypes:[.Java1] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KotlinClass + CONSTRUCTOR visibility:public <> () returnType:.KotlinClass [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Java1' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KotlinClass modality:OPEN visibility:public superTypes:[.Java1]' + FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN () returnType:@[FlexibleNullability] T of .KotlinClass.bar? [fake_override] + overridden: + public open fun bar (): @[FlexibleNullability] T of .Java1.bar? declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + 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 declared in .Java1 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .KotlinClass.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .KotlinClass.foo? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .KotlinClass.foo?, t2:@[FlexibleNullability] T of .KotlinClass.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?, t2: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .KotlinClass.foo? + VALUE_PARAMETER name:t2 index:1 type:@[FlexibleNullability] T of .KotlinClass.foo? + 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 .Java1 + $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 .Java1 + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:KotlinInterface modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KotlinInterface + 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 declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + 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 + FUN name:bar visibility:public modality:OPEN ($this:.KotlinInterface) returnType:T of .KotlinInterface.bar + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.KotlinInterface + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun bar (): T of .KotlinInterface.bar declared in .KotlinInterface' + CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=kotlin.Nothing origin=EXCLEXCL + : kotlin.Nothing + arg0: CONST Null type=kotlin.Nothing? value=null + FUN name:foo visibility:public modality:OPEN <> ($this:.KotlinInterface, t:kotlin.Number) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.KotlinInterface + VALUE_PARAMETER name:t index:0 type:kotlin.Number + BLOCK_BODY + FUN name:foo visibility:public modality:OPEN <> ($this:.KotlinInterface, t:kotlin.Number, t2:kotlin.Int) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.KotlinInterface + VALUE_PARAMETER name:t index:0 type:kotlin.Number + VALUE_PARAMETER name:t2 index:1 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=7 + BLOCK_BODY + FUN name:foo visibility:public modality:OPEN ($this:.KotlinInterface, t:T of .KotlinInterface.foo) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.KotlinInterface + VALUE_PARAMETER name:t index:0 type:T of .KotlinInterface.foo + BLOCK_BODY + FUN name:test visibility:public modality:FINAL <> (a:.A, b:.B, c:.C, d:.D) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:.A + VALUE_PARAMETER name:b index:1 type:.B + VALUE_PARAMETER name:c index:2 type:.C + VALUE_PARAMETER name:d index:3 type:.D + BLOCK_BODY + CALL 'public final fun test1 (): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR 'a: .A declared in .test' type=.A origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun test2 (): kotlin.Int declared in .A' type=kotlin.Int origin=null + $this: GET_VAR 'a: .A declared in .test' type=.A origin=null + CALL 'public final fun test3 (): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR 'a: .A declared in .test' type=.A origin=null + CALL 'public final fun test4 (): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR 'a: .A declared in .test' type=.A origin=null + CALL 'public final fun test5 (): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR 'a: .A declared in .test' type=.A origin=null + CALL 'public final fun test1 (): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .B declared in .test' type=.B origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun test2 (): @[FlexibleNullability] kotlin.Int? declared in .B' type=@[FlexibleNullability] kotlin.Int? origin=null + $this: GET_VAR 'b: .B declared in .test' type=.B origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun test3 (): @[FlexibleNullability] kotlin.Number? declared in .B' type=@[FlexibleNullability] kotlin.Number? origin=null + $this: GET_VAR 'b: .B declared in .test' type=.B origin=null + CALL 'public final fun test4 (): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .B declared in .test' type=.B origin=null + CALL 'public final fun test5 (): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .B declared in .test' type=.B origin=null + CALL 'public final fun test6 (): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .B declared in .test' type=.B origin=null + CALL 'public final fun test7 (): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .B declared in .test' type=.B origin=null + CALL 'public final fun test1 (): kotlin.Unit declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'c: .C declared in .test' type=.C origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun test2 (): kotlin.Int declared in .C' type=kotlin.Int origin=null + $this: GET_VAR 'c: .C declared in .test' type=.C origin=null + CALL 'public final fun test3 (): kotlin.Unit declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'c: .C declared in .test' type=.C origin=null + CALL 'public final fun test4 (): kotlin.Unit declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'c: .C declared in .test' type=.C origin=null + CALL 'public final fun test5 (): kotlin.Unit declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'c: .C declared in .test' type=.C origin=null + CALL 'public final fun test6 (): kotlin.Unit declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'c: .C declared in .test' type=.C origin=null + CALL 'public final fun test1 (): kotlin.Unit declared in .D' type=kotlin.Unit origin=null + $this: GET_VAR 'd: .D declared in .test' type=.D origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun test2 (): kotlin.Int declared in .D' type=kotlin.Int origin=null + $this: GET_VAR 'd: .D declared in .test' type=.D origin=null + CALL 'public final fun test3 (): kotlin.Unit declared in .D' type=kotlin.Unit origin=null + $this: GET_VAR 'd: .D declared in .test' type=.D origin=null + CALL 'public final fun test4 (): kotlin.Unit declared in .D' type=kotlin.Unit origin=null + $this: GET_VAR 'd: .D declared in .test' type=.D origin=null + CALL 'public final fun test5 (): kotlin.Unit declared in .D' type=kotlin.Unit origin=null + $this: GET_VAR 'd: .D declared in .test' type=.D origin=null + CALL 'public final fun test6 (): kotlin.Unit declared in .D' type=kotlin.Unit origin=null + $this: GET_VAR 'd: .D declared in .test' type=.D origin=null diff --git a/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.fir.kt.txt b/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.fir.kt.txt new file mode 100644 index 00000000000..9e7f2664972 --- /dev/null +++ b/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.fir.kt.txt @@ -0,0 +1,183 @@ +class A : Java1, Java2, KotlinInterface { + constructor() /* primary */ { + super/*Java1*/() + /* () */ + + } + + fun test1() { + return .foo(t = 1) + } + + fun test2(): Int { + return .bar() + } + + fun test3() { + return .foo(t = "") + } + + fun test4() { + return .foo(t = 1.5) + } + + fun test5() { + return .foo(t = 1.5, t2 = 8) + } + +} + +class B : Java1, Java2, Java3 { + constructor() /* primary */ { + super/*Java1*/() + /* () */ + + } + + fun test1() { + return .foo(t = 1) + } + + fun test2(): @FlexibleNullability Int? { + return bar<@FlexibleNullability Int?>() + } + + fun test3(): @FlexibleNullability Number? { + return .bar() + } + + fun test4() { + return foo<@FlexibleNullability String?>(t = "") + } + + fun test5() { + return .foo(t = 1.5) + } + + fun test6() { + return .foo(t = 1.5, t2 = 8) + } + + fun test7() { + return .foo(t = 1, t2 = 8) + } + +} + +class C : KotlinClass, Java2 { + constructor() /* primary */ { + super/*KotlinClass*/() + /* () */ + + } + + fun test1() { + return foo<@FlexibleNullability Int?>(t = 1) + } + + fun test2(): Int { + return bar<@FlexibleNullability Int?>() /*!! Int */ + } + + fun test3() { + return foo<@FlexibleNullability String?>(t = "") + } + + fun test4() { + return foo<@FlexibleNullability Double?>(t = 1.5) + } + + fun test5() { + return foo(t = 1.5, t2 = 8) + } + + fun test6() { + return foo<@FlexibleNullability Int?>(t = 1, t2 = 8) + } + +} + +class D : Java4, Java2 { + constructor() /* primary */ { + super/*Java4*/() + /* () */ + + } + + fun test1() { + return foo<@FlexibleNullability Int?>(t = 1) + } + + fun test2(): Int { + return bar<@FlexibleNullability Int?>() /*!! Int */ + } + + fun test3() { + return foo<@FlexibleNullability String?>(t = "") + } + + fun test4() { + return foo<@FlexibleNullability Double?>(t = 1.5) + } + + fun test5() { + return foo(t = 1.5, t2 = 8) + } + + fun test6() { + return foo<@FlexibleNullability Int?>(t = 1, t2 = 8) + } + +} + +open class KotlinClass : Java1 { + constructor() /* primary */ { + super/*Java1*/() + /* () */ + + } + +} + +interface KotlinInterface { + fun bar(): T { + return CHECK_NOT_NULL(arg0 = null) + } + + fun foo(t: Number) { + } + + fun foo(t: Number, t2: Int = 7) { + } + + fun foo(t: T) { + } + +} + +fun test(a: A, b: B, c: C, d: D) { + a.test1() + a.test2() /*~> Unit */ + a.test3() + a.test4() + a.test5() + b.test1() + b.test2() /*~> Unit */ + b.test3() /*~> Unit */ + b.test4() + b.test5() + b.test6() + b.test7() + c.test1() + c.test2() /*~> Unit */ + c.test3() + c.test4() + c.test5() + c.test6() + d.test1() + d.test2() /*~> Unit */ + d.test3() + d.test4() + d.test5() + d.test6() +} diff --git a/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.ir.txt b/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.ir.txt new file mode 100644 index 00000000000..fe3c72cc9e7 --- /dev/null +++ b/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.ir.txt @@ -0,0 +1,498 @@ +FILE fqName: fileName:/1.kt + CLASS CLASS name:A modality:FINAL visibility:public superTypes:[.Java1; .Java2; .KotlinInterface] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Java1' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[.Java1; .Java2; .KotlinInterface]' + FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN ($this:.KotlinInterface) returnType:T of .A.bar [fake_override] + overridden: + public open fun bar (): T of .KotlinInterface.bar declared in .KotlinInterface + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.KotlinInterface + FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN () returnType:@[FlexibleNullability] T of .A.bar? [fake_override] + overridden: + public open fun bar (): @[FlexibleNullability] T of .Java1.bar? declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + 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 declared in .Java1 + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Java2 + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .KotlinInterface + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.KotlinInterface, t:kotlin.Number) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: kotlin.Number): kotlin.Unit declared in .KotlinInterface + $this: VALUE_PARAMETER name: type:.KotlinInterface + VALUE_PARAMETER name:t index:0 type:kotlin.Number + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.KotlinInterface, t:kotlin.Number, t2:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: kotlin.Number, t2: kotlin.Int): kotlin.Unit declared in .KotlinInterface + $this: VALUE_PARAMETER name: type:.KotlinInterface + VALUE_PARAMETER name:t index:0 type:kotlin.Number + VALUE_PARAMETER name:t2 index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN ($this:.KotlinInterface, t:T of .A.foo) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: T of .KotlinInterface.foo): kotlin.Unit declared in .KotlinInterface + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.KotlinInterface + VALUE_PARAMETER name:t index:0 type:T of .A.foo + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .A.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .A.foo? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .A.foo?, t2:@[FlexibleNullability] T of .A.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?, t2: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .A.foo? + VALUE_PARAMETER name:t2 index:1 type:@[FlexibleNullability] T of .A.foo? + 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 .Java1 + public open fun hashCode (): kotlin.Int declared in .Java2 + public open fun hashCode (): kotlin.Int declared in .KotlinInterface + $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 .Java1 + public open fun toString (): kotlin.String declared in .Java2 + public open fun toString (): kotlin.String declared in .KotlinInterface + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.Unit declared in .A' + CALL 'public open fun foo (t: kotlin.Number): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR ': .A declared in .A.test1' type=.A origin=null + t: CONST Int type=kotlin.Int value=1 + FUN name:test2 visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (): kotlin.Int declared in .A' + CALL 'public open fun bar (): T of .A.bar declared in .A' type=kotlin.Int origin=null + : kotlin.Int + $this: GET_VAR ': .A declared in .A.test2' type=.A origin=null + FUN name:test3 visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (): kotlin.Unit declared in .A' + CALL 'public open fun foo (t: T of .A.foo): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + : kotlin.String + $this: GET_VAR ': .A declared in .A.test3' type=.A origin=null + t: CONST String type=kotlin.String value="" + FUN name:test4 visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (): kotlin.Unit declared in .A' + CALL 'public open fun foo (t: kotlin.Number): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR ': .A declared in .A.test4' type=.A origin=null + t: CONST Double type=kotlin.Double value=1.5 + FUN name:test5 visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5 (): kotlin.Unit declared in .A' + CALL 'public open fun foo (t: kotlin.Number, t2: kotlin.Int): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR ': .A declared in .A.test5' type=.A origin=null + t: CONST Double type=kotlin.Double value=1.5 + t2: CONST Int type=kotlin.Int value=8 + CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.Java1; .Java2; .Java3] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + CONSTRUCTOR visibility:public <> () returnType:.B [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Java1' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.Java1; .Java2; .Java3]' + FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN <> ($this:.Java3) returnType:@[FlexibleNullability] kotlin.Number? [fake_override] + overridden: + public open fun bar (): @[FlexibleNullability] kotlin.Number? declared in .Java3 + $this: VALUE_PARAMETER name: type:.Java3 + FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN () returnType:@[FlexibleNullability] T of .B.bar? [fake_override] + overridden: + public open fun bar (): @[FlexibleNullability] T of .Java1.bar? declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + 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 declared in .Java1 + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Java2 + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Java3 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.Java3, t:@[FlexibleNullability] kotlin.Number?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] kotlin.Number?): kotlin.Unit declared in .Java3 + $this: VALUE_PARAMETER name: type:.Java3 + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] kotlin.Number? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.Java3, t:@[FlexibleNullability] kotlin.Number?, t2:@[FlexibleNullability] kotlin.Number?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] kotlin.Number?, t2: @[FlexibleNullability] kotlin.Number?): kotlin.Unit declared in .Java3 + $this: VALUE_PARAMETER name: type:.Java3 + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] kotlin.Number? + VALUE_PARAMETER name:t2 index:1 type:@[FlexibleNullability] kotlin.Number? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .B.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .B.foo? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .B.foo?, t2:@[FlexibleNullability] T of .B.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?, t2: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .B.foo? + VALUE_PARAMETER name:t2 index:1 type:@[FlexibleNullability] T of .B.foo? + 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 .Java1 + public open fun hashCode (): kotlin.Int declared in .Java2 + public open fun hashCode (): kotlin.Int declared in .Java3 + $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 .Java1 + public open fun toString (): kotlin.String declared in .Java2 + public open fun toString (): kotlin.String declared in .Java3 + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.Unit declared in .B' + CALL 'public open fun foo (t: @[FlexibleNullability] kotlin.Number?): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR ': .B declared in .B.test1' type=.B origin=null + t: CONST Int type=kotlin.Int value=1 + FUN name:test2 visibility:public modality:FINAL <> ($this:.B) returnType:@[FlexibleNullability] kotlin.Int? + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (): @[FlexibleNullability] kotlin.Int? declared in .B' + CALL 'public open fun bar (): @[FlexibleNullability] T of .Java1.bar? declared in .Java1' type=@[FlexibleNullability] kotlin.Int? origin=null + : @[FlexibleNullability] kotlin.Int? + FUN name:test3 visibility:public modality:FINAL <> ($this:.B) returnType:@[FlexibleNullability] kotlin.Number? + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (): @[FlexibleNullability] kotlin.Number? declared in .B' + CALL 'public open fun bar (): @[FlexibleNullability] kotlin.Number? declared in .B' type=@[FlexibleNullability] kotlin.Number? origin=null + $this: GET_VAR ': .B declared in .B.test3' type=.B origin=null + FUN name:test4 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (): kotlin.Unit declared in .B' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.String? + t: CONST String type=kotlin.String value="" + FUN name:test5 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5 (): kotlin.Unit declared in .B' + CALL 'public open fun foo (t: @[FlexibleNullability] kotlin.Number?): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR ': .B declared in .B.test5' type=.B origin=null + t: CONST Double type=kotlin.Double value=1.5 + FUN name:test6 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test6 (): kotlin.Unit declared in .B' + CALL 'public open fun foo (t: @[FlexibleNullability] kotlin.Number?, t2: @[FlexibleNullability] kotlin.Number?): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR ': .B declared in .B.test6' type=.B origin=null + t: CONST Double type=kotlin.Double value=1.5 + t2: CONST Int type=kotlin.Int value=8 + FUN name:test7 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test7 (): kotlin.Unit declared in .B' + CALL 'public open fun foo (t: @[FlexibleNullability] kotlin.Number?, t2: @[FlexibleNullability] kotlin.Number?): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR ': .B declared in .B.test7' type=.B origin=null + t: CONST Int type=kotlin.Int value=1 + t2: CONST Int type=kotlin.Int value=8 + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.KotlinClass; .Java2] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .KotlinClass' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.KotlinClass; .Java2]' + FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN () returnType:@[FlexibleNullability] T of .C.bar? [fake_override] + overridden: + public open fun bar (): @[FlexibleNullability] T of .Java1.bar? declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + 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 declared in .KotlinClass + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Java2 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .C.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .C.foo? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .C.foo?, t2:@[FlexibleNullability] T of .C.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?, t2: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .C.foo? + VALUE_PARAMETER name:t2 index:1 type:@[FlexibleNullability] T of .C.foo? + 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 .KotlinClass + public open fun hashCode (): kotlin.Int declared in .Java2 + $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 .KotlinClass + public open fun toString (): kotlin.String declared in .Java2 + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.Unit declared in .C' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.Int? + t: CONST Int type=kotlin.Int value=1 + FUN name:test2 visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (): kotlin.Int declared in .C' + TYPE_OP type=kotlin.Int origin=IMPLICIT_NOTNULL typeOperand=kotlin.Int + CALL 'public open fun bar (): @[FlexibleNullability] T of .Java1.bar? declared in .Java1' type=@[FlexibleNullability] kotlin.Int? origin=null + : @[FlexibleNullability] kotlin.Int? + FUN name:test3 visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (): kotlin.Unit declared in .C' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.String? + t: CONST String type=kotlin.String value="" + FUN name:test4 visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (): kotlin.Unit declared in .C' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.Double? + t: CONST Double type=kotlin.Double value=1.5 + FUN name:test5 visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5 (): kotlin.Unit declared in .C' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?, t2: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.Any? + t: CONST Double type=kotlin.Double value=1.5 + t2: CONST Int type=kotlin.Int value=8 + FUN name:test6 visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test6 (): kotlin.Unit declared in .C' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?, t2: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.Int? + t: CONST Int type=kotlin.Int value=1 + t2: CONST Int type=kotlin.Int value=8 + CLASS CLASS name:D modality:FINAL visibility:public superTypes:[.Java4; .Java2] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.D + CONSTRUCTOR visibility:public <> () returnType:.D [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Java4' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:D modality:FINAL visibility:public superTypes:[.Java4; .Java2]' + FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN () returnType:@[FlexibleNullability] T of .D.bar? [fake_override] + overridden: + public open fun bar (): @[FlexibleNullability] T of .Java4.bar? declared in .Java4 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + 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 declared in .Java4 + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Java2 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .D.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .Java4.foo?): kotlin.Unit declared in .Java4 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .D.foo? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .D.foo?, t2:@[FlexibleNullability] T of .D.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .Java4.foo?, t2: @[FlexibleNullability] T of .Java4.foo?): kotlin.Unit declared in .Java4 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .D.foo? + VALUE_PARAMETER name:t2 index:1 type:@[FlexibleNullability] T of .D.foo? + 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 .Java4 + public open fun hashCode (): kotlin.Int declared in .Java2 + $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 .Java4 + public open fun toString (): kotlin.String declared in .Java2 + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL <> ($this:.D) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.D + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.Unit declared in .D' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java4.foo?): kotlin.Unit declared in .Java4' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.Int? + t: CONST Int type=kotlin.Int value=1 + FUN name:test2 visibility:public modality:FINAL <> ($this:.D) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.D + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (): kotlin.Int declared in .D' + TYPE_OP type=kotlin.Int origin=IMPLICIT_NOTNULL typeOperand=kotlin.Int + CALL 'public open fun bar (): @[FlexibleNullability] T of .Java4.bar? declared in .Java4' type=@[FlexibleNullability] kotlin.Int? origin=null + : @[FlexibleNullability] kotlin.Int? + FUN name:test3 visibility:public modality:FINAL <> ($this:.D) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.D + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (): kotlin.Unit declared in .D' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java4.foo?): kotlin.Unit declared in .Java4' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.String? + t: CONST String type=kotlin.String value="" + FUN name:test4 visibility:public modality:FINAL <> ($this:.D) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.D + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (): kotlin.Unit declared in .D' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java4.foo?): kotlin.Unit declared in .Java4' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.Double? + t: CONST Double type=kotlin.Double value=1.5 + FUN name:test5 visibility:public modality:FINAL <> ($this:.D) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.D + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5 (): kotlin.Unit declared in .D' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java4.foo?, t2: @[FlexibleNullability] T of .Java4.foo?): kotlin.Unit declared in .Java4' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.Any? + t: CONST Double type=kotlin.Double value=1.5 + t2: CONST Int type=kotlin.Int value=8 + FUN name:test6 visibility:public modality:FINAL <> ($this:.D) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.D + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test6 (): kotlin.Unit declared in .D' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java4.foo?, t2: @[FlexibleNullability] T of .Java4.foo?): kotlin.Unit declared in .Java4' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.Int? + t: CONST Int type=kotlin.Int value=1 + t2: CONST Int type=kotlin.Int value=8 + CLASS CLASS name:KotlinClass modality:OPEN visibility:public superTypes:[.Java1] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KotlinClass + CONSTRUCTOR visibility:public <> () returnType:.KotlinClass [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Java1' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KotlinClass modality:OPEN visibility:public superTypes:[.Java1]' + FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN () returnType:@[FlexibleNullability] T of .KotlinClass.bar? [fake_override] + overridden: + public open fun bar (): @[FlexibleNullability] T of .Java1.bar? declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + 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 declared in .Java1 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .KotlinClass.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .KotlinClass.foo? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .KotlinClass.foo?, t2:@[FlexibleNullability] T of .KotlinClass.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?, t2: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .KotlinClass.foo? + VALUE_PARAMETER name:t2 index:1 type:@[FlexibleNullability] T of .KotlinClass.foo? + 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 .Java1 + $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 .Java1 + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:KotlinInterface modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KotlinInterface + 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 declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + 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 + FUN name:bar visibility:public modality:OPEN ($this:.KotlinInterface) returnType:T of .KotlinInterface.bar + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.KotlinInterface + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun bar (): T of .KotlinInterface.bar declared in .KotlinInterface' + CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=kotlin.Nothing origin=EXCLEXCL + : kotlin.Nothing + arg0: CONST Null type=kotlin.Nothing? value=null + FUN name:foo visibility:public modality:OPEN <> ($this:.KotlinInterface, t:kotlin.Number) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.KotlinInterface + VALUE_PARAMETER name:t index:0 type:kotlin.Number + BLOCK_BODY + FUN name:foo visibility:public modality:OPEN <> ($this:.KotlinInterface, t:kotlin.Number, t2:kotlin.Int) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.KotlinInterface + VALUE_PARAMETER name:t index:0 type:kotlin.Number + VALUE_PARAMETER name:t2 index:1 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=7 + BLOCK_BODY + FUN name:foo visibility:public modality:OPEN ($this:.KotlinInterface, t:T of .KotlinInterface.foo) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.KotlinInterface + VALUE_PARAMETER name:t index:0 type:T of .KotlinInterface.foo + BLOCK_BODY + FUN name:test visibility:public modality:FINAL <> (a:.A, b:.B, c:.C, d:.D) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:.A + VALUE_PARAMETER name:b index:1 type:.B + VALUE_PARAMETER name:c index:2 type:.C + VALUE_PARAMETER name:d index:3 type:.D + BLOCK_BODY + CALL 'public final fun test1 (): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR 'a: .A declared in .test' type=.A origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun test2 (): kotlin.Int declared in .A' type=kotlin.Int origin=null + $this: GET_VAR 'a: .A declared in .test' type=.A origin=null + CALL 'public final fun test3 (): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR 'a: .A declared in .test' type=.A origin=null + CALL 'public final fun test4 (): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR 'a: .A declared in .test' type=.A origin=null + CALL 'public final fun test5 (): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR 'a: .A declared in .test' type=.A origin=null + CALL 'public final fun test1 (): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .B declared in .test' type=.B origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun test2 (): @[FlexibleNullability] kotlin.Int? declared in .B' type=@[FlexibleNullability] kotlin.Int? origin=null + $this: GET_VAR 'b: .B declared in .test' type=.B origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun test3 (): @[FlexibleNullability] kotlin.Number? declared in .B' type=@[FlexibleNullability] kotlin.Number? origin=null + $this: GET_VAR 'b: .B declared in .test' type=.B origin=null + CALL 'public final fun test4 (): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .B declared in .test' type=.B origin=null + CALL 'public final fun test5 (): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .B declared in .test' type=.B origin=null + CALL 'public final fun test6 (): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .B declared in .test' type=.B origin=null + CALL 'public final fun test7 (): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .B declared in .test' type=.B origin=null + CALL 'public final fun test1 (): kotlin.Unit declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'c: .C declared in .test' type=.C origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun test2 (): kotlin.Int declared in .C' type=kotlin.Int origin=null + $this: GET_VAR 'c: .C declared in .test' type=.C origin=null + CALL 'public final fun test3 (): kotlin.Unit declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'c: .C declared in .test' type=.C origin=null + CALL 'public final fun test4 (): kotlin.Unit declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'c: .C declared in .test' type=.C origin=null + CALL 'public final fun test5 (): kotlin.Unit declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'c: .C declared in .test' type=.C origin=null + CALL 'public final fun test6 (): kotlin.Unit declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'c: .C declared in .test' type=.C origin=null + CALL 'public final fun test1 (): kotlin.Unit declared in .D' type=kotlin.Unit origin=null + $this: GET_VAR 'd: .D declared in .test' type=.D origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun test2 (): kotlin.Int declared in .D' type=kotlin.Int origin=null + $this: GET_VAR 'd: .D declared in .test' type=.D origin=null + CALL 'public final fun test3 (): kotlin.Unit declared in .D' type=kotlin.Unit origin=null + $this: GET_VAR 'd: .D declared in .test' type=.D origin=null + CALL 'public final fun test4 (): kotlin.Unit declared in .D' type=kotlin.Unit origin=null + $this: GET_VAR 'd: .D declared in .test' type=.D origin=null + CALL 'public final fun test5 (): kotlin.Unit declared in .D' type=kotlin.Unit origin=null + $this: GET_VAR 'd: .D declared in .test' type=.D origin=null + CALL 'public final fun test6 (): kotlin.Unit declared in .D' type=kotlin.Unit origin=null + $this: GET_VAR 'd: .D declared in .test' type=.D origin=null diff --git a/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.kt b/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.kt new file mode 100644 index 00000000000..3eaf9ab537e --- /dev/null +++ b/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.kt @@ -0,0 +1,106 @@ +// TARGET_BACKEND: JVM + +// FILE: Java1.java +public class Java1 { + public static void foo(T t) { } + public static T bar() { + return null; + } + public static void foo(T t, T t2) {} +} + +// FILE: Java2.java +public interface Java2 { + static int bar() { + return 1; + } + static void foo(int t) { } + static void foo(int t, int t2) {} +} + +// FILE: Java3.java +public interface Java3 { + default Number bar() { + return 1; + } + default void foo(Number t) { } + default void foo(Number t, Number t2) { } +} + +// FILE: Java4.java +public class Java4 extends Java1 { } + +// FILE: 1.kt +class A : Java1(), Java2, KotlinInterface { //Kotlin ← Java1, Java2, Kotlin2 + fun test1() = foo(1) + fun test2(): Int = bar() + fun test3() = foo("") + fun test4() = foo(1.5) + fun test5() = foo(1.5, 8) +} + +class B : Java1(), Java2, Java3 { //Kotlin ← Java1, Java2, Java3 + fun test1() = foo(1) + fun test2()= bar() + fun test3()= bar() + fun test4() = foo("") + fun test5() = foo(1.5) + fun test6() = foo(1.5, 8) + fun test7() = foo(1, 8) +} + +class C : KotlinClass() , Java2 { //Kotlin ← Java, Kotlin2 ← Java2 + fun test1() = foo(1) + fun test2(): Int = bar() + fun test3() = foo("") + fun test4() = foo(1.5) + fun test5() = foo(1.5, 8) + fun test6() = foo(1, 8) +} + +class D : Java4(), Java2 { //Kotlin ← Java1, Java2 ← Java3 + fun test1() = foo(1) + fun test2(): Int = bar() + fun test3() = foo("") + fun test4() = foo(1.5) + fun test5() = foo(1.5, 8) + fun test6() = foo(1, 8) +} + +interface KotlinInterface { + fun foo(t: T) { } + fun bar(): T { + return null!! + } + fun foo(t: Number){ } + fun foo(t: Number, t2: Int = 7) { } +} + +open class KotlinClass : Java1() + +fun test(a: A, b: B, c: C, d: D) { + a.test1() + a.test2() + a.test3() + a.test4() + a.test5() + b.test1() + b.test2() + b.test3() + b.test4() + b.test5() + b.test6() + b.test7() + c.test1() + c.test2() + c.test3() + c.test4() + c.test5() + c.test6() + d.test1() + d.test2() + d.test3() + d.test4() + d.test5() + d.test6() +} \ No newline at end of file diff --git a/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.kt.txt b/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.kt.txt new file mode 100644 index 00000000000..b429bfb688e --- /dev/null +++ b/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.kt.txt @@ -0,0 +1,183 @@ +class A : Java1, Java2, KotlinInterface { + constructor() /* primary */ { + super/*Java1*/() + /* () */ + + } + + fun test1() { + return .foo(t = 1) + } + + fun test2(): Int { + return .bar() + } + + fun test3() { + return .foo(t = "") + } + + fun test4() { + return .foo(t = 1.5) + } + + fun test5() { + return .foo(t = 1.5, t2 = 8) + } + +} + +class B : Java1, Java2, Java3 { + constructor() /* primary */ { + super/*Java1*/() + /* () */ + + } + + fun test1() { + return .foo(t = 1) + } + + fun test2(): @FlexibleNullability Int? { + return bar<@FlexibleNullability Int?>() + } + + fun test3(): @FlexibleNullability Number? { + return .bar() + } + + fun test4() { + return foo<@FlexibleNullability String?>(t = "") + } + + fun test5() { + return .foo(t = 1.5) + } + + fun test6() { + return .foo(t = 1.5, t2 = 8) + } + + fun test7() { + return .foo(t = 1, t2 = 8) + } + +} + +class C : KotlinClass, Java2 { + constructor() /* primary */ { + super/*KotlinClass*/() + /* () */ + + } + + fun test1() { + return foo<@FlexibleNullability Int?>(t = 1) + } + + fun test2(): Int { + return bar<@FlexibleNullability Int?>() /*!! Int */ + } + + fun test3() { + return foo<@FlexibleNullability String?>(t = "") + } + + fun test4() { + return foo<@FlexibleNullability Double?>(t = 1.5) + } + + fun test5() { + return foo<@FlexibleNullability Any?>(t = 1.5, t2 = 8) + } + + fun test6() { + return foo<@FlexibleNullability Int?>(t = 1, t2 = 8) + } + +} + +class D : Java4, Java2 { + constructor() /* primary */ { + super/*Java4*/() + /* () */ + + } + + fun test1() { + return foo<@FlexibleNullability Int?>(t = 1) + } + + fun test2(): Int { + return bar<@FlexibleNullability Int?>() /*!! Int */ + } + + fun test3() { + return foo<@FlexibleNullability String?>(t = "") + } + + fun test4() { + return foo<@FlexibleNullability Double?>(t = 1.5) + } + + fun test5() { + return foo<@FlexibleNullability Any?>(t = 1.5, t2 = 8) + } + + fun test6() { + return foo<@FlexibleNullability Int?>(t = 1, t2 = 8) + } + +} + +open class KotlinClass : Java1 { + constructor() /* primary */ { + super/*Java1*/() + /* () */ + + } + +} + +interface KotlinInterface { + fun bar(): T { + return CHECK_NOT_NULL(arg0 = null) + } + + fun foo(t: Number) { + } + + fun foo(t: Number, t2: Int = 7) { + } + + fun foo(t: T) { + } + +} + +fun test(a: A, b: B, c: C, d: D) { + a.test1() + a.test2() /*~> Unit */ + a.test3() + a.test4() + a.test5() + b.test1() + b.test2() /*~> Unit */ + b.test3() /*~> Unit */ + b.test4() + b.test5() + b.test6() + b.test7() + c.test1() + c.test2() /*~> Unit */ + c.test3() + c.test4() + c.test5() + c.test6() + d.test1() + d.test2() /*~> Unit */ + d.test3() + d.test4() + d.test5() + d.test6() +} diff --git a/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.sig.kt.txt b/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.sig.kt.txt new file mode 100644 index 00000000000..84b8d1b53bc --- /dev/null +++ b/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.sig.kt.txt @@ -0,0 +1,281 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A : Java1, Java2, KotlinInterface { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + // Public signature debug description: (){} + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: A#bar(){0§}0:0 + // Public signature: /A.bar|-3730887172686175993[0] + // Public signature debug description: bar(){0§}0:0 + /* fake */ override fun bar(): T + + // CHECK: + // Mangled name: A#foo(kotlin.Number){} + // Public signature: /A.foo|97687418835402471[0] + // Public signature debug description: foo(kotlin.Number){} + /* fake */ override fun foo(t: Number): Unit + + // CHECK: + // Mangled name: A#foo(kotlin.Number;kotlin.Int){} + // Public signature: /A.foo|-582544100250830393[0] + // Public signature debug description: foo(kotlin.Number;kotlin.Int){} + /* fake */ override fun foo(t: Number, t2: Int): Unit + + // CHECK: + // Mangled name: A#foo(0:0){0§} + // Public signature: /A.foo|-6838606926256314363[0] + // Public signature debug description: foo(0:0){0§} + /* fake */ override fun foo(t: T): Unit + + // CHECK: + // Mangled name: A#test1(){} + // Public signature: /A.test1|4297044443957252634[0] + // Public signature debug description: test1(){} + fun test1(): Unit + + // CHECK JVM_IR: + // Mangled name: A#test2(){}kotlin.Int + // Public signature: /A.test2|5542371834528279174[0] + // Public signature debug description: test2(){}kotlin.Int + fun test2(): Int + + // CHECK: + // Mangled name: A#test3(){} + // Public signature: /A.test3|-3759735065270951803[0] + // Public signature debug description: test3(){} + fun test3(): Unit + + // CHECK: + // Mangled name: A#test4(){} + // Public signature: /A.test4|5588455914500386239[0] + // Public signature debug description: test4(){} + fun test4(): Unit + + // CHECK: + // Mangled name: A#test5(){} + // Public signature: /A.test5|-2461239215881954159[0] + // Public signature debug description: test5(){} + fun test5(): Unit + +} + +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +class B : Java1, Java2, Java3 { + // CHECK: + // Mangled name: B#(){} + // Public signature: /B.|-5645683436151566731[0] + // Public signature debug description: (){} + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: B#bar(){}kotlin.Number? + // Public signature: /B.bar|-1679062975122643439[0] + // Public signature debug description: bar(){}kotlin.Number? + /* fake */ override fun bar(): Number? + + // CHECK: + // Mangled name: B#foo(kotlin.Number?){} + // Public signature: /B.foo|2831167016207060641[0] + // Public signature debug description: foo(kotlin.Number?){} + /* fake */ override fun foo(t: Number?): Unit + + // CHECK: + // Mangled name: B#foo(kotlin.Number?;kotlin.Number?){} + // Public signature: /B.foo|-7463972333851766982[0] + // Public signature debug description: foo(kotlin.Number?;kotlin.Number?){} + /* fake */ override fun foo(t: Number?, t2: Number?): Unit + + // CHECK: + // Mangled name: B#test1(){} + // Public signature: /B.test1|4297044443957252634[0] + // Public signature debug description: test1(){} + fun test1(): Unit + + // CHECK JVM_IR: + // Mangled name: B#test2(){}kotlin.Int? + // Public signature: /B.test2|-5765850018663628420[0] + // Public signature debug description: test2(){}kotlin.Int? + fun test2(): Int? + + // CHECK JVM_IR: + // Mangled name: B#test3(){}kotlin.Number? + // Public signature: /B.test3|-6251483702542360946[0] + // Public signature debug description: test3(){}kotlin.Number? + fun test3(): Number? + + // CHECK: + // Mangled name: B#test4(){} + // Public signature: /B.test4|5588455914500386239[0] + // Public signature debug description: test4(){} + fun test4(): Unit + + // CHECK: + // Mangled name: B#test5(){} + // Public signature: /B.test5|-2461239215881954159[0] + // Public signature debug description: test5(){} + fun test5(): Unit + + // CHECK: + // Mangled name: B#test6(){} + // Public signature: /B.test6|-6357717956567725919[0] + // Public signature debug description: test6(){} + fun test6(): Unit + + // CHECK: + // Mangled name: B#test7(){} + // Public signature: /B.test7|-8173197202779127520[0] + // Public signature debug description: test7(){} + fun test7(): Unit + +} + +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C : KotlinClass, Java2 { + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + // Public signature debug description: (){} + constructor() /* primary */ + + // CHECK: + // Mangled name: C#test1(){} + // Public signature: /C.test1|4297044443957252634[0] + // Public signature debug description: test1(){} + fun test1(): Unit + + // CHECK JVM_IR: + // Mangled name: C#test2(){}kotlin.Int + // Public signature: /C.test2|5542371834528279174[0] + // Public signature debug description: test2(){}kotlin.Int + fun test2(): Int + + // CHECK: + // Mangled name: C#test3(){} + // Public signature: /C.test3|-3759735065270951803[0] + // Public signature debug description: test3(){} + fun test3(): Unit + + // CHECK: + // Mangled name: C#test4(){} + // Public signature: /C.test4|5588455914500386239[0] + // Public signature debug description: test4(){} + fun test4(): Unit + + // CHECK: + // Mangled name: C#test5(){} + // Public signature: /C.test5|-2461239215881954159[0] + // Public signature debug description: test5(){} + fun test5(): Unit + + // CHECK: + // Mangled name: C#test6(){} + // Public signature: /C.test6|-6357717956567725919[0] + // Public signature debug description: test6(){} + fun test6(): Unit + +} + +// CHECK: +// Mangled name: D +// Public signature: /D|null[0] +class D : Java4, Java2 { + // CHECK: + // Mangled name: D#(){} + // Public signature: /D.|-5645683436151566731[0] + // Public signature debug description: (){} + constructor() /* primary */ + + // CHECK: + // Mangled name: D#test1(){} + // Public signature: /D.test1|4297044443957252634[0] + // Public signature debug description: test1(){} + fun test1(): Unit + + // CHECK JVM_IR: + // Mangled name: D#test2(){}kotlin.Int + // Public signature: /D.test2|5542371834528279174[0] + // Public signature debug description: test2(){}kotlin.Int + fun test2(): Int + + // CHECK: + // Mangled name: D#test3(){} + // Public signature: /D.test3|-3759735065270951803[0] + // Public signature debug description: test3(){} + fun test3(): Unit + + // CHECK: + // Mangled name: D#test4(){} + // Public signature: /D.test4|5588455914500386239[0] + // Public signature debug description: test4(){} + fun test4(): Unit + + // CHECK: + // Mangled name: D#test5(){} + // Public signature: /D.test5|-2461239215881954159[0] + // Public signature debug description: test5(){} + fun test5(): Unit + + // CHECK: + // Mangled name: D#test6(){} + // Public signature: /D.test6|-6357717956567725919[0] + // Public signature debug description: test6(){} + fun test6(): Unit + +} + +// CHECK: +// Mangled name: KotlinClass +// Public signature: /KotlinClass|null[0] +open class KotlinClass : Java1 { + // CHECK: + // Mangled name: KotlinClass#(){} + // Public signature: /KotlinClass.|-5645683436151566731[0] + // Public signature debug description: (){} + constructor() /* primary */ + +} + +// CHECK: +// Mangled name: KotlinInterface +// Public signature: /KotlinInterface|null[0] +interface KotlinInterface { + // CHECK JVM_IR: + // Mangled name: KotlinInterface#bar(){0§}0:0 + // Public signature: /KotlinInterface.bar|-3730887172686175993[0] + // Public signature debug description: bar(){0§}0:0 + fun bar(): T + + // CHECK: + // Mangled name: KotlinInterface#foo(kotlin.Number){} + // Public signature: /KotlinInterface.foo|97687418835402471[0] + // Public signature debug description: foo(kotlin.Number){} + fun foo(t: Number): Unit + + // CHECK: + // Mangled name: KotlinInterface#foo(kotlin.Number;kotlin.Int){} + // Public signature: /KotlinInterface.foo|-582544100250830393[0] + // Public signature debug description: foo(kotlin.Number;kotlin.Int){} + fun foo(t: Number, t2: Int): Unit + + // CHECK: + // Mangled name: KotlinInterface#foo(0:0){0§} + // Public signature: /KotlinInterface.foo|-6838606926256314363[0] + // Public signature debug description: foo(0:0){0§} + fun foo(t: T): Unit + +} + +// CHECK: +// Mangled name: #test(A;B;C;D){} +// Public signature: /test|7656439746344069424[0] +// Public signature debug description: test(A;B;C;D){} +fun test(a: A, b: B, c: C, d: D): Unit diff --git a/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOverride.ir.txt b/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOverride.ir.txt new file mode 100644 index 00000000000..810886e486e --- /dev/null +++ b/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOverride.ir.txt @@ -0,0 +1,238 @@ +FILE fqName: fileName:/1.kt + CLASS CLASS name:A modality:FINAL visibility:public superTypes:[.Java1; .KotlinInterface] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Java1' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[.Java1; .KotlinInterface]' + FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN ($this:.KotlinInterface) returnType:T of .A.bar [fake_override] + overridden: + public open fun bar (): T of .KotlinInterface.bar declared in .KotlinInterface + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.KotlinInterface + FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN () returnType:@[FlexibleNullability] T of .A.bar? [fake_override] + overridden: + public open fun bar (): @[FlexibleNullability] T of .Java1.bar? declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + 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 declared in .Java1 + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .KotlinInterface + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.KotlinInterface, t:kotlin.Number) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: kotlin.Number): kotlin.Unit declared in .KotlinInterface + $this: VALUE_PARAMETER name: type:.KotlinInterface + VALUE_PARAMETER name:t index:0 type:kotlin.Number + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.KotlinInterface, t:kotlin.Number, t2:kotlin.Int) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: kotlin.Number, t2: kotlin.Int): kotlin.Unit declared in .KotlinInterface + $this: VALUE_PARAMETER name: type:.KotlinInterface + VALUE_PARAMETER name:t index:0 type:kotlin.Number + VALUE_PARAMETER name:t2 index:1 type:kotlin.Int + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> (t:@[FlexibleNullability] kotlin.Number?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] kotlin.Number?): kotlin.Unit declared in .Java1 + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] kotlin.Number? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> (t:@[FlexibleNullability] kotlin.Number?, t2:@[FlexibleNullability] kotlin.Int?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] kotlin.Number?, t2: @[FlexibleNullability] kotlin.Int?): kotlin.Unit declared in .Java1 + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] kotlin.Number? + VALUE_PARAMETER name:t2 index:1 type:@[FlexibleNullability] kotlin.Int? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN ($this:.KotlinInterface, t:T of .A.foo) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: T of .KotlinInterface.foo): kotlin.Unit declared in .KotlinInterface + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.KotlinInterface + VALUE_PARAMETER name:t index:0 type:T of .A.foo + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .A.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .A.foo? + 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 .Java1 + public open fun hashCode (): kotlin.Int declared in .KotlinInterface + $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 .Java1 + public open fun toString (): kotlin.String declared in .KotlinInterface + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.Unit declared in .A' + CALL 'public open fun foo (t: kotlin.Number): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR ': .A declared in .A.test1' type=.A origin=null + t: CONST Int type=kotlin.Int value=1 + FUN name:test2 visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (): kotlin.Int declared in .A' + CALL 'public open fun bar (): T of .A.bar declared in .A' type=kotlin.Int origin=null + : kotlin.Int + $this: GET_VAR ': .A declared in .A.test2' type=.A origin=null + FUN name:test3 visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (): kotlin.Unit declared in .A' + CALL 'public open fun foo (t: T of .A.foo): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + : kotlin.String + $this: GET_VAR ': .A declared in .A.test3' type=.A origin=null + t: CONST String type=kotlin.String value="" + FUN name:test4 visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (): kotlin.Unit declared in .A' + CALL 'public open fun foo (t: kotlin.Number): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR ': .A declared in .A.test4' type=.A origin=null + t: CONST Double type=kotlin.Double value=1.5 + FUN name:test5 visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5 (): kotlin.Unit declared in .A' + CALL 'public open fun foo (t: kotlin.Number, t2: kotlin.Int): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR ': .A declared in .A.test5' type=.A origin=null + t: CONST Double type=kotlin.Double value=1.5 + t2: CONST Int type=kotlin.Int value=8 + CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.Java1; .Java2] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + CONSTRUCTOR visibility:public <> () returnType:.B [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Java1' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.Java1; .Java2]' + FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN () returnType:@[FlexibleNullability] T of .B.bar? [fake_override] + overridden: + public open fun bar (): @[FlexibleNullability] T of .Java1.bar? declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + 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 declared in .Java1 + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Java2 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> (t:@[FlexibleNullability] kotlin.Number?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] kotlin.Number?): kotlin.Unit declared in .Java1 + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] kotlin.Number? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> (t:@[FlexibleNullability] kotlin.Number?, t2:@[FlexibleNullability] kotlin.Int?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] kotlin.Number?, t2: @[FlexibleNullability] kotlin.Int?): kotlin.Unit declared in .Java1 + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] kotlin.Number? + VALUE_PARAMETER name:t2 index:1 type:@[FlexibleNullability] kotlin.Int? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .B.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .B.foo? + 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 .Java1 + public open fun hashCode (): kotlin.Int declared in .Java2 + $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 .Java1 + public open fun toString (): kotlin.String declared in .Java2 + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.Unit declared in .B' + CALL 'public open fun foo (t: @[FlexibleNullability] kotlin.Number?): kotlin.Unit declared in .Java1' type=kotlin.Unit origin=null + t: CONST Int type=kotlin.Int value=1 + FUN name:test2 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (): kotlin.Int declared in .B' + TYPE_OP type=kotlin.Int origin=IMPLICIT_NOTNULL typeOperand=kotlin.Int + CALL 'public open fun bar (): @[FlexibleNullability] T of .Java1.bar? declared in .Java1' type=@[FlexibleNullability] kotlin.Int? origin=null + : @[FlexibleNullability] kotlin.Int? + FUN name:test3 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (): kotlin.Unit declared in .B' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.String? + t: CONST String type=kotlin.String value="" + FUN name:test4 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (): kotlin.Unit declared in .B' + CALL 'public open fun foo (t: @[FlexibleNullability] kotlin.Number?): kotlin.Unit declared in .Java1' type=kotlin.Unit origin=null + t: CONST Double type=kotlin.Double value=1.5 + FUN name:test5 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test5 (): kotlin.Unit declared in .B' + CALL 'public open fun foo (t: @[FlexibleNullability] kotlin.Number?, t2: @[FlexibleNullability] kotlin.Int?): kotlin.Unit declared in .Java1' type=kotlin.Unit origin=null + t: CONST Double type=kotlin.Double value=1.5 + t2: CONST Int type=kotlin.Int value=8 + CLASS INTERFACE name:KotlinInterface modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KotlinInterface + 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 declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + 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 + FUN name:bar visibility:public modality:OPEN ($this:.KotlinInterface) returnType:T of .KotlinInterface.bar + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.KotlinInterface + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun bar (): T of .KotlinInterface.bar declared in .KotlinInterface' + CALL 'public final fun CHECK_NOT_NULL (arg0: T0 of kotlin.internal.ir.CHECK_NOT_NULL?): {T0 of kotlin.internal.ir.CHECK_NOT_NULL & Any} declared in kotlin.internal.ir' type=kotlin.Nothing origin=EXCLEXCL + : kotlin.Nothing + arg0: CONST Null type=kotlin.Nothing? value=null + FUN name:foo visibility:public modality:OPEN <> ($this:.KotlinInterface, t:kotlin.Number) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.KotlinInterface + VALUE_PARAMETER name:t index:0 type:kotlin.Number + BLOCK_BODY + FUN name:foo visibility:public modality:OPEN <> ($this:.KotlinInterface, t:kotlin.Number, t2:kotlin.Int) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.KotlinInterface + VALUE_PARAMETER name:t index:0 type:kotlin.Number + VALUE_PARAMETER name:t2 index:1 type:kotlin.Int + EXPRESSION_BODY + CONST Int type=kotlin.Int value=7 + BLOCK_BODY + FUN name:foo visibility:public modality:OPEN ($this:.KotlinInterface, t:T of .KotlinInterface.foo) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + $this: VALUE_PARAMETER name: type:.KotlinInterface + VALUE_PARAMETER name:t index:0 type:T of .KotlinInterface.foo + BLOCK_BODY + FUN name:test visibility:public modality:FINAL <> (a:.A, b:.B) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:.A + VALUE_PARAMETER name:b index:1 type:.B + BLOCK_BODY + CALL 'public final fun test1 (): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR 'a: .A declared in .test' type=.A origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun test2 (): kotlin.Int declared in .A' type=kotlin.Int origin=null + $this: GET_VAR 'a: .A declared in .test' type=.A origin=null + CALL 'public final fun test3 (): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR 'a: .A declared in .test' type=.A origin=null + CALL 'public final fun test4 (): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR 'a: .A declared in .test' type=.A origin=null + CALL 'public final fun test5 (): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR 'a: .A declared in .test' type=.A origin=null + CALL 'public final fun test1 (): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .B declared in .test' type=.B origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun test2 (): kotlin.Int declared in .B' type=kotlin.Int origin=null + $this: GET_VAR 'b: .B declared in .test' type=.B origin=null + CALL 'public final fun test3 (): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .B declared in .test' type=.B origin=null + CALL 'public final fun test4 (): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .B declared in .test' type=.B origin=null + CALL 'public final fun test5 (): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .B declared in .test' type=.B origin=null diff --git a/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOverride.kt b/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOverride.kt new file mode 100644 index 00000000000..50c92bbd8b5 --- /dev/null +++ b/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOverride.kt @@ -0,0 +1,61 @@ +// FIR_IDENTICAL +// TARGET_BACKEND: JVM + +// FILE: Java1.java +public class Java1 { + public static void foo(T t) {} + public static T bar() { + return null; + } + public static void foo(Number t) {} + public static void foo(Number t, Integer t2) {} +} + +// FILE: Java2.java +public interface Java2 { + static void foo(T t) {} + static T bar() { + return null; + } + static void foo(int t) {} + static void foo(int t, int t2) {} +} + +// FILE: 1.kt +class A : Java1(), KotlinInterface { + fun test1() = foo(1) + fun test2(): Int = bar() + fun test3() = foo("") + fun test4() = foo(1.5) + fun test5() = foo(1.5, 8) +} + +class B : Java1(), Java2 { + fun test1() = foo(1) + fun test2(): Int = bar() + fun test3() = foo("") + fun test4() = foo(1.5) + fun test5() = foo(1.5, 8) +} + +interface KotlinInterface { + fun foo(t: T) {} + fun bar(): T { + return null!! + } + fun foo(t: Number) {} + fun foo(t: Number, t2: Int = 7) {} +} + +fun test(a: A, b: B) { + a.test1() + a.test2() + a.test3() + a.test4() + a.test5() + b.test1() + b.test2() + b.test3() + b.test4() + b.test5() +} \ No newline at end of file diff --git a/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOverride.kt.txt b/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOverride.kt.txt new file mode 100644 index 00000000000..e45a3f5e776 --- /dev/null +++ b/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOverride.kt.txt @@ -0,0 +1,86 @@ +class A : Java1, KotlinInterface { + constructor() /* primary */ { + super/*Java1*/() + /* () */ + + } + + fun test1() { + return .foo(t = 1) + } + + fun test2(): Int { + return .bar() + } + + fun test3() { + return .foo(t = "") + } + + fun test4() { + return .foo(t = 1.5) + } + + fun test5() { + return .foo(t = 1.5, t2 = 8) + } + +} + +class B : Java1, Java2 { + constructor() /* primary */ { + super/*Java1*/() + /* () */ + + } + + fun test1() { + return foo(t = 1) + } + + fun test2(): Int { + return bar<@FlexibleNullability Int?>() /*!! Int */ + } + + fun test3() { + return foo<@FlexibleNullability String?>(t = "") + } + + fun test4() { + return foo(t = 1.5) + } + + fun test5() { + return foo(t = 1.5, t2 = 8) + } + +} + +interface KotlinInterface { + fun bar(): T { + return CHECK_NOT_NULL(arg0 = null) + } + + fun foo(t: Number) { + } + + fun foo(t: Number, t2: Int = 7) { + } + + fun foo(t: T) { + } + +} + +fun test(a: A, b: B) { + a.test1() + a.test2() /*~> Unit */ + a.test3() + a.test4() + a.test5() + b.test1() + b.test2() /*~> Unit */ + b.test3() + b.test4() + b.test5() +} diff --git a/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOverride.sig.kt.txt b/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOverride.sig.kt.txt new file mode 100644 index 00000000000..f3976489fc2 --- /dev/null +++ b/compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOverride.sig.kt.txt @@ -0,0 +1,143 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +class A : Java1, KotlinInterface { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + // Public signature debug description: (){} + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: A#bar(){0§}0:0 + // Public signature: /A.bar|-3730887172686175993[0] + // Public signature debug description: bar(){0§}0:0 + /* fake */ override fun bar(): T + + // CHECK: + // Mangled name: A#foo(kotlin.Number){} + // Public signature: /A.foo|97687418835402471[0] + // Public signature debug description: foo(kotlin.Number){} + /* fake */ override fun foo(t: Number): Unit + + // CHECK: + // Mangled name: A#foo(kotlin.Number;kotlin.Int){} + // Public signature: /A.foo|-582544100250830393[0] + // Public signature debug description: foo(kotlin.Number;kotlin.Int){} + /* fake */ override fun foo(t: Number, t2: Int): Unit + + // CHECK: + // Mangled name: A#foo(0:0){0§} + // Public signature: /A.foo|-6838606926256314363[0] + // Public signature debug description: foo(0:0){0§} + /* fake */ override fun foo(t: T): Unit + + // CHECK: + // Mangled name: A#test1(){} + // Public signature: /A.test1|4297044443957252634[0] + // Public signature debug description: test1(){} + fun test1(): Unit + + // CHECK JVM_IR: + // Mangled name: A#test2(){}kotlin.Int + // Public signature: /A.test2|5542371834528279174[0] + // Public signature debug description: test2(){}kotlin.Int + fun test2(): Int + + // CHECK: + // Mangled name: A#test3(){} + // Public signature: /A.test3|-3759735065270951803[0] + // Public signature debug description: test3(){} + fun test3(): Unit + + // CHECK: + // Mangled name: A#test4(){} + // Public signature: /A.test4|5588455914500386239[0] + // Public signature debug description: test4(){} + fun test4(): Unit + + // CHECK: + // Mangled name: A#test5(){} + // Public signature: /A.test5|-2461239215881954159[0] + // Public signature debug description: test5(){} + fun test5(): Unit + +} + +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +class B : Java1, Java2 { + // CHECK: + // Mangled name: B#(){} + // Public signature: /B.|-5645683436151566731[0] + // Public signature debug description: (){} + constructor() /* primary */ + + // CHECK: + // Mangled name: B#test1(){} + // Public signature: /B.test1|4297044443957252634[0] + // Public signature debug description: test1(){} + fun test1(): Unit + + // CHECK JVM_IR: + // Mangled name: B#test2(){}kotlin.Int + // Public signature: /B.test2|5542371834528279174[0] + // Public signature debug description: test2(){}kotlin.Int + fun test2(): Int + + // CHECK: + // Mangled name: B#test3(){} + // Public signature: /B.test3|-3759735065270951803[0] + // Public signature debug description: test3(){} + fun test3(): Unit + + // CHECK: + // Mangled name: B#test4(){} + // Public signature: /B.test4|5588455914500386239[0] + // Public signature debug description: test4(){} + fun test4(): Unit + + // CHECK: + // Mangled name: B#test5(){} + // Public signature: /B.test5|-2461239215881954159[0] + // Public signature debug description: test5(){} + fun test5(): Unit + +} + +// CHECK: +// Mangled name: KotlinInterface +// Public signature: /KotlinInterface|null[0] +interface KotlinInterface { + // CHECK JVM_IR: + // Mangled name: KotlinInterface#bar(){0§}0:0 + // Public signature: /KotlinInterface.bar|-3730887172686175993[0] + // Public signature debug description: bar(){0§}0:0 + fun bar(): T + + // CHECK: + // Mangled name: KotlinInterface#foo(kotlin.Number){} + // Public signature: /KotlinInterface.foo|97687418835402471[0] + // Public signature debug description: foo(kotlin.Number){} + fun foo(t: Number): Unit + + // CHECK: + // Mangled name: KotlinInterface#foo(kotlin.Number;kotlin.Int){} + // Public signature: /KotlinInterface.foo|-582544100250830393[0] + // Public signature debug description: foo(kotlin.Number;kotlin.Int){} + fun foo(t: Number, t2: Int): Unit + + // CHECK: + // Mangled name: KotlinInterface#foo(0:0){0§} + // Public signature: /KotlinInterface.foo|-6838606926256314363[0] + // Public signature debug description: foo(0:0){0§} + fun foo(t: T): Unit + +} + +// CHECK: +// Mangled name: #test(A;B){} +// Public signature: /test|-2533013708701322011[0] +// Public signature debug description: test(A;B){} +fun test(a: A, b: B): Unit diff --git a/compiler/testData/ir/irText/fakeOverrides/javastatic/substitutionStaticOverride.ir.txt b/compiler/testData/ir/irText/fakeOverrides/javastatic/substitutionStaticOverride.ir.txt new file mode 100644 index 00000000000..f3e69f4fb3e --- /dev/null +++ b/compiler/testData/ir/irText/fakeOverrides/javastatic/substitutionStaticOverride.ir.txt @@ -0,0 +1,214 @@ +FILE fqName: fileName:/1.kt + CLASS CLASS name:A modality:OPEN visibility:public superTypes:[.Java1] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Java1' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:OPEN visibility:public superTypes:[.Java1]' + FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN () returnType:@[FlexibleNullability] T of .A.bar? [fake_override] + overridden: + public open fun bar (): @[FlexibleNullability] T of .Java1.bar? declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + 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 declared in .Java1 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> (t:@[FlexibleNullability] kotlin.Number?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] kotlin.Number?): kotlin.Unit declared in .Java1 + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] kotlin.Number? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> (t:@[FlexibleNullability] kotlin.Number?, t2:@[FlexibleNullability] kotlin.Int?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] kotlin.Number?, t2: @[FlexibleNullability] kotlin.Int?): kotlin.Unit declared in .Java1 + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] kotlin.Number? + VALUE_PARAMETER name:t2 index:1 type:@[FlexibleNullability] kotlin.Int? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .A.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .A.foo? + 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 .Java1 + $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 .Java1 + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun test1 (): kotlin.Unit declared in .A' + CALL 'public open fun foo (t: @[FlexibleNullability] kotlin.Number?): kotlin.Unit declared in .Java1' type=kotlin.Unit origin=null + t: CONST Int type=kotlin.Int value=1 + FUN name:test2 visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun test2 (): kotlin.Int declared in .A' + TYPE_OP type=kotlin.Int origin=IMPLICIT_NOTNULL typeOperand=kotlin.Int + CALL 'public open fun bar (): @[FlexibleNullability] T of .Java1.bar? declared in .Java1' type=@[FlexibleNullability] kotlin.Int? origin=null + : @[FlexibleNullability] kotlin.Int? + FUN name:test3 visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun test3 (): kotlin.Unit declared in .A' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java1.foo?): kotlin.Unit declared in .Java1' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.String? + t: CONST String type=kotlin.String value="" + FUN name:test4 visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun test4 (): kotlin.Unit declared in .A' + CALL 'public open fun foo (t: @[FlexibleNullability] kotlin.Number?, t2: @[FlexibleNullability] kotlin.Int?): kotlin.Unit declared in .Java1' type=kotlin.Unit origin=null + t: CONST Int type=kotlin.Int value=1 + t2: CONST Int type=kotlin.Int value=1 + CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.Java2] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + CONSTRUCTOR visibility:public <> () returnType:.B [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Java2' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.Java2]' + FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN () returnType:@[FlexibleNullability] T of .B.bar? [fake_override] + overridden: + public open fun bar (): @[FlexibleNullability] T of .Java2.bar? declared in .Java2 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + 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 declared in .Java2 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> (t:@[FlexibleNullability] kotlin.Number?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] kotlin.Number?): kotlin.Unit declared in .Java2 + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] kotlin.Number? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> (t:@[FlexibleNullability] kotlin.Number?, t2:@[FlexibleNullability] kotlin.Int?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] kotlin.Number?, t2: @[FlexibleNullability] kotlin.Int?): kotlin.Unit declared in .Java2 + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] kotlin.Number? + VALUE_PARAMETER name:t2 index:1 type:@[FlexibleNullability] kotlin.Int? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .B.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .Java2.foo?): kotlin.Unit declared in .Java2 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .B.foo? + 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 .Java2 + $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 .Java2 + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.Unit declared in .B' + CALL 'public open fun foo (t: @[FlexibleNullability] kotlin.Number?): kotlin.Unit declared in .Java2' type=kotlin.Unit origin=null + t: CONST Int type=kotlin.Int value=1 + FUN name:test2 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Int + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test2 (): kotlin.Int declared in .B' + TYPE_OP type=kotlin.Int origin=IMPLICIT_NOTNULL typeOperand=kotlin.Int + CALL 'public open fun bar (): @[FlexibleNullability] T of .Java2.bar? declared in .Java2' type=@[FlexibleNullability] kotlin.Int? origin=null + : @[FlexibleNullability] kotlin.Int? + FUN name:test3 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test3 (): kotlin.Unit declared in .B' + CALL 'public open fun foo (t: @[FlexibleNullability] T of .Java2.foo?): kotlin.Unit declared in .Java2' type=kotlin.Unit origin=null + : @[FlexibleNullability] kotlin.String? + t: CONST String type=kotlin.String value="" + FUN name:test4 visibility:public modality:FINAL <> ($this:.B) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun test4 (): kotlin.Unit declared in .B' + CALL 'public open fun foo (t: @[FlexibleNullability] kotlin.Number?, t2: @[FlexibleNullability] kotlin.Int?): kotlin.Unit declared in .Java2' type=kotlin.Unit origin=null + t: CONST Int type=kotlin.Int value=1 + t2: CONST Int type=kotlin.Int value=1 + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.Java3] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Java3' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.Java3]' + FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN () returnType:@[FlexibleNullability] T of .C.bar? [fake_override] + overridden: + public open fun bar (): @[FlexibleNullability] T of .Java3.bar? declared in .Java3 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + 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 declared in .Java3 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> (t:@[FlexibleNullability] kotlin.Number?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] kotlin.Number?): kotlin.Unit declared in .Java3 + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] kotlin.Number? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> (t:@[FlexibleNullability] kotlin.Number?, t2:@[FlexibleNullability] kotlin.Int?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] kotlin.Number?, t2: @[FlexibleNullability] kotlin.Int?): kotlin.Unit declared in .Java3 + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] kotlin.Number? + VALUE_PARAMETER name:t2 index:1 type:@[FlexibleNullability] kotlin.Int? + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN (t:@[FlexibleNullability] T of .C.foo?) returnType:kotlin.Unit [fake_override] + overridden: + public open fun foo (t: @[FlexibleNullability] T of .Java3.foo?): kotlin.Unit declared in .Java3 + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[FlexibleNullability] kotlin.Any?] reified:false + VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of .C.foo? + 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 .Java3 + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:test1 visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Unit [fake_override] + overridden: + public open fun test1 (): kotlin.Unit declared in .Java3 + $this: VALUE_PARAMETER name: type:.A + FUN FAKE_OVERRIDE name:test2 visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Int [fake_override] + overridden: + public open fun test2 (): kotlin.Int declared in .Java3 + $this: VALUE_PARAMETER name: type:.A + FUN FAKE_OVERRIDE name:test3 visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Unit [fake_override] + overridden: + public open fun test3 (): kotlin.Unit declared in .Java3 + $this: VALUE_PARAMETER name: type:.A + FUN FAKE_OVERRIDE name:test4 visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Unit [fake_override] + overridden: + public open fun test4 (): kotlin.Unit declared in .Java3 + $this: VALUE_PARAMETER name: type:.A + 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 .Java3 + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> (a:.A, b:.B, c:.C) returnType:kotlin.Unit + VALUE_PARAMETER name:a index:0 type:.A + VALUE_PARAMETER name:b index:1 type:.B + VALUE_PARAMETER name:c index:2 type:.C + BLOCK_BODY + CALL 'public open fun test1 (): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR 'a: .A declared in .test' type=.A origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public open fun test2 (): kotlin.Int declared in .A' type=kotlin.Int origin=null + $this: GET_VAR 'a: .A declared in .test' type=.A origin=null + CALL 'public open fun test3 (): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR 'a: .A declared in .test' type=.A origin=null + CALL 'public open fun test4 (): kotlin.Unit declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR 'a: .A declared in .test' type=.A origin=null + CALL 'public final fun test1 (): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .B declared in .test' type=.B origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public final fun test2 (): kotlin.Int declared in .B' type=kotlin.Int origin=null + $this: GET_VAR 'b: .B declared in .test' type=.B origin=null + CALL 'public final fun test3 (): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .B declared in .test' type=.B origin=null + CALL 'public final fun test4 (): kotlin.Unit declared in .B' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .B declared in .test' type=.B origin=null + CALL 'public open fun test1 (): kotlin.Unit declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'c: .C declared in .test' type=.C origin=null + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public open fun test2 (): kotlin.Int declared in .C' type=kotlin.Int origin=null + $this: GET_VAR 'c: .C declared in .test' type=.C origin=null + CALL 'public open fun test3 (): kotlin.Unit declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'c: .C declared in .test' type=.C origin=null + CALL 'public open fun test4 (): kotlin.Unit declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR 'c: .C declared in .test' type=.C origin=null diff --git a/compiler/testData/ir/irText/fakeOverrides/javastatic/substitutionStaticOverride.kt b/compiler/testData/ir/irText/fakeOverrides/javastatic/substitutionStaticOverride.kt new file mode 100644 index 00000000000..638a4b71ea7 --- /dev/null +++ b/compiler/testData/ir/irText/fakeOverrides/javastatic/substitutionStaticOverride.kt @@ -0,0 +1,52 @@ +// FIR_IDENTICAL +// TARGET_BACKEND: JVM + +// FILE: Java1.java +public class Java1 { + public static void foo(T t) {} + public static T bar() { + return null; + } + public static void foo(Number t) {} + public static void foo(Number t, Integer t2) {} +} + +// FILE: Java2.java +public class Java2 extends Java1 { } + +// FILE: Java3.java +public class Java3 extends A { } + +// FILE: 1.kt + +open class A : Java1() { + open fun test1() = foo(1) + open fun test2(): Int = bar() + open fun test3() = foo("") + open fun test4() = foo(1, 1) +} + +class B: Java2() { // Kotlin ← Java1 ← Java2 + fun test1() = foo(1) + fun test2(): Int = bar() + fun test3() = foo("") + fun test4() = foo(1, 1) +} + +class C : Java3() //Kotlin ← Java ← Kotlin ← Java + + +fun test(a: A, b: B, c: C) { + a.test1() + a.test2() + a.test3() + a.test4() + b.test1() + b.test2() + b.test3() + b.test4() + c.test1() + c.test2() + c.test3() + c.test4() +} \ No newline at end of file diff --git a/compiler/testData/ir/irText/fakeOverrides/javastatic/substitutionStaticOverride.kt.txt b/compiler/testData/ir/irText/fakeOverrides/javastatic/substitutionStaticOverride.kt.txt new file mode 100644 index 00000000000..da17db9e27e --- /dev/null +++ b/compiler/testData/ir/irText/fakeOverrides/javastatic/substitutionStaticOverride.kt.txt @@ -0,0 +1,73 @@ +open class A : Java1 { + constructor() /* primary */ { + super/*Java1*/() + /* () */ + + } + + open fun test1() { + return foo(t = 1) + } + + open fun test2(): Int { + return bar<@FlexibleNullability Int?>() /*!! Int */ + } + + open fun test3() { + return foo<@FlexibleNullability String?>(t = "") + } + + open fun test4() { + return foo(t = 1, t2 = 1) + } + +} + +class B : Java2 { + constructor() /* primary */ { + super/*Java2*/() + /* () */ + + } + + fun test1() { + return foo(t = 1) + } + + fun test2(): Int { + return bar<@FlexibleNullability Int?>() /*!! Int */ + } + + fun test3() { + return foo<@FlexibleNullability String?>(t = "") + } + + fun test4() { + return foo(t = 1, t2 = 1) + } + +} + +class C : Java3 { + constructor() /* primary */ { + super/*Java3*/() + /* () */ + + } + +} + +fun test(a: A, b: B, c: C) { + a.test1() + a.test2() /*~> Unit */ + a.test3() + a.test4() + b.test1() + b.test2() /*~> Unit */ + b.test3() + b.test4() + c.test1() + c.test2() /*~> Unit */ + c.test3() + c.test4() +} diff --git a/compiler/testData/ir/irText/fakeOverrides/javastatic/substitutionStaticOverride.sig.kt.txt b/compiler/testData/ir/irText/fakeOverrides/javastatic/substitutionStaticOverride.sig.kt.txt new file mode 100644 index 00000000000..0a1c9b0c50d --- /dev/null +++ b/compiler/testData/ir/irText/fakeOverrides/javastatic/substitutionStaticOverride.sig.kt.txt @@ -0,0 +1,113 @@ +// CHECK: +// Mangled name: A +// Public signature: /A|null[0] +open class A : Java1 { + // CHECK: + // Mangled name: A#(){} + // Public signature: /A.|-5645683436151566731[0] + // Public signature debug description: (){} + constructor() /* primary */ + + // CHECK: + // Mangled name: A#test1(){} + // Public signature: /A.test1|4297044443957252634[0] + // Public signature debug description: test1(){} + open fun test1(): Unit + + // CHECK JVM_IR: + // Mangled name: A#test2(){}kotlin.Int + // Public signature: /A.test2|5542371834528279174[0] + // Public signature debug description: test2(){}kotlin.Int + open fun test2(): Int + + // CHECK: + // Mangled name: A#test3(){} + // Public signature: /A.test3|-3759735065270951803[0] + // Public signature debug description: test3(){} + open fun test3(): Unit + + // CHECK: + // Mangled name: A#test4(){} + // Public signature: /A.test4|5588455914500386239[0] + // Public signature debug description: test4(){} + open fun test4(): Unit + +} + +// CHECK: +// Mangled name: B +// Public signature: /B|null[0] +class B : Java2 { + // CHECK: + // Mangled name: B#(){} + // Public signature: /B.|-5645683436151566731[0] + // Public signature debug description: (){} + constructor() /* primary */ + + // CHECK: + // Mangled name: B#test1(){} + // Public signature: /B.test1|4297044443957252634[0] + // Public signature debug description: test1(){} + fun test1(): Unit + + // CHECK JVM_IR: + // Mangled name: B#test2(){}kotlin.Int + // Public signature: /B.test2|5542371834528279174[0] + // Public signature debug description: test2(){}kotlin.Int + fun test2(): Int + + // CHECK: + // Mangled name: B#test3(){} + // Public signature: /B.test3|-3759735065270951803[0] + // Public signature debug description: test3(){} + fun test3(): Unit + + // CHECK: + // Mangled name: B#test4(){} + // Public signature: /B.test4|5588455914500386239[0] + // Public signature debug description: test4(){} + fun test4(): Unit + +} + +// CHECK: +// Mangled name: C +// Public signature: /C|null[0] +class C : Java3 { + // CHECK: + // Mangled name: C#(){} + // Public signature: /C.|-5645683436151566731[0] + // Public signature debug description: (){} + constructor() /* primary */ + + // CHECK: + // Mangled name: C#test1(){} + // Public signature: /C.test1|4297044443957252634[0] + // Public signature debug description: test1(){} + /* fake */ override fun test1(): Unit + + // CHECK JVM_IR: + // Mangled name: C#test2(){}kotlin.Int + // Public signature: /C.test2|5542371834528279174[0] + // Public signature debug description: test2(){}kotlin.Int + /* fake */ override fun test2(): Int + + // CHECK: + // Mangled name: C#test3(){} + // Public signature: /C.test3|-3759735065270951803[0] + // Public signature debug description: test3(){} + /* fake */ override fun test3(): Unit + + // CHECK: + // Mangled name: C#test4(){} + // Public signature: /C.test4|5588455914500386239[0] + // Public signature debug description: test4(){} + /* fake */ override fun test4(): Unit + +} + +// CHECK: +// Mangled name: #test(A;B;C){} +// Public signature: /test|-4981009800298118531[0] +// Public signature debug description: test(A;B;C){} +fun test(a: A, b: B, c: C): Unit diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java index 3000d15beda..2ab2a72c700 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java @@ -3361,6 +3361,18 @@ public class ClassicJvmIrTextTestGenerated extends AbstractClassicJvmIrTextTest runTest("compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionOverrideOnStaticKJK.kt"); } + @Test + @TestMetadata("intersectionWithGenericOnComplexHierarchy.kt") + public void testIntersectionWithGenericOnComplexHierarchy() { + runTest("compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOnComplexHierarchy.kt"); + } + + @Test + @TestMetadata("intersectionWithGenericOverride.kt") + public void testIntersectionWithGenericOverride() { + runTest("compiler/testData/ir/irText/fakeOverrides/javastatic/intersectionWithGenericOverride.kt"); + } + @Test @TestMetadata("staticOverrideOnComplexHierarchy.kt") public void testStaticOverrideOnComplexHierarchy() { @@ -3390,6 +3402,12 @@ public class ClassicJvmIrTextTestGenerated extends AbstractClassicJvmIrTextTest public void testStaticOverrideOnKJKJ() { runTest("compiler/testData/ir/irText/fakeOverrides/javastatic/staticOverrideOnKJKJ.kt"); } + + @Test + @TestMetadata("substitutionStaticOverride.kt") + public void testSubstitutionStaticOverride() { + runTest("compiler/testData/ir/irText/fakeOverrides/javastatic/substitutionStaticOverride.kt"); + } } @Nested