Commit Graph

266 Commits

Author SHA1 Message Date
Mikhail Bogdanov 477cca3c99 Add JvmDefaultWithoutCompatibility annotation 2020-06-19 11:57:35 +02:00
Abduqodiri Qurbonzoda 16b62b8e65 Introduce minWithOrNull and maxWithOrNull extension functions #KT-38854 2020-06-19 04:53:53 +03:00
Abduqodiri Qurbonzoda 194791a168 Introduce minByOrNull and maxByOrNull extension functions #KT-38854 2020-06-19 04:53:51 +03:00
Abduqodiri Qurbonzoda 846a7823ad Introduce minOrNull and maxOrNull extension functions #KT-39064 2020-06-19 04:53:49 +03:00
Ilya Gorbunov ec5a04a6c7 Update public jvm API dump after introduction of javaType
See 9e37b62f62
2020-06-18 12:44:23 +03:00
Valeriy.Vyrva c023a02884 Create SortedMap with Comparator and items
KT-34142
2020-06-04 02:04:22 +03:00
Ilya Gorbunov bdd53ee9cd Introduce new overloads of flatMap and flatMapTo
- Sequence<T>.flatMap((T) -> Iterable<R>)
- Iterable<T>.flatMap((T) -> Sequence<R>)
- Array<T>.flatMap((T) -> Sequence<R>)
- Map.flatMap((Entry) -> Sequence<R>)

KT-34506
2020-06-02 19:01:43 +03:00
Ilya Gorbunov 23414496c4 Annotation to enable overload resolution by lambda return type
#KT-38480
2020-05-29 09:36:32 +03:00
Roman Elizarov 46b426ef77 KT-31741: stdlib: DeepRecursiveFunction (#3398)
Introduces experimental coroutines-based framework to execute deeply recursive functions that utilities the heap and thus avoid StackOverflowError.
2020-05-27 10:06:00 +03:00
Abduqodiri Qurbonzoda f3145454f2 Decommonize collection builder implementations 2020-05-23 03:40:44 +03:00
Dmitry Petrov fcf8a91a38 Update kotlin-stdlib-runtime-merged.txt 2020-05-20 07:19:29 +03:00
Alexander Udalov 82551e91a4 Add KClass.isFun modifier to reflection
#KT-38881 Fixed
2020-05-14 14:05:51 +02:00
Alexander Udalov 0ce16b9d8c Support non-reified type parameters in typeOf in JVM and JVM_IR
#KT-30279 Fixed
2020-05-13 10:04:28 +02:00
Abduqodiri Qurbonzoda ec166db506 Implement collection builders 2020-04-30 02:28:41 +03:00
Alexander Udalov 9fa8e009c6 Support equals/hashCode for fun interfaces in JVM and JVM_IR
#KT-33455 Fixed
2020-04-29 12:15:50 +02:00
Abduqodiri Qurbonzoda d6472aa700 Reverse range and sortDescending range #KT-36955 2020-04-20 22:06:28 +03:00
Dmitry Petrov b06780988d KNVE: add doc comment and mark as PublishedApi 2020-04-20 20:07:51 +03:00
Ilya Gorbunov 893021f22b Introduce runningFold and runningReduce operations
runningFold is a synonym for scan,
runningReduce replaces scanReduce.

#KT-38060
2020-04-15 23:28:07 +03:00
Ilya Gorbunov 408b441a71 Rename extension toStringWithTrace to stackTraceToString
#KT-37603
2020-04-13 09:32:42 +03:00
Ilya Gorbunov 552bcdb31b Introduce Throwable.toStringWithTrace
#KT-37603
2020-04-13 09:32:41 +03:00
Ilya Gorbunov 7b7263c5bf Implement common Throwable.addSuppressed/suppressed extensions
Instead of `suppressed` Array we provide `suppressedExceptions` List

#KT-23737
2020-04-13 09:32:41 +03:00
Abduqodiri Qurbonzoda f2c05bf82c IR: Move annotation @JsExport to common source set in stdlib #KT-35966 2020-04-11 04:03:57 +03:00
Abduqodiri Qurbonzoda 4a7b1b210a Add onEachIndexed similar to forEachIndexed #KT-37161 2020-04-11 03:47:47 +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
Alexander Udalov 9f758b4f25 Support toString for AdaptedFunctionReference subclasses
Also make it serializable like other lambdas, suspend lambdas and normal
callable references.
2020-04-08 19:16:38 +02:00
Alexander Udalov 0681231e99 Introduce AdaptedFunctionReference runtime class
It's used as a superclass for anonymous classes for adapted function
references. Its main feature is that it _doesn't_ inherit from KFunction
(as opposed to FunctionReference), as per the decision to postpone
reflection support for adapted function references in KT-36024.

 #KT-36024 Fixed
2020-04-08 19:15:38 +02:00
Alexander Udalov 3269a7e693 Change behavior of equals/hashCode on adapted function references
Function references are now equal if they refer to the same function,
and if the parameter/return type adaptation, which happens when a
reference is used where some function type is expected, is exactly the
same. This includes the number of expected positional parameters (which
can be affected by defaults/varargs), whether the coercion of vararg
parameter to Array type happened, and whether the coercion of return
type to Unit happened.

 #KT-37543 Fixed
2020-04-01 14:18:49 +02:00
Ilya Gorbunov f3fc1197ae Add SIZE_BITS and SIZE_BYTES constants to Double and Float
#KT-29182
2020-04-01 08:06:57 +03:00
Ilya Gorbunov 1c93911279 Make Double and Float known values constant
#KT-13887
2020-04-01 08:06:57 +03:00
Abduqodiri Qurbonzoda b1fac4e721 Implement reduceIndexedOrNull and reduceRightIndexedOrNull #KT-36866 2020-03-12 18:08:55 +03:00
Abduqodiri Qurbonzoda b60633d79a Add associateWith to Array<T> #KT-30372 2020-03-12 18:06:54 +03:00
Abduqodiri Qurbonzoda e632d58936 Nullable Array.contentEquals/contentHashCode/contentToString #KT-34161 2020-03-12 18:01:23 +03:00
Alexander Udalov 98aecbef6b Optimize runtime representation for callable reference subclasses
Instead of generating overrides for getOwner/getName/getSignature in
each anonymous class representing a callable reference, pass them to the
superclass' constructor and store as fields. This occupies some small
memory but helps to reduce the size of the generated class files, and
will be helpful for adding further runtime information to callable
references, such as information about implicit conversions this
reference has been subject to.

Represent owner as java.lang.Class + boolean instead of
KDeclarationContainer, so that the unnecessary wrapping Class->KClass
wouldn't happen before it's needed, and also to make sure all callable
references remain serializable.

Note that the argument type where the "is declaration container a class"
is passed is int instead of boolean. The plan is to pass the
aforementioned implicit conversion information as bits of this same
integer value.

 #KT-27362 Fixed
2020-03-06 16:55:07 +01:00
Alexander Udalov 8d7c8672ac Generate reference to existing class for builtin function references
Instead of non-existing `kotlin.KotlinPackage`, which led to
NoClassDefFoundError as soon as reflection tried to call getOwner on a
builtin callable reference, use a reference to a new physical class
`kotlin.jvm.internal.Intrinsics$Kotlin`. This will allow to support
KT-17151.

Note that for API version less than 1.4, this will still lead to
NoClassDefFoundError, but this is not worse than the current situation
where it happens anyway.
2020-03-06 16:55:05 +01:00
Abduqodiri Qurbonzoda a32f742893 Inherit ReadWriteProperty from ReadOnlyProperty #KT-27729 2020-03-05 16:53:02 +03:00
Abduqodiri Qurbonzoda 1f721796b8 Add vararg overloads for maxOf/minOf functions #KT-33906 2020-02-26 04:17:19 +03:00
Abduqodiri Qurbonzoda 6670a2fff8 Update public api dump 2020-02-20 21:14:52 +03:00
Abduqodiri Qurbonzoda ce8e511b79 Add setOfNotNull function #KT-35851 2020-02-18 02:33:59 +03:00
Abduqodiri Qurbonzoda ed7b8e9b85 Scan functions for Sequences and Iterable #KT-7657 2020-02-13 04:01:47 +03:00
Ilya Gorbunov b5a0daabc3 Extract kotlin.coroutines.experimental API into compat artifact
Add public API dump for kotlin-coroutines-experimental-compat

#KT-36083
2020-01-29 09:12:39 +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 76759d3a5f Drop compatibility stub for experimental unsigned API from 1.3.0 2020-01-23 19:38:02 +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
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 15a441141f Update public API dump after KT-11567 codegen changes came into effect
The only questionable case left is a private companion
in a public interface, which is generated as a public synthetic field
2020-01-20 21:29:50 +03:00
Abduqodiri Qurbonzoda 3cad1bbb51 Create method Collection.randomOrNull() #KT-35347 2020-01-16 22:25:53 +03:00
Alexander Udalov f954a6c812 Support custom message in RequiresOptIn
#KT-34648 Fixed
2020-01-14 21:04:43 +01:00
Ilya Gorbunov 6d092b5f71 Add more reduceOrNull tests
- Test for unsigned arrays
- Update binary api dump with the new functions
2019-12-26 19:27:47 +03:00