Commit Graph

3976 Commits

Author SHA1 Message Date
Mikhail Glukhikh a77b758efa LV 2.0: drop reporting FIR_COMPILED_CLASS and relevant stuff
#KT-62056 Fixed
Related to KT-59171, KT-61951
2023-09-21 11:14:09 +00:00
Ilya Gorbunov 93b107000a [stdlib-mpp] Remove stdlib projects no longer included in build 2023-09-20 01:07:59 +00:00
Mikhail Glukhikh 5fb38008b7 Switch Kotlin version to 2.0
#KT-59171 In Progress
2023-09-19 15:46:26 +00:00
Zalim Bashorov 86e854a980 Revert "[Wasm] Don't use the new br_on_cast* instructions since they are not supported in Node.js yet"
This reverts commit 2d728727

#KT-60828 Fixed
2023-09-19 09:23:26 +00:00
Alexander Udalov 909f32ed54 Build: pass -Xexpect-actual-classes to some libraries compile tasks
To suppress the warning introduced in KT-61573.
2023-09-12 11:24:29 +00:00
Abduqodiri Qurbonzoda ba374bb45c Optimize hex formatting and parsing implementation #KT-58218
Merge-request: KT-MR-11702
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2023-09-08 22:40:56 +00:00
Nikita Bobko 01fc708a0f Mark expect/actual classifiers as experimental
^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`
2023-09-04 12:21:37 +00:00
Ilya Gorbunov 8ae21c0e1b [Generator] Do not omit public visibility of methods in wasm 2023-09-04 11:32:39 +00:00
Ilya Gorbunov 1c149925b7 [Generator] Always put expression body on a new line 2023-09-04 11:32:39 +00:00
Ilya Gorbunov 68a9b9c312 [Generator] Reference generator class in generated code files 2023-09-04 11:32:39 +00:00
Ilya Gorbunov 60bbd08569 [Generator] Rename additionalDoc, put its content before annotations 2023-09-04 11:32:39 +00:00
Abduqodiri Qurbonzoda 9352e40d54 Wasm Enum.hashCode() is not final #KT-61614
Merge-request: KT-MR-11938
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2023-08-31 14:31:56 +00:00
Ilya Kirillov 9b114335fb [stdlib] fix stdlib-common highlighting in K2 IDE plugin
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.
2023-08-31 12:51:47 +00:00
Ilya Gorbunov 7d3f080c81 Generate JS Long using builtin generators (step 2) 2023-08-29 16:27:55 +00:00
Ilya Gorbunov 814515964d Move JS Long to generated Primitives.kt file (step 1) 2023-08-29 16:27:55 +00:00
Alex Kuznetsov 35b3a9ec82 [Docs] Samples for 'step' function 2023-08-25 19:34:39 +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
Ivan Kylchik adce2c9a78 [WASM] Replace deprecated Char.toInt() with Char.code 2023-08-24 08:59:49 +00:00
Ivan Kylchik ee973c0ede [Generator] Generate Char class 2023-08-24 08:59:49 +00:00
Ivan Kylchik 38e434bc07 [Generator] Generate Boolean class 2023-08-24 08:59:49 +00:00
Ilya Gorbunov 3f3cd2e87a [Generator] Set up body for rangeTo and rangeUntil by default
Also use expression body formatting for `rangeTo`.
2023-08-24 08:59:49 +00:00
Nikita Bobko ad90c86abe jvm-minimal-for-test: apply module-wise -opt-in=kotlin.ExperimentalMultiplatform
Motivation: Consistency. All other stdlib modules use this module-wise
`-opt-in`
2023-08-21 19:51:08 +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
Aleksei.Cherepanov e1c399b353 Fix JPS import after 7ae443ad 2023-08-21 10:11:55 +00:00
Ilya Gorbunov 9640e32483 [stdlib-mpp] Publish wasm artifacts through variants of stdlib KT-60909 2023-08-18 15:36:15 +00:00
Sebastian Sellmair f06a1c89ef [stdlib-mpp] Publish patched/custom kpsm to list 'commonMain' included into 'nativeApiElements'
Native/Shared Source Sets still requires stdlib:commonMain.klib as
dependency for IDE analysis.

See: KT-56278
^KT-60901 Verification Pending
2023-08-11 14:52:02 +00:00
Ilya Gorbunov 3e4cbd6dd2 Publish Gradle metadata for kotlin-stdlib-common, KT-60911
This makes it depend on kotlin-stdlib in all targets
and have no artifacts from Gradle's point of view
2023-08-11 08:49:23 +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
Ilya Gorbunov 0882c645dd [stdlib-mpp] Move dependency constraints to api dependencies, KT-55297
Constrained alignment is also required for compile time dependencies
2023-08-10 10:35:54 +00:00
Aleksei.Cherepanov c8c3565a24 Fix JPS import
Exclude kotlin-stdlib-js project for JPS build. Related to KT-56106

#KT-61059 Fixed


Merge-request: KT-MR-11527
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
2023-08-09 14:37:21 +00:00
Anton Lakotka 7c5dd7c451 [stdlib-mpp] Add dependency constraint on kotlin-stdlib-common for...
...other variants where it can be expected. Such as:

* commonMainMetadataElements (legacy metadata)
* metadataElements (klib metadata)
* nativeApiElements

This would prevent from leaking kotlin-stdlib-common dependencies of
older Kotlin versions. So every KGP configuration where
stdlib dependencies is configured automatically will enforce dependency
constraints on kotlin-stdlib-common.

^KT-61053 Verification Pending
2023-08-09 07:52:35 +00:00
Igor Yakovlev 223e590dcd [Wasm] Temporary task to provide wasm stdlib tests 2023-08-08 18:10:20 +02:00
Igor Yakovlev 983991d46c [Wasm] Add box and stdlib tests in wasi mode 2023-08-08 18:10:19 +02:00
Igor Yakovlev f42d0b1ed4 [Wasm] Add wasi kotlin.test target gradle buildscript 2023-08-08 18:10:19 +02:00
Igor Yakovlev d1c7caf15c [Wasm] Add wasi stdlib target gradle buildscript
KT-56608
2023-08-08 18:10:19 +02:00
Igor Yakovlev 8cc0660693 [Wasm] Wasi stdlib implementation
KT-56608
2023-08-08 18:10:19 +02:00
Igor Yakovlev 090f393f97 [Wasm] Make std internal functions have a bodies 2023-08-08 18:10:19 +02:00
Ilya Gorbunov 0072189fb1 [stdlib-mpp] Configure SBOM for published artifacts KT-53791 2023-08-08 12:32:18 +00:00
Abduqodiri Qurbonzoda 21619264d0 [K/N] Add a note to Regex documentation about future changes of behavior
This note will allow us to fix https://youtrack.jetbrains.com/issue/KT-58198/Native-Regex-issues in the future.

Co-authored-by: Ilya Gorbunov <Ilya.Gorbunov@jetbrains.com>


Merge-request: KT-MR-11387
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2023-08-08 08:21:10 +00:00
Alexander Udalov cceb138c6c Stdlib: do not check radix twice in Byte/Short.toString
`checkRadix` is already called in `Int.toString`.
2023-08-07 21:47:10 +00:00
Ilya Gorbunov 1a8cb02a43 [stdlib-mpp] Fix implicit signing task dependency on shared javadoc artifact
By not using shared javadoc artifact for all publications.
See the commit e6df34805f for details.
2023-08-04 16:11:56 +00:00
Ilya Gorbunov 28992b1302 [stdlib-mpp] Move KGP obsolete property suppress closer to usage
Also remove no-op property enableGranularSourceSetsMetadata
2023-08-04 16:11:56 +00:00
Ilya Gorbunov d72631a773 [stdlib-mpp] Workarounds for opt-in problems caused by languageSettings DSL rework
KT-56106
2023-08-03 14:47:21 +00:00
Ilya Gorbunov 21565c6128 [stdlib-mpp] Add dependency constraints to JVM variant, KT-55297 2023-08-03 14:47:21 +00:00
Ilya Gorbunov 671451fb67 [stdlib-mpp] publish legacy MPP common metadata additionally in a variant under 'common' classifier 2023-08-03 14:47:21 +00:00
Ilya Gorbunov a9bc8fa402 [stdlib-mpp] Exclude kotlin-stdlib-js/js-ir projects and use kotlin-stdlib instead
- Specify disambiguating attributes in kotlin-dom-api-compat
  compile dependency configurations
  because it uses the flag that removes JS compiler type attribute
  from all configurations and variants

  KT-56106
2023-08-03 14:47:21 +00:00
Ilya Gorbunov a4c75338f3 [stdlib-mpp] js artifacts for dist
KT-56106
2023-08-03 14:47:21 +00:00
Ilya Gorbunov 8e78a433e7 [stdlib-mpp] Suppress warnings to please the Kotlin compiler in Gradle DSL
KT-56106
2023-08-03 14:47:21 +00:00
Ilya Gorbunov 19cbd4dd3e [stdlib-mpp] Disable js-v1 test execution and compilation and remove the corresponding workarounds
KT-56106
2023-08-03 14:47:20 +00:00