The documentation is provided for ArrayList class but describes its
primary constructor. Thus, in documentation website it appears
as ArrayList documentation. When no KDoc is provided, website generator
takes it from other platforms.
This commit specializes the existing Kotlin/Native stdlib ArrayList into
two subclasses:
* ArrayList
* ArraySubList
This avoids repeatedly checking whether a basic ArrayList is created as a
sublist of another ArrayList.
In the iterators, checkForComodification is marked for inlining, since
this significantly improves iterations performance.
A number of benchmarks are added to the native ring benchmark suite, to
test whether the changed runtime type of ArrayList.subList(...) has an
impact.
The error is reported only when K2 is enabled in stdlib
Merge-request: KT-MR-12930
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
^KT-62656 Fixed
I blindly converted all `@AllowDifferentMembersInActual` to suppresses.
But some suppresses in stdlib are redundant. I'm too lazy properly
annotate only the necessary places. All these suppresses will go away
after the bootstrap update anyway
I drop allowDifferentMembersInActual_class and
allowDifferentMembersInActual_typealias tests because their only purpose
was to check that `@AllowDifferentMembersInActual` works as expected
Note: some tests are failing in the compiler because of that. I will fix
them in the next commit
Rewrite FlatteningSequence to use
the same optimization technique as AbstractIterator.
Didn't extend AbstractIterator as storing and reloading a value
from a field is slightly slower compared to the implemented approach.
Use integer constants instead of enum to track AbstractIterator's state:
- for switches with a few cases, integer constants are
faster as there's no need to load ordinal value from
enum and map it into tableswitch index;
- on JVM, JIT-compiler can optimize away state-tracking code if it uses
integer constants, but when it comes to enums and tableswitches,
it can't apply a same set of optimizations to it.
^KT-61573 Fixed
Review: https://jetbrains.team/p/kt/reviews/11969/timeline
Tests:
- MultiPlatformIntegrationTestGenerated
- CliTestGenerated
- MultiPlatformIntegrationTestGenerated
- DiagnosticTestGenerated.Multiplatform
- FirLightTreeOldFrontendDiagnosticsTestGenerated
Also add -Xexpect-actual-classes flag to all necessary ./libraries/* modules
Otherwise compilation of those modules failes because of `-Werror`
K2 IDE Plugin uses only a partial set of built-ins.
It only has declarations which are not present in
the JVM stdlib as classfiles.
Because of that, some major declarations like
`kotlin.Unit` are missing,
so resolution inside kotlin stdlib common modules does not work.
Because of incorrectly resolved stdlib,
highlighting and resolution in other files in the kotlin project does not work.
This commit adds source versions of stdlib declarations
(`/core/builtins/src/kotlin/`) to the common stdlib as a source-set
for IDE import.
This way all declarations in stdlib common module are properly resolved.
The approach might be incorrect as it might introduce possible redeclaration
conflicts between common and platform stdlib sources
as `/core/builtins/src/kotlin/` source-set is also registered as a source-set for
platforms.