How should I return multi expressions in `IrGener...
# compiler
c
How should I return multi expressions in
IrGenerationExtension.visitCall
?
Forgive me for being a little stupid. I didn’t see
Copy code
irBlock {}
s
Blocks could break the flow quite a bit, I think
IrComposite
is a bit more suitable for this use case
c
Cool, is there any difference between these two methods?
s
No real knowledge, only guessing based on my experience with blocks: it feels like blocks create some kind of scope, and sometimes result in less efficient bytecode. Composite seems to be a plain expression container, just collecting multiple expressions in a place of a single one. Both could break the code flow though if used in the wrong places, but I've seen composites used way more often for default param values and other grouping inside the compiler.
c
Detailed explanation! Thank you, I use
IrComposite
now