Johannes Barop
11/27/2023, 9:57 PMSyntheticResolveExtension
with a FirDeclarationGenerationExtension
to add the signature. The Fir phase runs without exception, however the method is missing during Ir phase.
override fun generateFunctions(
callableId: CallableId,
context: MemberGenerationContext?
): List<FirNamedFunctionSymbol> {
val newFunction = buildSimpleFunction {
moduleData = session.moduleData
name = callableId.callableName
dispatchReceiverType = context?.owner?.defaultType()
symbol = FirNamedFunctionSymbol(callableId)
origin = context!!.owner.origin // TODO
status = FirResolvedDeclarationStatusImpl(Visibilities.Public, Modality.OPEN, EffectiveVisibility.Public)
returnTypeRef = buildResolvedTypeRef { type = session.builtinTypes.unitType.type }
}
return listOf(newFunction.symbol)
}
During class lowering I want to add the function body. However the method is missing in irClass.functions
. Any ideas why?Artem Kobzar
11/30/2023, 8:21 AMJohannes Barop
12/04/2023, 7:21 PMcreateMemberFunction
. Dunno what was missing with the other approach