Account for context class receivers when creating the ExpressionReceiver
^KT-54084 Fixed
This commit is contained in:
committed by
Nikita Nazarov
parent
f578381726
commit
bd742bb95c
+31
@@ -0,0 +1,31 @@
|
||||
class Context {
|
||||
constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
fun foo(): Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Test {
|
||||
private /* final field */ val contextReceiverField0: Context
|
||||
constructor(<this>: Context) /* primary */ {
|
||||
super/*Any*/()
|
||||
<this>.#contextReceiverField0 = <this>
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
fun foo(): Int {
|
||||
return 2
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
val x: Int = <this>.#contextReceiverField0.foo()
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user