Should I use `FirReceiverParameterSymbol#resolvedT...
# compiler
m
Should I use
FirReceiverParameterSymbol#resolvedType
or
FirReceiverParameterSymbol#fir#typeRef
?
Copy code
fun receiverParam(typeRef: FirTypeRef): SubstitutedMethodSignatureBuilder {
    this.functionBuilder.receiverParameter = buildReceiverParameter(fun (paramBuilder) {
        paramBuilder.typeRef = typeRef
        paramBuilder.symbol = FirReceiverParameterSymbol()
        paramBuilder.moduleData = this.session.moduleData
        paramBuilder.origin = this.key.origin
        paramBuilder.containingDeclarationSymbol = this.functionBuilder.symbol
    })
    return this
}
I want to declare a wrapper method that derives a
receiverParameter: FirReceiverParameter
from a given
FirReceiverParameterSymbol
Copy code
fun receiverParamSubstitute(source: FirReceiverParameterSymbol) {
    this.receiverParam(this.substitute(TODO()))
}
Should I pass •
@OptIn(SymbolInternals::class) source.fir.typeRef
• Or
source.resolvedType.toFirResolvedTypeRef()
? The value of
resolvedType
seems to be based on
fir.typeRef
, but I don’t understand the actual exact difference.
Copy code
private fun substitute(
    source: FirTypeRef,
): FirResolvedTypeRef {
    return this.substitutes.substituteOrSelf(source)
}
FYI, this is the definition of the
substitute
method.