KT-52791 Make it possible to pass multiple context receivers to a class
This commit is contained in:
committed by
Space Team
parent
62217b39ec
commit
906c161068
+1
-7
@@ -133,19 +133,13 @@ internal class ClassMemberGenerator(
|
|||||||
val thisParameter =
|
val thisParameter =
|
||||||
conversionScope.dispatchReceiverParameter(irClass) ?: error("No found this parameter for $irClass")
|
conversionScope.dispatchReceiverParameter(irClass) ?: error("No found this parameter for $irClass")
|
||||||
|
|
||||||
val receiver = IrGetValueImpl(
|
|
||||||
UNDEFINED_OFFSET, UNDEFINED_OFFSET,
|
|
||||||
thisParameter.type,
|
|
||||||
thisParameter.symbol,
|
|
||||||
)
|
|
||||||
|
|
||||||
for (index in containingClass.contextReceivers.indices) {
|
for (index in containingClass.contextReceivers.indices) {
|
||||||
val irValueParameter = valueParameters[index]
|
val irValueParameter = valueParameters[index]
|
||||||
body.statements.add(
|
body.statements.add(
|
||||||
IrSetFieldImpl(
|
IrSetFieldImpl(
|
||||||
UNDEFINED_OFFSET, UNDEFINED_OFFSET,
|
UNDEFINED_OFFSET, UNDEFINED_OFFSET,
|
||||||
contextReceiverFields[index].symbol,
|
contextReceiverFields[index].symbol,
|
||||||
receiver,
|
IrGetValueImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, thisParameter.type, thisParameter.symbol),
|
||||||
IrGetValueImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, irValueParameter.type, irValueParameter.symbol),
|
IrGetValueImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, irValueParameter.type, irValueParameter.symbol),
|
||||||
components.irBuiltIns.unitType,
|
components.irBuiltIns.unitType,
|
||||||
)
|
)
|
||||||
|
|||||||
+6
@@ -17215,6 +17215,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
|||||||
runTest("compiler/testData/codegen/box/extensionClasses/generics.kt");
|
runTest("compiler/testData/codegen/box/extensionClasses/generics.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("multiple.kt")
|
||||||
|
public void testMultiple() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/extensionClasses/multiple.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("propertyWithContext.kt")
|
@TestMetadata("propertyWithContext.kt")
|
||||||
public void testPropertyWithContext() throws Exception {
|
public void testPropertyWithContext() throws Exception {
|
||||||
|
|||||||
Generated
+6
@@ -859,6 +859,12 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest {
|
|||||||
runTest("compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.kt");
|
runTest("compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt52791.kt")
|
||||||
|
public void testKt52791() throws Exception {
|
||||||
|
runTest("compiler/testData/ir/irText/declarations/contextReceivers/kt52791.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("lazy.kt")
|
@TestMetadata("lazy.kt")
|
||||||
public void testLazy() throws Exception {
|
public void testLazy() throws Exception {
|
||||||
|
|||||||
+6
@@ -859,6 +859,12 @@ public class LightTreeFir2IrTextTestGenerated extends AbstractLightTreeFir2IrTex
|
|||||||
runTest("compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.kt");
|
runTest("compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt52791.kt")
|
||||||
|
public void testKt52791() throws Exception {
|
||||||
|
runTest("compiler/testData/ir/irText/declarations/contextReceivers/kt52791.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("lazy.kt")
|
@TestMetadata("lazy.kt")
|
||||||
public void testLazy() throws Exception {
|
public void testLazy() throws Exception {
|
||||||
|
|||||||
+10
-3
@@ -52,6 +52,7 @@ import org.jetbrains.kotlin.types.checker.SimpleClassicTypeSystemContext;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
import static kotlin.collections.CollectionsKt.firstOrNull;
|
import static kotlin.collections.CollectionsKt.firstOrNull;
|
||||||
import static org.jetbrains.kotlin.descriptors.DescriptorVisibilities.PRIVATE;
|
import static org.jetbrains.kotlin.descriptors.DescriptorVisibilities.PRIVATE;
|
||||||
@@ -310,17 +311,23 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements ClassDes
|
|||||||
return CollectionsKt.emptyList();
|
return CollectionsKt.emptyList();
|
||||||
}
|
}
|
||||||
List<KtContextReceiver> contextReceivers = classOrObject.getContextReceivers();
|
List<KtContextReceiver> contextReceivers = classOrObject.getContextReceivers();
|
||||||
List<ReceiverParameterDescriptor> contextReceiverDescriptors = contextReceivers.stream()
|
List<ReceiverParameterDescriptor> contextReceiverDescriptors =
|
||||||
.map(contextReceiver -> {
|
IntStream.range(0, contextReceivers.size())
|
||||||
|
.mapToObj(index -> {
|
||||||
|
KtContextReceiver contextReceiver = contextReceivers.get(index);
|
||||||
KtTypeReference typeReference = contextReceiver.typeReference();
|
KtTypeReference typeReference = contextReceiver.typeReference();
|
||||||
if (typeReference == null) return null;
|
if (typeReference == null) return null;
|
||||||
KotlinType kotlinType =
|
KotlinType kotlinType =
|
||||||
c.getTypeResolver().resolveType(getScopeForClassHeaderResolution(), typeReference, c.getTrace(), true);
|
c.getTypeResolver().resolveType(getScopeForClassHeaderResolution(), typeReference, c.getTrace(), true);
|
||||||
|
Name label = contextReceiver.labelNameAsName() != null
|
||||||
|
? contextReceiver.labelNameAsName()
|
||||||
|
: Name.identifier("_context_receiver_" + index);
|
||||||
return DescriptorFactory.createContextReceiverParameterForClass(
|
return DescriptorFactory.createContextReceiverParameterForClass(
|
||||||
this,
|
this,
|
||||||
kotlinType,
|
kotlinType,
|
||||||
contextReceiver.labelNameAsName(),
|
contextReceiver.labelNameAsName(),
|
||||||
Annotations.Companion.getEMPTY()
|
Annotations.Companion.getEMPTY(),
|
||||||
|
index
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
|
|||||||
@@ -370,18 +370,18 @@ class BodyGenerator(
|
|||||||
irBlockBody: IrBlockBody
|
irBlockBody: IrBlockBody
|
||||||
) {
|
) {
|
||||||
val thisAsReceiverParameter = classDescriptor.thisAsReceiverParameter
|
val thisAsReceiverParameter = classDescriptor.thisAsReceiverParameter
|
||||||
val receiver = IrGetValueImpl(
|
|
||||||
UNDEFINED_OFFSET, UNDEFINED_OFFSET,
|
|
||||||
thisAsReceiverParameter.type.toIrType(),
|
|
||||||
context.symbolTable.referenceValue(thisAsReceiverParameter)
|
|
||||||
)
|
|
||||||
for ((index, receiverDescriptor) in classDescriptor.contextReceivers.withIndex()) {
|
for ((index, receiverDescriptor) in classDescriptor.contextReceivers.withIndex()) {
|
||||||
val irValueParameter = irConstructor.valueParameters[index]
|
val irValueParameter = irConstructor.valueParameters[index]
|
||||||
irBlockBody.statements.add(
|
irBlockBody.statements.add(
|
||||||
IrSetFieldImpl(
|
IrSetFieldImpl(
|
||||||
UNDEFINED_OFFSET, UNDEFINED_OFFSET,
|
UNDEFINED_OFFSET, UNDEFINED_OFFSET,
|
||||||
context.additionalDescriptorStorage.getSyntheticField(receiverDescriptor.value).symbol,
|
context.additionalDescriptorStorage.getSyntheticField(receiverDescriptor.value).symbol,
|
||||||
receiver,
|
IrGetValueImpl(
|
||||||
|
UNDEFINED_OFFSET,
|
||||||
|
UNDEFINED_OFFSET,
|
||||||
|
thisAsReceiverParameter.type.toIrType(),
|
||||||
|
context.symbolTable.referenceValue(thisAsReceiverParameter)
|
||||||
|
),
|
||||||
IrGetValueImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, irValueParameter.type, irValueParameter.symbol),
|
IrGetValueImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, irValueParameter.type, irValueParameter.symbol),
|
||||||
context.irBuiltIns.unitType
|
context.irBuiltIns.unitType
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
// !LANGUAGE: +ContextReceivers
|
||||||
|
// TARGET_BACKEND: JVM_IR
|
||||||
|
|
||||||
|
class A(val a: String)
|
||||||
|
class B(val b: String)
|
||||||
|
|
||||||
|
context(A, B)
|
||||||
|
class C {
|
||||||
|
fun foo() = this@A.a + this@B.b
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val c = with(A("O")) {
|
||||||
|
with(B("K")) {
|
||||||
|
C()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return c.foo()
|
||||||
|
}
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
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'
|
|
||||||
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
|
|
||||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
|
||||||
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
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
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*/()
|
|
||||||
<this>.#contextReceiverField0 = _context_receiver_0
|
|
||||||
/* <init>() */
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
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 */
|
|
||||||
}
|
|
||||||
@@ -32,14 +32,14 @@ FILE fqName:<root> fileName:/class.kt
|
|||||||
CLASS CLASS name:Inner modality:FINAL visibility:public superTypes:[kotlin.Any]
|
CLASS CLASS name:Inner modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Inner
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Inner
|
||||||
FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.Outer visibility:private [final]
|
FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.Outer visibility:private [final]
|
||||||
CONSTRUCTOR visibility:public <> (<this>:<root>.Outer, arg:kotlin.Any) returnType:<root>.Inner [primary]
|
CONSTRUCTOR visibility:public <> (_context_receiver_0:<root>.Outer, arg:kotlin.Any) returnType:<root>.Inner [primary]
|
||||||
VALUE_PARAMETER name:<this> index:0 type:<root>.Outer
|
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.Outer
|
||||||
VALUE_PARAMETER name:arg index:1 type:kotlin.Any
|
VALUE_PARAMETER name:arg index:1 type:kotlin.Any
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||||
SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.Outer visibility:private [final]' type=kotlin.Unit origin=null
|
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
|
receiver: GET_VAR '<this>: <root>.Inner declared in <root>.Inner' type=<root>.Inner origin=null
|
||||||
value: GET_VAR '<this>: <root>.Outer declared in <root>.Inner.<init>' type=<root>.Outer origin=null
|
value: GET_VAR '_context_receiver_0: <root>.Outer declared in <root>.Inner.<init>' type=<root>.Outer origin=null
|
||||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||||
FUN name:bar visibility:public modality:FINAL <> ($this:<root>.Inner) returnType:kotlin.Int
|
FUN name:bar visibility:public modality:FINAL <> ($this:<root>.Inner) returnType:kotlin.Int
|
||||||
$this: VALUE_PARAMETER name:<this> type:<root>.Inner
|
$this: VALUE_PARAMETER name:<this> type:<root>.Inner
|
||||||
@@ -74,6 +74,6 @@ FILE fqName:<root> fileName:/class.kt
|
|||||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.Outer
|
$receiver: VALUE_PARAMETER name:$this$with type:<root>.Outer
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): <root>.Inner declared in <root>.f'
|
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): <root>.Inner declared in <root>.f'
|
||||||
CONSTRUCTOR_CALL 'public constructor <init> (<this>: <root>.Outer, arg: kotlin.Any) [primary] declared in <root>.Inner' type=<root>.Inner origin=null
|
CONSTRUCTOR_CALL 'public constructor <init> (_context_receiver_0: <root>.Outer, arg: kotlin.Any) [primary] declared in <root>.Inner' type=<root>.Inner origin=null
|
||||||
<this>: GET_VAR '$this$with: <root>.Outer declared in <root>.f.<anonymous>' type=<root>.Outer 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
|
arg: CONST Int type=kotlin.Int value=3
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// !LANGUAGE: +ContextReceivers
|
// !LANGUAGE: +ContextReceivers
|
||||||
|
|
||||||
class Outer {
|
class Outer {
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ class Outer {
|
|||||||
|
|
||||||
class Inner {
|
class Inner {
|
||||||
private /* final field */ val contextReceiverField0: Outer
|
private /* final field */ val contextReceiverField0: Outer
|
||||||
constructor(<this>: Outer, arg: Any) /* primary */ {
|
constructor(_context_receiver_0: Outer, arg: Any) /* primary */ {
|
||||||
super/*Any*/()
|
super/*Any*/()
|
||||||
<this>.#contextReceiverField0 = <this>
|
<this>.#contextReceiverField0 = _context_receiver_0
|
||||||
/* <init>() */
|
/* <init>() */
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -28,7 +28,7 @@ class Inner {
|
|||||||
|
|
||||||
fun f(outer: Outer) {
|
fun f(outer: Outer) {
|
||||||
with<Outer, Inner>(receiver = outer, block = local fun Outer.<anonymous>(): Inner {
|
with<Outer, Inner>(receiver = outer, block = local fun Outer.<anonymous>(): Inner {
|
||||||
return Inner(<this> = $this$with, arg = 3)
|
return Inner(_context_receiver_0 = $this$with, arg = 3)
|
||||||
}
|
}
|
||||||
) /*~> Unit */
|
) /*~> Unit */
|
||||||
}
|
}
|
||||||
|
|||||||
-61
@@ -1,61 +0,0 @@
|
|||||||
FILE fqName:<root> fileName:/contextReceiverMethod.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:foo 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 foo (): 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
|
|
||||||
CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any]
|
|
||||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Test
|
|
||||||
FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.Context visibility:private [final]
|
|
||||||
CONSTRUCTOR visibility:public <> (_context_receiver_0:<root>.Context) returnType:<root>.Test [primary]
|
|
||||||
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.Context
|
|
||||||
BLOCK_BODY
|
|
||||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
|
||||||
SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.Context visibility:private [final]' type=kotlin.Unit origin=null
|
|
||||||
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test' type=<root>.Test origin=null
|
|
||||||
value: GET_VAR '_context_receiver_0: <root>.Context declared in <root>.Test.<init>' type=<root>.Context origin=null
|
|
||||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
|
||||||
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.Test) returnType:kotlin.Int
|
|
||||||
$this: VALUE_PARAMETER name:<this> type:<root>.Test
|
|
||||||
BLOCK_BODY
|
|
||||||
RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in <root>.Test'
|
|
||||||
CONST Int type=kotlin.Int value=2
|
|
||||||
FUN name:bar visibility:public modality:FINAL <> ($this:<root>.Test) returnType:kotlin.Unit
|
|
||||||
$this: VALUE_PARAMETER name:<this> type:<root>.Test
|
|
||||||
BLOCK_BODY
|
|
||||||
VAR name:x type:kotlin.Int [val]
|
|
||||||
CALL 'public final fun foo (): kotlin.Int declared in <root>.Context' type=kotlin.Int origin=null
|
|
||||||
$this: GET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.Context visibility:private [final]' type=<root>.Context origin=null
|
|
||||||
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test.bar' type=<root>.Test 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
|
|
||||||
-31
@@ -1,31 +0,0 @@
|
|||||||
class Context {
|
|
||||||
constructor() /* primary */ {
|
|
||||||
super/*Any*/()
|
|
||||||
/* <init>() */
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
fun foo(): Int {
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
class Test {
|
|
||||||
private /* final field */ val contextReceiverField0: Context
|
|
||||||
constructor(_context_receiver_0: Context) /* primary */ {
|
|
||||||
super/*Any*/()
|
|
||||||
<this>.#contextReceiverField0 = _context_receiver_0
|
|
||||||
/* <init>() */
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
fun foo(): Int {
|
|
||||||
return 2
|
|
||||||
}
|
|
||||||
|
|
||||||
fun bar() {
|
|
||||||
val x: Int = <this>.#contextReceiverField0.foo()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
+3
-3
@@ -26,13 +26,13 @@ FILE fqName:<root> fileName:/contextReceiverMethod.kt
|
|||||||
CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any]
|
CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Test
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Test
|
||||||
FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.Context visibility:private [final]
|
FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.Context visibility:private [final]
|
||||||
CONSTRUCTOR visibility:public <> (<this>:<root>.Context) returnType:<root>.Test [primary]
|
CONSTRUCTOR visibility:public <> (_context_receiver_0:<root>.Context) returnType:<root>.Test [primary]
|
||||||
VALUE_PARAMETER name:<this> index:0 type:<root>.Context
|
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.Context
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||||
SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.Context visibility:private [final]' type=kotlin.Unit origin=null
|
SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.Context visibility:private [final]' type=kotlin.Unit origin=null
|
||||||
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test' type=<root>.Test origin=null
|
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test' type=<root>.Test origin=null
|
||||||
value: GET_VAR '<this>: <root>.Context declared in <root>.Test.<init>' type=<root>.Context origin=null
|
value: GET_VAR '_context_receiver_0: <root>.Context declared in <root>.Test.<init>' type=<root>.Context origin=null
|
||||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||||
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.Test) returnType:kotlin.Int
|
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.Test) returnType:kotlin.Int
|
||||||
$this: VALUE_PARAMETER name:<this> type:<root>.Test
|
$this: VALUE_PARAMETER name:<this> type:<root>.Test
|
||||||
|
|||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// !LANGUAGE: +ContextReceivers
|
// !LANGUAGE: +ContextReceivers
|
||||||
|
|
||||||
class Context {
|
class Context {
|
||||||
|
|||||||
+2
-2
@@ -13,9 +13,9 @@ class Context {
|
|||||||
|
|
||||||
class Test {
|
class Test {
|
||||||
private /* final field */ val contextReceiverField0: Context
|
private /* final field */ val contextReceiverField0: Context
|
||||||
constructor(<this>: Context) /* primary */ {
|
constructor(_context_receiver_0: Context) /* primary */ {
|
||||||
super/*Any*/()
|
super/*Any*/()
|
||||||
<this>.#contextReceiverField0 = <this>
|
<this>.#contextReceiverField0 = _context_receiver_0
|
||||||
/* <init>() */
|
/* <init>() */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
-103
@@ -1,103 +0,0 @@
|
|||||||
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'
|
|
||||||
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
|
|
||||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:OK 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
|
|
||||||
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
@@ -1,39 +0,0 @@
|
|||||||
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*/()
|
|
||||||
<this>.#contextReceiverField0 = _context_receiver_0
|
|
||||||
/* <init>() */
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
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>()
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
+5
-5
@@ -33,14 +33,14 @@ FILE fqName:<root> fileName:/contextualPrimaryConstructorWithParams.kt
|
|||||||
CLASS CLASS name:OK modality:FINAL visibility:public superTypes:[kotlin.Any]
|
CLASS CLASS name:OK modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.OK
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.OK
|
||||||
FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.O visibility:private [final]
|
FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.O visibility:private [final]
|
||||||
CONSTRUCTOR visibility:public <> (<this>:<root>.O, k:kotlin.String) returnType:<root>.OK [primary]
|
CONSTRUCTOR visibility:public <> (_context_receiver_0:<root>.O, k:kotlin.String) returnType:<root>.OK [primary]
|
||||||
VALUE_PARAMETER name:<this> index:0 type:<root>.O
|
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.O
|
||||||
VALUE_PARAMETER name:k index:1 type:kotlin.String
|
VALUE_PARAMETER name:k index:1 type:kotlin.String
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||||
SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.O visibility:private [final]' type=kotlin.Unit origin=null
|
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
|
receiver: GET_VAR '<this>: <root>.OK declared in <root>.OK' type=<root>.OK origin=null
|
||||||
value: GET_VAR '<this>: <root>.O declared in <root>.OK.<init>' type=<root>.O origin=null
|
value: GET_VAR '_context_receiver_0: <root>.O declared in <root>.OK.<init>' type=<root>.O origin=null
|
||||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:OK modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:OK modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||||
PROPERTY name:k visibility:public modality:FINAL [val]
|
PROPERTY name:k visibility:public modality:FINAL [val]
|
||||||
FIELD PROPERTY_BACKING_FIELD name:k type:kotlin.String visibility:private [final]
|
FIELD PROPERTY_BACKING_FIELD name:k type:kotlin.String visibility:private [final]
|
||||||
@@ -95,8 +95,8 @@ FILE fqName:<root> fileName:/contextualPrimaryConstructorWithParams.kt
|
|||||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.O
|
$receiver: VALUE_PARAMETER name:$this$with type:<root>.O
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
VAR name:ok type:<root>.OK [val]
|
VAR name:ok type:<root>.OK [val]
|
||||||
CONSTRUCTOR_CALL 'public constructor <init> (<this>: <root>.O, k: kotlin.String) [primary] declared in <root>.OK' type=<root>.OK origin=null
|
CONSTRUCTOR_CALL 'public constructor <init> (_context_receiver_0: <root>.O, k: kotlin.String) [primary] declared in <root>.OK' type=<root>.OK origin=null
|
||||||
<this>: GET_VAR '$this$with: <root>.O declared in <root>.box.<anonymous>' type=<root>.O 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"
|
k: CONST String type=kotlin.String value="K"
|
||||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.String declared in <root>.box'
|
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
|
CALL 'public final fun <get-result> (): kotlin.String declared in <root>.OK' type=kotlin.String origin=GET_PROPERTY
|
||||||
|
|||||||
Vendored
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// !LANGUAGE: +ContextReceivers
|
// !LANGUAGE: +ContextReceivers
|
||||||
|
|
||||||
class O(val o: String)
|
class O(val o: String)
|
||||||
|
|||||||
+3
-3
@@ -13,9 +13,9 @@ class O {
|
|||||||
|
|
||||||
class OK {
|
class OK {
|
||||||
private /* final field */ val contextReceiverField0: O
|
private /* final field */ val contextReceiverField0: O
|
||||||
constructor(<this>: O, k: String) /* primary */ {
|
constructor(_context_receiver_0: O, k: String) /* primary */ {
|
||||||
super/*Any*/()
|
super/*Any*/()
|
||||||
<this>.#contextReceiverField0 = <this>
|
<this>.#contextReceiverField0 = _context_receiver_0
|
||||||
/* <init>() */
|
/* <init>() */
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,7 @@ class OK {
|
|||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
return with<O, String>(receiver = O(o = "O"), block = local fun O.<anonymous>(): String {
|
return with<O, String>(receiver = O(o = "O"), block = local fun O.<anonymous>(): String {
|
||||||
val ok: OK = OK(<this> = $this$with, k = "K")
|
val ok: OK = OK(_context_receiver_0 = $this$with, k = "K")
|
||||||
return ok.<get-result>()
|
return ok.<get-result>()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
Vendored
+5
-5
@@ -86,13 +86,13 @@ FILE fqName:<root> fileName:/delegatedPropertiesOperators.kt
|
|||||||
CLASS CLASS name:Result modality:FINAL visibility:public superTypes:[kotlin.Any]
|
CLASS CLASS name:Result modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Result
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Result
|
||||||
FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final]
|
FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final]
|
||||||
CONSTRUCTOR visibility:public <> (<this>:kotlin.Int) returnType:<root>.Result [primary]
|
CONSTRUCTOR visibility:public <> (_context_receiver_0:kotlin.Int) returnType:<root>.Result [primary]
|
||||||
VALUE_PARAMETER name:<this> index:0 type:kotlin.Int
|
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||||
SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final]' type=kotlin.Unit origin=null
|
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
|
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result' type=<root>.Result origin=null
|
||||||
value: GET_VAR '<this>: kotlin.Int declared in <root>.Result.<init>' type=kotlin.Int origin=null
|
value: GET_VAR '_context_receiver_0: kotlin.Int declared in <root>.Result.<init>' type=kotlin.Int origin=null
|
||||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Result modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Result modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||||
PROPERTY name:s visibility:public modality:FINAL [delegated,var]
|
PROPERTY name:s visibility:public modality:FINAL [delegated,var]
|
||||||
FIELD PROPERTY_DELEGATE name:s$delegate type:<root>.Delegate visibility:private [final]
|
FIELD PROPERTY_DELEGATE name:s$delegate type:<root>.Delegate visibility:private [final]
|
||||||
@@ -149,8 +149,8 @@ FILE fqName:<root> fileName:/delegatedPropertiesOperators.kt
|
|||||||
$receiver: VALUE_PARAMETER name:$this$with type:kotlin.Int
|
$receiver: VALUE_PARAMETER name:$this$with type:kotlin.Int
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): <root>.Result declared in <root>.box'
|
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): <root>.Result declared in <root>.box'
|
||||||
CONSTRUCTOR_CALL 'public constructor <init> (<this>: kotlin.Int) [primary] declared in <root>.Result' type=<root>.Result origin=null
|
CONSTRUCTOR_CALL 'public constructor <init> (_context_receiver_0: kotlin.Int) [primary] declared in <root>.Result' type=<root>.Result origin=null
|
||||||
<this>: GET_VAR '$this$with: kotlin.Int declared in <root>.box.<anonymous>' type=kotlin.Int 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
|
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
|
$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"
|
<set-?>: CONST String type=kotlin.String value="OK"
|
||||||
|
|||||||
Vendored
+3
-3
@@ -33,9 +33,9 @@ class Delegate {
|
|||||||
|
|
||||||
class Result {
|
class Result {
|
||||||
private /* final field */ val contextReceiverField0: Int
|
private /* final field */ val contextReceiverField0: Int
|
||||||
constructor(<this>: Int) /* primary */ {
|
constructor(_context_receiver_0: Int) /* primary */ {
|
||||||
super/*Any*/()
|
super/*Any*/()
|
||||||
<this>.#contextReceiverField0 = <this>
|
<this>.#contextReceiverField0 = _context_receiver_0
|
||||||
/* <init>() */
|
/* <init>() */
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -53,7 +53,7 @@ class Result {
|
|||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
val result: Result = with<Int, Result>(receiver = 1, block = local fun Int.<anonymous>(): Result {
|
val result: Result = with<Int, Result>(receiver = 1, block = local fun Int.<anonymous>(): Result {
|
||||||
return Result(<this> = $this$with)
|
return Result(_context_receiver_0 = $this$with)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
result.<set-s>(<set-?> = "OK")
|
result.<set-s>(<set-?> = "OK")
|
||||||
|
|||||||
-65
@@ -1,65 +0,0 @@
|
|||||||
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
|
|
||||||
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'
|
|
||||||
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
|
|
||||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A 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: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
|
|
||||||
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'
|
|
||||||
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
|
|
||||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B 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:foo visibility:public modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.Unit
|
|
||||||
$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> (_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> (_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
|
|
||||||
-29
@@ -1,29 +0,0 @@
|
|||||||
class A<T : Any?> {
|
|
||||||
private /* final field */ val contextReceiverField0: T
|
|
||||||
constructor(_context_receiver_0: T) /* primary */ {
|
|
||||||
super/*Any*/()
|
|
||||||
<this>.#contextReceiverField0 = _context_receiver_0
|
|
||||||
/* <init>() */
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
class B<P : Any?> {
|
|
||||||
private /* final field */ val contextReceiverField0: Collection<P>
|
|
||||||
constructor(_context_receiver_0: Collection<P>) /* primary */ {
|
|
||||||
super/*Any*/()
|
|
||||||
<this>.#contextReceiverField0 = _context_receiver_0
|
|
||||||
/* <init>() */
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Int.foo() {
|
|
||||||
A<Int>(_context_receiver_0 = <this>) /*~> Unit */
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Collection<Int>.bar() {
|
|
||||||
B<Int>(_context_receiver_0 = <this>) /*~> Unit */
|
|
||||||
}
|
|
||||||
+10
-10
@@ -3,13 +3,13 @@ FILE fqName:<root> fileName:/genericOuterClass.kt
|
|||||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A<T of <root>.A>
|
$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
|
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false
|
||||||
FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:T of <root>.A visibility:private [final]
|
FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:T of <root>.A visibility:private [final]
|
||||||
CONSTRUCTOR visibility:public <> (<this>:T of <root>.A) returnType:<root>.A<T of <root>.A> [primary]
|
CONSTRUCTOR visibility:public <> (_context_receiver_0:T of <root>.A) returnType:<root>.A<T of <root>.A> [primary]
|
||||||
VALUE_PARAMETER name:<this> index:0 type:T of <root>.A
|
VALUE_PARAMETER name:_context_receiver_0 index:0 type:T of <root>.A
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in 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
|
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
|
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 '<this>: T of <root>.A declared in <root>.A.<init>' type=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
|
||||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A 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]
|
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||||
overridden:
|
overridden:
|
||||||
@@ -28,13 +28,13 @@ FILE fqName:<root> fileName:/genericOuterClass.kt
|
|||||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.B<P of <root>.B>
|
$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
|
TYPE_PARAMETER name:P index:0 variance: superTypes:[kotlin.Any?] reified:false
|
||||||
FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.collections.Collection<P of <root>.B> visibility:private [final]
|
FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.collections.Collection<P of <root>.B> visibility:private [final]
|
||||||
CONSTRUCTOR visibility:public <> (<this>:kotlin.collections.Collection<P of <root>.B>) returnType:<root>.B<P of <root>.B> [primary]
|
CONSTRUCTOR visibility:public <> (_context_receiver_0:kotlin.collections.Collection<P of <root>.B>) returnType:<root>.B<P of <root>.B> [primary]
|
||||||
VALUE_PARAMETER name:<this> index:0 type:kotlin.collections.Collection<P of <root>.B>
|
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.collections.Collection<P of <root>.B>
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in 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
|
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
|
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 '<this>: kotlin.collections.Collection<P of <root>.B> declared in <root>.B.<init>' type=kotlin.collections.Collection<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
|
||||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B 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]
|
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||||
overridden:
|
overridden:
|
||||||
@@ -53,13 +53,13 @@ FILE fqName:<root> fileName:/genericOuterClass.kt
|
|||||||
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Int
|
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Int
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||||
CONSTRUCTOR_CALL 'public constructor <init> (<this>: T of <root>.A) [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
|
<class: T>: kotlin.Int
|
||||||
<this>: GET_VAR '<this>: kotlin.Int declared in <root>.foo' type=kotlin.Int origin=null
|
_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
|
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>
|
$receiver: VALUE_PARAMETER name:<this> type:kotlin.collections.Collection<kotlin.Int>
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||||
CONSTRUCTOR_CALL 'public constructor <init> (<this>: kotlin.collections.Collection<P of <root>.B>) [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
|
<class: P>: kotlin.Int
|
||||||
<this>: GET_VAR '<this>: kotlin.collections.Collection<kotlin.Int> declared in <root>.bar' type=kotlin.collections.Collection<kotlin.Int> origin=null
|
_context_receiver_0: GET_VAR '<this>: kotlin.collections.Collection<kotlin.Int> declared in <root>.bar' type=kotlin.collections.Collection<kotlin.Int> origin=null
|
||||||
|
|||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// !LANGUAGE: +ContextReceivers
|
// !LANGUAGE: +ContextReceivers
|
||||||
|
|
||||||
context(T) class A<T>
|
context(T) class A<T>
|
||||||
|
|||||||
+6
-6
@@ -1,8 +1,8 @@
|
|||||||
class A<T : Any?> {
|
class A<T : Any?> {
|
||||||
private /* final field */ val contextReceiverField0: T
|
private /* final field */ val contextReceiverField0: T
|
||||||
constructor(<this>: T) /* primary */ {
|
constructor(_context_receiver_0: T) /* primary */ {
|
||||||
super/*Any*/()
|
super/*Any*/()
|
||||||
<this>.#contextReceiverField0 = <this>
|
<this>.#contextReceiverField0 = _context_receiver_0
|
||||||
/* <init>() */
|
/* <init>() */
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -11,9 +11,9 @@ class A<T : Any?> {
|
|||||||
|
|
||||||
class B<P : Any?> {
|
class B<P : Any?> {
|
||||||
private /* final field */ val contextReceiverField0: Collection<P>
|
private /* final field */ val contextReceiverField0: Collection<P>
|
||||||
constructor(<this>: Collection<P>) /* primary */ {
|
constructor(_context_receiver_0: Collection<P>) /* primary */ {
|
||||||
super/*Any*/()
|
super/*Any*/()
|
||||||
<this>.#contextReceiverField0 = <this>
|
<this>.#contextReceiverField0 = _context_receiver_0
|
||||||
/* <init>() */
|
/* <init>() */
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -21,9 +21,9 @@ class B<P : Any?> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun Int.foo() {
|
fun Int.foo() {
|
||||||
A<Int>(<this> = <this>) /*~> Unit */
|
A<Int>(_context_receiver_0 = <this>) /*~> Unit */
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Collection<Int>.bar() {
|
fun Collection<Int>.bar() {
|
||||||
B<Int>(<this> = <this>) /*~> Unit */
|
B<Int>(_context_receiver_0 = <this>) /*~> Unit */
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -192,14 +192,14 @@ FILE fqName:<root> fileName:/iteratorOperator.kt
|
|||||||
CLASS CLASS name:CounterIterator modality:FINAL visibility:public superTypes:[kotlin.collections.Iterator<kotlin.Int>]
|
CLASS CLASS name:CounterIterator modality:FINAL visibility:public superTypes:[kotlin.collections.Iterator<kotlin.Int>]
|
||||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.CounterIterator
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.CounterIterator
|
||||||
FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.CounterConfig visibility:private [final]
|
FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.CounterConfig visibility:private [final]
|
||||||
CONSTRUCTOR visibility:public <> (<this>:<root>.CounterConfig, counter:<root>.Counter) returnType:<root>.CounterIterator [primary]
|
CONSTRUCTOR visibility:public <> (_context_receiver_0:<root>.CounterConfig, counter:<root>.Counter) returnType:<root>.CounterIterator [primary]
|
||||||
VALUE_PARAMETER name:<this> index:0 type:<root>.CounterConfig
|
VALUE_PARAMETER name:_context_receiver_0 index:0 type:<root>.CounterConfig
|
||||||
VALUE_PARAMETER name:counter index:1 type:<root>.Counter
|
VALUE_PARAMETER name:counter index:1 type:<root>.Counter
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||||
SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.CounterConfig visibility:private [final]' type=kotlin.Unit origin=null
|
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
|
receiver: GET_VAR '<this>: <root>.CounterIterator declared in <root>.CounterIterator' type=<root>.CounterIterator origin=null
|
||||||
value: GET_VAR '<this>: <root>.CounterConfig declared in <root>.CounterIterator.<init>' type=<root>.CounterConfig origin=null
|
value: GET_VAR '_context_receiver_0: <root>.CounterConfig declared in <root>.CounterIterator.<init>' type=<root>.CounterConfig origin=null
|
||||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CounterIterator modality:FINAL visibility:public superTypes:[kotlin.collections.Iterator<kotlin.Int>]'
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CounterIterator modality:FINAL visibility:public superTypes:[kotlin.collections.Iterator<kotlin.Int>]'
|
||||||
PROPERTY name:counter visibility:private modality:FINAL [val]
|
PROPERTY name:counter visibility:private modality:FINAL [val]
|
||||||
FIELD PROPERTY_BACKING_FIELD name:counter type:<root>.Counter visibility:private [final]
|
FIELD PROPERTY_BACKING_FIELD name:counter type:<root>.Counter visibility:private [final]
|
||||||
@@ -272,8 +272,8 @@ FILE fqName:<root> fileName:/iteratorOperator.kt
|
|||||||
$receiver: VALUE_PARAMETER name:$this$with type:<root>.CounterConfig
|
$receiver: VALUE_PARAMETER name:$this$with type:<root>.CounterConfig
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): <root>.CounterIterator declared in <root>.iterator'
|
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): <root>.CounterIterator declared in <root>.iterator'
|
||||||
CONSTRUCTOR_CALL 'public constructor <init> (<this>: <root>.CounterConfig, counter: <root>.Counter) [primary] declared in <root>.CounterIterator' type=<root>.CounterIterator origin=null
|
CONSTRUCTOR_CALL 'public constructor <init> (_context_receiver_0: <root>.CounterConfig, counter: <root>.Counter) [primary] declared in <root>.CounterIterator' type=<root>.CounterIterator origin=null
|
||||||
<this>: GET_VAR '$this$with: <root>.CounterConfig declared in <root>.iterator.<anonymous>' type=<root>.CounterConfig origin=null
|
_context_receiver_0: GET_VAR '$this$with: <root>.CounterConfig declared in <root>.iterator.<anonymous>' type=<root>.CounterConfig origin=null
|
||||||
counter: GET_VAR '<this>: <root>.Counter declared in <root>.iterator' type=<root>.Counter 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
|
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
|
|||||||
+3
-3
@@ -87,9 +87,9 @@ data class CounterConfig {
|
|||||||
|
|
||||||
class CounterIterator : Iterator<Int> {
|
class CounterIterator : Iterator<Int> {
|
||||||
private /* final field */ val contextReceiverField0: CounterConfig
|
private /* final field */ val contextReceiverField0: CounterConfig
|
||||||
constructor(<this>: CounterConfig, counter: Counter) /* primary */ {
|
constructor(_context_receiver_0: CounterConfig, counter: Counter) /* primary */ {
|
||||||
super/*Any*/()
|
super/*Any*/()
|
||||||
<this>.#contextReceiverField0 = <this>
|
<this>.#contextReceiverField0 = _context_receiver_0
|
||||||
/* <init>() */
|
/* <init>() */
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -117,7 +117,7 @@ class CounterIterator : Iterator<Int> {
|
|||||||
|
|
||||||
operator fun Counter.iterator(_context_receiver_0: CounterConfig): CounterIterator {
|
operator fun Counter.iterator(_context_receiver_0: CounterConfig): CounterIterator {
|
||||||
return with<CounterConfig, CounterIterator>(receiver = _context_receiver_0, block = local fun CounterConfig.<anonymous>(): CounterIterator {
|
return with<CounterConfig, CounterIterator>(receiver = _context_receiver_0, block = local fun CounterConfig.<anonymous>(): CounterIterator {
|
||||||
return CounterIterator(<this> = $this$with, counter = <this>)
|
return CounterIterator(_context_receiver_0 = $this$with, counter = <this>)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
FILE fqName:<root> fileName:/kt52791.kt
|
||||||
|
CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||||
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyClass
|
||||||
|
FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Unit visibility:private [final]
|
||||||
|
FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField1 type:kotlin.Int visibility:private [final]
|
||||||
|
CONSTRUCTOR visibility:public <> (_context_receiver_0:kotlin.Unit, _context_receiver_1:kotlin.Int) returnType:<root>.MyClass [primary]
|
||||||
|
VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Unit
|
||||||
|
VALUE_PARAMETER name:_context_receiver_1 index:1 type:kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||||
|
SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Unit visibility:private [final]' type=kotlin.Unit origin=null
|
||||||
|
receiver: GET_VAR '<this>: <root>.MyClass declared in <root>.MyClass' type=<root>.MyClass origin=null
|
||||||
|
value: GET_VAR '_context_receiver_0: kotlin.Unit declared in <root>.MyClass.<init>' type=kotlin.Unit origin=null
|
||||||
|
SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField1 type:kotlin.Int visibility:private [final]' type=kotlin.Unit origin=null
|
||||||
|
receiver: GET_VAR '<this>: <root>.MyClass declared in <root>.MyClass' type=<root>.MyClass origin=null
|
||||||
|
value: GET_VAR '_context_receiver_1: kotlin.Int declared in <root>.MyClass.<init>' type=kotlin.Int origin=null
|
||||||
|
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyClass 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
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
// !LANGUAGE: +ContextReceivers
|
||||||
|
// FIR_IDENTICAL
|
||||||
|
// TARGET_BACKEND: JVM_IR
|
||||||
|
|
||||||
|
context(Unit, Int)
|
||||||
|
class MyClass
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
class MyClass {
|
||||||
|
private /* final field */ val contextReceiverField0: Unit
|
||||||
|
private /* final field */ val contextReceiverField1: Int
|
||||||
|
constructor(_context_receiver_0: Unit, _context_receiver_1: Int) /* primary */ {
|
||||||
|
super/*Any*/()
|
||||||
|
<this>.#contextReceiverField0 = _context_receiver_0
|
||||||
|
<this>.#contextReceiverField1 = _context_receiver_1
|
||||||
|
/* <init>() */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+6
@@ -17215,6 +17215,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/extensionClasses/generics.kt");
|
runTest("compiler/testData/codegen/box/extensionClasses/generics.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("multiple.kt")
|
||||||
|
public void testMultiple() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/extensionClasses/multiple.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("propertyWithContext.kt")
|
@TestMetadata("propertyWithContext.kt")
|
||||||
public void testPropertyWithContext() throws Exception {
|
public void testPropertyWithContext() throws Exception {
|
||||||
|
|||||||
Generated
+6
@@ -859,6 +859,12 @@ public class IrTextTestGenerated extends AbstractIrTextTest {
|
|||||||
runTest("compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.kt");
|
runTest("compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt52791.kt")
|
||||||
|
public void testKt52791() throws Exception {
|
||||||
|
runTest("compiler/testData/ir/irText/declarations/contextReceivers/kt52791.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("lazy.kt")
|
@TestMetadata("lazy.kt")
|
||||||
public void testLazy() throws Exception {
|
public void testLazy() throws Exception {
|
||||||
|
|||||||
+5
-4
@@ -206,12 +206,13 @@ class TypeAliasConstructorDescriptorImpl private constructor(
|
|||||||
|
|
||||||
val classDescriptor = typeAliasDescriptor.classDescriptor
|
val classDescriptor = typeAliasDescriptor.classDescriptor
|
||||||
val contextReceiverParameters = classDescriptor?.let {
|
val contextReceiverParameters = classDescriptor?.let {
|
||||||
constructor.contextReceiverParameters.map {
|
constructor.contextReceiverParameters.mapIndexed { index, contextReceiver ->
|
||||||
DescriptorFactory.createContextReceiverParameterForClass(
|
DescriptorFactory.createContextReceiverParameterForClass(
|
||||||
classDescriptor,
|
classDescriptor,
|
||||||
substitutorForUnderlyingClass.safeSubstitute(it.type, Variance.INVARIANT),
|
substitutorForUnderlyingClass.safeSubstitute(contextReceiver.type, Variance.INVARIANT),
|
||||||
(it.value as ImplicitContextReceiver).customLabelName,
|
(contextReceiver.value as ImplicitContextReceiver).customLabelName,
|
||||||
Annotations.EMPTY
|
Annotations.EMPTY,
|
||||||
|
index
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} ?: emptyList()
|
} ?: emptyList()
|
||||||
|
|||||||
@@ -246,10 +246,12 @@ public class DescriptorFactory {
|
|||||||
@NotNull ClassDescriptor owner,
|
@NotNull ClassDescriptor owner,
|
||||||
@Nullable KotlinType receiverParameterType,
|
@Nullable KotlinType receiverParameterType,
|
||||||
@Nullable Name customLabelName,
|
@Nullable Name customLabelName,
|
||||||
@NotNull Annotations annotations
|
@NotNull Annotations annotations,
|
||||||
|
int index
|
||||||
) {
|
) {
|
||||||
return receiverParameterType == null
|
return receiverParameterType == null
|
||||||
? null
|
? null
|
||||||
: new ReceiverParameterDescriptorImpl(owner, new ContextClassReceiver(owner, receiverParameterType, customLabelName, null), annotations);
|
: new ReceiverParameterDescriptorImpl(owner, new ContextClassReceiver(owner, receiverParameterType, customLabelName, null),
|
||||||
|
annotations, NameUtils.contextReceiverName(index));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user