Commit Graph

2771 Commits

Author SHA1 Message Date
Vyacheslav Gerasimov 06448b6469 Revert "Set local build version to 1.4.255-SNAPSHOT"
This reverts commit a8650ccf
2020-01-30 18:20:27 +03:00
Vyacheslav Gerasimov a8650ccfd2 Set local build version to 1.4.255-SNAPSHOT
#KT-36128
2020-01-29 20:20:33 +03:00
Alexander Udalov 953b461c53 Add new compiler errors and flags when JVM compiles against JVM IR
From now on, the old JVM backend will report an error by default when
compiling against class files produced by the JVM IR backend. This is
needed because we're not yet sure that the ABI generated by JVM IR is
fully correct and do not want to land in a 2-dimensional compatibility
situation where we'll need to consider twice more scenarios when
introducing any breaking change in the language. This is generally OK
since the JVM IR backend is still going to be experimental in 1.4.

However, for purposes of users which _do_ need to compile something with
the old backend against JVM IR, we provide two new compiler flags:
* -Xallow-jvm-ir-dependencies -- allows to suppress the error when
  compiling with the old backend against JVM IR.
* -Xir-binary-with-stable-api -- allows to mark the generated binaries
  as stable, when compiling anything with JVM IR, so that dependent
  modules will compile even with the old backend automatically. In this
  case, the author usually does not care for the generated ABI, or s/he
  ensures that it's consistent with the one expected by the old compiler
  with some external tools.

Internally, this is implemented by storing two new flags in
kotlin.Metadata: one tells if the class file was compiled with the JVM
IR, and another tells if the class file is stable (in case it's compiled
with JVM IR). Implementation is similar to the diagnostic reported by
the pre-release dependency checker.
2020-01-29 17:20:41 +01:00
Ilya Gorbunov 7792613f88 Finishing touch: drop experimental coroutines sourcesets from stdlib
#KT-36083
2020-01-29 09:12:42 +03:00
Ilya Gorbunov b5a0daabc3 Extract kotlin.coroutines.experimental API into compat artifact
Add public API dump for kotlin-coroutines-experimental-compat

#KT-36083
2020-01-29 09:12:39 +03:00
Vyacheslav Gerasimov 1f3755248c Build: Make task inputs relative to improve caching 2020-01-24 19:40:00 +03:00
Vyacheslav Gerasimov 3f10329347 Build: Fix publication of stdlib-js to avoid publishing all artifacts
Because of https://github.com/gradle/gradle/issues/4612 install and
uploadArchives tasks published artifacts which were not meant
to be published
2020-01-24 19:39:59 +03:00
Vyacheslav Gerasimov 7dcdc506d8 Build: Fix outputs for :kotlin-stdlib-js:compileJs
jsOutputMetaFile was missing
2020-01-24 19:39:59 +03:00
Vyacheslav Gerasimov 770344770d Build: Make :kotlin-stdlib-js:compileJs task cacheable 2020-01-24 19:39:58 +03:00
Vsevolod Tolstopyatov a00e98bad9 KT-36118 Introduce AbstractCoroutineContextKey and corresponding extensions required by its implementors
* It enables subtyping relationship for keys and elements, allowing type-safe and concise manipulations on the context when complex hierarchies of elements (e.g. implementors of ContinuationInterceptor) are present
    * It unblocks possibility to implement suspendCancellableCoroutine in stdlib
    * Implementing proper polymorphic get and minusKey in AbstractCoroutineContextElement is impossible because it will introduce source-incompatible change
    * ContinuationInterceptor get and minusKey are adjusted in a completely backwards-compatible way
2020-01-24 16:17:14 +03:00
Ilya Gorbunov 7bb504321c KT-15363 Rename expectedSize to capacity and edit docs 2020-01-24 15:28:35 +03:00
Ilya Gorbunov 14351446d7 KT-15363 Fix failing test: missing capacity parameter check in JS
Partially restore JVM map capacity implementation
2020-01-24 15:28:18 +03:00
Ilya Gorbunov 4aa7d45a5a KT-15363 Collection builders: improve tests and samples 2020-01-24 15:28:17 +03:00
Fleshgrinder bf9d3d87a6 KT-15363 Collection Builders
Added container builders for lists, sets, and maps.
The new experimental type inference only works for the simple builders
with a single generic type. The versions with nullability and the maps
still require explicit specification of the types. Obviously explicit
specification is required for all users who are not using the new
experimental inference. Improving the type inference is something that
should be done separately and many things – including these builders –
will benefit from it, however, this is not a blocker for these builders
in my opinion.
2020-01-24 15:28:17 +03:00
Abduqodiri Qurbonzoda e89893b6fd Optimize ArrayDeque tests run time 2020-01-24 05:52:18 +03:00
Ilya Gorbunov 8733d5f9ed ArrayDeque: avoid triggering JDK 1.6 bug in tests
Use System.arraycopy instead of Arrays.copyOfRange to
avoid triggering JDK-7174363 bug in copyOfRange.

Fix package of ArrayDequeTest
2020-01-24 01:39:48 +03:00
Ilya Gorbunov 76759d3a5f Drop compatibility stub for experimental unsigned API from 1.3.0 2020-01-23 19:38:02 +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 e459542e6f Add removeFirst(OrNull) and removeLast(OrNull) methods to MutableList 2020-01-22 23:22:28 +03:00
Abduqodiri Qurbonzoda b6849efd47 Common ArrayDeque 2020-01-22 23:22:21 +03:00
Alexander Udalov 3ca0f8a569 Fix incorrect message for new nullability assertion exception in 1.4
#KT-36026 Fixed
2020-01-22 14:41:20 +01:00
Alexander Udalov e34a207725 Implement KTypeProjection.toString
The implementation is checked by tests on typeOf.

 #KT-30071 Fixed
2020-01-21 19:34:01 +01:00
Tsvetan 5f0e3018db KT-27856 Add contracts to Timing.kt lambdas (#1987) 2020-01-21 15:42:21 +03:00
Ilya Gorbunov 1336da8453 Rename Clock to TimeSource, ClockMark to TimeMark
Step 2: rename classes and interfaces.
Provide deprecated typealiases to smooth migration.
2020-01-21 03:28:35 +03:00
Ilya Gorbunov a11a25087a Rename Clock to TimeSource, ClockMark to TimeMark
Step 1: rename files
2020-01-21 03:28:35 +03:00
Ilya Gorbunov 51c5fcc8b8 Drop experimental stdlib sourceset
Haven't used it after pre 1.3
2020-01-20 18:35:21 +03:00
Nikolay Krasko ca49672a7a Advance version to 1.4 2020-01-17 10:33:50 +03:00
Abduqodiri Qurbonzoda 3cad1bbb51 Create method Collection.randomOrNull() #KT-35347 2020-01-16 22:25:53 +03:00
Ilya Gorbunov e9cea3358d Do not use libraryJarWithoutIr as runtime output artifact
This avoids having both libraryJarWithoutIr and default jar artifact,
which points to the same path as libraryJarWithIr, in the dependent
projects' classpath.
Use libraryJarWithIr instead.
For local builds where libraryJarWithIr doesn't contain any IR, this
should have the same effect.
2020-01-16 16:01:56 +03:00
Ilya Gorbunov 3fabf9b6ad Add dependency in disabled jar task on custom libraryJarWithIr
jar task is disabled, but its artifact is still used through
the runtime configuration in the other projects.
In fact, dependent projects get both
libs/kotlin-stdlib-js-1.3-SNAPSHOT.jar
lib/dist/kotlin-stdlib-js-1.3-SNAPSHOT.jar
in their classpath.

However the former artifact is built with libraryJarWithIr task after
jar task is skipped. This leads to a situation during the parallel build
that a dependent project tries to read that artifact
when libraryJarWithIr task writes it.

This commit adds a dependency edge between the disabled jar and custom
libraryJarWithIr tasks, so that the artifact is ready by
the moment jar task has finished.
2020-01-16 16:01:55 +03:00
Ilya Gorbunov 09b1960dd0 Regenerate stdlib sources: update copyright year 2020-01-16 15:57:06 +03:00
Ilya Gorbunov ac7e54f651 Improve terminological consistency in KClass docs 2020-01-16 15:36:13 +03:00
Ilya Gorbunov 3a78ab6d40 Do not use qualifiedName property in KClass.cast function, because it's not supported in K/JS
Introduce an internal property that returns either qualified or simple name, and use it instead.
2020-01-16 15:36:07 +03:00
Ilya Gorbunov 8af43155c3 Remove reflect API not actually supported in K/JS
#KT-32186
2020-01-16 15:33:16 +03:00
Ilya Gorbunov 562bac3f6f Copy JVM reflect declarations to JS 2020-01-16 15:33:16 +03:00
Ilya Gorbunov ea95aabbb0 Optimistically add isInstance and qualifiedName to common KClass
Because they are used in common cast and safeCast functions
2020-01-16 15:33:15 +03:00
Ilya Gorbunov 47f78c424d Commonize KType API
Move KTypeProjection, KVariance, KClassifier, KTypeParameter to stdlib-common.

#KT-29748 Fixed
#KT-32855 Fixed
2020-01-16 15:33:15 +03:00
Ilya Gorbunov d87fb0ece0 Introduce expect KFunction in common 2020-01-16 15:33:14 +03:00
Ilya Gorbunov 427e34fe5a Do not serialize JVM kotlin.reflect to builtins
Serialize common types from kotlin-reflect as builtins instead.
2020-01-16 15:32:29 +03:00
Alexander Udalov c3d5a88e52 Add -Xno-use-ir to compiler modules where JVM IR currently fails
This option has no effect on the production code. But in a custom
scenario of a local bootstrap, where the compiler is replaced with the
one where JVM IR backend is enabled by default, this option allows to
switch back to the old backend.

All of these arguments (except the one for compiling experimental
coroutines) are supposed to go away as soon as we fix related problems
in the JVM IR backend.
2020-01-16 12:21:47 +01:00
Alexander Udalov 514bf3eec0 Deprecate Experimental/UseExperimental in favor of RequiresOptIn/OptIn 2020-01-14 21:04:44 +01:00
Alexander Udalov f954a6c812 Support custom message in RequiresOptIn
#KT-34648 Fixed
2020-01-14 21:04:43 +01:00
Alexander Udalov 8f94a2bb75 Rename UseExperimental->OptIn, Experimental->RequiresOptIn in stdlib kdocs 2020-01-14 21:04:42 +01:00
Vyacheslav Gerasimov fa1c6c9697 Build: Add missing com.github.node-gradle.node plugin versions 2020-01-13 19:40:08 +03:00
Ilya Gorbunov 9e4d7df86e Revert "[JS IR] stdlib: switch between artifacts rather than artifact content"
The default Jar task is disabled, but its archive file is still
configured as an artifact to be published in the 'archives' configuration.
Thus, neither 'install', nor 'publish' tasks could not find this file
when `libraryJarWithIr` isn't triggered and does not build it.
Removing that artifact from the 'archives' configuration artifacts makes
'install' task publish nothing.

Therefore it's better to revert the change so that 'libraryJarWithIr' task
always runs and produces an artifact with the default name.

This reverts commit a9fec211
2020-01-11 02:27:05 +03:00
Ilya Gorbunov c084dfa1d7 [JS IR] stdlib: use 'base' plugin instead of kotlin("jvm")
'base' plugin is enough in this case, given that a couple of tasks is registered and configured manually.

Fix kotlin-reflect dependency to be a project dependency.
2020-01-09 22:57:50 +03:00
Ilya Gorbunov a9fec21178 [JS IR] stdlib: switch between artifacts rather than artifact content
The switch `includeStdlibJsIr` now affects which artifact is published:
the one with IR or the one without. Previously it affected
whether or not IR was bundled into the artifact "with IR".
2020-01-09 22:57:45 +03:00
Ilya Gorbunov 372a4009bd Fix coreLibsInstall composite task again
See the commit f0e67f8397 for details
2020-01-09 22:54:57 +03:00
Alexander Udalov e0b9ffa780 Regenerate builtins sources 2020-01-03 13:09:43 +01:00