[test] Move irText tests from fir2ir/testData to compiler/testData

Let's store them conveniently in one place!
This commit is contained in:
Sergej Jaskiewicz
2023-03-09 18:48:37 +01:00
committed by Space Team
parent c1ea3e7b53
commit ebafdd3af0
24 changed files with 179 additions and 177 deletions
@@ -0,0 +1,90 @@
FILE fqName:<root> fileName:/backingFieldVisibility.kt
CLASS CLASS name:A modality:FINAL 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> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]'
PROPERTY name:a visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
CONST Int type=kotlin.Int value=1
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-a> visibility:public modality:FINAL <> ($this:<root>.A) returnType:kotlin.Number
correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.A
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-a> (): kotlin.Number declared in <root>.A'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.Int visibility:private [final]' type=kotlin.Number origin=null
receiver: GET_VAR '<this>: <root>.A declared in <root>.A.<get-a>' type=<root>.A origin=null
PROPERTY name:b visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:b type:kotlin.Int visibility:internal [final]
EXPRESSION_BODY
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
$this: CALL 'public final fun <get-a> (): kotlin.Number declared in <root>.A' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.A declared in <root>.A' type=<root>.A origin=null
other: CONST Int type=kotlin.Int value=2
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-b> visibility:public modality:FINAL <> ($this:<root>.A) returnType:kotlin.Number
correspondingProperty: PROPERTY name:b visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.A
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-b> (): kotlin.Number declared in <root>.A'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:kotlin.Int visibility:internal [final]' type=kotlin.Number origin=null
receiver: GET_VAR '<this>: <root>.A declared in <root>.A.<get-b>' type=<root>.A origin=null
PROPERTY name:c visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
CONST Int type=kotlin.Int value=1
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-c> visibility:public modality:FINAL <> ($this:<root>.A) returnType:kotlin.Int
correspondingProperty: PROPERTY name:c visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.A
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-c> (): kotlin.Int declared in <root>.A'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.A declared in <root>.A.<get-c>' type=<root>.A origin=null
PROPERTY name:d visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:d type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
$this: CALL 'public final fun <get-c> (): kotlin.Int declared in <root>.A' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.A declared in <root>.A' type=<root>.A origin=null
other: CONST Int type=kotlin.Int value=2
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-d> visibility:public modality:FINAL <> ($this:<root>.A) returnType:kotlin.Int
correspondingProperty: PROPERTY name:d visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.A
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-d> (): kotlin.Int declared in <root>.A'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:d type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.A declared in <root>.A.<get-d>' type=<root>.A origin=null
FUN name:rest visibility:public modality:FINAL <> ($this:<root>.A) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.A
BLOCK_BODY
VAR name:aI type:kotlin.Int [val]
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
$this: CALL 'public final fun <get-a> (): kotlin.Number declared in <root>.A' type=kotlin.Int origin=GET_PROPERTY
$this: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.A' type=<root>.A origin=null
other: CONST Int type=kotlin.Int value=10
VAR name:bI type:kotlin.Int [val]
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
$this: CALL 'public final fun <get-b> (): kotlin.Number declared in <root>.A' type=kotlin.Int origin=GET_PROPERTY
$this: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.A' type=<root>.A origin=null
other: CONST Int type=kotlin.Int value=20
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<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:test visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR name:bA type:kotlin.Int [val]
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
$this: CALL 'public final fun <get-b> (): kotlin.Number declared in <root>.A' type=kotlin.Int origin=GET_PROPERTY
$this: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.A' type=<root>.A origin=null
other: CONST Int type=kotlin.Int value=20
@@ -0,0 +1,21 @@
// FIR_IDENTICAL
class A {
val a: Number
private field = 1
val b: Number
internal field = a + 2
val c = 1
val d = c + 2
fun rest() {
val aI = A().a + 10
val bI = A().b + 20
}
}
fun test() {
val bA = A().b + 20
}
@@ -0,0 +1,34 @@
class A {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
val a: Int
field = 1
get
val b: Int
field = <this>.<get-a>().plus(other = 2)
get
val c: Int
field = 1
get
val d: Int
field = <this>.<get-c>().plus(other = 2)
get
fun rest() {
val aI: Int = A().<get-a>().plus(other = 10)
val bI: Int = A().<get-b>().plus(other = 20)
}
}
fun test() {
val bA: Int = A().<get-b>().plus(other = 20)
}
@@ -0,0 +1,83 @@
FILE fqName:<root> fileName:/explicitBackingFieldType.kt
CLASS CLASS name:A modality:FINAL 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> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]'
PROPERTY name:a visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
CONST Int type=kotlin.Int value=20
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-a> visibility:public modality:FINAL <> ($this:<root>.A) returnType:kotlin.Int
correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.A
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-a> (): kotlin.Int declared in <root>.A'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.A declared in <root>.A.<get-a>' type=<root>.A origin=null
PROPERTY name:it visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:it type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
CONST Int type=kotlin.Int value=4
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-it> visibility:public modality:FINAL <> ($this:<root>.A) returnType:kotlin.Number
correspondingProperty: PROPERTY name:it visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.A
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-it> (): kotlin.Number declared in <root>.A'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:it type:kotlin.Int visibility:private [final]' type=kotlin.Number origin=null
receiver: GET_VAR '<this>: <root>.A declared in <root>.A.<get-it>' type=<root>.A origin=null
PROPERTY name:invertedTypes visibility:public modality:FINAL [var]
FIELD PROPERTY_BACKING_FIELD name:invertedTypes type:kotlin.Number visibility:private
EXPRESSION_BODY
CONST Int type=kotlin.Int value=42
FUN name:<get-invertedTypes> visibility:public modality:FINAL <> ($this:<root>.A) returnType:kotlin.Int
correspondingProperty: PROPERTY name:invertedTypes visibility:public modality:FINAL [var]
$this: VALUE_PARAMETER name:<this> type:<root>.A
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-invertedTypes> (): kotlin.Int declared in <root>.A'
WHEN type=kotlin.Int origin=IF
BRANCH
if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT
arg0: CALL 'public abstract fun toInt (): kotlin.Int declared in kotlin.Number' type=kotlin.Int origin=null
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:invertedTypes type:kotlin.Number visibility:private' type=kotlin.Number origin=GET_PROPERTY
receiver: GET_VAR '<this>: <root>.A declared in <root>.A.<get-invertedTypes>' type=<root>.A origin=null
arg1: CONST Int type=kotlin.Int value=10
then: CALL 'public abstract fun toInt (): kotlin.Int declared in kotlin.Number' type=kotlin.Int origin=null
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:invertedTypes type:kotlin.Number visibility:private' type=kotlin.Number origin=GET_PROPERTY
receiver: GET_VAR '<this>: <root>.A declared in <root>.A.<get-invertedTypes>' type=<root>.A origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Int type=kotlin.Int value=10
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-invertedTypes> visibility:public modality:FINAL <> ($this:<root>.A, <set-?>:kotlin.Int) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:invertedTypes visibility:public modality:FINAL [var]
$this: VALUE_PARAMETER name:<this> type:<root>.A
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.Int
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:invertedTypes type:kotlin.Number visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.A declared in <root>.A.<set-invertedTypes>' type=<root>.A origin=null
value: GET_VAR '<set-?>: kotlin.Int declared in <root>.A.<set-invertedTypes>' type=kotlin.Int origin=null
PROPERTY name:p visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
CONST Int type=kotlin.Int value=5
FUN name:<get-p> visibility:public modality:FINAL <> ($this:<root>.A) returnType:kotlin.Int
correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.A
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-p> (): kotlin.Int declared in <root>.A'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=GET_PROPERTY
receiver: GET_VAR '<this>: <root>.A declared in <root>.A.<get-p>' type=<root>.A origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<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
@@ -0,0 +1,14 @@
// FIR_IDENTICAL
class A {
val a = 20
val it: Number
field = 4
var invertedTypes: Int
field: Number = 42
get() = if (field.toInt() > 10) field.toInt() else 10
val p = 5
get() = field
}
@@ -0,0 +1,33 @@
class A {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
val a: Int
field = 20
get
val it: Int
field = 4
get
var invertedTypes: Number
field = 42
get(): Int {
return when {
greater(arg0 = <this>.#invertedTypes.toInt(), arg1 = 10) -> <this>.#invertedTypes.toInt()
else -> 10
}
}
set
val p: Int
field = 5
get(): Int {
return <this>.#p
}
}
@@ -0,0 +1,57 @@
FILE fqName:<root> fileName:/independentBackingFieldType.kt
CLASS CLASS name:A modality:FINAL 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> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]'
PROPERTY name:it visibility:public modality:FINAL [var]
FIELD PROPERTY_BACKING_FIELD name:it type:kotlin.Double visibility:private
EXPRESSION_BODY
CONST Double type=kotlin.Double value=3.14
FUN name:<get-it> visibility:public modality:FINAL <> ($this:<root>.A) returnType:kotlin.Int
correspondingProperty: PROPERTY name:it visibility:public modality:FINAL [var]
$this: VALUE_PARAMETER name:<this> type:<root>.A
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-it> (): kotlin.Int declared in <root>.A'
CALL 'public open fun toInt (): kotlin.Int declared in kotlin.Double' type=kotlin.Int origin=null
$this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Double [operator] declared in kotlin.Double' type=kotlin.Double origin=PLUS
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:it type:kotlin.Double visibility:private' type=kotlin.Double origin=GET_PROPERTY
receiver: GET_VAR '<this>: <root>.A declared in <root>.A.<get-it>' type=<root>.A origin=null
other: CONST Int type=kotlin.Int value=10
FUN name:<set-it> visibility:public modality:FINAL <> ($this:<root>.A, value:kotlin.Int) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:it visibility:public modality:FINAL [var]
$this: VALUE_PARAMETER name:<this> type:<root>.A
VALUE_PARAMETER name:value index:0 type:kotlin.Int
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:it type:kotlin.Double visibility:private' type=kotlin.Unit origin=EQ
receiver: GET_VAR '<this>: <root>.A declared in <root>.A.<set-it>' type=<root>.A origin=null
value: CALL 'public open fun toDouble (): kotlin.Double declared in kotlin.Int' type=kotlin.Double origin=null
$this: CALL 'public final fun minus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=MINUS
$this: GET_VAR 'value: kotlin.Int declared in <root>.A.<set-it>' type=kotlin.Int origin=null
other: CONST Int type=kotlin.Int value=10
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<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:test visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR name:a type:<root>.A [val]
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.A' type=<root>.A origin=null
VAR name:it type:kotlin.Int [val]
CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CALL 'public final fun <get-it> (): kotlin.Int declared in <root>.A' type=kotlin.Int origin=GET_PROPERTY
$this: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.A' type=<root>.A origin=null
other: CONST Int type=kotlin.Int value=10
CALL 'public final fun <set-it> (value: kotlin.Int): kotlin.Unit declared in <root>.A' type=kotlin.Unit origin=EQ
$this: GET_VAR 'val a: <root>.A [val] declared in <root>.test' type=<root>.A origin=null
value: GET_VAR 'val it: kotlin.Int [val] declared in <root>.test' type=kotlin.Int origin=null
@@ -0,0 +1,15 @@
// FIR_IDENTICAL
class A {
var it: Int
field = 3.14
get() = (field + 10).toInt()
set(value) {
field = (value - 10).toDouble()
}
}
fun test() {
val a = A()
val it: Int = A().it and 10
a.it = it
}
@@ -0,0 +1,23 @@
class A {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
var it: Double
field = 3.14
get(): Int {
return <this>.#it.plus(other = 10).toInt()
}
set(value: Int) {
<this>.#it = value.minus(other = 10).toDouble()
}
}
fun test() {
val a: A = A()
val it: Int = A().<get-it>().and(other = 10)
a.<set-it>(value = it)
}
@@ -0,0 +1,59 @@
FILE fqName:<root> fileName:/propertyTypeNarrowing.kt
CLASS CLASS name:A modality:FINAL 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> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]'
PROPERTY name:it visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:it type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
CONST Int type=kotlin.Int value=4
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-it> visibility:public modality:FINAL <> ($this:<root>.A) returnType:kotlin.Number
correspondingProperty: PROPERTY name:it visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.A
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-it> (): kotlin.Number declared in <root>.A'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:it type:kotlin.Int visibility:private [final]' type=kotlin.Number origin=null
receiver: GET_VAR '<this>: <root>.A declared in <root>.A.<get-it>' type=<root>.A origin=null
FUN name:test visibility:public modality:FINAL <> ($this:<root>.A) returnType:kotlin.Int
$this: VALUE_PARAMETER name:<this> type:<root>.A
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test (): kotlin.Int declared in <root>.A'
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
$this: CALL 'public final fun <get-it> (): kotlin.Number declared in <root>.A' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.A declared in <root>.A.test' type=<root>.A origin=null
other: CONST Int type=kotlin.Int value=3
PROPERTY name:p visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
CONST Int type=kotlin.Int value=5
FUN name:<get-p> visibility:public modality:FINAL <> ($this:<root>.A) returnType:kotlin.Int
correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.A
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-p> (): kotlin.Int declared in <root>.A'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=GET_PROPERTY
receiver: GET_VAR '<this>: <root>.A declared in <root>.A.<get-p>' type=<root>.A origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<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:test visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR name:d type:kotlin.Unit [val]
CALL 'public final fun test (): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
VAR name:b type:kotlin.Int [val]
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
$this: CALL 'public final fun <get-p> (): kotlin.Int declared in <root>.A' type=kotlin.Int origin=GET_PROPERTY
$this: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.A' type=<root>.A origin=null
other: CONST Int type=kotlin.Int value=2
@@ -0,0 +1,15 @@
// FIR_IDENTICAL
class A {
val it: Number
field = 4
fun test() = it + 3
val p = 5
get() = field
}
fun test() {
val d = test()
val b = A().p + 2
}
@@ -0,0 +1,28 @@
class A {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
val it: Int
field = 4
get
fun test(): Int {
return <this>.<get-it>().plus(other = 3)
}
val p: Int
field = 5
get(): Int {
return <this>.#p
}
}
fun test() {
val d: Unit = test()
val b: Int = A().<get-p>().plus(other = 2)
}