Commit Graph

519 Commits

Author SHA1 Message Date
Dmitrii Gridin b6d373d8e5 Update copyright to 2024 2024-01-05 13:43:17 +00:00
Artem Kobzar 2530cba82a [K/JS] Compile Kotlin coroutines as JS generator ^KT-63038 Fixed 2023-12-18 17:13:07 +00:00
Abduqodiri Qurbonzoda e94b247835 Introduce Common StringBuilder.append/insert(Byte/Short) extensions #KT-63341 2023-11-26 02:48:19 +02:00
Abduqodiri Qurbonzoda db6a662631 Remove Common StringBuilder.append/insert(Byte/Short) members #KT-63341 2023-11-26 02:48:18 +02:00
Ilya Gorbunov d8ee74222f [builtins-gen] Explicit visibility for companion objects and secondary constructors 2023-11-22 18:04:34 +00:00
Alexander Korepanov 45c166abf8 [JS IR] Introduce special setMetadataFor*() for synthetic classes
^KT-63436 Fixed
2023-11-22 09:21:44 +00:00
Alexander Korepanov 9af681e234 [JS IR] Rename metadataUtils.kt -> metadataUtilsOld.kt 2023-11-22 09:21:44 +00:00
Ilya Gorbunov 4d8cf4903c [stdlib] Explicit visibility and return types: DOM API 2023-11-21 18:14:09 +00:00
Ilya Gorbunov ce427b96b3 [stdlib] Suppress explicit api errors in DOM declarations generated by dukat
Suppressions should be removed once dukat supports generating
explicit public visibility and return types
2023-11-21 18:14:09 +00:00
Ilya Gorbunov 381a8fd55f [stdlib] Explicit visibility and return types: JS
Stepping test line number changes are due to changes in coroutineInternalJS.kt
2023-11-21 18:14:09 +00:00
Ilya Gorbunov aa4419b7e3 [stdlib] Explicit visibility and return types: Collections 2023-11-20 02:24:40 +00:00
Ilya Gorbunov da1d3be7f2 [stdlib] Explicit visibility and return types: StringBuilder 2023-11-20 02:24:40 +00:00
Ilya Gorbunov fc64e30829 [stdlib-js] Move jsTypeOf to a documentable source root and restore its kdoc 2023-11-13 20:06:27 +00:00
Ilya Gorbunov c69f36a8be [stdlib-js] Move public API out of runtime helpers directory 2023-11-13 19:21:08 +00:00
Ilya Gorbunov 9ccce52915 Clean up WasExperimental annotation from declarations with SinceKotlin<=1.4
Since it is not possible to use -api-version < 1.4, this annotation has no effect
2023-11-10 12:20:52 +00:00
Nikita Bobko 4050285fef Drop unnecessary suppress from stdlib
^KT-62785 Fixed
Review: https://jetbrains.team/p/kt/reviews/12858/files
2023-11-06 19:00:35 +00:00
Nikita Bobko 14029b0ebc [STDLIB] 1/2 Drop AllowDifferentMembersInActual from stdlib
^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
2023-10-20 14:37:09 +00:00
Ilya Gorbunov aedc704e77 [stdlib] Further merge js-ir specific sources 2023-10-19 03:11:54 +00:00
Ilya Gorbunov 911fa3bbbb [stdlib] Merge js-ir specific sources into common js sources 2023-10-19 03:11:54 +00:00
Ilya Gorbunov 1d232c69d6 [stdlib] Move location of generated sources for js-IR compilation 2023-10-19 03:11:53 +00:00
Ilya Gorbunov 5f0a930ea3 [stdlib] Delete js-v1 sources 2023-10-19 03:11:53 +00:00
Abduqodiri Qurbonzoda 84c6333b23 Introduce Common String.toCharArray(destination) #KT-60657
Merge-request: KT-MR-11340
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2023-08-25 03:11:13 +00:00
Nikita Bobko 25c082f02b K1: Implement a checker that disallows to have different member scopes for expect open and its actual
^KT-22841 Fixed
Review: https://jetbrains.team/p/kt/reviews/11603/timeline

The commit also introduces `@AllowDifferentMembersInActual` annotation in
stdlib which allows to suppress the diagnostic
2023-08-21 19:51:08 +00:00
Ilya Gorbunov 93b0a90172 Add missing SinceKotlin for new JS annotations, KT-6168 2023-08-21 12:49:21 +00:00
Nikita Bobko d39755b578 [FE] Convert specific diagnostic for actual function with default arguments into a common incompatibility
^KT-59665 Fixed
Review: https://jetbrains.team/p/kt/reviews/11039/timeline

It's better to have this logic in common place
(AbstractExpectActualCompatibilityChecker) to avoid missing compilation
errors in the future

This commit fixes:
1. Missing compilation error for actual function with default arguments
   for 'actual typealias' KT-59665
2. Missing compilation error for actual function with default arguments
   for actual fake-override KT-59665

Alternative solution for KT-59665 is to create a special checker.

"incompatibility" vs "special checker":

Arguments for common incompatibility:
- What if we had a rule that expect and actual default params must
  match? If so then it certainly would be an incompatibility.
- Technically, we do the matching of expect and actual params (because
  we allow default params in common ancestors of expect and actual
  declarations).
- It's hard to check that the actual definition doesn't use default
  params because `ExpectedActualResolver.findActualForExpected` filters
  out fake-overrides and doesn't return them. It's not clear logic for
  me, that I'm afraid to touch.
  implicitActualFakeOverride_AbstractMap.kt test breaks if you drop this
  weird logic
- WEAK incompatibilities can be considered as "checkers". So it doesn't
  matter how it's implemented, as a "incompatibility" or a "checker"

Arguments against common incompatibility:
- Although we match expect and actual declarations to allow default
  params in common ancestors of expect and actual declarations, it's
  still can be considered that we check that the actual declaration
  doesn't have default params. And it doesn't feel right that we check
  correctness of the actual declaration in expect-actual matcher.
- ~~It may change the rules of expect actual matching~~ (It's not true,
  because ActualFunctionWithDefaultParameters is declared as WEAK
  incompatibility)
2023-08-10 15:46:46 +00:00
Abduqodiri Qurbonzoda 7fc90c02f1 Rename copyToArrayImpl to collectionToArray 2023-07-27 11:16:58 +00:00
Abduqodiri Qurbonzoda 7010bf2c20 Move copyToArrayImpl implementation to Common source set 2023-07-27 11:16:58 +00:00
Abduqodiri Qurbonzoda 6fdfd4e8dd Null-terminate Collection.toArray destination only in JVM
In other platforms the elements following the collection elements
should not be changed.

As a part of efforts to stabilize Native stdlib.
2023-07-27 11:16:58 +00:00
Artem Kobzar 85ee2d71d2 [K/JS] Remove FILE target from JsName annotation and use the new experimental JsFileName annotation instead 2023-07-27 09:44:28 +00:00
Ilya Gorbunov 61175889b9 KT-53154 extract implementation of enumEntries into an expect/actual internal helper function
It's required, so it can be implemented in different backends
at a different pace and in a different manner
2023-07-24 11:18:44 +00:00
Roman Efremov 8ce1417621 [Stdlib] Fix reports of MPP annotation checker
^KT-58551
2023-07-24 09:48:49 +00:00
Alexander Korepanov ad3583ac38 [JS IR] Fix KClass equals for Nothing type 2023-07-21 14:48:30 +00:00
Alexander Korepanov 90498593f3 [JS IR] Fix review comments. 2023-07-21 14:48:30 +00:00
Alexander Korepanov 09501224e8 [JS IR] Add comments
^KT-59001
2023-07-21 14:48:30 +00:00
Alexander Korepanov 0b4a9499f0 [JS IR] Catch concurrent modifications of HashMap
^KT-59001
2023-07-21 14:48:29 +00:00
Alexander Korepanov 5e2c1761fc [JS IR] Implement InternalStringLinkedMap
^KT-59001
2023-07-21 14:48:29 +00:00
Alexander Korepanov 058cc9def2 [JS IR] Rework HashSet
^KT-59001
2023-07-21 14:48:29 +00:00
Alexander Korepanov f834007da6 [JS IR] Remove unused code & comments & style fixes
^KT-59001
2023-07-21 14:48:29 +00:00
Alexander Korepanov 2300facead [JS IR] Rework HashMapEntries, get rid of LinkedHashMap
^KT-59001
2023-07-21 14:48:29 +00:00
Alexander Korepanov f202865080 [JS IR] Improve InternalStringMap iterators & Extend InternalMap interface
^KT-59001
2023-07-21 14:48:29 +00:00
Alexander Korepanov 6f0628cb8a [JS IR] Replace InternalHashCodeMap with InternalHashMap
^KT-59001
2023-07-21 14:48:29 +00:00
Alexander Korepanov 6a1e14df0b [JS IR] Implement InternalMap interface
^KT-59001
2023-07-21 14:48:29 +00:00
Alexander Korepanov 6a77514a83 [JS IR] Get rid of HashMap EqualityComparator
^KT-59001
2023-07-21 14:48:29 +00:00
Alexander Korepanov 402d5e63fd [JS IR] Cleanup InternalHashMap
^KT-59001
2023-07-21 14:48:29 +00:00
Alexander Korepanov e26c06f0e1 [JS IR] Copy paste native-wasm HashMap implementation
Copy from libraries/stdlib/native-wasm/src/kotlin/collections/HashMap.kt

^KT-59001
2023-07-21 14:48:29 +00:00
Artem Kobzar 044c0adae7 [K/JS] Implement an incremental compilation for the per-file granularity 2023-07-19 15:57:56 +00:00
Abduqodiri Qurbonzoda fed453fdea Provide Common StringBuilder.append/insert with primitive type arguments #KT-57359
Merge-request: KT-MR-10892
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2023-07-13 11:52:14 +00:00
Ilya Gorbunov 39e9996940 Rename js/annotations.kt to avoid duplicates in sources
The conflicting one is Annotations.kt from builtins that are merged together with js stdlib sources, thus leading to two files with the same name differing only by case.
2023-06-26 18:24:34 +00:00
Artem Kobzar 64158a8a2f [K/JS] Add file-to-file compilation ^KT-6168 Fixed 2023-06-22 18:23:45 +00:00
Vsevolod Tolstopyatov 175cf5e833 KT-53327 replace Enum.values() with Enum.entries in CharCategory
Also, replace it in stdlib tests where appropriate and disable already unsupported legacy JS tests


^KT-53327 fixed

Co-authored-by: Artem Kobzar <Artem.Kobzar@jetbrains.com>

Merge-request: KT-MR-10632
Merged-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
2023-06-21 14:40:16 +00:00