https://kotlinlang.org logo
#compiler
Title
# compiler
j

Justin Tullgren

09/28/2023, 12:18 AM
Hi, I’m looking for a way to chain a
.also
to a function call via a compiler plugin. ex:
foo()
->
foo().also { log(it) }
. Is this still just an IrCall change or some other concept?
y

Youssef Shoaib [MOD]

09/28/2023, 4:13 PM
irCall with a lambda argument or a function reference argument
j

Justin Tullgren

09/28/2023, 4:15 PM
Looking at the IrCall, are you saying
.also
would have a parameter to the function it is chained on or is it a context receiver?
or extension receiver? Sorry I’m not sure how extension functions are representd in IR
y

Youssef Shoaib [MOD]

09/28/2023, 4:18 PM
it'll have it as an extension receiver IIRC
j

Justin Tullgren

09/28/2023, 4:19 PM
ok thanks, i’ll try to make something happen!