Commit Graph

2525 Commits

Author SHA1 Message Date
Anton Bannykh b7ffdb9fde JS IR: support kotlin.test 2019-04-05 12:30:21 +03:00
Ilya Gorbunov dde2b30601 Clarify wording in Random.nextUInt docs: missed extra 'not' 2019-04-03 16:31:03 +03:00
Ilya Gorbunov 04bbf23936 Add explicit imports of kotlin.ranges more specific functions
The extensions 'contains' and 'reversed' from kotlin.ranges can be more
specific for IntRange, LongRange, etc than the same functions from
kotlin.collections, yet they lose in overload resolution to the latter
ones when invoked from kotlin.collections package
because of same package package extensions are preferred (KT-30633).
2019-04-02 21:28:33 +03:00
Ilya Gorbunov d77f76bdb0 Clarify wording in Random.nextInt/Long/UInt/ULong docs
#KT-30704 Fixed
2019-04-02 21:28:32 +03:00
Toshiaki Kameyama 4a3e4f099d KT-30451 Redundant call of selector in maxBy&minBy
Refactor maxBy & minBy: do not call selector when collection has single item
2019-03-31 05:11:05 +03:00
Ilya Gorbunov 91c7233ed8 Make Throwable.addSuppressed extension work without kotlin-stdlib-jdk7*
*given that it runs on JDK7 and higher. The addSuppressed member
is called with reflection when it's available.
kotlin-stdlib-jdk7 extension still overrides that and calls
addSuppressed member statically as before.

#KT-30560 Fixed
2019-03-28 22:42:20 +03:00
Ilya Gorbunov e6e00483d4 Put kotlin-stdlib-jdk7/8 output in test classpath when running jdk6 tests
These tests ensure how compiled jdk6 binaries work in newer JDK7/8 environment,
and most likely the stdlib-jdk7/8 artifacts will be in that environment.

This reverts test classpath change (accidentally?) made in the commit 99f2cc3d.
2019-03-28 22:42:20 +03:00
Sergey Rostov 7b89b0abbb JPS Build: exclude :core:builtins, use prebuilt bootstrap version 2019-03-28 10:06:35 +03:00
Sergey Rostov fb3f28974e Build: support local.properties for JPS build. Apply JPS related tweaks only inside IDEA import. 2019-03-28 10:06:16 +03:00
Abduqodiri Qurbonzoda 636ed025da Replace "binary representation of" with "bits of" 2019-03-22 21:18:27 +03:00
Alexander Udalov ed86757817 Rework how built-in types are loaded in compiler for JVM
In TopDownAnalyzerFacadeForJVM, we now always use the "load built-ins
from module dependencies" behavior that was previously only enabled with
the dedicated CLI argument -Xload-builtins-from-dependencies. However,
sometimes we compile code without kotlin-stdlib in the classpath, and we
don't want everything to crash because some standard type like
kotlin.Unit hasn't been found.

To mitigate this, we add another module at the end of the dependencies
list, namely a "fallback built-ins" module. This module loads all
built-in declarations from the compiler's class loader, as was done by
default previously. This prevents the compiler from crashing if any
built-in declaration is not found, but compiling the code against
built-ins found in the compiler is still discouraged, so we report an
error if anything is resolved to a declaration from this module, via a
new checker MissingBuiltInDeclarationChecker.

Also introduce a new CLI argument -Xsuppress-missing-builtins-error
specifically to suppress this error and to allow compiling code against
compiler's own built-ins.

 #KT-19227 Fixed
 #KT-28198 Fixed
2019-03-22 14:59:03 +01:00
Ilya Gorbunov 8021f9c4af Clarify toSortedMap and sortedMapOf docs (KT-30100)
Remove the note about iteration order so that toSortedMap is not misused
for sorting map entires with the comparator inconsistent with key equality.
2019-03-20 22:08:03 +03:00
Ilya Gorbunov b74fe7c1c3 Clarify floor and ceil docs (KT-30418) 2019-03-19 03:12:12 +03:00
Ilya Gorbunov b0a234ec74 Minor: collection docs formatting 2019-03-19 03:12:09 +03:00
Ilya Gorbunov 25b3f62767 Clarify yield/yieldAll function suspending the caller behavior 2019-03-18 18:01:39 +03:00
Abduqodiri Qurbonzoda 35c6f09886 Implement coerce extension functions for unsigned types 2019-03-15 17:46:48 +03:00
Abduqodiri Qurbonzoda a369496aca Throw IOOB on invalid index in JS StringBuilder.get to adhere contract 2019-03-15 17:40:31 +03:00
Abduqodiri Qurbonzoda 814d6cf39c Document Array and String get() function behavior (KT-30141) 2019-03-15 17:40:19 +03:00
Ilya Gorbunov 7a038f1330 Refactor sanitizeStackTrace function to spare allocations
Use Arrays.copyOfRange instead of List.subList.toArray.
2019-03-15 06:26:59 +03:00
Ilya Gorbunov edc766af56 Document exception thrown for negative n in take/takeLast/drop/dropLast
#KT-29151
2019-03-13 17:58:19 +03:00
Ilya Gorbunov 6bc7c06038 Add samples for is(|Not|NullOr)Empty and is(|Not|NullOr)Blank functions 2019-03-13 17:58:05 +03:00
Ilya Gorbunov ed878be1f7 Docs: reword summaries for a couple of experimental annotations 2019-03-13 17:53:37 +03:00
Ilya Gorbunov ffe8b4419c Docs: use consistent kotlinlang.org url in references 2019-03-13 17:53:37 +03:00
Abduqodiri Qurbonzoda ba61695a45 Check for index-out-of-bound in elementAt function (KT-30051) 2019-03-12 21:39:09 +03:00
Abduqodiri Qurbonzoda 82002e5e73 Remove implementations of conversions from UByte/UShort to Float/Double 2019-03-12 02:56:44 +03:00
Ilya Gorbunov 42120b93b8 KT-29151 Provide specialized string samples for all drop/take functions
These include:
- take, takeLast, takeWhile, takeLastWhile,
- drop, dropLast, dropWhile, dropLastWhile
2019-03-11 19:30:59 +03:00
Burak Eregar 991e739693 KT-29151 Fix the problematic pages - CharSequence.take() & String.take() 2019-03-11 19:30:58 +03:00
Ilya Gorbunov 6ae5e91930 Move UArraysKt into kotlin.collections.unsigned package
Provide UArraysKt class in kotlin.collections for binary compatibility
instead of removed multipart facade class. It contains only non-inline
functions of the latter.
2019-03-08 23:35:40 +03:00
Ilya Gorbunov db4c4132f6 Make JvmPackageName a common internal annotation 2019-03-08 23:35:37 +03:00
Abduqodiri Qurbonzoda be6c2d8c7d Implement min max minOf maxOf functions for unsigned types (KT-30035) 2019-03-08 23:34:36 +03:00
Abduqodiri Qurbonzoda bf83f0e070 Implement contains extension functions for URanges (KT-26378) 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda cb587893c0 Implement sorting extension functions for UArrays 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda c42dbb34ca Implement drop, take & filter extension functions for UArrays 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda abb275775e Implement map, flatMap, zip & groupBy extension functions for UArrays 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda 503264b996 Implement folding extension functions for UArrays 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda 7695b5e575 Implement sum extension function for UArrays (KT-28779) 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda 690e35f11a Implement reduce, forEach, min & max extension functions for UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda fc85781bfc Implement asList, slice & sliceArray extension functions for UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda 114736c09b Implement reversing extension functions for UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda 92cd84682c Implement first, last & single extension functions for UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda 299fac8e2d Implement conversion from typed array and collection to UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda bbaabb90e4 Implement any, all, none, count & sumBy functions for UArrays 2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda 512d986006 Implement index-requesting extension functions for UArrays
Contains implementations of `indexOf`, `lastIndexOf`, `indexOfFirst`,
`indexOfLast`, `lastIndex` and `indices` extension functions.
2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda 876dff6d22 Implement fill extension function for UArrays (KT-28339) 2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda 6b92190726 Implement component(N) functions for destructuring UArrays 2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda 550c74bb6b Implement binarySearch method for UArrays (KT-27262) 2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda 6cd9858147 Specialize plus operator for UArrays (KT-28397) 2019-03-08 23:34:32 +03:00
Roman Elizarov 4f532a7c05 Invoke probeCoroutineResumed on each unroll of the frame from heap
Fixes KT-29997
2019-03-07 17:04:11 +03:00
Alexander Udalov d1e33534db Implement typeOf intrinsic on JVM
#KT-29915 Fixed
2019-03-05 18:16:31 +01:00
Abduqodiri Qurbonzoda 3af6b36401 Write docs for unsigned types conversions 2019-03-05 17:34:15 +03:00