Commit Graph

62 Commits

Author SHA1 Message Date
Alexander Udalov 0d1380c232 Fix warnings in generator modules 2021-08-10 17:57:50 +02:00
Abduqodiri Qurbonzoda 71c5c8b20a Fix Range.isEmpty doc 2021-04-19 19:14:25 +03:00
Abduqodiri Qurbonzoda 98d31a1813 Expand KDoc of inc() and dec() operators #KT-43701 2021-04-10 03:23:04 +03:00
Ilya Gorbunov b64b96eee6 Deprecate Char-to-Number conversions in stdlib (JVM and JS)
- Int.toChar was left non-deprecated because the replacement is not intrinsic yet.
- Number.toChar was left non-deprecated because otherwise the deprecation propagates to the override, Int.toChar.

KT-23451
2021-04-07 18:30:20 +03:00
Abduqodiri Qurbonzoda 968099fbec Advance deprecation level of FP to lesser than Int types to ERROR #KT-30360 2021-04-07 00:23:20 +03:00
Ilya Gorbunov 94240f7b21 Stabilize unsigned types KT-45653
Deprecate specialized unsigned iterators for removal.

Fix compiler tests:
- drop unsignedLiteralsOn1_2 because apiVersion 1.2 is no longer supported
- drop experimental unsigned literals diagnostic test
2021-03-31 19:05:04 +03:00
Anastasiya Shadrina 94c4d1c23e Specify when the range is empty in KDoc 2021-03-19 20:40:06 +07:00
Ilya Gorbunov 7e2c365b79 Generate docs for floorDiv and mod and improve docs for div and rem
Refactor operator documentation generation for primitives and unsigned
types so that it is easier to specialize it.

Manually sync docs of numeric types in js-ir stdlib.

 KT-26234
2021-03-05 07:32:16 +03:00
Ilya Gorbunov 50d4979531 Floor division and remainder for numeric types KT-26234
- floorDiv/mod for unsigned types
- floorDiv/mod for signed types
- mod for floating point types

- mod return type: same as divisor for integer types

- Update JS API dump
- Avoid triggering division overflow in tests due to K/N
- Workaround failing test in JS-legacy
2021-03-05 07:32:16 +03:00
Ilmir Usmanov d67e4f0c48 Rename inline class -> @JvmInline value class in stdlib and compiler 2021-02-25 16:06:51 +01:00
Ilya Gorbunov 87e130e77a Remove obsolete diagnostics suppression
The diagnostic NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS is now
obsolete because internal constructors of inline classes became allowed.
2021-02-03 18:23:53 +03:00
Abduqodiri Qurbonzoda 36e6247125 Add more details about bit shift operations #KT-41112 2020-09-16 04:05:12 +03:00
Alexander Udalov 26eb51a9f9 Minor, fix generateBuiltins test 2020-08-21 17:51:23 +02:00
Alexander Udalov d115a1ff9c Minor, fix some warnings such as "unused main argument" in generators 2020-05-27 23:29:21 +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
Ilya Gorbunov 8f37ace9ee Finally drop deprecated mod functions from numeric types
#KT-26654
2020-01-23 19:28:22 +03:00
Abduqodiri Qurbonzoda 1203df7405 Deprecate floating point to integral types lesser than Int #KT-30360 2020-01-22 23:27:35 +03:00
Abduqodiri Qurbonzoda 432828a2db Clarify floating-point to integral conversion rounding behaviour 2019-08-15 00:57:27 +03:00
Abduqodiri Qurbonzoda 96dcafdf35 Document order of array elements initialization (KT-32353) 2019-07-11 21:18:47 +03:00
Dmitry Gridin 37c856290f Fix minor compile warnings 2019-04-25 19:47:39 +07:00
nikita.movshin 65244b4bea Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update only 2 lines copyright.
2019-04-23 20:09:22 +03:00
Abduqodiri Qurbonzoda 636ed025da Replace "binary representation of" with "bits of" 2019-03-22 21:18:27 +03:00
Abduqodiri Qurbonzoda 960797b926 Replace mistaken "bit sign" with "sign bit" 2019-03-22 21:18:27 +03:00
Abduqodiri Qurbonzoda f36a8db8eb More detailed Primitive.toChar conversion documentation 2019-03-22 21:18:27 +03:00
Abduqodiri Qurbonzoda 814d6cf39c Document Array and String get() function behavior (KT-30141) 2019-03-15 17:40:19 +03:00
Abduqodiri Qurbonzoda a0e2ca669b Write docs for primitive types conversions 2019-03-13 13:14:37 +03:00
Abduqodiri Qurbonzoda 82002e5e73 Remove implementations of conversions from UByte/UShort to Float/Double 2019-03-12 02:56:44 +03:00
Abduqodiri Qurbonzoda fc85781bfc Implement asList, slice & sliceArray extension functions for UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda 3af6b36401 Write docs for unsigned types conversions 2019-03-05 17:34:15 +03:00
Abduqodiri Qurbonzoda ae47130c8e Implement UArray.contains(element) workaround for JS 2019-02-25 21:58:53 +03:00
Abduqodiri Qurbonzoda c1b523ddef Fix UArray.containsAll(Collection<Any?>) 2019-02-25 21:58:53 +03:00
Abduqodiri Qurbonzoda 1b6b44c805 Implement conversion between floating point numbers and unsigned integers
KT-27108
2019-02-25 21:58:03 +03:00
Ilya Gorbunov 1d7ee22bdc Simplify comparisons for small unsigned types that can fit in Int
UByte and UShort can be extended to Int exactly and then compared as ints
2018-09-18 22:25:36 +03:00
Ilya Gorbunov af29dced98 Make overridden compareTo in unsigned types inline only 2018-09-18 22:25:36 +03:00
Ilya Gorbunov 9e0708e85a Make most of unsigned operations inline only 2018-09-18 22:25:36 +03:00
Mikhail Zarechenskiy 7595cb23ab Raise deprecation level for mod operators to ERROR in stdlib
#KT-25217 In Progress
2018-09-09 23:55:36 +03:00
Ilya Gorbunov 82d35cfa26 Change signed to unsigned widening conversions to sign-extending
e.g. `Byte.toUInt()` now returns `UInt.MAX_VALUE` for Byte value of -1 instead of 0xFFu.

#KT-26594 Fixed
2018-09-06 21:25:42 +03:00
Ilya Gorbunov 6360cc3cb5 Unsigned arrays: expose storage field as internal PublishedApi
To be able to write basic extensions that access storage array.
2018-08-30 14:58:24 +03:00
Ilya Gorbunov 76ff4c9b2f Remove custom hashCode and equals from unsigned types
The generated ones are ok now (on JVM)
2018-08-30 14:58:16 +03:00
Ilya Gorbunov a0b0994651 Make unsigned array constructor-like functions inline-only 2018-08-30 14:56:53 +03:00
Ilya Gorbunov f9479d12f9 Add missing unsigned array constructors (from size)
#KT-25961 Fixed
2018-08-30 14:56:51 +03:00
Ilya Gorbunov 7dc6c3d7ce Prohibit MIN_VALUE step for unsigned progressions 2018-08-30 14:56:04 +03:00
Ilya Gorbunov 4e574cb017 Improve exception message for invalid steps and document step requirements
#KT-17176
2018-08-30 14:56:02 +03:00
Pap Lőrinc bdf623f711 Prohibit step size of min value, as it doesn't have a negated counterpart
#KT-17176
2018-08-30 14:56:00 +03:00
Ilya Gorbunov 1792a77a47 Generate hashCode and equals for unsigned types 2018-08-30 14:52:51 +03:00
Ilya Gorbunov 0c50014e7a Introduce SIZE_BYTES and SIZE_BITS constants for all integral types
#KT-8247 Fixed
2018-08-30 14:51:10 +03:00
Ilya Gorbunov b5fabf3f72 Make unsigned types experimental (with warning if not opted-in) 2018-07-04 19:12:11 +03:00
Ilya Gorbunov 3349976279 Make MIN_VALUE and MAX_VALUE of unsigned types actual constants 2018-07-03 03:52:18 +03:00
Ilya Gorbunov 7a208c3e01 Simplify unsigned array constructor functions 2018-07-03 03:52:18 +03:00