FIR: Unignore all Fir2IrText tests on context receivers
This commit is contained in:
Vendored
+213
@@ -0,0 +1,213 @@
|
||||
FILE fqName:<root> fileName:/arrayAccessCompositeOperators.kt
|
||||
CLASS CLASS name:MyContainer modality:FINAL visibility:public [data] superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyContainer
|
||||
CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:<root>.MyContainer [primary]
|
||||
VALUE_PARAMETER name:i index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyContainer modality:FINAL visibility:public [data] superTypes:[kotlin.Any]'
|
||||
PROPERTY name:i visibility:public modality:FINAL [var]
|
||||
FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'i: kotlin.Int declared in <root>.MyContainer.<init>' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-i> visibility:public modality:FINAL <> ($this:<root>.MyContainer) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:i visibility:public modality:FINAL [var]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.MyContainer
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-i> (): kotlin.Int declared in <root>.MyContainer'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.MyContainer declared in <root>.MyContainer.<get-i>' type=<root>.MyContainer origin=null
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-i> visibility:public modality:FINAL <> ($this:<root>.MyContainer, <set-?>:kotlin.Int) returnType:kotlin.Unit
|
||||
correspondingProperty: PROPERTY name:i visibility:public modality:FINAL [var]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.MyContainer
|
||||
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
|
||||
receiver: GET_VAR '<this>: <root>.MyContainer declared in <root>.MyContainer.<set-i>' type=<root>.MyContainer origin=null
|
||||
value: GET_VAR '<set-?>: kotlin.Int declared in <root>.MyContainer.<set-i>' type=kotlin.Int origin=null
|
||||
FUN name:component1 visibility:public modality:FINAL <> ($this:<root>.MyContainer) returnType:kotlin.Int [operator]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.MyContainer
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int [operator] declared in <root>.MyContainer'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.MyContainer declared in <root>.MyContainer.component1' type=<root>.MyContainer origin=null
|
||||
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.MyContainer, i:kotlin.Int) returnType:<root>.MyContainer
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.MyContainer
|
||||
VALUE_PARAMETER name:i index:0 type:kotlin.Int
|
||||
EXPRESSION_BODY
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.MyContainer declared in <root>.MyContainer.copy' type=<root>.MyContainer origin=null
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun copy (i: kotlin.Int): <root>.MyContainer declared in <root>.MyContainer'
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.MyContainer' type=<root>.MyContainer origin=null
|
||||
i: GET_VAR 'i: kotlin.Int declared in <root>.MyContainer.copy' type=kotlin.Int origin=null
|
||||
FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.MyContainer, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.MyContainer
|
||||
VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any?
|
||||
BLOCK_BODY
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ
|
||||
arg0: GET_VAR '<this>: <root>.MyContainer declared in <root>.MyContainer.equals' type=<root>.MyContainer origin=null
|
||||
arg1: GET_VAR 'other: kotlin.Any? declared in <root>.MyContainer.equals' type=kotlin.Any? origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.MyContainer'
|
||||
CONST Boolean type=kotlin.Boolean value=true
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=<root>.MyContainer
|
||||
GET_VAR 'other: kotlin.Any? declared in <root>.MyContainer.equals' type=kotlin.Any? origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.MyContainer'
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:<root>.MyContainer [val]
|
||||
TYPE_OP type=<root>.MyContainer origin=CAST typeOperand=<root>.MyContainer
|
||||
GET_VAR 'other: kotlin.Any? declared in <root>.MyContainer.equals' type=kotlin.Any? origin=null
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.MyContainer declared in <root>.MyContainer.equals' type=<root>.MyContainer origin=null
|
||||
arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR 'val tmp_0: <root>.MyContainer [val] declared in <root>.MyContainer.equals' type=<root>.MyContainer origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.MyContainer'
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.MyContainer'
|
||||
CONST Boolean type=kotlin.Boolean value=true
|
||||
FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.MyContainer) returnType:kotlin.Int
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.MyContainer
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in <root>.MyContainer'
|
||||
CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.MyContainer declared in <root>.MyContainer.hashCode' type=<root>.MyContainer origin=null
|
||||
FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.MyContainer) returnType:kotlin.String
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.MyContainer
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.MyContainer'
|
||||
STRING_CONCATENATION type=kotlin.String
|
||||
CONST String type=kotlin.String value="MyContainer("
|
||||
CONST String type=kotlin.String value="i="
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.MyContainer declared in <root>.MyContainer.toString' type=<root>.MyContainer origin=null
|
||||
CONST String type=kotlin.String value=")"
|
||||
PROPERTY name:operationScore visibility:public modality:FINAL [var]
|
||||
FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]
|
||||
EXPRESSION_BODY
|
||||
CONST Int type=kotlin.Int value=0
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-operationScore> visibility:public modality:FINAL <> () returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var]
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-operationScore> (): kotlin.Int declared in <root>'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-operationScore> visibility:public modality:FINAL <> (<set-?>:kotlin.Int) returnType:kotlin.Unit
|
||||
correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var]
|
||||
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null
|
||||
value: GET_VAR '<set-?>: kotlin.Int declared in <root>.<set-operationScore>' type=kotlin.Int origin=null
|
||||
FUN name:get visibility:public modality:FINAL <> ($receiver:<root>.MyContainer, _context_receiver_0:kotlin.Int, index:kotlin.Int) returnType:kotlin.Int [operator]
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.MyContainer
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
|
||||
VALUE_PARAMETER name:index index:1 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun <set-operationScore> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-operationScore> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
other: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.get' type=kotlin.Int origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun get (_context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.Int [operator] declared in <root>'
|
||||
WHEN type=kotlin.Int origin=IF
|
||||
BRANCH
|
||||
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||
arg0: GET_VAR 'index: kotlin.Int declared in <root>.get' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=0
|
||||
then: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.MyContainer' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.MyContainer declared in <root>.get' type=<root>.MyContainer origin=null
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: CONST Int type=kotlin.Int value=-1
|
||||
FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:<root>.MyContainer, _context_receiver_0:kotlin.Int, other:<root>.MyContainer) returnType:kotlin.Unit [operator]
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.MyContainer
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
|
||||
VALUE_PARAMETER name:other index:1 type:<root>.MyContainer
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun <set-operationScore> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-operationScore> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
other: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.plusAssign' type=kotlin.Int origin=null
|
||||
CALL 'public final fun <set-i> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.MyContainer' type=kotlin.Unit origin=EQ
|
||||
$this: GET_VAR '<this>: <root>.MyContainer declared in <root>.plusAssign' type=<root>.MyContainer origin=null
|
||||
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.MyContainer' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.MyContainer declared in <root>.plusAssign' type=<root>.MyContainer origin=null
|
||||
other: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.MyContainer' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR 'other: <root>.MyContainer declared in <root>.plusAssign' type=<root>.MyContainer origin=null
|
||||
FUN name:inc visibility:public modality:FINAL <> ($receiver:<root>.MyContainer, _context_receiver_0:kotlin.Int) returnType:<root>.MyContainer [operator]
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.MyContainer
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun <set-operationScore> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-operationScore> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
other: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.inc' type=kotlin.Int origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun inc (_context_receiver_0: kotlin.Int): <root>.MyContainer [operator] declared in <root>'
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.MyContainer' type=<root>.MyContainer origin=null
|
||||
i: 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-i> (): kotlin.Int declared in <root>.MyContainer' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.MyContainer declared in <root>.inc' type=<root>.MyContainer origin=null
|
||||
other: CONST Int type=kotlin.Int value=1
|
||||
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||
BLOCK_BODY
|
||||
VAR name:myContainer type:<root>.MyContainer [var]
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.MyContainer' type=<root>.MyContainer origin=null
|
||||
i: CONST Int type=kotlin.Int value=0
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.Unit origin=null
|
||||
<T>: kotlin.Int
|
||||
<R>: kotlin.Unit
|
||||
receiver: CONST Int type=kotlin.Int value=1
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<kotlin.Int, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.Unit
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun plusAssign (_context_receiver_0: kotlin.Int, other: <root>.MyContainer): kotlin.Unit [operator] declared in <root>' type=kotlin.Unit origin=null
|
||||
$receiver: GET_VAR 'var myContainer: <root>.MyContainer [var] declared in <root>.box' type=<root>.MyContainer origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
other: CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.MyContainer' type=<root>.MyContainer origin=null
|
||||
i: CALL 'public final fun get (_context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.Int [operator] declared in <root>' type=kotlin.Int origin=null
|
||||
$receiver: BLOCK type=<root>.MyContainer origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:<root>.MyContainer [val]
|
||||
GET_VAR 'var myContainer: <root>.MyContainer [var] declared in <root>.box' type=<root>.MyContainer origin=null
|
||||
SET_VAR 'var myContainer: <root>.MyContainer [var] declared in <root>.box' type=kotlin.Unit origin=EQ
|
||||
CALL 'public final fun inc (_context_receiver_0: kotlin.Int): <root>.MyContainer [operator] declared in <root>' type=<root>.MyContainer origin=null
|
||||
$receiver: GET_VAR 'val tmp_1: <root>.MyContainer [val] declared in <root>.box.<anonymous>' type=<root>.MyContainer origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_1: <root>.MyContainer [val] declared in <root>.box.<anonymous>' type=<root>.MyContainer origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
index: CONST Int type=kotlin.Int value=0
|
||||
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
WHEN type=kotlin.String origin=IF
|
||||
BRANCH
|
||||
if: WHEN type=kotlin.Boolean origin=ANDAND
|
||||
BRANCH
|
||||
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||
arg0: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.MyContainer' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR 'var myContainer: <root>.MyContainer [var] declared in <root>.box' type=<root>.MyContainer origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=1
|
||||
then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||
arg0: CALL 'public final fun <get-operationScore> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
arg1: CONST Int type=kotlin.Int value=3
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: CONST Boolean type=kotlin.Boolean value=false
|
||||
then: CONST String type=kotlin.String value="OK"
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: CONST String type=kotlin.String value="fail"
|
||||
Vendored
+85
@@ -0,0 +1,85 @@
|
||||
data class MyContainer {
|
||||
constructor(i: Int) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
var i: Int
|
||||
field = i
|
||||
get
|
||||
set
|
||||
|
||||
operator fun component1(): Int {
|
||||
return <this>.#i
|
||||
}
|
||||
|
||||
fun copy(i: Int = <this>.#i): MyContainer {
|
||||
return MyContainer(i = i)
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
when {
|
||||
EQEQEQ(arg0 = <this>, arg1 = other) -> return true
|
||||
}
|
||||
when {
|
||||
other !is MyContainer -> return false
|
||||
}
|
||||
val tmp0_other_with_cast: MyContainer = other as MyContainer
|
||||
when {
|
||||
EQEQ(arg0 = <this>.#i, arg1 = tmp0_other_with_cast.#i).not() -> return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return <this>.#i.hashCode()
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "MyContainer(" + "i=" + <this>.#i + ")"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var operationScore: Int
|
||||
field = 0
|
||||
get
|
||||
set
|
||||
|
||||
operator fun MyContainer.get(_context_receiver_0: Int, index: Int): Int {
|
||||
<set-operationScore>(<set-?> = <get-operationScore>().plus(other = _context_receiver_0))
|
||||
return when {
|
||||
EQEQ(arg0 = index, arg1 = 0) -> <this>.<get-i>()
|
||||
else -> -1
|
||||
}
|
||||
}
|
||||
|
||||
operator fun MyContainer.plusAssign(_context_receiver_0: Int, other: MyContainer) {
|
||||
<set-operationScore>(<set-?> = <get-operationScore>().plus(other = _context_receiver_0))
|
||||
<this>.<set-i>(<set-?> = <this>.<get-i>().plus(other = other.<get-i>()))
|
||||
}
|
||||
|
||||
operator fun MyContainer.inc(_context_receiver_0: Int): MyContainer {
|
||||
<set-operationScore>(<set-?> = <get-operationScore>().plus(other = _context_receiver_0))
|
||||
return MyContainer(i = <this>.<get-i>().plus(other = 1))
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var myContainer: MyContainer = MyContainer(i = 0)
|
||||
with<Int, Unit>(receiver = 1, block = local fun Int.<anonymous>() {
|
||||
myContainer.plusAssign(_context_receiver_0 = $this$with, other = MyContainer(i = { // BLOCK
|
||||
val <unary>: MyContainer = myContainer
|
||||
myContainer = <unary>.inc(_context_receiver_0 = $this$with)
|
||||
<unary>
|
||||
}.get(_context_receiver_0 = $this$with, index = 0)))
|
||||
}
|
||||
)
|
||||
return when {
|
||||
when {
|
||||
EQEQ(arg0 = myContainer.<get-i>(), arg1 = 1) -> EQEQ(arg0 = <get-operationScore>(), arg1 = 3)
|
||||
else -> false
|
||||
} -> "OK"
|
||||
else -> "fail"
|
||||
}
|
||||
}
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
data class MyContainer(var i: Int)
|
||||
|
||||
|
||||
+185
@@ -0,0 +1,185 @@
|
||||
FILE fqName:<root> fileName:/arrayAccessOperators.kt
|
||||
CLASS CLASS name:MyContainer modality:FINAL visibility:public [data] superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyContainer
|
||||
CONSTRUCTOR visibility:public <> (s:kotlin.String) returnType:<root>.MyContainer [primary]
|
||||
VALUE_PARAMETER name:s index:0 type:kotlin.String
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyContainer modality:FINAL visibility:public [data] superTypes:[kotlin.Any]'
|
||||
PROPERTY name:s visibility:public modality:FINAL [var]
|
||||
FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 's: kotlin.String declared in <root>.MyContainer.<init>' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-s> visibility:public modality:FINAL <> ($this:<root>.MyContainer) returnType:kotlin.String
|
||||
correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [var]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.MyContainer
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-s> (): kotlin.String declared in <root>.MyContainer'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private' type=kotlin.String origin=null
|
||||
receiver: GET_VAR '<this>: <root>.MyContainer declared in <root>.MyContainer.<get-s>' type=<root>.MyContainer origin=null
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-s> visibility:public modality:FINAL <> ($this:<root>.MyContainer, <set-?>:kotlin.String) returnType:kotlin.Unit
|
||||
correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [var]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.MyContainer
|
||||
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.String
|
||||
BLOCK_BODY
|
||||
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private' type=kotlin.Unit origin=null
|
||||
receiver: GET_VAR '<this>: <root>.MyContainer declared in <root>.MyContainer.<set-s>' type=<root>.MyContainer origin=null
|
||||
value: GET_VAR '<set-?>: kotlin.String declared in <root>.MyContainer.<set-s>' type=kotlin.String origin=null
|
||||
FUN name:component1 visibility:public modality:FINAL <> ($this:<root>.MyContainer) returnType:kotlin.String [operator]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.MyContainer
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.String [operator] declared in <root>.MyContainer'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private' type=kotlin.String origin=null
|
||||
receiver: GET_VAR '<this>: <root>.MyContainer declared in <root>.MyContainer.component1' type=<root>.MyContainer origin=null
|
||||
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.MyContainer, s:kotlin.String) returnType:<root>.MyContainer
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.MyContainer
|
||||
VALUE_PARAMETER name:s index:0 type:kotlin.String
|
||||
EXPRESSION_BODY
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private' type=kotlin.String origin=null
|
||||
receiver: GET_VAR '<this>: <root>.MyContainer declared in <root>.MyContainer.copy' type=<root>.MyContainer origin=null
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun copy (s: kotlin.String): <root>.MyContainer declared in <root>.MyContainer'
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (s: kotlin.String) [primary] declared in <root>.MyContainer' type=<root>.MyContainer origin=null
|
||||
s: GET_VAR 's: kotlin.String declared in <root>.MyContainer.copy' type=kotlin.String origin=null
|
||||
FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.MyContainer, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.MyContainer
|
||||
VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any?
|
||||
BLOCK_BODY
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ
|
||||
arg0: GET_VAR '<this>: <root>.MyContainer declared in <root>.MyContainer.equals' type=<root>.MyContainer origin=null
|
||||
arg1: GET_VAR 'other: kotlin.Any? declared in <root>.MyContainer.equals' type=kotlin.Any? origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.MyContainer'
|
||||
CONST Boolean type=kotlin.Boolean value=true
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=<root>.MyContainer
|
||||
GET_VAR 'other: kotlin.Any? declared in <root>.MyContainer.equals' type=kotlin.Any? origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.MyContainer'
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:<root>.MyContainer [val]
|
||||
TYPE_OP type=<root>.MyContainer origin=CAST typeOperand=<root>.MyContainer
|
||||
GET_VAR 'other: kotlin.Any? declared in <root>.MyContainer.equals' type=kotlin.Any? origin=null
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private' type=kotlin.String origin=null
|
||||
receiver: GET_VAR '<this>: <root>.MyContainer declared in <root>.MyContainer.equals' type=<root>.MyContainer origin=null
|
||||
arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private' type=kotlin.String origin=null
|
||||
receiver: GET_VAR 'val tmp_0: <root>.MyContainer [val] declared in <root>.MyContainer.equals' type=<root>.MyContainer origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.MyContainer'
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.MyContainer'
|
||||
CONST Boolean type=kotlin.Boolean value=true
|
||||
FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.MyContainer) returnType:kotlin.Int
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.MyContainer
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in <root>.MyContainer'
|
||||
CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.String' type=kotlin.Int origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private' type=kotlin.String origin=null
|
||||
receiver: GET_VAR '<this>: <root>.MyContainer declared in <root>.MyContainer.hashCode' type=<root>.MyContainer origin=null
|
||||
FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.MyContainer) returnType:kotlin.String
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.MyContainer
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.MyContainer'
|
||||
STRING_CONCATENATION type=kotlin.String
|
||||
CONST String type=kotlin.String value="MyContainer("
|
||||
CONST String type=kotlin.String value="s="
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private' type=kotlin.String origin=null
|
||||
receiver: GET_VAR '<this>: <root>.MyContainer declared in <root>.MyContainer.toString' type=<root>.MyContainer origin=null
|
||||
CONST String type=kotlin.String value=")"
|
||||
FUN name:get visibility:public modality:FINAL <> ($receiver:<root>.MyContainer, _context_receiver_0:kotlin.Int, index:kotlin.Int) returnType:kotlin.String? [operator]
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.MyContainer
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
|
||||
VALUE_PARAMETER name:index index:1 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun get (_context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.String? [operator] declared in <root>'
|
||||
WHEN type=kotlin.String? origin=IF
|
||||
BRANCH
|
||||
if: WHEN type=kotlin.Boolean origin=ANDAND
|
||||
BRANCH
|
||||
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||
arg0: GET_VAR 'index: kotlin.Int declared in <root>.get' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=0
|
||||
then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||
arg0: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.get' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=42
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: CONST Boolean type=kotlin.Boolean value=false
|
||||
then: CALL 'public final fun <get-s> (): kotlin.String declared in <root>.MyContainer' type=kotlin.String origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.MyContainer declared in <root>.get' type=<root>.MyContainer origin=null
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: CONST Null type=kotlin.Nothing? value=null
|
||||
FUN name:set visibility:public modality:FINAL <> ($receiver:<root>.MyContainer, _context_receiver_0:kotlin.Int, index:kotlin.Int, value:kotlin.String) returnType:kotlin.Unit [operator]
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.MyContainer
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
|
||||
VALUE_PARAMETER name:index index:1 type:kotlin.Int
|
||||
VALUE_PARAMETER name:value index:2 type:kotlin.String
|
||||
BLOCK_BODY
|
||||
WHEN type=kotlin.Unit origin=IF
|
||||
BRANCH
|
||||
if: WHEN type=kotlin.Boolean origin=OROR
|
||||
BRANCH
|
||||
if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: GET_VAR 'index: kotlin.Int declared in <root>.set' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=0
|
||||
then: CONST Boolean type=kotlin.Boolean value=true
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.set' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=42
|
||||
then: RETURN type=kotlin.Nothing from='public final fun set (_context_receiver_0: kotlin.Int, index: kotlin.Int, value: kotlin.String): kotlin.Unit [operator] declared in <root>'
|
||||
GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit
|
||||
CALL 'public final fun <set-s> (<set-?>: kotlin.String): kotlin.Unit declared in <root>.MyContainer' type=kotlin.Unit origin=EQ
|
||||
$this: GET_VAR '<this>: <root>.MyContainer declared in <root>.set' type=<root>.MyContainer origin=null
|
||||
<set-?>: GET_VAR 'value: kotlin.String declared in <root>.set' type=kotlin.String origin=null
|
||||
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.String origin=null
|
||||
<T>: kotlin.Int
|
||||
<R>: kotlin.String
|
||||
receiver: CONST Int type=kotlin.Int value=42
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<kotlin.Int, kotlin.String> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.String
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
VAR name:myContainer type:<root>.MyContainer [val]
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (s: kotlin.String) [primary] declared in <root>.MyContainer' type=<root>.MyContainer origin=null
|
||||
s: CONST String type=kotlin.String value="fail"
|
||||
CALL 'public final fun set (_context_receiver_0: kotlin.Int, index: kotlin.Int, value: kotlin.String): kotlin.Unit [operator] declared in <root>' type=kotlin.Unit origin=null
|
||||
$receiver: GET_VAR 'val myContainer: <root>.MyContainer [val] declared in <root>.box.<anonymous>' type=<root>.MyContainer origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
index: CONST Int type=kotlin.Int value=0
|
||||
value: CONST String type=kotlin.String value="OK"
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.String declared in <root>.box'
|
||||
BLOCK type=kotlin.String origin=ELVIS
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.String? [val]
|
||||
CALL 'public final fun get (_context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.String? [operator] declared in <root>' type=kotlin.String? origin=null
|
||||
$receiver: GET_VAR 'val myContainer: <root>.MyContainer [val] declared in <root>.box.<anonymous>' type=<root>.MyContainer origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
index: CONST Int type=kotlin.Int value=0
|
||||
WHEN type=kotlin.String origin=ELVIS
|
||||
BRANCH
|
||||
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||
arg0: GET_VAR 'val tmp_1: kotlin.String? [val] declared in <root>.box.<anonymous>' type=kotlin.String? origin=null
|
||||
arg1: CONST Null type=kotlin.Nothing? value=null
|
||||
then: CONST String type=kotlin.String value="fail"
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: GET_VAR 'val tmp_1: kotlin.String? [val] declared in <root>.box.<anonymous>' type=kotlin.String? origin=null
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
data class MyContainer {
|
||||
constructor(s: String) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
var s: String
|
||||
field = s
|
||||
get
|
||||
set
|
||||
|
||||
operator fun component1(): String {
|
||||
return <this>.#s
|
||||
}
|
||||
|
||||
fun copy(s: String = <this>.#s): MyContainer {
|
||||
return MyContainer(s = s)
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
when {
|
||||
EQEQEQ(arg0 = <this>, arg1 = other) -> return true
|
||||
}
|
||||
when {
|
||||
other !is MyContainer -> return false
|
||||
}
|
||||
val tmp0_other_with_cast: MyContainer = other as MyContainer
|
||||
when {
|
||||
EQEQ(arg0 = <this>.#s, arg1 = tmp0_other_with_cast.#s).not() -> return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return <this>.#s.hashCode()
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "MyContainer(" + "s=" + <this>.#s + ")"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
operator fun MyContainer.get(_context_receiver_0: Int, index: Int): String? {
|
||||
return when {
|
||||
when {
|
||||
EQEQ(arg0 = index, arg1 = 0) -> EQEQ(arg0 = _context_receiver_0, arg1 = 42)
|
||||
else -> false
|
||||
} -> <this>.<get-s>()
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
operator fun MyContainer.set(_context_receiver_0: Int, index: Int, value: String) {
|
||||
when {
|
||||
when {
|
||||
EQEQ(arg0 = index, arg1 = 0).not() -> true
|
||||
else -> EQEQ(arg0 = _context_receiver_0, arg1 = 42).not()
|
||||
} -> return Unit
|
||||
}
|
||||
<this>.<set-s>(<set-?> = value)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return with<Int, String>(receiver = 42, block = local fun Int.<anonymous>(): String {
|
||||
val myContainer: MyContainer = MyContainer(s = "fail")
|
||||
myContainer.set(_context_receiver_0 = $this$with, index = 0, value = "OK")
|
||||
return { // BLOCK
|
||||
val <elvis>: String? = myContainer.get(_context_receiver_0 = $this$with, index = 0)
|
||||
when {
|
||||
EQEQ(arg0 = <elvis>, arg1 = null) -> "fail"
|
||||
else -> <elvis>
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
data class MyContainer(var s: String)
|
||||
|
||||
@@ -21,4 +20,4 @@ fun box(): String {
|
||||
myContainer[0] = "OK"
|
||||
myContainer[0] ?: "fail"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
FILE fqName:<root> fileName:/class.kt
|
||||
CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Outer
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.Outer [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||
PROPERTY name:x visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
CONST Int type=kotlin.Int value=1
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:<root>.Outer) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Outer
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-x> (): kotlin.Int declared in <root>.Outer'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Outer declared in <root>.Outer.<get-x>' type=<root>.Outer 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
|
||||
CLASS CLASS name:Inner modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Inner
|
||||
FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.Outer visibility:private [final]
|
||||
CONSTRUCTOR visibility:public <> (_context_receiver_0:<root>.Outer, arg:kotlin.Any) returnType:<root>.Inner [primary]
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.Outer
|
||||
VALUE_PARAMETER name:arg index:1 type:kotlin.Any
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||
SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.Outer visibility:private [final]' type=kotlin.Unit origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Inner declared in <root>.Inner' type=<root>.Inner origin=null
|
||||
value: GET_VAR '_context_receiver_0: <root>.Outer declared in <root>.Inner.<init>' type=<root>.Outer origin=null
|
||||
FUN name:bar visibility:public modality:FINAL <> ($this:<root>.Inner) returnType:kotlin.Int
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Inner
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun bar (): kotlin.Int declared in <root>.Inner'
|
||||
CALL 'public final fun <get-x> (): kotlin.Int declared in <root>.Outer' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.Outer visibility:private [final]' type=<root>.Outer origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Inner declared in <root>.Inner.bar' type=<root>.Inner 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:f visibility:public modality:FINAL <> (outer:<root>.Outer) returnType:kotlin.Unit
|
||||
VALUE_PARAMETER name:outer index:0 type:<root>.Outer
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=<root>.Inner origin=null
|
||||
<T>: <root>.Outer
|
||||
<R>: <root>.Inner
|
||||
receiver: GET_VAR 'outer: <root>.Outer declared in <root>.f' type=<root>.Outer origin=null
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.Outer, <root>.Inner> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.Outer) returnType:<root>.Inner
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.Outer
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): <root>.Inner declared in <root>.f'
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (_context_receiver_0: <root>.Outer, arg: kotlin.Any) [primary] declared in <root>.Inner' type=<root>.Inner origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.Outer declared in <root>.f.<anonymous>' type=<root>.Outer origin=null
|
||||
arg: CONST Int type=kotlin.Int value=3
|
||||
@@ -0,0 +1,34 @@
|
||||
class Outer {
|
||||
constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
val x: Int
|
||||
field = 1
|
||||
get
|
||||
|
||||
}
|
||||
|
||||
class Inner {
|
||||
private /* final field */ val contextReceiverField0: Outer
|
||||
constructor(_context_receiver_0: Outer, arg: Any) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
<this>.#contextReceiverField0 = _context_receiver_0
|
||||
}
|
||||
|
||||
fun bar(): Int {
|
||||
return <this>.#contextReceiverField0.<get-x>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun f(outer: Outer) {
|
||||
with<Outer, Inner>(receiver = outer, block = local fun Outer.<anonymous>(): Inner {
|
||||
return Inner(_context_receiver_0 = $this$with, arg = 3)
|
||||
}
|
||||
) /*~> Unit */
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
class Outer {
|
||||
val x: Int = 1
|
||||
@@ -14,4 +13,4 @@ fun f(outer: Outer) {
|
||||
with(outer) {
|
||||
Inner(3)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+317
@@ -0,0 +1,317 @@
|
||||
FILE fqName:<root> fileName:/compoundAssignmentOperators.kt
|
||||
CLASS CLASS name:Result modality:FINAL visibility:public [data] superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Result
|
||||
CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:<root>.Result [primary]
|
||||
VALUE_PARAMETER name:i index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Result modality:FINAL visibility:public [data] superTypes:[kotlin.Any]'
|
||||
PROPERTY name:i visibility:public modality:FINAL [var]
|
||||
FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'i: kotlin.Int declared in <root>.Result.<init>' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-i> visibility:public modality:FINAL <> ($this:<root>.Result) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:i visibility:public modality:FINAL [var]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Result
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-i> (): kotlin.Int declared in <root>.Result'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result.<get-i>' type=<root>.Result origin=null
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-i> visibility:public modality:FINAL <> ($this:<root>.Result, <set-?>:kotlin.Int) returnType:kotlin.Unit
|
||||
correspondingProperty: PROPERTY name:i visibility:public modality:FINAL [var]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Result
|
||||
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result.<set-i>' type=<root>.Result origin=null
|
||||
value: GET_VAR '<set-?>: kotlin.Int declared in <root>.Result.<set-i>' type=kotlin.Int origin=null
|
||||
FUN name:component1 visibility:public modality:FINAL <> ($this:<root>.Result) returnType:kotlin.Int [operator]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Result
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int [operator] declared in <root>.Result'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result.component1' type=<root>.Result origin=null
|
||||
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.Result, i:kotlin.Int) returnType:<root>.Result
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Result
|
||||
VALUE_PARAMETER name:i index:0 type:kotlin.Int
|
||||
EXPRESSION_BODY
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result.copy' type=<root>.Result origin=null
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun copy (i: kotlin.Int): <root>.Result declared in <root>.Result'
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.Result' type=<root>.Result origin=null
|
||||
i: GET_VAR 'i: kotlin.Int declared in <root>.Result.copy' type=kotlin.Int origin=null
|
||||
FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.Result, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.Result
|
||||
VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any?
|
||||
BLOCK_BODY
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ
|
||||
arg0: GET_VAR '<this>: <root>.Result declared in <root>.Result.equals' type=<root>.Result origin=null
|
||||
arg1: GET_VAR 'other: kotlin.Any? declared in <root>.Result.equals' type=kotlin.Any? origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Result'
|
||||
CONST Boolean type=kotlin.Boolean value=true
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=<root>.Result
|
||||
GET_VAR 'other: kotlin.Any? declared in <root>.Result.equals' type=kotlin.Any? origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Result'
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:<root>.Result [val]
|
||||
TYPE_OP type=<root>.Result origin=CAST typeOperand=<root>.Result
|
||||
GET_VAR 'other: kotlin.Any? declared in <root>.Result.equals' type=kotlin.Any? origin=null
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result.equals' type=<root>.Result origin=null
|
||||
arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR 'val tmp_0: <root>.Result [val] declared in <root>.Result.equals' type=<root>.Result origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Result'
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Result'
|
||||
CONST Boolean type=kotlin.Boolean value=true
|
||||
FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.Result) returnType:kotlin.Int
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.Result
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in <root>.Result'
|
||||
CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result.hashCode' type=<root>.Result origin=null
|
||||
FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.Result) returnType:kotlin.String
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.Result
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.Result'
|
||||
STRING_CONCATENATION type=kotlin.String
|
||||
CONST String type=kotlin.String value="Result("
|
||||
CONST String type=kotlin.String value="i="
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result.toString' type=<root>.Result origin=null
|
||||
CONST String type=kotlin.String value=")"
|
||||
PROPERTY name:operationScore visibility:public modality:FINAL [var]
|
||||
FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]
|
||||
EXPRESSION_BODY
|
||||
CONST Int type=kotlin.Int value=0
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-operationScore> visibility:public modality:FINAL <> () returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var]
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-operationScore> (): kotlin.Int declared in <root>'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-operationScore> visibility:public modality:FINAL <> (<set-?>:kotlin.Int) returnType:kotlin.Unit
|
||||
correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var]
|
||||
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null
|
||||
value: GET_VAR '<set-?>: kotlin.Int declared in <root>.<set-operationScore>' type=kotlin.Int origin=null
|
||||
FUN name:plus visibility:public modality:FINAL <> ($receiver:<root>.Result, _context_receiver_0:kotlin.Int, other:<root>.Result) returnType:<root>.Result [operator]
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.Result
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
|
||||
VALUE_PARAMETER name:other index:1 type:<root>.Result
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun <set-operationScore> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-operationScore> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
other: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.plus' type=kotlin.Int origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun plus (_context_receiver_0: kotlin.Int, other: <root>.Result): <root>.Result [operator] declared in <root>'
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.Result' type=<root>.Result origin=null
|
||||
i: 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-i> (): kotlin.Int declared in <root>.Result' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.Result declared in <root>.plus' type=<root>.Result origin=null
|
||||
other: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.Result' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR 'other: <root>.Result declared in <root>.plus' type=<root>.Result origin=null
|
||||
FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:<root>.Result, _context_receiver_0:kotlin.Int, other:<root>.Result) returnType:kotlin.Unit [operator]
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.Result
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
|
||||
VALUE_PARAMETER name:other index:1 type:<root>.Result
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun <set-operationScore> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-operationScore> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
other: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.plusAssign' type=kotlin.Int origin=null
|
||||
CALL 'public final fun <set-i> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.Result' type=kotlin.Unit origin=EQ
|
||||
$this: GET_VAR '<this>: <root>.Result declared in <root>.plusAssign' type=<root>.Result origin=null
|
||||
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.Result' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.Result declared in <root>.plusAssign' type=<root>.Result origin=null
|
||||
other: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.Result' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR 'other: <root>.Result declared in <root>.plusAssign' type=<root>.Result origin=null
|
||||
FUN name:minus visibility:public modality:FINAL <> ($receiver:<root>.Result, _context_receiver_0:kotlin.Int, other:<root>.Result) returnType:<root>.Result [operator]
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.Result
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
|
||||
VALUE_PARAMETER name:other index:1 type:<root>.Result
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun <set-operationScore> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-operationScore> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
other: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.minus' type=kotlin.Int origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun minus (_context_receiver_0: kotlin.Int, other: <root>.Result): <root>.Result [operator] declared in <root>'
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.Result' type=<root>.Result origin=null
|
||||
i: CALL 'public final fun minus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=MINUS
|
||||
$this: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.Result' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.Result declared in <root>.minus' type=<root>.Result origin=null
|
||||
other: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.Result' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR 'other: <root>.Result declared in <root>.minus' type=<root>.Result origin=null
|
||||
FUN name:minusAssign visibility:public modality:FINAL <> ($receiver:<root>.Result, _context_receiver_0:kotlin.Int, other:<root>.Result) returnType:kotlin.Unit [operator]
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.Result
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
|
||||
VALUE_PARAMETER name:other index:1 type:<root>.Result
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun <set-operationScore> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-operationScore> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
other: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.minusAssign' type=kotlin.Int origin=null
|
||||
CALL 'public final fun <set-i> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.Result' type=kotlin.Unit origin=EQ
|
||||
$this: GET_VAR '<this>: <root>.Result declared in <root>.minusAssign' type=<root>.Result origin=null
|
||||
<set-?>: CALL 'public final fun minus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.Result' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.Result declared in <root>.minusAssign' type=<root>.Result origin=null
|
||||
other: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.Result' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR 'other: <root>.Result declared in <root>.minusAssign' type=<root>.Result origin=null
|
||||
FUN name:times visibility:public modality:FINAL <> ($receiver:<root>.Result, _context_receiver_0:kotlin.Int, other:<root>.Result) returnType:<root>.Result [operator]
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.Result
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
|
||||
VALUE_PARAMETER name:other index:1 type:<root>.Result
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun <set-operationScore> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-operationScore> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
other: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.times' type=kotlin.Int origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun times (_context_receiver_0: kotlin.Int, other: <root>.Result): <root>.Result [operator] declared in <root>'
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.Result' type=<root>.Result origin=null
|
||||
i: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=MUL
|
||||
$this: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.Result' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.Result declared in <root>.times' type=<root>.Result origin=null
|
||||
other: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.Result' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR 'other: <root>.Result declared in <root>.times' type=<root>.Result origin=null
|
||||
FUN name:timesAssign visibility:public modality:FINAL <> ($receiver:<root>.Result, _context_receiver_0:kotlin.Int, other:<root>.Result) returnType:kotlin.Unit [operator]
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.Result
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
|
||||
VALUE_PARAMETER name:other index:1 type:<root>.Result
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun <set-operationScore> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-operationScore> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
other: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.timesAssign' type=kotlin.Int origin=null
|
||||
CALL 'public final fun <set-i> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.Result' type=kotlin.Unit origin=EQ
|
||||
$this: GET_VAR '<this>: <root>.Result declared in <root>.timesAssign' type=<root>.Result origin=null
|
||||
<set-?>: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.Result' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.Result declared in <root>.timesAssign' type=<root>.Result origin=null
|
||||
other: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.Result' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR 'other: <root>.Result declared in <root>.timesAssign' type=<root>.Result origin=null
|
||||
FUN name:div visibility:public modality:FINAL <> ($receiver:<root>.Result, _context_receiver_0:kotlin.Int, other:<root>.Result) returnType:<root>.Result [operator]
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.Result
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
|
||||
VALUE_PARAMETER name:other index:1 type:<root>.Result
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun <set-operationScore> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-operationScore> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
other: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.div' type=kotlin.Int origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun div (_context_receiver_0: kotlin.Int, other: <root>.Result): <root>.Result [operator] declared in <root>'
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.Result' type=<root>.Result origin=null
|
||||
i: CALL 'public final fun div (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=DIV
|
||||
$this: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.Result' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.Result declared in <root>.div' type=<root>.Result origin=null
|
||||
other: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.Result' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR 'other: <root>.Result declared in <root>.div' type=<root>.Result origin=null
|
||||
FUN name:divAssign visibility:public modality:FINAL <> ($receiver:<root>.Result, _context_receiver_0:kotlin.Int, other:<root>.Result) returnType:kotlin.Unit [operator]
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.Result
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
|
||||
VALUE_PARAMETER name:other index:1 type:<root>.Result
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun <set-operationScore> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-operationScore> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
other: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.divAssign' type=kotlin.Int origin=null
|
||||
CALL 'public final fun <set-i> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.Result' type=kotlin.Unit origin=EQ
|
||||
$this: GET_VAR '<this>: <root>.Result declared in <root>.divAssign' type=<root>.Result origin=null
|
||||
<set-?>: CALL 'public final fun div (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.Result' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.Result declared in <root>.divAssign' type=<root>.Result origin=null
|
||||
other: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.Result' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR 'other: <root>.Result declared in <root>.divAssign' type=<root>.Result origin=null
|
||||
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||
BLOCK_BODY
|
||||
VAR name:result type:<root>.Result [val]
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.Result' type=<root>.Result origin=null
|
||||
i: CONST Int type=kotlin.Int value=0
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.Unit origin=null
|
||||
<T>: kotlin.Int
|
||||
<R>: kotlin.Unit
|
||||
receiver: CONST Int type=kotlin.Int value=1
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<kotlin.Int, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.Unit
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun plusAssign (_context_receiver_0: kotlin.Int, other: <root>.Result): kotlin.Unit [operator] declared in <root>' type=kotlin.Unit origin=null
|
||||
$receiver: GET_VAR 'val result: <root>.Result [val] declared in <root>.box' type=<root>.Result origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
other: CALL 'public final fun plus (_context_receiver_0: kotlin.Int, other: <root>.Result): <root>.Result [operator] declared in <root>' type=<root>.Result origin=PLUS
|
||||
$receiver: CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.Result' type=<root>.Result origin=null
|
||||
i: CONST Int type=kotlin.Int value=1
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
other: CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.Result' type=<root>.Result origin=null
|
||||
i: CONST Int type=kotlin.Int value=1
|
||||
CALL 'public final fun minusAssign (_context_receiver_0: kotlin.Int, other: <root>.Result): kotlin.Unit [operator] declared in <root>' type=kotlin.Unit origin=null
|
||||
$receiver: GET_VAR 'val result: <root>.Result [val] declared in <root>.box' type=<root>.Result origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
other: CALL 'public final fun minus (_context_receiver_0: kotlin.Int, other: <root>.Result): <root>.Result [operator] declared in <root>' type=<root>.Result origin=MINUS
|
||||
$receiver: CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.Result' type=<root>.Result origin=null
|
||||
i: CONST Int type=kotlin.Int value=1
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
other: CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.Result' type=<root>.Result origin=null
|
||||
i: CONST Int type=kotlin.Int value=0
|
||||
CALL 'public final fun timesAssign (_context_receiver_0: kotlin.Int, other: <root>.Result): kotlin.Unit [operator] declared in <root>' type=kotlin.Unit origin=null
|
||||
$receiver: GET_VAR 'val result: <root>.Result [val] declared in <root>.box' type=<root>.Result origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
other: CALL 'public final fun times (_context_receiver_0: kotlin.Int, other: <root>.Result): <root>.Result [operator] declared in <root>' type=<root>.Result origin=MUL
|
||||
$receiver: CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.Result' type=<root>.Result origin=null
|
||||
i: CONST Int type=kotlin.Int value=1
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
other: CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.Result' type=<root>.Result origin=null
|
||||
i: CONST Int type=kotlin.Int value=2
|
||||
CALL 'public final fun divAssign (_context_receiver_0: kotlin.Int, other: <root>.Result): kotlin.Unit [operator] declared in <root>' type=kotlin.Unit origin=null
|
||||
$receiver: GET_VAR 'val result: <root>.Result [val] declared in <root>.box' type=<root>.Result origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
other: CALL 'public final fun div (_context_receiver_0: kotlin.Int, other: <root>.Result): <root>.Result [operator] declared in <root>' type=<root>.Result origin=DIV
|
||||
$receiver: CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.Result' type=<root>.Result origin=null
|
||||
i: CONST Int type=kotlin.Int value=4
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
other: CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.Result' type=<root>.Result origin=null
|
||||
i: CONST Int type=kotlin.Int value=2
|
||||
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
WHEN type=kotlin.String origin=IF
|
||||
BRANCH
|
||||
if: WHEN type=kotlin.Boolean origin=ANDAND
|
||||
BRANCH
|
||||
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||
arg0: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.Result' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR 'val result: <root>.Result [val] declared in <root>.box' type=<root>.Result origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=1
|
||||
then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||
arg0: CALL 'public final fun <get-operationScore> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
arg1: CONST Int type=kotlin.Int value=8
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: CONST Boolean type=kotlin.Boolean value=false
|
||||
then: CONST String type=kotlin.String value="OK"
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: CONST String type=kotlin.String value="fail"
|
||||
Vendored
+106
@@ -0,0 +1,106 @@
|
||||
data class Result {
|
||||
constructor(i: Int) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
var i: Int
|
||||
field = i
|
||||
get
|
||||
set
|
||||
|
||||
operator fun component1(): Int {
|
||||
return <this>.#i
|
||||
}
|
||||
|
||||
fun copy(i: Int = <this>.#i): Result {
|
||||
return Result(i = i)
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
when {
|
||||
EQEQEQ(arg0 = <this>, arg1 = other) -> return true
|
||||
}
|
||||
when {
|
||||
other !is Result -> return false
|
||||
}
|
||||
val tmp0_other_with_cast: Result = other as Result
|
||||
when {
|
||||
EQEQ(arg0 = <this>.#i, arg1 = tmp0_other_with_cast.#i).not() -> return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return <this>.#i.hashCode()
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "Result(" + "i=" + <this>.#i + ")"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var operationScore: Int
|
||||
field = 0
|
||||
get
|
||||
set
|
||||
|
||||
operator fun Result.plus(_context_receiver_0: Int, other: Result): Result {
|
||||
<set-operationScore>(<set-?> = <get-operationScore>().plus(other = _context_receiver_0))
|
||||
return Result(i = <this>.<get-i>().plus(other = other.<get-i>()))
|
||||
}
|
||||
|
||||
operator fun Result.plusAssign(_context_receiver_0: Int, other: Result) {
|
||||
<set-operationScore>(<set-?> = <get-operationScore>().plus(other = _context_receiver_0))
|
||||
<this>.<set-i>(<set-?> = <this>.<get-i>().plus(other = other.<get-i>()))
|
||||
}
|
||||
|
||||
operator fun Result.minus(_context_receiver_0: Int, other: Result): Result {
|
||||
<set-operationScore>(<set-?> = <get-operationScore>().plus(other = _context_receiver_0))
|
||||
return Result(i = <this>.<get-i>().minus(other = other.<get-i>()))
|
||||
}
|
||||
|
||||
operator fun Result.minusAssign(_context_receiver_0: Int, other: Result) {
|
||||
<set-operationScore>(<set-?> = <get-operationScore>().plus(other = _context_receiver_0))
|
||||
<this>.<set-i>(<set-?> = <this>.<get-i>().minus(other = other.<get-i>()))
|
||||
}
|
||||
|
||||
operator fun Result.times(_context_receiver_0: Int, other: Result): Result {
|
||||
<set-operationScore>(<set-?> = <get-operationScore>().plus(other = _context_receiver_0))
|
||||
return Result(i = <this>.<get-i>().times(other = other.<get-i>()))
|
||||
}
|
||||
|
||||
operator fun Result.timesAssign(_context_receiver_0: Int, other: Result) {
|
||||
<set-operationScore>(<set-?> = <get-operationScore>().plus(other = _context_receiver_0))
|
||||
<this>.<set-i>(<set-?> = <this>.<get-i>().times(other = other.<get-i>()))
|
||||
}
|
||||
|
||||
operator fun Result.div(_context_receiver_0: Int, other: Result): Result {
|
||||
<set-operationScore>(<set-?> = <get-operationScore>().plus(other = _context_receiver_0))
|
||||
return Result(i = <this>.<get-i>().div(other = other.<get-i>()))
|
||||
}
|
||||
|
||||
operator fun Result.divAssign(_context_receiver_0: Int, other: Result) {
|
||||
<set-operationScore>(<set-?> = <get-operationScore>().plus(other = _context_receiver_0))
|
||||
<this>.<set-i>(<set-?> = <this>.<get-i>().div(other = other.<get-i>()))
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val result: Result = Result(i = 0)
|
||||
with<Int, Unit>(receiver = 1, block = local fun Int.<anonymous>() {
|
||||
result.plusAssign(_context_receiver_0 = $this$with, other = Result(i = 1).plus(_context_receiver_0 = $this$with, other = Result(i = 1)))
|
||||
result.minusAssign(_context_receiver_0 = $this$with, other = Result(i = 1).minus(_context_receiver_0 = $this$with, other = Result(i = 0)))
|
||||
result.timesAssign(_context_receiver_0 = $this$with, other = Result(i = 1).times(_context_receiver_0 = $this$with, other = Result(i = 2)))
|
||||
result.divAssign(_context_receiver_0 = $this$with, other = Result(i = 4).div(_context_receiver_0 = $this$with, other = Result(i = 2)))
|
||||
}
|
||||
)
|
||||
return when {
|
||||
when {
|
||||
EQEQ(arg0 = result.<get-i>(), arg1 = 1) -> EQEQ(arg0 = <get-operationScore>(), arg1 = 8)
|
||||
else -> false
|
||||
} -> "OK"
|
||||
else -> "fail"
|
||||
}
|
||||
}
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
data class Result(var i: Int)
|
||||
|
||||
|
||||
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
FILE fqName:<root> fileName:/contextualFunctionConversion.kt
|
||||
FUN name:withContext visibility:public modality:FINAL <> (f:kotlin.Function1<kotlin.String, kotlin.String>) returnType:kotlin.String
|
||||
VALUE_PARAMETER name:f index:0 type:kotlin.Function1<kotlin.String, kotlin.String>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun withContext (f: kotlin.Function1<kotlin.String, kotlin.String>): kotlin.String declared in <root>'
|
||||
CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 [operator] declared in kotlin.Function1' type=kotlin.String origin=INVOKE
|
||||
$this: GET_VAR 'f: kotlin.Function1<kotlin.String, kotlin.String> declared in <root>.withContext' type=kotlin.Function1<kotlin.String, kotlin.String> origin=VARIABLE_AS_FUNCTION
|
||||
p1: CONST String type=kotlin.String value="OK"
|
||||
FUN name:callWithContext visibility:public modality:FINAL <> (f:kotlin.Function1<kotlin.String, kotlin.String>) returnType:kotlin.String
|
||||
VALUE_PARAMETER name:f index:0 type:kotlin.Function1<kotlin.String, kotlin.String>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun callWithContext (f: kotlin.Function1<kotlin.String, kotlin.String>): kotlin.String declared in <root>'
|
||||
CALL 'public final fun withContext (f: kotlin.Function1<kotlin.String, kotlin.String>): kotlin.String declared in <root>' type=kotlin.String origin=null
|
||||
f: GET_VAR 'f: kotlin.Function1<kotlin.String, kotlin.String> declared in <root>.callWithContext' type=kotlin.Function1<kotlin.String, kotlin.String> origin=null
|
||||
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CALL 'public final fun callWithContext (f: kotlin.Function1<kotlin.String, kotlin.String>): kotlin.String declared in <root>' type=kotlin.String origin=null
|
||||
f: FUN_EXPR type=kotlin.Function1<kotlin.String, kotlin.String> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (s:kotlin.String) returnType:kotlin.String
|
||||
VALUE_PARAMETER name:s index:0 type:kotlin.String
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (s: kotlin.String): kotlin.String declared in <root>.box'
|
||||
GET_VAR 's: kotlin.String declared in <root>.box.<anonymous>' type=kotlin.String origin=null
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
fun withContext(f: Function1<String, String>): String {
|
||||
return f.invoke(p1 = "OK")
|
||||
}
|
||||
|
||||
fun callWithContext(f: Function1<String, String>): String {
|
||||
return withContext(f = f)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return callWithContext(f = local fun <anonymous>(s: String): String {
|
||||
return s
|
||||
}
|
||||
)
|
||||
}
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
fun withContext(f: context(String) () -> String) = f("OK")
|
||||
|
||||
|
||||
+175
@@ -0,0 +1,175 @@
|
||||
FILE fqName:<root> fileName:/contextualInlineCall.kt
|
||||
CLASS CLASS name:Context modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Context
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.Context [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Context modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||
FUN name:c visibility:public modality:FINAL <> ($this:<root>.Context) returnType:kotlin.Int
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Context
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun c (): kotlin.Int declared in <root>.Context'
|
||||
CONST Int type=kotlin.Int value=1
|
||||
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:testInline visibility:public modality:FINAL <> (_context_receiver_0:<root>.Context) returnType:kotlin.Int [inline]
|
||||
contextReceiverParametersCount: 1
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.Context
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun testInline (_context_receiver_0: <root>.Context): kotlin.Int [inline] declared in <root>'
|
||||
CALL 'public final fun c (): kotlin.Int declared in <root>.Context' type=kotlin.Int origin=null
|
||||
$this: GET_VAR '_context_receiver_0: <root>.Context declared in <root>.testInline' type=<root>.Context origin=null
|
||||
FUN name:testInlineWithArg visibility:public modality:FINAL <> (_context_receiver_0:<root>.Context, i:kotlin.Int) returnType:kotlin.Int [inline]
|
||||
contextReceiverParametersCount: 1
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.Context
|
||||
VALUE_PARAMETER name:i index:1 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun testInlineWithArg (_context_receiver_0: <root>.Context, i: kotlin.Int): kotlin.Int [inline] declared in <root>'
|
||||
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
|
||||
$this: GET_VAR 'i: kotlin.Int declared in <root>.testInlineWithArg' type=kotlin.Int origin=null
|
||||
other: CALL 'public final fun c (): kotlin.Int declared in <root>.Context' type=kotlin.Int origin=null
|
||||
$this: GET_VAR '_context_receiver_0: <root>.Context declared in <root>.testInlineWithArg' type=<root>.Context origin=null
|
||||
FUN name:testInlineWithExtensionAndArg visibility:public modality:FINAL <> ($receiver:kotlin.Int, _context_receiver_0:<root>.Context, i:kotlin.Int) returnType:kotlin.Int [inline]
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Int
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.Context
|
||||
VALUE_PARAMETER name:i index:1 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndArg (_context_receiver_0: <root>.Context, i: kotlin.Int): kotlin.Int [inline] declared in <root>'
|
||||
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 plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
|
||||
$this: GET_VAR '<this>: kotlin.Int declared in <root>.testInlineWithExtensionAndArg' type=kotlin.Int origin=null
|
||||
other: GET_VAR 'i: kotlin.Int declared in <root>.testInlineWithExtensionAndArg' type=kotlin.Int origin=null
|
||||
other: CALL 'public final fun c (): kotlin.Int declared in <root>.Context' type=kotlin.Int origin=null
|
||||
$this: GET_VAR '_context_receiver_0: <root>.Context declared in <root>.testInlineWithExtensionAndArg' type=<root>.Context origin=null
|
||||
FUN name:testInlineWithExtensionAndMultipleArgs visibility:public modality:FINAL <> ($receiver:kotlin.Int, _context_receiver_0:<root>.Context, i1:kotlin.Int, i2:kotlin.Int) returnType:kotlin.Int [inline]
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Int
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.Context
|
||||
VALUE_PARAMETER name:i1 index:1 type:kotlin.Int
|
||||
VALUE_PARAMETER name:i2 index:2 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndMultipleArgs (_context_receiver_0: <root>.Context, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in <root>'
|
||||
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 plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
|
||||
$this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
|
||||
$this: GET_VAR '<this>: kotlin.Int declared in <root>.testInlineWithExtensionAndMultipleArgs' type=kotlin.Int origin=null
|
||||
other: GET_VAR 'i1: kotlin.Int declared in <root>.testInlineWithExtensionAndMultipleArgs' type=kotlin.Int origin=null
|
||||
other: GET_VAR 'i2: kotlin.Int declared in <root>.testInlineWithExtensionAndMultipleArgs' type=kotlin.Int origin=null
|
||||
other: CALL 'public final fun c (): kotlin.Int declared in <root>.Context' type=kotlin.Int origin=null
|
||||
$this: GET_VAR '_context_receiver_0: <root>.Context declared in <root>.testInlineWithExtensionAndMultipleArgs' type=<root>.Context origin=null
|
||||
FUN name:testInlineWithExtensionAndMultipleContextsAndArgs visibility:public modality:FINAL <> ($receiver:kotlin.Int, _context_receiver_0:<root>.Context, _context_receiver_1:kotlin.Any, i1:kotlin.Int, i2:kotlin.Int) returnType:kotlin.Int [inline]
|
||||
contextReceiverParametersCount: 2
|
||||
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Int
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.Context
|
||||
VALUE_PARAMETER name:_context_receiver_1 index:1 type:kotlin.Any
|
||||
VALUE_PARAMETER name:i1 index:2 type:kotlin.Int
|
||||
EXPRESSION_BODY
|
||||
CONST Int type=kotlin.Int value=1
|
||||
VALUE_PARAMETER name:i2 index:3 type:kotlin.Int
|
||||
EXPRESSION_BODY
|
||||
CONST Int type=kotlin.Int value=2
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndMultipleContextsAndArgs (_context_receiver_0: <root>.Context, _context_receiver_1: kotlin.Any, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in <root>'
|
||||
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 plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
|
||||
$this: 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 plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
|
||||
$this: GET_VAR '<this>: kotlin.Int declared in <root>.testInlineWithExtensionAndMultipleContextsAndArgs' type=kotlin.Int origin=null
|
||||
other: GET_VAR 'i1: kotlin.Int declared in <root>.testInlineWithExtensionAndMultipleContextsAndArgs' type=kotlin.Int origin=null
|
||||
other: GET_VAR 'i2: kotlin.Int declared in <root>.testInlineWithExtensionAndMultipleContextsAndArgs' type=kotlin.Int origin=null
|
||||
other: CALL 'public final fun c (): kotlin.Int declared in <root>.Context' type=kotlin.Int origin=null
|
||||
$this: GET_VAR '_context_receiver_0: <root>.Context declared in <root>.testInlineWithExtensionAndMultipleContextsAndArgs' type=<root>.Context origin=null
|
||||
other: WHEN type=kotlin.Int origin=IF
|
||||
BRANCH
|
||||
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||
arg0: GET_VAR '_context_receiver_1: kotlin.Any declared in <root>.testInlineWithExtensionAndMultipleContextsAndArgs' type=kotlin.Any origin=null
|
||||
arg1: CONST Null type=kotlin.Nothing? value=null
|
||||
then: CONST Int type=kotlin.Int value=0
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: CONST Int type=kotlin.Int value=1
|
||||
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null
|
||||
<T>: <root>.Context
|
||||
<R>: kotlin.Nothing
|
||||
receiver: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Context' type=<root>.Context origin=null
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.Context, kotlin.Nothing> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.Context) returnType:kotlin.Nothing
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.Context
|
||||
BLOCK_BODY
|
||||
VAR name:result type:kotlin.Int [var]
|
||||
CONST Int type=kotlin.Int value=0
|
||||
SET_VAR 'var result: kotlin.Int [var] declared in <root>.box.<anonymous>' type=kotlin.Unit origin=PLUSEQ
|
||||
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'var result: kotlin.Int [var] declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
other: CALL 'public final fun testInline (_context_receiver_0: <root>.Context): kotlin.Int [inline] declared in <root>' type=kotlin.Int origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.Context declared in <root>.box.<anonymous>' type=<root>.Context origin=null
|
||||
SET_VAR 'var result: kotlin.Int [var] declared in <root>.box.<anonymous>' type=kotlin.Unit origin=PLUSEQ
|
||||
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'var result: kotlin.Int [var] declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
other: CALL 'public final fun testInlineWithArg (_context_receiver_0: <root>.Context, i: kotlin.Int): kotlin.Int [inline] declared in <root>' type=kotlin.Int origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.Context declared in <root>.box.<anonymous>' type=<root>.Context origin=null
|
||||
i: CONST Int type=kotlin.Int value=1
|
||||
SET_VAR 'var result: kotlin.Int [var] declared in <root>.box.<anonymous>' type=kotlin.Unit origin=PLUSEQ
|
||||
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'var result: kotlin.Int [var] declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
other: CALL 'public final fun testInlineWithExtensionAndArg (_context_receiver_0: <root>.Context, i: kotlin.Int): kotlin.Int [inline] declared in <root>' type=kotlin.Int origin=null
|
||||
$receiver: CONST Int type=kotlin.Int value=1
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.Context declared in <root>.box.<anonymous>' type=<root>.Context origin=null
|
||||
i: CONST Int type=kotlin.Int value=1
|
||||
SET_VAR 'var result: kotlin.Int [var] declared in <root>.box.<anonymous>' type=kotlin.Unit origin=PLUSEQ
|
||||
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'var result: kotlin.Int [var] declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
other: CALL 'public final fun testInlineWithExtensionAndMultipleArgs (_context_receiver_0: <root>.Context, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in <root>' type=kotlin.Int origin=null
|
||||
$receiver: CONST Int type=kotlin.Int value=1
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.Context declared in <root>.box.<anonymous>' type=<root>.Context origin=null
|
||||
i1: CONST Int type=kotlin.Int value=1
|
||||
i2: CONST Int type=kotlin.Int value=2
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.Unit origin=null
|
||||
<T>: kotlin.Int
|
||||
<R>: kotlin.Unit
|
||||
receiver: CONST Int type=kotlin.Int value=1
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<kotlin.Int, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.Unit
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
SET_VAR 'var result: kotlin.Int [var] declared in <root>.box.<anonymous>' type=kotlin.Unit origin=PLUSEQ
|
||||
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'var result: kotlin.Int [var] declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
other: CALL 'public final fun testInlineWithExtensionAndMultipleContextsAndArgs (_context_receiver_0: <root>.Context, _context_receiver_1: kotlin.Any, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in <root>' type=kotlin.Int origin=null
|
||||
$receiver: CONST Int type=kotlin.Int value=1
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.Context declared in <root>.box.<anonymous>' type=<root>.Context origin=null
|
||||
_context_receiver_1: GET_VAR '$this$with: <root>.Context declared in <root>.box.<anonymous>' type=<root>.Context origin=null
|
||||
i1: CONST Int type=kotlin.Int value=1
|
||||
i2: CONST Int type=kotlin.Int value=2
|
||||
SET_VAR 'var result: kotlin.Int [var] declared in <root>.box.<anonymous>' type=kotlin.Unit origin=PLUSEQ
|
||||
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'var result: kotlin.Int [var] declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
other: CALL 'public final fun testInlineWithExtensionAndMultipleContextsAndArgs (_context_receiver_0: <root>.Context, _context_receiver_1: kotlin.Any, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in <root>' type=kotlin.Int origin=null
|
||||
$receiver: CONST Int type=kotlin.Int value=1
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.Context declared in <root>.box.<anonymous>' type=<root>.Context origin=null
|
||||
_context_receiver_1: GET_VAR '$this$with: <root>.Context declared in <root>.box.<anonymous>' type=<root>.Context origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
WHEN type=kotlin.String origin=IF
|
||||
BRANCH
|
||||
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||
arg0: GET_VAR 'var result: kotlin.Int [var] declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=23
|
||||
then: CONST String type=kotlin.String value="OK"
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: CONST String type=kotlin.String value="fail"
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
class Context {
|
||||
constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
fun c(): Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inline fun testInline(_context_receiver_0: Context): Int {
|
||||
return _context_receiver_0.c()
|
||||
}
|
||||
|
||||
inline fun testInlineWithArg(_context_receiver_0: Context, i: Int): Int {
|
||||
return i.plus(other = _context_receiver_0.c())
|
||||
}
|
||||
|
||||
inline fun Int.testInlineWithExtensionAndArg(_context_receiver_0: Context, i: Int): Int {
|
||||
return <this>.plus(other = i).plus(other = _context_receiver_0.c())
|
||||
}
|
||||
|
||||
inline fun Int.testInlineWithExtensionAndMultipleArgs(_context_receiver_0: Context, i1: Int, i2: Int): Int {
|
||||
return <this>.plus(other = i1).plus(other = i2).plus(other = _context_receiver_0.c())
|
||||
}
|
||||
|
||||
inline fun Int.testInlineWithExtensionAndMultipleContextsAndArgs(_context_receiver_0: Context, _context_receiver_1: Any, i1: Int = 1, i2: Int = 2): Int {
|
||||
return <this>.plus(other = i1).plus(other = i2).plus(other = _context_receiver_0.c()).plus(other = when {
|
||||
EQEQ(arg0 = _context_receiver_1, arg1 = null) -> 0
|
||||
else -> 1
|
||||
})
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return with<Context, Nothing>(receiver = Context(), block = local fun Context.<anonymous>(): Nothing {
|
||||
var result: Int = 0
|
||||
result = result.plus(other = testInline(_context_receiver_0 = $this$with))
|
||||
result = result.plus(other = testInlineWithArg(_context_receiver_0 = $this$with, i = 1))
|
||||
result = result.plus(other = 1.testInlineWithExtensionAndArg(_context_receiver_0 = $this$with, i = 1))
|
||||
result = result.plus(other = 1.testInlineWithExtensionAndMultipleArgs(_context_receiver_0 = $this$with, i1 = 1, i2 = 2))
|
||||
with<Int, Unit>(receiver = 1, block = local fun Int.<anonymous>() {
|
||||
result = result.plus(other = 1.testInlineWithExtensionAndMultipleContextsAndArgs(_context_receiver_0 = $this$with, _context_receiver_1 = $this$with, i1 = 1, i2 = 2))
|
||||
result = result.plus(other = 1.testInlineWithExtensionAndMultipleContextsAndArgs(_context_receiver_0 = $this$with, _context_receiver_1 = $this$with))
|
||||
}
|
||||
)
|
||||
return when {
|
||||
EQEQ(arg0 = result, arg1 = 23) -> "OK"
|
||||
else -> "fail"
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
class Context {
|
||||
fun c() = 1
|
||||
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
FILE fqName:<root> fileName:/contextualPrimaryConstructorWithParams.kt
|
||||
CLASS CLASS name:O modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.O
|
||||
CONSTRUCTOR visibility:public <> (o:kotlin.String) returnType:<root>.O [primary]
|
||||
VALUE_PARAMETER name:o index:0 type:kotlin.String
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:O modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||
PROPERTY name:o visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:o type:kotlin.String visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'o: kotlin.String declared in <root>.O.<init>' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-o> visibility:public modality:FINAL <> ($this:<root>.O) returnType:kotlin.String
|
||||
correspondingProperty: PROPERTY name:o visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.O
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-o> (): kotlin.String declared in <root>.O'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:o type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
|
||||
receiver: GET_VAR '<this>: <root>.O declared in <root>.O.<get-o>' type=<root>.O 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
|
||||
CLASS CLASS name:OK modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.OK
|
||||
FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.O visibility:private [final]
|
||||
CONSTRUCTOR visibility:public <> (_context_receiver_0:<root>.O, k:kotlin.String) returnType:<root>.OK [primary]
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.O
|
||||
VALUE_PARAMETER name:k index:1 type:kotlin.String
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:OK modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||
SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.O visibility:private [final]' type=kotlin.Unit origin=null
|
||||
receiver: GET_VAR '<this>: <root>.OK declared in <root>.OK' type=<root>.OK origin=null
|
||||
value: GET_VAR '_context_receiver_0: <root>.O declared in <root>.OK.<init>' type=<root>.O origin=null
|
||||
PROPERTY name:k visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:k type:kotlin.String visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'k: kotlin.String declared in <root>.OK.<init>' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-k> visibility:public modality:FINAL <> ($this:<root>.OK) returnType:kotlin.String
|
||||
correspondingProperty: PROPERTY name:k visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.OK
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-k> (): kotlin.String declared in <root>.OK'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:k type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
|
||||
receiver: GET_VAR '<this>: <root>.OK declared in <root>.OK.<get-k>' type=<root>.OK origin=null
|
||||
PROPERTY name:result visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:result type:kotlin.String visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS
|
||||
$this: CALL 'public final fun <get-o> (): kotlin.String declared in <root>.O' type=kotlin.String origin=GET_PROPERTY
|
||||
$this: GET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.O visibility:private [final]' type=<root>.O origin=null
|
||||
receiver: GET_VAR '<this>: <root>.OK declared in <root>.OK' type=<root>.OK origin=null
|
||||
other: CALL 'public final fun <get-k> (): kotlin.String declared in <root>.OK' type=kotlin.String origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.OK declared in <root>.OK' type=<root>.OK origin=null
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-result> visibility:public modality:FINAL <> ($this:<root>.OK) returnType:kotlin.String
|
||||
correspondingProperty: PROPERTY name:result visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.OK
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-result> (): kotlin.String declared in <root>.OK'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:result type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
|
||||
receiver: GET_VAR '<this>: <root>.OK declared in <root>.OK.<get-result>' type=<root>.OK 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:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.String origin=null
|
||||
<T>: <root>.O
|
||||
<R>: kotlin.String
|
||||
receiver: CONSTRUCTOR_CALL 'public constructor <init> (o: kotlin.String) [primary] declared in <root>.O' type=<root>.O origin=null
|
||||
o: CONST String type=kotlin.String value="O"
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.O, kotlin.String> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.O) returnType:kotlin.String
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.O
|
||||
BLOCK_BODY
|
||||
VAR name:ok type:<root>.OK [val]
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (_context_receiver_0: <root>.O, k: kotlin.String) [primary] declared in <root>.OK' type=<root>.OK origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.O declared in <root>.box.<anonymous>' type=<root>.O origin=null
|
||||
k: CONST String type=kotlin.String value="K"
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.String declared in <root>.box'
|
||||
CALL 'public final fun <get-result> (): kotlin.String declared in <root>.OK' type=kotlin.String origin=GET_PROPERTY
|
||||
$this: GET_VAR 'val ok: <root>.OK [val] declared in <root>.box.<anonymous>' type=<root>.OK origin=null
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
class O {
|
||||
constructor(o: String) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
val o: String
|
||||
field = o
|
||||
get
|
||||
|
||||
}
|
||||
|
||||
class OK {
|
||||
private /* final field */ val contextReceiverField0: O
|
||||
constructor(_context_receiver_0: O, k: String) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
<this>.#contextReceiverField0 = _context_receiver_0
|
||||
}
|
||||
|
||||
val k: String
|
||||
field = k
|
||||
get
|
||||
|
||||
val result: String
|
||||
field = <this>.#contextReceiverField0.<get-o>().plus(other = <this>.<get-k>())
|
||||
get
|
||||
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return with<O, String>(receiver = O(o = "O"), block = local fun O.<anonymous>(): String {
|
||||
val ok: OK = OK(_context_receiver_0 = $this$with, k = "K")
|
||||
return ok.<get-result>()
|
||||
}
|
||||
)
|
||||
}
|
||||
Vendored
+1
-2
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
class O(val o: String)
|
||||
|
||||
@@ -13,4 +12,4 @@ fun box(): String {
|
||||
val ok = OK("K")
|
||||
ok.result
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+166
@@ -0,0 +1,166 @@
|
||||
FILE fqName:<root> fileName:/delegatedPropertiesOperators.kt
|
||||
PROPERTY name:operationScore visibility:public modality:FINAL [var]
|
||||
FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]
|
||||
EXPRESSION_BODY
|
||||
CONST Int type=kotlin.Int value=0
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-operationScore> visibility:public modality:FINAL <> () returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var]
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-operationScore> (): kotlin.Int declared in <root>'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-operationScore> visibility:public modality:FINAL <> (<set-?>:kotlin.Int) returnType:kotlin.Unit
|
||||
correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var]
|
||||
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null
|
||||
value: GET_VAR '<set-?>: kotlin.Int declared in <root>.<set-operationScore>' type=kotlin.Int origin=null
|
||||
CLASS CLASS name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Delegate
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.Delegate [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||
PROPERTY name:delegateValue visibility:public modality:FINAL [var]
|
||||
FIELD PROPERTY_BACKING_FIELD name:delegateValue type:kotlin.String visibility:private
|
||||
EXPRESSION_BODY
|
||||
CONST String type=kotlin.String value="fail"
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-delegateValue> visibility:public modality:FINAL <> ($this:<root>.Delegate) returnType:kotlin.String
|
||||
correspondingProperty: PROPERTY name:delegateValue visibility:public modality:FINAL [var]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Delegate
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-delegateValue> (): kotlin.String declared in <root>.Delegate'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegateValue type:kotlin.String visibility:private' type=kotlin.String origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Delegate declared in <root>.Delegate.<get-delegateValue>' type=<root>.Delegate origin=null
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-delegateValue> visibility:public modality:FINAL <> ($this:<root>.Delegate, <set-?>:kotlin.String) returnType:kotlin.Unit
|
||||
correspondingProperty: PROPERTY name:delegateValue visibility:public modality:FINAL [var]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Delegate
|
||||
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.String
|
||||
BLOCK_BODY
|
||||
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegateValue type:kotlin.String visibility:private' type=kotlin.Unit origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Delegate declared in <root>.Delegate.<set-delegateValue>' type=<root>.Delegate origin=null
|
||||
value: GET_VAR '<set-?>: kotlin.String declared in <root>.Delegate.<set-delegateValue>' type=kotlin.String origin=null
|
||||
FUN name:getValue visibility:public modality:FINAL <> ($this:<root>.Delegate, _context_receiver_0:kotlin.Int, thisRef:kotlin.Any?, property:kotlin.reflect.KProperty<*>) returnType:kotlin.String [operator]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Delegate
|
||||
contextReceiverParametersCount: 1
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
|
||||
VALUE_PARAMETER name:thisRef index:1 type:kotlin.Any?
|
||||
VALUE_PARAMETER name:property index:2 type:kotlin.reflect.KProperty<*>
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun <set-operationScore> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-operationScore> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
other: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.Delegate.getValue' type=kotlin.Int origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun getValue (_context_receiver_0: kotlin.Int, thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): kotlin.String [operator] declared in <root>.Delegate'
|
||||
CALL 'public final fun <get-delegateValue> (): kotlin.String declared in <root>.Delegate' type=kotlin.String origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.Delegate declared in <root>.Delegate.getValue' type=<root>.Delegate origin=null
|
||||
FUN name:setValue visibility:public modality:FINAL <> ($this:<root>.Delegate, _context_receiver_0:kotlin.Int, thisRef:kotlin.Any?, property:kotlin.reflect.KProperty<*>, value:kotlin.String) returnType:kotlin.Unit [operator]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Delegate
|
||||
contextReceiverParametersCount: 1
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
|
||||
VALUE_PARAMETER name:thisRef index:1 type:kotlin.Any?
|
||||
VALUE_PARAMETER name:property index:2 type:kotlin.reflect.KProperty<*>
|
||||
VALUE_PARAMETER name:value index:3 type:kotlin.String
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun <set-operationScore> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-operationScore> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
other: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.Delegate.setValue' type=kotlin.Int origin=null
|
||||
CALL 'public final fun <set-delegateValue> (<set-?>: kotlin.String): kotlin.Unit declared in <root>.Delegate' type=kotlin.Unit origin=EQ
|
||||
$this: GET_VAR '<this>: <root>.Delegate declared in <root>.Delegate.setValue' type=<root>.Delegate origin=null
|
||||
<set-?>: GET_VAR 'value: kotlin.String declared in <root>.Delegate.setValue' type=kotlin.String 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
|
||||
CLASS CLASS name:Result modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Result
|
||||
FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final]
|
||||
CONSTRUCTOR visibility:public <> (_context_receiver_0:kotlin.Int) returnType:<root>.Result [primary]
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Result modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||
SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final]' type=kotlin.Unit origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result' type=<root>.Result origin=null
|
||||
value: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.Result.<init>' type=kotlin.Int origin=null
|
||||
PROPERTY name:s visibility:public modality:FINAL [delegated,var]
|
||||
FIELD PROPERTY_DELEGATE name:s$delegate type:<root>.Delegate visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Delegate' type=<root>.Delegate origin=null
|
||||
FUN DELEGATED_PROPERTY_ACCESSOR name:<get-s> visibility:public modality:FINAL <> ($this:<root>.Result) returnType:kotlin.String
|
||||
correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [delegated,var]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Result
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-s> (): kotlin.String declared in <root>.Result'
|
||||
CALL 'public final fun getValue (_context_receiver_0: kotlin.Int, thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): kotlin.String [operator] declared in <root>.Delegate' type=kotlin.String origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:s$delegate type:<root>.Delegate visibility:private [final]' type=<root>.Delegate origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result.<get-s>' type=<root>.Result origin=null
|
||||
_context_receiver_0: GET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result.<get-s>' type=<root>.Result origin=null
|
||||
thisRef: GET_VAR '<this>: <root>.Result declared in <root>.Result.<get-s>' type=<root>.Result origin=null
|
||||
property: PROPERTY_REFERENCE 'public final s: kotlin.String [delegated,var]' field=null getter='public final fun <get-s> (): kotlin.String declared in <root>.Result' setter='public final fun <set-s> (<set-?>: kotlin.String): kotlin.Unit declared in <root>.Result' type=kotlin.reflect.KMutableProperty1<<root>.Result, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||
FUN DELEGATED_PROPERTY_ACCESSOR name:<set-s> visibility:public modality:FINAL <> ($this:<root>.Result, <set-?>:kotlin.String) returnType:kotlin.Unit
|
||||
correspondingProperty: PROPERTY name:s visibility:public modality:FINAL [delegated,var]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Result
|
||||
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.String
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun setValue (_context_receiver_0: kotlin.Int, thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: kotlin.String): kotlin.Unit [operator] declared in <root>.Delegate' type=kotlin.Unit origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:s$delegate type:<root>.Delegate visibility:private [final]' type=<root>.Delegate origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result.<set-s>' type=<root>.Result origin=null
|
||||
_context_receiver_0: GET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result.<set-s>' type=<root>.Result origin=null
|
||||
thisRef: GET_VAR '<this>: <root>.Result declared in <root>.Result.<set-s>' type=<root>.Result origin=null
|
||||
property: PROPERTY_REFERENCE 'public final s: kotlin.String [delegated,var]' field=null getter='public final fun <get-s> (): kotlin.String declared in <root>.Result' setter='public final fun <set-s> (<set-?>: kotlin.String): kotlin.Unit declared in <root>.Result' type=kotlin.reflect.KMutableProperty1<<root>.Result, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||
value: GET_VAR '<set-?>: kotlin.String declared in <root>.Result.<set-s>' type=kotlin.String 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:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||
BLOCK_BODY
|
||||
VAR name:result type:<root>.Result [val]
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=<root>.Result origin=null
|
||||
<T>: kotlin.Int
|
||||
<R>: <root>.Result
|
||||
receiver: CONST Int type=kotlin.Int value=1
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<kotlin.Int, <root>.Result> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:kotlin.Int) returnType:<root>.Result
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): <root>.Result declared in <root>.box'
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (_context_receiver_0: kotlin.Int) [primary] declared in <root>.Result' type=<root>.Result origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
CALL 'public final fun <set-s> (<set-?>: kotlin.String): kotlin.Unit declared in <root>.Result' type=kotlin.Unit origin=EQ
|
||||
$this: GET_VAR 'val result: <root>.Result [val] declared in <root>.box' type=<root>.Result origin=null
|
||||
<set-?>: CONST String type=kotlin.String value="OK"
|
||||
VAR name:returnValue type:kotlin.String [val]
|
||||
CALL 'public final fun <get-s> (): kotlin.String declared in <root>.Result' type=kotlin.String origin=GET_PROPERTY
|
||||
$this: GET_VAR 'val result: <root>.Result [val] declared in <root>.box' type=<root>.Result origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
WHEN type=kotlin.String origin=IF
|
||||
BRANCH
|
||||
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||
arg0: CALL 'public final fun <get-operationScore> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
arg1: CONST Int type=kotlin.Int value=2
|
||||
then: GET_VAR 'val returnValue: kotlin.String [val] declared in <root>.box' type=kotlin.String origin=null
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: CONST String type=kotlin.String value="fail"
|
||||
Vendored
+61
@@ -0,0 +1,61 @@
|
||||
var operationScore: Int
|
||||
field = 0
|
||||
get
|
||||
set
|
||||
|
||||
class Delegate {
|
||||
constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
var delegateValue: String
|
||||
field = "fail"
|
||||
get
|
||||
set
|
||||
|
||||
operator fun getValue(_context_receiver_0: Int, thisRef: Any?, property: KProperty<*>): String {
|
||||
<set-operationScore>(<set-?> = <get-operationScore>().plus(other = _context_receiver_0))
|
||||
return <this>.<get-delegateValue>()
|
||||
}
|
||||
|
||||
operator fun setValue(_context_receiver_0: Int, thisRef: Any?, property: KProperty<*>, value: String) {
|
||||
<set-operationScore>(<set-?> = <get-operationScore>().plus(other = _context_receiver_0))
|
||||
<this>.<set-delegateValue>(<set-?> = value)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Result {
|
||||
private /* final field */ val contextReceiverField0: Int
|
||||
constructor(_context_receiver_0: Int) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
<this>.#contextReceiverField0 = _context_receiver_0
|
||||
}
|
||||
|
||||
var s: String /* by */
|
||||
field = Delegate()
|
||||
get(): String {
|
||||
return <this>.#s$delegate.getValue(_context_receiver_0 = <this>.#contextReceiverField0, thisRef = <this>, property = Result::s)
|
||||
}
|
||||
set(<set-?>: String) {
|
||||
<this>.#s$delegate.setValue(_context_receiver_0 = <this>.#contextReceiverField0, thisRef = <this>, property = Result::s, value = <set-?>)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val result: Result = with<Int, Result>(receiver = 1, block = local fun Int.<anonymous>(): Result {
|
||||
return Result(_context_receiver_0 = $this$with)
|
||||
}
|
||||
)
|
||||
result.<set-s>(<set-?> = "OK")
|
||||
val returnValue: String = result.<get-s>()
|
||||
return when {
|
||||
EQEQ(arg0 = <get-operationScore>(), arg1 = 2) -> returnValue
|
||||
else -> "fail"
|
||||
}
|
||||
}
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// WITH_STDLIB
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
@@ -33,4 +32,4 @@ fun box(): String {
|
||||
result.s = "OK"
|
||||
val returnValue = result.s
|
||||
return if (operationScore == 2) returnValue else "fail"
|
||||
}
|
||||
}
|
||||
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
FILE fqName:<root> fileName:/canvas.kt
|
||||
CLASS INTERFACE name:Canvas modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Canvas
|
||||
PROPERTY name:suffix visibility:public modality:ABSTRACT [val]
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-suffix> visibility:public modality:ABSTRACT <> ($this:<root>.Canvas) returnType:kotlin.String
|
||||
correspondingProperty: PROPERTY name:suffix visibility:public modality:ABSTRACT [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Canvas
|
||||
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
|
||||
CLASS INTERFACE name:Shape modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Shape
|
||||
FUN name:draw visibility:public modality:ABSTRACT <> ($this:<root>.Shape, _context_receiver_0:<root>.Canvas) returnType:kotlin.String
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Shape
|
||||
contextReceiverParametersCount: 1
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.Canvas
|
||||
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
|
||||
CLASS CLASS name:Circle modality:FINAL visibility:public superTypes:[<root>.Shape]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Circle
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.Circle [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Circle modality:FINAL visibility:public superTypes:[<root>.Shape]'
|
||||
FUN name:draw visibility:public modality:FINAL <> ($this:<root>.Circle, _context_receiver_0:<root>.Canvas) returnType:kotlin.String
|
||||
overridden:
|
||||
public abstract fun draw (_context_receiver_0: <root>.Canvas): kotlin.String declared in <root>.Shape
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Circle
|
||||
contextReceiverParametersCount: 1
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.Canvas
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun draw (_context_receiver_0: <root>.Canvas): kotlin.String declared in <root>.Circle'
|
||||
CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS
|
||||
$this: CONST String type=kotlin.String value="OK"
|
||||
other: CALL 'public abstract fun <get-suffix> (): kotlin.String declared in <root>.Canvas' type=kotlin.String origin=GET_PROPERTY
|
||||
$this: GET_VAR '_context_receiver_0: <root>.Canvas declared in <root>.Circle.draw' type=<root>.Canvas 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 [fake_override,operator] declared in <root>.Shape
|
||||
$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 [fake_override] declared in <root>.Shape
|
||||
$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 [fake_override] declared in <root>.Shape
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
CLASS OBJECT name:MyCanvas modality:FINAL visibility:public superTypes:[<root>.Canvas]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyCanvas
|
||||
CONSTRUCTOR visibility:private <> () returnType:<root>.MyCanvas [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:MyCanvas modality:FINAL visibility:public superTypes:[<root>.Canvas]'
|
||||
PROPERTY name:suffix visibility:public modality:FINAL [val]
|
||||
overridden:
|
||||
public abstract suffix: kotlin.String [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:suffix type:kotlin.String visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
CONST String type=kotlin.String value=""
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-suffix> visibility:public modality:FINAL <> ($this:<root>.MyCanvas) returnType:kotlin.String
|
||||
correspondingProperty: PROPERTY name:suffix visibility:public modality:FINAL [val]
|
||||
overridden:
|
||||
public abstract fun <get-suffix> (): kotlin.String declared in <root>.Canvas
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.MyCanvas
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-suffix> (): kotlin.String declared in <root>.MyCanvas'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:suffix type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
|
||||
receiver: GET_VAR '<this>: <root>.MyCanvas declared in <root>.MyCanvas.<get-suffix>' type=<root>.MyCanvas 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 [fake_override,operator] declared in <root>.Canvas
|
||||
$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 [fake_override] declared in <root>.Canvas
|
||||
$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 [fake_override] declared in <root>.Canvas
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.String origin=null
|
||||
<T>: <root>.MyCanvas
|
||||
<R>: kotlin.String
|
||||
receiver: GET_OBJECT 'CLASS OBJECT name:MyCanvas modality:FINAL visibility:public superTypes:[<root>.Canvas]' type=<root>.MyCanvas
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.MyCanvas, kotlin.String> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.MyCanvas) returnType:kotlin.String
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.MyCanvas
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.String declared in <root>.box'
|
||||
CALL 'public final fun draw (_context_receiver_0: <root>.Canvas): kotlin.String declared in <root>.Circle' type=kotlin.String origin=null
|
||||
$this: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Circle' type=<root>.Circle origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.MyCanvas declared in <root>.box.<anonymous>' type=<root>.MyCanvas origin=null
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
interface Canvas {
|
||||
abstract val suffix: String
|
||||
abstract get
|
||||
|
||||
}
|
||||
|
||||
interface Shape {
|
||||
abstract fun draw(_context_receiver_0: Canvas): String
|
||||
|
||||
}
|
||||
|
||||
class Circle : Shape {
|
||||
constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
override fun draw(_context_receiver_0: Canvas): String {
|
||||
return "OK".plus(other = _context_receiver_0.<get-suffix>())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
object MyCanvas : Canvas {
|
||||
private constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
override val suffix: String
|
||||
field = ""
|
||||
override get
|
||||
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return with<MyCanvas, String>(receiver = MyCanvas, block = local fun MyCanvas.<anonymous>(): String {
|
||||
return Circle().draw(_context_receiver_0 = $this$with)
|
||||
}
|
||||
)
|
||||
}
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
interface Canvas {
|
||||
val suffix: String
|
||||
@@ -20,4 +19,4 @@ object MyCanvas : Canvas {
|
||||
override val suffix = ""
|
||||
}
|
||||
|
||||
fun box() = with(MyCanvas) { Circle().draw() }
|
||||
fun box() = with(MyCanvas) { Circle().draw() }
|
||||
|
||||
+246
@@ -0,0 +1,246 @@
|
||||
FILE fqName:<root> fileName:/compareTo.kt
|
||||
CLASS CLASS name:Pair modality:FINAL visibility:public [data] superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Pair<A of <root>.Pair, B of <root>.Pair>
|
||||
TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false
|
||||
TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false
|
||||
CONSTRUCTOR visibility:public <> (first:A of <root>.Pair, second:B of <root>.Pair) returnType:<root>.Pair<A of <root>.Pair, B of <root>.Pair> [primary]
|
||||
VALUE_PARAMETER name:first index:0 type:A of <root>.Pair
|
||||
VALUE_PARAMETER name:second index:1 type:B of <root>.Pair
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Pair modality:FINAL visibility:public [data] superTypes:[kotlin.Any]'
|
||||
PROPERTY name:first visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:first type:A of <root>.Pair visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'first: A of <root>.Pair declared in <root>.Pair.<init>' type=A of <root>.Pair origin=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-first> visibility:public modality:FINAL <> ($this:<root>.Pair<A of <root>.Pair, B of <root>.Pair>) returnType:A of <root>.Pair
|
||||
correspondingProperty: PROPERTY name:first visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Pair<A of <root>.Pair, B of <root>.Pair>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-first> (): A of <root>.Pair declared in <root>.Pair'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:first type:A of <root>.Pair visibility:private [final]' type=A of <root>.Pair origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Pair<A of <root>.Pair, B of <root>.Pair> declared in <root>.Pair.<get-first>' type=<root>.Pair<A of <root>.Pair, B of <root>.Pair> origin=null
|
||||
PROPERTY name:second visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:second type:B of <root>.Pair visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'second: B of <root>.Pair declared in <root>.Pair.<init>' type=B of <root>.Pair origin=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-second> visibility:public modality:FINAL <> ($this:<root>.Pair<A of <root>.Pair, B of <root>.Pair>) returnType:B of <root>.Pair
|
||||
correspondingProperty: PROPERTY name:second visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Pair<A of <root>.Pair, B of <root>.Pair>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-second> (): B of <root>.Pair declared in <root>.Pair'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of <root>.Pair visibility:private [final]' type=B of <root>.Pair origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Pair<A of <root>.Pair, B of <root>.Pair> declared in <root>.Pair.<get-second>' type=<root>.Pair<A of <root>.Pair, B of <root>.Pair> origin=null
|
||||
FUN name:component1 visibility:public modality:FINAL <> ($this:<root>.Pair<A of <root>.Pair, B of <root>.Pair>) returnType:A of <root>.Pair [operator]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Pair<A of <root>.Pair, B of <root>.Pair>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun component1 (): A of <root>.Pair [operator] declared in <root>.Pair'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:first type:A of <root>.Pair visibility:private [final]' type=A of <root>.Pair origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Pair<A of <root>.Pair, B of <root>.Pair> declared in <root>.Pair.component1' type=<root>.Pair<A of <root>.Pair, B of <root>.Pair> origin=null
|
||||
FUN name:component2 visibility:public modality:FINAL <> ($this:<root>.Pair<A of <root>.Pair, B of <root>.Pair>) returnType:B of <root>.Pair [operator]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Pair<A of <root>.Pair, B of <root>.Pair>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun component2 (): B of <root>.Pair [operator] declared in <root>.Pair'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of <root>.Pair visibility:private [final]' type=B of <root>.Pair origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Pair<A of <root>.Pair, B of <root>.Pair> declared in <root>.Pair.component2' type=<root>.Pair<A of <root>.Pair, B of <root>.Pair> origin=null
|
||||
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.Pair<A of <root>.Pair, B of <root>.Pair>, first:A of <root>.Pair, second:B of <root>.Pair) returnType:<root>.Pair<A of <root>.Pair, B of <root>.Pair>
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Pair<A of <root>.Pair, B of <root>.Pair>
|
||||
VALUE_PARAMETER name:first index:0 type:A of <root>.Pair
|
||||
EXPRESSION_BODY
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:first type:A of <root>.Pair visibility:private [final]' type=A of <root>.Pair origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Pair<A of <root>.Pair, B of <root>.Pair> declared in <root>.Pair.copy' type=<root>.Pair<A of <root>.Pair, B of <root>.Pair> origin=null
|
||||
VALUE_PARAMETER name:second index:1 type:B of <root>.Pair
|
||||
EXPRESSION_BODY
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of <root>.Pair visibility:private [final]' type=B of <root>.Pair origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Pair<A of <root>.Pair, B of <root>.Pair> declared in <root>.Pair.copy' type=<root>.Pair<A of <root>.Pair, B of <root>.Pair> origin=null
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun copy (first: A of <root>.Pair, second: B of <root>.Pair): <root>.Pair<A of <root>.Pair, B of <root>.Pair> declared in <root>.Pair'
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (first: A of <root>.Pair, second: B of <root>.Pair) [primary] declared in <root>.Pair' type=<root>.Pair<A of <root>.Pair, B of <root>.Pair> origin=null
|
||||
<class: A>: kotlin.Any
|
||||
<class: B>: kotlin.Any
|
||||
first: GET_VAR 'first: A of <root>.Pair declared in <root>.Pair.copy' type=A of <root>.Pair origin=null
|
||||
second: GET_VAR 'second: B of <root>.Pair declared in <root>.Pair.copy' type=B of <root>.Pair origin=null
|
||||
FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.Pair<A of <root>.Pair, B of <root>.Pair>, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.Pair<A of <root>.Pair, B of <root>.Pair>
|
||||
VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any?
|
||||
BLOCK_BODY
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ
|
||||
arg0: GET_VAR '<this>: <root>.Pair<A of <root>.Pair, B of <root>.Pair> declared in <root>.Pair.equals' type=<root>.Pair<A of <root>.Pair, B of <root>.Pair> origin=null
|
||||
arg1: GET_VAR 'other: kotlin.Any? declared in <root>.Pair.equals' type=kotlin.Any? origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Pair'
|
||||
CONST Boolean type=kotlin.Boolean value=true
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=<root>.Pair<A of <root>.Pair, B of <root>.Pair>
|
||||
GET_VAR 'other: kotlin.Any? declared in <root>.Pair.equals' type=kotlin.Any? origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Pair'
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:<root>.Pair<A of <root>.Pair, B of <root>.Pair> [val]
|
||||
TYPE_OP type=<root>.Pair<A of <root>.Pair, B of <root>.Pair> origin=CAST typeOperand=<root>.Pair<A of <root>.Pair, B of <root>.Pair>
|
||||
GET_VAR 'other: kotlin.Any? declared in <root>.Pair.equals' type=kotlin.Any? origin=null
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:first type:A of <root>.Pair visibility:private [final]' type=A of <root>.Pair origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Pair<A of <root>.Pair, B of <root>.Pair> declared in <root>.Pair.equals' type=<root>.Pair<A of <root>.Pair, B of <root>.Pair> origin=null
|
||||
arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:first type:A of <root>.Pair visibility:private [final]' type=A of <root>.Pair origin=null
|
||||
receiver: GET_VAR 'val tmp_0: <root>.Pair<A of <root>.Pair, B of <root>.Pair> [val] declared in <root>.Pair.equals' type=<root>.Pair<A of <root>.Pair, B of <root>.Pair> origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Pair'
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of <root>.Pair visibility:private [final]' type=B of <root>.Pair origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Pair<A of <root>.Pair, B of <root>.Pair> declared in <root>.Pair.equals' type=<root>.Pair<A of <root>.Pair, B of <root>.Pair> origin=null
|
||||
arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of <root>.Pair visibility:private [final]' type=B of <root>.Pair origin=null
|
||||
receiver: GET_VAR 'val tmp_0: <root>.Pair<A of <root>.Pair, B of <root>.Pair> [val] declared in <root>.Pair.equals' type=<root>.Pair<A of <root>.Pair, B of <root>.Pair> origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Pair'
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Pair'
|
||||
CONST Boolean type=kotlin.Boolean value=true
|
||||
FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.Pair<A of <root>.Pair, B of <root>.Pair>) returnType:kotlin.Int
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.Pair<A of <root>.Pair, B of <root>.Pair>
|
||||
BLOCK_BODY
|
||||
VAR name:result type:kotlin.Int [var]
|
||||
WHEN type=kotlin.Int origin=null
|
||||
BRANCH
|
||||
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||
arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:first type:A of <root>.Pair visibility:private [final]' type=A of <root>.Pair origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Pair<A of <root>.Pair, B of <root>.Pair> declared in <root>.Pair.hashCode' type=<root>.Pair<A of <root>.Pair, B of <root>.Pair> origin=null
|
||||
arg1: CONST Null type=kotlin.Nothing? value=null
|
||||
then: CONST Int type=kotlin.Int value=0
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:first type:A of <root>.Pair visibility:private [final]' type=A of <root>.Pair origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Pair<A of <root>.Pair, B of <root>.Pair> declared in <root>.Pair.hashCode' type=<root>.Pair<A of <root>.Pair, B of <root>.Pair> origin=null
|
||||
SET_VAR 'var result: kotlin.Int [var] declared in <root>.Pair.hashCode' type=kotlin.Unit origin=EQ
|
||||
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'var result: kotlin.Int [var] declared in <root>.Pair.hashCode' type=kotlin.Int origin=null
|
||||
other: CONST Int type=kotlin.Int value=31
|
||||
other: WHEN type=kotlin.Int origin=null
|
||||
BRANCH
|
||||
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||
arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of <root>.Pair visibility:private [final]' type=B of <root>.Pair origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Pair<A of <root>.Pair, B of <root>.Pair> declared in <root>.Pair.hashCode' type=<root>.Pair<A of <root>.Pair, B of <root>.Pair> origin=null
|
||||
arg1: CONST Null type=kotlin.Nothing? value=null
|
||||
then: CONST Int type=kotlin.Int value=0
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of <root>.Pair visibility:private [final]' type=B of <root>.Pair origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Pair<A of <root>.Pair, B of <root>.Pair> declared in <root>.Pair.hashCode' type=<root>.Pair<A of <root>.Pair, B of <root>.Pair> origin=null
|
||||
RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in <root>.Pair'
|
||||
GET_VAR 'var result: kotlin.Int [var] declared in <root>.Pair.hashCode' type=kotlin.Int origin=null
|
||||
FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.Pair<A of <root>.Pair, B of <root>.Pair>) returnType:kotlin.String
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.Pair<A of <root>.Pair, B of <root>.Pair>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.Pair'
|
||||
STRING_CONCATENATION type=kotlin.String
|
||||
CONST String type=kotlin.String value="Pair("
|
||||
CONST String type=kotlin.String value="first="
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:first type:A of <root>.Pair visibility:private [final]' type=A of <root>.Pair origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Pair<A of <root>.Pair, B of <root>.Pair> declared in <root>.Pair.toString' type=<root>.Pair<A of <root>.Pair, B of <root>.Pair> origin=null
|
||||
CONST String type=kotlin.String value=", "
|
||||
CONST String type=kotlin.String value="second="
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of <root>.Pair visibility:private [final]' type=B of <root>.Pair origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Pair<A of <root>.Pair, B of <root>.Pair> declared in <root>.Pair.toString' type=<root>.Pair<A of <root>.Pair, B of <root>.Pair> origin=null
|
||||
CONST String type=kotlin.String value=")"
|
||||
FUN name:compareTo visibility:public modality:FINAL <T> ($receiver:T of <root>.compareTo, _context_receiver_0:java.util.Comparator<T of <root>.compareTo>, other:T of <root>.compareTo) returnType:kotlin.Int [operator,infix]
|
||||
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:T of <root>.compareTo
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:java.util.Comparator<T of <root>.compareTo>
|
||||
VALUE_PARAMETER name:other index:1 type:T of <root>.compareTo
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun compareTo <T> (_context_receiver_0: java.util.Comparator<T of <root>.compareTo>, other: T of <root>.compareTo): kotlin.Int [operator,infix] declared in <root>'
|
||||
CALL 'public abstract fun compare (p0: @[FlexibleNullability] T of java.util.Comparator?, p1: @[FlexibleNullability] T of java.util.Comparator?): kotlin.Int declared in java.util.Comparator' type=kotlin.Int origin=null
|
||||
$this: GET_VAR '_context_receiver_0: java.util.Comparator<T of <root>.compareTo> declared in <root>.compareTo' type=java.util.Comparator<T of <root>.compareTo> origin=null
|
||||
p0: GET_VAR '<this>: T of <root>.compareTo declared in <root>.compareTo' type=T of <root>.compareTo origin=null
|
||||
p1: GET_VAR 'other: T of <root>.compareTo declared in <root>.compareTo' type=T of <root>.compareTo origin=null
|
||||
PROPERTY name:min visibility:public modality:FINAL [val]
|
||||
FUN name:<get-min> visibility:public modality:FINAL <T> ($receiver:<root>.Pair<T of <root>.<get-min>, T of <root>.<get-min>>, _context_receiver_0:java.util.Comparator<T of <root>.<get-min>>) returnType:T of <root>.<get-min>
|
||||
correspondingProperty: PROPERTY name:min visibility:public modality:FINAL [val]
|
||||
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.Pair<T of <root>.<get-min>, T of <root>.<get-min>>
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:java.util.Comparator<T of <root>.<get-min>>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-min> <T> (_context_receiver_0: java.util.Comparator<T of <root>.<get-min>>): T of <root>.<get-min> declared in <root>'
|
||||
WHEN type=T of <root>.<get-min> origin=IF
|
||||
BRANCH
|
||||
if: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT
|
||||
arg0: CALL 'public final fun compareTo <T> (_context_receiver_0: java.util.Comparator<T of <root>.compareTo>, other: T of <root>.compareTo): kotlin.Int [operator,infix] declared in <root>' type=kotlin.Int origin=null
|
||||
<T>: T of <root>.<get-min>
|
||||
$receiver: CALL 'public final fun <get-first> (): A of <root>.Pair declared in <root>.Pair' type=T of <root>.<get-min> origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.Pair<T of <root>.<get-min>, T of <root>.<get-min>> declared in <root>.<get-min>' type=<root>.Pair<T of <root>.<get-min>, T of <root>.<get-min>> origin=null
|
||||
_context_receiver_0: GET_VAR '_context_receiver_0: java.util.Comparator<T of <root>.<get-min>> declared in <root>.<get-min>' type=java.util.Comparator<T of <root>.<get-min>> origin=null
|
||||
other: CALL 'public final fun <get-second> (): B of <root>.Pair declared in <root>.Pair' type=T of <root>.<get-min> origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.Pair<T of <root>.<get-min>, T of <root>.<get-min>> declared in <root>.<get-min>' type=<root>.Pair<T of <root>.<get-min>, T of <root>.<get-min>> origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=0
|
||||
then: CALL 'public final fun <get-first> (): A of <root>.Pair declared in <root>.Pair' type=T of <root>.<get-min> origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.Pair<T of <root>.<get-min>, T of <root>.<get-min>> declared in <root>.<get-min>' type=<root>.Pair<T of <root>.<get-min>, T of <root>.<get-min>> origin=null
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: CALL 'public final fun <get-second> (): B of <root>.Pair declared in <root>.Pair' type=T of <root>.<get-min> origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.Pair<T of <root>.<get-min>, T of <root>.<get-min>> declared in <root>.<get-min>' type=<root>.Pair<T of <root>.<get-min>, T of <root>.<get-min>> origin=null
|
||||
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||
BLOCK_BODY
|
||||
VAR name:comparator type:java.util.Comparator<@[FlexibleNullability] kotlin.String?> [val]
|
||||
TYPE_OP type=java.util.Comparator<@[FlexibleNullability] kotlin.String?> origin=SAM_CONVERSION typeOperand=java.util.Comparator<@[FlexibleNullability] kotlin.String?>
|
||||
FUN_EXPR type=kotlin.Function2<@[FlexibleNullability] kotlin.String?, @[FlexibleNullability] kotlin.String?, kotlin.Int> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (a:@[FlexibleNullability] kotlin.String?, b:@[FlexibleNullability] kotlin.String?) returnType:kotlin.Int
|
||||
VALUE_PARAMETER name:a index:0 type:@[FlexibleNullability] kotlin.String?
|
||||
VALUE_PARAMETER name:b index:1 type:@[FlexibleNullability] kotlin.String?
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (a: @[FlexibleNullability] kotlin.String?, b: @[FlexibleNullability] kotlin.String?): kotlin.Int declared in <root>.box'
|
||||
WHEN type=kotlin.Int origin=IF
|
||||
BRANCH
|
||||
if: WHEN type=kotlin.Boolean origin=OROR
|
||||
BRANCH
|
||||
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||
arg0: GET_VAR 'a: @[FlexibleNullability] kotlin.String? declared in <root>.box.<anonymous>' type=@[FlexibleNullability] kotlin.String? origin=null
|
||||
arg1: CONST Null type=kotlin.Nothing? value=null
|
||||
then: CONST Boolean type=kotlin.Boolean value=true
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||
arg0: GET_VAR 'b: @[FlexibleNullability] kotlin.String? declared in <root>.box.<anonymous>' type=@[FlexibleNullability] kotlin.String? origin=null
|
||||
arg1: CONST Null type=kotlin.Nothing? value=null
|
||||
then: CONST Int type=kotlin.Int value=0
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: CALL 'public open fun compareTo (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public open fun <get-length> (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR 'a: @[FlexibleNullability] kotlin.String? declared in <root>.box.<anonymous>' type=@[FlexibleNullability] kotlin.String? origin=null
|
||||
other: CALL 'public open fun <get-length> (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR 'b: @[FlexibleNullability] kotlin.String? declared in <root>.box.<anonymous>' type=@[FlexibleNullability] kotlin.String? origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.String origin=null
|
||||
<T>: java.util.Comparator<@[FlexibleNullability] kotlin.String?>
|
||||
<R>: kotlin.String
|
||||
receiver: GET_VAR 'val comparator: java.util.Comparator<@[FlexibleNullability] kotlin.String?> [val] declared in <root>.box' type=java.util.Comparator<@[FlexibleNullability] kotlin.String?> origin=null
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<java.util.Comparator<@[FlexibleNullability] kotlin.String?>, kotlin.String> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:java.util.Comparator<@[FlexibleNullability] kotlin.String?>) returnType:kotlin.String
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:java.util.Comparator<@[FlexibleNullability] kotlin.String?>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.String declared in <root>.box'
|
||||
CALL 'public final fun <get-min> <T> (_context_receiver_0: java.util.Comparator<T of <root>.<get-min>>): T of <root>.<get-min> declared in <root>' type=kotlin.String origin=GET_PROPERTY
|
||||
<T>: kotlin.String
|
||||
$receiver: CONSTRUCTOR_CALL 'public constructor <init> (first: A of <root>.Pair, second: B of <root>.Pair) [primary] declared in <root>.Pair' type=<root>.Pair<kotlin.String, kotlin.String> origin=null
|
||||
<class: A>: kotlin.String
|
||||
<class: B>: kotlin.String
|
||||
first: CONST String type=kotlin.String value="OK"
|
||||
second: CONST String type=kotlin.String value="fail"
|
||||
_context_receiver_0: GET_VAR '$this$with: java.util.Comparator<@[FlexibleNullability] kotlin.String?> declared in <root>.box.<anonymous>' type=java.util.Comparator<@[FlexibleNullability] kotlin.String?> origin=null
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
data class Pair<A : Any?, B : Any?> {
|
||||
constructor(first: A, second: B) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
val first: A
|
||||
field = first
|
||||
get
|
||||
|
||||
val second: B
|
||||
field = second
|
||||
get
|
||||
|
||||
operator fun component1(): A {
|
||||
return <this>.#first
|
||||
}
|
||||
|
||||
operator fun component2(): B {
|
||||
return <this>.#second
|
||||
}
|
||||
|
||||
fun copy(first: A = <this>.#first, second: B = <this>.#second): Pair<A, B> {
|
||||
return Pair<Any, Any>(first = first, second = second)
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
when {
|
||||
EQEQEQ(arg0 = <this>, arg1 = other) -> return true
|
||||
}
|
||||
when {
|
||||
other !is Pair<A, B> -> return false
|
||||
}
|
||||
val tmp0_other_with_cast: Pair<A, B> = other as Pair<A, B>
|
||||
when {
|
||||
EQEQ(arg0 = <this>.#first, arg1 = tmp0_other_with_cast.#first).not() -> return false
|
||||
}
|
||||
when {
|
||||
EQEQ(arg0 = <this>.#second, arg1 = tmp0_other_with_cast.#second).not() -> return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
var result: Int = when {
|
||||
EQEQ(arg0 = <this>.#first, arg1 = null) -> 0
|
||||
else -> <this>.#first.hashCode()
|
||||
}
|
||||
result = result.times(other = 31).plus(other = when {
|
||||
EQEQ(arg0 = <this>.#second, arg1 = null) -> 0
|
||||
else -> <this>.#second.hashCode()
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "Pair(" + "first=" + <this>.#first + ", " + "second=" + <this>.#second + ")"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
infix operator fun <T : Any?> T.compareTo(_context_receiver_0: Comparator<T>, other: T): Int {
|
||||
return _context_receiver_0.compare(p0 = <this>, p1 = other)
|
||||
}
|
||||
|
||||
val <T : Any?> Pair<T, T>.min: T
|
||||
get(_context_receiver_0: Comparator<T>): T {
|
||||
return when {
|
||||
less(arg0 = <this>.<get-first>().compareTo<T>(_context_receiver_0 = _context_receiver_0, other = <this>.<get-second>()), arg1 = 0) -> <this>.<get-first>()
|
||||
else -> <this>.<get-second>()
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val comparator: Comparator<@FlexibleNullability String?> = local fun <anonymous>(a: @FlexibleNullability String?, b: @FlexibleNullability String?): Int {
|
||||
return when {
|
||||
when {
|
||||
EQEQ(arg0 = a, arg1 = null) -> true
|
||||
else -> EQEQ(arg0 = b, arg1 = null)
|
||||
} -> 0
|
||||
else -> a.<get-length>().compareTo(other = b.<get-length>())
|
||||
}
|
||||
}
|
||||
/*-> Comparator<@FlexibleNullability String?> */
|
||||
return with<Comparator<@FlexibleNullability String?>, String>(receiver = comparator, block = local fun Comparator<@FlexibleNullability String?>.<anonymous>(): String {
|
||||
return Pair<String, String>(first = "OK", second = "fail").<get-min><String>(_context_receiver_0 = $this$with)
|
||||
}
|
||||
)
|
||||
}
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
data class Pair<A, B>(val first: A, val second: B)
|
||||
|
||||
@@ -17,4 +16,4 @@ fun box(): String {
|
||||
return with(comparator) {
|
||||
Pair("OK", "fail").min
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
FILE fqName:<root> fileName:/dp.kt
|
||||
CLASS CLASS name:View modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.View
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.View [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:View modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||
PROPERTY name:coefficient visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:coefficient type:kotlin.Int visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
CONST Int type=kotlin.Int value=42
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-coefficient> visibility:public modality:FINAL <> ($this:<root>.View) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:coefficient visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.View
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-coefficient> (): kotlin.Int declared in <root>.View'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:coefficient type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.View declared in <root>.View.<get-coefficient>' type=<root>.View 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
|
||||
PROPERTY name:dp visibility:public modality:FINAL [val]
|
||||
FUN name:<get-dp> visibility:public modality:FINAL <> ($receiver:kotlin.Int, _context_receiver_0:<root>.View) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:dp visibility:public modality:FINAL [val]
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Int
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.View
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-dp> (_context_receiver_0: <root>.View): kotlin.Int declared in <root>'
|
||||
CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=MUL
|
||||
$this: CALL 'public final fun <get-coefficient> (): kotlin.Int declared in <root>.View' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '_context_receiver_0: <root>.View declared in <root>.<get-dp>' type=<root>.View origin=null
|
||||
other: GET_VAR '<this>: kotlin.Int declared in <root>.<get-dp>' type=kotlin.Int origin=null
|
||||
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null
|
||||
<T>: <root>.View
|
||||
<R>: kotlin.Nothing
|
||||
receiver: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.View' type=<root>.View origin=null
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.View, kotlin.Nothing> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.View) returnType:kotlin.Nothing
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.View
|
||||
BLOCK_BODY
|
||||
WHEN type=kotlin.Unit origin=IF
|
||||
BRANCH
|
||||
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||
arg0: CALL 'public final fun map <T, R> (transform: kotlin.Function1<T of kotlin.collections.CollectionsKt.map, R of kotlin.collections.CollectionsKt.map>): kotlin.collections.List<R of kotlin.collections.CollectionsKt.map> [inline] declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List<kotlin.Int> origin=null
|
||||
<T>: kotlin.Int
|
||||
<R>: kotlin.Int
|
||||
$receiver: CALL 'public final fun listOf <T> (vararg elements: T of kotlin.collections.CollectionsKt.listOf): kotlin.collections.List<T of kotlin.collections.CollectionsKt.listOf> declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List<kotlin.Int> origin=null
|
||||
<T>: kotlin.Int
|
||||
elements: VARARG type=kotlin.Array<out kotlin.Int> varargElementType=kotlin.Int
|
||||
CONST Int type=kotlin.Int value=1
|
||||
CONST Int type=kotlin.Int value=2
|
||||
CONST Int type=kotlin.Int value=10
|
||||
transform: FUN_EXPR type=kotlin.Function1<kotlin.Int, kotlin.Int> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:kotlin.Int) returnType:kotlin.Int
|
||||
VALUE_PARAMETER name:it index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (it: kotlin.Int): kotlin.Int declared in <root>.box.<anonymous>'
|
||||
CALL 'public final fun <get-dp> (_context_receiver_0: <root>.View): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
$receiver: GET_VAR 'it: kotlin.Int declared in <root>.box.<anonymous>.<anonymous>' type=kotlin.Int origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.View declared in <root>.box.<anonymous>' type=<root>.View origin=null
|
||||
arg1: CALL 'public final fun listOf <T> (vararg elements: T of kotlin.collections.CollectionsKt.listOf): kotlin.collections.List<T of kotlin.collections.CollectionsKt.listOf> declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List<kotlin.Int> origin=null
|
||||
<T>: kotlin.Int
|
||||
elements: VARARG type=kotlin.Array<out kotlin.Int> varargElementType=kotlin.Int
|
||||
CONST Int type=kotlin.Int value=42
|
||||
CONST Int type=kotlin.Int value=84
|
||||
CONST Int type=kotlin.Int value=420
|
||||
then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CONST String type=kotlin.String value="OK"
|
||||
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CONST String type=kotlin.String value="fail"
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
class View {
|
||||
constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
val coefficient: Int
|
||||
field = 42
|
||||
get
|
||||
|
||||
}
|
||||
|
||||
val Int.dp: Int
|
||||
get(_context_receiver_0: View): Int {
|
||||
return _context_receiver_0.<get-coefficient>().times(other = <this>)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
with<View, Nothing>(receiver = View(), block = local fun View.<anonymous>(): Nothing {
|
||||
when {
|
||||
EQEQ(arg0 = listOf<Int>(elements = [1, 2, 10]).map<Int, Int>(transform = local fun <anonymous>(it: Int): Int {
|
||||
return it.<get-dp>(_context_receiver_0 = $this$with)
|
||||
}
|
||||
), arg1 = listOf<Int>(elements = [42, 84, 420])) -> return "OK"
|
||||
}
|
||||
return "fail"
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// WITH_STDLIB
|
||||
|
||||
class View {
|
||||
@@ -16,4 +15,4 @@ fun box(): String {
|
||||
}
|
||||
return "fail"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+122
@@ -0,0 +1,122 @@
|
||||
FILE fqName:<root> fileName:/functionalType.kt
|
||||
CLASS CLASS name:Param modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Param
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.Param [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Param modality:FINAL 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 [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
|
||||
CLASS CLASS name:O modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.O
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.O [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:O modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||
PROPERTY name:o visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:o type:kotlin.String visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
CONST String type=kotlin.String value="O"
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-o> visibility:public modality:FINAL <> ($this:<root>.O) returnType:kotlin.String
|
||||
correspondingProperty: PROPERTY name:o visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.O
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-o> (): kotlin.String declared in <root>.O'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:o type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
|
||||
receiver: GET_VAR '<this>: <root>.O declared in <root>.O.<get-o>' type=<root>.O 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
|
||||
CLASS CLASS name:K modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.K
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.K [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||
PROPERTY name:k visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:k type:kotlin.String visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
CONST String type=kotlin.String value="K"
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-k> visibility:public modality:FINAL <> ($this:<root>.K) returnType:kotlin.String
|
||||
correspondingProperty: PROPERTY name:k visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.K
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-k> (): kotlin.String declared in <root>.K'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:k type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
|
||||
receiver: GET_VAR '<this>: <root>.K declared in <root>.K.<get-k>' type=<root>.K 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:f visibility:public modality:FINAL <T> ($receiver:<root>.K, _context_receiver_0:<root>.O, g:@[ExtensionFunctionType] kotlin.Function3<<root>.O, <root>.K, <root>.Param, T of <root>.f>) returnType:T of <root>.f
|
||||
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.K
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.O
|
||||
VALUE_PARAMETER name:g index:1 type:@[ExtensionFunctionType] kotlin.Function3<<root>.O, <root>.K, <root>.Param, T of <root>.f>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun f <T> (_context_receiver_0: <root>.O, g: @[ExtensionFunctionType] kotlin.Function3<<root>.O, <root>.K, <root>.Param, T of <root>.f>): T of <root>.f declared in <root>'
|
||||
CALL 'public abstract fun invoke (p1: P1 of kotlin.Function3, p2: P2 of kotlin.Function3, p3: P3 of kotlin.Function3): R of kotlin.Function3 [operator] declared in kotlin.Function3' type=T of <root>.f origin=INVOKE
|
||||
$this: GET_VAR 'g: @[ExtensionFunctionType] kotlin.Function3<<root>.O, <root>.K, <root>.Param, T of <root>.f> declared in <root>.f' type=@[ExtensionFunctionType] kotlin.Function3<<root>.O, <root>.K, <root>.Param, T of <root>.f> origin=VARIABLE_AS_FUNCTION
|
||||
p1: GET_VAR '_context_receiver_0: <root>.O declared in <root>.f' type=<root>.O origin=null
|
||||
p2: GET_VAR '<this>: <root>.K declared in <root>.f' type=<root>.K origin=null
|
||||
p3: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Param' type=<root>.Param origin=null
|
||||
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.String origin=null
|
||||
<T>: <root>.O
|
||||
<R>: kotlin.String
|
||||
receiver: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.O' type=<root>.O origin=null
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.O, kotlin.String> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.O) returnType:kotlin.String
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.O
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.String declared in <root>.box'
|
||||
CALL 'public final fun f <T> (_context_receiver_0: <root>.O, g: @[ExtensionFunctionType] kotlin.Function3<<root>.O, <root>.K, <root>.Param, T of <root>.f>): T of <root>.f declared in <root>' type=kotlin.String origin=null
|
||||
<T>: kotlin.String
|
||||
$receiver: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.K' type=<root>.K origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.O declared in <root>.box.<anonymous>' type=<root>.O origin=null
|
||||
g: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function3<<root>.O, <root>.K, <root>.Param, kotlin.String> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.K, _context_receiver_0:<root>.O, it:<root>.Param) returnType:kotlin.String
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:$this$f type:<root>.K
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.O
|
||||
VALUE_PARAMETER name:it index:1 type:<root>.Param
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (_context_receiver_0: <root>.O, it: <root>.Param): kotlin.String declared in <root>.box.<anonymous>'
|
||||
CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS
|
||||
$this: CALL 'public final fun <get-o> (): kotlin.String declared in <root>.O' type=kotlin.String origin=GET_PROPERTY
|
||||
$this: GET_VAR '$this$with: <root>.O declared in <root>.box.<anonymous>' type=<root>.O origin=null
|
||||
other: CALL 'public final fun <get-k> (): kotlin.String declared in <root>.K' type=kotlin.String origin=GET_PROPERTY
|
||||
$this: GET_VAR '$this$f: <root>.K declared in <root>.box.<anonymous>.<anonymous>' type=<root>.K origin=null
|
||||
Vendored
+48
@@ -0,0 +1,48 @@
|
||||
class Param {
|
||||
constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class O {
|
||||
constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
val o: String
|
||||
field = "O"
|
||||
get
|
||||
|
||||
}
|
||||
|
||||
class K {
|
||||
constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
val k: String
|
||||
field = "K"
|
||||
get
|
||||
|
||||
}
|
||||
|
||||
fun <T : Any?> K.f(_context_receiver_0: O, g: @ExtensionFunctionType Function3<O, K, Param, T>): T {
|
||||
return g.invoke(p1 = _context_receiver_0, p2 = <this>, p3 = Param())
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return with<O, String>(receiver = O(), block = local fun O.<anonymous>(): String {
|
||||
return K().f<String>(_context_receiver_0 = $this$with, g = local fun K.<anonymous>(_context_receiver_0: O, it: Param): String {
|
||||
return $this$with.<get-o>().plus(other = $this$f.<get-k>())
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
class Param
|
||||
class O {
|
||||
@@ -15,4 +14,4 @@ fun <T> K.f(g: context(O) K.(Param) -> T) = g(this@O, this@K, Param())
|
||||
|
||||
fun box() = with(O()) {
|
||||
K().f { o + k }
|
||||
}
|
||||
}
|
||||
|
||||
+199
@@ -0,0 +1,199 @@
|
||||
FILE fqName:<root> fileName:/monoidSum.kt
|
||||
CLASS INTERFACE name:Semigroup modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Semigroup<T of <root>.Semigroup>
|
||||
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false
|
||||
FUN name:combine visibility:public modality:ABSTRACT <> ($this:<root>.Semigroup<T of <root>.Semigroup>, $receiver:T of <root>.Semigroup, other:T of <root>.Semigroup) returnType:T of <root>.Semigroup [infix]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Semigroup<T of <root>.Semigroup>
|
||||
$receiver: VALUE_PARAMETER name:<this> type:T of <root>.Semigroup
|
||||
VALUE_PARAMETER name:other index:0 type:T of <root>.Semigroup
|
||||
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
|
||||
CLASS INTERFACE name:Monoid modality:ABSTRACT visibility:public superTypes:[<root>.Semigroup<T of <root>.Monoid>]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Monoid<T of <root>.Monoid>
|
||||
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false
|
||||
PROPERTY name:unit visibility:public modality:ABSTRACT [val]
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-unit> visibility:public modality:ABSTRACT <> ($this:<root>.Monoid<T of <root>.Monoid>) returnType:T of <root>.Monoid
|
||||
correspondingProperty: PROPERTY name:unit visibility:public modality:ABSTRACT [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Monoid<T of <root>.Monoid>
|
||||
FUN FAKE_OVERRIDE name:combine visibility:public modality:ABSTRACT <> ($this:<root>.Semigroup<T of <root>.Semigroup>, $receiver:T of <root>.Monoid, other:T of <root>.Monoid) returnType:T of <root>.Monoid [fake_override,infix]
|
||||
overridden:
|
||||
public abstract fun combine (other: T of <root>.Semigroup): T of <root>.Semigroup [infix] declared in <root>.Semigroup
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Semigroup<T of <root>.Semigroup>
|
||||
$receiver: VALUE_PARAMETER name:<this> type:T of <root>.Monoid
|
||||
VALUE_PARAMETER name:other index:0 type:T of <root>.Monoid
|
||||
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 [fake_override,operator] declared in <root>.Semigroup
|
||||
$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 [fake_override] declared in <root>.Semigroup
|
||||
$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 [fake_override] declared in <root>.Semigroup
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
CLASS OBJECT name:IntMonoid modality:FINAL visibility:public superTypes:[<root>.Monoid<kotlin.Int>]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.IntMonoid
|
||||
CONSTRUCTOR visibility:private <> () returnType:<root>.IntMonoid [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:IntMonoid modality:FINAL visibility:public superTypes:[<root>.Monoid<kotlin.Int>]'
|
||||
FUN name:combine visibility:public modality:FINAL <> ($this:<root>.IntMonoid, $receiver:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [infix]
|
||||
overridden:
|
||||
public abstract fun combine (other: T of <root>.Monoid): T of <root>.Monoid [fake_override,infix] declared in <root>.Monoid
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.IntMonoid
|
||||
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Int
|
||||
VALUE_PARAMETER name:other index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun combine (other: kotlin.Int): kotlin.Int [infix] declared in <root>.IntMonoid'
|
||||
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
|
||||
$this: GET_VAR '<this>: kotlin.Int declared in <root>.IntMonoid.combine' type=kotlin.Int origin=null
|
||||
other: GET_VAR 'other: kotlin.Int declared in <root>.IntMonoid.combine' type=kotlin.Int origin=null
|
||||
PROPERTY name:unit visibility:public modality:FINAL [val]
|
||||
overridden:
|
||||
public abstract unit: T of <root>.Monoid [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:unit type:kotlin.Int visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
CONST Int type=kotlin.Int value=0
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-unit> visibility:public modality:FINAL <> ($this:<root>.IntMonoid) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:unit visibility:public modality:FINAL [val]
|
||||
overridden:
|
||||
public abstract fun <get-unit> (): T of <root>.Monoid declared in <root>.Monoid
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.IntMonoid
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-unit> (): kotlin.Int declared in <root>.IntMonoid'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:unit type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.IntMonoid declared in <root>.IntMonoid.<get-unit>' type=<root>.IntMonoid 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 [fake_override,operator] declared in <root>.Monoid
|
||||
$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 [fake_override] declared in <root>.Monoid
|
||||
$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 [fake_override] declared in <root>.Monoid
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
CLASS OBJECT name:StringMonoid modality:FINAL visibility:public superTypes:[<root>.Monoid<kotlin.String>]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.StringMonoid
|
||||
CONSTRUCTOR visibility:private <> () returnType:<root>.StringMonoid [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:StringMonoid modality:FINAL visibility:public superTypes:[<root>.Monoid<kotlin.String>]'
|
||||
FUN name:combine visibility:public modality:FINAL <> ($this:<root>.StringMonoid, $receiver:kotlin.String, other:kotlin.String) returnType:kotlin.String [infix]
|
||||
overridden:
|
||||
public abstract fun combine (other: T of <root>.Monoid): T of <root>.Monoid [fake_override,infix] declared in <root>.Monoid
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.StringMonoid
|
||||
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String
|
||||
VALUE_PARAMETER name:other index:0 type:kotlin.String
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun combine (other: kotlin.String): kotlin.String [infix] declared in <root>.StringMonoid'
|
||||
CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS
|
||||
$this: GET_VAR '<this>: kotlin.String declared in <root>.StringMonoid.combine' type=kotlin.String origin=null
|
||||
other: GET_VAR 'other: kotlin.String declared in <root>.StringMonoid.combine' type=kotlin.String origin=null
|
||||
PROPERTY name:unit visibility:public modality:FINAL [val]
|
||||
overridden:
|
||||
public abstract unit: T of <root>.Monoid [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:unit type:kotlin.String visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
CONST String type=kotlin.String value=""
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-unit> visibility:public modality:FINAL <> ($this:<root>.StringMonoid) returnType:kotlin.String
|
||||
correspondingProperty: PROPERTY name:unit visibility:public modality:FINAL [val]
|
||||
overridden:
|
||||
public abstract fun <get-unit> (): T of <root>.Monoid declared in <root>.Monoid
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.StringMonoid
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-unit> (): kotlin.String declared in <root>.StringMonoid'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:unit type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
|
||||
receiver: GET_VAR '<this>: <root>.StringMonoid declared in <root>.StringMonoid.<get-unit>' type=<root>.StringMonoid 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 [fake_override,operator] declared in <root>.Monoid
|
||||
$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 [fake_override] declared in <root>.Monoid
|
||||
$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 [fake_override] declared in <root>.Monoid
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN name:sum visibility:public modality:FINAL <T> ($receiver:kotlin.collections.List<T of <root>.sum>, _context_receiver_0:<root>.Monoid<T of <root>.sum>) returnType:T of <root>.sum
|
||||
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:kotlin.collections.List<T of <root>.sum>
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.Monoid<T of <root>.sum>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun sum <T> (_context_receiver_0: <root>.Monoid<T of <root>.sum>): T of <root>.sum declared in <root>'
|
||||
CALL 'public final fun fold <T, R> (initial: R of kotlin.collections.CollectionsKt.fold, operation: kotlin.Function2<R of kotlin.collections.CollectionsKt.fold, T of kotlin.collections.CollectionsKt.fold, R of kotlin.collections.CollectionsKt.fold>): R of kotlin.collections.CollectionsKt.fold [inline] declared in kotlin.collections.CollectionsKt' type=T of <root>.sum origin=null
|
||||
<T>: T of <root>.sum
|
||||
<R>: T of <root>.sum
|
||||
$receiver: GET_VAR '<this>: kotlin.collections.List<T of <root>.sum> declared in <root>.sum' type=kotlin.collections.List<T of <root>.sum> origin=null
|
||||
initial: CALL 'public abstract fun <get-unit> (): T of <root>.Monoid declared in <root>.Monoid' type=T of <root>.sum origin=GET_PROPERTY
|
||||
$this: GET_VAR '_context_receiver_0: <root>.Monoid<T of <root>.sum> declared in <root>.sum' type=<root>.Monoid<T of <root>.sum> origin=null
|
||||
operation: FUN_EXPR type=kotlin.Function2<T of <root>.sum, T of <root>.sum, T of <root>.sum> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (acc:T of <root>.sum, e:T of <root>.sum) returnType:T of <root>.sum
|
||||
VALUE_PARAMETER name:acc index:0 type:T of <root>.sum
|
||||
VALUE_PARAMETER name:e index:1 type:T of <root>.sum
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (acc: T of <root>.sum, e: T of <root>.sum): T of <root>.sum declared in <root>.sum'
|
||||
CALL 'public abstract fun combine (other: T of <root>.Monoid): T of <root>.Monoid [fake_override,infix] declared in <root>.Monoid' type=T of <root>.sum origin=null
|
||||
$this: GET_VAR '_context_receiver_0: <root>.Monoid<T of <root>.sum> declared in <root>.sum' type=<root>.Monoid<T of <root>.sum> origin=null
|
||||
$receiver: GET_VAR 'acc: T of <root>.sum declared in <root>.sum.<anonymous>' type=T of <root>.sum origin=null
|
||||
other: GET_VAR 'e: T of <root>.sum declared in <root>.sum.<anonymous>' type=T of <root>.sum origin=null
|
||||
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.Int origin=null
|
||||
<T>: <root>.IntMonoid
|
||||
<R>: kotlin.Int
|
||||
receiver: GET_OBJECT 'CLASS OBJECT name:IntMonoid modality:FINAL visibility:public superTypes:[<root>.Monoid<kotlin.Int>]' type=<root>.IntMonoid
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.IntMonoid, kotlin.Int> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.IntMonoid) returnType:kotlin.Int
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.IntMonoid
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.Int declared in <root>.box'
|
||||
CALL 'public final fun sum <T> (_context_receiver_0: <root>.Monoid<T of <root>.sum>): T of <root>.sum declared in <root>' type=kotlin.Int origin=null
|
||||
<T>: kotlin.Int
|
||||
$receiver: CALL 'public final fun listOf <T> (vararg elements: T of kotlin.collections.CollectionsKt.listOf): kotlin.collections.List<T of kotlin.collections.CollectionsKt.listOf> declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List<kotlin.Int> origin=null
|
||||
<T>: kotlin.Int
|
||||
elements: VARARG type=kotlin.Array<out kotlin.Int> varargElementType=kotlin.Int
|
||||
CONST Int type=kotlin.Int value=1
|
||||
CONST Int type=kotlin.Int value=2
|
||||
CONST Int type=kotlin.Int value=3
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.IntMonoid declared in <root>.box.<anonymous>' type=<root>.IntMonoid origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.String origin=null
|
||||
<T>: <root>.StringMonoid
|
||||
<R>: kotlin.String
|
||||
receiver: GET_OBJECT 'CLASS OBJECT name:StringMonoid modality:FINAL visibility:public superTypes:[<root>.Monoid<kotlin.String>]' type=<root>.StringMonoid
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.StringMonoid, kotlin.String> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.StringMonoid) returnType:kotlin.String
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.StringMonoid
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.String declared in <root>.box'
|
||||
CALL 'public final fun sum <T> (_context_receiver_0: <root>.Monoid<T of <root>.sum>): T of <root>.sum declared in <root>' type=kotlin.String origin=null
|
||||
<T>: kotlin.String
|
||||
$receiver: CALL 'public final fun listOf <T> (vararg elements: T of kotlin.collections.CollectionsKt.listOf): kotlin.collections.List<T of kotlin.collections.CollectionsKt.listOf> declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List<kotlin.String> origin=null
|
||||
<T>: kotlin.String
|
||||
elements: VARARG type=kotlin.Array<out kotlin.String> varargElementType=kotlin.String
|
||||
CONST String type=kotlin.String value="O"
|
||||
CONST String type=kotlin.String value="K"
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.StringMonoid declared in <root>.box.<anonymous>' type=<root>.StringMonoid origin=null
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
interface Semigroup<T : Any?> {
|
||||
abstract infix fun T.combine(other: T): T
|
||||
|
||||
}
|
||||
|
||||
interface Monoid<T : Any?> : Semigroup<T> {
|
||||
abstract val unit: T
|
||||
abstract get
|
||||
|
||||
}
|
||||
|
||||
object IntMonoid : Monoid<Int> {
|
||||
private constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
override infix fun Int.combine(other: Int): Int {
|
||||
return <this>.plus(other = other)
|
||||
}
|
||||
|
||||
override val unit: Int
|
||||
field = 0
|
||||
override get
|
||||
|
||||
}
|
||||
|
||||
object StringMonoid : Monoid<String> {
|
||||
private constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
override infix fun String.combine(other: String): String {
|
||||
return <this>.plus(other = other)
|
||||
}
|
||||
|
||||
override val unit: String
|
||||
field = ""
|
||||
override get
|
||||
|
||||
}
|
||||
|
||||
fun <T : Any?> List<T>.sum(_context_receiver_0: Monoid<T>): T {
|
||||
return <this>.fold<T, T>(initial = _context_receiver_0.<get-unit>(), operation = local fun <anonymous>(acc: T, e: T): T {
|
||||
return (_context_receiver_0, acc).combine(other = e)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
with<IntMonoid, Int>(receiver = IntMonoid, block = local fun IntMonoid.<anonymous>(): Int {
|
||||
return listOf<Int>(elements = [1, 2, 3]).sum<Int>(_context_receiver_0 = $this$with)
|
||||
}
|
||||
) /*~> Unit */
|
||||
return with<StringMonoid, String>(receiver = StringMonoid, block = local fun StringMonoid.<anonymous>(): String {
|
||||
return listOf<String>(elements = ["O", "K"]).sum<String>(_context_receiver_0 = $this$with)
|
||||
}
|
||||
)
|
||||
}
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// WITH_STDLIB
|
||||
|
||||
interface Semigroup<T> {
|
||||
@@ -29,4 +28,4 @@ fun box(): String {
|
||||
return with(StringMonoid) {
|
||||
listOf("O", "K").sum()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
FILE fqName:<root> fileName:/function.kt
|
||||
CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$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> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||
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=42
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-c> visibility:public modality:FINAL <> ($this:<root>.C) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:c visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.C
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-c> (): kotlin.Int declared in <root>.C'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.C declared in <root>.C.<get-c>' type=<root>.C 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:foo visibility:public modality:FINAL <> (_context_receiver_0:<root>.C) returnType:kotlin.Unit
|
||||
contextReceiverParametersCount: 1
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.C
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun <get-c> (): kotlin.Int declared in <root>.C' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '_context_receiver_0: <root>.C declared in <root>.foo' type=<root>.C origin=null
|
||||
FUN name:bar visibility:public modality:FINAL <> (c:<root>.C) returnType:kotlin.Unit
|
||||
VALUE_PARAMETER name:c index:0 type:<root>.C
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.Unit origin=null
|
||||
<T>: <root>.C
|
||||
<R>: kotlin.Unit
|
||||
receiver: GET_VAR 'c: <root>.C declared in <root>.bar' type=<root>.C origin=null
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.C, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.C) returnType:kotlin.Unit
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.C
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun foo (_context_receiver_0: <root>.C): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.C declared in <root>.bar.<anonymous>' type=<root>.C origin=null
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
class C {
|
||||
constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
val c: Int
|
||||
field = 42
|
||||
get
|
||||
|
||||
}
|
||||
|
||||
fun foo(_context_receiver_0: C) {
|
||||
_context_receiver_0.<get-c>() /*~> Unit */
|
||||
}
|
||||
|
||||
fun bar(c: C) {
|
||||
with<C, Unit>(receiver = c, block = local fun C.<anonymous>() {
|
||||
foo(_context_receiver_0 = $this$with)
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
class C {
|
||||
val c = 42
|
||||
@@ -14,4 +13,4 @@ fun bar(c: C) {
|
||||
with(c) {
|
||||
foo()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+249
@@ -0,0 +1,249 @@
|
||||
FILE fqName:<root> fileName:/functionalType.kt
|
||||
CLASS CLASS name:Param modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Param
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.Param [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Param modality:FINAL 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 [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
|
||||
CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$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> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||
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=42
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-c> visibility:public modality:FINAL <> ($this:<root>.C) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:c visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.C
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-c> (): kotlin.Int declared in <root>.C'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.C declared in <root>.C.<get-c>' type=<root>.C 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
|
||||
CLASS CLASS name:R modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.R
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.R [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:R modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||
PROPERTY name:r visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:r type:kotlin.Int visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
CONST Int type=kotlin.Int value=42
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-r> visibility:public modality:FINAL <> ($this:<root>.R) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:r visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.R
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-r> (): kotlin.Int declared in <root>.R'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:r type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.R declared in <root>.R.<get-r>' type=<root>.R 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:f1 visibility:public modality:FINAL <> ($receiver:<root>.R, _context_receiver_0:<root>.C, g:@[ExtensionFunctionType] kotlin.Function3<<root>.C, <root>.R, <root>.Param, kotlin.Unit>) returnType:kotlin.Unit
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.R
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.C
|
||||
VALUE_PARAMETER name:g index:1 type:@[ExtensionFunctionType] kotlin.Function3<<root>.C, <root>.R, <root>.Param, kotlin.Unit>
|
||||
BLOCK_BODY
|
||||
CALL 'public abstract fun invoke (p1: P1 of kotlin.Function3, p2: P2 of kotlin.Function3, p3: P3 of kotlin.Function3): R of kotlin.Function3 [operator] declared in kotlin.Function3' type=kotlin.Unit origin=INVOKE
|
||||
$this: GET_VAR 'g: @[ExtensionFunctionType] kotlin.Function3<<root>.C, <root>.R, <root>.Param, kotlin.Unit> declared in <root>.f1' type=@[ExtensionFunctionType] kotlin.Function3<<root>.C, <root>.R, <root>.Param, kotlin.Unit> origin=VARIABLE_AS_FUNCTION
|
||||
p1: GET_VAR '_context_receiver_0: <root>.C declared in <root>.f1' type=<root>.C origin=null
|
||||
p2: GET_VAR '<this>: <root>.R declared in <root>.f1' type=<root>.R origin=null
|
||||
p3: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Param' type=<root>.Param origin=null
|
||||
FUN name:f2 visibility:public modality:FINAL <> (_context_receiver_0:<root>.C, g:kotlin.Function2<<root>.C, <root>.Param, kotlin.Unit>) returnType:kotlin.Unit
|
||||
contextReceiverParametersCount: 1
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.C
|
||||
VALUE_PARAMETER name:g index:1 type:kotlin.Function2<<root>.C, <root>.Param, kotlin.Unit>
|
||||
BLOCK_BODY
|
||||
CALL 'public abstract fun invoke (p1: P1 of kotlin.Function2, p2: P2 of kotlin.Function2): R of kotlin.Function2 [operator] declared in kotlin.Function2' type=kotlin.Unit origin=INVOKE
|
||||
$this: GET_VAR 'g: kotlin.Function2<<root>.C, <root>.Param, kotlin.Unit> declared in <root>.f2' type=kotlin.Function2<<root>.C, <root>.Param, kotlin.Unit> origin=VARIABLE_AS_FUNCTION
|
||||
p1: GET_VAR '_context_receiver_0: <root>.C declared in <root>.f2' type=<root>.C origin=null
|
||||
p2: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Param' type=<root>.Param origin=null
|
||||
FUN name:f3 visibility:public modality:FINAL <> ($receiver:<root>.R, _context_receiver_0:<root>.C, g:@[ExtensionFunctionType] kotlin.Function2<<root>.C, <root>.R, kotlin.Unit>) returnType:kotlin.Unit
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.R
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.C
|
||||
VALUE_PARAMETER name:g index:1 type:@[ExtensionFunctionType] kotlin.Function2<<root>.C, <root>.R, kotlin.Unit>
|
||||
BLOCK_BODY
|
||||
CALL 'public abstract fun invoke (p1: P1 of kotlin.Function2, p2: P2 of kotlin.Function2): R of kotlin.Function2 [operator] declared in kotlin.Function2' type=kotlin.Unit origin=INVOKE
|
||||
$this: GET_VAR 'g: @[ExtensionFunctionType] kotlin.Function2<<root>.C, <root>.R, kotlin.Unit> declared in <root>.f3' type=@[ExtensionFunctionType] kotlin.Function2<<root>.C, <root>.R, kotlin.Unit> origin=VARIABLE_AS_FUNCTION
|
||||
p1: GET_VAR '_context_receiver_0: <root>.C declared in <root>.f3' type=<root>.C origin=null
|
||||
p2: GET_VAR '<this>: <root>.R declared in <root>.f3' type=<root>.R origin=null
|
||||
FUN name:f4 visibility:public modality:FINAL <> (_context_receiver_0:<root>.C, g:kotlin.Function1<<root>.C, kotlin.Unit>) returnType:kotlin.Unit
|
||||
contextReceiverParametersCount: 1
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.C
|
||||
VALUE_PARAMETER name:g index:1 type:kotlin.Function1<<root>.C, kotlin.Unit>
|
||||
BLOCK_BODY
|
||||
CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 [operator] declared in kotlin.Function1' type=kotlin.Unit origin=INVOKE
|
||||
$this: GET_VAR 'g: kotlin.Function1<<root>.C, kotlin.Unit> declared in <root>.f4' type=kotlin.Function1<<root>.C, kotlin.Unit> origin=VARIABLE_AS_FUNCTION
|
||||
p1: GET_VAR '_context_receiver_0: <root>.C declared in <root>.f4' type=<root>.C origin=null
|
||||
FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
VAR name:lf1 type:@[ExtensionFunctionType] kotlin.Function3<<root>.C, <root>.R, <root>.Param, kotlin.Unit> [val]
|
||||
FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function3<<root>.C, <root>.R, <root>.Param, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.R, _context_receiver_0:<root>.C, <unused var>:<root>.Param) returnType:kotlin.Unit
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.R
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.C
|
||||
VALUE_PARAMETER UNDERSCORE_PARAMETER name:<unused var> index:1 type:<root>.Param
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun <get-r> (): kotlin.Int declared in <root>.R' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.R declared in <root>.test.<anonymous>' type=<root>.R origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun <get-c> (): kotlin.Int declared in <root>.C' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '_context_receiver_0: <root>.C declared in <root>.test.<anonymous>' type=<root>.C origin=null
|
||||
VAR name:lf2 type:kotlin.Function2<<root>.C, <root>.Param, kotlin.Unit> [val]
|
||||
FUN_EXPR type=kotlin.Function2<<root>.C, <root>.Param, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (_context_receiver_0:<root>.C, <unused var>:<root>.Param) returnType:kotlin.Unit
|
||||
contextReceiverParametersCount: 1
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.C
|
||||
VALUE_PARAMETER UNDERSCORE_PARAMETER name:<unused var> index:1 type:<root>.Param
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun <get-c> (): kotlin.Int declared in <root>.C' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '_context_receiver_0: <root>.C declared in <root>.test.<anonymous>' type=<root>.C origin=null
|
||||
VAR name:lf3 type:@[ExtensionFunctionType] kotlin.Function2<<root>.C, <root>.R, kotlin.Unit> [val]
|
||||
FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function2<<root>.C, <root>.R, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.R, _context_receiver_0:<root>.C) returnType:kotlin.Unit
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.R
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.C
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun <get-r> (): kotlin.Int declared in <root>.R' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.R declared in <root>.test.<anonymous>' type=<root>.R origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun <get-c> (): kotlin.Int declared in <root>.C' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '_context_receiver_0: <root>.C declared in <root>.test.<anonymous>' type=<root>.C origin=null
|
||||
VAR name:lf4 type:kotlin.Function1<<root>.C, kotlin.Unit> [val]
|
||||
FUN_EXPR type=kotlin.Function1<<root>.C, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (_context_receiver_0:<root>.C) returnType:kotlin.Unit
|
||||
contextReceiverParametersCount: 1
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.C
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun <get-c> (): kotlin.Int declared in <root>.C' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '_context_receiver_0: <root>.C declared in <root>.test.<anonymous>' type=<root>.C origin=null
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.Unit origin=null
|
||||
<T>: <root>.C
|
||||
<R>: kotlin.Unit
|
||||
receiver: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.C' type=<root>.C origin=null
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.C, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.C) returnType:kotlin.Unit
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.C
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.Unit declared in <root>.test'
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.Unit origin=null
|
||||
<T>: <root>.R
|
||||
<R>: kotlin.Unit
|
||||
receiver: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.R' type=<root>.R origin=null
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.R, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.R) returnType:kotlin.Unit
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.R
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun f1 (_context_receiver_0: <root>.C, g: @[ExtensionFunctionType] kotlin.Function3<<root>.C, <root>.R, <root>.Param, kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
$receiver: GET_VAR '$this$with: <root>.R declared in <root>.test.<anonymous>.<anonymous>' type=<root>.R origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.C declared in <root>.test.<anonymous>' type=<root>.C origin=null
|
||||
g: GET_VAR 'val lf1: @[ExtensionFunctionType] kotlin.Function3<<root>.C, <root>.R, <root>.Param, kotlin.Unit> [val] declared in <root>.test' type=@[ExtensionFunctionType] kotlin.Function3<<root>.C, <root>.R, <root>.Param, kotlin.Unit> origin=null
|
||||
CALL 'public final fun f1 (_context_receiver_0: <root>.C, g: @[ExtensionFunctionType] kotlin.Function3<<root>.C, <root>.R, <root>.Param, kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
$receiver: GET_VAR '$this$with: <root>.R declared in <root>.test.<anonymous>.<anonymous>' type=<root>.R origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.C declared in <root>.test.<anonymous>' type=<root>.C origin=null
|
||||
g: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function3<<root>.C, <root>.R, <root>.Param, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.R, _context_receiver_0:<root>.C, <unused var>:<root>.Param) returnType:kotlin.Unit
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:$this$f1 type:<root>.R
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.C
|
||||
VALUE_PARAMETER UNDERSCORE_PARAMETER name:<unused var> index:1 type:<root>.Param
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun <get-r> (): kotlin.Int declared in <root>.R' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '$this$f1: <root>.R declared in <root>.test.<anonymous>.<anonymous>.<anonymous>' type=<root>.R origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun <get-c> (): kotlin.Int declared in <root>.C' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '$this$with: <root>.C declared in <root>.test.<anonymous>' type=<root>.C origin=null
|
||||
CALL 'public final fun f2 (_context_receiver_0: <root>.C, g: kotlin.Function2<<root>.C, <root>.Param, kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.C declared in <root>.test.<anonymous>' type=<root>.C origin=null
|
||||
g: GET_VAR 'val lf2: kotlin.Function2<<root>.C, <root>.Param, kotlin.Unit> [val] declared in <root>.test' type=kotlin.Function2<<root>.C, <root>.Param, kotlin.Unit> origin=null
|
||||
CALL 'public final fun f2 (_context_receiver_0: <root>.C, g: kotlin.Function2<<root>.C, <root>.Param, kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.C declared in <root>.test.<anonymous>' type=<root>.C origin=null
|
||||
g: FUN_EXPR type=kotlin.Function2<<root>.C, <root>.Param, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (_context_receiver_0:<root>.C, <unused var>:<root>.Param) returnType:kotlin.Unit
|
||||
contextReceiverParametersCount: 1
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.C
|
||||
VALUE_PARAMETER UNDERSCORE_PARAMETER name:<unused var> index:1 type:<root>.Param
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun <get-c> (): kotlin.Int declared in <root>.C' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '$this$with: <root>.C declared in <root>.test.<anonymous>' type=<root>.C origin=null
|
||||
CALL 'public final fun f3 (_context_receiver_0: <root>.C, g: @[ExtensionFunctionType] kotlin.Function2<<root>.C, <root>.R, kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
$receiver: GET_VAR '$this$with: <root>.R declared in <root>.test.<anonymous>.<anonymous>' type=<root>.R origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.C declared in <root>.test.<anonymous>' type=<root>.C origin=null
|
||||
g: GET_VAR 'val lf3: @[ExtensionFunctionType] kotlin.Function2<<root>.C, <root>.R, kotlin.Unit> [val] declared in <root>.test' type=@[ExtensionFunctionType] kotlin.Function2<<root>.C, <root>.R, kotlin.Unit> origin=null
|
||||
CALL 'public final fun f3 (_context_receiver_0: <root>.C, g: @[ExtensionFunctionType] kotlin.Function2<<root>.C, <root>.R, kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
$receiver: GET_VAR '$this$with: <root>.R declared in <root>.test.<anonymous>.<anonymous>' type=<root>.R origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.C declared in <root>.test.<anonymous>' type=<root>.C origin=null
|
||||
g: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function2<<root>.C, <root>.R, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.R, _context_receiver_0:<root>.C) returnType:kotlin.Unit
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:$this$f3 type:<root>.R
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.C
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun <get-r> (): kotlin.Int declared in <root>.R' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '$this$f3: <root>.R declared in <root>.test.<anonymous>.<anonymous>.<anonymous>' type=<root>.R origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun <get-c> (): kotlin.Int declared in <root>.C' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '$this$with: <root>.C declared in <root>.test.<anonymous>' type=<root>.C origin=null
|
||||
CALL 'public final fun f4 (_context_receiver_0: <root>.C, g: kotlin.Function1<<root>.C, kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.C declared in <root>.test.<anonymous>' type=<root>.C origin=null
|
||||
g: GET_VAR 'val lf4: kotlin.Function1<<root>.C, kotlin.Unit> [val] declared in <root>.test' type=kotlin.Function1<<root>.C, kotlin.Unit> origin=null
|
||||
CALL 'public final fun f4 (_context_receiver_0: <root>.C, g: kotlin.Function1<<root>.C, kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.C declared in <root>.test.<anonymous>' type=<root>.C origin=null
|
||||
g: FUN_EXPR type=kotlin.Function1<<root>.C, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (_context_receiver_0:<root>.C) returnType:kotlin.Unit
|
||||
contextReceiverParametersCount: 1
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.C
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun <get-c> (): kotlin.Int declared in <root>.C' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '$this$with: <root>.C declared in <root>.test.<anonymous>' type=<root>.C origin=null
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
class Param {
|
||||
constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class C {
|
||||
constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
val c: Int
|
||||
field = 42
|
||||
get
|
||||
|
||||
}
|
||||
|
||||
class R {
|
||||
constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
val r: Int
|
||||
field = 42
|
||||
get
|
||||
|
||||
}
|
||||
|
||||
fun R.f1(_context_receiver_0: C, g: @ExtensionFunctionType Function3<C, R, Param, Unit>) {
|
||||
g.invoke(p1 = _context_receiver_0, p2 = <this>, p3 = Param())
|
||||
}
|
||||
|
||||
fun f2(_context_receiver_0: C, g: Function2<C, Param, Unit>) {
|
||||
g.invoke(p1 = _context_receiver_0, p2 = Param())
|
||||
}
|
||||
|
||||
fun R.f3(_context_receiver_0: C, g: @ExtensionFunctionType Function2<C, R, Unit>) {
|
||||
g.invoke(p1 = _context_receiver_0, p2 = <this>)
|
||||
}
|
||||
|
||||
fun f4(_context_receiver_0: C, g: Function1<C, Unit>) {
|
||||
g.invoke(p1 = _context_receiver_0)
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val lf1: @ExtensionFunctionType Function3<C, R, Param, Unit> = local fun R.<anonymous>(_context_receiver_0: C, <unused var>: Param) {
|
||||
<this>.<get-r>() /*~> Unit */
|
||||
_context_receiver_0.<get-c>() /*~> Unit */
|
||||
}
|
||||
|
||||
val lf2: Function2<C, Param, Unit> = local fun <anonymous>(_context_receiver_0: C, <unused var>: Param) {
|
||||
_context_receiver_0.<get-c>() /*~> Unit */
|
||||
}
|
||||
|
||||
val lf3: @ExtensionFunctionType Function2<C, R, Unit> = local fun R.<anonymous>(_context_receiver_0: C) {
|
||||
<this>.<get-r>() /*~> Unit */
|
||||
_context_receiver_0.<get-c>() /*~> Unit */
|
||||
}
|
||||
|
||||
val lf4: Function1<C, Unit> = local fun <anonymous>(_context_receiver_0: C) {
|
||||
_context_receiver_0.<get-c>() /*~> Unit */
|
||||
}
|
||||
|
||||
with<C, Unit>(receiver = C(), block = local fun C.<anonymous>() {
|
||||
return with<R, Unit>(receiver = R(), block = local fun R.<anonymous>() {
|
||||
$this$with.f1(_context_receiver_0 = $this$with, g = lf1)
|
||||
$this$with.f1(_context_receiver_0 = $this$with, g = local fun R.<anonymous>(_context_receiver_0: C, <unused var>: Param) {
|
||||
$this$f1.<get-r>() /*~> Unit */
|
||||
$this$with.<get-c>() /*~> Unit */
|
||||
}
|
||||
)
|
||||
f2(_context_receiver_0 = $this$with, g = lf2)
|
||||
f2(_context_receiver_0 = $this$with, g = local fun <anonymous>(_context_receiver_0: C, <unused var>: Param) {
|
||||
$this$with.<get-c>() /*~> Unit */
|
||||
}
|
||||
)
|
||||
$this$with.f3(_context_receiver_0 = $this$with, g = lf3)
|
||||
$this$with.f3(_context_receiver_0 = $this$with, g = local fun R.<anonymous>(_context_receiver_0: C) {
|
||||
$this$f3.<get-r>() /*~> Unit */
|
||||
$this$with.<get-c>() /*~> Unit */
|
||||
}
|
||||
)
|
||||
f4(_context_receiver_0 = $this$with, g = lf4)
|
||||
f4(_context_receiver_0 = $this$with, g = local fun <anonymous>(_context_receiver_0: C) {
|
||||
$this$with.<get-c>() /*~> Unit */
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
+1
-2
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
class Param
|
||||
class C {
|
||||
@@ -70,4 +69,4 @@ fun test() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+16
-4
@@ -2,10 +2,15 @@ FILE fqName:<root> fileName:/genericOuterClass.kt
|
||||
CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A<T of <root>.A>
|
||||
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.A<T of <root>.A> [primary]
|
||||
FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:T of <root>.A visibility:private [final]
|
||||
CONSTRUCTOR visibility:public <> (_context_receiver_0:T of <root>.A) returnType:<root>.A<T of <root>.A> [primary]
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:T of <root>.A
|
||||
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]'
|
||||
SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:T of <root>.A visibility:private [final]' type=kotlin.Unit origin=null
|
||||
receiver: GET_VAR '<this>: <root>.A<T of <root>.A> declared in <root>.A' type=<root>.A<T of <root>.A> origin=null
|
||||
value: GET_VAR '_context_receiver_0: T of <root>.A declared in <root>.A.<init>' type=T of <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
|
||||
@@ -22,10 +27,15 @@ FILE fqName:<root> fileName:/genericOuterClass.kt
|
||||
CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.B<P of <root>.B>
|
||||
TYPE_PARAMETER name:P index:0 variance: superTypes:[kotlin.Any?] reified:false
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.B<P of <root>.B> [primary]
|
||||
FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.collections.Collection<P of <root>.B> visibility:private [final]
|
||||
CONSTRUCTOR visibility:public <> (_context_receiver_0:kotlin.collections.Collection<P of <root>.B>) returnType:<root>.B<P of <root>.B> [primary]
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.collections.Collection<P of <root>.B>
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||
SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.collections.Collection<P of <root>.B> visibility:private [final]' type=kotlin.Unit origin=null
|
||||
receiver: GET_VAR '<this>: <root>.B<P of <root>.B> declared in <root>.B' type=<root>.B<P of <root>.B> origin=null
|
||||
value: GET_VAR '_context_receiver_0: kotlin.collections.Collection<P of <root>.B> declared in <root>.B.<init>' type=kotlin.collections.Collection<P of <root>.B> 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
|
||||
@@ -43,11 +53,13 @@ FILE fqName:<root> fileName:/genericOuterClass.kt
|
||||
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.A' type=<root>.A<kotlin.Int> origin=null
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (_context_receiver_0: T of <root>.A) [primary] declared in <root>.A' type=<root>.A<kotlin.Int> origin=null
|
||||
<class: T>: kotlin.Int
|
||||
_context_receiver_0: GET_VAR '<this>: kotlin.Int declared in <root>.foo' type=kotlin.Int origin=null
|
||||
FUN name:bar visibility:public modality:FINAL <> ($receiver:kotlin.collections.Collection<kotlin.Int>) returnType:kotlin.Unit
|
||||
$receiver: VALUE_PARAMETER name:<this> type:kotlin.collections.Collection<kotlin.Int>
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.B' type=<root>.B<kotlin.Int> origin=null
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (_context_receiver_0: kotlin.collections.Collection<P of <root>.B>) [primary] declared in <root>.B' type=<root>.B<kotlin.Int> origin=null
|
||||
<class: P>: kotlin.Int
|
||||
_context_receiver_0: GET_VAR '<this>: kotlin.collections.Collection<kotlin.Int> declared in <root>.bar' type=kotlin.collections.Collection<kotlin.Int> origin=null
|
||||
|
||||
+8
-4
@@ -1,25 +1,29 @@
|
||||
class A<T : Any?> {
|
||||
constructor() /* primary */ {
|
||||
private /* final field */ val contextReceiverField0: T
|
||||
constructor(_context_receiver_0: T) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
<this>.#contextReceiverField0 = _context_receiver_0
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class B<P : Any?> {
|
||||
constructor() /* primary */ {
|
||||
private /* final field */ val contextReceiverField0: Collection<P>
|
||||
constructor(_context_receiver_0: Collection<P>) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
<this>.#contextReceiverField0 = _context_receiver_0
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun Int.foo() {
|
||||
A<Int>() /*~> Unit */
|
||||
A<Int>(_context_receiver_0 = <this>) /*~> Unit */
|
||||
}
|
||||
|
||||
fun Collection<Int>.bar() {
|
||||
B<Int>() /*~> Unit */
|
||||
B<Int>(_context_receiver_0 = <this>) /*~> Unit */
|
||||
}
|
||||
|
||||
+315
@@ -0,0 +1,315 @@
|
||||
FILE fqName:<root> fileName:/iteratorOperator.kt
|
||||
CLASS CLASS name:Counter modality:FINAL visibility:public [data] superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Counter
|
||||
CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:<root>.Counter [primary]
|
||||
VALUE_PARAMETER name:i index:0 type:kotlin.Int
|
||||
EXPRESSION_BODY
|
||||
CONST Int type=kotlin.Int value=0
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Counter modality:FINAL visibility:public [data] superTypes:[kotlin.Any]'
|
||||
PROPERTY name:i visibility:public modality:FINAL [var]
|
||||
FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'i: kotlin.Int declared in <root>.Counter.<init>' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-i> visibility:public modality:FINAL <> ($this:<root>.Counter) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:i visibility:public modality:FINAL [var]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Counter
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-i> (): kotlin.Int declared in <root>.Counter'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Counter declared in <root>.Counter.<get-i>' type=<root>.Counter origin=null
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-i> visibility:public modality:FINAL <> ($this:<root>.Counter, <set-?>:kotlin.Int) returnType:kotlin.Unit
|
||||
correspondingProperty: PROPERTY name:i visibility:public modality:FINAL [var]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Counter
|
||||
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Counter declared in <root>.Counter.<set-i>' type=<root>.Counter origin=null
|
||||
value: GET_VAR '<set-?>: kotlin.Int declared in <root>.Counter.<set-i>' type=kotlin.Int origin=null
|
||||
FUN name:component1 visibility:public modality:FINAL <> ($this:<root>.Counter) returnType:kotlin.Int [operator]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Counter
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int [operator] declared in <root>.Counter'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Counter declared in <root>.Counter.component1' type=<root>.Counter origin=null
|
||||
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.Counter, i:kotlin.Int) returnType:<root>.Counter
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Counter
|
||||
VALUE_PARAMETER name:i index:0 type:kotlin.Int
|
||||
EXPRESSION_BODY
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Counter declared in <root>.Counter.copy' type=<root>.Counter origin=null
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun copy (i: kotlin.Int): <root>.Counter declared in <root>.Counter'
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.Counter' type=<root>.Counter origin=null
|
||||
i: GET_VAR 'i: kotlin.Int declared in <root>.Counter.copy' type=kotlin.Int origin=null
|
||||
FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.Counter, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.Counter
|
||||
VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any?
|
||||
BLOCK_BODY
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ
|
||||
arg0: GET_VAR '<this>: <root>.Counter declared in <root>.Counter.equals' type=<root>.Counter origin=null
|
||||
arg1: GET_VAR 'other: kotlin.Any? declared in <root>.Counter.equals' type=kotlin.Any? origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Counter'
|
||||
CONST Boolean type=kotlin.Boolean value=true
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=<root>.Counter
|
||||
GET_VAR 'other: kotlin.Any? declared in <root>.Counter.equals' type=kotlin.Any? origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Counter'
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:<root>.Counter [val]
|
||||
TYPE_OP type=<root>.Counter origin=CAST typeOperand=<root>.Counter
|
||||
GET_VAR 'other: kotlin.Any? declared in <root>.Counter.equals' type=kotlin.Any? origin=null
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Counter declared in <root>.Counter.equals' type=<root>.Counter origin=null
|
||||
arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR 'val tmp_0: <root>.Counter [val] declared in <root>.Counter.equals' type=<root>.Counter origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Counter'
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Counter'
|
||||
CONST Boolean type=kotlin.Boolean value=true
|
||||
FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.Counter) returnType:kotlin.Int
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.Counter
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in <root>.Counter'
|
||||
CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Counter declared in <root>.Counter.hashCode' type=<root>.Counter origin=null
|
||||
FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.Counter) returnType:kotlin.String
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.Counter
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.Counter'
|
||||
STRING_CONCATENATION type=kotlin.String
|
||||
CONST String type=kotlin.String value="Counter("
|
||||
CONST String type=kotlin.String value="i="
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Counter declared in <root>.Counter.toString' type=<root>.Counter origin=null
|
||||
CONST String type=kotlin.String value=")"
|
||||
CLASS CLASS name:CounterConfig modality:FINAL visibility:public [data] superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.CounterConfig
|
||||
CONSTRUCTOR visibility:public <> (max:kotlin.Int) returnType:<root>.CounterConfig [primary]
|
||||
VALUE_PARAMETER name:max index:0 type:kotlin.Int
|
||||
EXPRESSION_BODY
|
||||
CONST Int type=kotlin.Int value=10
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CounterConfig modality:FINAL visibility:public [data] superTypes:[kotlin.Any]'
|
||||
PROPERTY name:max visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'max: kotlin.Int declared in <root>.CounterConfig.<init>' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-max> visibility:public modality:FINAL <> ($this:<root>.CounterConfig) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:max visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.CounterConfig
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-max> (): kotlin.Int declared in <root>.CounterConfig'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.CounterConfig declared in <root>.CounterConfig.<get-max>' type=<root>.CounterConfig origin=null
|
||||
FUN name:component1 visibility:public modality:FINAL <> ($this:<root>.CounterConfig) returnType:kotlin.Int [operator]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.CounterConfig
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int [operator] declared in <root>.CounterConfig'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.CounterConfig declared in <root>.CounterConfig.component1' type=<root>.CounterConfig origin=null
|
||||
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.CounterConfig, max:kotlin.Int) returnType:<root>.CounterConfig
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.CounterConfig
|
||||
VALUE_PARAMETER name:max index:0 type:kotlin.Int
|
||||
EXPRESSION_BODY
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.CounterConfig declared in <root>.CounterConfig.copy' type=<root>.CounterConfig origin=null
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun copy (max: kotlin.Int): <root>.CounterConfig declared in <root>.CounterConfig'
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (max: kotlin.Int) [primary] declared in <root>.CounterConfig' type=<root>.CounterConfig origin=null
|
||||
max: GET_VAR 'max: kotlin.Int declared in <root>.CounterConfig.copy' type=kotlin.Int origin=null
|
||||
FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.CounterConfig, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.CounterConfig
|
||||
VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any?
|
||||
BLOCK_BODY
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ
|
||||
arg0: GET_VAR '<this>: <root>.CounterConfig declared in <root>.CounterConfig.equals' type=<root>.CounterConfig origin=null
|
||||
arg1: GET_VAR 'other: kotlin.Any? declared in <root>.CounterConfig.equals' type=kotlin.Any? origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.CounterConfig'
|
||||
CONST Boolean type=kotlin.Boolean value=true
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=<root>.CounterConfig
|
||||
GET_VAR 'other: kotlin.Any? declared in <root>.CounterConfig.equals' type=kotlin.Any? origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.CounterConfig'
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:<root>.CounterConfig [val]
|
||||
TYPE_OP type=<root>.CounterConfig origin=CAST typeOperand=<root>.CounterConfig
|
||||
GET_VAR 'other: kotlin.Any? declared in <root>.CounterConfig.equals' type=kotlin.Any? origin=null
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.CounterConfig declared in <root>.CounterConfig.equals' type=<root>.CounterConfig origin=null
|
||||
arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR 'val tmp_1: <root>.CounterConfig [val] declared in <root>.CounterConfig.equals' type=<root>.CounterConfig origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.CounterConfig'
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.CounterConfig'
|
||||
CONST Boolean type=kotlin.Boolean value=true
|
||||
FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.CounterConfig) returnType:kotlin.Int
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.CounterConfig
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in <root>.CounterConfig'
|
||||
CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.CounterConfig declared in <root>.CounterConfig.hashCode' type=<root>.CounterConfig origin=null
|
||||
FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.CounterConfig) returnType:kotlin.String
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.CounterConfig
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.CounterConfig'
|
||||
STRING_CONCATENATION type=kotlin.String
|
||||
CONST String type=kotlin.String value="CounterConfig("
|
||||
CONST String type=kotlin.String value="max="
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.CounterConfig declared in <root>.CounterConfig.toString' type=<root>.CounterConfig origin=null
|
||||
CONST String type=kotlin.String value=")"
|
||||
CLASS CLASS name:CounterIterator modality:FINAL visibility:public superTypes:[kotlin.collections.Iterator<kotlin.Int>]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.CounterIterator
|
||||
FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.CounterConfig visibility:private [final]
|
||||
CONSTRUCTOR visibility:public <> (_context_receiver_0:<root>.CounterConfig, counter:<root>.Counter) returnType:<root>.CounterIterator [primary]
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.CounterConfig
|
||||
VALUE_PARAMETER name:counter index:1 type:<root>.Counter
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CounterIterator modality:FINAL visibility:public superTypes:[kotlin.collections.Iterator<kotlin.Int>]'
|
||||
SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.CounterConfig visibility:private [final]' type=kotlin.Unit origin=null
|
||||
receiver: GET_VAR '<this>: <root>.CounterIterator declared in <root>.CounterIterator' type=<root>.CounterIterator origin=null
|
||||
value: GET_VAR '_context_receiver_0: <root>.CounterConfig declared in <root>.CounterIterator.<init>' type=<root>.CounterConfig origin=null
|
||||
PROPERTY name:counter visibility:private modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:counter type:<root>.Counter visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'counter: <root>.Counter declared in <root>.CounterIterator.<init>' type=<root>.Counter origin=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-counter> visibility:private modality:FINAL <> ($this:<root>.CounterIterator) returnType:<root>.Counter
|
||||
correspondingProperty: PROPERTY name:counter visibility:private modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.CounterIterator
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='private final fun <get-counter> (): <root>.Counter declared in <root>.CounterIterator'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:<root>.Counter visibility:private [final]' type=<root>.Counter origin=null
|
||||
receiver: GET_VAR '<this>: <root>.CounterIterator declared in <root>.CounterIterator.<get-counter>' type=<root>.CounterIterator origin=null
|
||||
FUN name:hasNext visibility:public modality:FINAL <> ($this:<root>.CounterIterator) returnType:kotlin.Boolean [operator]
|
||||
overridden:
|
||||
public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.CounterIterator
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun hasNext (): kotlin.Boolean [operator] declared in <root>.CounterIterator'
|
||||
CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT
|
||||
arg0: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.Counter' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: CALL 'private final fun <get-counter> (): <root>.Counter declared in <root>.CounterIterator' type=<root>.Counter origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.CounterIterator declared in <root>.CounterIterator.hasNext' type=<root>.CounterIterator origin=null
|
||||
arg1: CALL 'public final fun <get-max> (): kotlin.Int declared in <root>.CounterConfig' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.CounterConfig visibility:private [final]' type=<root>.CounterConfig origin=null
|
||||
receiver: GET_VAR '<this>: <root>.CounterIterator declared in <root>.CounterIterator.hasNext' type=<root>.CounterIterator origin=null
|
||||
FUN name:next visibility:public modality:FINAL <> ($this:<root>.CounterIterator) returnType:kotlin.Int [operator]
|
||||
overridden:
|
||||
public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.CounterIterator
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun next (): kotlin.Int [operator] declared in <root>.CounterIterator'
|
||||
BLOCK type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:<root>.Counter [val]
|
||||
CALL 'private final fun <get-counter> (): <root>.Counter declared in <root>.CounterIterator' type=<root>.Counter origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.CounterIterator declared in <root>.CounterIterator.next' type=<root>.CounterIterator origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val]
|
||||
CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.Counter' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR 'val tmp_2: <root>.Counter [val] declared in <root>.CounterIterator.next' type=<root>.Counter origin=null
|
||||
CALL 'public final fun <set-i> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.Counter' type=kotlin.Unit origin=EQ
|
||||
$this: GET_VAR 'val tmp_2: <root>.Counter [val] declared in <root>.CounterIterator.next' type=<root>.Counter origin=null
|
||||
<set-?>: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_3: kotlin.Int [val] declared in <root>.CounterIterator.next' type=kotlin.Int origin=null
|
||||
GET_VAR 'val tmp_3: kotlin.Int [val] declared in <root>.CounterIterator.next' type=kotlin.Int 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 [fake_override,operator] declared in kotlin.collections.Iterator
|
||||
$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 [fake_override] declared in kotlin.collections.Iterator
|
||||
$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 [fake_override] declared in kotlin.collections.Iterator
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN name:iterator visibility:public modality:FINAL <> ($receiver:<root>.Counter, _context_receiver_0:<root>.CounterConfig) returnType:<root>.CounterIterator [operator]
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.Counter
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.CounterConfig
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun iterator (_context_receiver_0: <root>.CounterConfig): <root>.CounterIterator [operator] declared in <root>'
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=<root>.CounterIterator origin=null
|
||||
<T>: <root>.CounterConfig
|
||||
<R>: <root>.CounterIterator
|
||||
receiver: GET_VAR '_context_receiver_0: <root>.CounterConfig declared in <root>.iterator' type=<root>.CounterConfig origin=null
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.CounterConfig, <root>.CounterIterator> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.CounterConfig) returnType:<root>.CounterIterator
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.CounterConfig
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): <root>.CounterIterator declared in <root>.iterator'
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (_context_receiver_0: <root>.CounterConfig, counter: <root>.Counter) [primary] declared in <root>.CounterIterator' type=<root>.CounterIterator origin=null
|
||||
_context_receiver_0: GET_VAR '_context_receiver_0: <root>.CounterConfig declared in <root>.iterator' type=<root>.CounterConfig origin=null
|
||||
counter: GET_VAR '<this>: <root>.Counter declared in <root>.iterator' type=<root>.Counter origin=null
|
||||
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||
BLOCK_BODY
|
||||
VAR name:result type:kotlin.Int [var]
|
||||
CONST Int type=kotlin.Int value=0
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.Unit origin=null
|
||||
<T>: <root>.CounterConfig
|
||||
<R>: kotlin.Unit
|
||||
receiver: CONSTRUCTOR_CALL 'public constructor <init> (max: kotlin.Int) [primary] declared in <root>.CounterConfig' type=<root>.CounterConfig origin=null
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.CounterConfig, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.CounterConfig) returnType:kotlin.Unit
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.CounterConfig
|
||||
BLOCK_BODY
|
||||
BLOCK type=kotlin.Unit origin=FOR_LOOP
|
||||
VAR FOR_LOOP_ITERATOR name:tmp_4 type:<root>.CounterIterator [val]
|
||||
CALL 'public final fun iterator (_context_receiver_0: <root>.CounterConfig): <root>.CounterIterator [operator] declared in <root>' type=<root>.CounterIterator origin=null
|
||||
$receiver: CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.Counter' type=<root>.Counter origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.CounterConfig declared in <root>.box.<anonymous>' type=<root>.CounterConfig origin=null
|
||||
WHILE label=null origin=FOR_LOOP_INNER_WHILE
|
||||
condition: CALL 'public final fun hasNext (): kotlin.Boolean [operator] declared in <root>.CounterIterator' type=kotlin.Boolean origin=null
|
||||
$this: GET_VAR 'val tmp_4: <root>.CounterIterator [val] declared in <root>.box.<anonymous>' type=<root>.CounterIterator origin=null
|
||||
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
|
||||
VAR name:i type:kotlin.Int [val]
|
||||
CALL 'public final fun next (): kotlin.Int [operator] declared in <root>.CounterIterator' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val tmp_4: <root>.CounterIterator [val] declared in <root>.box.<anonymous>' type=<root>.CounterIterator origin=null
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
SET_VAR 'var result: kotlin.Int [var] declared in <root>.box' type=kotlin.Unit origin=PLUSEQ
|
||||
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'var result: kotlin.Int [var] declared in <root>.box' type=kotlin.Int origin=null
|
||||
other: GET_VAR 'val i: kotlin.Int [val] declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
WHEN type=kotlin.String origin=IF
|
||||
BRANCH
|
||||
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||
arg0: GET_VAR 'var result: kotlin.Int [var] declared in <root>.box' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=45
|
||||
then: CONST String type=kotlin.String value="OK"
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: CONST String type=kotlin.String value="fail"
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
data class Counter {
|
||||
constructor(i: Int = 0) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
var i: Int
|
||||
field = i
|
||||
get
|
||||
set
|
||||
|
||||
operator fun component1(): Int {
|
||||
return <this>.#i
|
||||
}
|
||||
|
||||
fun copy(i: Int = <this>.#i): Counter {
|
||||
return Counter(i = i)
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
when {
|
||||
EQEQEQ(arg0 = <this>, arg1 = other) -> return true
|
||||
}
|
||||
when {
|
||||
other !is Counter -> return false
|
||||
}
|
||||
val tmp0_other_with_cast: Counter = other as Counter
|
||||
when {
|
||||
EQEQ(arg0 = <this>.#i, arg1 = tmp0_other_with_cast.#i).not() -> return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return <this>.#i.hashCode()
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "Counter(" + "i=" + <this>.#i + ")"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
data class CounterConfig {
|
||||
constructor(max: Int = 10) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
val max: Int
|
||||
field = max
|
||||
get
|
||||
|
||||
operator fun component1(): Int {
|
||||
return <this>.#max
|
||||
}
|
||||
|
||||
fun copy(max: Int = <this>.#max): CounterConfig {
|
||||
return CounterConfig(max = max)
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
when {
|
||||
EQEQEQ(arg0 = <this>, arg1 = other) -> return true
|
||||
}
|
||||
when {
|
||||
other !is CounterConfig -> return false
|
||||
}
|
||||
val tmp0_other_with_cast: CounterConfig = other as CounterConfig
|
||||
when {
|
||||
EQEQ(arg0 = <this>.#max, arg1 = tmp0_other_with_cast.#max).not() -> return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return <this>.#max.hashCode()
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "CounterConfig(" + "max=" + <this>.#max + ")"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class CounterIterator : Iterator<Int> {
|
||||
private /* final field */ val contextReceiverField0: CounterConfig
|
||||
constructor(_context_receiver_0: CounterConfig, counter: Counter) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
<this>.#contextReceiverField0 = _context_receiver_0
|
||||
}
|
||||
|
||||
private val counter: Counter
|
||||
field = counter
|
||||
private get
|
||||
|
||||
override operator fun hasNext(): Boolean {
|
||||
return less(arg0 = <this>.<get-counter>().<get-i>(), arg1 = <this>.#contextReceiverField0.<get-max>())
|
||||
}
|
||||
|
||||
override operator fun next(): Int {
|
||||
return { // BLOCK
|
||||
val <receiver>: Counter = <this>.<get-counter>()
|
||||
val <unary>: Int = <receiver>.<get-i>()
|
||||
<receiver>.<set-i>(<set-?> = <unary>.inc())
|
||||
<unary>
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
operator fun Counter.iterator(_context_receiver_0: CounterConfig): CounterIterator {
|
||||
return with<CounterConfig, CounterIterator>(receiver = _context_receiver_0, block = local fun CounterConfig.<anonymous>(): CounterIterator {
|
||||
return CounterIterator(_context_receiver_0 = _context_receiver_0, counter = <this>)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var result: Int = 0
|
||||
with<CounterConfig, Unit>(receiver = CounterConfig(), block = local fun CounterConfig.<anonymous>() {
|
||||
{ // BLOCK
|
||||
val <iterator>: CounterIterator = Counter().iterator(_context_receiver_0 = $this$with)
|
||||
while (<iterator>.hasNext()) { // BLOCK
|
||||
val i: Int = <iterator>.next()
|
||||
{ // BLOCK
|
||||
result = result.plus(other = i)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
return when {
|
||||
EQEQ(arg0 = result, arg1 = 45) -> "OK"
|
||||
else -> "fail"
|
||||
}
|
||||
}
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// WITH_STDLIB
|
||||
|
||||
data class Counter(var i: Int = 0)
|
||||
@@ -25,4 +24,4 @@ fun box(): String {
|
||||
}
|
||||
}
|
||||
return if (result == 45) "OK" else "fail"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
FILE fqName:<root> fileName:/lazy.kt
|
||||
CLASS INTERFACE name:Lazy modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Lazy<T of <root>.Lazy>
|
||||
TYPE_PARAMETER name:T index:0 variance: superTypes:[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 [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:test1 visibility:public modality:FINAL <> (_context_receiver_0:<root>.Lazy<kotlin.Int>, _context_receiver_1:<root>.Lazy<kotlin.CharSequence>) returnType:kotlin.Unit
|
||||
contextReceiverParametersCount: 2
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.Lazy<kotlin.Int>
|
||||
VALUE_PARAMETER name:_context_receiver_1 index:1 type:<root>.Lazy<kotlin.CharSequence>
|
||||
BLOCK_BODY
|
||||
FUN name:test2 visibility:public modality:FINAL <T> ($receiver:<root>.Lazy<kotlin.Int>, _context_receiver_0:<root>.Lazy<T of <root>.test2>) returnType:kotlin.Unit
|
||||
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.Lazy<kotlin.Int>
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.Lazy<T of <root>.test2>
|
||||
BLOCK_BODY
|
||||
FUN name:test3 visibility:public modality:FINAL <T> ($receiver:<root>.Lazy<kotlin.Int>, _context_receiver_0:<root>.Lazy<<root>.Lazy<T of <root>.test3>>) returnType:kotlin.Unit
|
||||
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.Lazy<kotlin.Int>
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.Lazy<<root>.Lazy<T of <root>.test3>>
|
||||
BLOCK_BODY
|
||||
FUN name:f visibility:public modality:FINAL <T> (lazy1:<root>.Lazy<kotlin.Int>, lazy2:<root>.Lazy<kotlin.CharSequence>, lazyT:<root>.Lazy<T of <root>.f>, lazyLazyT:<root>.Lazy<<root>.Lazy<T of <root>.f>>) returnType:kotlin.Unit
|
||||
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false
|
||||
VALUE_PARAMETER name:lazy1 index:0 type:<root>.Lazy<kotlin.Int>
|
||||
VALUE_PARAMETER name:lazy2 index:1 type:<root>.Lazy<kotlin.CharSequence>
|
||||
VALUE_PARAMETER name:lazyT index:2 type:<root>.Lazy<T of <root>.f>
|
||||
VALUE_PARAMETER name:lazyLazyT index:3 type:<root>.Lazy<<root>.Lazy<T of <root>.f>>
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.Unit origin=null
|
||||
<T>: <root>.Lazy<kotlin.Int>
|
||||
<R>: kotlin.Unit
|
||||
receiver: GET_VAR 'lazy1: <root>.Lazy<kotlin.Int> declared in <root>.f' type=<root>.Lazy<kotlin.Int> origin=null
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.Lazy<kotlin.Int>, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.Lazy<kotlin.Int>) returnType:kotlin.Unit
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.Lazy<kotlin.Int>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.Unit declared in <root>.f'
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.Unit origin=null
|
||||
<T>: <root>.Lazy<kotlin.CharSequence>
|
||||
<R>: kotlin.Unit
|
||||
receiver: GET_VAR 'lazy2: <root>.Lazy<kotlin.CharSequence> declared in <root>.f' type=<root>.Lazy<kotlin.CharSequence> origin=null
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.Lazy<kotlin.CharSequence>, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.Lazy<kotlin.CharSequence>) returnType:kotlin.Unit
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.Lazy<kotlin.CharSequence>
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun test1 (_context_receiver_0: <root>.Lazy<kotlin.Int>, _context_receiver_1: <root>.Lazy<kotlin.CharSequence>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.Lazy<kotlin.Int> declared in <root>.f.<anonymous>' type=<root>.Lazy<kotlin.Int> origin=null
|
||||
_context_receiver_1: GET_VAR '$this$with: <root>.Lazy<kotlin.CharSequence> declared in <root>.f.<anonymous>.<anonymous>' type=<root>.Lazy<kotlin.CharSequence> origin=null
|
||||
CALL 'public final fun test2 <T> (_context_receiver_0: <root>.Lazy<T of <root>.test2>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
<T>: kotlin.Int
|
||||
$receiver: GET_VAR '$this$with: <root>.Lazy<kotlin.Int> declared in <root>.f.<anonymous>' type=<root>.Lazy<kotlin.Int> origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.Lazy<kotlin.Int> declared in <root>.f.<anonymous>' type=<root>.Lazy<kotlin.Int> origin=null
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.Unit origin=null
|
||||
<T>: <root>.Lazy<kotlin.CharSequence>
|
||||
<R>: kotlin.Unit
|
||||
receiver: GET_VAR 'lazy2: <root>.Lazy<kotlin.CharSequence> declared in <root>.f' type=<root>.Lazy<kotlin.CharSequence> origin=null
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.Lazy<kotlin.CharSequence>, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.Lazy<kotlin.CharSequence>) returnType:kotlin.Unit
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.Lazy<kotlin.CharSequence>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.Unit declared in <root>.f'
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.Unit origin=null
|
||||
<T>: <root>.Lazy<kotlin.Int>
|
||||
<R>: kotlin.Unit
|
||||
receiver: GET_VAR 'lazy1: <root>.Lazy<kotlin.Int> declared in <root>.f' type=<root>.Lazy<kotlin.Int> origin=null
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.Lazy<kotlin.Int>, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.Lazy<kotlin.Int>) returnType:kotlin.Unit
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.Lazy<kotlin.Int>
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun test1 (_context_receiver_0: <root>.Lazy<kotlin.Int>, _context_receiver_1: <root>.Lazy<kotlin.CharSequence>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.Lazy<kotlin.Int> declared in <root>.f.<anonymous>.<anonymous>' type=<root>.Lazy<kotlin.Int> origin=null
|
||||
_context_receiver_1: GET_VAR '$this$with: <root>.Lazy<kotlin.CharSequence> declared in <root>.f.<anonymous>' type=<root>.Lazy<kotlin.CharSequence> origin=null
|
||||
CALL 'public final fun test2 <T> (_context_receiver_0: <root>.Lazy<T of <root>.test2>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
<T>: kotlin.CharSequence
|
||||
$receiver: GET_VAR '$this$with: <root>.Lazy<kotlin.Int> declared in <root>.f.<anonymous>.<anonymous>' type=<root>.Lazy<kotlin.Int> origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.Lazy<kotlin.CharSequence> declared in <root>.f.<anonymous>' type=<root>.Lazy<kotlin.CharSequence> origin=null
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.Unit origin=null
|
||||
<T>: <root>.Lazy<T of <root>.f>
|
||||
<R>: kotlin.Unit
|
||||
receiver: GET_VAR 'lazyT: <root>.Lazy<T of <root>.f> declared in <root>.f' type=<root>.Lazy<T of <root>.f> origin=null
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.Lazy<T of <root>.f>, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.Lazy<T of <root>.f>) returnType:kotlin.Unit
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.Lazy<T of <root>.f>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.Unit declared in <root>.f'
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.Unit origin=null
|
||||
<T>: <root>.Lazy<kotlin.Int>
|
||||
<R>: kotlin.Unit
|
||||
receiver: GET_VAR 'lazy1: <root>.Lazy<kotlin.Int> declared in <root>.f' type=<root>.Lazy<kotlin.Int> origin=null
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.Lazy<kotlin.Int>, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.Lazy<kotlin.Int>) returnType:kotlin.Unit
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.Lazy<kotlin.Int>
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun test2 <T> (_context_receiver_0: <root>.Lazy<T of <root>.test2>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
<T>: T of <root>.f
|
||||
$receiver: GET_VAR '$this$with: <root>.Lazy<kotlin.Int> declared in <root>.f.<anonymous>.<anonymous>' type=<root>.Lazy<kotlin.Int> origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.Lazy<T of <root>.f> declared in <root>.f.<anonymous>' type=<root>.Lazy<T of <root>.f> origin=null
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.Unit origin=null
|
||||
<T>: <root>.Lazy<<root>.Lazy<T of <root>.f>>
|
||||
<R>: kotlin.Unit
|
||||
receiver: GET_VAR 'lazyLazyT: <root>.Lazy<<root>.Lazy<T of <root>.f>> declared in <root>.f' type=<root>.Lazy<<root>.Lazy<T of <root>.f>> origin=null
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.Lazy<<root>.Lazy<T of <root>.f>>, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.Lazy<<root>.Lazy<T of <root>.f>>) returnType:kotlin.Unit
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.Lazy<<root>.Lazy<T of <root>.f>>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.Unit declared in <root>.f'
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.Unit origin=null
|
||||
<T>: <root>.Lazy<kotlin.Int>
|
||||
<R>: kotlin.Unit
|
||||
receiver: GET_VAR 'lazy1: <root>.Lazy<kotlin.Int> declared in <root>.f' type=<root>.Lazy<kotlin.Int> origin=null
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.Lazy<kotlin.Int>, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.Lazy<kotlin.Int>) returnType:kotlin.Unit
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.Lazy<kotlin.Int>
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun test2 <T> (_context_receiver_0: <root>.Lazy<T of <root>.test2>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
<T>: <root>.Lazy<T of <root>.f>
|
||||
$receiver: GET_VAR '$this$with: <root>.Lazy<kotlin.Int> declared in <root>.f.<anonymous>.<anonymous>' type=<root>.Lazy<kotlin.Int> origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.Lazy<<root>.Lazy<T of <root>.f>> declared in <root>.f.<anonymous>' type=<root>.Lazy<<root>.Lazy<T of <root>.f>> origin=null
|
||||
CALL 'public final fun test3 <T> (_context_receiver_0: <root>.Lazy<<root>.Lazy<T of <root>.test3>>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
<T>: T of <root>.f
|
||||
$receiver: GET_VAR '$this$with: <root>.Lazy<kotlin.Int> declared in <root>.f.<anonymous>.<anonymous>' type=<root>.Lazy<kotlin.Int> origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.Lazy<<root>.Lazy<T of <root>.f>> declared in <root>.f.<anonymous>' type=<root>.Lazy<<root>.Lazy<T of <root>.f>> origin=null
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.Unit origin=null
|
||||
<T>: <root>.Lazy<kotlin.Int>
|
||||
<R>: kotlin.Unit
|
||||
receiver: GET_VAR 'lazy1: <root>.Lazy<kotlin.Int> declared in <root>.f' type=<root>.Lazy<kotlin.Int> origin=null
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.Lazy<kotlin.Int>, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.Lazy<kotlin.Int>) returnType:kotlin.Unit
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.Lazy<kotlin.Int>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.Unit declared in <root>.f'
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.Unit origin=null
|
||||
<T>: <root>.Lazy<<root>.Lazy<T of <root>.f>>
|
||||
<R>: kotlin.Unit
|
||||
receiver: GET_VAR 'lazyLazyT: <root>.Lazy<<root>.Lazy<T of <root>.f>> declared in <root>.f' type=<root>.Lazy<<root>.Lazy<T of <root>.f>> origin=null
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.Lazy<<root>.Lazy<T of <root>.f>>, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.Lazy<<root>.Lazy<T of <root>.f>>) returnType:kotlin.Unit
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.Lazy<<root>.Lazy<T of <root>.f>>
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun test2 <T> (_context_receiver_0: <root>.Lazy<T of <root>.test2>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
<T>: kotlin.Int
|
||||
$receiver: GET_VAR '$this$with: <root>.Lazy<kotlin.Int> declared in <root>.f.<anonymous>' type=<root>.Lazy<kotlin.Int> origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.Lazy<kotlin.Int> declared in <root>.f.<anonymous>' type=<root>.Lazy<kotlin.Int> origin=null
|
||||
CALL 'public final fun test3 <T> (_context_receiver_0: <root>.Lazy<<root>.Lazy<T of <root>.test3>>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
<T>: T of <root>.f
|
||||
$receiver: GET_VAR '$this$with: <root>.Lazy<kotlin.Int> declared in <root>.f.<anonymous>' type=<root>.Lazy<kotlin.Int> origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.Lazy<<root>.Lazy<T of <root>.f>> declared in <root>.f.<anonymous>.<anonymous>' type=<root>.Lazy<<root>.Lazy<T of <root>.f>> origin=null
|
||||
@@ -0,0 +1,54 @@
|
||||
interface Lazy<T : Any?> {
|
||||
|
||||
}
|
||||
|
||||
fun test1(_context_receiver_0: Lazy<Int>, _context_receiver_1: Lazy<CharSequence>) {
|
||||
}
|
||||
|
||||
fun <T : Any?> Lazy<Int>.test2(_context_receiver_0: Lazy<T>) {
|
||||
}
|
||||
|
||||
fun <T : Any?> Lazy<Int>.test3(_context_receiver_0: Lazy<Lazy<T>>) {
|
||||
}
|
||||
|
||||
fun <T : Any?> f(lazy1: Lazy<Int>, lazy2: Lazy<CharSequence>, lazyT: Lazy<T>, lazyLazyT: Lazy<Lazy<T>>) {
|
||||
with<Lazy<Int>, Unit>(receiver = lazy1, block = local fun Lazy<Int>.<anonymous>() {
|
||||
return with<Lazy<CharSequence>, Unit>(receiver = lazy2, block = local fun Lazy<CharSequence>.<anonymous>() {
|
||||
test1(_context_receiver_0 = $this$with, _context_receiver_1 = $this$with)
|
||||
$this$with.test2<Int>(_context_receiver_0 = $this$with)
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
with<Lazy<CharSequence>, Unit>(receiver = lazy2, block = local fun Lazy<CharSequence>.<anonymous>() {
|
||||
return with<Lazy<Int>, Unit>(receiver = lazy1, block = local fun Lazy<Int>.<anonymous>() {
|
||||
test1(_context_receiver_0 = $this$with, _context_receiver_1 = $this$with)
|
||||
$this$with.test2<CharSequence>(_context_receiver_0 = $this$with)
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
with<Lazy<T>, Unit>(receiver = lazyT, block = local fun Lazy<T>.<anonymous>() {
|
||||
return with<Lazy<Int>, Unit>(receiver = lazy1, block = local fun Lazy<Int>.<anonymous>() {
|
||||
$this$with.test2<T>(_context_receiver_0 = $this$with)
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
with<Lazy<Lazy<T>>, Unit>(receiver = lazyLazyT, block = local fun Lazy<Lazy<T>>.<anonymous>() {
|
||||
return with<Lazy<Int>, Unit>(receiver = lazy1, block = local fun Lazy<Int>.<anonymous>() {
|
||||
$this$with.test2<Lazy<T>>(_context_receiver_0 = $this$with)
|
||||
$this$with.test3<T>(_context_receiver_0 = $this$with)
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
with<Lazy<Int>, Unit>(receiver = lazy1, block = local fun Lazy<Int>.<anonymous>() {
|
||||
return with<Lazy<Lazy<T>>, Unit>(receiver = lazyLazyT, block = local fun Lazy<Lazy<T>>.<anonymous>() {
|
||||
$this$with.test2<Int>(_context_receiver_0 = $this$with)
|
||||
$this$with.test3<T>(_context_receiver_0 = $this$with)
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
interface Lazy<T>
|
||||
|
||||
@@ -42,4 +41,4 @@ fun <T> f(lazy1: Lazy<Int>, lazy2: Lazy<CharSequence>, lazyT: Lazy<T>, lazyLazyT
|
||||
test3()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
FILE fqName:<root> fileName:/overloadPriority.kt
|
||||
CLASS CLASS name:Context modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Context
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.Context [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Context modality:FINAL 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 [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:f visibility:public modality:FINAL <> (_context_receiver_0:<root>.Context) returnType:kotlin.String
|
||||
contextReceiverParametersCount: 1
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.Context
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun f (_context_receiver_0: <root>.Context): kotlin.String declared in <root>'
|
||||
CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null
|
||||
FUN name:f visibility:public modality:FINAL <> () returnType:kotlin.Any
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun f (): kotlin.Any declared in <root>'
|
||||
CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null
|
||||
FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.Int origin=null
|
||||
<T>: <root>.Context
|
||||
<R>: kotlin.Int
|
||||
receiver: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Context' type=<root>.Context origin=null
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<<root>.Context, kotlin.Int> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:<root>.Context) returnType:kotlin.Int
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.Context
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.Int declared in <root>.test'
|
||||
CALL 'public open fun <get-length> (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: CALL 'public final fun f (_context_receiver_0: <root>.Context): kotlin.String declared in <root>' type=kotlin.String origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: <root>.Context declared in <root>.test.<anonymous>' type=<root>.Context origin=null
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
class Context {
|
||||
constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun f(_context_receiver_0: Context): String {
|
||||
return TODO()
|
||||
}
|
||||
|
||||
fun f(): Any {
|
||||
return TODO()
|
||||
}
|
||||
|
||||
fun test() {
|
||||
with<Context, Int>(receiver = Context(), block = local fun Context.<anonymous>(): Int {
|
||||
return f(_context_receiver_0 = $this$with).<get-length>()
|
||||
}
|
||||
) /*~> Unit */
|
||||
}
|
||||
+1
-2
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
class Context
|
||||
|
||||
@@ -12,4 +11,4 @@ fun test() {
|
||||
with(Context()) {
|
||||
f().length
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
FILE fqName:<root> fileName:/overloading.kt
|
||||
FUN name:foo visibility:public modality:FINAL <> (_context_receiver_0:kotlin.Int, _context_receiver_1:kotlin.String) returnType:kotlin.Int
|
||||
contextReceiverParametersCount: 2
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
|
||||
VALUE_PARAMETER name:_context_receiver_1 index:1 type:kotlin.String
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun foo (_context_receiver_0: kotlin.Int, _context_receiver_1: kotlin.String): kotlin.Int declared in <root>'
|
||||
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
|
||||
$this: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.foo' type=kotlin.Int origin=null
|
||||
other: CONST Int type=kotlin.Int value=42
|
||||
FUN name:foo visibility:public modality:FINAL <> (_context_receiver_0:kotlin.Int) returnType:kotlin.Int
|
||||
contextReceiverParametersCount: 1
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun foo (_context_receiver_0: kotlin.Int): kotlin.Int declared in <root>'
|
||||
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
|
||||
$this: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.foo' type=kotlin.Int origin=null
|
||||
other: CONST Int type=kotlin.Int value=42
|
||||
FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.Int origin=null
|
||||
<T>: kotlin.Int
|
||||
<R>: kotlin.Int
|
||||
receiver: CONST Int type=kotlin.Int value=42
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<kotlin.Int, kotlin.Int> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.Int
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.Int declared in <root>.test'
|
||||
CALL 'public final fun foo (_context_receiver_0: kotlin.Int): kotlin.Int declared in <root>' type=kotlin.Int origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.test.<anonymous>' type=kotlin.Int origin=null
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
fun foo(_context_receiver_0: Int, _context_receiver_1: String): Int {
|
||||
return _context_receiver_0.plus(other = 42)
|
||||
}
|
||||
|
||||
fun foo(_context_receiver_0: Int): Int {
|
||||
return _context_receiver_0.plus(other = 42)
|
||||
}
|
||||
|
||||
fun test() {
|
||||
with<Int, Int>(receiver = 42, block = local fun Int.<anonymous>(): Int {
|
||||
return foo(_context_receiver_0 = $this$with)
|
||||
}
|
||||
) /*~> Unit */
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
context(Int, String)
|
||||
fun foo(): Int {
|
||||
@@ -15,4 +14,4 @@ fun test() {
|
||||
with(42) {
|
||||
foo()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+50
@@ -0,0 +1,50 @@
|
||||
FILE fqName:<root> fileName:/passingLambdaToContextualParam.kt
|
||||
CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$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> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||
PROPERTY name:result visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:result type:kotlin.String visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
CONST String type=kotlin.String value="OK"
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-result> visibility:public modality:FINAL <> ($this:<root>.C) returnType:kotlin.String
|
||||
correspondingProperty: PROPERTY name:result visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.C
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-result> (): kotlin.String declared in <root>.C'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:result type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
|
||||
receiver: GET_VAR '<this>: <root>.C declared in <root>.C.<get-result>' type=<root>.C 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:contextual visibility:public modality:FINAL <> (f:kotlin.Function1<<root>.C, kotlin.String>) returnType:kotlin.String
|
||||
VALUE_PARAMETER name:f index:0 type:kotlin.Function1<<root>.C, kotlin.String>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun contextual (f: kotlin.Function1<<root>.C, kotlin.String>): kotlin.String declared in <root>'
|
||||
CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 [operator] declared in kotlin.Function1' type=kotlin.String origin=INVOKE
|
||||
$this: GET_VAR 'f: kotlin.Function1<<root>.C, kotlin.String> declared in <root>.contextual' type=kotlin.Function1<<root>.C, kotlin.String> origin=VARIABLE_AS_FUNCTION
|
||||
p1: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.C' type=<root>.C origin=null
|
||||
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CALL 'public final fun contextual (f: kotlin.Function1<<root>.C, kotlin.String>): kotlin.String declared in <root>' type=kotlin.String origin=null
|
||||
f: FUN_EXPR type=kotlin.Function1<<root>.C, kotlin.String> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (_context_receiver_0:<root>.C) returnType:kotlin.String
|
||||
contextReceiverParametersCount: 1
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.C
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (_context_receiver_0: <root>.C): kotlin.String declared in <root>.box'
|
||||
CALL 'public final fun <get-result> (): kotlin.String declared in <root>.C' type=kotlin.String origin=GET_PROPERTY
|
||||
$this: GET_VAR '_context_receiver_0: <root>.C declared in <root>.box.<anonymous>' type=<root>.C origin=null
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
class C {
|
||||
constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
val result: String
|
||||
field = "OK"
|
||||
get
|
||||
|
||||
}
|
||||
|
||||
fun contextual(f: Function1<C, String>): String {
|
||||
return f.invoke(p1 = C())
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return contextual(f = local fun <anonymous>(_context_receiver_0: C): String {
|
||||
return _context_receiver_0.<get-result>()
|
||||
}
|
||||
)
|
||||
}
|
||||
Vendored
+1
-2
@@ -1,6 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
class C {
|
||||
val result = "OK"
|
||||
@@ -8,4 +7,4 @@ class C {
|
||||
|
||||
fun contextual(f: context(C) () -> String) = f(C())
|
||||
|
||||
fun box(): String = contextual { result }
|
||||
fun box(): String = contextual { result }
|
||||
|
||||
+9
-5
@@ -37,11 +37,13 @@ FILE fqName:<root> fileName:/plusMatrix.kt
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN name:plus visibility:public modality:FINAL <> ($receiver:<root>.Matrix, other:<root>.Matrix) returnType:<root>.Matrix
|
||||
FUN name:plus visibility:public modality:FINAL <> ($receiver:<root>.Matrix, _context_receiver_0:<root>.NumberOperations, other:<root>.Matrix) returnType:<root>.Matrix
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.Matrix
|
||||
VALUE_PARAMETER name:other index:0 type:<root>.Matrix
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.NumberOperations
|
||||
VALUE_PARAMETER name:other index:1 type:<root>.Matrix
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun plus (other: <root>.Matrix): <root>.Matrix declared in <root>'
|
||||
RETURN type=kotlin.Nothing from='public final fun plus (_context_receiver_0: <root>.NumberOperations, other: <root>.Matrix): <root>.Matrix declared in <root>'
|
||||
CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null
|
||||
FUN name:plusMatrix visibility:public modality:FINAL <> ($receiver:<root>.NumberOperations, m1:<root>.Matrix, m2:<root>.Matrix) returnType:kotlin.Unit
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.NumberOperations
|
||||
@@ -49,10 +51,12 @@ FILE fqName:<root> fileName:/plusMatrix.kt
|
||||
VALUE_PARAMETER name:m2 index:1 type:<root>.Matrix
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun plus (other: <root>.Matrix): <root>.Matrix declared in <root>' type=<root>.Matrix origin=null
|
||||
CALL 'public final fun plus (_context_receiver_0: <root>.NumberOperations, other: <root>.Matrix): <root>.Matrix declared in <root>' type=<root>.Matrix origin=null
|
||||
$receiver: GET_VAR 'm1: <root>.Matrix declared in <root>.plusMatrix' type=<root>.Matrix origin=null
|
||||
_context_receiver_0: GET_VAR '<this>: <root>.NumberOperations declared in <root>.plusMatrix' type=<root>.NumberOperations origin=null
|
||||
other: GET_VAR 'm2: <root>.Matrix declared in <root>.plusMatrix' type=<root>.Matrix origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun plus (other: <root>.Matrix): <root>.Matrix declared in <root>' type=<root>.Matrix origin=null
|
||||
CALL 'public final fun plus (_context_receiver_0: <root>.NumberOperations, other: <root>.Matrix): <root>.Matrix declared in <root>' type=<root>.Matrix origin=null
|
||||
$receiver: GET_VAR 'm2: <root>.Matrix declared in <root>.plusMatrix' type=<root>.Matrix origin=null
|
||||
_context_receiver_0: GET_VAR '<this>: <root>.NumberOperations declared in <root>.plusMatrix' type=<root>.NumberOperations origin=null
|
||||
other: GET_VAR 'm1: <root>.Matrix declared in <root>.plusMatrix' type=<root>.Matrix origin=null
|
||||
|
||||
+3
-3
@@ -12,11 +12,11 @@ class Matrix {
|
||||
|
||||
}
|
||||
|
||||
fun Matrix.plus(other: Matrix): Matrix {
|
||||
fun Matrix.plus(_context_receiver_0: NumberOperations, other: Matrix): Matrix {
|
||||
return TODO()
|
||||
}
|
||||
|
||||
fun NumberOperations.plusMatrix(m1: Matrix, m2: Matrix) {
|
||||
m1.plus(other = m2) /*~> Unit */
|
||||
m2.plus(other = m1) /*~> Unit */
|
||||
m1.plus(_context_receiver_0 = <this>, other = m2) /*~> Unit */
|
||||
m2.plus(_context_receiver_0 = <this>, other = m1) /*~> Unit */
|
||||
}
|
||||
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
FILE fqName:<root> fileName:/property.kt
|
||||
CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A
|
||||
FUN name:a visibility:public modality:ABSTRACT <> ($this:<root>.A) returnType:kotlin.Int
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.A
|
||||
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
|
||||
CLASS INTERFACE name:B modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.B
|
||||
FUN name:b visibility:public modality:ABSTRACT <> ($this:<root>.B) returnType:kotlin.Int
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.B
|
||||
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
|
||||
PROPERTY name:c visibility:public modality:FINAL [val]
|
||||
FUN name:<get-c> visibility:public modality:FINAL <> (_context_receiver_0:<root>.A, _context_receiver_1:<root>.B) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:c visibility:public modality:FINAL [val]
|
||||
contextReceiverParametersCount: 2
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.A
|
||||
VALUE_PARAMETER name:_context_receiver_1 index:1 type:<root>.B
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-c> (_context_receiver_0: <root>.A, _context_receiver_1: <root>.B): kotlin.Int declared in <root>'
|
||||
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
|
||||
$this: CALL 'public abstract fun a (): kotlin.Int declared in <root>.A' type=kotlin.Int origin=null
|
||||
$this: GET_VAR '_context_receiver_0: <root>.A declared in <root>.<get-c>' type=<root>.A origin=null
|
||||
other: CALL 'public abstract fun b (): kotlin.Int declared in <root>.B' type=kotlin.Int origin=null
|
||||
$this: GET_VAR '_context_receiver_1: <root>.B declared in <root>.<get-c>' type=<root>.B origin=null
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
interface A {
|
||||
abstract fun a(): Int
|
||||
|
||||
}
|
||||
|
||||
interface B {
|
||||
abstract fun b(): Int
|
||||
|
||||
}
|
||||
|
||||
val c: Int
|
||||
get(_context_receiver_0: A, _context_receiver_1: B): Int {
|
||||
return _context_receiver_0.a().plus(other = _context_receiver_1.b())
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
interface A {
|
||||
fun a(): Int
|
||||
@@ -9,4 +8,4 @@ interface B {
|
||||
}
|
||||
|
||||
context(A, B)
|
||||
val c get() = a() + b()
|
||||
val c get() = a() + b()
|
||||
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
FILE fqName:<root> fileName:/thisWithCustomLabel.kt
|
||||
CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A<T of <root>.A>
|
||||
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false
|
||||
CONSTRUCTOR visibility:public <> (a:T of <root>.A) returnType:<root>.A<T of <root>.A> [primary]
|
||||
VALUE_PARAMETER name:a index:0 type:T of <root>.A
|
||||
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:T of <root>.A visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'a: T of <root>.A declared in <root>.A.<init>' type=T of <root>.A origin=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-a> visibility:public modality:FINAL <> ($this:<root>.A<T of <root>.A>) returnType:T of <root>.A
|
||||
correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.A<T of <root>.A>
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-a> (): T of <root>.A declared in <root>.A'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:T of <root>.A visibility:private [final]' type=T of <root>.A origin=null
|
||||
receiver: GET_VAR '<this>: <root>.A<T of <root>.A> declared in <root>.A.<get-a>' type=<root>.A<T of <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
|
||||
CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.B
|
||||
CONSTRUCTOR visibility:public <> (b:kotlin.Any) returnType:<root>.B [primary]
|
||||
VALUE_PARAMETER name:b index:0 type:kotlin.Any
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||
PROPERTY name:b visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:b type:kotlin.Any visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'b: kotlin.Any declared in <root>.B.<init>' type=kotlin.Any origin=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-b> visibility:public modality:FINAL <> ($this:<root>.B) returnType:kotlin.Any
|
||||
correspondingProperty: PROPERTY name:b visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.B
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-b> (): kotlin.Any declared in <root>.B'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null
|
||||
receiver: GET_VAR '<this>: <root>.B declared in <root>.B.<get-b>' type=<root>.B 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
|
||||
CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.C
|
||||
CONSTRUCTOR visibility:public <> (c:kotlin.Any) returnType:<root>.C [primary]
|
||||
VALUE_PARAMETER name:c index:0 type:kotlin.Any
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||
PROPERTY name:c visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.Any visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'c: kotlin.Any declared in <root>.C.<init>' type=kotlin.Any origin=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-c> visibility:public modality:FINAL <> ($this:<root>.C) returnType:kotlin.Any
|
||||
correspondingProperty: PROPERTY name:c visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.C
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-c> (): kotlin.Any declared in <root>.C'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null
|
||||
receiver: GET_VAR '<this>: <root>.C declared in <root>.C.<get-c>' type=<root>.C 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:f visibility:public modality:FINAL <> (_context_receiver_0:<root>.A<kotlin.Int>, _context_receiver_1:<root>.A<kotlin.String>, _context_receiver_2:<root>.B) returnType:kotlin.Unit
|
||||
contextReceiverParametersCount: 3
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.A<kotlin.Int>
|
||||
VALUE_PARAMETER name:_context_receiver_1 index:1 type:<root>.A<kotlin.String>
|
||||
VALUE_PARAMETER name:_context_receiver_2 index:2 type:<root>.B
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public open fun toFloat (): kotlin.Float declared in kotlin.Int' type=kotlin.Float origin=null
|
||||
$this: CALL 'public final fun <get-a> (): T of <root>.A declared in <root>.A' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '_context_receiver_0: <root>.A<kotlin.Int> declared in <root>.f' type=<root>.A<kotlin.Int> origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public open fun <get-length> (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: CALL 'public final fun <get-a> (): T of <root>.A declared in <root>.A' type=kotlin.String origin=GET_PROPERTY
|
||||
$this: GET_VAR '_context_receiver_1: <root>.A<kotlin.String> declared in <root>.f' type=<root>.A<kotlin.String> origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun <get-b> (): kotlin.Any declared in <root>.B' type=kotlin.Any origin=GET_PROPERTY
|
||||
$this: GET_VAR '_context_receiver_2: <root>.B declared in <root>.f' type=<root>.B origin=null
|
||||
PROPERTY name:p visibility:public modality:FINAL [val]
|
||||
FUN name:<get-p> visibility:public modality:FINAL <> ($receiver:<root>.C, _context_receiver_0:<root>.A<kotlin.Int>, _context_receiver_1:<root>.A<kotlin.String>, _context_receiver_2:<root>.B) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [val]
|
||||
contextReceiverParametersCount: 3
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.C
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.A<kotlin.Int>
|
||||
VALUE_PARAMETER name:_context_receiver_1 index:1 type:<root>.A<kotlin.String>
|
||||
VALUE_PARAMETER name:_context_receiver_2 index:2 type:<root>.B
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public open fun toFloat (): kotlin.Float declared in kotlin.Int' type=kotlin.Float origin=null
|
||||
$this: CALL 'public final fun <get-a> (): T of <root>.A declared in <root>.A' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '_context_receiver_0: <root>.A<kotlin.Int> declared in <root>.<get-p>' type=<root>.A<kotlin.Int> origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public open fun <get-length> (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: CALL 'public final fun <get-a> (): T of <root>.A declared in <root>.A' type=kotlin.String origin=GET_PROPERTY
|
||||
$this: GET_VAR '_context_receiver_1: <root>.A<kotlin.String> declared in <root>.<get-p>' type=<root>.A<kotlin.String> origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun <get-b> (): kotlin.Any declared in <root>.B' type=kotlin.Any origin=GET_PROPERTY
|
||||
$this: GET_VAR '_context_receiver_2: <root>.B declared in <root>.<get-p>' type=<root>.B origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun <get-c> (): kotlin.Any declared in <root>.C' type=kotlin.Any origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.C declared in <root>.<get-p>' type=<root>.C origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun <get-c> (): kotlin.Any declared in <root>.C' type=kotlin.Any origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.C declared in <root>.<get-p>' type=<root>.C origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun <get-c> (): kotlin.Any declared in <root>.C' type=kotlin.Any origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.C declared in <root>.<get-p>' type=<root>.C origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-p> (_context_receiver_0: <root>.A<kotlin.Int>, _context_receiver_1: <root>.A<kotlin.String>, _context_receiver_2: <root>.B): kotlin.Int declared in <root>'
|
||||
CONST Int type=kotlin.Int value=1
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
class A<T : Any?> {
|
||||
constructor(a: T) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
val a: T
|
||||
field = a
|
||||
get
|
||||
|
||||
}
|
||||
|
||||
class B {
|
||||
constructor(b: Any) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
val b: Any
|
||||
field = b
|
||||
get
|
||||
|
||||
}
|
||||
|
||||
class C {
|
||||
constructor(c: Any) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
val c: Any
|
||||
field = c
|
||||
get
|
||||
|
||||
}
|
||||
|
||||
fun f(_context_receiver_0: A<Int>, _context_receiver_1: A<String>, _context_receiver_2: B) {
|
||||
_context_receiver_0.<get-a>().toFloat() /*~> Unit */
|
||||
_context_receiver_1.<get-a>().<get-length>() /*~> Unit */
|
||||
_context_receiver_2.<get-b>() /*~> Unit */
|
||||
}
|
||||
|
||||
val C.p: Int
|
||||
get(_context_receiver_0: A<Int>, _context_receiver_1: A<String>, _context_receiver_2: B): Int {
|
||||
_context_receiver_0.<get-a>().toFloat() /*~> Unit */
|
||||
_context_receiver_1.<get-a>().<get-length>() /*~> Unit */
|
||||
_context_receiver_2.<get-b>() /*~> Unit */
|
||||
<this>.<get-c>() /*~> Unit */
|
||||
<this>.<get-c>() /*~> Unit */
|
||||
<this>.<get-c>() /*~> Unit */
|
||||
return 1
|
||||
}
|
||||
+1
-2
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
class A<T>(val a: T)
|
||||
class B(val b: Any)
|
||||
@@ -20,4 +19,4 @@ context(labelAInt@A<Int>, A<String>, labelB@B) val C.p: Int
|
||||
this@p.c
|
||||
this.c
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+6
-3
@@ -1,7 +1,9 @@
|
||||
FILE fqName:<root> fileName:/typeParameterAsContextReceiver.kt
|
||||
FUN name:useContext visibility:public modality:FINAL <T> (block:kotlin.Function1<T of <root>.useContext, kotlin.Unit>) returnType:kotlin.Unit
|
||||
FUN name:useContext visibility:public modality:FINAL <T> (_context_receiver_0:T of <root>.useContext, block:kotlin.Function1<T of <root>.useContext, kotlin.Unit>) returnType:kotlin.Unit
|
||||
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false
|
||||
VALUE_PARAMETER name:block index:0 type:kotlin.Function1<T of <root>.useContext, kotlin.Unit>
|
||||
contextReceiverParametersCount: 1
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:T of <root>.useContext
|
||||
VALUE_PARAMETER name:block index:1 type:kotlin.Function1<T of <root>.useContext, kotlin.Unit>
|
||||
BLOCK_BODY
|
||||
FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
@@ -13,8 +15,9 @@ FILE fqName:<root> fileName:/typeParameterAsContextReceiver.kt
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.Unit
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun useContext <T> (block: kotlin.Function1<T of <root>.useContext, kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
CALL 'public final fun useContext <T> (_context_receiver_0: T of <root>.useContext, block: kotlin.Function1<T of <root>.useContext, kotlin.Unit>): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
|
||||
<T>: kotlin.Int
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.test.<anonymous>' type=kotlin.Int origin=null
|
||||
block: FUN_EXPR type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (i:kotlin.Int) returnType:kotlin.Unit
|
||||
VALUE_PARAMETER name:i index:0 type:kotlin.Int
|
||||
|
||||
Vendored
+2
-2
@@ -1,9 +1,9 @@
|
||||
fun <T : Any?> useContext(block: Function1<T, Unit>) {
|
||||
fun <T : Any?> useContext(_context_receiver_0: T, block: Function1<T, Unit>) {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
with<Int, Unit>(receiver = 42, block = local fun Int.<anonymous>() {
|
||||
useContext<Int>(block = local fun <anonymous>(i: Int) {
|
||||
useContext<Int>(_context_receiver_0 = $this$with, block = local fun <anonymous>(i: Int) {
|
||||
i.toDouble() /*~> Unit */
|
||||
}
|
||||
)
|
||||
|
||||
+238
@@ -0,0 +1,238 @@
|
||||
FILE fqName:<root> fileName:/unaryOperators.kt
|
||||
CLASS CLASS name:Result modality:FINAL visibility:public [data] superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Result
|
||||
CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:<root>.Result [primary]
|
||||
VALUE_PARAMETER name:i index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Result modality:FINAL visibility:public [data] superTypes:[kotlin.Any]'
|
||||
PROPERTY name:i visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'i: kotlin.Int declared in <root>.Result.<init>' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-i> visibility:public modality:FINAL <> ($this:<root>.Result) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:i visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Result
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-i> (): kotlin.Int declared in <root>.Result'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result.<get-i>' type=<root>.Result origin=null
|
||||
FUN name:component1 visibility:public modality:FINAL <> ($this:<root>.Result) returnType:kotlin.Int [operator]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Result
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int [operator] declared in <root>.Result'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result.component1' type=<root>.Result origin=null
|
||||
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.Result, i:kotlin.Int) returnType:<root>.Result
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Result
|
||||
VALUE_PARAMETER name:i index:0 type:kotlin.Int
|
||||
EXPRESSION_BODY
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result.copy' type=<root>.Result origin=null
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun copy (i: kotlin.Int): <root>.Result declared in <root>.Result'
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.Result' type=<root>.Result origin=null
|
||||
i: GET_VAR 'i: kotlin.Int declared in <root>.Result.copy' type=kotlin.Int origin=null
|
||||
FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.Result, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.Result
|
||||
VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any?
|
||||
BLOCK_BODY
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ
|
||||
arg0: GET_VAR '<this>: <root>.Result declared in <root>.Result.equals' type=<root>.Result origin=null
|
||||
arg1: GET_VAR 'other: kotlin.Any? declared in <root>.Result.equals' type=kotlin.Any? origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Result'
|
||||
CONST Boolean type=kotlin.Boolean value=true
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=<root>.Result
|
||||
GET_VAR 'other: kotlin.Any? declared in <root>.Result.equals' type=kotlin.Any? origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Result'
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:<root>.Result [val]
|
||||
TYPE_OP type=<root>.Result origin=CAST typeOperand=<root>.Result
|
||||
GET_VAR 'other: kotlin.Any? declared in <root>.Result.equals' type=kotlin.Any? origin=null
|
||||
WHEN type=kotlin.Unit origin=null
|
||||
BRANCH
|
||||
if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result.equals' type=<root>.Result origin=null
|
||||
arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR 'val tmp_0: <root>.Result [val] declared in <root>.Result.equals' type=<root>.Result origin=null
|
||||
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Result'
|
||||
CONST Boolean type=kotlin.Boolean value=false
|
||||
RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Result'
|
||||
CONST Boolean type=kotlin.Boolean value=true
|
||||
FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.Result) returnType:kotlin.Int
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.Result
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in <root>.Result'
|
||||
CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result.hashCode' type=<root>.Result origin=null
|
||||
FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.Result) returnType:kotlin.String
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.Result
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.Result'
|
||||
STRING_CONCATENATION type=kotlin.String
|
||||
CONST String type=kotlin.String value="Result("
|
||||
CONST String type=kotlin.String value="i="
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result.toString' type=<root>.Result origin=null
|
||||
CONST String type=kotlin.String value=")"
|
||||
PROPERTY name:operationScore visibility:public modality:FINAL [var]
|
||||
FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]
|
||||
EXPRESSION_BODY
|
||||
CONST Int type=kotlin.Int value=0
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-operationScore> visibility:public modality:FINAL <> () returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var]
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-operationScore> (): kotlin.Int declared in <root>'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-operationScore> visibility:public modality:FINAL <> (<set-?>:kotlin.Int) returnType:kotlin.Unit
|
||||
correspondingProperty: PROPERTY name:operationScore visibility:public modality:FINAL [var]
|
||||
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null
|
||||
value: GET_VAR '<set-?>: kotlin.Int declared in <root>.<set-operationScore>' type=kotlin.Int origin=null
|
||||
FUN name:unaryMinus visibility:public modality:FINAL <> ($receiver:<root>.Result, _context_receiver_0:kotlin.Int) returnType:<root>.Result [operator]
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.Result
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun <set-operationScore> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-operationScore> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
other: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.unaryMinus' type=kotlin.Int origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun unaryMinus (_context_receiver_0: kotlin.Int): <root>.Result [operator] declared in <root>'
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.Result' type=<root>.Result origin=null
|
||||
i: CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.Result' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.Result declared in <root>.unaryMinus' type=<root>.Result origin=null
|
||||
FUN name:unaryPlus visibility:public modality:FINAL <> ($receiver:<root>.Result, _context_receiver_0:kotlin.Int) returnType:<root>.Result [operator]
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.Result
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun <set-operationScore> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-operationScore> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
other: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.unaryPlus' type=kotlin.Int origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun unaryPlus (_context_receiver_0: kotlin.Int): <root>.Result [operator] declared in <root>'
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.Result' type=<root>.Result origin=null
|
||||
i: WHEN type=kotlin.Int origin=IF
|
||||
BRANCH
|
||||
if: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT
|
||||
arg0: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.Result' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.Result declared in <root>.unaryPlus' type=<root>.Result origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=0
|
||||
then: CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.Result' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.Result declared in <root>.unaryPlus' type=<root>.Result origin=null
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.Result' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.Result declared in <root>.unaryPlus' type=<root>.Result origin=null
|
||||
FUN name:inc visibility:public modality:FINAL <> ($receiver:<root>.Result, _context_receiver_0:kotlin.Int) returnType:<root>.Result [operator]
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.Result
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun <set-operationScore> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-operationScore> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
other: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.inc' type=kotlin.Int origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun inc (_context_receiver_0: kotlin.Int): <root>.Result [operator] declared in <root>'
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.Result' type=<root>.Result origin=null
|
||||
i: 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-i> (): kotlin.Int declared in <root>.Result' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.Result declared in <root>.inc' type=<root>.Result origin=null
|
||||
other: CONST Int type=kotlin.Int value=1
|
||||
FUN name:dec visibility:public modality:FINAL <> ($receiver:<root>.Result, _context_receiver_0:kotlin.Int) returnType:<root>.Result [operator]
|
||||
contextReceiverParametersCount: 1
|
||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.Result
|
||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
CALL 'public final fun <set-operationScore> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>' type=kotlin.Unit origin=EQ
|
||||
<set-?>: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: CALL 'public final fun <get-operationScore> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
other: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.dec' type=kotlin.Int origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun dec (_context_receiver_0: kotlin.Int): <root>.Result [operator] declared in <root>'
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.Result' type=<root>.Result origin=null
|
||||
i: CALL 'public final fun minus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=MINUS
|
||||
$this: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.Result' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.Result declared in <root>.dec' type=<root>.Result origin=null
|
||||
other: CONST Int type=kotlin.Int value=1
|
||||
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||
BLOCK_BODY
|
||||
VAR name:result type:<root>.Result [var]
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (i: kotlin.Int) [primary] declared in <root>.Result' type=<root>.Result origin=null
|
||||
i: CONST Int type=kotlin.Int value=0
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun with <T, R> (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1<T of kotlin.StandardKt.with, R of kotlin.StandardKt.with>): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=<root>.Result origin=null
|
||||
<T>: kotlin.Int
|
||||
<R>: <root>.Result
|
||||
receiver: CONST Int type=kotlin.Int value=1
|
||||
block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<kotlin.Int, <root>.Result> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($receiver:kotlin.Int) returnType:<root>.Result
|
||||
$receiver: VALUE_PARAMETER name:$this$with type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:<root>.Result [val]
|
||||
GET_VAR 'var result: <root>.Result [var] declared in <root>.box' type=<root>.Result origin=null
|
||||
SET_VAR 'var result: <root>.Result [var] declared in <root>.box' type=kotlin.Unit origin=EQ
|
||||
CALL 'public final fun inc (_context_receiver_0: kotlin.Int): <root>.Result [operator] declared in <root>' type=<root>.Result origin=null
|
||||
$receiver: GET_VAR 'val tmp_1: <root>.Result [val] declared in <root>.box.<anonymous>' type=<root>.Result origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
GET_VAR 'val tmp_1: <root>.Result [val] declared in <root>.box.<anonymous>' type=<root>.Result origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:<root>.Result [val]
|
||||
GET_VAR 'var result: <root>.Result [var] declared in <root>.box' type=<root>.Result origin=null
|
||||
SET_VAR 'var result: <root>.Result [var] declared in <root>.box' type=kotlin.Unit origin=EQ
|
||||
CALL 'public final fun inc (_context_receiver_0: kotlin.Int): <root>.Result [operator] declared in <root>' type=<root>.Result origin=null
|
||||
$receiver: GET_VAR 'val tmp_2: <root>.Result [val] declared in <root>.box.<anonymous>' type=<root>.Result origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
GET_VAR 'val tmp_2: <root>.Result [val] declared in <root>.box.<anonymous>' type=<root>.Result origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun unaryMinus (_context_receiver_0: kotlin.Int): <root>.Result [operator] declared in <root>' type=<root>.Result origin=null
|
||||
$receiver: GET_VAR 'var result: <root>.Result [var] declared in <root>.box' type=<root>.Result origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun unaryPlus (_context_receiver_0: kotlin.Int): <root>.Result [operator] declared in <root>' type=<root>.Result origin=null
|
||||
$receiver: GET_VAR 'var result: <root>.Result [var] declared in <root>.box' type=<root>.Result origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:<root>.Result [val]
|
||||
GET_VAR 'var result: <root>.Result [var] declared in <root>.box' type=<root>.Result origin=null
|
||||
SET_VAR 'var result: <root>.Result [var] declared in <root>.box' type=kotlin.Unit origin=EQ
|
||||
CALL 'public final fun dec (_context_receiver_0: kotlin.Int): <root>.Result [operator] declared in <root>' type=<root>.Result origin=null
|
||||
$receiver: GET_VAR 'val tmp_3: <root>.Result [val] declared in <root>.box.<anonymous>' type=<root>.Result origin=null
|
||||
_context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int origin=null
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): <root>.Result declared in <root>.box'
|
||||
GET_VAR 'val tmp_3: <root>.Result [val] declared in <root>.box.<anonymous>' type=<root>.Result origin=null
|
||||
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
WHEN type=kotlin.String origin=IF
|
||||
BRANCH
|
||||
if: WHEN type=kotlin.Boolean origin=ANDAND
|
||||
BRANCH
|
||||
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||
arg0: CALL 'public final fun <get-i> (): kotlin.Int declared in <root>.Result' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR 'var result: <root>.Result [var] declared in <root>.box' type=<root>.Result origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=1
|
||||
then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
|
||||
arg0: CALL 'public final fun <get-operationScore> (): kotlin.Int declared in <root>' type=kotlin.Int origin=GET_PROPERTY
|
||||
arg1: CONST Int type=kotlin.Int value=5
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: CONST Boolean type=kotlin.Boolean value=false
|
||||
then: CONST String type=kotlin.String value="OK"
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: CONST String type=kotlin.String value="fail"
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
data class Result {
|
||||
constructor(i: Int) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
val i: Int
|
||||
field = i
|
||||
get
|
||||
|
||||
operator fun component1(): Int {
|
||||
return <this>.#i
|
||||
}
|
||||
|
||||
fun copy(i: Int = <this>.#i): Result {
|
||||
return Result(i = i)
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
when {
|
||||
EQEQEQ(arg0 = <this>, arg1 = other) -> return true
|
||||
}
|
||||
when {
|
||||
other !is Result -> return false
|
||||
}
|
||||
val tmp0_other_with_cast: Result = other as Result
|
||||
when {
|
||||
EQEQ(arg0 = <this>.#i, arg1 = tmp0_other_with_cast.#i).not() -> return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return <this>.#i.hashCode()
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "Result(" + "i=" + <this>.#i + ")"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var operationScore: Int
|
||||
field = 0
|
||||
get
|
||||
set
|
||||
|
||||
operator fun Result.unaryMinus(_context_receiver_0: Int): Result {
|
||||
<set-operationScore>(<set-?> = <get-operationScore>().plus(other = _context_receiver_0))
|
||||
return Result(i = <this>.<get-i>().unaryMinus())
|
||||
}
|
||||
|
||||
operator fun Result.unaryPlus(_context_receiver_0: Int): Result {
|
||||
<set-operationScore>(<set-?> = <get-operationScore>().plus(other = _context_receiver_0))
|
||||
return Result(i = when {
|
||||
less(arg0 = <this>.<get-i>(), arg1 = 0) -> <this>.<get-i>().unaryMinus()
|
||||
else -> <this>.<get-i>()
|
||||
})
|
||||
}
|
||||
|
||||
operator fun Result.inc(_context_receiver_0: Int): Result {
|
||||
<set-operationScore>(<set-?> = <get-operationScore>().plus(other = _context_receiver_0))
|
||||
return Result(i = <this>.<get-i>().plus(other = 1))
|
||||
}
|
||||
|
||||
operator fun Result.dec(_context_receiver_0: Int): Result {
|
||||
<set-operationScore>(<set-?> = <get-operationScore>().plus(other = _context_receiver_0))
|
||||
return Result(i = <this>.<get-i>().minus(other = 1))
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var result: Result = Result(i = 0)
|
||||
with<Int, Result>(receiver = 1, block = local fun Int.<anonymous>(): Result {
|
||||
val <unary>: Result = result
|
||||
result = <unary>.inc(_context_receiver_0 = $this$with)
|
||||
<unary> /*~> Unit */
|
||||
val <unary>: Result = result
|
||||
result = <unary>.inc(_context_receiver_0 = $this$with)
|
||||
<unary> /*~> Unit */
|
||||
result.unaryMinus(_context_receiver_0 = $this$with) /*~> Unit */
|
||||
result.unaryPlus(_context_receiver_0 = $this$with) /*~> Unit */
|
||||
val <unary>: Result = result
|
||||
result = <unary>.dec(_context_receiver_0 = $this$with)
|
||||
return <unary>
|
||||
}
|
||||
) /*~> Unit */
|
||||
return when {
|
||||
when {
|
||||
EQEQ(arg0 = result.<get-i>(), arg1 = 1) -> EQEQ(arg0 = <get-operationScore>(), arg1 = 5)
|
||||
else -> false
|
||||
} -> "OK"
|
||||
else -> "fail"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
data class Result(val i: Int)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user