KT-52791 Make it possible to pass multiple context receivers to a class

This commit is contained in:
Pavel Mikhailovskii
2022-12-28 11:21:03 +00:00
committed by Space Team
parent 62217b39ec
commit 906c161068
38 changed files with 180 additions and 516 deletions
@@ -1,8 +1,8 @@
class A<T : Any?> {
private /* final field */ val contextReceiverField0: T
constructor(<this>: T) /* primary */ {
constructor(_context_receiver_0: T) /* primary */ {
super/*Any*/()
<this>.#contextReceiverField0 = <this>
<this>.#contextReceiverField0 = _context_receiver_0
/* <init>() */
}
@@ -11,9 +11,9 @@ class A<T : Any?> {
class B<P : Any?> {
private /* final field */ val contextReceiverField0: Collection<P>
constructor(<this>: Collection<P>) /* primary */ {
constructor(_context_receiver_0: Collection<P>) /* primary */ {
super/*Any*/()
<this>.#contextReceiverField0 = <this>
<this>.#contextReceiverField0 = _context_receiver_0
/* <init>() */
}
@@ -21,9 +21,9 @@ class B<P : Any?> {
}
fun Int.foo() {
A<Int>(<this> = <this>) /*~> Unit */
A<Int>(_context_receiver_0 = <this>) /*~> Unit */
}
fun Collection<Int>.bar() {
B<Int>(<this> = <this>) /*~> Unit */
B<Int>(_context_receiver_0 = <this>) /*~> Unit */
}