[K/JS] Use declared upper-bound types for parameters inside inlined functions body, instead of the provided types

This commit is contained in:
Artem Kobzar
2023-06-20 12:01:28 +00:00
committed by Space Team
parent aa4ebe1991
commit 039b5fca7a
38 changed files with 269 additions and 53 deletions
@@ -1623,9 +1623,20 @@ object ArrayOps : TemplateGroupBase() {
body {
"""
AbstractList.checkRangeIndexes(fromIndex, toIndex, size)
nativeFill(element, fromIndex, toIndex);
nativeFill(element, fromIndex, toIndex)
"""
}
specialFor(ArraysOfPrimitives) {
if (primitive == PrimitiveType.Char) {
body {
"""
AbstractList.checkRangeIndexes(fromIndex, toIndex, size)
// We need to call [Char.code] here to eliminate Char-boxing with the new JS function inlining logic
nativeFill(element.code, fromIndex, toIndex)
"""
}
}
}
}
on(Platform.Native) {
suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")