Commit Graph

48320 Commits

Author SHA1 Message Date
Ilya Gorbunov 2ce0bca34e Make bound check helpers top-level so they are compiled as static on JVM
Improve empty range exception text in nextInt/nextLong(range)
2018-08-30 14:50:52 +03:00
Ilya Gorbunov 35c927214d More efficient double generation in JS 2018-08-30 14:50:50 +03:00
Ilya Gorbunov b96803248f Write random contract tests and fix implementations to pass them 2018-08-30 14:50:48 +03:00
Ilya Gorbunov ed1f869354 Add xorwow random implementation test and fix implementation 2018-08-30 14:50:46 +03:00
Ilya Gorbunov 042a8ff6a2 Provide ThreadLocalRandom wrapper only on JDK8 as it is buggy in JDK7 2018-08-30 14:50:44 +03:00
Ilya Gorbunov 870f5e3448 Remove lazy initialization of default platform random 2018-08-30 14:50:42 +03:00
Ilya Gorbunov fa33b1b5a9 Random docs and API refinement
KT-17261
2018-08-30 14:50:40 +03:00
Ilya Gorbunov 7e4528e217 Common shuffle/shuffled with the specified random source
KT-17261, KT-9010
2018-08-30 14:50:38 +03:00
Ilya Gorbunov cc031e3a40 Provide common Random API
#KT-17261
2018-08-30 14:50:36 +03:00
Ilmir Usmanov 9df411481c Do not coerce function literals to suspend.
The design is to use `suspend fun` instead of coercion, just as suspend
lambdas.
However, this syntax is not supported in the parser. But this is not a
problem, since the coercion lead to internal compiler error.
As a workaround everybody uses suspend lambdas.
 #KT-24860: Fixed
2018-08-30 14:50:33 +03:00
Ilya Gorbunov d57e1bb68b Migrate stepping and evaluation tests to the new coroutine API 2018-08-30 14:50:31 +03:00
Ilya Gorbunov bbee18b84d Introduce StringBuilder.clear() extension
#KT-18910 Fixed
2018-08-30 14:50:29 +03:00
Ilya Gorbunov c667340261 Allow pre-release compiler reading pre-release binaries in tests
Pre-release compiler should be able to read pre-release binaries in tests
even if a stable language version is used, otherwise no stdlib API can be read.
2018-08-30 14:50:27 +03:00
Alexander Udalov f423403167 Make kotlin.Metadata public
Prohibit explicit usage of `@Metadata` to prevent possible
AnnotationFormatError at runtime

 #KT-23602 Fixed
2018-08-30 14:50:25 +03:00
Ilya Gorbunov 8102e512d3 For bootstrapping on 1.3-M1: compile parts that can be used in .gradle.kts scripts with 1.2 language version 2018-08-30 14:50:23 +03:00
Ilya Gorbunov b160561795 Include new coroutines and unsigned classes into stdlib
Fix clashing module name in common coroutines sourceset
2018-08-30 14:50:21 +03:00
Ilya Gorbunov 4c6c0aa279 Update public API test due to ProperVisibilityForCompanionObjectInstanceField 2018-08-30 14:50:19 +03:00
Ilya Gorbunov 76e581fe4f Temporarily turn off ReleaseCoroutines feature 2018-08-30 14:50:16 +03:00
Ilya Gorbunov d4a195c757 Advance maven project versions to 1.3-SNAPSHOT 2018-08-30 14:49:30 +03:00
Ilya Gorbunov 0f5f90cf52 Advance project version to 1.3-SNAPSHOT
Set LATEST_STABLE language version and current version of stdlib to 1.3, set IS_PRE_RELEASE
Remove "EXPERIMENTAL" from 1.3 version description in tests and gradle options
2018-08-30 14:49:27 +03:00
Natalia Selezneva 5b29528386 Scripting Console files shouldn't have scratch panel
KT-25818 Fixed
2018-08-30 12:35:54 +03:00
Natalia Selezneva 472e3a7178 Simpify message in commit dialog for java to kt renames
^KT-26073
2018-08-30 12:35:54 +03:00
Natalia Selezneva 2fe4f95d33 Gradle project configurator: fix inserting of non-kotlin library version in gradle.kts files 2018-08-30 12:35:53 +03:00
Natalia Selezneva 4671fa0136 Mute some multiplatform test for Gradle 4.9 2018-08-30 12:35:52 +03:00
Natalia Selezneva 81f4bd3846 Add tests for configuring kotlin with gradle 4.9 2018-08-30 12:35:52 +03:00
Sergey Rostov 81b519286f ScriptDependenciesLoader: Fix freeze on notifyRootsChanged
In 4f3f4dd, launch(EDT(project)) was replaced with TransactionGuard.submitTransaction to fix write in write-unsafe context.
Unfortunately submitTransaction will call action immediately if we are already on EDT. This causes IDE freeze.
By replacing submitTransaction with submitTransactionLater we are postponing work to the end of events queue (as it was before 4f3f4dd).
Also in isUnitTestMode we need to call action immediately as it was before 4f3f4dd.

#KT-25958 Fixed
2018-08-30 10:59:32 +03:00
Yan Zhulanow ddb034715d Gradle importer: Join compiler plugin options as before the new MPP refactoring (KT-26424)
Android Studio has at least two kinds of importers: a generic one (that is run when the "Refresh Gradle model" tool button is pressed) and a fast one (is run on the build variant switch). Fast importer doesn't invoke our import handlers (AndroidExtensionsGradleImportHandler) that modify the compiler options stored in Kotlin facet in some way.

Until the recent MPP importer refactoring both old and new options were saved in the Kotlin facet; now only the new options persist. This is certainly better, though it breaks the existing behavior (as the options added by import handlers become lost).

The alternative approach is to re-design import handlers in a way they won't require the whole module/source set node (so we can invoke them every time), though it requires a way more changes.
2018-08-29 19:16:16 +05:00
kenji tomita e5841441c9 Fix #KT-26353 'Make variable immutable' is a bad name for a quickfix that changes 'var' to 'val' 2018-08-29 16:27:46 +03:00
Alexander Udalov e85dcfc3e3 Fix compatibility with Android plugin broken in 896cf61 2018-08-29 15:24:58 +02:00
Toshiaki Kameyama 3ea0222d43 "Add annotation target" quickfix: add SOURCE retention when target is EXPRESSION #KT-26306 Fixed 2018-08-29 16:18:04 +03:00
Denis Vnukov ddf92ef187 Creating IrLineNumberTestGenerated, adding line numbers for few common expressions
This PR enables LineNumberTestGenerated test on IR backend. The testing of
hardcoded sequence of line numbers is replaced with mere checks for set-like
checks for expected line numbers.
2018-08-29 12:52:20 +02:00
Ilya Gorbunov 36936d252c Support multiple expectedBy dependencies when building -Xcommon-sources list
`addCommonSourceSetToPlatformSourceSet` may be called multiple times during
a platform project configuration.
2018-08-28 19:13:36 +03:00
Zalim Bashorov b2d9254bfd Fix testdata 2018-08-28 16:30:15 +03:00
Vyacheslav Gerasimov bf4ded3991 Add org.jetbrains.markdown to test runtime of idea project 2018-08-28 15:20:03 +03:00
Pavel Punegov 1ea9c2d4ba Replace min with coerceAtMost in test 2018-08-28 13:48:44 +03:00
Pavel Punegov 1c5ebacf0f Disable 1.3 version coroutines in Native and incorrect genericProperty test 2018-08-28 13:48:44 +03:00
Pavel Punegov 9eb78fc490 Disable tests that fail in NATIVE 2018-08-28 13:48:44 +03:00
Pavel Punegov 39a65a099a Disable IEEE754 tests with improper comparisons behaviour in Native 2018-08-28 13:48:44 +03:00
Pavel Punegov 1a7d366733 Disable JVM tests in native 2018-08-28 13:48:44 +03:00
Pavel Punegov 0c8f34a934 Disable JVM assertions in native 2018-08-28 13:48:44 +03:00
Pavel Punegov e2efeb70f7 Zip stdlib tests 2018-08-28 13:48:43 +03:00
Pavel Punegov 2ff6047845 Update ignore tag for Native backend 2018-08-28 13:48:43 +03:00
Alexander Udalov 4219aff548 Refactor DescriptorRenderer's renderAccessors option
In some tests with txt (probably all except loadJava), property
accessors are not rendered at all, so a third option value (NONE) will
be useful to determine whether we need to render annotations on property
accessors as get/set/sparam-targeted annotations on the property
2018-08-27 23:37:06 +02:00
Alexander Udalov 896cf61443 Move JVM-specific annotation FQ names and utils to frontend.java 2018-08-27 23:37:06 +02:00
Alexander Udalov ab441dcd96 Drop PropertyDescriptorImpl.setType that takes KotlinType
Only use the other setType that takes an instance of
ReceiverParameterDescriptor. This will make sure that call sites can
use correct receiver annotations
2018-08-27 23:37:05 +02:00
Alexander Udalov 34c033bcaf Take ReceiverParameterDescriptor in FunctionDescriptorImpl.initialize
Instead of just KotlinType. This will allow to pass annotations on the
receiver at call sites
2018-08-27 23:37:04 +02:00
Alexander Udalov 6fb39785ff Postpone force resolve of annotations on properties
Otherwise (after subsequent commits) we may end up calling
BindingContext.HAS_BACKING_FIELD too early and getting incorrect value,
which will influence which annotations the property and the field will
have, and since they're cached as soon as they're computed, they will
remain incorrect until the end of the program. Now we're calling force
resolve after bodies of property accessors are resolved, which is the
point where the backing field presence has been already determined for
certain.

This all still looks very fragile because we might try to get property's
annotations anywhere else before the accessors' bodies are analyzed, but
I have no idea at the moment how to improve this without refactoring the
whole subsystem
2018-08-27 23:36:25 +02:00
Alexander Udalov 8d44824875 Minor, use Annotations.EMPTY instead of empty AnnotationsImpl 2018-08-27 23:36:24 +02:00
Alexander Udalov 872f6e2cea Minor, make AnnotatedImpl not abstract 2018-08-27 23:36:24 +02:00
Alexander Udalov 50270293e3 Minor, improve assertion message in test 2018-08-27 23:36:24 +02:00