[PL] Fix: Don't count value arguments vs value parameters for external functions

This commit is contained in:
Dmitriy Dolovov
2023-04-17 01:20:42 +02:00
committed by Space Team
parent b644fc009d
commit 9d3deb7e0e
@@ -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.