diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/linkage/partial/PartiallyLinkedIrTreePatcher.kt b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/linkage/partial/PartiallyLinkedIrTreePatcher.kt index 7195610b665..aa06bc1025d 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/linkage/partial/PartiallyLinkedIrTreePatcher.kt +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/linkage/partial/PartiallyLinkedIrTreePatcher.kt @@ -753,12 +753,21 @@ internal class PartiallyLinkedIrTreePatcher( 0 // Does not matter here. ) - if (this is IrFunctionReference) { - // Function references don't contain arguments. - return null - } else if (this is IrEnumConstructorCall && (function.parent as? IrClass)?.symbol == builtIns.enumClass) { - // This is a special case. IrEnumConstructorCall don't contain arguments. - return null + when (this) { + is IrFunctionAccessExpression -> { + if (function.isExternal) { + // External functions may have the default arguments declared in native implementations, + // which are not available from Kotlin. + return null + } else if (this is IrEnumConstructorCall && (function.parent as? IrClass)?.symbol == builtIns.enumClass) { + // This is a special case. IrEnumConstructorCall don't contain arguments. + return null + } + } + is IrFunctionReference -> { + // Function references don't contain arguments. + return null + } } // Default values are not kept in value parameters of fake override/delegated/override functions.