Commit Graph

409 Commits

Author SHA1 Message Date
Georgy Bronnikov 41e38d5a1a JVM_IR: move serialized IR to a separate annotation 2021-10-02 00:56:46 +03:00
Abduqodiri Qurbonzoda dc2f5eab25 Align JS and JVM behavior of Regex replace function #KT-28378 2021-09-30 17:38:03 +00:00
Abduqodiri Qurbonzoda cca5f82aa0 Handle container builders capacity overflow 2021-09-30 16:01:57 +00:00
Abduqodiri Qurbonzoda f8bcba0b76 Align JS String.equals/compareTo(ignoreCase) behavior with JVM #KT-48999 2021-09-30 15:35:50 +00:00
Ilya Gorbunov 04d70162d2 Make DurationUnit not a typealias of TimeUnit on JVM
Provide conversion functions between DurationUnit and TimeUnit
2021-09-30 14:31:54 +00:00
Vyacheslav Gerasimov ab146bd6d4 Build: Fix deprecated Gradle configurations usages
for migration to Gradle 7+ #KTI-559
2021-09-26 18:28:44 +03:00
Ilya Gorbunov 7666377565 Control Duration init block assertions on JVM with -ea option
On other platforms enable them unconditionally
2021-09-24 16:17:54 +00:00
Ilya Gorbunov 96611de344 Stabilize Duration, DurationUnit and related top-level functions KT-46784
Co-authored-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2021-09-24 16:17:53 +00:00
Abduqodiri Qurbonzoda 261d0c2783 Promote collection builders to stable #KT-47421 2021-09-21 11:25:28 +00:00
Dmitriy Novozhilov 0923d39215 [Build] Setup useFirForLibraries flag 2021-09-20 14:18:18 +03:00
Abduqodiri Qurbonzoda 3ddc29363a Remove deprecated Common synchronized and deprecate it in JS #KT-46101 2021-09-16 19:38:37 +03:00
Abduqodiri Qurbonzoda d9f8ce899a Promote rotateLeft and rotateRight to stable 2021-09-16 19:27:21 +03:00
Abduqodiri Qurbonzoda 34a50e4e34 Promote regex splitToSequence to stable 2021-09-16 19:26:33 +03:00
Abduqodiri Qurbonzoda f1befc0108 Format Other_Uppercase/Other_Lowercase property as an identifier in docs 2021-09-15 17:31:52 +03:00
Mikhail Glukhikh ffbd574a08 Use -opt-in instead of -Xopt-in in comments and scripts 2021-09-08 23:43:55 +03:00
Abduqodiri Qurbonzoda 97eb28144f Introduce Common readln() and readlnOrNull() top-level functions #KT-48456 2021-09-05 15:31:11 +00:00
Ilya Gorbunov 11314a5c4e Rename enabling old behavior property and make it cached in a field
Mention the property name in the note about conversion to set.

#KT-45438
2021-09-02 06:06:39 +03:00
Abduqodiri Qurbonzoda 94b371af5b Remove brittle ‘contains’ optimization in minus/removeAll/retainAll #KT-45438 2021-09-02 05:58:19 +03:00
Abduqodiri Qurbonzoda 91aa956f34 Introduce JVM readln() and readlnOrNull() top-level functions #KT-48456 2021-09-02 01:00:34 +00:00
Alexander Udalov 98be418245 Uncomment new SinceKotlin and remove obsolete warning suppressions 2021-08-30 19:36:32 +02:00
Mads Ager a12b22c04d [JVM] Force lock object in JVM synchronized implementation into local.
This fixes a performance problem in the case where the lock object
is a capture and the monitor enter/exit happens directly on
field loads. When the locking happens on field loads instead of a
local, the JVM cannot prove that locking is balanced. That has
the consequence that the code is runs very slow (always in the
interpreter).

^KT-48367 Fixed.
2021-08-27 21:29:12 +02:00
Ilya Gorbunov 43a614ffcd Make builder collection implementations serializable KT-39328
Collections returned by collection builders are now serializable in
their read-only state.
The builder mutable collections inside collection builder lambda,
however, are not.
2021-08-24 23:13:57 +00:00
Steven Schäfer de9d2919a8 JVM Metadata: Add a bit to mark anonymous objects in inline functions
Anonymous objects in the scope of an inline functions are copied to
all call-sites. This makes them part of the public ABI of a Kotlin
library.

We introduce a flag to mark all classes in the scope of an inline
function. When compiling with assertions enabled, we check that
this flag is set whenever we inline an anonymous object from another
module.
2021-08-23 18:25:33 +02:00
Alexander Udalov 3bc0eaff59 Fix warnings in stdlib samples and test modules 2021-08-10 17:57:50 +02:00
Alexander Udalov 0925e1b497 Enable JVM IR for stdlib/reflect/test libraries
Changes in Gradle integration tests are needed because:
- in new-mpp-android, kotlin-stdlib-jdk8 is used, and JVM IR generates
  JDK 8-specific bytecode (invokedynamic). D8 needs to be configured to
  desugar it with source/target versions set to 1.8, otherwise it
  reports an error.
- in AndroidExtensionsManyVariants and AndroidIcepickProject, D8 fails
  with assertions enabled if AGP < 4.0.0 is used because of
  https://issuetracker.google.com/issues/148661132. The tests which use
  old AGP versions are probably not relevant anymore anyway.

Changes in kotlin-stdlib-runtime-merged.txt are caused by a slightly
different generation scheme of collection subclasses in JVM IR, and are
harmless.

(Previous attempt was at 15e978dbd311c2ba78ec32b394c21acde9811ccb.)
2021-08-05 12:36:35 +02:00
Abduqodiri Qurbonzoda d7b10f31b4 Add Regex splitToSequence samples 2021-08-05 10:32:32 +00:00
Alexander Udalov 0a6d010d1c Support new repeatable annotations in kotlin-reflect
- Unwrap Kotlin-repeatable annotations (with implicit container)
- Introduce `KAnnotatedElement.findAnnotations` to find instances of
  repeated annotations

 #KT-12794
2021-07-30 19:53:33 +02:00
Alexander Udalov 0a9498f7e2 Build: suppress deprecated JVM target warning globally
There seems to be no point in configuring the compiler argument per
project. This argument will be deleted soon anyway, when we remove
support for JDK 1.6 & 1.7.

Also remove `disableDeprecatedJvmTargetWarning`. It didn't have any
effect in all modules where it was applied because these modules
reassign `freeCompilerArgs` anyway, with
`-Xsuppress-deprecated-jvm-target-warning` in it.
2021-07-27 13:35:39 +02:00
Alexander Udalov 91c39ed01c Build: remove obsolete compiler arguments
These compiler arguments enable features which are enabled by default in
the current Kotlin anyway.

The only exception is in :compiler:cli which uses an old language
version.
2021-07-27 13:35:38 +02:00
Abduqodiri Qurbonzoda b65c477e68 Regex.splitToSequence, CharSequence.splitToSequence(Regex) #KT-23351 2021-07-20 14:09:24 +00:00
Ilya Gorbunov 3f6e2be687 Duration: do not use scientific format for large values
The largest duration value formatted in ns with maximal decimals
would fit in 40 chars.
2021-07-12 04:39:25 +00:00
Ilya Gorbunov 28a0698463 Regex.matchAt/matchesAt #KT-34021 2021-07-10 21:31:19 +03:00
Alexander Udalov a7e48c3af1 Improve toString of platform types created by typeOf
In the stdlib implementation, render "!" if the type is only
nullability-flexible. Otherwise, render "($lower..$upper)".

Note that full kotlin-reflect has a much more complicated logic (see
`DescriptorRendererImpl.renderFlexibleType`) that renders things like
`(Mutable)List` and so on. It is not a goal of the stdlib implementation
to replicate all of that, since it requires copying a large amount of
code, namely the entirety of `JavaToKotlinClassMap` to map Java class
names to Kotlin.
2021-07-09 14:53:56 +02:00
Alexander Udalov ddfa94e7e9 Support Nothing type in typeOf
The proper support will come in KT-15518, but that would be a breaking
change even for stable Kotlin without kotlin-reflect. Before that issue
is fixed, represent Nothing in types with the Void class, and use a flag
in the no-reflect implementation to remember that it's not actually the
Void class itself.

 #KT-39166 Fixed
2021-07-09 14:40:05 +02:00
Yahor Berdnikau 7789054547 Migrate repo to use JVM toolchains Gradle feature.
^KT-46972 Fixed
2021-07-05 14:11:12 +00:00
Alexander Udalov 012c7c39af Improve KType.toString for primitive type arguments in stdlib implementation 2021-07-01 19:33:55 +02:00
Alexander Udalov 0cb905a4b1 Support mutable collection types in typeOf
flexibleTypes_1_6.kt is fixed for JVM IR in a subsequent commit.

 #KT-35877 Fixed
2021-07-01 19:33:55 +02:00
Alexander Udalov 6e975b3498 Support flexible types internally in typeOf
#KT-45066 Fixed
2021-07-01 19:33:55 +02:00
Abduqodiri Qurbonzoda aabc00f53f Throw IllegalStateException from MapBuilder iterator.remove() #KT-47419 2021-06-24 22:59:15 +00:00
Vyacheslav Gerasimov 06b4fe1613 Build: Fix kotlin-stdlib-jvm-minimal-for-test usages
Name changed after publishing with main artifacts for external usage
2021-06-12 04:33:32 +03:00
Abduqodiri Qurbonzoda 225be54c61 Get rid of platform differences in Regex.find doc 2021-06-08 00:32:27 +00:00
Abduqodiri Qurbonzoda d934c97bf5 Equivalize isLowerCase and isUpperCase behavior in all platforms #KT-46184 2021-05-31 13:42:46 +03:00
Abduqodiri Qurbonzoda bb2a50a4eb Fix Char.isISOControl doc 2021-04-19 19:14:17 +03:00
Abduqodiri Qurbonzoda d1f18c4651 Add @see doc references to java isUpperCase and isLowerCase 2021-04-19 19:14:14 +03:00
Abduqodiri Qurbonzoda 22dcc92951 Fix Char.isTitleCase doc 2021-04-19 19:14:13 +03:00
Abduqodiri Qurbonzoda 36aee8f2b4 Fix String.replace doc 2021-04-19 19:14:10 +03:00
Abduqodiri Qurbonzoda 3a8d1c4b5e Remove redundant @OptIn 2021-04-16 19:01:28 +03:00
Abduqodiri Qurbonzoda f253b1fb15 Incorrect description for JVM toUpperCase method #KT-45884 2021-04-16 19:01:09 +03:00
Mikhail Glukhikh addfa27980 Fix various EXPOSED_FROM_PRIVATE_IN_FILE deprecations 2021-04-08 09:41:25 +03:00
Abduqodiri Qurbonzoda aa543c6631 Migrate stdlib, tests and samples to new case conversion api 2021-04-08 03:22:01 +03:00