FIR: Unignore all Fir2IrText tests on context receivers

This commit is contained in:
Denis.Zharkov
2022-03-28 18:47:29 +03:00
committed by teamcity
parent 55159eba45
commit 66bd8dccfa
75 changed files with 4710 additions and 62 deletions
@@ -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"
}
}