Commit Graph

56191 Commits

Author SHA1 Message Date
Sergey Igushkin f6679f27f4 Add test tasks to the Gradle model built for MPP
Add `testTasks` to KotlinTarget model class, build them
based on task names until proper test runs API is available.
2019-07-11 20:47:58 +03:00
Vyacheslav Gerasimov 9b32670738 Build: Use stripMetadata task for result jar when relocation is enabled
to cleanup invalid metadata left after relocation
2019-07-11 20:07:14 +03:00
Roman Artemev efafb6585e [JS IR BE] Refactored js("...") function
- support object expression
 - do not wrap in function in statement-level position
 - support implicit return
 - code clean up
2019-07-11 18:00:28 +03:00
Roman Artemev 946bc75cda [JS IR BE] Code clean up
- Remove hacks for unbound symbols in TypeOperatorLowering
 - Replace hacker intrinsics with dynamic operations
 - Fix return type for `Object$create` intrinsic
2019-07-11 18:00:28 +03:00
Roman Artemev f9336555da [IR] Remove code duplication in IrTypeCheckerContext 2019-07-11 18:00:28 +03:00
Ilya Chernikov c08b88281c Remove accidetial usages of the internal jdk classes 2019-07-11 15:50:27 +02:00
Ilya Chernikov 1396b3e682 Return default configuration when refinement failed on resolving script descriptor
also fixes appropriate IDE tests
2019-07-11 15:50:27 +02:00
Ilya Chernikov ab938efa68 Attempt to fix Windows detection in main-kts tests 2019-07-11 15:50:27 +02:00
Ilya Chernikov 382e55284c Fix legacy definitions error propagation
also fixes script-util test with resolving errors
2019-07-11 15:50:26 +02:00
Ilya Chernikov 10e19bccb1 Abort script evaluation if environment is created with errors
also fixes appropriate test
2019-07-11 15:50:26 +02:00
Ilya Chernikov c9a4328feb Fix compiled scripts saving tests:
The tests were broken some time ago by applying script isolation, so
it was necessary to add base libraries into the classpath.
Also refactored some classpath building utilities.
2019-07-11 15:50:26 +02:00
Ilya Chernikov 9c004c3a52 Refactor scripting compiler plugin - move cli dependent parts out of the -impl jar
The kotlin-scripting-compiler-impl jar is used in the idea plugin and
therefore should not depend on the cli parts of the compiler to avoid
dependency from the plugin to the kotlin-compiler.jar.
Therefore the cli-dependent parts were moved to the scripting plugin
jar, which is used only in cli compiler based environments.
Also implement required abstractions to allow this movement and
drop some redundant dependencies to the cli parts in other projects.
2019-07-11 15:50:26 +02:00
Ilya Chernikov 9ae0ff03fa Improve script and REPL result handling:
- implement error result
- refactor other result classes
- implement handling in the script evaluation extension - also restores
  previous script error reporting functionality
- add possibility to customize result fileds in script and REPL
- refactor result calculation in the backend: cleanup, rename (since
  it is not only about REPL now)
2019-07-11 15:50:26 +02:00
Ilya Chernikov dc4370ff08 Implement support for new script customizations in command line compiler
refactor and fix internals in many places to make it work
add appropriate tests for main-kts case
2019-07-11 15:50:25 +02:00
Ilya Chernikov 1ab255eafb Use kotlin home for automatic loading of the scripting plugin 2019-07-11 15:50:25 +02:00
Dmitry Petrov 6ea33986fa psi2ir: Provide substituted descriptor for property references 2019-07-11 15:32:43 +03:00
Igor Yakovlev 1968fd7fcb Remove check for files count for mirror elements set in light classes
It is workaround about intensive exception #EA-121413. There is no idea how to fix it fast but it is a try. In case of using UltraLight classes we hope not to
use old fashion light classes anymore soon. (Fixed #KT-28193)
2019-07-11 14:21:32 +03:00
Dmitry Gridin e0c5f897fb KotlinGenerateToStringAction: should generate .contentToString instead java.util.Arrays.toString
#KT-27563 Fixed
2019-07-11 12:53:03 +03:00
Mikhail Glukhikh 43c6049f02 FIR2IR: set origin correctly for synthetic property accesses 2019-07-11 12:46:48 +03:00
Mikhail Glukhikh c6a09dba4e FIR: consider Java default constructors as primary ones 2019-07-11 12:40:29 +03:00
Mikhail Glukhikh 2ceffa241b FIR: make Java default constructor visibility same with class visibility 2019-07-11 12:38:53 +03:00
Mikhail Glukhikh 14bbbb5bf5 FIR: add test for synthetic property access 2019-07-11 12:37:45 +03:00
Mikhail Glukhikh c35d7eab70 Refactor FIR symbols to make them and their FIR element types more clear
This commit also fixes work with Java synthetic properties
2019-07-11 12:37:32 +03:00
Sergey Igushkin 701b9ce166 (minor) Minor corrections in K/A/30GradleIT#testOmittedStdlibVersion 2019-07-11 02:04:58 +03:00
technoir 15feeddc46 Allow omitting version of standard artifacts when kotlin-android plugin is used 2019-07-11 01:44:52 +03:00
Sergey Igushkin 0aa80d1912 Fix org.jetbrains.kotlin.native.disabledTargets registered as extension
Do not register an extension, use an extra property instead. This way,
it is less visible for a build author.

Hotfix for commit c292380aff
Issue #KT-29693
2019-07-10 21:12:23 +03:00
Sergey Igushkin 26a8c16166 Fix Gradle task input annotations for Gradle 5.5 checks
* Interface and abstract properties are now checked, too.
  For them, copy the @Input/@Internal annotations from the
  implementations (luckily, they were all consistent).

* Annotating a private property without a public accessor is not not
  allowed. Remove one such annotation.
2019-07-10 21:06:57 +03:00
Nikolay Krasko e804b58f5f Fix getting logger factory in 182 2019-07-10 20:38:13 +03:00
Sergey Igushkin 4516902aaf Fix metadata transformation for non-published dependencies, KT-32225
Fix dependencies that are added in non-published source sets, which were
omitted from the requested dependencies since their configurations were
not added to the extendsFrom set of the merged configurations.

Also, don't resolve both merged configurations (compile and runtime) in
GranularMetadataTransformation, as the IDE can anyway import only the
compile-scoped dependencies from api & implementation.

Issue #KT-32225 Fixed
2019-07-10 19:37:03 +03:00
Sergey Igushkin dbc8007c63 Fix visibility for MPP dependencies from non-root source sets, KT-32204
Fix incorrect source sets visibility when a dependency is added to a
non-root source set and its visible source sets are mistakenly treated
as already visible by the dependsOn parents and are thus not extracted
from the metadata package.

To simplify the logic, reuse the GranularMetadataTransformation
instances from the dependsOn parent source sets: they can provide the
requested dependencies sets for the parents and their transformation
results, so that excluding the dependency source sets which are seen
the parents gets simpler.

The issue is then fixed by naturally excluding only the source sets
which are mentioned in the parents' transformation results.

Issue #KT-32204 Fixed
2019-07-10 19:36:57 +03:00
Nikolay Krasko 0da55e8284 Unregister custom logger after use in AbstractGradleMultiplatformWizardTest 2019-07-10 17:52:29 +03:00
Max Medvedev 5d35bebacd Keyword completion: use proper prefix matcher for keyword completion
fixes #KT-32519
2019-07-10 15:54:44 +03:00
Mikhail Glukhikh ee37a0aa9f Inline callable: keep all usages inside annotation entries
#KT-24596 Fixed
2019-07-10 15:10:52 +03:00
Mikhail Glukhikh eb00af6b96 CFG: mark annotation arguments as "used as expressions" #KT-24596 Fixed
NB: only classes / function / properties annotations are considered here,
not including local declarations and other annotations
2019-07-10 15:10:52 +03:00
Mikhail Glukhikh b24b8bfb28 BindingContextUtils: fix warnings 2019-07-10 15:10:51 +03:00
Mikhail Glukhikh b97f187cf6 ControlFlowInformationProvider: fix warnings 2019-07-10 15:10:51 +03:00
Mikhail Glukhikh 5e94f537ef Refactoring: use isUsedAsExpression instead of USED_AS_EXPRESSION slice 2019-07-10 15:10:51 +03:00
Mikhail Glukhikh 5afa5de1d7 ReplaceWith: don't keep class literal & callable reference in inlining
#KT-30197 Fixed
2019-07-10 15:10:51 +03:00
Mikhail Glukhikh 615aa265f5 Inline: do more precise check before adding this@Labeled #KT-30762 Fixed 2019-07-10 15:10:51 +03:00
Dmitry Gridin 6605e0dfc0 Update test 'moveMultipleFIlesWithImplicitPrefix' 2019-07-10 14:09:37 +03:00
Dmitry Gridin d2b8535548 Move/copy refactoring: add base support of implicit package prefix
#KT-29720 Fixed
2019-07-10 14:09:37 +03:00
Dmitry Gridin 7c547d8c5a Minor: clean up copy refactoring 2019-07-10 14:09:37 +03:00
Dmitry Gridin 1a9abaeb2a Clean up move refactoring 2019-07-10 14:09:37 +03:00
Dmitry Gridin beba1d82fc ReplaceJavaStaticMethodWithKotlinAnalogInspection: add CommentSaver for case with transform to extension 2019-07-10 14:09:37 +03:00
Dmitry Gridin 56d2961cd9 ReplaceJavaStaticMethodWithKotlinAnalogInspection: add more tests 2019-07-10 14:09:37 +03:00
Dmitry Gridin 82bf21f195 ReplaceJavaStaticMethodWithKotlinAnalogInspection: rename isApplicable(call, context) to isApplicableInContext 2019-07-10 14:09:37 +03:00
Dmitry Gridin 71c0b3caa0 ReplaceJavaStaticMethodWithKotlinAnalogInspection: clean up comments 2019-07-10 14:09:36 +03:00
Dmitry Gridin 8314dbffd5 ReplaceJavaStaticMethodWithKotlinAnalogInspection: introduce Transformation for extension with non-null arguments 2019-07-10 14:09:36 +03:00
Dmitry Gridin 8b8858b223 ReplaceJavaStaticMethodWithKotlinAnalogInspection: introduce Transformation for extension with non-null receiver 2019-07-10 14:09:36 +03:00
Dmitry Gridin d47a7234bb ReplaceJavaStaticMethodWithKotlinAnalogInspection: apply inspection on idea module 2019-07-10 14:09:36 +03:00