Standardize context receiver parameter names
Previously, FIR used `_context_receiver_n` while FE10 used `<this>` for all context receiver parameters. This commit changes the code in FE10 to follow the convention from FIR.
This commit is contained in:
committed by
Alexander Udalov
parent
5cf1a88c42
commit
21fef70367
+17
-17
@@ -11,20 +11,20 @@ class Context {
|
||||
|
||||
}
|
||||
|
||||
inline fun testInline(<this>: Context): Int {
|
||||
return <this>.c()
|
||||
inline fun testInline(_context_receiver_0: Context): Int {
|
||||
return _context_receiver_0.c()
|
||||
}
|
||||
|
||||
inline fun testInlineWithArg(<this>: Context, i: Int): Int {
|
||||
return i.plus(other = <this>.c())
|
||||
inline fun testInlineWithArg(_context_receiver_0: Context, i: Int): Int {
|
||||
return i.plus(other = _context_receiver_0.c())
|
||||
}
|
||||
|
||||
inline fun Int.testInlineWithExtensionAndArg(<this>: Context, i: Int): Int {
|
||||
return <this>.plus(other = i).plus(other = <this>.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(<this>: Context, i1: Int, i2: Int): Int {
|
||||
return <this>.plus(other = i1).plus(other = i2).plus(other = <this>.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())
|
||||
}
|
||||
|
||||
class A {
|
||||
@@ -40,9 +40,9 @@ class A {
|
||||
|
||||
}
|
||||
|
||||
inline fun Int.testInlineWithExtensionAndMultipleContextsAndArgs(<this>: Context, <this>: A, i1: Int = 1, i2: Int = 2): Int {
|
||||
return <this>.plus(other = i1).plus(other = i2).plus(other = <this>.c()).plus(other = when {
|
||||
EQEQ(arg0 = <this>.<get-a>(), arg1 = null) -> 0
|
||||
inline fun Int.testInlineWithExtensionAndMultipleContextsAndArgs(_context_receiver_0: Context, _context_receiver_1: A, 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.<get-a>(), arg1 = null) -> 0
|
||||
else -> 1
|
||||
})
|
||||
}
|
||||
@@ -50,13 +50,13 @@ inline fun Int.testInlineWithExtensionAndMultipleContextsAndArgs(<this>: Context
|
||||
fun box(): String {
|
||||
return with<Context, Nothing>(receiver = Context(), block = local fun Context.<anonymous>(): Nothing {
|
||||
var result: Int = 0
|
||||
result = result.plus(other = testInline(<this> = $this$with))
|
||||
result = result.plus(other = testInlineWithArg(<this> = $this$with, i = 1))
|
||||
result = result.plus(other = 1.testInlineWithExtensionAndArg(<this> = $this$with, i = 1))
|
||||
result = result.plus(other = 1.testInlineWithExtensionAndMultipleArgs(<this> = $this$with, i1 = 1, i2 = 2))
|
||||
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<A, Unit>(receiver = A(a = 1), block = local fun A.<anonymous>() {
|
||||
result = result.plus(other = 1.testInlineWithExtensionAndMultipleContextsAndArgs(<this> = $this$with, <this> = $this$with, i1 = 1, i2 = 2))
|
||||
result = result.plus(other = 1.testInlineWithExtensionAndMultipleContextsAndArgs(<this> = $this$with, <this> = $this$with))
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user