When calling a delegate constructor, I need to pass arguments. It seems that this argument list needs to be a
FirResolvedArgumentList
which requires a
FirExpression
and a
FirValueParameter
. The latter I have but I'm unsure about the former. I'm accepting parameters that I'd like to reference. What expression should I use to reference a value parameter? I tried
buildSingleExpressionBlock
but that doesn't seem to be it
ansman
04/05/2024, 1:15 AM
Alright, it seems the expression is generated using
toQualifiedAccess
. But I need to reference the delegate constructor's parameters but all I have is a
FirClassSymbol
which can give me a
FirValueParameterSymbol
but I need a
FirValueParameter
. Is there a sane way to convert between symbols and elements without using
.fir
?
j
Javier
04/05/2024, 7:34 AM
You should avoid any
build*
and only use
create*
method except you don’t find any
create*
method
Javier
04/05/2024, 7:34 AM
Why don’t you want to use
.fir
?
a
ansman
04/05/2024, 6:46 PM
Because it's marked as
@SymbolInternals
j
Javier
04/05/2024, 6:47 PM
I am using it everywhere, cc @dmitriy.novozhilov why is it marked as internal?
d
dmitriy.novozhilov
04/08/2024, 8:20 AM
In Analysis API (IDE) mode there is no guarantee, that fir under the symbol you get from scope/provider will be resolved to the phase you are on right now
So it's ok to access
symbol.fir
itself, but you can't rely on any data in it without calling lazy resolve (which is done under the hood when you use accessors on symbols)