Imran/Malic
08/21/2020, 2:45 PMdescriptor
, which would return the resolved call at the call-site. It has been removed ever since in this PR and was wondering if someone knows a way to go from IrCall -> CallableMemberDescriptor in the IrPhase. In my use case I can’t access the psiElement at call-site only the one in the symbol from the original declaration, which is not resolved - regarding type arguments etc.
that is:
{ expression: IrCall -> expression.symbol.owner.descriptor.original.findPsi()
} // returns the PsiElement
but
{ expression: IrCall-> BindingTraceContext.createTraceableBindingTrace().bindingContext.get(BindingContext.DECLARATION_TO_DESCRIPTOR, expression.symbol.owner.descriptor.original.findPsi()) } // returns always null
prior to 1.3.71 one would only need to do:
{ expression: IrCall -> expression.descriptor } // returns CallableMemberDescriptor, which is fully resolved
Any help is very welcome 😄Ilmir Usmanov [JB]
08/21/2020, 3:30 PMsymbol.owner
.Imran/Malic
08/21/2020, 8:28 PMsymbol.owner
only gives me the unsubstituted version as far as I see it in the debugger. But I might be missing the API that resolves that. I haven’t found itudalov
DeclarationDescriptor
in IR backends and are planning to remove access to it entirely. It’s a legacy API, not very suitable for the kind of tasks required in the backend. For your task, I’d recommend you to look at IrTypeSubstitutor
and its usages, maybe there’s something helpful. Alternatively, you can perform the substitution manually yourself, since the IrCall
should have all the necessary informationImran/Malic
08/31/2020, 11:33 AMImran/Malic
08/31/2020, 11:38 AMSimpleFunctionDescriptor
in IR to an WrappedSimplFunctionDescriptor
, but the problem is if I try to do that in SyntheticResolution I need the SymbolTable and the associated IrFunction, from that descriptor, which I don’t have in that Phase.
And within the IrPhase I don’t seem to find the right endpoint to change itImran/Malic
08/31/2020, 11:45 AMImran/Malic
08/31/2020, 11:46 AM