Commit Graph

1705 Commits

Author SHA1 Message Date
Ilya Gorbunov ea1e16e309 Delegate properties to property references
#KT-8658
2020-04-15 18:37:33 +03:00
Abduqodiri Qurbonzoda 08ff52bee4 Introduce StringBuilder.appendLine in stdlib-common #KT-37839 2020-04-13 14:27:53 +03:00
Ilya Gorbunov 15319eb88e Implement in-place shuffle for arrays
Minor: reorder shuffle/shuffled extensions more consistently

#KT-25651 Fixed
2020-04-10 11:04:51 +03:00
Ilya Gorbunov e58f1c8932 Introduce Sequence.shuffled
#KT-37751
2020-04-10 10:59:40 +03:00
Miguel Serra 61ad32f012 Samples of Map functions "contains" and "isNotEmpty"
Co-authored-by: Ilya Gorbunov <ilya.gorbunov@jetbrains.com>
2020-03-31 04:54:51 +03:00
Ilya Gorbunov d7007044c2 Add a note about the Random(...) generators being not thread-safe 2020-03-24 01:37:03 +03:00
Abduqodiri Qurbonzoda e632d58936 Nullable Array.contentEquals/contentHashCode/contentToString #KT-34161 2020-03-12 18:01:23 +03:00
Alexander Udalov 795d6ab407 Migrate UseExperimental->OptIn in project sources 2020-03-10 12:07:14 +01:00
Abduqodiri Qurbonzoda a32f742893 Inherit ReadWriteProperty from ReadOnlyProperty #KT-27729 2020-03-05 16:53:02 +03:00
Abduqodiri Qurbonzoda fe50bb4b93 KProperty and ReadOnlyProperty type parameter names #KT-16529 2020-02-26 17:34:03 +03:00
Abduqodiri Qurbonzoda afceec71a4 Create an interface with provideDelegate() method #KT-26494 2020-02-20 18:57:52 +03:00
Abduqodiri Qurbonzoda ce8e511b79 Add setOfNotNull function #KT-35851 2020-02-18 02:33:59 +03:00
Abduqodiri Qurbonzoda 5a4ce2aa4c Mark shared global vals to fix K/N worker thread crash 2020-02-18 01:49:24 +03:00
Vyacheslav Gerasimov 06448b6469 Revert "Set local build version to 1.4.255-SNAPSHOT"
This reverts commit a8650ccf
2020-01-30 18:20:27 +03:00
Vyacheslav Gerasimov a8650ccfd2 Set local build version to 1.4.255-SNAPSHOT
#KT-36128
2020-01-29 20:20:33 +03:00
Vsevolod Tolstopyatov a00e98bad9 KT-36118 Introduce AbstractCoroutineContextKey and corresponding extensions required by its implementors
* It enables subtyping relationship for keys and elements, allowing type-safe and concise manipulations on the context when complex hierarchies of elements (e.g. implementors of ContinuationInterceptor) are present
    * It unblocks possibility to implement suspendCancellableCoroutine in stdlib
    * Implementing proper polymorphic get and minusKey in AbstractCoroutineContextElement is impossible because it will introduce source-incompatible change
    * ContinuationInterceptor get and minusKey are adjusted in a completely backwards-compatible way
2020-01-24 16:17:14 +03:00
Ilya Gorbunov 7bb504321c KT-15363 Rename expectedSize to capacity and edit docs 2020-01-24 15:28:35 +03:00
Ilya Gorbunov 14351446d7 KT-15363 Fix failing test: missing capacity parameter check in JS
Partially restore JVM map capacity implementation
2020-01-24 15:28:18 +03:00
Fleshgrinder bf9d3d87a6 KT-15363 Collection Builders
Added container builders for lists, sets, and maps.
The new experimental type inference only works for the simple builders
with a single generic type. The versions with nullability and the maps
still require explicit specification of the types. Obviously explicit
specification is required for all users who are not using the new
experimental inference. Improving the type inference is something that
should be done separately and many things – including these builders –
will benefit from it, however, this is not a blocker for these builders
in my opinion.
2020-01-24 15:28:17 +03:00
Ilya Gorbunov 8733d5f9ed ArrayDeque: avoid triggering JDK 1.6 bug in tests
Use System.arraycopy instead of Arrays.copyOfRange to
avoid triggering JDK-7174363 bug in copyOfRange.

Fix package of ArrayDequeTest
2020-01-24 01:39:48 +03:00
Abduqodiri Qurbonzoda e459542e6f Add removeFirst(OrNull) and removeLast(OrNull) methods to MutableList 2020-01-22 23:22:28 +03:00
Abduqodiri Qurbonzoda b6849efd47 Common ArrayDeque 2020-01-22 23:22:21 +03:00
Alexander Udalov e34a207725 Implement KTypeProjection.toString
The implementation is checked by tests on typeOf.

 #KT-30071 Fixed
2020-01-21 19:34:01 +01:00
Ilya Gorbunov 1336da8453 Rename Clock to TimeSource, ClockMark to TimeMark
Step 2: rename classes and interfaces.
Provide deprecated typealiases to smooth migration.
2020-01-21 03:28:35 +03:00
Ilya Gorbunov a11a25087a Rename Clock to TimeSource, ClockMark to TimeMark
Step 1: rename files
2020-01-21 03:28:35 +03:00
Nikolay Krasko ca49672a7a Advance version to 1.4 2020-01-17 10:33:50 +03:00
Ilya Gorbunov ac7e54f651 Improve terminological consistency in KClass docs 2020-01-16 15:36:13 +03:00
Ilya Gorbunov 3a78ab6d40 Do not use qualifiedName property in KClass.cast function, because it's not supported in K/JS
Introduce an internal property that returns either qualified or simple name, and use it instead.
2020-01-16 15:36:07 +03:00
Ilya Gorbunov ea95aabbb0 Optimistically add isInstance and qualifiedName to common KClass
Because they are used in common cast and safeCast functions
2020-01-16 15:33:15 +03:00
Ilya Gorbunov 47f78c424d Commonize KType API
Move KTypeProjection, KVariance, KClassifier, KTypeParameter to stdlib-common.

#KT-29748 Fixed
#KT-32855 Fixed
2020-01-16 15:33:15 +03:00
Ilya Gorbunov d87fb0ece0 Introduce expect KFunction in common 2020-01-16 15:33:14 +03:00
Alexander Udalov 514bf3eec0 Deprecate Experimental/UseExperimental in favor of RequiresOptIn/OptIn 2020-01-14 21:04:44 +01:00
Alexander Udalov f954a6c812 Support custom message in RequiresOptIn
#KT-34648 Fixed
2020-01-14 21:04:43 +01:00
Alexander Udalov 8f94a2bb75 Rename UseExperimental->OptIn, Experimental->RequiresOptIn in stdlib kdocs 2020-01-14 21:04:42 +01:00
Miguel Serra 4fa5e2d85c KT-20357: Add samples for linkedSetOf 2019-12-26 20:07:39 +03:00
Alexander Udalov cdbabf224f Introduce RequiresOptIn and OptIn annotations
RequiresOptIn should be used now instead of Experimental, OptIn instead
of UseExperimental. See https://github.com/Kotlin/KEEP/pull/201.

This change adds the new declarations only to the stdlib, and supports
them in the compiler. Because of the way compiler loads annotations, we
need to bootstrap it first before deprecating the old annotations and
updating tests.

 #KT-34647 Fixed
2019-12-17 18:17:48 +01:00
Abduqodiri Qurbonzoda b868e6f8da Rename Appendable methods parameters 2019-12-17 19:04:00 +03:00
Abduqodiri Qurbonzoda 19e001afad Commonize Float.rangeTo(Float) #KT-35299 2019-12-09 20:24:06 +03:00
Abduqodiri Qurbonzoda 20d02dd0ee Commonize StringBuilder 2019-12-04 22:15:33 +03:00
Abduqodiri Qurbonzoda 1431e27a7b Move StringBuilder to its own file 2019-12-04 22:15:33 +03:00
Abduqodiri Qurbonzoda 0c033297a8 Move Appendable to its own file 2019-12-04 22:15:33 +03:00
Abduqodiri Qurbonzoda 50752d47fe Move CharacterCodingException to its own file 2019-12-04 22:15:33 +03:00
Abduqodiri Qurbonzoda 2155f1680f Fix small mistake in CharSequence.lastIndexOf documentation 2019-12-04 22:15:33 +03:00
Ilya Gorbunov edfd933348 Improve Result docs to emphasize that any Throwable exception is caught
#KT-33447 Fixed
2019-12-03 21:08:31 +03:00
Ilya Gorbunov 555d503ff9 Improve indexOf sample to showcase return value handling
Remove sample reference from indexOf(Char) overload: both overloads are on
the same page, and showing the sample for indexOf(String) under indexOf(Char)
is redundant and misleading.
2019-11-29 21:34:49 +03:00
Burak Eregar e30d87ee01 KT-20357: Add samples for indexOf 2019-11-29 21:34:49 +03:00
Kerooker c16b89d770 Fix XorWowRandom documentation
This commit changes XorWowRandom.kt documentation to include a HTTPS link instead of a HTTP link, for security purposes.

This commit also changes the same documentation to reflect the real cycles from the `xorwow` algorithm:

    Simple and very fast (125 million/sec), the elements in its cycle of 2^192 − 2^32 easily pass all the tests in Diehard.

 Marsaglia, G. 2003. Xorshift RNGs. J. Statis. Soft. 8, 14, p. 5

 At last, this commit explicits which part of the code is the implementation of the mentioned algorithm.

 Closes KT-35175
2019-11-29 19:31:55 +03:00
Alexander Udalov 7f4b568021 Mark new KClass.cast/safeCast extensions as low-priority
To avoid overload resolution ambiguity error in sources where everything
from both kotlin.reflect and kotlin.reflect.full is imported with a
star-import
2019-11-05 19:34:06 +01:00
Alexander Udalov 896512f7cd Support KClass.isInstance/cast/safeCast in stdlib-only reflection implementation
#KT-14720 Fixed
2019-10-29 15:52:00 +01:00
Abduqodiri Qurbonzoda d66f07a84e CollectionsKt.windowed throws IllegalArgumentException 2019-09-20 00:50:54 +03:00