Commit Graph

2303 Commits

Author SHA1 Message Date
Ilya Gorbunov 6bfb5c59a3 Make ResultTest common
Use custom exception type to avoid platform differences in toString implementation.
2018-09-14 15:32:25 +03:00
Ilya Gorbunov b1c2daf1fe Stdlib: fix name shadowing and names of overridden method parameters 2018-09-14 15:32:25 +03:00
Ilya Gorbunov bf4be12239 Stdlib: review and suppress warnings 2018-09-14 15:32:25 +03:00
Ilya Gorbunov 6786b9ece2 Stdlib tests: cleanup warnings 2018-09-14 15:32:08 +03:00
Ilya Gorbunov 7e0a658de7 Change nextInt/Long with range parameters from members to extensions
We'd like to fix the implementation of these methods, so we could intrinsify them later
or perform other optimizations that are not possible when these methods are open.
2018-09-14 15:15:52 +03:00
Ilya Gorbunov 928fe19801 Rename Random.next* parameters: remaining renames
- Correct docs after parameter renaming
- Rename parameters in Random inheritors
- Rename local variables

#KT-26596
2018-09-14 15:15:52 +03:00
kenji tomita ffb83bbdf0 Rename Random.next* parameters from "origin, bound" to "from, until"
Rename Random test methods

#KT-26596
2018-09-14 15:15:52 +03:00
Ilya Gorbunov 9353cfb526 contentDeepToString: use list instead of set for infinite recursion tracking
#KT-26388
2018-09-13 06:10:10 +03:00
Ilya Gorbunov 2d356b89b5 Specialize contentDeepEquals/HashCode/ToString for arrays of unsigned types
#KT-26388
2018-09-13 06:10:10 +03:00
Ilmir Usmanov 273889d1a9 Add our own primitive boxing methods to stdlib
These methods are very thin wrappers around primitive wrapper classes
constructors.
They are used by coroutines code which returns primitives and this way
HotSpot is able to throw the allocations away completely.
 #KT-26591 Fixed
2018-09-12 15:36:11 +03:00
Alexander Udalov f63cf9d506 Use JvmName on kotlin.Metadata parameters to improve public API
#KT-26359 Fixed
2018-09-12 14:37:11 +03:00
victor.petukhov 50d9dbbfc1 Fix inheritance in stdlib contracts code (KT-26409) 2018-09-12 12:34:15 +03:00
Anton Bannykh ead9b31e03 JS: support [suspend] fun main([args: Array<String>]) (KT-26628, KT-26572 fixed) 2018-09-12 09:49:25 +03:00
Ilya Gorbunov 41a8678b95 Remove mutability and nullability annotations from stdlib in kotlinc/lib
#KT-21784
2018-09-12 00:58:55 +03:00
Ilya Gorbunov 000e7493a1 Introduce common KCallable and K(Mutable)Property(ø,0,1,2) interfaces
#KT-25935
2018-09-11 19:21:15 +03:00
Ilya Gorbunov 7b46d22877 Introduce common KClass interface #KT-25935 2018-09-11 18:45:55 +03:00
Ilya Gorbunov 62ffacab09 Raise deprecation level for jsClass functions
Suppress error in tests

#KT-21703
2018-09-11 18:15:04 +03:00
Ilya Gorbunov 35f42c7d35 Raise deprecation level for kotlin.Synchronized and Volatile, remove replacements
They are js-only but not supposed to be used in Kotlin/JS code, so their
usages should be just removed.

#KT-21703
2018-09-11 18:15:03 +03:00
Ilya Gorbunov 010b36be1f Raise deprecation level for kotlin.js.Math functions
#KT-21703
2018-09-11 18:15:03 +03:00
Ilya Gorbunov fbd2322ffa Add replacement information for deprecated JQuery members
#KT-21703
2018-09-11 18:15:03 +03:00
Ilya Gorbunov c3f654a71c Stdlib/JS: drop deprecated CharSequence.size
#KT-21703
2018-09-11 18:15:03 +03:00
Ilya Gorbunov 1a8b258d86 Raise deprecation level for map delegation accessor according to #KT-18789
#KT-21703
2018-09-11 18:15:03 +03:00
victor.petukhov 8f209fa667 Add documentation to contracts stdlib code 2018-09-11 18:03:38 +03:00
victor.petukhov 63698380e1 Add contract samples for stdlib 2018-09-11 18:03:09 +03:00
Ilya Gorbunov 1eda3805ec Introduce overloads to check for T? element contained in iterable range in a constant time
#KT-18483
2018-09-11 17:06:42 +03:00
Roman Artemev cc995bf1d5 Remove workaround for COROUTINE_SUSPENDED property 2018-09-11 14:29:47 +03:00
Mikhail Zarechenskiy 106ecadd62 Allow using kotlin.Result as a return type in stdlib 2018-09-11 10:39:27 +03:00
Ilya Gorbunov 48add96e79 Deprecate mixed Int/FP contains operator for ranges
#KT-22423
2018-09-11 05:40:15 +03:00
Ilya Gorbunov 68c5c0f639 Introduce ConcurrentModificationException typealias in stdlib/jvm
This is required to provide the corresponding expect exception in stdlib/common.
Raise deprecation level for constructors declared in common but unsupported in JVM.

#KT-26598
2018-09-11 04:59:56 +03:00
Alexander Udalov 1d5d6b5b72 Support strict metadata version semantics
Preface: Kotlin 1.3 will be able to read metadata of .class files
produced by Kotlin 1.4 (see KT-25972). Also, to simplify implementation
and to improve diagnostic messages, we're going to advance JVM metadata
version to 1.4.0 in Kotlin 1.4, and would like to keep it in sync with
the compiler version thereafter. This presents a problem: in an unlikely
event that before releasing 1.4, we find out that the metadata-reading
implementation in 1.3 was incorrect, we'd like to be able to fix the bug
in that implementation and _forbid_ 1.3 from reading metadata of 1.4.
But prior to this commit the only way to do this was to advance the
metadata version, in this case to 1.5, and that breaks the
metadata/compiler version equivalence we'd like to keep.

The solution is to add another boolean flag to the class file, called
"strict metadata version semantics", which signifies that if this class
file has metadata version 1.X, then it can only be read by the compilers
of versions 1.X and greater. This flag effectively disables the smooth
migration scenario proposed in KT-25972 (as does increasing metadata
version by 2), and will be used only in hopeless situations as in the
case described above.
2018-09-10 14:12:18 +03:00
Ilya Gorbunov 48fd8a63ee Introduce Any?.hashCode() extension #KT-25039 2018-09-10 06:41:49 +03:00
Mikhail Zarechenskiy 3431123cab Fixes for tests about mod
#KT-25217
2018-09-10 06:31:55 +03:00
Roman Elizarov b12e0aab2f Remove contract from Result.xxxCatching functions
Fixes KT-26523
2018-09-09 11:36:47 +03:00
Roman Elizarov 2406bf0536 Restore SuccessOrFailure.kt to bootstrap (to be removed later) 2018-09-09 11:34:49 +03:00
Roman Elizarov e2713501ce Rename SuccessOrFailure to Result and hide Failure from ABI
* The members of Result are isSuccess, isFailure, exceptionOrNull, getOrNull
* The rest of API is implemented via inline-only extensions
* There are two internal functions to hide detailed mechanics of an internal
  Result.Failure class: createFailure and throwOnFailure
* Result.toString is explicit: either Success(v) or Failure(x)

See KT-26538
2018-09-09 11:34:31 +03:00
Zalim Bashorov 24dc8b33cd [JS IR BE] fix compilation of stdlib by IR BE after move coroutine related sources in stdlib 2018-09-07 19:22:35 +03:00
Ilya Gorbunov 700e6fc5e3 Extract carrier value from continuation result
Otherwise incorrect type gets into continuation: SuccessOrFailure<T> instead of T.
2018-09-07 01:28:32 +03:00
Ilya Gorbunov 2821c357a1 Switch coroutine tests to release coroutines 2018-09-07 01:03:53 +03:00
Ilya Gorbunov df9f77909b Make experimental COROUTINE_SUSPENDED refer to corresponding release one
Partially reverts commit 20c7a97.
Apply workaround for KT-25003 once again for the new COROUTINE_SUSPENDED
2018-09-07 01:03:53 +03:00
Ilya Gorbunov e22ca022d4 Switch sourcesets of experimental and release coroutines
- Move experimental coroutines out of the main source root.
- Include experimental coroutines into the coroutines source set.
- Include release coroutines into the main source set.
2018-09-07 01:03:53 +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 4344005fb5 Deprecate synchronized function in common stdlib #KT-26595 2018-09-06 21:15:31 +03:00
Mikhail Zarechenskiy bc7f13b838 Temporarily allow equals & hashCode for SoF to compile bootstrap
equals & hashCode should be removed completely soon anyway
2018-09-06 10:39:34 +03:00
Ilmir Usmanov 53a1526412 Add version to DebugMetadata
#KT-26580 Fixed
2018-09-05 22:51:55 +03:00
Roman Elizarov 0401b4e0bb Coroutine context shall perform structural equality comparison on keys
Fixes KT-26398
2018-09-05 01:29:19 +03:00
Ilmir Usmanov cfc10ec061 Simplify debug metadata: instead of array of same values, store single element
This change is valid, since we want StackTraceElement to be as close
as possible to StackTraceElement of non-coroutine code.
Particularly, if the line is inside inlined function, its className,
functionName and sourceFile are inline site's ones, but lineNumber
is large, which is the way of representing inline function's line
numbers. The rest is handled by the plugin, which allows the user to choose
between inline function body and inline site.
2018-09-04 22:20:08 +03:00
Svyatoslav Kuzmich 197a5969e2 [JS IR BE] Fix stdlib files list for 1.3 2018-09-04 20:19:04 +03:00
Svyatoslav Kuzmich c3b9a5108e [JS IR BE] Add more stdlib files to runtime
Keep old sources list for coroutine tests
2018-09-04 20:19:04 +03:00
Svyatoslav Kuzmich a01b6de2d8 [JS IR BE] Add missing exceptions 2018-09-04 20:19:03 +03:00
Ilya Gorbunov 64996618b3 Suppress signed literals used as unsigned values in stdlib tests 2018-09-04 17:39:51 +03:00