Does anyone know if the compose kotlin compiler plugin will remove code added by other plugins? Ex....
j
Does anyone know if the compose kotlin compiler plugin will remove code added by other plugins? Ex. In a irBlockBody a statement is added but then the compose compiler comes along and it don't see it after
a
cc @Leland Richardson [G]
j
my logger says its getting modified. Also my `
Copy code
IrGenerationExtension
is set to be run first
l
hmm. so you’re updating the
body
of an IrFunction, before compose’s IrGenerationExtension, and then after compose’s IrGenerationExtension, you’re seeing it revert back to the original one?
j
yes
i am trying to look through the composablefunctionbodytransformer but there is a lot there 🙂
l
indeed
i can’t think of a reason that would happen
if you have src for a minimal IrGeneratorExtention that does this, i can try plugging it in to our tests and see if i can repro and if so, why it’s happening
j
sure. 5 min and i'll zip it up. Can i post here?
l
up to you 🙂 i don’t mind grabbing it from here if you dont
j
will just the `
Copy code
IrGenerationExtension
class work? I have an anonymous visitor implementation in the class
its all poc code, no trade secret
l
yeah i guess just the IrGeneratorExtension and anything it depends on that isn’t in the compiler itself
j
k 5 min
ugh, just put together a simple example and it worked. its on my end. Sorry for wasting your time
and thanks for responding so quick
l
no worries!
r
I had this happen too, w/ compose (or something) removing my added init blocks Reported as https://issuetracker.google.com/issues/185609826
Symbol comparison also seems to break
j
thanks! How were you noticing them being removed? javap or something else?
i'm thinking my issue was i was using the kotlin bytecode viewer and it was hiding some magic
so curious how you are sure of your issue?
r
I was using it to register RPC methods and they weren't getting registered, so I looked at the class file and the init blocks weren't there
If you open the class file in a plaintext editor it's pretty obvious for init blocks, it depends on how "big" of a transformation you're doing
👍 1
j
ok I can't read byte code that well so i tend to not look at classes