Commit Graph

47693 Commits

Author SHA1 Message Date
Roman Artemev c62e4b4fcf [JS IR BE] Support coroutines
* Move FinallyBlockLowering to common part
* Fix catching of dynamic exception
* Fix bridges for suspend functions
* Disable explicit cast to Unit
* Run lowering per module
* Update some test data
2018-08-08 18:33:39 +03:00
Vyacheslav Gerasimov 37fadb8ee5 as33: Remove incorrect gradle.xml.as33 2018-08-08 16:26:15 +03:00
Mikhail Zarechenskiy d3280252f9 Prohibit inline data classes
`CONFLICTING_JVM_DECLARATIONS` diagnostics are reported because we're
 trying to generate functions from `Any` once for inline class and
 once for data class

 #KT-25760 Fixed
2018-08-08 15:47:26 +03:00
Mikhail Zarechenskiy fa2d159e3f Refactoring: move JVM related diagnostic to ErrorsJvm 2018-08-08 15:47:26 +03:00
Mikhail Zarechenskiy 34cd0e9f6c Do not report warning about useless annotations for JvmStatic properties
#KT-25745 Fixed
2018-08-08 15:47:25 +03:00
Mikhail Zarechenskiy d9e0af4483 Improve message for warning about useless annotations
#KT-25746 Fixed
2018-08-08 15:47:25 +03:00
Alexey Sedunov 1f59ff1bd4 Minor: Fix test data 2018-08-08 15:32:00 +03:00
Alexey Sedunov c234b40670 Misc: Update AS3.3 version to 182.4928781 2018-08-08 14:26:30 +03:00
Nicolay Mitropolsky fcc49f55e3 JavaFrameworkType.findExtension nullability fix 2018-08-08 13:50:54 +03:00
Alexander Udalov 5dadddaecd Fix version-specific bunch files for KotlinTestUtils
After 5da8ce844a
2018-08-08 12:11:58 +02:00
Dmitry Savvinov a8e1a6a2a1 Add contract for 'synchronized'
^KT-25962 Fixed
2018-08-08 12:53:09 +03:00
Dmitry Savvinov a81fc9e9bc Add contract to checkNotNull overload without message
^KT-25303 Fixed
2018-08-08 12:50:38 +03:00
Dmitry Savvinov 952f67dafc Fix bogus smartcast on enum entry members
Previously, enum entries were treated by the data-flow subsystem similar
to other class/singletons. As a consequence, calls like
'Enum.ENTRY.property' had IdentifierInfo of 'property'.

However, specially for enum entries, descriptor of 'property' is one and
the same for all entries. It means that from the data-flow point of
view, 'Enum.ONE.property' and 'Enum.TWO.property' are *one and the same
data-flow values*.

It could obviously lead to some bogus smartcasts, so this commit
introduces separate IdentifierInfo.EnumEntry and uses it to build proper
qualified values.

^KT-20772 Fixed
2018-08-08 12:48:56 +03:00
Nicolay Mitropolsky ce6543b1cb 183: IdeaExtensionPoints.IDEA_COMPATIBLE_BUILD_NUMBER = "183.1" 2018-08-08 12:29:36 +03:00
Dmitry Savvinov 9472ded936 Minor: fix .txt dump
Was missed in commits a71f09022c
and bd9254597d
2018-08-08 12:12:15 +03:00
Dmitry Savvinov 2b8ca60c05 Add SKIP_JAVAC in tests where behaviour has diverged with IDEA resolve
See a71f09022c
2018-08-08 12:12:15 +03:00
Denis Zharkov e3bdde45de Intern canonical classes and parameters names in BinaryClassSignatureParser
Otherwise, a lot of duplicated strings are generated
2018-08-08 15:17:25 +07:00
Denis Zharkov 782f221ab5 Optimize memory-footprint for ClassifierResolutionContext
Use immutable maps for inner classes/type parameters
in nested contexts instead of making copies for each of them
2018-08-08 15:17:25 +07:00
Denis Zharkov 71a9ba4790 Minor. Move helpers for javaslang to a separate package 2018-08-08 15:17:25 +07:00
Denis Zharkov 3a8335d47f Optimize memory footprint for SlicedMapImpl in case it's empty
It might be useful in case of many delegating traces that
remain effectively empty themselves (up to 7M of empty maps in case of compilation of 'idea' module)
2018-08-08 15:17:25 +07:00
Denis Zharkov 8050869e45 Use THashSet for sets that are assumed to be big
Otherwise, a lot of memory is wasted on nodes instances

(cherry picked from commit 4922f87)
2018-08-08 15:17:25 +07:00
Denis Zharkov 2fd9b3ee35 Do not initialize SimpleFunctionDescriptorImpl::userDataMap if it's empty 2018-08-08 15:17:25 +07:00
Mikhail Glukhikh e6850bf007 Add "Call chain -> sequence" to 183 plugin 2018-08-08 11:02:58 +03:00
Mikhail Glukhikh c7e46d4998 Downgrade "Call chain -> sequence" to INFO level 2018-08-08 11:02:56 +03:00
Toshiaki Kameyama b638e91c2b Call chain --> Sequence: minor improvements
Related to KT-15476
2018-08-08 11:02:55 +03:00
Toshiaki Kameyama 7e28cb1fe3 Call chain --> Sequence: take termination into account
Related to KT-15476
2018-08-08 11:02:47 +03:00
Toshiaki Kameyama 108dea5b46 Introduce "Call chain on collection should be converted into 'Sequence'"
So #KT-15476 Fixed
2018-08-08 10:29:10 +03:00
takasy 76a98c8e67 KT-20357 Add sample code for Pair/Triple.toList 2018-08-07 21:27:16 +03:00
Ilya Gorbunov f41b410e1d Do not use projectTest helper to setup kotlinx-metadata-jvm
It sets up test instrumenter which cannot be used when running
these tests under JDK6.

Do not setup working dir, as there tests do not depend on it.
2018-08-07 21:27:16 +03:00
Alexey Sedunov 632dd05116 Misc: Fix compilation after rebase 2018-08-07 18:35:08 +03:00
Alexander Udalov b67d236857 Fix bunch files for KotlinToJVMBytecodeCompiler
After 1582354077
2018-08-07 16:13:16 +02:00
Sergey Rostov 839a6b5e60 JPS: Support new MPP model. 2018-08-07 15:59:43 +03:00
Alexey Sedunov ecf607d4fa Gradle: Implement new MPP model import 2018-08-07 15:59:41 +03:00
Sergey Igushkin caec846330 Improve Android libraries support: allow project dependency on a lib
* Add a platform type androidJvm that is one-way compatible (can
  consume but cannot be consumed) with jvm, register the matching
  strategy

* Write our attributes to Android's output configurations (this uses
  a naming convention that Android inherits from Java, but there's no
  public API at the moment for that)
2018-08-07 15:55:46 +03:00
Sergey Igushkin 3f60798848 Fix the use case of an old-style project depending on an MPP lib
* Setup the attributes for the resolvable and output configurations
2018-08-07 15:55:46 +03:00
Sergey Igushkin 3ff61f59a7 Implement dependsOn relation for Kotlin source sets
* Setup configurations' extendsFrom and inherit sources of source sets.
  This make it unnecessary to restore transitive dependencies of a
  source set at its use sites, since their sources and dependencies are
  already included.

* Use dependsOn during default configuration instead of compilation.source()
2018-08-07 15:55:45 +03:00
Sergey Igushkin 93943a565c Refactor Kotlin tasks provider & fix friend task matching with new MPP
* Parameterize with the target name and use it in the task names
* Get rid of separate task providers for common and js, use the default
  with an appropriate target name
2018-08-07 15:55:45 +03:00
Sergey Igushkin d4f44e63cd Create runtime software component usage only for runnables;
Also make Kotlin2JsCompilation a compilation to runnable files
2018-08-07 15:55:45 +03:00
Sergey Igushkin 209d0cf6a1 Add a few integration tests for the new MPP plugin 2018-08-07 15:55:45 +03:00
Sergey Igushkin 1e95e4d427 Allow resolution for compileOnly and compileClasspath configurations
This is required by the old IDE importer, which needs to resolve these configurations, and there seems to be no easy way to prevent that.
2018-08-07 15:55:44 +03:00
Sergey Igushkin 19fd706d98 Fixes for Android single-target projects
1. Kapt resolves runtime classpath during configuration, and because of
that we are unable to setup configurations that already took part in
dependency resolution. To fix that, run Kapt configuration as a separate
step out of the main loop over the variants

2. Old Android projects (< 3.0.0) don't have `api` and `implementation`
configurations. To stay compatible with those, ignore these
configurations being absent during configurations hierarchy setup.
2018-08-07 15:55:44 +03:00
Sergey Igushkin 7b6764c9ae Add test tasks to targets configured with KotlinTargetConfigurator 2018-08-07 15:55:44 +03:00
Sergey Igushkin cb99f43033 Implement new MPP plugin 2018-08-07 15:55:44 +03:00
Sergey Igushkin dc7d488deb Update existing plugin implementations to use KotlinCompilation
Add default implementations for KotlinTarget and KotlinCompilation
(some of them are used in code added by further commits).

Refactor AbstractKotlinPlugin so that parts of its logic can be easily
applied outside the plugin (needed for MPP plugin later).

The single platform Kotlin plugins having Kotlin compiled along with
Java will now create a KotlinCompilation and a KotlinSourceSet per Java
source set or per Android variant.
The build configuration logic will use KotlinCompilation
objects rather than Java or Android plugin entities.

Subplugins API and implementations are updated to use KotlinCompilation.
2018-08-07 15:55:44 +03:00
Sergey Igushkin 25eb93b136 (partial) Replace the KotlinSourceSet implementation and its factory
(Note: this commit leaves the repository in a non-compilable state as it
leaves some of the old API usages unchanged; they are replaced with new
implementations in further commits where more appropriate)

The new implementation covers the wider interface, and the factory
should now be used not on its own but in a named domain object container
(the API for creating a source set is now provided through the
source sets container rather than the factory, so that source sets are
also properly registered).
2018-08-07 15:55:43 +03:00
Sergey Igushkin 3828c26fa9 Introduce new API
These interfaces are needed for both new MPP design and getting rid of
the Java plugin source sets in favor of Kotlin source sets
2018-08-07 15:55:43 +03:00
Svyatoslav Kuzmich a1c10956cb [JS IR BE] Support super calls for methods of Any 2018-08-07 14:41:50 +03:00
Svyatoslav Kuzmich 439350d41a [JS IR BE] Cast types in bridges 2018-08-07 14:41:50 +03:00
Alexander Udalov 97faff246d Compile kotlinx-metadata-jvm with JVM target 1.6 instead of 1.8
#KT-25920 Fixed
2018-08-07 13:38:47 +02:00
Alexander Udalov 1582354077 Refactor CompileEnvironmentUtil.getKtFiles, move to KotlinCoreEnvironment
Do not call this method the second time in KotlinToJVMBytecodeCompiler
where all KtFile instances are already created; just get only those
files that are in the needed module, which can be determined solely by
the file path.

Also "kotlinize" getKtFiles and rename to createKtFiles
2018-08-07 13:38:30 +02:00