[Test] KT-61360: add tests for the IrFakeOverrideBuilder

Add tests for fake overrides with focus on java interoperability

Co-authored-by: Aleksandra Arsenteva <aleksandra.arsenteva@jetbrains.com>
This commit is contained in:
anzhela.sukhanova
2024-01-19 18:22:17 +02:00
committed by Space Team
parent 30aae741a6
commit 82255d5ee8
853 changed files with 269404 additions and 0 deletions
@@ -0,0 +1,174 @@
FILE fqName:<root> fileName:/1.kt
CLASS CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A
CONSTRUCTOR visibility:public <> () returnType:<root>.A [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Any]'
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
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:<this> 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:<this> type:kotlin.Any
CLASS CLASS name:B modality:FINAL visibility:public superTypes:[<root>.Java1]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.B
CONSTRUCTOR visibility:public <> () returnType:<root>.B [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Java1'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[<root>.Java1]'
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 <root>.Java1
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
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 <root>.Java1
$this: VALUE_PARAMETER name:<this> 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 <root>.Java1
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:C modality:FINAL visibility:public superTypes:[<root>.Java2]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.C
CONSTRUCTOR visibility:public <> () returnType:<root>.C [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Java2'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[<root>.Java2]'
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 <root>.Java2
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
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 <root>.Java2
$this: VALUE_PARAMETER name:<this> 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 <root>.Java2
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:D modality:FINAL visibility:public superTypes:[<root>.Java2; <root>.Java3]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.D
CONSTRUCTOR visibility:public <> () returnType:<root>.D [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Java2'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:D modality:FINAL visibility:public superTypes:[<root>.Java2; <root>.Java3]'
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 <root>.Java2
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Java3
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
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 <root>.Java2
public open fun hashCode (): kotlin.Int declared in <root>.Java3
$this: VALUE_PARAMETER name:<this> 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 <root>.Java2
public open fun toString (): kotlin.String declared in <root>.Java3
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:E modality:FINAL visibility:public superTypes:[<root>.A; <root>.Java3]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.E
CONSTRUCTOR visibility:public <> () returnType:<root>.E [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.A'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:E modality:FINAL visibility:public superTypes:[<root>.A; <root>.Java3]'
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 <root>.A
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Java3
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
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 <root>.A
public open fun hashCode (): kotlin.Int declared in <root>.Java3
$this: VALUE_PARAMETER name:<this> 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 <root>.A
public open fun toString (): kotlin.String declared in <root>.Java3
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:foo visibility:public modality:FINAL <> ($receiver:<root>.A, a:kotlin.Int) returnType:kotlin.Unit
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
VALUE_PARAMETER name:a index:0 type:kotlin.Int
BLOCK_BODY
FUN name:foo visibility:public modality:FINAL <> ($receiver:<root>.Java2, a:kotlin.Int) returnType:kotlin.Unit
$receiver: VALUE_PARAMETER name:<this> type:<root>.Java2
VALUE_PARAMETER name:a index:0 type:kotlin.Int
BLOCK_BODY
FUN name:foo visibility:public modality:FINAL <> ($receiver:<root>.Java3, a:kotlin.Any) returnType:kotlin.Unit
$receiver: VALUE_PARAMETER name:<this> type:<root>.Java3
VALUE_PARAMETER name:a index:0 type:kotlin.Any
BLOCK_BODY
FUN name:test visibility:public modality:FINAL <> (b:<root>.B, c:<root>.C, d:<root>.D, e:<root>.E) returnType:kotlin.Unit
VALUE_PARAMETER name:b index:0 type:<root>.B
VALUE_PARAMETER name:c index:1 type:<root>.C
VALUE_PARAMETER name:d index:2 type:<root>.D
VALUE_PARAMETER name:e index:3 type:<root>.E
BLOCK_BODY
CALL 'public final fun <set-a> (value: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
$receiver: GET_VAR 'b: <root>.B declared in <root>.test' type=<root>.B origin=null
value: CONST Int type=kotlin.Int value=10
CALL 'public final fun foo (a: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
$receiver: GET_VAR 'b: <root>.B declared in <root>.test' type=<root>.B origin=null
a: CONST Int type=kotlin.Int value=1
CALL 'public final fun <set-a> (value: kotlin.String): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
$receiver: GET_VAR 'c: <root>.C declared in <root>.test' type=<root>.C origin=null
value: CONST String type=kotlin.String value="3"
CALL 'public final fun foo (a: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
$receiver: GET_VAR 'c: <root>.C declared in <root>.test' type=<root>.C origin=null
a: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (a: kotlin.Any): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
$receiver: GET_VAR 'd: <root>.D declared in <root>.test' type=<root>.D origin=null
a: CONST String type=kotlin.String value=""
CALL 'public final fun foo (a: kotlin.Any): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
$receiver: GET_VAR 'e: <root>.E declared in <root>.test' type=<root>.E origin=null
a: CONST String type=kotlin.String value=""
PROPERTY name:a visibility:public modality:FINAL [var]
FUN name:<get-a> visibility:public modality:FINAL <> ($receiver:<root>.A) returnType:kotlin.Int
correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [var]
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-a> (): kotlin.Int declared in <root>'
CONST Int type=kotlin.Int value=1
FUN name:<set-a> visibility:public modality:FINAL <> ($receiver:<root>.A, value:kotlin.Int) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [var]
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
VALUE_PARAMETER name:value index:0 type:kotlin.Int
BLOCK_BODY
PROPERTY name:a visibility:public modality:FINAL [var]
FUN name:<get-a> visibility:public modality:FINAL <> ($receiver:<root>.Java2) returnType:kotlin.String
correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [var]
$receiver: VALUE_PARAMETER name:<this> type:<root>.Java2
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-a> (): kotlin.String declared in <root>'
CONST String type=kotlin.String value="java2"
FUN name:<set-a> visibility:public modality:FINAL <> ($receiver:<root>.Java2, value:kotlin.String) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [var]
$receiver: VALUE_PARAMETER name:<this> type:<root>.Java2
VALUE_PARAMETER name:value index:0 type:kotlin.String
BLOCK_BODY
PROPERTY name:a visibility:public modality:FINAL [var]
FUN name:<get-a> visibility:public modality:FINAL <> ($receiver:<root>.Java3) returnType:kotlin.String
correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [var]
$receiver: VALUE_PARAMETER name:<this> type:<root>.Java3
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-a> (): kotlin.String declared in <root>'
CONST String type=kotlin.String value="java3"
FUN name:<set-a> visibility:public modality:FINAL <> ($receiver:<root>.Java3, value:kotlin.String) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [var]
$receiver: VALUE_PARAMETER name:<this> type:<root>.Java3
VALUE_PARAMETER name:value index:0 type:kotlin.String
BLOCK_BODY
@@ -0,0 +1,51 @@
// FIR_IDENTICAL
// TARGET_BACKEND: JVM
// FILE: Java1.java
public class Java1 extends A { }
// FILE: Java2.java
public class Java2 { }
// FILE: Java3.java
public interface Java3 { }
// FILE: 1.kt
open class A
fun A.foo(a: Int) {}
var A.a: Int
get() = 1
set(value) {}
class B : Java1() //Kotlin ← Java ← Kotlin with kotlin receiver
fun Java2.foo(a: Int) {}
var Java2.a: String
get() = "java2"
set(value) {}
class C : Java2() //Kotlin ← Java with java receiver
fun Java3.foo(a: Any) {}
var Java3.a: String
get() = "java3"
set(value) {}
class D : Java2(), Java3 //Kotlin ← Java1, Java2 with java receivers
class E : A(), Java3 //Kotlin ← Java, Kotlin2
fun test(b: B, c: C, d: D, e: E){
b.a = 10
b.foo(1)
c.a = "3"
c.foo(1)
d.foo("")
e.foo("")
}
@@ -0,0 +1,83 @@
open class A {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
class B : Java1 {
constructor() /* primary */ {
super/*Java1*/()
/* <init>() */
}
}
class C : Java2 {
constructor() /* primary */ {
super/*Java2*/()
/* <init>() */
}
}
class D : Java2, Java3 {
constructor() /* primary */ {
super/*Java2*/()
/* <init>() */
}
}
class E : A, Java3 {
constructor() /* primary */ {
super/*A*/()
/* <init>() */
}
}
fun A.foo(a: Int) {
}
fun Java2.foo(a: Int) {
}
fun Java3.foo(a: Any) {
}
fun test(b: B, c: C, d: D, e: E) {
b.<set-a>(value = 10)
b.foo(a = 1)
c.<set-a>(value = "3")
c.foo(a = 1)
d.foo(a = "")
e.foo(a = "")
}
var A.a: Int
get(): Int {
return 1
}
set(value: Int) {
}
var Java2.a: String
get(): String {
return "java2"
}
set(value: String) {
}
var Java3.a: String
get(): String {
return "java3"
}
set(value: String) {
}
@@ -0,0 +1,131 @@
// CHECK:
// Mangled name: A
// Public signature: /A|null[0]
open class A {
// CHECK:
// Mangled name: A#<init>(){}
// Public signature: /A.<init>|-5645683436151566731[0]
// Public signature debug description: <init>(){}
constructor() /* primary */
}
// CHECK:
// Mangled name: B
// Public signature: /B|null[0]
class B : Java1 {
// CHECK:
// Mangled name: B#<init>(){}
// Public signature: /B.<init>|-5645683436151566731[0]
// Public signature debug description: <init>(){}
constructor() /* primary */
}
// CHECK:
// Mangled name: C
// Public signature: /C|null[0]
class C : Java2 {
// CHECK:
// Mangled name: C#<init>(){}
// Public signature: /C.<init>|-5645683436151566731[0]
// Public signature debug description: <init>(){}
constructor() /* primary */
}
// CHECK:
// Mangled name: D
// Public signature: /D|null[0]
class D : Java2, Java3 {
// CHECK:
// Mangled name: D#<init>(){}
// Public signature: /D.<init>|-5645683436151566731[0]
// Public signature debug description: <init>(){}
constructor() /* primary */
}
// CHECK:
// Mangled name: E
// Public signature: /E|null[0]
class E : A, Java3 {
// CHECK:
// Mangled name: E#<init>(){}
// Public signature: /E.<init>|-5645683436151566731[0]
// Public signature debug description: <init>(){}
constructor() /* primary */
}
// CHECK:
// Mangled name: #foo@A(kotlin.Int){}
// Public signature: /foo|-6186268904683510789[0]
// Public signature debug description: foo@A(kotlin.Int){}
fun A.foo(a: Int): Unit
// CHECK:
// Mangled name: #foo@Java2(kotlin.Int){}
// Public signature: /foo|-7830593942430915020[0]
// Public signature debug description: foo@Java2(kotlin.Int){}
fun Java2.foo(a: Int): Unit
// CHECK:
// Mangled name: #foo@Java3(kotlin.Any){}
// Public signature: /foo|1460465834488203451[0]
// Public signature debug description: foo@Java3(kotlin.Any){}
fun Java3.foo(a: Any): Unit
// CHECK:
// Mangled name: #test(B;C;D;E){}
// Public signature: /test|-2264777070922935105[0]
// Public signature debug description: test(B;C;D;E){}
fun test(b: B, c: C, d: D, e: E): Unit
// CHECK:
// Mangled name: @A{}a
// Public signature: /a|-112912227296012367[0]
// Public signature debug description: @A{}a
var A.a: Int
// CHECK JVM_IR:
// Mangled name: #<get-a>@A(){}kotlin.Int
// Public signature: /a.<get-a>|-5182152274603237009[0]
// Public signature debug description: <get-a>@A(){}kotlin.Int
get(): Int
// CHECK:
// Mangled name: #<set-a>@A(kotlin.Int){}
// Public signature: /a.<set-a>|6195122733392538441[0]
// Public signature debug description: <set-a>@A(kotlin.Int){}
set(value: Int): Unit
// CHECK:
// Mangled name: @Java2{}a
// Public signature: /a|6282677371177159489[0]
// Public signature debug description: @Java2{}a
var Java2.a: String
// CHECK JVM_IR:
// Mangled name: #<get-a>@Java2(){}kotlin.String
// Public signature: /a.<get-a>|6032259885091372080[0]
// Public signature debug description: <get-a>@Java2(){}kotlin.String
get(): String
// CHECK:
// Mangled name: #<set-a>@Java2(kotlin.String){}
// Public signature: /a.<set-a>|-9081416691016033755[0]
// Public signature debug description: <set-a>@Java2(kotlin.String){}
set(value: String): Unit
// CHECK:
// Mangled name: @Java3{}a
// Public signature: /a|-2751463959158715061[0]
// Public signature debug description: @Java3{}a
var Java3.a: String
// CHECK JVM_IR:
// Mangled name: #<get-a>@Java3(){}kotlin.String
// Public signature: /a.<get-a>|9187131099263723507[0]
// Public signature debug description: <get-a>@Java3(){}kotlin.String
get(): String
// CHECK:
// Mangled name: #<set-a>@Java3(kotlin.String){}
// Public signature: /a.<set-a>|8472946520744369884[0]
// Public signature debug description: <set-a>@Java3(kotlin.String){}
set(value: String): Unit
@@ -0,0 +1,232 @@
FILE fqName:<root> fileName:/1.kt
CLASS CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A
CONSTRUCTOR visibility:public <> () returnType:<root>.A [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Any]'
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
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:<this> 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:<this> type:kotlin.Any
FUN name:bar visibility:public modality:OPEN <> ($this:<root>.A, $receiver:<root>.Java2, a:kotlin.Int) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.A
$receiver: VALUE_PARAMETER name:<this> type:<root>.Java2
VALUE_PARAMETER name:a index:0 type:kotlin.Int
BLOCK_BODY
FUN name:foo visibility:public modality:OPEN <> ($this:<root>.A, $receiver:<root>.A, a:kotlin.Int) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.A
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
VALUE_PARAMETER name:a index:0 type:kotlin.Int
BLOCK_BODY
PROPERTY name:a visibility:public modality:OPEN [var]
FUN name:<get-a> visibility:public modality:OPEN <> ($this:<root>.A, $receiver:<root>.A) returnType:kotlin.Int
correspondingProperty: PROPERTY name:a visibility:public modality:OPEN [var]
$this: VALUE_PARAMETER name:<this> type:<root>.A
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun <get-a> (): kotlin.Int declared in <root>.A'
CONST Int type=kotlin.Int value=1
FUN name:<set-a> visibility:public modality:OPEN <> ($this:<root>.A, $receiver:<root>.A, value:kotlin.Int) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:a visibility:public modality:OPEN [var]
$this: VALUE_PARAMETER name:<this> type:<root>.A
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
VALUE_PARAMETER name:value index:0 type:kotlin.Int
BLOCK_BODY
PROPERTY name:b visibility:public modality:OPEN [var]
FUN name:<get-b> visibility:public modality:OPEN <> ($this:<root>.A, $receiver:<root>.Java2) returnType:kotlin.String
correspondingProperty: PROPERTY name:b visibility:public modality:OPEN [var]
$this: VALUE_PARAMETER name:<this> type:<root>.A
$receiver: VALUE_PARAMETER name:<this> type:<root>.Java2
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun <get-b> (): kotlin.String declared in <root>.A'
CONST String type=kotlin.String value="java2"
FUN name:<set-b> visibility:public modality:OPEN <> ($this:<root>.A, $receiver:<root>.Java2, value:kotlin.String) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:b visibility:public modality:OPEN [var]
$this: VALUE_PARAMETER name:<this> type:<root>.A
$receiver: VALUE_PARAMETER name:<this> type:<root>.Java2
VALUE_PARAMETER name:value index:0 type:kotlin.String
BLOCK_BODY
CLASS CLASS name:B modality:FINAL visibility:public superTypes:[<root>.Java1]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.B
CONSTRUCTOR visibility:public <> () returnType:<root>.B [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Java1'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[<root>.Java1]'
FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN <> ($this:<root>.A, $receiver:<root>.Java2, a:kotlin.Int) returnType:kotlin.Unit [fake_override]
overridden:
public open fun bar (a: kotlin.Int): kotlin.Unit declared in <root>.Java1
$this: VALUE_PARAMETER name:<this> type:<root>.A
$receiver: VALUE_PARAMETER name:<this> type:<root>.Java2
VALUE_PARAMETER name:a index:0 type:kotlin.Int
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 <root>.Java1
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:<root>.A, $receiver:<root>.A, a:kotlin.Int) returnType:kotlin.Unit [fake_override]
overridden:
public open fun foo (a: kotlin.Int): kotlin.Unit declared in <root>.Java1
$this: VALUE_PARAMETER name:<this> type:<root>.A
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
VALUE_PARAMETER name:a index:0 type:kotlin.Int
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 <root>.Java1
$this: VALUE_PARAMETER name:<this> 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 <root>.Java1
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:test visibility:public modality:FINAL <> ($this:<root>.B) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.B
BLOCK_BODY
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
CALL 'public open fun <get-a> (): kotlin.Int declared in <root>.B' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.B declared in <root>.B.test' type=<root>.B origin=null
$receiver: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.A' type=<root>.A origin=null
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
CALL 'public open fun <get-b> (): kotlin.String declared in <root>.B' type=kotlin.String origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.B declared in <root>.B.test' type=<root>.B origin=null
$receiver: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Java2' type=<root>.Java2 origin=null
CALL 'public open fun foo (a: kotlin.Int): kotlin.Unit declared in <root>.B' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.B declared in <root>.B.test' type=<root>.B origin=null
$receiver: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.A' type=<root>.A origin=null
a: CONST Int type=kotlin.Int value=1
CALL 'public open fun bar (a: kotlin.Int): kotlin.Unit declared in <root>.B' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.B declared in <root>.B.test' type=<root>.B origin=null
$receiver: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Java2' type=<root>.Java2 origin=null
a: CONST Int type=kotlin.Int value=1
PROPERTY FAKE_OVERRIDE name:a visibility:public modality:OPEN [fake_override,var]
overridden:
public open a: kotlin.Int
FUN FAKE_OVERRIDE name:<get-a> visibility:public modality:OPEN <> ($this:<root>.Java1, $receiver:<root>.A) returnType:kotlin.Int [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:a visibility:public modality:OPEN [fake_override,var]
overridden:
public open fun <get-a> (): kotlin.Int declared in <root>.Java1
$this: VALUE_PARAMETER name:<this> type:<root>.Java1
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
FUN FAKE_OVERRIDE name:<set-a> visibility:public modality:OPEN <> ($this:<root>.Java1, $receiver:<root>.A, <set-?>:kotlin.Int) returnType:kotlin.Unit [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:a visibility:public modality:OPEN [fake_override,var]
overridden:
public open fun <set-a> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.Java1
$this: VALUE_PARAMETER name:<this> type:<root>.Java1
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.Int
PROPERTY FAKE_OVERRIDE name:b visibility:public modality:OPEN [fake_override,var]
overridden:
public open b: kotlin.String
FUN FAKE_OVERRIDE name:<get-b> visibility:public modality:OPEN <> ($this:<root>.Java1, $receiver:<root>.Java2) returnType:kotlin.String [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:b visibility:public modality:OPEN [fake_override,var]
overridden:
public open fun <get-b> (): kotlin.String declared in <root>.Java1
$this: VALUE_PARAMETER name:<this> type:<root>.Java1
$receiver: VALUE_PARAMETER name:<this> type:<root>.Java2
FUN FAKE_OVERRIDE name:<set-b> visibility:public modality:OPEN <> ($this:<root>.Java1, $receiver:<root>.Java2, <set-?>:kotlin.String) returnType:kotlin.Unit [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:b visibility:public modality:OPEN [fake_override,var]
overridden:
public open fun <set-b> (<set-?>: kotlin.String): kotlin.Unit declared in <root>.Java1
$this: VALUE_PARAMETER name:<this> type:<root>.Java1
$receiver: VALUE_PARAMETER name:<this> type:<root>.Java2
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.String
CLASS CLASS name:C modality:FINAL visibility:public superTypes:[<root>.Java1]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.C
CONSTRUCTOR visibility:public <> () returnType:<root>.C [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Java1'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[<root>.Java1]'
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 <root>.Java1
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
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 <root>.Java1
$this: VALUE_PARAMETER name:<this> 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 <root>.Java1
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:bar visibility:public modality:OPEN <> ($this:<root>.C, $receiver:<root>.Java2, a:kotlin.Int) returnType:kotlin.Unit
overridden:
public open fun bar (a: kotlin.Int): kotlin.Unit declared in <root>.Java1
$this: VALUE_PARAMETER name:<this> type:<root>.C
$receiver: VALUE_PARAMETER name:<this> type:<root>.Java2
VALUE_PARAMETER name:a index:0 type:kotlin.Int
BLOCK_BODY
FUN name:foo visibility:public modality:OPEN <> ($this:<root>.C, $receiver:<root>.A, a:kotlin.Int) returnType:kotlin.Unit
overridden:
public open fun foo (a: kotlin.Int): kotlin.Unit declared in <root>.Java1
$this: VALUE_PARAMETER name:<this> type:<root>.C
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
VALUE_PARAMETER name:a index:0 type:kotlin.Int
BLOCK_BODY
FUN name:test visibility:public modality:FINAL <> ($this:<root>.C) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.C
BLOCK_BODY
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
CALL 'public open fun <get-a> (): kotlin.Int declared in <root>.C' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.C declared in <root>.C.test' type=<root>.C origin=null
$receiver: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.A' type=<root>.A origin=null
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
CALL 'public open fun <get-b> (): kotlin.String declared in <root>.C' type=kotlin.String origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.C declared in <root>.C.test' type=<root>.C origin=null
$receiver: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Java2' type=<root>.Java2 origin=null
CALL 'public open fun foo (a: kotlin.Int): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.C declared in <root>.C.test' type=<root>.C origin=null
$receiver: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.A' type=<root>.A origin=null
a: CONST Int type=kotlin.Int value=1
CALL 'public open fun bar (a: kotlin.Int): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.C declared in <root>.C.test' type=<root>.C origin=null
$receiver: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Java2' type=<root>.Java2 origin=null
a: CONST Int type=kotlin.Int value=1
PROPERTY name:a visibility:public modality:OPEN [var]
overridden:
public open a: kotlin.Int
FUN name:<get-a> visibility:public modality:OPEN <> ($this:<root>.C, $receiver:<root>.A) returnType:kotlin.Int
correspondingProperty: PROPERTY name:a visibility:public modality:OPEN [var]
overridden:
public open fun <get-a> (): kotlin.Int declared in <root>.Java1
$this: VALUE_PARAMETER name:<this> type:<root>.C
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun <get-a> (): kotlin.Int declared in <root>.C'
CONST Int type=kotlin.Int value=2
FUN name:<set-a> visibility:public modality:OPEN <> ($this:<root>.C, $receiver:<root>.A, value:kotlin.Int) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:a visibility:public modality:OPEN [var]
overridden:
public open fun <set-a> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.Java1
$this: VALUE_PARAMETER name:<this> type:<root>.C
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
VALUE_PARAMETER name:value index:0 type:kotlin.Int
BLOCK_BODY
PROPERTY name:b visibility:public modality:OPEN [var]
overridden:
public open b: kotlin.String
FUN name:<get-b> visibility:public modality:OPEN <> ($this:<root>.C, $receiver:<root>.Java2) returnType:kotlin.String
correspondingProperty: PROPERTY name:b visibility:public modality:OPEN [var]
overridden:
public open fun <get-b> (): kotlin.String declared in <root>.Java1
$this: VALUE_PARAMETER name:<this> type:<root>.C
$receiver: VALUE_PARAMETER name:<this> type:<root>.Java2
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun <get-b> (): kotlin.String declared in <root>.C'
CONST String type=kotlin.String value="C.java2"
FUN name:<set-b> visibility:public modality:OPEN <> ($this:<root>.C, $receiver:<root>.Java2, value:kotlin.String) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:b visibility:public modality:OPEN [var]
overridden:
public open fun <set-b> (<set-?>: kotlin.String): kotlin.Unit declared in <root>.Java1
$this: VALUE_PARAMETER name:<this> type:<root>.C
$receiver: VALUE_PARAMETER name:<this> type:<root>.Java2
VALUE_PARAMETER name:value index:0 type:kotlin.String
BLOCK_BODY
@@ -0,0 +1,80 @@
open class A {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
open fun Java2.bar(a: Int) {
}
open fun A.foo(a: Int) {
}
open var A.a: Int
open get(): Int {
return 1
}
open set(value: Int) {
}
open var Java2.b: String
open get(): String {
return "java2"
}
open set(value: String) {
}
}
class B : Java1 {
constructor() /* primary */ {
super/*Java1*/()
/* <init>() */
}
fun test() {
(<this>, A()).<get-a>() /*~> Unit */
(<this>, Java2()).<get-b>() /*~> Unit */
(<this>, A()).foo(a = 1)
(<this>, Java2()).bar(a = 1)
}
}
class C : Java1 {
constructor() /* primary */ {
super/*Java1*/()
/* <init>() */
}
override fun Java2.bar(a: Int) {
}
override fun A.foo(a: Int) {
}
fun test() {
(<this>, A()).<get-a>() /*~> Unit */
(<this>, Java2()).<get-b>() /*~> Unit */
(<this>, A()).foo(a = 1)
(<this>, Java2()).bar(a = 1)
}
override var A.a: Int
override get(): Int {
return 2
}
override set(value: Int) {
}
override var Java2.b: String
override get(): String {
return "C.java2"
}
override set(value: String) {
}
}
@@ -0,0 +1,232 @@
FILE fqName:<root> fileName:/1.kt
CLASS CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A
CONSTRUCTOR visibility:public <> () returnType:<root>.A [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Any]'
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
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:<this> 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:<this> type:kotlin.Any
FUN name:bar visibility:public modality:OPEN <> ($this:<root>.A, $receiver:<root>.Java2, a:kotlin.Int) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.A
$receiver: VALUE_PARAMETER name:<this> type:<root>.Java2
VALUE_PARAMETER name:a index:0 type:kotlin.Int
BLOCK_BODY
FUN name:foo visibility:public modality:OPEN <> ($this:<root>.A, $receiver:<root>.A, a:kotlin.Int) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.A
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
VALUE_PARAMETER name:a index:0 type:kotlin.Int
BLOCK_BODY
PROPERTY name:a visibility:public modality:OPEN [var]
FUN name:<get-a> visibility:public modality:OPEN <> ($this:<root>.A, $receiver:<root>.A) returnType:kotlin.Int
correspondingProperty: PROPERTY name:a visibility:public modality:OPEN [var]
$this: VALUE_PARAMETER name:<this> type:<root>.A
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun <get-a> (): kotlin.Int declared in <root>.A'
CONST Int type=kotlin.Int value=1
FUN name:<set-a> visibility:public modality:OPEN <> ($this:<root>.A, $receiver:<root>.A, value:kotlin.Int) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:a visibility:public modality:OPEN [var]
$this: VALUE_PARAMETER name:<this> type:<root>.A
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
VALUE_PARAMETER name:value index:0 type:kotlin.Int
BLOCK_BODY
PROPERTY name:b visibility:public modality:OPEN [var]
FUN name:<get-b> visibility:public modality:OPEN <> ($this:<root>.A, $receiver:<root>.Java2) returnType:kotlin.String
correspondingProperty: PROPERTY name:b visibility:public modality:OPEN [var]
$this: VALUE_PARAMETER name:<this> type:<root>.A
$receiver: VALUE_PARAMETER name:<this> type:<root>.Java2
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun <get-b> (): kotlin.String declared in <root>.A'
CONST String type=kotlin.String value="java2"
FUN name:<set-b> visibility:public modality:OPEN <> ($this:<root>.A, $receiver:<root>.Java2, value:kotlin.String) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:b visibility:public modality:OPEN [var]
$this: VALUE_PARAMETER name:<this> type:<root>.A
$receiver: VALUE_PARAMETER name:<this> type:<root>.Java2
VALUE_PARAMETER name:value index:0 type:kotlin.String
BLOCK_BODY
CLASS CLASS name:B modality:FINAL visibility:public superTypes:[<root>.Java1]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.B
CONSTRUCTOR visibility:public <> () returnType:<root>.B [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Java1'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[<root>.Java1]'
FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN <> ($this:<root>.A, $receiver:<root>.Java2, a:kotlin.Int) returnType:kotlin.Unit [fake_override]
overridden:
public open fun bar (a: kotlin.Int): kotlin.Unit declared in <root>.Java1
$this: VALUE_PARAMETER name:<this> type:<root>.A
$receiver: VALUE_PARAMETER name:<this> type:<root>.Java2
VALUE_PARAMETER name:a index:0 type:kotlin.Int
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 <root>.Java1
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:<root>.A, $receiver:<root>.A, a:kotlin.Int) returnType:kotlin.Unit [fake_override]
overridden:
public open fun foo (a: kotlin.Int): kotlin.Unit declared in <root>.Java1
$this: VALUE_PARAMETER name:<this> type:<root>.A
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
VALUE_PARAMETER name:a index:0 type:kotlin.Int
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 <root>.Java1
$this: VALUE_PARAMETER name:<this> 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 <root>.Java1
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:test visibility:public modality:FINAL <> ($this:<root>.B) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.B
BLOCK_BODY
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
CALL 'public open fun <get-a> (): kotlin.Int declared in <root>.B' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.B declared in <root>.B.test' type=<root>.B origin=null
$receiver: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.A' type=<root>.A origin=null
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
CALL 'public open fun <get-b> (): kotlin.String declared in <root>.B' type=kotlin.String origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.B declared in <root>.B.test' type=<root>.B origin=null
$receiver: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Java2' type=<root>.Java2 origin=null
CALL 'public open fun foo (a: kotlin.Int): kotlin.Unit declared in <root>.B' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.B declared in <root>.B.test' type=<root>.B origin=null
$receiver: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.A' type=<root>.A origin=null
a: CONST Int type=kotlin.Int value=1
CALL 'public open fun bar (a: kotlin.Int): kotlin.Unit declared in <root>.B' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.B declared in <root>.B.test' type=<root>.B origin=null
$receiver: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Java2' type=<root>.Java2 origin=null
a: CONST Int type=kotlin.Int value=1
PROPERTY FAKE_OVERRIDE name:a visibility:public modality:OPEN [fake_override,var]
overridden:
public open a: kotlin.Int
FUN FAKE_OVERRIDE name:<get-a> visibility:public modality:OPEN <> ($this:<root>.A, $receiver:<root>.A) returnType:kotlin.Int [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:a visibility:public modality:OPEN [fake_override,var]
overridden:
public open fun <get-a> (): kotlin.Int declared in <root>.Java1
$this: VALUE_PARAMETER name:<this> type:<root>.A
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
FUN FAKE_OVERRIDE name:<set-a> visibility:public modality:OPEN <> ($this:<root>.A, $receiver:<root>.A, value:kotlin.Int) returnType:kotlin.Unit [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:a visibility:public modality:OPEN [fake_override,var]
overridden:
public open fun <set-a> (value: kotlin.Int): kotlin.Unit declared in <root>.Java1
$this: VALUE_PARAMETER name:<this> type:<root>.A
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
VALUE_PARAMETER name:value index:0 type:kotlin.Int
PROPERTY FAKE_OVERRIDE name:b visibility:public modality:OPEN [fake_override,var]
overridden:
public open b: kotlin.String
FUN FAKE_OVERRIDE name:<get-b> visibility:public modality:OPEN <> ($this:<root>.A, $receiver:<root>.Java2) returnType:kotlin.String [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:b visibility:public modality:OPEN [fake_override,var]
overridden:
public open fun <get-b> (): kotlin.String declared in <root>.Java1
$this: VALUE_PARAMETER name:<this> type:<root>.A
$receiver: VALUE_PARAMETER name:<this> type:<root>.Java2
FUN FAKE_OVERRIDE name:<set-b> visibility:public modality:OPEN <> ($this:<root>.A, $receiver:<root>.Java2, value:kotlin.String) returnType:kotlin.Unit [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:b visibility:public modality:OPEN [fake_override,var]
overridden:
public open fun <set-b> (value: kotlin.String): kotlin.Unit declared in <root>.Java1
$this: VALUE_PARAMETER name:<this> type:<root>.A
$receiver: VALUE_PARAMETER name:<this> type:<root>.Java2
VALUE_PARAMETER name:value index:0 type:kotlin.String
CLASS CLASS name:C modality:FINAL visibility:public superTypes:[<root>.Java1]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.C
CONSTRUCTOR visibility:public <> () returnType:<root>.C [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Java1'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[<root>.Java1]'
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 <root>.Java1
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
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 <root>.Java1
$this: VALUE_PARAMETER name:<this> 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 <root>.Java1
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:bar visibility:public modality:OPEN <> ($this:<root>.C, $receiver:<root>.Java2, a:kotlin.Int) returnType:kotlin.Unit
overridden:
public open fun bar (a: kotlin.Int): kotlin.Unit declared in <root>.Java1
$this: VALUE_PARAMETER name:<this> type:<root>.C
$receiver: VALUE_PARAMETER name:<this> type:<root>.Java2
VALUE_PARAMETER name:a index:0 type:kotlin.Int
BLOCK_BODY
FUN name:foo visibility:public modality:OPEN <> ($this:<root>.C, $receiver:<root>.A, a:kotlin.Int) returnType:kotlin.Unit
overridden:
public open fun foo (a: kotlin.Int): kotlin.Unit declared in <root>.Java1
$this: VALUE_PARAMETER name:<this> type:<root>.C
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
VALUE_PARAMETER name:a index:0 type:kotlin.Int
BLOCK_BODY
FUN name:test visibility:public modality:FINAL <> ($this:<root>.C) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.C
BLOCK_BODY
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
CALL 'public open fun <get-a> (): kotlin.Int declared in <root>.C' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.C declared in <root>.C.test' type=<root>.C origin=null
$receiver: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.A' type=<root>.A origin=null
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
CALL 'public open fun <get-b> (): kotlin.String declared in <root>.C' type=kotlin.String origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.C declared in <root>.C.test' type=<root>.C origin=null
$receiver: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Java2' type=<root>.Java2 origin=null
CALL 'public open fun foo (a: kotlin.Int): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.C declared in <root>.C.test' type=<root>.C origin=null
$receiver: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.A' type=<root>.A origin=null
a: CONST Int type=kotlin.Int value=1
CALL 'public open fun bar (a: kotlin.Int): kotlin.Unit declared in <root>.C' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.C declared in <root>.C.test' type=<root>.C origin=null
$receiver: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Java2' type=<root>.Java2 origin=null
a: CONST Int type=kotlin.Int value=1
PROPERTY name:a visibility:public modality:OPEN [var]
overridden:
public open a: kotlin.Int
FUN name:<get-a> visibility:public modality:OPEN <> ($this:<root>.C, $receiver:<root>.A) returnType:kotlin.Int
correspondingProperty: PROPERTY name:a visibility:public modality:OPEN [var]
overridden:
public open fun <get-a> (): kotlin.Int declared in <root>.Java1
$this: VALUE_PARAMETER name:<this> type:<root>.C
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun <get-a> (): kotlin.Int declared in <root>.C'
CONST Int type=kotlin.Int value=2
FUN name:<set-a> visibility:public modality:OPEN <> ($this:<root>.C, $receiver:<root>.A, value:kotlin.Int) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:a visibility:public modality:OPEN [var]
overridden:
public open fun <set-a> (value: kotlin.Int): kotlin.Unit declared in <root>.Java1
$this: VALUE_PARAMETER name:<this> type:<root>.C
$receiver: VALUE_PARAMETER name:<this> type:<root>.A
VALUE_PARAMETER name:value index:0 type:kotlin.Int
BLOCK_BODY
PROPERTY name:b visibility:public modality:OPEN [var]
overridden:
public open b: kotlin.String
FUN name:<get-b> visibility:public modality:OPEN <> ($this:<root>.C, $receiver:<root>.Java2) returnType:kotlin.String
correspondingProperty: PROPERTY name:b visibility:public modality:OPEN [var]
overridden:
public open fun <get-b> (): kotlin.String declared in <root>.Java1
$this: VALUE_PARAMETER name:<this> type:<root>.C
$receiver: VALUE_PARAMETER name:<this> type:<root>.Java2
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun <get-b> (): kotlin.String declared in <root>.C'
CONST String type=kotlin.String value="C.java2"
FUN name:<set-b> visibility:public modality:OPEN <> ($this:<root>.C, $receiver:<root>.Java2, value:kotlin.String) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:b visibility:public modality:OPEN [var]
overridden:
public open fun <set-b> (value: kotlin.String): kotlin.Unit declared in <root>.Java1
$this: VALUE_PARAMETER name:<this> type:<root>.C
$receiver: VALUE_PARAMETER name:<this> type:<root>.Java2
VALUE_PARAMETER name:value index:0 type:kotlin.String
BLOCK_BODY
@@ -0,0 +1,49 @@
// TARGET_BACKEND: JVM
// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR
// FILE: Java1.java
public class Java1 extends A { }
// FILE: Java2.java
public class Java2 { }
// FILE: 1.kt
open class A {
open fun A.foo(a: Int) {}
open var A.a: Int
get() = 1
set(value) {}
open fun Java2.bar(a: Int) {}
open var Java2.b: String
get() = "java2"
set(value) {}
}
class B : Java1() { //Kotlin ← Java ← Kotlin
fun test() {
A().a
Java2().b
A().foo(1)
Java2().bar(1)
}
}
class C: Java1() {
override var A.a: Int
get() = 2
set(value) {}
override var Java2.b: String
get() = "C.java2"
set(value) {}
override fun A.foo(a: Int) { }
override fun Java2.bar(a: Int) { }
fun test() {
A().a
Java2().b
A().foo(1)
Java2().bar(1)
}
}
@@ -0,0 +1,80 @@
open class A {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
open fun Java2.bar(a: Int) {
}
open fun A.foo(a: Int) {
}
open var A.a: Int
open get(): Int {
return 1
}
open set(value: Int) {
}
open var Java2.b: String
open get(): String {
return "java2"
}
open set(value: String) {
}
}
class B : Java1 {
constructor() /* primary */ {
super/*Java1*/()
/* <init>() */
}
fun test() {
(<this>, A()).<get-a>() /*~> Unit */
(<this>, Java2()).<get-b>() /*~> Unit */
(<this>, A()).foo(a = 1)
(<this>, Java2()).bar(a = 1)
}
}
class C : Java1 {
constructor() /* primary */ {
super/*Java1*/()
/* <init>() */
}
override fun Java2.bar(a: Int) {
}
override fun A.foo(a: Int) {
}
fun test() {
(<this>, A()).<get-a>() /*~> Unit */
(<this>, Java2()).<get-b>() /*~> Unit */
(<this>, A()).foo(a = 1)
(<this>, Java2()).bar(a = 1)
}
override var A.a: Int
override get(): Int {
return 2
}
override set(value: Int) {
}
override var Java2.b: String
override get(): String {
return "C.java2"
}
override set(value: String) {
}
}
@@ -0,0 +1,179 @@
// CHECK:
// Mangled name: A
// Public signature: /A|null[0]
open class A {
// CHECK:
// Mangled name: A#<init>(){}
// Public signature: /A.<init>|-5645683436151566731[0]
// Public signature debug description: <init>(){}
constructor() /* primary */
// CHECK:
// Mangled name: A#bar@Java2(kotlin.Int){}
// Public signature: /A.bar|-4052098631143945129[0]
// Public signature debug description: bar@Java2(kotlin.Int){}
open fun Java2.bar(a: Int): Unit
// CHECK:
// Mangled name: A#foo@A(kotlin.Int){}
// Public signature: /A.foo|-6186268904683510789[0]
// Public signature debug description: foo@A(kotlin.Int){}
open fun A.foo(a: Int): Unit
// CHECK:
// Mangled name: A@A{}a
// Public signature: /A.a|-112912227296012367[0]
// Public signature debug description: @A{}a
open var A.a: Int
// CHECK JVM_IR:
// Mangled name: A#<get-a>@A(){}kotlin.Int
// Public signature: /A.a.<get-a>|-5182152274603237009[0]
// Public signature debug description: <get-a>@A(){}kotlin.Int
open get(): Int
// CHECK:
// Mangled name: A#<set-a>@A(kotlin.Int){}
// Public signature: /A.a.<set-a>|6195122733392538441[0]
// Public signature debug description: <set-a>@A(kotlin.Int){}
open set(value: Int): Unit
// CHECK:
// Mangled name: A@Java2{}b
// Public signature: /A.b|2371064665038281993[0]
// Public signature debug description: @Java2{}b
open var Java2.b: String
// CHECK JVM_IR:
// Mangled name: A#<get-b>@Java2(){}kotlin.String
// Public signature: /A.b.<get-b>|4816858536020199467[0]
// Public signature debug description: <get-b>@Java2(){}kotlin.String
open get(): String
// CHECK:
// Mangled name: A#<set-b>@Java2(kotlin.String){}
// Public signature: /A.b.<set-b>|7587520575456570009[0]
// Public signature debug description: <set-b>@Java2(kotlin.String){}
open set(value: String): Unit
}
// CHECK:
// Mangled name: B
// Public signature: /B|null[0]
class B : Java1 {
// CHECK:
// Mangled name: B#<init>(){}
// Public signature: /B.<init>|-5645683436151566731[0]
// Public signature debug description: <init>(){}
constructor() /* primary */
// CHECK:
// Mangled name: B#bar@Java2(kotlin.Int){}
// Public signature: /B.bar|-4052098631143945129[0]
// Public signature debug description: bar@Java2(kotlin.Int){}
/* fake */ override fun Java2.bar(a: Int): Unit
// CHECK:
// Mangled name: B#foo@A(kotlin.Int){}
// Public signature: /B.foo|-6186268904683510789[0]
// Public signature debug description: foo@A(kotlin.Int){}
/* fake */ override fun A.foo(a: Int): Unit
// CHECK:
// Mangled name: B#test(){}
// Public signature: /B.test|6620506149988718649[0]
// Public signature debug description: test(){}
fun test(): Unit
// CHECK:
// Mangled name: B@A{}a
// Public signature: /B.a|-112912227296012367[0]
// Public signature debug description: @A{}a
/* fake */ override var A.a: Int
// CHECK JVM_IR:
// Mangled name: B#<get-a>@A(){}kotlin.Int
// Public signature: /B.a.<get-a>|-5182152274603237009[0]
// Public signature debug description: <get-a>@A(){}kotlin.Int
/* fake */ override get(): Int
// CHECK:
// Mangled name: B#<set-a>@A(kotlin.Int){}
// Public signature: /B.a.<set-a>|6195122733392538441[0]
// Public signature debug description: <set-a>@A(kotlin.Int){}
/* fake */ override set(value: Int): Unit
// CHECK:
// Mangled name: B@Java2{}b
// Public signature: /B.b|2371064665038281993[0]
// Public signature debug description: @Java2{}b
/* fake */ override var Java2.b: String
// CHECK JVM_IR:
// Mangled name: B#<get-b>@Java2(){}kotlin.String
// Public signature: /B.b.<get-b>|4816858536020199467[0]
// Public signature debug description: <get-b>@Java2(){}kotlin.String
/* fake */ override get(): String
// CHECK:
// Mangled name: B#<set-b>@Java2(kotlin.String){}
// Public signature: /B.b.<set-b>|7587520575456570009[0]
// Public signature debug description: <set-b>@Java2(kotlin.String){}
/* fake */ override set(value: String): Unit
}
// CHECK:
// Mangled name: C
// Public signature: /C|null[0]
class C : Java1 {
// CHECK:
// Mangled name: C#<init>(){}
// Public signature: /C.<init>|-5645683436151566731[0]
// Public signature debug description: <init>(){}
constructor() /* primary */
// CHECK:
// Mangled name: C#bar@Java2(kotlin.Int){}
// Public signature: /C.bar|-4052098631143945129[0]
// Public signature debug description: bar@Java2(kotlin.Int){}
override fun Java2.bar(a: Int): Unit
// CHECK:
// Mangled name: C#foo@A(kotlin.Int){}
// Public signature: /C.foo|-6186268904683510789[0]
// Public signature debug description: foo@A(kotlin.Int){}
override fun A.foo(a: Int): Unit
// CHECK:
// Mangled name: C#test(){}
// Public signature: /C.test|6620506149988718649[0]
// Public signature debug description: test(){}
fun test(): Unit
// CHECK:
// Mangled name: C@A{}a
// Public signature: /C.a|-112912227296012367[0]
// Public signature debug description: @A{}a
override var A.a: Int
// CHECK JVM_IR:
// Mangled name: C#<get-a>@A(){}kotlin.Int
// Public signature: /C.a.<get-a>|-5182152274603237009[0]
// Public signature debug description: <get-a>@A(){}kotlin.Int
override get(): Int
// CHECK:
// Mangled name: C#<set-a>@A(kotlin.Int){}
// Public signature: /C.a.<set-a>|6195122733392538441[0]
// Public signature debug description: <set-a>@A(kotlin.Int){}
override set(value: Int): Unit
// CHECK:
// Mangled name: C@Java2{}b
// Public signature: /C.b|2371064665038281993[0]
// Public signature debug description: @Java2{}b
override var Java2.b: String
// CHECK JVM_IR:
// Mangled name: C#<get-b>@Java2(){}kotlin.String
// Public signature: /C.b.<get-b>|4816858536020199467[0]
// Public signature debug description: <get-b>@Java2(){}kotlin.String
override get(): String
// CHECK:
// Mangled name: C#<set-b>@Java2(kotlin.String){}
// Public signature: /C.b.<set-b>|7587520575456570009[0]
// Public signature debug description: <set-b>@Java2(kotlin.String){}
override set(value: String): Unit
}