Commit Graph

332 Commits

Author SHA1 Message Date
Ilya Gorbunov 5c2fe13a89 Refer to java.util.Arrays fully-qualified in generated code 2016-11-16 18:47:42 +03:00
Ilya Gorbunov fae5c88f22 Remove java.util references from the common code 2016-11-16 18:47:42 +03:00
Ilya Gorbunov 8feaaf4df0 Allow to annotate generated API with SinceKotlin and annotate new array functions. 2016-11-08 18:08:59 +03:00
Ilya Gorbunov dceec89572 JS: Array.toString is const, Array.contentToString is shallow, Array.contentDeepToString is deep and self-reference aware
#KT-13582
2016-11-08 17:23:45 +03:00
Ilya Gorbunov a868eecb1a Introduce contentEquals/HashCode/ToString for Arrays. Different methods for deep equals/hashCode/toString rather than overloads with a parameter, because most of the time it would be constant, and make these methods inline-only.
Make `contentEquals` infix function.
Add docs.
#KT-13582
2016-11-08 17:23:45 +03:00
Alexander Udalov 3db459c1d8 JS: drop Collections.reverse and java.util.Collections altogether 2016-11-07 12:27:54 +03:00
Alexander Udalov 30a7790dca Minimize references to java.util.Collections in stdlib sources
Only three usages are left in platform-independent code: in reverse, sort and
sortWith for mutable lists
2016-11-07 12:20:14 +03:00
Ilya Gorbunov 47be8e664a Minor: replace var with val. 2016-09-22 22:28:14 +03:00
Ilya Gorbunov 9c4221cda8 Return EMPTY range [0, -1] when MIN_VALUE is specified as exclusive upper bound.
#KT-12762 Fixed
2016-08-26 05:19:51 +03:00
Ilya Gorbunov bb774cea76 Minor: remove anonymous class for Map.asSequence 2016-08-10 21:52:24 +03:00
Ilya Gorbunov fb99919c59 Accept maps out-projected by key where possible. 2016-08-10 21:52:24 +03:00
Ilya Gorbunov fed24c2be6 Docs: preserve empty lines in the generated documentation to separate summary and paragraphs in the body. 2016-08-09 17:43:12 +03:00
Mikhail Glukhikh bf4231d65a Standard library regenerated
(cherry picked from commit 68af26c)
2016-07-27 10:52:01 +03:00
Alexander Udalov 8f33830f29 Suppress UNCHECKED_CAST instead of CAST_NEVER_SUCCEEDS in several places
This is related to KT-6611 being fixed recently. Note that not all cases of
incorrect "cast never succeeds" were fixed
2016-07-13 13:42:42 +03:00
Ilya Gorbunov d646afabb2 Document functions which return set or map preserving the order of elements/entries.
#KT-11632 Fixed
2016-05-08 03:24:03 +03:00
Ilya Gorbunov 249d08a66e Handle special cases of drop, take, takeLast when it is known in advance that the result is a single-item list. #KT-9990 2016-04-29 22:21:19 +03:00
Ilya Gorbunov a665b2183c Optimize operations to return special collection implementations when result is empty or has single element.
#KT-9990
2016-04-29 22:21:19 +03:00
Ilya Gorbunov 2d12ed68c8 Remove runtime specialization in inline last and lastOrNull to prevent double inlining of predicate body. 2016-04-29 22:21:19 +03:00
Ilya Gorbunov 09c1ff1233 Do not use indexed access for lists not supporting RandomAccess
Add RandomAccess specialization.
2016-04-29 22:21:19 +03:00
Ilya Gorbunov f4f82656f7 Use list iterators instead of indexed access in operations on lists taking a lambda.
Related to #KT-9607
2016-04-29 22:21:19 +03:00
Valentin Kipyatkov b551886889 Code cleanup: removed redundant semicolons 2016-04-29 11:26:25 +03:00
Ilya Gorbunov 409094f0f7 Make stdlib functions dependent on reified is checks available in JS.
#KT-11346 Fixed
2016-04-27 18:22:20 +03:00
Ilya Gorbunov f35dc47b4e Optimize snapshot operations to return special collection implementations when result is empty or has single element.
#KT-9990 Fixed
2016-03-31 21:30:59 +03:00
Ilya Gorbunov e5dbb65ff7 JS: Remove declarations of unsupported SortedSet and TreeSet, make toSortedSet() jvm-only.
Fix completion test.

Relates to #KT-7480
2016-03-01 14:01:38 +03:00
Ilya Gorbunov 19fa2f51ea Review and correct exception messages. 2016-02-27 00:52:30 +03:00
Ilya Gorbunov 00e30e417f Cleanup: suppress warnings where appropriate. 2016-02-26 21:54:57 +03:00
Ilya Gorbunov b19c0363fd Clarify parameter order of lambda function parameter of *Indexed functions.
#KT-10953 Fixed
2016-02-26 20:47:26 +03:00
Ilya Gorbunov 0e0455daeb Improve the documentation of binarySearch functions.
#KT-10198 Fixed
2016-02-26 20:31:05 +03:00
Ilya Gorbunov 24edbc36df Create at most one wrapper sequence for adjacent drop/take operations on sequences.
Based on PR #814 by Sargun Vohra
#KT-10821 Fixed
2016-02-14 16:46:46 +03:00
Ilya Gorbunov 1fca1cc607 Use foreach loop instead of directly taking iterator in sum and average.
Use indexed loop for arrays in reduce and reduceIndexed.
#KT-10579 Fixed
2016-02-09 22:51:39 +03:00
Ilya Gorbunov b4ebaad8f5 Drop previously deprecated API. 2016-02-09 02:58:07 +03:00
Michael Bogdanov 4b203de608 INVISIBLE_MEMBER_FROM_INLINE renamed to NON_PUBLIC_CALL_FROM_PUBLIC_INLINE 2016-02-03 10:35:29 +03:00
Ilya Gorbunov f19ef6e3d5 SAM-constructors for Iterable and Sequence interfaces. 2016-02-03 00:13:17 +03:00
Ilya Gorbunov 947fd84f1e Minor: reorder primitive specializations in generated code (according to the order they defined in java). 2016-02-02 22:06:34 +03:00
Ilya Gorbunov 7a50562a4e Minor: reorder families in generated code. 2016-02-02 22:06:34 +03:00
Ilya Gorbunov dccae6c3ff Introduce annotation InlineExposed to indicate internal members effectively public due to usage in inlined functions.
Currently, doesn't affect anything.

Make collectionSizeOrDefault and collectionSizeOrNull internal, but expose them via inlining together with mapCapacity.

Make Regex(Pattern) constructor exposed by inlined Pattern.toRegex
2016-02-01 22:20:27 +03:00
Ilya Gorbunov c7bd70732c Inline-only in generated code 2016-02-01 22:09:07 +03:00
Gabriel Borges d58efff974 Add foldIndexed and reduceIndexed groups of functions
- foldIndexed, foldRightIndexed, reduceIndexed and reduceRightIndexed have been added, in line with filterIndexed etc.;
- Test cases added appropriately for the new functions.
2016-01-31 02:45:02 +03:00
Ilya Gorbunov d46501e11b Make all remaining deprecations to be errors. 2016-01-27 18:34:32 +03:00
Ilya Gorbunov 263e1b4b5d Drop deprecated mapIndexedTo on Maps. 2016-01-27 18:34:31 +03:00
Ilya Gorbunov 8d02467e6d Introduce plusElement and minusElement to disambiguate situations like List<List<T>> + List<T>
#KT-9992 Fixed
2016-01-27 00:00:01 +03:00
Ilya Gorbunov 90a239e74c Provide toMutableList as a replacement for toArrayList. 2016-01-26 11:49:15 +03:00
Ilya Gorbunov 564155734b Introduce associateTo and associateByTo with the destination MutableMap to fill. 2016-01-26 11:49:12 +03:00
Ilya Gorbunov 8224a4e186 Rename toMap and toMapBy to associate and associateBy 2016-01-26 11:49:03 +03:00
Ilya Gorbunov 7703252239 Provide groupBy and groupByTo with keySelector and valueTransform.
Rename parameters of groupBy, add type parameter for MutableMap to groupByTo.
2016-01-25 21:15:56 +03:00
Ilya Gorbunov a78b08d9c7 Use generic coerceIn for nullable primitives, provide specialization for non-nullable ones.
Fix docs for coerceAtMost.
2016-01-24 06:44:13 +03:00
Ilya Gorbunov ef0d998fbc Drop deprecations: *Raw functions. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov 85a02d40c6 Drop hidden declarations provided for binary compatibility 2016-01-22 05:54:38 +03:00
Ilya Gorbunov 264c9a0fc9 Drop deprecated toGenerator and toLinkedList (again). 2016-01-22 05:54:38 +03:00
Ilya Gorbunov 91f4cf0ebc Drop Progression<T> and its deprecated properties: start, end, increment.
Drop deprecated range extensions.
Make progression constructors private.
2016-01-22 05:54:38 +03:00