min
10/01/2026, 7:27 AMFirReceiverParameterSymbol#resolvedType or FirReceiverParameterSymbol#fir#typeRef?min
10/01/2026, 7:31 AMfun 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
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.
private fun substitute(
source: FirTypeRef,
): FirResolvedTypeRef {
return this.substitutes.substituteOrSelf(source)
}
FYI, this is the definition of the substitute method.