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
+5
-5
@@ -43,20 +43,20 @@ object StringMonoid : Monoid<String> {
|
||||
|
||||
}
|
||||
|
||||
fun <T : Any?> List<T>.sum(<this>: Monoid<T>): T {
|
||||
return <this>.fold<T, T>(initial = <this>.<get-unit>(), operation = local fun <anonymous>(acc: T, e: T): T {
|
||||
return (<this>, acc).combine(other = e)
|
||||
fun <T : Any?> List<T>.sum(_context_receiver_0: Monoid<T>): T {
|
||||
return <this>.fold<T, T>(initial = _context_receiver_0.<get-unit>(), operation = local fun <anonymous>(acc: T, e: T): T {
|
||||
return (_context_receiver_0, acc).combine(other = e)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
with<IntMonoid, Int>(receiver = IntMonoid, block = local fun IntMonoid.<anonymous>(): Int {
|
||||
return listOf<Int>(elements = [1, 2, 3]).sum<Int>(<this> = $this$with)
|
||||
return listOf<Int>(elements = [1, 2, 3]).sum<Int>(_context_receiver_0 = $this$with)
|
||||
}
|
||||
) /*~> Unit */
|
||||
return with<StringMonoid, String>(receiver = StringMonoid, block = local fun StringMonoid.<anonymous>(): String {
|
||||
return listOf<String>(elements = ["O", "K"]).sum<String>(<this> = $this$with)
|
||||
return listOf<String>(elements = ["O", "K"]).sum<String>(_context_receiver_0 = $this$with)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user