[klib] Return the block's return value in inFile methods

This commit is contained in:
Sergej Jaskiewicz
2024-01-12 15:09:07 +01:00
committed by Space Team
parent da9f0e7af8
commit c8f8316e9b
8 changed files with 16 additions and 32 deletions
@@ -71,7 +71,7 @@ abstract class FakeOverrideBuilderStrategy(
* Contract:
* * must call [block] exactly once.
*/
abstract fun inFile(file: IrFile?, block: () -> Unit)
abstract fun <R> inFile(file: IrFile?, block: () -> R): R
/**
* Callback for creating a symbol for fake override function.
@@ -1305,7 +1305,7 @@ private object BindToNewEmptySymbols : FakeOverrideBuilderStrategy(
}
}
override fun inFile(file: IrFile?, block: () -> Unit) { block() }
override fun <R> inFile(file: IrFile?, block: () -> R): R = block()
}
fun IrClass.addFakeOverrides(