Commit Graph

1680 Commits

Author SHA1 Message Date
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
Abduqodiri Qurbonzoda f01420332f Avoid division in string-to-number conversions (KT-26309) 2019-09-15 21:08:23 +03:00
Ilya Gorbunov 7ff01b02a9 Make ExperimentalTime annotation documented 2019-08-22 21:29:18 +03:00
Ilya Gorbunov 2c79b1f89e Minor: fix incorrect reference in kdoc 2019-08-22 21:29:18 +03:00
Ilya Gorbunov fba22606e6 Introduce erroneous operators ClockMark.minus/compareTo(ClockMark)
To provide a better diagnostic message on their misuse.
2019-08-16 15:29:17 +03:00
Ilya Gorbunov ac07cb686b Change status of ExperimentalTime API to a more risky one 2019-08-16 15:29:17 +03:00
Ilya Gorbunov a985402507 Introduce ClockMark.hasPassedNow, hasNotPassedNow functions
Makes it more clear to use them than comparing elapsed with Duration.ZERO.
2019-08-16 15:29:16 +03:00
Ilya Gorbunov 44195d436e Rename: Clock.markNow, ClockMark.elapsedNow
Add "Now" suffix to the names of functions that depend on the current
time moment.
2019-08-16 15:29:16 +03:00
Ilya Gorbunov a493d46a6e Make effectively private properties actually private to avoid accessors 2019-08-16 15:29:16 +03:00
Ilya Gorbunov f889d25287 Introduce TestClock.plusAssign(Duration) and hide implementation details
TestClock.plusAssign(Duration) is for advancing TestClock time.
Hide reading value, do not allow to provide initial reading,
fix clock unit to nanoseconds at construction time.
2019-08-16 15:28:45 +03:00
Ilya Gorbunov 4de9361c37 Introduce Duration.isPositive method 2019-08-16 15:25:57 +03:00
Ilya Gorbunov 65b0a5f903 Unify withIndex docs wording 2019-08-01 19:55:36 +03:00
Jake Wharton 1a6069382e Provide Array.fill in common stdlib
KT-32359
2019-08-01 19:02:38 +03:00
Ilya Gorbunov 695d657ca8 Random.nextLong: use progression properties consistently
Apply inspection suggestion that helps to reduce boxing.
2019-07-31 21:53:16 +03:00
Ilya Gorbunov 945e058586 Document return value of removeAll and retainAll with predicate
#KT-32532 Fixed
2019-07-17 14:27:26 +03:00
keijumt 3f5d64e635 Add sample of hashMapOf 2019-07-12 17:10:15 +03:00
Pavel Semyonov 2577dfa06a docs: added KDoc for Comparator, fixed KDoc for comparison binarySearch() 2019-07-12 16:08:37 +03:00
Abduqodiri Qurbonzoda 96dcafdf35 Document order of array elements initialization (KT-32353) 2019-07-11 21:18:47 +03:00
Ilya Gorbunov 7d14fb756d Make Duration storageUnit inline val to avoid state initialization
Avoid state initialization in JS and Native
2019-07-09 20:39:28 +03:00
Ilya Gorbunov 39bdf34b9f Use common implementation of fastLog2 based on countLeadingZeroBits 2019-07-08 19:09:32 +03:00
Ilya Gorbunov f8724654a1 Bit query and bit rotation functions for Int, Long, Short, Byte
#KT-12749
2019-07-08 19:09:32 +03:00
Svyatoslav Kuzmich 0b19a4a32b [JS IR BE] Initial version of member namer 2019-06-21 17:02:01 +03:00
Ilya Gorbunov d7252548fc Add symmetric number * duration operators 2019-06-18 19:49:50 +03:00
Ilya Gorbunov a5b7c270ae Change Duration.toString(unit, decimals) formatting
- switch to scientific notation when value is too big (greater than 1e14)
- allow at most 12 decimals, larger values are coerced to 12
- use scientific format with exactly two decimals in mantissa in JVM
2019-06-18 19:49:35 +03:00
Ilya Gorbunov 58b04c7974 Add remaining docs for Duration members, runnable samples for toString 2019-06-18 04:02:35 +03:00
Ilya Gorbunov ffd9d8c71d Remove unneeded buildString from Duration.toString 2019-06-18 04:02:35 +03:00