Commit Graph

56505 Commits

Author SHA1 Message Date
Denis Zharkov 38bcedc451 [Tests] Add tests for types refinement in IDE 2019-07-30 12:41:36 +03:00
Dmitriy Novozhilov d000341178 [Misc] Add missing type to lambda in ILTConstructor 2019-07-30 12:41:36 +03:00
Dmitry Savvinov fe78e153f7 [Misc] Introduce helper-method 'IntersectionTypeConstructor.createType()' 2019-07-30 12:41:36 +03:00
Dmitry Savvinov 5c13e02e9c [Misc] Clean-up and deduplicate code in 'findClassInModule.kt' 2019-07-30 12:41:36 +03:00
Dmitriy Novozhilov a0f339ffc7 [Misc] Enable @Experimental project-wide 2019-07-30 12:41:36 +03:00
Dmitriy Novozhilov f026a98403 [Misc] Make NewKotlinTypeChecker non-static 2019-07-30 12:41:36 +03:00
Dmitriy Novozhilov 4f1e85b468 [Misc] Add caching of hashCode in KotlinType
KT-32852
2019-07-30 12:41:35 +03:00
Denis Zharkov 8d1b063d62 [Misc] Add test on typealiased SAM 2019-07-30 12:41:35 +03:00
Denis Zharkov c1144f35f1 [Misc] Move TypeAliasExpander to core 2019-07-30 12:41:35 +03:00
Denis Zharkov 7ba3f7e599 [Misc] Make ArgumentTypeResolver::isSubtypeOfForArgumentType not static
Later, it will use type-refinement component that'll be injected there
2019-07-30 12:41:35 +03:00
Denis Zharkov 529763b9bd [Misc] Get rid of public Companion methods in SmartCastManager
It's necessary for type-refinement component to be injected
2019-07-30 12:41:35 +03:00
Denis Zharkov e7d6a9508e [Misc] Reformat CallType.kt 2019-07-30 12:41:35 +03:00
Denis Zharkov edb9623556 [Misc] Reformat DescriptorEquivalenceForOverrides.kt 2019-07-30 12:41:35 +03:00
Andrey Uskov 4e486e7738 Fix NewMultiplatformKaptProjectImportingTest (KT-32974)
Fix test case when importing module per source set is not supported
in Android Studio
#KT-32974 Fixed
2019-07-30 11:56:07 +03:00
Andrey Uskov c17a5bc8f2 Disable KaptImportingTest.testModulePerSourceSet in AS (KT-32683)
#KT-32683 Fixed
2019-07-30 11:55:17 +03:00
Andrey Uskov 02ee950836 Add transitive dependencies on common MPP modules
Transitive dependencies on modules available via
'dependsOn' dependencies are added to java modules
depending on MPP projects
#KT-33025 Fixed
2019-07-30 11:38:51 +03:00
Steven Schäfer 3ce731cf7c Avoid eager deserialization of array classes in ArrayConstructorLowering 2019-07-30 10:35:00 +02:00
Ilmir Usmanov 2910d8e9b2 Also check predecessors of PUSH Unit in unit tail-call optimization 2019-07-29 20:34:53 +03:00
Ilmir Usmanov e60674f5e1 Fix test data 2019-07-29 20:34:51 +03:00
Ilmir Usmanov cc06798e2c Implement unit suspend functions tail-call optimisation
Unlike previously, this optimisation works on every callee return type.
Tail-calls inside unit functions can be either
INVOKE...
ARETURN
or
INVOKE
POP
GETSTATIC kotlin/Unit.INSTANCE
ARETURN
The first pattern is already covered. The second one is a bit tricky,
since we cannot just assume than the function is tail-call, we also need
to check whether the callee returned COROUTINE_SUSPENDED marker.
Thus, resulting bytecode of function's 'epilogue' look like
DUP
INVOKESTATIC getCOROUTINE_SUSPENDED
IF_ACMPNE LN
ARETURN
LN:
POP

 #KT-28938 Fixed
2019-07-29 20:34:48 +03:00
Alexey Tsvetkov a16e03681b Substitute kotlin-reflect in compileOnly configurations too
This fixes running IDEA with JPS build.
Gradle only uses compileClasspath configurations
for compilation. Hence the substitution introduced in 5c99243c10
affected only compile tasks (without affecting existing POMs).

However, Intellij import also looks into compileOnly configurations
in order to determine PROVIDED dependencies.
Only dependencies, that are present in both
compileOnly and compileClasspath confgurations,
are considered to have PROVIDED scope.

The substitution was replacing kotlin-reflect with kotlin-reflect-api
in compileClasspath configuration. CompileOnly configurations still resolved
to kotlin-reflect, so a compileOnly dependency to kotlin-reflect
would result in kotlin-reflect-api dependency with COMPILE scope in
IDEA.
This is exactly what happened in 'idea-runner' module, thus breaking
running IDEA from JPS build.

This change fixes the issue by configuring the same substitution
for compileOnly configurations.
2019-07-29 19:48:10 +03:00
Alexey Tsvetkov 317c39f27d Enable assertions in Kotlin Compile Daemon process
#KT-32992 Fixed
2019-07-29 19:40:36 +03:00
Alexey Tsvetkov 560f1483e8 Drop MaxPermSize support from compiler daemon
#KT-17045 Fixed
2019-07-29 19:38:40 +03:00
Dmitry Gridin db23131611 AbstractFindUsagesTest: add read lock 2019-07-29 17:16:41 +03:00
Igor Chevdar e575ca4f53 [IR] Fixed parents during constructors moving 2019-07-29 16:18:15 +03:00
Vyacheslav Gerasimov 2c61572c50 Build: Fix artifact pattern for Android Studio bintray repo 2019-07-26 19:01:53 +03:00
Vyacheslav Gerasimov 10f5204f67 as36: Fix groovy-all dependency version 2019-07-26 18:27:41 +03:00
Ilya Chernikov aed9b13455 Fix jvm-host-embeddable artefact generation 2019-07-26 16:29:45 +02:00
Ilya Chernikov 333c7ff688 Filter out local classes on JSR-223 properties mapping
fixes e.g. Spring framework usages of the JSR-223 engine
2019-07-26 16:28:56 +02:00
Alexey Tsvetkov 2ae19e1d42 Run :kotlin-gradle-plugin:validateTaskProperties on every install
Previously `validateTaskProperties` was run with tests
(`test` task depends on `validateTaskProperties` task).
Tests run with `--continue` argument on TeamCity,
so the validation was not failing remote-run builds.
To fix this, make `install` depend on `validateTaskProperties`.
2019-07-26 15:31:59 +03:00
Alexey Tsvetkov aff66b6a29 Make KotlinJpsBuildTestBase abstract
Otherwise TeamCity warns that it does not contain any tests
2019-07-26 15:09:47 +03:00
Roman Artemev ce9ed26918 [DEBUGGER] Improve computation of source position for breakpoint
in KotlinLineBreakpointType more precise.

 - make `getOffset` of returned position point to lambda body start.

 Fix [WEB-29329]
2019-07-26 15:05:41 +03:00
Dmitry Gridin 2e0ec3b490 AbstractFindUsagesTest: add read lock 2019-07-26 12:57:29 +03:00
Dmitry Gridin dbb9b3b6fd AbstractFindUsagesTest: cleanup code 2019-07-26 12:52:02 +03:00
Nikolay Krasko 58f294a757 Fix kotlin compiler tests in 192 (KT-32193)
#KT-32193 Fixed
2019-07-26 12:38:40 +03:00
Georgy Bronnikov 3729c4e770 JVM: simplify choice of wrapped receiver descriptors 2019-07-26 11:57:51 +03:00
Dmitry Gridin a10e57eaec JavaOutsideModuleDetector: should refresh notification after move
#KT-32967 Fixed
2019-07-26 10:33:54 +03:00
Dmitry Gridin 4c8d0acb5d CreateExpectFix: shouldn't suggest create expect property with lateinit or const modifier
#KT-32705 Fixed
2019-07-26 10:33:28 +03:00
Ilya Chernikov a858607fac Fix script classpath utility functions that use classpath filtering by "keys"
The problem was that only the first matching classpath entry were used.
The problem was reported by @lion7 on github (https://github.com/JetBrains/kotlin/commit/67ad3773de2b12f7e1d29e00151b997a4f6373ba#commitcomment-34443927)
2019-07-26 08:55:16 +02:00
Ilya Chernikov ec3ccf1ba8 Properly handle REPL snippets with exceptions ...
so the REPL remain operational after exception in one of the snippets:
- separately return script class and script instance on evaluation (
  because in case of an exception the class is valid, while the instance
  is not).
- store both the class and the instance in the history
- handle this data accordingly
2019-07-26 08:55:16 +02:00
Ilya Chernikov 288fdc0952 Add a handler for providing evaluation context for scripts
use it on refinement.
also some refactoring on context class and around
2019-07-26 08:55:16 +02:00
Ilya Chernikov 2a5c4a2409 Move caching to after all configuration refinements and ...
move compilation cache setting to the scripting host configuration
The cache implementation can now take into account all external
dependencies that may appear during refinement.
Also change initial refinement location accordingly and rearrange
caching interfaces to make it available in scripting plugin.
2019-07-26 08:55:16 +02:00
Ilya Chernikov e41bbe9328 Introducing transient properties in scripting API 2019-07-26 08:55:16 +02:00
Ilya Chernikov 5fe843d754 Refactor main-kts build scripts - fix red code in IDEA 2019-07-26 08:55:15 +02:00
Ilya Chernikov 42dde50b6b Implement base zip cache with tests...
plus some relevant fixes and refactorings
2019-07-26 08:55:15 +02:00
Ilya Chernikov c7eb9e9520 Move caching tests into a dedicated class
plus some tests refactorings
2019-07-26 08:55:15 +02:00
Ilya Chernikov ef23033936 Add net.jpountz and one.util.streamex to the list of shadowed packages
should fix problem with using REPL infrastructure with Apache Zeppelin
2019-07-26 08:55:15 +02:00
Ilya Chernikov cefd4a35c5 Fix and test evaluation of scripts with default configurations 2019-07-26 08:55:15 +02:00
Ilya Chernikov 961607673d [minor] Refactor properties collection builder:
add a helper to replace the value only if it is absent or default
rearrange some functions
2019-07-26 08:55:15 +02:00
Ilya Chernikov 0af52f2fa6 Implement composable refinement handlers...
for compilation and evaluation configurations.
Add utilities to apply refinements uniformly.
Also fix one invoke for list values - it was not consistent with
other builders
2019-07-26 08:55:14 +02:00