@@ -891,7 +891,7 @@ open class KotlinFileExtractor(
891
891
f.realOverrideTarget.let { it != f && (it as ? IrSimpleFunction )?.modality != Modality .ABSTRACT && isKotlinDefinedInterface(it.parentClassOrNull) }
892
892
893
893
private fun makeInterfaceForwarder (f : IrFunction , parentId : Label <out DbReftype >, extractBody : Boolean , extractMethodAndParameterTypeAccesses : Boolean , typeSubstitution : TypeSubstitution ? , classTypeArgsIncludingOuterClasses : List <IrTypeArgument >? ) =
894
- forceExtractFunction(f, parentId, extractBody = false , extractMethodAndParameterTypeAccesses, typeSubstitution, classTypeArgsIncludingOuterClasses, overriddenAttributes = OverriddenFunctionAttributes (visibility = DescriptorVisibilities .PUBLIC )).also { functionId ->
894
+ forceExtractFunction(f, parentId, extractBody = false , extractMethodAndParameterTypeAccesses, typeSubstitution, classTypeArgsIncludingOuterClasses, overriddenAttributes = OverriddenFunctionAttributes (visibility = DescriptorVisibilities .PUBLIC , modality = Modality . OPEN )).also { functionId ->
895
895
tw.writeCompiler_generated(functionId, CompilerGeneratedKinds .INTERFACE_FORWARDER .kind)
896
896
if (extractBody) {
897
897
val realFunctionLocId = tw.getLocation(f)
@@ -1244,7 +1244,7 @@ open class KotlinFileExtractor(
1244
1244
addModifiers(id, " suspend" )
1245
1245
}
1246
1246
if (f.symbol !is IrConstructorSymbol ) {
1247
- when ((f as ? IrSimpleFunction )?.modality) {
1247
+ when (overriddenAttributes?.modality ? : (f as ? IrSimpleFunction )?.modality) {
1248
1248
Modality .ABSTRACT -> addModifiers(id, " abstract" )
1249
1249
Modality .FINAL -> addModifiers(id, " final" )
1250
1250
else -> Unit
@@ -5311,7 +5311,7 @@ open class KotlinFileExtractor(
5311
5311
// we would need to compose generic type substitutions -- for example, if we're implementing
5312
5312
// T UnaryOperator<T>.apply(T t) here, we would need to compose substitutions so we can implement
5313
5313
// the real underlying R Function<T, R>.apply(T t).
5314
- forceExtractFunction(samMember, classId, extractBody = false , extractMethodAndParameterTypeAccesses = true , typeSub, classTypeArgs, overriddenAttributes = OverriddenFunctionAttributes (id = ids.function, sourceLoc = tw.getLocation(e)))
5314
+ forceExtractFunction(samMember, classId, extractBody = false , extractMethodAndParameterTypeAccesses = true , typeSub, classTypeArgs, overriddenAttributes = OverriddenFunctionAttributes (id = ids.function, sourceLoc = tw.getLocation(e), modality = Modality . FINAL ))
5315
5315
5316
5316
addModifiers(ids.function, " override" )
5317
5317
if (st.isSuspendFunctionOrKFunction()) {
@@ -5536,6 +5536,7 @@ open class KotlinFileExtractor(
5536
5536
val typeParameters : List <IrTypeParameter >? = null ,
5537
5537
val isStatic : Boolean? = null ,
5538
5538
val visibility : DescriptorVisibility ? = null ,
5539
+ val modality : Modality ? = null ,
5539
5540
)
5540
5541
5541
5542
private fun peekDeclStackAsDeclarationParent (elementToReportOn : IrElement ): IrDeclarationParent ? {
0 commit comments