[PL] Fix: Don't count value arguments vs value parameters for external functions
This commit is contained in:
committed by
Space Team
parent
b644fc009d
commit
9d3deb7e0e
+15
-6
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user