diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/NativeInlineFunctionResolver.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/NativeInlineFunctionResolver.kt index 8d4248b705b71..59813a4f20c45 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/NativeInlineFunctionResolver.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/NativeInlineFunctionResolver.kt @@ -50,8 +50,8 @@ internal class NativeInlineFunctionResolver( function.loweredInlineFunction?.let { return it } - val moduleDeserializer = context.irLinker.getCachedDeclarationModuleDeserializer(function) - val functionIsCached = moduleDeserializer != null && function.body == null + val moduleDeserializer = if (function.body == null) context.irLinker.getCachedDeclarationModuleDeserializer(function) else null + val functionIsCached = moduleDeserializer != null if (functionIsCached) { // The function is cached, get its body from the IR linker. moduleDeserializer.deserializeInlineFunction(function)