Justin Tullgren
10/10/2023, 9:42 PMpluginContext
. Any thoughts on how to get a reference to that function to insert it in some places in code?shikasd
10/11/2023, 1:05 AMJustin Tullgren
10/11/2023, 3:32 PM@Composable fun MyFun(arg: String, arg1: String): String
Justin Tullgren
10/11/2023, 3:33 PMval MyFun = @Composable { arg:String, arg1:String -> arg }
that wouldn’t change?shikasd
10/11/2023, 4:04 PMJustin Tullgren
10/11/2023, 4:07 PMpluginContext.referenceFunctions
. The minute I remove the @Composable
annotation its found. I know the lowering adds the composer and dirty flags and when I look at the transformations I see a different method name. Its okay, I may have a workaround. I wanted it to be be a composable so i could use LaunchedEffect but I have another idea to remove composables entirelyshikasd
10/11/2023, 4:23 PMMyFun(arg: String, arg1: String, $composer: Composer, $changed: Int)
shikasd
10/11/2023, 4:23 PMreferenceFunctions
uses fqName, so it should find itJustin Tullgren
10/11/2023, 4:24 PMshikasd
10/11/2023, 4:26 PMJustin Tullgren
10/11/2023, 4:27 PMshikasd
10/11/2023, 4:52 PMIrModuleFragment
)
You can check if the function in the same module by checking its origin, if it has DECLARATION_STUB
, it means that what you see is a deserialized stub, which doesn't account for IR transforms.Justin Tullgren
10/11/2023, 5:01 PMoverride fun generate(moduleFragment: IrModuleFragment, pluginContext: IrPluginContext) {
InteractionAdapter(configuration, pluginContext, logger).adapt(moduleFragment)
CaptureAdapter(configuration, pluginContext, logger).adapt(moduleFragment)
}
Justin Tullgren
10/11/2023, 5:01 PMshikasd
10/11/2023, 5:02 PMJustin Tullgren
10/11/2023, 5:03 PM