Drew Hamilton
02/23/2021, 12:56 PMIrSimpleFunctionSymbol
being bound (or not bound)? In particular, if it is being referenced so that it can be called in a generated function, is it meant to be bound to the same IrFunction
that it represents, or to the IrFunction
that is calling it?raulraja
02/23/2021, 3:23 PMIrFunctionAccessExpression
which involves IrCall
constructor calls and other expressions that represent the call site the symbol.owner
is bound to the function being invoked. I think is unbound if you are manually constructing the call but if the call had already been resolved it should be bound to the descriptor it points to. calls to dynamic operators like +
may be an exception in some places if I’m not mistaken.Drew Hamilton
02/23/2021, 3:36 PMSymbol
I resolve is unbound. This works fine in a vacuum, but when I try to use my plugin at the same time as Jetpack Compose, the Compose compiler yells at me for having an unbound symbol.
I can bind to my current IrFunction, but I have no idea if that’s correct or not. Any good reading about this concept?shikasd
02/23/2021, 3:39 PMshikasd
02/23/2021, 3:45 PMIrPluginContext.reference*
, which should return you bound symbols by fqName. If those symbols are unbound, it is usually a compiler bug :)raulraja
02/23/2021, 3:47 PMFunctionDescriptor
pointing to the resolved function in the call it would be calling referenceFunction(resolvedDescriptor)
to get the symbol?Drew Hamilton
02/23/2021, 3:48 PMreferenceSimpleFunction
, but yeah what Raul saidDrew Hamilton
02/23/2021, 3:49 PMpluginContext.symbolTable.referenceSimpleFunction
– so possibly highly relevant that i’m using the obsolete descriptor APIs?raulraja
02/23/2021, 3:50 PMshikasd
02/23/2021, 3:50 PMshikasd
02/23/2021, 3:50 PMDrew Hamilton
02/23/2021, 3:51 PMshikasd
02/23/2021, 3:53 PMshikasd
02/23/2021, 3:55 PMsymbolTable.allUnbound
and then ensure they are bound using linker.getDeclaration
IIRC, but it is more like a massive hack.Drew Hamilton
02/23/2021, 3:57 PMDrew Hamilton
02/24/2021, 9:13 AM