Compare commits

...

5889 Commits

Author SHA1 Message Date
Dmitry Savvinov
747f22de2f Allow to force-require syntetic SAM-adapters even in NI
This is needed for some IDE clients, particularly, completion: even
though presenting only non-converted member (e.g., 'foo(Consumer<Int>')
is nominally OK, as resolution with NI is smart enough to accept 'foo { }'
for such a call, it is inconvenient for users (for example, hitting
enter would insert round brackets instead of a figure brackets)

This commit adds very-very narrow API (borderline hacky) in
JavaSyntheticScopes, to allow clients explicitly ask for a scopes with
force-enabled synthetic conversions. It fixes several tests, which had
started to fail after corresponding commit about NI and SAM-adapters
(fe5976d7f4), e.g.:
- Java8BasicCompletionTestGenerated.testCollectionMethods
- Java8BasicCompletionTestGenerated.testStreamMethods
- JvmBasicCompletionTestGenerated$Common$StaticMembers.testJavaStaticMethods
- JvmBasicCompletionTestGenerated$Java.testSAMAdaptersStatic
- JvmWithLibBasicCompletionTestGenerated.testSamAdapter
- JvmWithLibBasicCompletionTestGenerated.testSamAdapterAndGenerics

Note that changes are made in ReferenceVariantsHelper, which is used by
several other clients in IDE. Presumably, those changes are needed for
them too.
2019-06-07 01:22:07 +03:00
Ilya Matveev
e2b51c9e2c Gradle, tests: Fix native interop test for Win x86 2019-06-06 17:26:47 +07:00
Ilya Matveev
ec044aeb01 Project wizard tests: Bump Gradle plugin version to use test binaries 2019-06-06 17:26:46 +07:00
Ilya Matveev
eade0a9788 IDEA plugin: Use new test binary getter in project templates
Issue #KT-31724 fixed
2019-06-06 17:26:45 +07:00
Ilya Matveev
8d2f6f732b Gradle, native: Fix creating test binaries for non-host platforms
Issue #KT-31725 fixed
2019-06-06 17:26:44 +07:00
Ivan Gavrilovic
808f5bbf71 KT-31714: Close files after analysis in incremental KAPT
Artifact transform used to analyze classpath was not closing files, which
caused java.nio.file.FileSystemException. This commit fixes that, and all
input streams are closed after use.

Fixes: KT-31714

(cherry picked from commit 7a2332fe36)
2019-06-06 17:43:58 +09:00
Ivan Gavrilovic
971b5645f9 KT-31127: add only generated Java sources to JavaCompile inputs
This commit changes how generated sources are added to the Gradle JavaCompile
task. Previously, directory was added to sources which caused issues with
annotation processors that only generate Kotlin sources. I.e. JavaCompile task
was executed but no java sources existed.

Now, only generated Java sources are added to the JavaCompile task. This
means that if only Kotlin sources are generated JavaCompile task will be
skipped.

Fixes: KT-31127
Test: Kapt3IT.testKotlinProcessorUsingFiler

(cherry picked from commit 695f202e46)
2019-06-06 17:43:58 +09:00
Ivan Gavrilovic
57c3ddd8f3 KAPT: do not discover incremental APs only if cache is not set
KaptFlag.INCREMENTAL_APT is used to indicate that KAPT run
should try to be incremental because changes to input files and
classpath have been detected. However, first run of the Gradle
task will set this flag to false, which means that all APs will be
detected as non-incremental in the first run. Further on, this means
that the dependency caches will be invalid, and all subsequent runs
will be non-incremental as well.

This commit uses existence of dependency cache to determine if incremental
APs should be discovered. The regression was introduced in
72fdc648ff.

Test: ./gradlew :kotlin-gradle-plugin-integration-tests:testAdvanceGradleVersion --tests *KaptIncrementalWith*\
 && ./gradlew :kotlin-gradle-plugin-integration-tests:test --tests *KaptIncrementalWith*

(cherry picked from commit 55ba985cd2)
2019-06-06 17:43:57 +09:00
Ivan Gavrilovic
f3c729a2b9 Support isolating APs that report multiple originating elements from the same file
It is possible for isolating annotation processor to report two or more
originating elements from the same source file when generating
sources/classes/resources. This commit makes sure the source file are
de-duped, so assertion that there is a single source file does not fail.

Test: IsolatingIncrementalProcessorsTest.testIsolatingWithMultipleOriginatingElements

This is improvement to https://youtrack.jetbrains.com/issue/KT-23880

(cherry picked from commit 1fa990b063)
2019-06-06 17:43:57 +09:00
Ivan Gavrilovic
46aab7a638 Improve constants analysis in KAPT
When analyzing source files in KAPT for incremental annotation processing,
avoid creating TreePath instances for initializers that are literals. E.g.
if it is just a boolean/int literal, we do not need to visit the tree nor
create expensive TreePath instance.

For classes that contain only constants (such as R.java for Android projects)
this is a significant improvement. Class that contains 16000 constants took
more than 10 seconds to analyze, now it is 70ms.

(cherry picked from commit 76f62da6ae)
2019-06-06 17:43:57 +09:00
Vyacheslav Gerasimov
d7f1875b00 192: Update 192 plugin to 192.4205.45 2019-06-05 19:51:46 +03:00
Leonid Startsev
d8b6922692 Correctly copy init blocks code to deserialization constructor
Fixes https://github.com/JetBrains/kotlin-native/issues/3019

Workaround problem with proguard and inline reified functions

(cherry picked from commit d3a596e3c2)
2019-06-05 18:32:27 +03:00
Leonid Startsev
9af0d424b4 Correctly reference deserialization constructor added by plugin
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/472

(cherry picked from commit 6370f0b3be)
2019-06-05 18:31:50 +03:00
Mikhail Glukhikh
c886487d25 Introduce Kotlin language substitutor to fix exceptions in velocity files
Related to KT-31470 (should fix the problem or at least soften it)
May be related also to KT-30977
#KT-30886 Fixed

(cherry picked from commit 71590b6735)
2019-06-05 14:06:45 +03:00
Mikhail Zarechenskiy
409e5bddb0 Fix evaluation of local functions for new-inference
Plus, additionally fix evaluation of generic local functions everywhere

 The problem was that in new-inference we create more substituted
 descriptors while old inference tries to preserve original ones.
 Later, backend fails to retrieve those descriptors as it uses originals.
 But, again, this worked only for simple functions, for generic functions
 debugger with new and old inference worked incorrectly

 #KT-31785 Fixed
2019-06-04 19:58:24 +03:00
Sergey Rostov
e05f01d550 Gradle, js, npm: don't setup package manager without npm dependencies
#KT-31729 Fixed

(cherry picked from commit 00f8f09274)
2019-06-04 16:37:39 +03:00
Igor Yakovlev
ad94bad919 Add correct UL-method hasTypeParameters realization (#KT-30970 Fixed)
Incorrect realization is breaking-down of IDEA generic-type inference algorithm that leads to SOE.
2019-06-03 17:04:53 +03:00
Ilya Chernikov
17f3e1f45b Fix classpath detection from classloader resources 2019-06-03 13:38:05 +02:00
Mikhail Zarechenskiy
9b0262a326 Fix exception from UAST on attempt to map non-fixed type variable
#KT-31723 Fixed
 #EA-126269 Fixed
 #EA-143705 Fixed
 #EA-143703 Fixed
 #EA-143694 Fixed
2019-06-03 14:17:47 +03:00
Mikhail Zarechenskiy
4aa748741c Fix UAST tests for new-inference: adapt SAM-converted descriptors 2019-06-03 14:17:46 +03:00
Mikhail Zarechenskiy
a09b75356a Enable new type inference for UAST tests as for IDE tests 2019-06-03 14:17:44 +03:00
Ilya Chernikov
781b6af1d0 Improve classpath extraction from classloader:
- implement opt-in unpacking/caching of the jar collection archives,
  such as spring boot fat jars and WARs, to the temp dir, and creating
  a valid classpath from extracted archive
- turning it on for the new default jsr223 engine
- fallback to extracting classpath from resource URLs if the classloader
  is not known url-based one
- refactor and optimize extraction
- cache the last retrieved classpath in the default JSR-223 script engine
  factory

(cherry picked from commit f986856d03)
2019-05-31 16:19:10 +02:00
nikita.movshin
e977174cb6 Update changelog for 1.3.40 2019-05-30 23:46:59 +03:00
Andrey Uskov
e03ff13a57 Make plugin 191 incompatible with IDEA 192 2019-05-30 13:00:34 +03:00
Andrey Uskov
4a279a2ae2 Disable invocation of GradleSettingsService in IDEA 192
#KT-31693 Fixed
2019-05-30 12:42:58 +03:00
Dmitriy Novozhilov
4d6aee014c [NI] Fix replacing original in PropertyDescriptor 2019-05-29 18:17:37 +03:00
Ilya Gorbunov
eee8621cd9 Fix method reference ambiguity in test after introducing 'capitalize' overload
(cherry picked from commit fe9bd9ee20)
2019-05-29 12:23:31 +03:00
Ilya Gorbunov
f72e62553f Fix titlecase lowering in decapitalize
Replace isUpperCase() with !isLowerCase check to lower both
upper- and titlecased first chars.

(cherry picked from commit 8badfca459)
2019-05-29 12:23:31 +03:00
Ilya Gorbunov
023194b792 capitalize/decapitalize: improve docs, add one test
(cherry picked from commit a921bd04e0)
2019-05-29 12:23:30 +03:00
Jake Wharton
a9dbb3c5b5 Add Locale-accepting overloads for (de)capitalize in JDK stdlib
#KT-28933 fixed

(cherry picked from commit af31794f60)
2019-05-29 12:23:30 +03:00
Alexander Udalov
b7c6313114 Get rid of copy-pasted code from JavaSdkUtil
#KT-30973 Fixed

(cherry picked from commit d2fcb8cc6a)
2019-05-29 10:50:45 +02:00
Dmitriy Novozhilov
42c841caf7 Fix compiler errors in compiler detected after enabling @OnlyInputTypes in NI 2019-05-29 11:40:34 +03:00
Dmitriy Novozhilov
47d8f81ae3 [NI] Support @OnlyInputTypes annotation. #KT-29307 fixed 2019-05-29 11:40:34 +03:00
Dmitriy Novozhilov
224ba97dbe [NI] Add checking @NotNull parameters for candidates 2019-05-29 11:40:34 +03:00
Dmitriy Novozhilov
8285c9984d [NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI 2019-05-29 11:40:34 +03:00
Alexey Tsvetkov
16ba022b4d Fix IC test for multifile part with property
Our JPS and Gradle plugins handle
recompilation of multifile classes differently.

JPS plugin delegates handling to the JPS itself,
which tracks dependencies via bytecode,
and marks classes as dirty when they are affected.
So in JPS other parts of multifile classes are recompiled only
when a part's signature is changed.

In Gradle plugin we handle recompilation ourselves in
simpler way: any change in any part leads to a recompilation
of all parts of the same multifile class.

In future we should improve our Gradle plugin, but for now
I'm changing the test so that both JPS and Gradle tests
recompile all parts.

Also the dummy function is added to make sure that we
don't blindly recompile everything when a part is changed.

(cherry picked from commit 7f1d30058a)
2019-05-29 10:23:40 +02:00
Alexander Udalov
370dcaf0f3 Minor, simplify code in PropertyCodegen
(cherry picked from commit c13bec0e41)
2019-05-29 10:23:38 +02:00
Alexander Udalov
d12711d41a Remove NotNull PSI element parameter from PropertyCodegen.generateBackingField
#KT-31131 Fixed

(cherry picked from commit 967a6bd80d)
2019-05-29 10:23:36 +02:00
Alexander Udalov
e189133357 Try loading PSI from descriptor in OtherOrigin constructor
To simplify several call sites

(cherry picked from commit e9b50157da)
2019-05-29 10:23:35 +02:00
Alexey Tsvetkov
3e764d93fa Add test for KT-31131
(cherry picked from commit 56d5846ef1)
2019-05-29 10:23:32 +02:00
Yan Zhulanow
38c23f5b43 Debugger: Implement error reporting for evaluator 2019-05-29 17:18:36 +09:00
Anton Yalyshev
3769c67bd1 created FUS Group for Debugger Evaluator 2019-05-29 17:18:35 +09:00
Yan Zhulanow
496b74b414 Pill: Fix getSerializedCompilerArguments() 2019-05-29 17:18:35 +09:00
Anton Bannykh
1bfddfef09 JS IR: ignore the new suspend callable reference test
(cherry picked from commit dad334ffcd)
2019-05-29 10:40:23 +03:00
George Gastaldi
31c92c9415 build: add kotlin-compiler-embeddable to BOM
(cherry picked from commit d0d4d00379)
2019-05-29 05:45:36 +03:00
Mikhail Zarechenskiy
53fa11884d [NI] Relax rules for call completion: require at least one constraint
It's enough to have at least one good constraint.

 Note that the whole algorithm can be a bit more general:
 we could check also Out<T>, In<T> and verify that T has good only
 lower constraint or upper constraint, but there are questions for
 types like Inv<Out<T>>, where T should have lower and upper constraints

 #KT-31514 Fixed
2019-05-29 02:15:37 +03:00
Sergey Igushkin
829771231d Make withJava() safe to call repeatedly on same target
(cherry picked from commit 25371734e8)
2019-05-29 01:08:46 +03:00
Anton Bannykh
4879e656ce JS: cache metadata, grouped by package FQN
(cherry picked from commit c3170d1908)
2019-05-28 23:38:23 +03:00
Anton Bannykh
c1455e3da0 JS: prepare to cache package metadata
(cherry picked from commit c1f69ca8d6)
2019-05-28 23:38:23 +03:00
Anton Bannykh
53170e9199 JS: make .meta.js the same as before
(cherry picked from commit fc7fea4863)
2019-05-28 23:38:23 +03:00
Anton Bannykh
e6ebfb96ec JS: merge proto parts as bytes
(cherry picked from commit 145ca7b6a9)
2019-05-28 23:38:23 +03:00
Anton Bannykh
02d1ffe9c7 JS: lazy load special functions and source maps
(cherry picked from commit fbd59ba68a)
2019-05-28 23:38:23 +03:00
Anton Bannykh
42bd1e5811 JS: improve json parsestring
(cherry picked from commit a3aca662c1)
2019-05-28 23:38:23 +03:00
Anton Bannykh
7b34f83429 JS: optimize JSON parser
(cherry picked from commit 56915d1c07)
2019-05-28 23:38:23 +03:00
Sergey Igushkin
c12208ac4f Fix Android 3.3 Gradle integration tests running with low Gradle version
(cherry picked from commit a4069c031e)
2019-05-28 20:57:00 +03:00
Sergey Igushkin
5d68860e9f Fix Android 3.3 Gradle integration tests running with low Gradle version
(cherry picked from commit 8b150d2b07)
2019-05-28 20:56:58 +03:00
Sergey Igushkin
27bb4d0b2e Fix the AGP deprecation warning on usage of getPackageLibrary, KT-30784
Use the new API that returns the task provider, if available.

Issue #KT-30784 Fixed

(cherry picked from commit 71bd88bdb3)
2019-05-28 20:56:24 +03:00
Anton Bannykh
5fc55df31e JS: support callable references on suspend functions (KT-30987 fixed)
(cherry picked from commit 052ddd60ce)
2019-05-28 19:14:24 +03:00
Elena Lepilkina
7def0ccba8 New EAP of Kotlin/Native 2019-05-28 19:03:01 +03:00
Dmitry Gridin
f47ad82a73 Fix KNPE in OptimizedImportsBuilder
#KT-31637 Fixed

(cherry picked from commit aff8a3f97f)
2019-05-28 21:54:01 +07:00
Kirill Shmakov
cfed5b351a Expand acronym for K/N definitions file
(cherry picked from commit 362e056b18)
2019-05-28 17:35:34 +03:00
Alexander Udalov
2e4e2f67bb Make inline+reified functions synthetic instead of private in bytecode
#KT-18563 Fixed

(cherry picked from commit f9d61f2dc7)
2019-05-28 16:18:32 +02:00
Alexander Udalov
dab23322fd Minor, restructure InlineOnly-related utilities
(cherry picked from commit a645b36688)
2019-05-28 16:18:06 +02:00
Alexander Udalov
7c00d2ba82 Restructure bytecode listing tests on InlineOnly/inline+reified
(cherry picked from commit b42adcd73d)
2019-05-28 16:18:05 +02:00
Sergey Rostov
14aab280c2 Gradle, JS: support exotic versions while converting to semver
#KT-31563
2019-05-28 16:41:31 +03:00
Ilmir Usmanov
489d80c249 Wrap result method node with max stack calculator in inliner
#KT-31347 Fixed
2019-05-28 16:38:25 +03:00
Nikolay Krasko
ef50f25db1 Refactoring: drop unused AbstractKotlinReferenceContributor.kt 2019-05-28 16:17:13 +03:00
Nikolay Krasko
a3dfa28374 Don't produce references for Kotlin block 2019-05-28 16:17:13 +03:00
Nikolay Krasko
95cdc94fbb Get Kotlin references through Kotlin contributors only (KT-31129)
Speed up getting references and protect Kotlin from slow
references contributors.

 #KT-31129 Fixed
2019-05-28 16:17:12 +03:00
Nikolay Krasko
ffa298ea34 Minor: move KotlinDefaultAnnotationMethodImplicitReferenceContributor.kt
Need this move to reference contributor from reference provider service.
2019-05-28 16:17:12 +03:00
Natalia Selezneva
ba00df846e Pass environment variables resolving script dependencies
There is no option in UI to enable/disable passing those variables,
but during Gradle Sync environment variables are passed by default
Also Gradle expect that gradleOptions are passed but there is also no option in UI
(during Gradle Sync IDEA add some options but they shouldn't affect dependencies resolution process)
see GradleExeSettings.resolverExtension.getExtraCommandLineArgs

gradleWithConnection was removed because it isn't used by gradle because they need to manage the TAPI project directory

projectRoot was fixed to externalProjectPath because it can be overrided in settings.gradle

^KT-30974 Fixed

(cherry picked from commit b5dbdc53d1)
2019-05-28 16:08:14 +03:00
Eduard Wolf
b8cb533b39 KT-31639: Fix Iterables.drop integer overflow
(cherry picked from commit c885cadde4)
2019-05-28 15:49:12 +03:00
Andrey Uskov
8b6096f312 Fix exception during mpp run task creation due to usage of deprecated api
#KT-31482 Fixed
2019-05-28 15:22:46 +03:00
Andrey Uskov
19f01b98df Fix ClassCastException during search of overriders
#EA-115095 Fixed
2019-05-28 15:21:56 +03:00
Andrey Uskov
cf8184e9c9 Do not show UI dialog from a write action during work of intention
#EA-100676 Fixed
2019-05-28 15:21:18 +03:00
Mikhail Zarechenskiy
eb813678fc Fix debugger tests for new-inference
There is new child of `VariableAsFunctionResolvedCall` in
 new-inference: `NewVariableAsFunctionResolvedCallImpl`. So, in order to
 support both versions, just use parent class
2019-05-28 14:49:34 +03:00
Igor Yakovlev
8c96111e16 Fix render of classpath log message for UL-classes 2019-05-28 14:26:48 +03:00
Alexander Udalov
02fc21b7ff Support fake Java property overrides in function equality in bridges
A synthetic property descriptor created for `B.value` (see the added
test) should not be equal to the normal descriptor created by the fake
override construction algorithm. Otherwise we can't reach this synthetic
non-abstract descriptor when building bridges in `C`, which results in
exception.

 #KT-31367 Fixed

(cherry picked from commit 082c337faa)
2019-05-28 11:51:37 +02:00
Ilya Matveev
f3be367962 Gradle, native: Rename test binary class: Test -> TestExecutable 2019-05-28 10:50:38 +03:00
Ilya Matveev
6d62f21d60 Gradle, native: Don't treat test output as stacktrace
Currently native test runner reports stacktraces using TC
service messages.
2019-05-28 10:50:37 +03:00
Ilya Matveev
54698544d9 Gradle, native: Introduce separate binary type for tests
Earlier native tests were represented by the same binary type as product
executables. We also used to create test tasks in the same manner as run
tasks for product executables. Such tasks could be obtained used a property
of an executable binary with type Exec.

But now we have a separate class for test tasks. Also we probably will want
to create several tasks for the same test. So we cannot use the same run task
property for both test and product executables. Also representing test and
product executables by the same binary type leads to the fact that assemble
task execution causes building not only product binaries but also the test
ones.

This patch solves the issues described above by introducing a separate binary
type for tests. Such a test binary can be created in the same manner as other
binaries:

    kotlin.macosX64 {
        binaries {
            test("integration") { ... }
        }
    }

One test binary and a task executing it is created by the plugin out of the box.
This test binary replaces a test executable used to be created earlier.

Issue #KT-31609 Fixed
2019-05-28 10:50:37 +03:00
Mikhail Zarechenskiy
9365ff6dcf Fix compilation against bootstrap compiler 2019-05-27 17:37:30 +03:00
Mikhail Zarechenskiy
200dde8cb4 [NI] Don't consider Any!-constraint from upper bounds as more specific
#KT-31624 Fixed
2019-05-27 17:37:28 +03:00
Mikhail Zarechenskiy
da06af2fee Duplicate test for NI and OI to avoid mismatch of diagnostics
There is a problem with different order of diagnostics for NI and OI,
 so, in order to fix this test, it was duplicated
2019-05-27 17:37:27 +03:00
Mikhail Zarechenskiy
e3fa388dfe [NI] Avoid forcing resolve for array access expression
#KT-31606 Fixed
 #EA-126523 Fixed
2019-05-27 17:37:25 +03:00
Mikhail Zarechenskiy
9434babe9f [NI] Don't apply SAM-conversion for type that is subtype of function
Plus, don't get synthetic candidates as all candidates are creating
 by conversion

 #KT-31503 Fixed
2019-05-27 17:37:23 +03:00
Mikhail Zarechenskiy
61f48da6e8 [NI] Fix assertion: KotlinTypeMarker -> KotlinType 2019-05-27 01:02:05 +03:00
Mikhail Zarechenskiy
46420d60f0 [NI] Approximate components of raw types separately
This is needed as components can have different type arguments
2019-05-26 21:42:43 +03:00
Mikhail Zarechenskiy
cb3371ba2e [NI] Implement various optimizations for incorporation algorithm
Mostly, these optimisations are picked from the old inference.
 Also, remove exponential complexity for flexible types in approximation,
 note that more correct fix for this would be to introduce new types
 that corresponds just to platform types to avoid nullability problems,
 but due to complexity it will be done later

 #KT-31415 Fixed
2019-05-26 21:35:52 +03:00
Mikhail Zarechenskiy
6b660fe466 Fix exception on star import from typealias
#KT-30983 Fixed
2019-05-26 21:35:50 +03:00
Mikhail Zarechenskiy
d0231351ec Add tests to preserve current behavior for upcoming changes
##KT-30983 In Progress
2019-05-26 21:35:48 +03:00
Mikhail Zarechenskiy
ec8e8cb23c [NI] More accurate handle of capture types from subtyping
#KT-31520 Fixed
2019-05-26 21:35:46 +03:00
Mikhail Zarechenskiy
c0c63bdc98 [NI] Don't loose inference session during property resolve
#KT-31620 Fixed
2019-05-26 21:35:45 +03:00
Toshiaki Kameyama
0786555650 Redundant 'suspend' modifier inspection: don't report when function has suspend operator invoke
#KT-25465 Fixed

(cherry picked from commit 354f8f0bf1)
2019-05-24 23:05:16 +03:00
Ilya Chernikov
b11e31d275 Fix scripting-compiler tests, add them to the global scriptingTest task 2019-05-24 13:43:03 +02:00
Dmitriy Novozhilov
15d28a75a9 Fix compiler testdata broken in d2d603b 2019-05-24 11:02:55 +03:00
Ilya Chernikov
62dcae008c [minor] fixes after review 2019-05-24 08:26:41 +02:00
Ilya Chernikov
fbeded85e6 Implement test run on embeddable jars for jsr223 and scripting host tests...
also:
- add missing tests to the global scriptingTests task
- extract jsr223 tests into separate project
- fix dependency in jsr223 embeddable jar
2019-05-24 08:26:41 +02:00
Ilya Chernikov
5e4ff87244 Refactor default JSR-223 engine implementation:
- rename classes for clarity
- sort out dependencies
- move common pars to jvm-host jar
- switch to configurations only customization
2019-05-24 08:26:41 +02:00
Ilya Chernikov
560c65c50f Add evaluation context passing to the evaluation config refiners 2019-05-24 08:26:40 +02:00
Ilya Chernikov
a23fb03bd9 Fix dependencies to compiler in scripting modules 2019-05-24 08:26:40 +02:00
Ilya Chernikov
b96fcce096 Move scripting jvm host tests to a separate project...
to solve problems with testing with direct dependency on proguarded compiler
2019-05-24 08:26:40 +02:00
Ilya Chernikov
503a042b29 Drop dependencies to script-util from new scripting infrastructure 2019-05-24 08:26:40 +02:00
Ilya Chernikov
649b74ab7f Convert JvmGetScriptingClass to object to simplify (de)serialization 2019-05-24 08:26:40 +02:00
Ilya Chernikov
623c7673e1 Add a link to hostConfiguration from compilation and evaluation ones
also add possibility to supply functional defaults for keys in PropertiesCollection
2019-05-24 08:26:40 +02:00
Ilya Chernikov
76b7dcfdaf Get rid of UsefulTestCase to avoid dependencies, parallelize tests 2019-05-24 08:26:40 +02:00
Ilya Chernikov
73e3cfe3a4 [minor] fix some warnings 2019-05-24 08:26:40 +02:00
Ilya Chernikov
45cbd792ac Add missing scripting tests to the global task, make them parallel 2019-05-24 08:26:39 +02:00
Ilya Chernikov
ebaca7a4d8 Fix main-kts script classpath calculation 2019-05-24 08:26:39 +02:00
Ilya Chernikov
8e45f79a0e Implement JSR-223 functionality on top of the "new" REPL 2019-05-24 08:26:39 +02:00
Ilya Chernikov
d91881acf4 Implement "legacy" REPL wrappers on top of the "new" scripting infrastructure 2019-05-24 08:26:39 +02:00
Ilya Chernikov
206d53d35a Create core environment in test mode properly 2019-05-24 08:26:39 +02:00
Ilya Chernikov
8585f69b27 Prepare scripting infrastructure for REPL:
- refactor script compiler to simplify extending it for repl
- add repl snippet compilation functions to the new scripting compiler
- extract util functions into appropriate files
- extract repl part into separate class
- extract bridge definition and related definitions into separate file
2019-05-24 08:26:39 +02:00
Ilya Chernikov
738108e9c9 Replace message collector with reporting lambda
to simplify usages and slightly reduce dependencies
2019-05-24 08:26:39 +02:00
Ilya Chernikov
c84a4e8640 Add another method for fetching classpath from classloader, refactor 2019-05-24 08:26:38 +02:00
Ilya Gorbunov
0526298b37 Unmute tests for JVM_IR that pass after making assertFailsWith inline
(cherry picked from commit 0a3ebb5780)
2019-05-23 19:40:24 +03:00
Ilya Gorbunov
7e766a1413 Add hidden methods to keep binary compatibility in kotlin-test for JVM
(cherry picked from commit 6632cf5b1d)
2019-05-23 19:40:23 +03:00
Ilya Gorbunov
bb77d673a0 Make assertFails(With) inline-only functions
So that the lambda passed to these functions can capture suspend
function calls.

#KT-31194 Fixed

(cherry picked from commit 22694fa6b0)
2019-05-23 19:40:23 +03:00
Ilya Gorbunov
ed85927abf Remove internal visibility suppressions in kotlin.test
Internal visibility works fine in MPP, so they are no longer required.

(partially cherry picked from commit 18f9b20610)
2019-05-23 19:40:06 +03:00
Benjamin Orsini
690b84e2e8 Add map() documentation sample
* docs: add map() sample
* docs: add samples for Map and CharSequence
* docs: add another sample for Maps.map()

(cherry picked from commit 3e39f26379)
2019-05-23 19:39:33 +03:00
Ivan Gavrilovic
2bba568dd6 If incremental KAPT is disabled, do not analyze classpath
When incremental apt mode in KAPT is disabled, do not analyze
classpath to determine the type of the annotation processors. Instead,
just mark them all as non-incremental.

(cherry picked from commit 72fdc648ff)
2019-05-23 19:19:21 +03:00
Peter Xu
d432ea7df5 Revert obsolete code introduced in KT-12402
The classes being filtered have been renamed months ago. The change
committed in KT-12402 is no longer relevant as the underlying issue has
been fixed.

(cherry picked from commit a639607821)
2019-05-23 19:19:20 +03:00
Ivan Gavrilovic
81f4a090f6 Handle return result of dir creation/deletion in kapt
#KT-31322

(cherry picked from commit b609fe529c)
2019-05-23 19:19:20 +03:00
Ivan Gavrilovic
7a17bccf23 Remove generated sources and classes for full KAPT build
When running incremental annotation processing in KAPT,
even if incremental flag is enabled, and full rebuild should
be performed (e.g. in presence of dynamic non-incremental APs),
make sure generated sources and classes are removed.

 #KT-31322 fixed

(cherry picked from commit f60bfc34c0)
2019-05-23 19:19:19 +03:00
Vladimir Krivosheev
6528826ea7 Do not use constructor injection for app level extension KotlinClassWithDelegatedPropertyRenderer (KT-31266)
(cherry picked from commit 757b4b3910)
2019-05-23 19:19:19 +03:00
Yan Zhulanow
902dfe0815 Revert "Kapt: Always use raw types for annotation parameter types (KT-30346)"
This reverts commit 66754e62

(cherry picked from commit a0778ad703)
2019-05-23 19:19:18 +03:00
Yan Zhulanow
207bd4e1b9 Pill: Recognize 'embedded' configuration as 'compile' in JPS 2019-05-23 19:19:18 +03:00
Dmitriy Novozhilov
d2d603b3bd Add wrappers on KotlinType in EffectSystem
Also that commit removes usages of builtins inside
  effect system and starts refactoring of functor
  composition via composition instead of inheritance.

There are some changes in testdata related to inference of recursive
  functions with implicit return types.

After this commit they all are marked as unresolved. It happens because
  those functions have DeferredType as return type, and computing this
  type produces recursive exception, which provides “typechecker
  recursive problem” diagnostic.

Before this commit, function call was completed successfully, because
  call completer didn’t computed that type, and computation of DeferredType
  were triggered only in `DataFlowAnalyzer.checkType`.
Now, effect system tries to compute that type while wrapping KotlinTypes
  into ESTypes, and effect system itself is triggered in in call completer,
  so, call completion doesn’t finish and function call is marked as unresolved.

#KT-31364
2019-05-23 19:19:17 +03:00
Dmitriy Novozhilov
536e135c66 [NI] Fix recursion in contract declaration analysis.
#KT-30410 Fixed
2019-05-23 19:19:17 +03:00
Dmitriy Novozhilov
56768ff7ea [NI] Add check for non-null argument type in arguments check
#KT-31461 Fixed
2019-05-23 19:19:16 +03:00
Dmitriy Novozhilov
6f05bafeb3 [NI] Remove deep types in commosn super type for recursive types
#KT-30411 Fixed
2019-05-23 19:19:16 +03:00
Dmitriy Novozhilov
ec852452b0 [NI] Fix error type approximation in ILTApproximatorConfiguration
#KT-31441 Fixed
2019-05-23 19:19:15 +03:00
Sergey Rostov
61ba1c875a Gradle, js: fix js test frameworks DSL for groovy
#KT-31566 Fixed
2019-05-23 19:19:15 +03:00
Sergey Rostov
15f9895088 Gradle, test reports: NewMultiplatformIT.testJavaSupportInJvmTargets
"check" task, now creates aggregate report for all gradle versions,
so this test is affected too
2019-05-23 19:19:15 +03:00
Sergey Rostov
95d338db0d Gradle, tests: introduce kotlin.tests.individualTaskReports
This property required for getting individual junit.xml files that is
currently used in test run assertions.
2019-05-23 19:19:14 +03:00
Sergey Rostov
ca065eedce Gradle, js, single platform projects: create single test aggregator
Extract KotlinTestsRegistry service for customizing aggregated test tasks
naming.
2019-05-23 19:19:14 +03:00
Sergey Rostov
61fcc1cbd2 Gradle, js, tests: always create a jsTest task for compatibility
This requires runnable aggregate test task even if there are not tests in it.
That, in turn, requires support aggregate test tasks hierarchy.
Also TestReport integrated in aggregate for all gradle versions (was for 5 only).

#KT-31527 Fixed
2019-05-23 19:19:13 +03:00
Sergey Rostov
0e480fd040 Gradle, libWithTests test: check js tests running, add test results assertion 2019-05-23 19:19:13 +03:00
Sergey Rostov
c8788d93a3 Gradle, testing test execution: support asserting reports from multiple tasks at once 2019-05-23 19:19:12 +03:00
Sergey Rostov
7c24ed6152 Gradle, js, webpack: fix compatibility with older gradle version 2019-05-23 19:19:12 +03:00
Sergey Rostov
d666d2b186 Gradle, js, npm: try fixing project version to semver
JS package managers requires it.

#KT-31563 Fixed
2019-05-23 19:19:11 +03:00
victor.petukhov
91da355f49 Actualize spec tests 2019-05-23 19:19:11 +03:00
victor.petukhov
bdb7683887 Report warning about implicitly inferred nothing only for return position
^KT-31535 Fixed
2019-05-23 19:19:10 +03:00
Ilmir Usmanov
066ce5464a Do not generate $$forInline suffix for enclosing method
in OUTERCLASS field.

The inliner generates two versions of suspend functions/lambdas in
inline functions: with state-machine and without. The former is used
to call the function from Java or via reflection and have ordinary
name, while the latter is used by inliner and have $$forInline suffix.
The inliner throws the state-machine version away, duplicates
$$forInline version and then call state-machine generator.

If these suspend functions/lambdas are not going to be inlined,
$$forInline version is not generated. However, all objects, which are
used in these suspend functions/lambdas, have $$forInline version
written to OUTERCLASS field. This leads to errors by proguard.
Since they are used in both state-machine version and for-inline ones,
we can simply remove $$forInline suffix from OUTERCLASS field and this
fixes the issue.

 #KT-31242 Fixed
2019-05-23 19:19:10 +03:00
Ilmir Usmanov
7bc607c851 Fix Java interop of inline suspend functions with suspend parameters
In 1.3.31 I fixed Java interop for inline function with coroutines
(TL;DR: when we need a state machine, generate two methods: one with
normal name, and the other one with $$forInline suffix, for the inliner
to use, just like inline suspend functions), however, I forgot a case
with inline suspend function with inline suspend function parameter.
In this case, the compiler a generated two functions, as needed, but,
neither of them had a state-machine. This change adds the state-machine
for the method with normal name. Note, that suspend inline functions
with crossinline parameter, which are also supported by the change,
did not cause incorrect behaviour, since until now they were generated
as synthetic.

 #KT-31354 Fixed
2019-05-23 19:19:09 +03:00
Ilmir Usmanov
e12c7c8f59 Remove redundant continuation classes and INNERCLASS nodes
#KT-31339 Fixed
2019-05-23 19:19:09 +03:00
Ilya Matveev
3b2272ce6a Gradle plugin: remove old native binary APIs
This patch removes APIs for native binary configuring
introduced in 1.3.0 and deprecated in 1.3.30.

Issue #KT-31229 Fixed
2019-05-23 19:19:08 +03:00
Sergey Rostov
5c998b7a33 Gradle, js, npm: skip KotlinProjectExtensions from different class loaders 2019-05-23 19:19:08 +03:00
Sergey Rostov
cfbc44f97f Gradle, js: fix supporting sub targets DSL in build.gradle.kts 2019-05-23 19:19:08 +03:00
Sergey Rostov
224360aa2d Gradle, js, npm: skip old Kotlin2JsPlugin compilations 2019-05-23 19:19:07 +03:00
Sergey Rostov
aef162b1d2 Gradle, js: create run task only when project evaluated
As it may be created after js target configuration by java application plugin
2019-05-23 19:19:07 +03:00
Sergey Rostov
2f7eedd568 Gradle, js, npm: fix case when resolver visits dependents projects first 2019-05-23 19:19:06 +03:00
Sergey Rostov
b22102d252 Gradle, js: implement NpmSimpleLinker for cases when there are no npm dependencies 2019-05-23 19:19:06 +03:00
Sergey Rostov
e20fbee48c Gradle, js: fix task input annotations 2019-05-23 19:19:05 +03:00
Sergey Rostov
3ee7134540 Gradle, tests: don't use gradle testing internals by default 2019-05-23 19:19:05 +03:00
Sergey Rostov
462c5dea53 Gradle, tests: fix cleanAllTests task name 2019-05-23 19:19:04 +03:00
Sergey Rostov
0c13f4b1fc Gradle, js: update npm packages versions 2019-05-23 19:19:04 +03:00
Sergey Rostov
9975ec9d0d Gradle: introduce "target" DSL function for single platform plugins 2019-05-23 19:19:04 +03:00
Sergey Rostov
ecb56ebedc Gradle, js: introduce commonJs() dsl function 2019-05-23 19:19:03 +03:00
Sergey Rostov
eb2e37f8d2 Gradle, js, webpack: report progress
#KT-31013
2019-05-23 19:19:03 +03:00
Sergey Rostov
d9e46fef61 Gradle, js, yarn: split into workspaces and simple implementations
#KT-31018
	#KT-31017
2019-05-23 19:19:02 +03:00
Sergey Rostov
1ebb5145de Gradle, js, npm: store imported packages as yarn workspaces
#KT-30530
2019-05-23 19:19:02 +03:00
Sergey Rostov
1db0643460 Gradle, tests: fix type in "prepend" 2019-05-23 19:19:01 +03:00
Sergey Rostov
46ea87217f Gradle, js, karma: source maps support
#KT-31478
	#KT-31011
	#KT-30573
2019-05-23 19:19:01 +03:00
Sergey Rostov
0cc405a02f Gradle, js, tests: don't add prefix if platform and/or sub target name is null 2019-05-23 19:19:00 +03:00
Sergey Rostov
a102cbe469 Gradle, js: create npm packages per compilation
#KT-30530
2019-05-23 19:19:00 +03:00
Sergey Rostov
78b02e5efa Gradle, js: resolve npm dependencies without task only during IDEA import
#KT-30530
2019-05-23 19:18:59 +03:00
Sergey Rostov
277694a733 Gradle, js: create one npmResolve per build (share between subprojects)
#KT-30530
2019-05-23 19:18:59 +03:00
Sergey Rostov
4f0128f3ca Gradle, js, npm: remove hoisted gradle node modules. Split results collection from shared cache.
#KT-30530
2019-05-23 19:18:58 +03:00
Sergey Rostov
5ee77a02ea Gradle, js, npm: resolver between projects
#KT-30530
2019-05-23 19:18:58 +03:00
Sergey Rostov
7146f79bc9 Gradle, js: use project.whenEvaluated instead of project.afterEvaluate 2019-05-23 19:18:57 +03:00
Sergey Rostov
56310ae159 Gradle, js, dsl: use ConfigureUtil.configure for Groovy compatibility 2019-05-23 19:18:57 +03:00
Sergey Rostov
fe72bc494e Gradle, js, krama: use web pack config directory
#KT-31011
2019-05-23 19:18:56 +03:00
Sergey Rostov
4ac8a18367 Gradle, js: don't use any subtarget by default 2019-05-23 19:18:55 +03:00
Sergey Rostov
db7b4e29c4 Gradle, js, run: fix run dependencies on browserRun and nodeRun 2019-05-23 19:18:55 +03:00
Sergey Rostov
9b1d498663 Gradle, js, test: add basic @Input for test frameworks settings 2019-05-23 19:18:54 +03:00
Sergey Rostov
19656f7884 Gradle, js: aggregate jsTest task should work the same way as all tests aggregator
E.g: individual test tasks should not fail build, aggregate reports should be created.
Also this task should not be included in check (as all tests should be already executed
from the all tests aggregated task).
2019-05-23 19:18:54 +03:00
Sergey Rostov
64556720e1 Gradle, js, karma: show output as progress 2019-05-23 19:18:53 +03:00
Sergey Rostov
fa240df089 Gradle, js, yarn: remove outdated warning about yarn workspaces
#KT-31018
	#KT-31017
2019-05-23 19:18:53 +03:00
Sergey Rostov
79dc998331 Gradle, js: fixes for groovy dsl 2019-05-23 19:18:52 +03:00
Sergey Rostov
1c8580109b Gradle, js, browser: best effort for parsing karma suite names
#KT-31011
2019-05-23 19:18:52 +03:00
Sergey Rostov
6d579d59d9 Gradle, js, browser: fix karma.conf.js writer
#KT-31011
2019-05-23 19:18:51 +03:00
Sergey Rostov
93209bf67b Gradle, js, browser: fix run 2019-05-23 19:18:50 +03:00
Sergey Rostov
6c3ab15b03 Gradle, js: fix resolving required dependencies
#KT-31011
2019-05-23 19:18:50 +03:00
Sergey Rostov
3ee521700e Gradle, nodeJs: fix tests 2019-05-23 19:18:49 +03:00
Sergey Rostov
e8a30fb648 Gradle, js: revert to storing compile output inside node_modules
#KT-30530
Currently kotlin JS compiler generated `require('a.js')` for test -> main
dependencies. This is not worked in layout with compile output at project
work dir (will work if compiler will generate `require('a_test.js')`).
2019-05-23 19:18:49 +03:00
Sergey Rostov
734c894d37 Gradle, js: extract NpmProjectModules to separate file
#KT-30530
2019-05-23 19:18:48 +03:00
Sergey Rostov
b5a8258bef Gradle, js, node: fix source map support configuration
#KT-30573 Fixed
2019-05-23 19:18:48 +03:00
Sergey Rostov
4247ecba2e Gradle, js: fix nodejs run target 2019-05-23 19:18:47 +03:00
Sergey Rostov
0aa9edd833 Gradle, js: restore umd by default 2019-05-23 19:18:47 +03:00
Sergey Rostov
57bf604350 Gradle, js: fix karma.conf.js by wrapping config in function
#KT-31011
2019-05-23 19:18:46 +03:00
Sergey Rostov
5102c5b820 Gradle, js: implement resolving node modules according to https://nodejs.org/api/modules.html
#KT-30530
2019-05-23 19:18:46 +03:00
Sergey Rostov
666b23dc92 Gradle, js: fix requiredDependencies resolve 2019-05-23 19:18:45 +03:00
Sergey Rostov
302be0a5d2 Gradle, js: fix NodeJsExec 2019-05-23 19:18:45 +03:00
Sergey Rostov
a4d9f4c112 Gradle, js: use js compilation only after target configuration 2019-05-23 19:18:45 +03:00
Sergey Rostov
299cdf79cd Gradle, JS: make KotlinWebpack.configDirectory optional
#KT-31013
2019-05-23 19:18:44 +03:00
Sergey Rostov
543eabbd5f Gradle, JS: resolve NPM dependencies inside task when possible
#KT-30530
2019-05-23 19:18:44 +03:00
Sergey Rostov
50c25e2852 Gradle, JS: introduce RequiresNpmDependencies
#KT-30530
2019-05-23 19:18:43 +03:00
Sergey Rostov
9e327b932c Gradle, JS: extract npm package constants
#KT-30530
2019-05-23 19:18:42 +03:00
Sergey Rostov
988ee456f5 Gradle, JS: introduce inner browser and nodejs inner targets
#KT-30747 Fixed
2019-05-23 19:18:42 +03:00
Sergey Rostov
a9d32b17ff Gradle, JS: nodejs target 2019-05-23 19:18:41 +03:00
Sergey Rostov
e3429c7997 Gradle, JS, webpack: source maps support
#KT-31013
2019-05-23 19:18:41 +03:00
Sergey Rostov
55a7ae6acb Gradle, JS: new nodejs project layout
#KT-30530
2019-05-23 19:18:40 +03:00
Sergey Rostov
73cead421e Gradle, JS: webpack support
#KT-31013
2019-05-23 19:18:40 +03:00
Sergey Rostov
899917585b Gradle, tests: clean should depend on cleanAllTests 2019-05-23 19:18:39 +03:00
Sergey Rostov
d3fd16a491 Gradle, testsL fix ijListenTestTask 2019-05-23 19:18:39 +03:00
Sergey Rostov
a19790c16a Gradle, npm: resolve node_modules at parents, return local NodeJsExtension at NodeJsPlugin.apply 2019-05-23 19:18:38 +03:00
Sergey Rostov
3d6579e5a5 Gradle, yarn: get recursively resolved dependencies
#KT-31018 Fixed
	#KT-31016 Fixed
	#KT-31017 Fixed
2019-05-23 19:18:38 +03:00
Sergey Rostov
eaca460d80 Gradle: improve tasks registration API, fix test tasks registration
Previously test tasks may be created inside other registration task
lambda which may be called lazily. This is illegal in Gradle.

Also let introduce Project.createOrRegisterTask on Project receiver
and reified type parameter.
2019-05-23 19:18:37 +03:00
Sergey Rostov
686bc8af83 Gradle: webpack
#KT-31013 Fixed
	#KT-31014 Fixed
2019-05-23 19:18:37 +03:00
Sergey Rostov
6c539e6b73 Gradle, tests: remove "Task" suffix from KotlinTest tasks (as for jvm) 2019-05-23 19:18:36 +03:00
Sergey Rostov
8be1aba2c8 Gradle, js: karma
#KT-31011 fixed
2019-05-23 19:18:35 +03:00
Sergey Rostov
b27b22e30f Gradle, js: mocha
#KT-31010 Fixed
2019-05-23 19:18:35 +03:00
Sergey Rostov
2946237005 Gradle, npm: disable manageNodeModules by default
#KT-30530
2019-05-23 19:18:34 +03:00
Sergey Rostov
de242623d7 Gradle, js: run tests using the new project-wide node_modules
#KT-30530
2019-05-23 19:18:34 +03:00
Sergey Rostov
b5dcfb2c5a Gradle: npm integration using yarn
#KT-31018 Fixed
2019-05-23 19:18:33 +03:00
Sergey Rostov
c6d560b2e6 Gradle, Tests runner: update tests, fix tests on Windows 2019-05-23 19:18:33 +03:00
Sergey Rostov
02e38b6e22 Gradle, Native: don't capture output if treatOutputAsStracktrace enabled
#KT-30529
2019-05-23 19:18:32 +03:00
Sergey Rostov
7b662a2fe3 Gradle, tests: cleanAllTests task
#KT-29946
2019-05-23 19:18:31 +03:00
Sergey Rostov
99b6ee5ee3 Gradle, tests: show test results in IDE
#KT-29946
2019-05-23 19:18:31 +03:00
Sergey Rostov
b653d81bfe Gradle: Kotlin/Native stack trace parser
#KT-30526
	#KT-30529
2019-05-23 19:18:30 +03:00
Sergey Rostov
97084112b3 Gradle: JS stack trace parser
#KT-30526
2019-05-23 19:18:29 +03:00
Sergey Rostov
8a54ab3dd2 Gradle, test: allTests task, same class and method names for jvm, js and native
#KT-30691 Fixed
	#KT-31448 Fixed
2019-05-23 19:18:29 +03:00
Elena Lepilkina
ee74bdacc0 New Kotlin/Native version 2019-05-22 18:19:03 +03:00
Vyacheslav Gerasimov
c12b784e5b Build: Fix cache redirector configuration for all projects
Since we forcing project evaluation in root build script cache redirector
should be configured before we do so, otherwise `afterEvaluate` is not called

(cherry picked from commit 40e9f48bd0)
2019-05-20 15:18:25 +03:00
nikita.movshin
f0555ab5df Fix changelog for 1.3.40 2019-05-17 20:59:49 +03:00
nikita.movshin
cac8f3ace3 Add changelog for 1.3.40 2019-05-17 20:57:41 +03:00
Elena Lepilkina
d331c7d376 New EAP buikd of Kotlin/Native 2019-05-17 10:17:53 +03:00
Roman Artemev
ad4671ed5f [IR BE] Delegate coroutine naming strategy to platform part
(cherry picked from commit 02d84bf061)
2019-05-16 19:20:41 +03:00
Alexey Tsvetkov
7cc4c606a1 Do not expose paths with placeholders in JS IC caches
#KT-31310 Fixed
2019-05-16 04:07:14 +03:00
Elena Lepilkina
009e33ed72 Changed Kotlin/Native version (EAP1) 2019-05-15 12:09:26 +03:00
Dmitry Gridin
2d83ceb980 Fix "Unused import" for 'provideDelegate'
#KT-31319 Fixed

(cherry picked from commit eee8d0263d)
2019-05-14 22:02:23 +07:00
Dmitry Gridin
966dd3ee24 Don't delete import from stdlib if alias exists and used
#KT-31414 Fixed

(cherry picked from commit 3914530fa8)
2019-05-14 22:02:07 +07:00
Dmitry Gridin
efdb19772b Optimize Imports shouldn't delete imports with unresolved parts
#KT-10512 Fixed

(cherry picked from commit 32298522dd)
2019-05-14 22:01:42 +07:00
Ilya Gorbunov
7accee269b Add simplified overloads of String<->ByteArray/CharArray conversions
These overloads cover the most common cases of conversion of the entire
String or Byte/CharArray, avoiding extra index check and branching.

#KT-24810, KT-29265

(cherry picked from commit 2c26dc3af6)
2019-05-14 17:54:13 +03:00
Mikhail Glukhikh
012b8f76a0 Fix .inspection file for ConvertNaNEquality tests
(cherry picked from commit 2d5f41cfe3)
2019-05-14 16:50:51 +03:00
Matthew Runo
01551d1bad Migrate RetentionPolicy arguments in deprecated Java quick-fix
#KT-29666 Fixed

(cherry picked from commit 39f576d75c)
2019-05-14 09:28:49 +03:00
Toshiaki Kameyama
be2c670c09 Implicit Nothing? type: don't report when declaration overrides nullable nothing type
#KT-30481 Fixed

(cherry picked from commit 14259ca9e0)
2019-05-14 09:28:23 +03:00
Dereck Bridie
a3ebd0751c KT-26629 Inspection to replace equality check with NaN with isNaN call
(cherry picked from commit 574178882a)
2019-05-14 09:27:58 +03:00
Mikhail Glukhikh
9d013254a4 Add name to argument: support old-style comment deletion
(cherry picked from commit b4a63794e5)
2019-05-14 09:27:36 +03:00
Mikhail Glukhikh
15045d2512 Use candidate descriptor to determine parameter name stability in IDEA
#KT-31349 Fixed

(cherry picked from commit b0d294b50c)
2019-05-14 09:27:12 +03:00
Mikhail Glukhikh
fa9cf694dd Apply "unnamed boolean literal" to idea & J2K + other style fixes
(cherry picked from commit d517276a06)
2019-05-14 09:26:51 +03:00
Mikhail Glukhikh
d849bde003 Introduce "add parameter names to following arguments"
This commit also refactors relevant intentions & inspections,
like "add name to argument", "add names to call arguments",
"unnamed boolean literal argument"

#KT-30622 Fixed

(cherry picked from commit 955bfd6e7b)
2019-05-14 09:26:25 +03:00
Sergey Igushkin
5694726f04 Introduce Java support in JVM MPP targets (KT-26256)
Deprecate the `jvmWithJava` preset, add warning.

Add a function `withJava()` to JVM MPP targets which applies the 'java'
plugin and sets up the Kotlin & Java interoperation.

Issue #KT-26256 Fixed

Signed-off-by: Sergey Igushkin <hotkeytlt@gmail.com>
(cherry picked from commit be05095df5)
2019-05-13 18:11:04 +03:00
Mikhail Zarechenskiy
d277ddb38c [NI] Complete call if return type contains only "good" type variables 2019-05-13 16:21:01 +03:00
Mikhail Zarechenskiy
3d6c735538 [NI] Complete call if return type has proper lower or equal constraints
There was a silly bug: equal constraint is actually a lower and an upper
 constraint, but we checked only presence of lower constraints.

 Test is important as here we have one equal constraint and should
 complete inner call `foo<Int>()` without propagating it to `bar` to
 avoid using `NoInfer` annotation multiple times
2019-05-13 16:20:52 +03:00
Mikhail Zarechenskiy
8165d07346 [NI] Use original implicit receiver for DSL violation check
There is an inconsistency between old and new inference for storing
 receivers of resolved calls. In new inference, for captured types,
 receiver will be changed and to preserve behavior of the old inference,
 we use original one during important checks.
 This is more a workaround than a solution and should be revisited.

 #KT-31356 Fixed
 #KT-29948 Fixed
 #KT-31360 Fixed
2019-05-13 16:20:43 +03:00
Mikhail Zarechenskiy
2a58d137e2 [NI] Preserve annotations during type substitution
#KT-31346 Fixed
2019-05-13 16:20:34 +03:00
Toshiaki Kameyama
b6f2cc125a "Redundant 'requireNotNull' or 'checkNotNull' call": don't remove first argument if function is used as expression
#KT-31404 Fixed

(cherry picked from commit cf4471ba53)
2019-05-13 17:05:02 +07:00
Dmitry Gridin
40f2823278 Fix incorrect quickfix "Replace with Kotlin analog" for conversion to an extension
where the first argument is an expression with an operation
 #KT-31341 Fixed

(cherry picked from commit 07e908f15f)
2019-05-13 17:04:49 +07:00
Natalia Selezneva
aa6d3c3fbe Fix NPE in SLRUMap in ScriptDefinitionsManager
EA-138364 - NPE: LinkedHashMap$Entry.access$

(cherry picked from commit e158875a14)
2019-05-13 12:39:50 +03:00
Natalia Selezneva
469230016e Do not provide 'add dependency' quick fix for unresolved references for non-project files
EA-126105 - NPE: JavaFileManagerImpl$LibSrcExcludingScope.<init> (KotlinAddOrderEntryActionFactory)

(cherry picked from commit 2a2fe6b428)
2019-05-13 12:39:13 +03:00
Natalia Selezneva
ce55ae31b5 Fix 'Invalid file' Exception during script definition search (EA-125840)
EA-125840 - assert: FileManagerImpl.findFile

(cherry picked from commit ba7d66eb4b)
2019-05-13 12:38:49 +03:00
Natalia Selezneva
703dd28553 Do not use canonical paths in OutsidersPsiFileSupportUtils (EA-135551)
EA-135551 - IOE: OutsidersPsiFileSupportUtils$getOutsiderFileOrigin$.invoke

(cherry picked from commit 836006b3f3)
2019-05-13 12:38:28 +03:00
Natalia Selezneva
3249a82f33 Fix notification about highlighting for diff view in build.gradle.kts (KT-30638)
(cherry picked from commit 98235952ad)

^KT-30638 Fixed
2019-05-13 12:38:02 +03:00
Natalia Selezneva
c5d590cbfd Fix highlighting for scripts in diff view (KT-30690)
(cherry picked from commit 495d98f997)

^KT-30690 Fixed
2019-05-13 12:37:00 +03:00
Natalia Selezneva
1fe369bf84 Minor: extract common parts
(cherry picked from commit 88c6ecbbdf)
2019-05-13 12:36:28 +03:00
Natalia Selezneva
33246782dc Run indexes update after typing in script if needed
(cherry picked from commit 89bf7f991a)
2019-05-13 12:36:02 +03:00
Natalia Selezneva
49c539eb39 Refactoring: add isApplicable method to ScriptDependenciesLoader
(cherry picked from commit 9e51f82248)
2019-05-13 12:35:32 +03:00
Natalia Selezneva
1a8dbc07ed Do not start script dependencies update if dependencies are already cached
(cherry picked from commit e990c61b55)
2019-05-13 12:35:08 +03:00
LepilkinaElena
6c0750e975 Version of K/N for MPP is set to EAP0 version 2019-05-07 14:50:59 +03:00
Mikhail Glukhikh
54411bd248 Simplifiable call: support case w/out receiver, add minor enhancements
Related to KT-30501
2019-05-07 14:28:20 +03:00
Mikhail Glukhikh
8328af5694 Apply "library call could be simplified" to idea + other style fixes 2019-05-07 14:28:20 +03:00
Mikhail Glukhikh
e934eba6e4 Simplifiable call inspection: add filter -> filterIsInstance replacement
#KT-30501 Fixed
2019-05-07 14:28:18 +03:00
Mikhail Glukhikh
7f1643cfad Minor: simplify isCalling 2019-05-07 14:28:17 +03:00
Mikhail Glukhikh
8913755e11 Simplifiable call inspection: add filter -> filterNotNull replacement
Related to KT-30501
2019-05-07 14:28:17 +03:00
Mikhail Glukhikh
4a5cbe0443 Replace "flatMap -> flatten" inspection with abstract "simplifiable call"
Related to KT-30501
2019-05-07 14:28:16 +03:00
Nicolay Mitropolsky
6101b5e6ba KotlinAnnotatedElementsSearcher made support Kotlin objects (KT-31332) 2019-05-07 09:26:00 +03:00
Svyatoslav Kuzmich
824c51e7f0 [JS IR] Add stdlib regression tests 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
0de1242f68 [JS IR BE] Unmute passed tests 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
331625a9bb [JS IR BE] Lower kotlin.js.Json external interface methods 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
d6c9375196 [JS IR BE] Preserve package fqName when moving external declarations out
Create separate package fragment for each fqName of external declaration package
2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
2741ecaaad [JS IR BE] Materialize Unit object during upcasts in AutoBoxingTransformer 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
58bed0f932 [JS IR BE] Fix types of in secondary ctor lowering
Type of IrDelegatingConstructorCall is 'kotlin.Unit'
2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
d6761d323c [JS IR BE] Fix return targets inside state machine 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
feeb6e9862 [JS IR BE] Fix type for lowered cast expression
Safe cast result type is different from its type operand.
2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
fc0a0f41d2 [JS IR BE] Fix: patch parents problems
* Patch parents for state machine builder
* Patch parents for declarations inside default value of actual parameter
2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
130d2d00c3 [JS IR BE] Fix unboxing empty inline class varargs 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
0aae760469 [JS IR BE] Fix block decomposition lowering for dynamic expressions 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
17178628fb [JS IR BE] Support bridges for special methods
Mostly reused from JVM IR lowering.
Shared logic moved to common backend module.
2019-05-06 19:34:25 +03:00
Mikhael Bogdanov
ec6904afd1 Minor. Fix test data 2019-05-06 17:34:02 +02:00
Mikhail Zarechenskiy
c1c464eeb5 Enable new type inference algorithm for IDE analysis
Note that this change doesn't affect compilation: if a project used
 old inference, then it'll continue to use it.

 To use old inference one can uncheck "Enable new type inference..."
 option in "Kotlin Compiler" tab
2019-05-06 18:19:25 +03:00
Mikhail Zarechenskiy
1fecd15355 [NI] Fix exception on capturing stub type from coroutine-inference
#KT-30853 Fixed
2019-05-06 18:05:02 +03:00
pyos
90f11211d3 JVM_IR: wrap performInline in enterIntoInlining/exitFromInliningOf 2019-05-06 16:23:28 +02:00
Mikhail Zarechenskiy
931bbd8cec [NI] Support ad-hoc implicit integer coercion for Kotlin/Native 2019-05-06 16:59:30 +03:00
Abduqodiri Qurbonzoda
c8a4fa58cd Implement String to/from ByteArray conversion (KT-24810) 2019-05-06 15:54:28 +03:00
Abduqodiri Qurbonzoda
81d2d3cb6a Implement String to/from CharArray conversion (KT-29265) 2019-05-06 15:54:28 +03:00
Mikhail Zarechenskiy
a3247b1b92 Add option to enable new inference only for IDE analysis
#KT-30453 Fixed
2019-05-06 14:36:05 +03:00
Dmitry Gridin
e857425b35 Fix 'optimizeImports' tests 2019-05-06 18:12:39 +07:00
Dmitry Gridin
75fb74b262 Fix runtime instance for AbstractJvmOptimizeImportsTest 2019-05-06 18:12:39 +07:00
Dmitry Gridin
ff26acacf9 Optimize Imports shouldn't delete imports with unresolved parts
#KT-10512 Fixed
2019-05-06 18:12:39 +07:00
Dmitry Gridin
87b559562f Run 'Optimize Import' on idea/tests and idea/src 2019-05-06 18:12:39 +07:00
Dmitry Gridin
96ed33e357 Optimize Imports should remove unused import alias
#KT-17375 Fixed
2019-05-06 18:10:52 +07:00
Dmitry Gridin
7fe0503337 Unused import: support also imports as alias
#KT-12392 Fixed
2019-05-06 18:10:52 +07:00
Dmitry Gridin
9062a2fe72 Fix false positive "Unused import directive" for imports under several alias
#KT-30949 Fixed
2019-05-06 18:10:51 +07:00
Dmitry Gridin
c52abfda16 Minor: refactoring KotlinImportOptimizer, KotlinUnusedImportInspection, OptimizedmportsBuilder and AbstractOptimizeImportsTest 2019-05-06 18:10:51 +07:00
Mikhail Zarechenskiy
2f835ed66f Specify type arguments to fix compilation against bootstrap compiler 2019-05-06 14:00:19 +03:00
Mikhail Zarechenskiy
8446ea8a6b [NI] Avoid substituting type variables inside captured types
This fixes exception in CreateAnnotation#testAnnotationType test
2019-05-06 14:00:17 +03:00
Mikhail Zarechenskiy
e8e8f6f336 Don't forget to rollback configured compiler options in IDE tests 2019-05-06 13:59:33 +03:00
Mikhail Zarechenskiy
4ed5c5363f [NI] Update testdata after 03e5e55f 2019-05-06 13:59:32 +03:00
Mikhail Zarechenskiy
97a6b3436c Add diagnostics from NI for SAM with receiver tests 2019-05-06 13:59:30 +03:00
Mikhail Zarechenskiy
c95eddbbbe [IDE-NI-MIGRATE] Migrate few tests for new inference 2019-05-06 13:59:28 +03:00
Mikhail Zarechenskiy
c03dfd1522 [IDE-NI-MIGRATE] Migrate completion tests for new inference 2019-05-06 13:59:26 +03:00
Mikhail Zarechenskiy
d4d1648e1d [IDE-NI-MIGRATE] Migrate QuickFix tests for new inference 2019-05-06 13:59:24 +03:00
Mikhail Zarechenskiy
871925ba31 Fix compilation after rebase 2019-05-06 11:36:32 +03:00
Dmitriy Novozhilov
a79030aa0f [IDE-NI-MIGRATE] [BAD] Migrate testdata of MultiModuleSafeDelete tests
Bad tests in `MultiModuleSafeDeleteTestGenerated`:
- testByActualClassSecondaryConstructorParameterLiftingToExpect_ExpectsAndActualsByActualClassSecondaryConstructorParameter
- testByExpectClassSecondaryConstructorParameter_ExpectsAndActualsByExpectClassSecondaryConstructorParameter
- testByActualClassPrimaryConstructorPropertyLiftingToExpect_ExpectsAndActualsByActualClassPrimaryConstructorProperty
- testByActualClassPrimaryConstructorParameterLiftingToExpect_ExpectsAndActualsByActualClassPrimaryConstructorParameter
- testByExpectClassPrimaryConstructorParameter_ExpectsAndActualsByExpectClassPrimaryConstructorParameter
2019-05-06 11:36:30 +03:00
Dmitriy Novozhilov
b66bbdf7a6 [IDE-NI-MIGRATE] [BAD] Migrate testdata of Extraction tests
Bad tests:
- IntroduceTypeParameter.testDuplicates
- IntroduceTypeParameter.testNullableType
- IntroduceTypeParameter.testUserType
- IntroduceTypeParameter.testFunctionType
- IntroduceTypeParameter.testInClass
- ExtractFunction.TypeParameters.testNoVarianceInFun
- ExtractFunction.Parameters.CandidateTypes.testNonNullableTypes
- ExtractFunction.Parameters.CandidateTypes.testMultipleTypes
- ExtractFunction.ControlFlow.OutputValues.testGenericPair
- IntroduceVariable.ExplicateTypeArguments.testDeeperNestedCall
2019-05-06 11:36:28 +03:00
Dmitriy Novozhilov
656c8a4fa7 [IDE] Add configuring compiler arguments in Extension tests 2019-05-06 11:36:27 +03:00
Dmitriy Novozhilov
03c34691af [NI] Expand TYPE_INFERENCE_ERRORS with diagnostics from NI 2019-05-06 11:36:25 +03:00
Dmitriy Novozhilov
3d5593c70c [IDE-NI-MIGRATE] [BAD] Migrate testdata of Intention tests
Issues:
- #KT-31263

Bad tests:
- SamConversionToAnonymousObject.testSimple3
- ConvertReferenceToLambda.testIf1
- ConvertReferenceToLambda.testIf2
- ConvertReferenceToLambda.testIf3
- ConvertReferenceToLambda.testIf4
- ConvertReferenceToLambda.testWhen1
- ConvertReferenceToLambda.testWhen2
- ConvertReferenceToLambda.testWhen3
- ConvertReferenceToLambda.testWhen4
- ConvertLambdaToReference.testVarargFunction2
2019-05-06 11:36:23 +03:00
Dmitriy Novozhilov
1a085516b0 [IDE-NI] Fix detecting error types in InsertExplicitTypeArgumentsIntention 2019-05-06 11:36:21 +03:00
Dmitriy Novozhilov
e46f552a8d [NI] Update testdata in diagnostic tests 2019-05-06 11:36:20 +03:00
Dmitriy Novozhilov
ad1b8a6fb1 [NI] Add substitution of lambda return type in diagnostics 2019-05-06 11:36:18 +03:00
Dmitriy Novozhilov
b4dbf0f9a4 [NI] Fix inference for constraints with captured in projection 2019-05-06 11:36:16 +03:00
Dmitriy Novozhilov
8f22d43d01 Typo: fix function name in kotlinToResolvedCallTransformer 2019-05-06 11:36:15 +03:00
Dmitriy Novozhilov
d18c55a412 [NI] Fix reporting type mismatch on lambda parameters 2019-05-06 11:36:13 +03:00
Dmitriy Novozhilov
f7091dd1e9 [NI] Uncapture captured types in diagnostics 2019-05-06 11:36:11 +03:00
Dmitriy Novozhilov
e6deaf3315 [NI] Fix reporting UNSAFE_IMPLICIT_INVOKE_CALL diagnostic 2019-05-06 11:36:09 +03:00
Dmitriy Novozhilov
251a02f71d [NI] Fix recording type of lambda in trace 2019-05-06 11:36:08 +03:00
Dmitriy Novozhilov
233dd3ffba [IDEA] Approximate IntegerLiteralType on IDEA side 2019-05-06 11:36:06 +03:00
Dmitriy Novozhilov
f2bbae6a63 [NI] Fix resolving callable references with typealias in ths
#KT-31199 Fixed
2019-05-06 11:36:04 +03:00
Dmitriy Novozhilov
65380f4eb4 [NI] Remove captured type approximation in type arguments of resolved call 2019-05-06 11:36:02 +03:00
Dmitriy Novozhilov
421fda6e92 [NI] Fix reporting smartcasts on arguments of binary expression 2019-05-06 11:36:01 +03:00
Dmitriy Novozhilov
5715c32216 [IDE-NI-MIGRATE] [OK] Enable only OI on some IDEA tests that unrelevant in NI 2019-05-06 11:35:59 +03:00
Dmitriy Novozhilov
48e450684b [TEST] Add configuration of language features in AbstractDiagnosticMessageTest 2019-05-06 11:35:57 +03:00
Dmitriy Novozhilov
05aa36a858 [IDE-NI-MIGRATE] [BAD] Migrate testdata of LocalInspection tests 2019-05-06 11:35:55 +03:00
Dmitriy Novozhilov
17df843bf1 [NI] Fix getting source psi in UnusedLambdaExpressionBodyInspection 2019-05-06 11:35:54 +03:00
Dmitriy Novozhilov
6f51415b4d [NI] Fix determining return type of lambda in IDEA
UselessCallOnCollection tests fixed
2019-05-06 11:35:50 +03:00
Sergey Rostov
956f27cc2d Gradle, JS Test: temporary disable js tests configuration
Test configuration will be reworked with new DSL for browser and nodejs
configuration.
2019-05-05 22:32:23 +03:00
Mikhael Bogdanov
5698d923eb Update dependencies for Android box tests 2019-05-03 15:36:48 +02:00
Mikhael Bogdanov
6dbbf0bb72 Move server process creation to JDK 6 suite
It's allow to avoid problem with wrong inherited output
 (gradle instead of test process)
2019-05-02 13:46:27 +02:00
Georgy Bronnikov
bfe148efd5 IR: mostly remove descriptors from codegen 2019-05-01 20:08:20 +03:00
Georgy Bronnikov
9923d956aa JVM_IR: rework IrIntrinsicMethods 2019-05-01 20:08:20 +03:00
Georgy Bronnikov
98d309d03b IR: declaration builders for receiver parameters 2019-05-01 20:08:20 +03:00
Georgy Bronnikov
ad70a68671 JVM_IR: correct some type parameter bugs 2019-05-01 20:08:20 +03:00
Georgy Bronnikov
3e6171aefc JVM_IR: redirect super calls to DefaultImpls where necessary 2019-05-01 11:47:44 +03:00
ilya-g
66fb47e715 Fix relative link in contributing guide 2019-05-01 07:59:15 +03:00
Ilya Gorbunov
5f2762ed20 Follow up: fix typos in coroutine docs 2019-05-01 05:40:35 +03:00
Svyatoslav Kuzmich
87415cb769 [JS IR] Help IDEA: Copy stdlib sources instead of sharing 2019-05-01 00:28:36 +03:00
Svyatoslav Kuzmich
54e6ee82ad Exclude :kotlin-stdlib-js-ir from coreLibProjects for local builds 2019-05-01 00:28:36 +03:00
Simon Ogorodnik
8a2b41c8cb Fix proguard 2019-04-30 19:28:17 +03:00
Mikhail Glukhikh
5262f0a53f Fir2Ir: apply major text data update after a bunch of resolve changes 2019-04-30 18:45:57 +03:00
Simon Ogorodnik
3e51cbc9dc FIR: move test to stdlib group thus fixing it 2019-04-30 18:45:56 +03:00
Simon Ogorodnik
5b929b88e1 [FIR] Allow nullability mismatch in resolve 2019-04-30 18:45:56 +03:00
Simon Ogorodnik
2111e56d2e FIR: introduce workaround to avoid type-aliases in ConeClassType 2019-04-30 18:45:56 +03:00
Simon Ogorodnik
c06d521e78 FIR: support star projection in CreateFreshTypeVariableSubstitutorStage
This commit fixes a small pack of tests failing at this point
2019-04-30 18:45:56 +03:00
Simon Ogorodnik
4bcba000fd FIR: pass name resolver to annotation deserializer separately 2019-04-30 18:45:56 +03:00
Mikhail Glukhikh
1bb4b32c91 Fir2Ir converter: fix exception on FirUnitExpression 2019-04-30 18:45:56 +03:00
Mikhail Glukhikh
f2ff103ed7 Fir2Ir converter: fix KNPE during use-site scope building for local 2019-04-30 18:45:55 +03:00
Mikhail Glukhikh
8cb16cc06a FIR provider: support getClassUseSiteMemberScope for type aliases 2019-04-30 18:45:55 +03:00
Mikhail Glukhikh
f457cb099f FIR deserializer: handle context in more correct way 2019-04-30 18:45:55 +03:00
Mikhail Glukhikh
1e653226ef FIR deserializer: don't create symbol in advance for class literals 2019-04-30 18:45:55 +03:00
Mikhail Glukhikh
a4b4db5589 FIR resolve: process situation with both implicit receivers properly 2019-04-30 18:45:55 +03:00
victor.petukhov
3636046e2d [FIR] Add test with potential recursive call in compiler FE on when with sealed class inside it (KT-18583) 2019-04-30 18:45:55 +03:00
Mikhail Glukhikh
d1d6b8b77a FIR Java: handle primitive arrays in annotations correctly 2019-04-30 18:45:54 +03:00
Mikhail Glukhikh
be18134270 FIR multi-module: minor test data fixes after resolve enhancements 2019-04-30 18:45:54 +03:00
Simon Ogorodnik
77817cb750 Raw FIR: copy class type-parameters into constructors properly 2019-04-30 18:45:54 +03:00
Simon Ogorodnik
9cef9e4056 Remove isMarkedNullable from FirResolvedTypeRef 2019-04-30 18:45:54 +03:00
Simon Ogorodnik
458080ca8b Raw FIR: create resolved references for desugared temporary variables 2019-04-30 18:45:54 +03:00
Simon Ogorodnik
99994e6c41 FIR: provide super-type as the self-type for anonymous objects
This commit is a temporary approximation useful before we have
symbols for local classes & objects
2019-04-30 18:45:54 +03:00
Simon Ogorodnik
2f7ced2a8e FIR Java: bind overrides properly 2019-04-30 18:45:53 +03:00
Simon Ogorodnik
d19a250cbe FIR: support proper overriding of generic functions 2019-04-30 18:45:53 +03:00
Simon Ogorodnik
7b9f5293da FIR: resolve primary constructor parameters in initializers context 2019-04-30 18:45:53 +03:00
Simon Ogorodnik
fa4ba82350 FIR: provide classifiers via class use-site scope 2019-04-30 18:45:53 +03:00
Simon Ogorodnik
f99f06831c FIR resolve: support typing for get class 2019-04-30 18:45:53 +03:00
Simon Ogorodnik
00ccea220e Raw FIR: allow implicit type of value parameter (helpful for lambda) 2019-04-30 18:45:53 +03:00
Simon Ogorodnik
9169071d60 FIR resolve: introduce draft version of the visibility checker 2019-04-30 18:45:52 +03:00
Simon Ogorodnik
adf845b2fd FIR: provide resolved super-type as the type of enum entry reference 2019-04-30 18:45:52 +03:00
Simon Ogorodnik
8e200d8113 Filter out self output directory from classpath in FIR modularized test 2019-04-30 18:45:52 +03:00
Simon Ogorodnik
e521e66c74 FIR deserializer: provide proper type for enum entries 2019-04-30 18:45:52 +03:00
Simon Ogorodnik
ca350e64c2 FIR deserializer: add proper container class id to nested class members 2019-04-30 18:45:52 +03:00
Simon Ogorodnik
daf9f927d4 FIR: add property case to companion test 2019-04-30 18:45:52 +03:00
Simon Ogorodnik
e41a79fbe9 Unify building references to symbols in html fir dump 2019-04-30 18:45:51 +03:00
Simon Ogorodnik
0c0f45791b Anchors instead of refs on declaration site in html fir dump 2019-04-30 18:45:51 +03:00
Simon Ogorodnik
d28bb5bc70 Render value-parameter modifiers in html fir dump 2019-04-30 18:45:51 +03:00
Simon Ogorodnik
efbf096879 Support ::class in html fir dump 2019-04-30 18:45:51 +03:00
Simon Ogorodnik
cb19a586f4 Fold nullability flexible types in html fir dump 2019-04-30 18:45:51 +03:00
Simon Ogorodnik
3e69838f48 FIR Java: map classes to make java type-parameters have correct bounds
Really, this commit implements early J2K mapping for all Java types.
It's questionable and probably wrong at least for super-types,
because, for example, we cannot resolve spliterator() in classes
derived from java.lang.Iterable
2019-04-30 18:45:51 +03:00
Simon Ogorodnik
cb91c6b977 Add abbreviated types rendering to html fir dump 2019-04-30 18:45:50 +03:00
Simon Ogorodnik
6a0e3371ae FIR: resolve conflicts on multiple inheritance of fun with same signature 2019-04-30 18:45:50 +03:00
Simon Ogorodnik
84fbf4ec25 Partially cache scopes in FIR body resolve transformer 2019-04-30 18:45:50 +03:00
Simon Ogorodnik
861ea6a30f Provide hashCode and equals for lookup tag based types 2019-04-30 18:45:50 +03:00
Simon Ogorodnik
ce0b482413 FIR resolve: add work-around to support enum entries 2019-04-30 18:45:50 +03:00
Simon Ogorodnik
d22eab680e FIR: provide nested classes and objects via declared member scope 2019-04-30 18:45:50 +03:00
Simon Ogorodnik
ee73d21d32 Expand type-aliases in cone (FIR) type context 2019-04-30 18:45:49 +03:00
Simon Ogorodnik
6f9f9fc087 FIR types: relax requirements around flexible types 2019-04-30 18:45:49 +03:00
Simon Ogorodnik
0ae2f992fa Raw FIR: provide receiver to ++, -- operators 2019-04-30 18:45:49 +03:00
Simon Ogorodnik
dc4ccf8d23 FIR resolve: make receiver completion run independent from outer call 2019-04-30 18:45:49 +03:00
Simon Ogorodnik
adb135d036 Provide title to symbol references in html fir dump 2019-04-30 18:45:49 +03:00
Simon Ogorodnik
c1a9fee7e1 Implement break, continue, init in html fir 2019-04-30 18:45:49 +03:00
Simon Ogorodnik
26119f0403 FIR: implement isDenotable on type constructor more accurately 2019-04-30 18:45:48 +03:00
Simon Ogorodnik
21d002ab6f FIR: add function for copying type-parameters 2019-04-30 18:45:48 +03:00
Simon Ogorodnik
cec10dac85 FIR deserializer: remove cycle in annotations loading 2019-04-30 18:45:48 +03:00
Mikhail Glukhikh
e3e7eea3fe FIR: support (partially) type annotations in JVM deserialized 2019-04-30 18:45:48 +03:00
Mikhail Glukhikh
48cd9e3251 FIR: support class annotations in JVM deserialized 2019-04-30 18:45:48 +03:00
Mikhail Glukhikh
a9db64989b FIR deserializer: support enum entries and their annotation usages 2019-04-30 18:45:48 +03:00
Mikhail Glukhikh
b839e50ee2 FIR: deserialize annotations (built-ins only, no enums & arrays yet)
Problems: enums aren't deserialized correctly; array aren't done at all;
Target annotation has no arguments in built-in for some reason.
2019-04-30 18:45:47 +03:00
Mikhail Glukhikh
092d10b1a8 FIR Java: fix creation & handling of type parameter symbols
Before this commit, we created type parameter symbols each time
when type parameter was referenced or created.
In this commit, we introduced class-bound Java type parameter stack
and use it to find referenced type parameter symbol.
So now they are created only when Java type parameter is created
2019-04-30 18:45:47 +03:00
Mikhail Glukhikh
f8bb1d161a Fir Java: add type parameters to constructors and their return types 2019-04-30 18:45:47 +03:00
Mikhail Glukhikh
5bf489327d Minor fix of around flexible and not-null FIR types (by semoro) 2019-04-30 18:45:47 +03:00
Simon Ogorodnik
c487c1443f FIR deserializer: provide type parameters for type-aliases 2019-04-30 18:45:47 +03:00
Simon Ogorodnik
9d7d358836 FIR deserializer: support properties 2019-04-30 18:45:47 +03:00
Simon Ogorodnik
b02b090bdf FIR inference: implement simple constraint system properly 2019-04-30 18:45:46 +03:00
Simon Ogorodnik
ddb08777d9 Link type parameters in html fir dump 2019-04-30 18:45:46 +03:00
Simon Ogorodnik
4469fec57b Enable local functions in fir html dump 2019-04-30 18:45:46 +03:00
Mikhail Glukhikh
f9feeac5e1 Raw FIR: generate data-class component1, component2, ... functions 2019-04-30 18:45:46 +03:00
Mikhail Glukhikh
bb7dcd9945 FIR: protect importing scopes from empty names 2019-04-30 18:45:46 +03:00
Simon Ogorodnik
8324ee7272 FIR deserializer: support type-aliases 2019-04-30 18:45:45 +03:00
Simon Ogorodnik
e6ab38a583 FIR: resolve constructors via type-aliases 2019-04-30 18:45:45 +03:00
Simon Ogorodnik
aa077b42e9 FIR deserializer: provide type-parameters for constructors 2019-04-30 18:45:45 +03:00
Simon Ogorodnik
1512a6ba9a Support FirAnonymousObject in html fir dump 2019-04-30 18:45:45 +03:00
Simon Ogorodnik
e6b9c41f3a FIR resolve: use proper argument mapping in FlatSignature for constructor 2019-04-30 18:45:45 +03:00
Simon Ogorodnik
d89913dc8d FIR: use type of last expression as type of branch, not type of block 2019-04-30 18:45:44 +03:00
Simon Ogorodnik
fd279860f7 FIR resolve: provide unconditional typing for block 2019-04-30 18:45:44 +03:00
Simon Ogorodnik
aa5f0fded5 FIR resolve: provide proper type for super reference 2019-04-30 18:45:44 +03:00
Simon Ogorodnik
9dcf8f836a FIR: support varargs in resolve 2019-04-30 18:45:44 +03:00
Simon Ogorodnik
fa135bbab0 FIR resolve: properly count used arguments in overload conflict resolver 2019-04-30 18:45:44 +03:00
Mikhail Glukhikh
b4019b0cc1 FIR inference: use generic version of error type in type approximator 2019-04-30 18:45:44 +03:00
Mikhail Glukhikh
7d793f6750 FIR resolve: add handling of companions as objects 2019-04-30 18:45:43 +03:00
Mikhail Glukhikh
ab258767f8 FIR resolve: add extra test & comments to multiple receiver resolve 2019-04-30 18:45:43 +03:00
Simon Ogorodnik
d1b8ca31c0 FIR resolve: add test for firstOrNull 2019-04-30 18:45:43 +03:00
Simon Ogorodnik
a3806a6e2e Cone (FIR) context: provide proper types instead of todo's 2019-04-30 18:45:43 +03:00
Simon Ogorodnik
dae5822986 FIR: fix nullability loss on substitution 2019-04-30 18:45:43 +03:00
Simon Ogorodnik
572c9e7115 FIR resolve: add test for map and apply 2019-04-30 18:45:42 +03:00
Simon Ogorodnik
206afde9cc FIR inference: add constraint system from receiver 2019-04-30 18:45:42 +03:00
Simon Ogorodnik
fda777ecae FIR: detect extension function types by reference annotation
Later it should be replaced by cone type annotation analysis
2019-04-30 18:45:42 +03:00
Simon Ogorodnik
3d73c28d1e FIR: fix receiver not being substituted 2019-04-30 18:45:42 +03:00
Simon Ogorodnik
77efe8b857 FIR resolve: reorder call resolution sequence 2019-04-30 18:45:42 +03:00
Simon Ogorodnik
d82e790405 Cone (FIR) type context: implement supertype substitution properly 2019-04-30 18:45:42 +03:00
Mikhail Glukhikh
f47258c6b1 FIR: make substitution wrapper for class-based type scope 2019-04-30 18:45:41 +03:00
Mikhail Glukhikh
93496f1dee FIR resolve: add correct receiver tower scopes + check receivers 2019-04-30 18:45:41 +03:00
Simon Ogorodnik
4b5172cda3 FIR (WIP): Initial support for proper lambda analysis 2019-04-30 18:45:41 +03:00
Simon Ogorodnik
8c67ec8c89 FIR resolve: abstract PostponedResolvedAtom & buildCurrentSubstitutor 2019-04-30 18:45:41 +03:00
Simon Ogorodnik
a0de50307a Raw FIR: generate more trivial tree for lambdas (no explicit return) 2019-04-30 18:45:41 +03:00
Simon Ogorodnik
aaf4645cef FIR: add return type to functional type's arguments 2019-04-30 18:45:41 +03:00
Simon Ogorodnik
a0176fbde5 Support labels in fir html dump 2019-04-30 18:45:40 +03:00
Simon Ogorodnik
541e1addf9 FIR modularized test: fix date format in report name 2019-04-30 18:45:40 +03:00
Simon Ogorodnik
82fbe4d83d Support String concatenation and Unit expression in html fir dump 2019-04-30 18:45:40 +03:00
Simon Ogorodnik
a6b2e119f7 FIR resolve: support trivial when typing 2019-04-30 18:45:40 +03:00
Simon Ogorodnik
55467909da FIR deserializer: optimize KotlinDeserializedJvmSymbolsProvider 2019-04-30 18:45:40 +03:00
Simon Ogorodnik
3a50d2e666 FIR: provide constructors from importing scopes 2019-04-30 18:45:40 +03:00
Simon Ogorodnik
e7ea75fd81 FIR: fix search scope to include kotlin libraries package parts 2019-04-30 18:45:39 +03:00
Simon Ogorodnik
4cb8faf666 FIR: uniquify scopes to avoid ambiguity on diamond inheritance 2019-04-30 18:45:39 +03:00
Simon Ogorodnik
8d4cbd84e3 FIR resolve: support synthetics discrimination 2019-04-30 18:45:39 +03:00
Simon Ogorodnik
49883d1d87 Add root index to fir dump 2019-04-30 18:45:39 +03:00
Simon Ogorodnik
9c04751572 FIR modularized test: use qualified module names 2019-04-30 18:45:39 +03:00
Simon Ogorodnik
3cabf490dd Use fir to html in modularized test 2019-04-30 18:45:39 +03:00
Simon Ogorodnik
61b410e276 Implement fir to html dump 2019-04-30 18:45:38 +03:00
Simon Ogorodnik
32e941cb53 FIR: keep names for error references 2019-04-30 18:45:38 +03:00
Mikhail Glukhikh
5bf41594ec FIR resolve: add receiver consistency checking
NB: looks like checker itself may be not needed, but it's important
to check extension receiver presence during candidate collection
2019-04-30 18:45:38 +03:00
Mikhail Glukhikh
2e7d655b20 FIR resolve: support nested class constructors 2019-04-30 18:45:38 +03:00
Mikhail Glukhikh
8b718c6822 FIR body resolve: support subject type calculation 2019-04-30 18:45:38 +03:00
Mikhail Glukhikh
e05dfb6541 FIR resolve: introduce argument mapper 2019-04-30 18:45:38 +03:00
Simon Ogorodnik
c98b820968 Extract FIR modularized tests to separate module 2019-04-30 18:45:37 +03:00
Simon Ogorodnik
6e3f173567 Implement old FE perf test similar to FIR modularized 2019-04-30 18:45:37 +03:00
Simon Ogorodnik
3c4f5be8fd Implement FIR modularized tests 2019-04-30 18:45:37 +03:00
Simon Ogorodnik
fe3afccfc2 FIR resolve: provide synthetic properties scope
At the moment get* and is* functions are supported
2019-04-30 18:45:37 +03:00
Simon Ogorodnik
5763b82cdd Improve FIR benchmark util, add progress and multi-run info collection 2019-04-30 18:45:37 +03:00
Simon Ogorodnik
45f92c490c FIR: make call resolver stop on first successful candidate 2019-04-30 18:45:37 +03:00
Simon Ogorodnik
95011b1076 Return "FIR resolve: support variable assignments" with full completion 2019-04-30 18:45:36 +03:00
Simon Ogorodnik
c6aff9380b FIR: support resolving to objects 2019-04-30 18:45:36 +03:00
Simon Ogorodnik
b38f3a1272 Replace ConeFunctionType with ConeClassType 2019-04-30 18:45:36 +03:00
Simon Ogorodnik
93cb23a498 Raw FIR: support type placeholders 2019-04-30 18:45:36 +03:00
Simon Ogorodnik
0e0c188e05 Rebuild fir-provider indexes on changes 2019-04-30 18:45:36 +03:00
Simon Ogorodnik
5f0fe4785d Implement FirProvider consistency checker 2019-04-30 18:45:35 +03:00
Simon Ogorodnik
1dae135840 Expand ConeTypeContext, implement FIR type inference & related checkers 2019-04-30 18:45:35 +03:00
Simon Ogorodnik
f1eb66819b Revert "FIR body resolve: support variable assignments"
Performed to make long branch rebasing easier
This reverts commit af8c3788
2019-04-30 18:45:35 +03:00
Simon Ogorodnik
935c21f906 FIR scopes: use use-site member scopes for imports 2019-04-30 18:45:35 +03:00
Simon Ogorodnik
3533541702 Provide class use-site scopes from FirSymbolProviders 2019-04-30 18:45:34 +03:00
Simon Ogorodnik
1cd25da7af FIR scope processors: add function to check is stop on ProcessorAction 2019-04-30 18:45:34 +03:00
Simon Ogorodnik
082e9d1cd7 FIR Java: implement knownClassNamesInPackage optimization 2019-04-30 18:45:34 +03:00
Yanis Batura
a51b7fb8d0 Fix typos 2019-04-30 18:42:07 +03:00
Leonid Startsev
0ecf20bd62 Revert back visibility in deserialization ctor to public so inheritors can access it from other modules.
Fix instantiating of polymorphic serializer with generics.
Move context creation below as asked.
2019-04-30 17:53:40 +03:00
Dmitriy Dolovov
3610c99163 Move IDE-related CIDR modules into 'ide' directory 2019-04-30 21:32:21 +07:00
Svyatoslav Kuzmich
379cb08226 [JS] Reduce usage of 'js' function in stdlib
Function 'kotlin.js.js' is to be redesigned in JS IR backend,
partially because it is a hard feature to support.

Current implementation is unstable and can cause problems around
 inlining and name generator. Luckily most of its use-cases
can be covered by simpler features like dynamic expressions and
external declarations.

Thus we are reducing it's usage in stdlib to make IR backend more
stable in current state. JavaScript features that can't be covered by dynamic expression are
implemented in 'jsOperators.kt' file respectively for each backend:

 - 'internal inline' function which calls 'js' function inside for current
   pre-IR backend

 - 'internal' function with '_hack' parameters for JS IR backend which will be
   later intinsicified in a compiler
2019-04-30 15:27:19 +03:00
Alexander Udalov
e22594acde JVM IR: slightly change field renaming convention implementation
Prefer to rename fields from the class, not from the companion, to be
more in line with the old backend's behavior. This has no effect on the
behavior of current tests but removes differences in metadata (since
metadata has information about every property->field mapping) in some of
them
2019-04-30 13:15:29 +02:00
Alexander Udalov
6cc293a0c5 JVM IR: record FIELD_FOR_PROPERTY for property delegates
Delegated properties now have their $delegate fields recorded in the
metadata (in `ClassCodegen.generateField`). This part of metadata is
used by `KPropertyN.getDelegate` functions, so almost all tests on
getDelegate are now unmuted
2019-04-30 13:15:29 +02:00
Alexander Udalov
5aae832c5f Minor, update doc on -Xsanitize-parentheses
The ASM issue with parentheses was fixed in
02f00c4a82

 #KT-29475
2019-04-30 13:15:29 +02:00
Alexander Udalov
bd6e90f302 FIR: remove dependency of :compiler:fir:resolve on :compiler:cli 2019-04-30 12:01:23 +02:00
pyos
c77e8a8c2d JVM_IR: remove another redundant lowering 2019-04-30 08:20:37 +02:00
Dmitriy Dolovov
c017ef9bc8 Properly detect Kotlin/Native libraries
Issue #KT-30598 fixed
2019-04-30 13:05:22 +07:00
Dmitriy Dolovov
20d77afcce Refactor Kotlin/Native path constants
Use java.io.File instead of java.nio.Path to have more uniform API
2019-04-30 13:05:14 +07:00
Dmitriy Dolovov
2ef7cde34b Add tests for "lite" API for Kotlin/Native libraries 2019-04-30 13:05:06 +07:00
Dmitriy Dolovov
07f6059f44 Refactor "lite" API for Kotlin/Native libraries 2019-04-30 13:04:56 +07:00
Andrey Uskov
6039d86388 Importing projects with granular metadata is partially supported
(except k-lib data format of metadata libraries and multiple target
platforms per source set)
2019-04-29 19:49:18 +03:00
Andrey Uskov
998a24414a Improved parsing of internal compiler arguments with boolean state in
case when the argument is listed twice in the list of command line
arguments. The last value will be used.
#KT-27181 Fixed
2019-04-29 19:48:01 +03:00
Andrey Uskov
affe8baf74 Fix import with jps enabled. kotlin-js-ir and kotlin-test-js-ir were
removed from jps build
2019-04-29 19:45:01 +03:00
Mikhael Bogdanov
0482f7e9c5 Restrict general compare intrinsic optimization to CompareTo intrinsic 2019-04-29 16:27:35 +02:00
Simon Ogorodnik
51f5042315 Fix FIR compilation 2019-04-29 16:51:39 +03:00
Mikhail Glukhikh
b8e6291265 Inference: use generic version of error type in type approximator 2019-04-29 16:51:39 +03:00
Simon Ogorodnik
db8bd8c197 Fix check isCapturedTypeFromSubtyping to support KotlinTypeMarkers 2019-04-29 16:51:38 +03:00
Simon Ogorodnik
aabc9fa10f Abstract PostponedResolvedAtom & buildCurrentSubstitutor 2019-04-29 16:51:37 +03:00
Simon Ogorodnik
58029830f0 Skip star-projection to avoid failures 2019-04-29 16:51:37 +03:00
Simon Ogorodnik
2ea7fb8801 Cleanup ConstraintStorage.buildResultingSubstitutor 2019-04-29 16:51:36 +03:00
Simon Ogorodnik
57a3b1a773 Abstract TypeApproximator from NewCapturedType 2019-04-29 16:51:36 +03:00
Simon Ogorodnik
9306f3840f Abstract buildResultingSubstitutor & ResultTypeResolver from KotlinType 2019-04-29 16:51:35 +03:00
Simon Ogorodnik
fe2e5b7301 Abstract FlatSignature from kotlin types 2019-04-29 16:51:34 +03:00
Simon Ogorodnik
8e595f015e Initial OverloadingConflictResolver abstraction from KotlinTypes 2019-04-29 16:51:34 +03:00
Simon Ogorodnik
9a1678728d Implement inference context and simple components 2019-04-29 16:51:33 +03:00
Simon Ogorodnik
04324b6723 Provide overloads with explicit resolutionFacade for resolutionApi
To ensure stable results of subsequent resolution api method calls,
it is require to provide same resolution facade, as
getResolutionFacade function doesn't guarantee to have same result in
subsequent calls due to soft caching
2019-04-29 16:51:32 +03:00
Roman Elizarov
1e5d973bb1 Fix CoroutineContext documentation with respect to equality
KT-26398 had updated behavior from reference comparison to regular
equality, but the documentation for CoroutineContext was left out.
The whole "by reference" needs to be removed, because it now
follows default behavior of all Kotlin collections and need no
further clarification.
2019-04-29 16:33:22 +03:00
Vyacheslav Gerasimov
389490ad79 Build: resolve :idea project resources lazily in ultimate plugin
to avoid using `evaluationDependsOn`
2019-04-29 16:23:16 +03:00
Vyacheslav Gerasimov
c218385ba8 Build: Collect sources for compiler lazily to avoid evaluationDependsOn 2019-04-29 16:23:16 +03:00
Vyacheslav Gerasimov
8851029baa Build: Use embedded configuration for compiler plugins 2019-04-29 16:23:16 +03:00
Vyacheslav Gerasimov
50e145f239 Build: remove various evaluationDependsOn calls across the build
`evaluationDependsOn` may lead to obscure gradle errors on project configuration
2019-04-29 16:23:16 +03:00
Vyacheslav Gerasimov
0ec1df89fa Build: use configuration for dependency on android-extensions-runtime
`evaluationDependsOn` may lead to obscure gradle errors on project configuration
2019-04-29 16:23:16 +03:00
Vyacheslav Gerasimov
b3720a55d2 Build: Make root ideaPlugin task depend on :prepare:idea-plugin
Since it's only one left in the project
2019-04-29 16:23:16 +03:00
Mikhail Glukhikh
3f6be95801 Include FIR modules into compiler #KT-30243 Fixed
(cherry picked from commit 053aa8ca1e)
2019-04-29 16:23:16 +03:00
Nicolay Mitropolsky
bd16c4629a KotlinElementActionsFactory.createChangeModifierActions modernisation
to allow IDEA relatively safely remove `createChangeModifierActions(target: JvmModifiersOwner, request: MemberRequest.Modifier)` in 192
2019-04-29 16:18:14 +03:00
Jiaxiang Chen
4b99d85322 Optimize JVM byte code generation for conditional conjunction
Implement an intrinsic method for boolean.and operation, and replace
ANDAND condition with a call to such intrinsic method.
2019-04-29 13:28:18 +02:00
Vasily Levchenko
53493657ff [kotlin-native-shared][version]bump 2019-04-29 14:08:16 +03:00
Nikolay Krasko
07ea0ffe16 Reformat and clean up idea.actions.internal 2019-04-29 12:13:18 +03:00
Nikolay Krasko
f9012cf637 Add options for disabling Kotlin line markers (KT-27332)
#KT-27332 Fixed
2019-04-29 12:13:14 +03:00
Nikolay Krasko
c72a375063 Better localization for dsl style icon change 2019-04-29 11:56:07 +03:00
Nikolay Krasko
ea8575c5a3 Remove check for Kotlin misconfiguration for the whole project (KT-30644)
Consider an existing project to be previously configured.

There's still "Configure Kotlin" action, check for configuration
triggered by adding a new Kotlin file, and notification in Kotlin files.

 #KT-30644 Fixed
2019-04-29 11:56:07 +03:00
Nikolay Krasko
01c0c3c924 Addition note about intention and quick-fixes execution in UI thread 2019-04-29 11:56:07 +03:00
Alexander Gorshenev
bd78e7e0aa Move property serialization to symbols
Make sure private field's wrapped descriptor is bound
2019-04-29 04:10:00 +03:00
Alexander Gorshenev
2c026114ae Made IrStatementOrigin serialization field optional for all statements 2019-04-29 04:04:16 +03:00
Alexander Gorshenev
85f85fb3e8 IrStatementOrigin support in newly introduced IrDelegatedPropertyReference 2019-04-29 04:04:16 +03:00
Alexander Gorshenev
19bd01cc8a Introduced proper IrStatementOrigin serialization. 2019-04-29 04:04:16 +03:00
Nicolay Mitropolsky
0794ab9432 Uast: cleaunp warnings (but some still remains) 2019-04-28 16:36:43 +03:00
Svyatoslav Kuzmich
13b332e99e Build scripts for JS IR versions of stdlib and kotlin.tests 2019-04-26 20:14:12 +03:00
Svyatoslav Kuzmich
5da83889d9 Stdlib tests: Supporess NoInfer access instead of redeclaration
Stdlib annotation 'kotlin.internal.NoInfer' was redeclared in stdlib tests
so non-fried modules (kotlin-stdlib-jdk7, kotlin-stdlib-jdk8, etc.)
could access it.

IR deserializer does not support declaration duplicates (at least yet
for JS IR backend). Thus this commit removes this redeclaration and
suppresses errors on its usages instead.
2019-04-26 20:14:03 +03:00
Sergey Igushkin
4848911e6d Fix testNativeTests, add missing system-out to expected test outputs 2019-04-26 18:51:25 +03:00
Sergey Igushkin
9d7c5213df Fix testNewKotlinJsPlugin on Windows (slashes) 2019-04-26 18:32:43 +03:00
Dmitry Petrov
865e0cc080 IR: IrConstructorCall: fixes after rebase 2019-04-26 17:43:26 +03:00
Igor Chevdar
7f423bd841 [IR] Fixes in inliner 2019-04-26 17:43:26 +03:00
Mikhael Bogdanov
be0b2e064b Fix JVM IR inliner 2019-04-26 17:43:26 +03:00
Roman Artemev
c545481db9 Fix JS_IR IrConstructorCall support 2019-04-26 17:43:26 +03:00
Roman Artemev
2a3ce8e9f1 Serialize IrConstructorCall 2019-04-26 17:43:26 +03:00
Dmitry Petrov
b78d1bb2b9 IrConstructorCall support in JVM_IR, JS_IR, and FIR2IR 2019-04-26 17:43:25 +03:00
Dmitry Petrov
82128800c5 IR: assertion in IrCallImpl init
NB it uses descriptor to determine if we try to call constructor using
IrCall.
2019-04-26 17:43:24 +03:00
Dmitry Petrov
11eea6e86a psi2ir: generate IrConstructorCall elements in IR builder helpers 2019-04-26 17:43:24 +03:00
Dmitry Petrov
e3fd74a580 IR: annotations are represented as IrConstructorCall elements
Also, they are rendered somewhat nicer
2019-04-26 17:43:24 +03:00
Dmitry Petrov
db7bcb6464 IR proto: IrConstructorCall in protobuf format 2019-04-26 17:43:24 +03:00
Dmitry Petrov
198ccbc114 JVM_IR: support IrConstructorCall in ExpressionCodegen 2019-04-26 17:43:24 +03:00
Dmitry Petrov
37b1c175ce IR: introduce IrConstructorCall / IrConstructorCallImpl 2019-04-26 17:43:24 +03:00
Roman Artemev
023306b1b3 [JS IR BE] Add tests for main function 2019-04-26 17:04:28 +03:00
Roman Artemev
5bd3bcd237 [JS IR BE] Support main function
* Implement IR-based main function detector
2019-04-26 17:04:28 +03:00
Roman Artemev
6729603ac7 [JS IR BE] Fix warnings 2019-04-26 17:04:28 +03:00
Mikhael Bogdanov
867e39f73c Parallelize idea-gradle tests 2019-04-26 14:42:20 +02:00
Leonid Startsev
90bf36ea7a Fix reference to IrField when serializing superclass' properties 2019-04-26 15:06:54 +03:00
Leonid Startsev
6bec6e6905 Add synthetic constructors to class member scope, so they won't fly 'in the air' in the backends
This is required mainly for Native compiler since it wont't work correctly on descriptors that are not present in the class.
2019-04-26 15:04:53 +03:00
Leonid Startsev
406896eaf0 Implement equals/hashcode for IrDeclarationOrigin so deserialized unknown origins would be compared correctly 2019-04-26 14:59:51 +03:00
LepilkinaElena
02331fbd7e Unify compiler and cinterop flags names (#2294) 2019-04-26 13:34:14 +03:00
nikita.movshin
7b017cb76f Add changelog for 1.3.30 and 1.3.31 2019-04-26 13:06:12 +03:00
Mikhael Bogdanov
c53682f397 Fix AS33 compilation
Commented unnecessary code that uses unavailable API
2019-04-26 11:29:42 +02:00
Mikhael Bogdanov
ceec35bf38 Up merge changes from UsefulTestCase into KtUsefulTestCase 2019-04-26 11:29:41 +02:00
Mikhael Bogdanov
1bc03e705a Minor. Remove old parallelize approach 2019-04-26 11:29:41 +02:00
Sergey Rostov
911a5bdd0e Specify missing type arguments to fix compilation 2019-04-26 12:00:43 +03:00
Mikhail Zarechenskiy
5b33e54f77 [NI] Provide diagnostics for candidates in "allCandidates" mode
This helps for completion as it use diagnostics to clip extra
 candidates
2019-04-26 11:40:17 +03:00
Mikhail Zarechenskiy
450bfed375 Specify missing type arguments to fix compilation in FE module 2019-04-26 11:32:19 +03:00
Mikhail Zarechenskiy
57ad0aa8fb Missing fix for project compilation against bootstrap compiler 2019-04-26 06:28:13 +03:00
Anton Yalyshev
657281a60d added tracking of chosen Kotlin framework in Java-based wizards 2019-04-25 19:06:20 +03:00
Anton Yalyshev
1d3f75adfd created FUS Group for New Project Wizards and Frameworks 2019-04-25 19:06:20 +03:00
Anton Yalyshev
01f34a0ba7 switched to new FUS adapter API 2019-04-25 19:06:19 +03:00
Anton Yalyshev
63ffff175b now we send FUS for ModuleBuilders and FrameworkSupportProviders 2019-04-25 19:06:19 +03:00
Svyatoslav Kuzmich
5baa520232 Advance bootstrap to 1.3.40-dev-2251
Required for JS IR CLI and Gradle plugin
2019-04-25 19:04:59 +03:00
Ilya Matveev
774dbcd6c0 Fix IDEA import after including kotlin-native-shared in Gradle plugin 2019-04-25 21:32:03 +07:00
Mikhail Zarechenskiy
f00c946ff7 Fix projection compilation against bootstrap compiler
This is needed after 5d95a1ac
2019-04-25 16:19:38 +03:00
Mikhail Zarechenskiy
ac0a1d984f [NI] Don't return resulting call if return type has uninferred types 2019-04-25 16:19:38 +03:00
Mikhail Zarechenskiy
db4ca059bd [NI] Fix IDE-refactorings when there are uninferred parameters 2019-04-25 16:19:37 +03:00
Mikhail Zarechenskiy
1e3db9ee7c [NI] Update test data for diagnostic tests 2019-04-25 16:19:37 +03:00
Mikhail Zarechenskiy
ff0993153c [NI] Improvements for "not enough information" diagnostic
#KT-30590 Fixed
2019-04-25 16:19:36 +03:00
Mikhail Zarechenskiy
09cc2ae27f [NI] Initial support of "not enough information" diagnostic
#KT-30590 In Progress
2019-04-25 16:19:36 +03:00
Dmitriy Novozhilov
c1b586f921 [NI] Complex test for "not enough" information diagnostic 2019-04-25 16:19:35 +03:00
Mikhail Zarechenskiy
d40313a8d7 [NI] Allow capturing type projections with type variables
#KT-25302 Fixed
2019-04-25 16:19:35 +03:00
Mikhail Zarechenskiy
abd1c3df26 [NI] Fix diagnostic reporting and unveil problem wrt captured types 2019-04-25 16:19:32 +03:00
Dmitry Gridin
6826d2f193 Replace provideByFqNameMulti with provideByFqName 2019-04-25 19:47:39 +07:00
Dmitry Gridin
3e74e875e8 Add a colon check in LanguageSettingsParser 2019-04-25 19:47:39 +07:00
Dmitry Gridin
b78ec32c02 Change CodegenFactory signature from Collection<KtFile?> to Collection<KtFile> 2019-04-25 19:47:39 +07:00
Dmitry Gridin
37c856290f Fix minor compile warnings 2019-04-25 19:47:39 +07:00
Dmitry Gridin
79793a4bda Replace deprecated classes with parent 2019-04-25 19:47:38 +07:00
Dmitry Gridin
2a85bece80 Replace CodeStyleSettingsManager.getSettings with CodeStyle.getSettings 2019-04-25 19:47:38 +07:00
Dmitry Gridin
bdb97ed46a Replace deprecated icons with actual 2019-04-25 19:47:38 +07:00
Dmitry Gridin
c41b98f5b9 Replace SystemInfo.isJavaVersionAtLeast("1.7") with SystemInfo.isJavaVersionAtLeast(1, 7, 0) 2019-04-25 19:47:38 +07:00
Dmitry Gridin
d7d9771b3c Replace UastEmptyExpression with UastEmptyExpression(null) 2019-04-25 19:47:38 +07:00
Alexander Udalov
648ed92ba3 Minor, deduplicate code in CodegenTestCase.doTest 2019-04-25 14:43:56 +02:00
Alexander Udalov
1c1ff3e2b2 Minor, move android-extensions-compiler tests to package org.jetbrains.kotlin
To fix the package name mismatch inspection
2019-04-25 14:43:47 +02:00
Alexander Udalov
74dd99a8da JS: use new DefaultBuiltIns instance instead of anonymous 2019-04-25 14:42:44 +02:00
Alexander Udalov
cb6fb78bc3 JS: do not use "-no-stdlib" in non-relevant tests
Rename some Ant tests: "simple[...]" -> "simpleWithoutStdlib[...]" and
"simpleWithStdlib[...]" -> "simple[...]"
2019-04-25 14:42:43 +02:00
Alexander Udalov
0659d0cba9 JS: do not use getBuiltInsModule to compute module name
The intention of this code was to use the name "kotlin" for the builtins
module, in case we're using builtins loaded from the compiler class
loader (whose module is created in
`KotlinBuiltIns.createBuiltInsModule`). However,
`getBuiltIns().getBuiltInsModule()` may refer not necessarily to the
builtins module, but also to any valid module where the builtins are
visible from, therefore its name would be computed incorrectly. Use the
module name instead to determine if it's a synthetic builtins module
created in `createBuiltInsModule`
2019-04-25 14:42:43 +02:00
Alexander Udalov
d5fd160fd3 JS: minor, do not use '==' on descriptors from built-ins
Use KotlinBuiltIns.isString instead of equality with
KotlinBuiltIns.string, which is more portable across different module
configurations. Also use isSubtypeOf instead of
DescriptorUtils.isSubclass and thus get rid of an extra error on an
unresolved class in nativeAnnotationCheckers.kt
2019-04-25 14:42:42 +02:00
pyos
31670622c0 Remove a redundant JVM-specific lowering 2019-04-25 14:30:41 +02:00
Jake Wharton
373424f430 Add ULong.compareTo and UInt.div/rem/compareTo intrinsics for Java 8 2019-04-25 13:21:25 +02:00
Georgy Bronnikov
e6362661d1 Merge pull request #2298 from pyos/linear-toarray-lowering
JVM_IR: make ToArrayLowering linear in complexity
2019-04-25 13:28:49 +03:00
Mikhail Glukhikh
69ea0a3597 Fir broken FIR2IR test 2019-04-25 12:37:13 +03:00
Ilya Matveev
24588263ed Store kotlin-native-shared version in the jar of the Gradle plugin 2019-04-25 16:19:11 +07:00
Ilya Matveev
c9ed648303 Use kotlin-native-shared in the Gradle plugin
The kotlin-native-shared artifact includes API allowing
us to work with K/N platforms, hosts, distribution etc.
This patch replaces a dependency on kotlin-native-utils
containing copies of such classes with a dependency on
published kotlin-native-shared in the Gradle plugin and
bundles kotlin-native-shared into the Gradle plugin jar.
2019-04-25 16:19:11 +07:00
pyos
4b0b9e1f80 JVM_IR: make ToArrayLowering linear in complexity
by not running DFS from every node visited during another DFS.
2019-04-25 11:07:34 +02:00
Nicolay Mitropolsky
f118b007f0 Uast: more cases for KotlinUSimpleReferenceExpression resolve (KT-30957, KT-27385) 2019-04-25 10:07:09 +03:00
Simon Ogorodnik
9352d52e7e FIR: load default value from meta-data 2019-04-25 09:47:38 +03:00
Simon Ogorodnik
879563233a FIR: optimize caching in JVM deserializer 2019-04-25 09:47:37 +03:00
Simon Ogorodnik
f453e7df27 Improve error reporting in fir benchmark function 2019-04-25 09:47:37 +03:00
Simon Ogorodnik
a5ca8ffe69 Refactor FirSelfImportingScope 2019-04-25 09:47:37 +03:00
Simon Ogorodnik
f22cca5087 FIR top-level member scope: lookup constructors via classes 2019-04-25 09:47:37 +03:00
Simon Ogorodnik
9cf91738ea Use local callables index in FirClassDeclaredMemberScope 2019-04-25 09:47:37 +03:00
Mikhael Bogdanov
11e0035254 Support test parallelization in uast tests 2019-04-25 08:09:27 +02:00
Mikhael Bogdanov
d1b5c76f09 Reuse KtUsefulTest case temporary files infrastructure 2019-04-25 08:09:26 +02:00
Svyatoslav Kuzmich
e30bdb8dc9 Fix hanling module names that require escaping 2019-04-25 03:54:17 +03:00
Ilya Chernikov
c3a439a829 Fix and refactor scripting subplugin application logic
so warning is not shown when discovery configuration is not populated
fix #KT-31124
refactor code for clarity on the way
also apply scripting subplugin after main plugin to ensure that
configurations are created before scripting is initialized
2019-04-24 17:27:47 +02:00
Ilya Chernikov
917fc56f36 Fix main-kts dependencies after extracting scripting 2019-04-24 17:27:03 +02:00
Ilya Chernikov
4b8d9c8fdd Fix classloaders order on script evaluation
the dependencies one should be a parent for the modules one, to avoid
incompatibility problems. Also fixes main-kts tests
2019-04-24 17:27:03 +02:00
Anton Yalyshev
6ffc3a8679 bunch files update after master switched to 191 2019-04-24 17:23:47 +03:00
Anton Yalyshev
2329954e02 added capability to send a custom event's context 2019-04-24 17:23:22 +03:00
Anton Yalyshev
0255d66144 shortened class and function names and make them closer to actual FUS naming 2019-04-24 17:23:21 +03:00
Dmitry Gridin
9bd32eb3cb Replace GradleBaseInspection with BaseInspection
#KT-31103 Fixed
2019-04-24 20:23:15 +07:00
Dmitry Gridin
0198df4935 PackageDirectoryMismatchInspection should report when a package statement is missing
#KT-13549 Fixed
2019-04-24 20:16:54 +07:00
Dmitry Gridin
2ae30de980 MoveVariableDeclarationIntoWhenInspection shouldn't report a multi-line variable
#KT-30457 Fixed
2019-04-24 20:12:44 +07:00
Sergey Igushkin
d456ae58b6 Remove usages of com.intellij.* utils from kotlin-build-common, KT-31106
As Gradle may under certain conditions reorder the buildscript
classpath artifacts, we need to ensure that the `kotlin-build-common`
module, which duplicates some of the classes that are shaded and packed
into `kotlin-compiler-embeddable`, does not call `com.intellij.*`
classes.

Replace the `com.intellij.*` utils that were called on the execution
path with our own implementations.

Issue #KT-31106 Fixed
2019-04-24 15:51:13 +03:00
Svyatoslav Kuzmich
09d7f4015b Move test.kt stubs to smallRuntime
We already use kotlin.test with fullRuntime klib.
2019-04-24 13:06:59 +03:00
Svyatoslav Kuzmich
b0bd5802bb Remove optionalExpectation hacks
Add common sources to Generate IR Runtime
2019-04-24 13:06:58 +03:00
Svyatoslav Kuzmich
1a6e6588fc Fix: Use Vars instead of plain assignments for declaration imports 2019-04-24 13:06:58 +03:00
Ilmir Usmanov
c2884f3ca8 Optimize variable liveness analysis
During coroutines transformation, we analyse liveness of local variables
in order to decide whether we need to spill them or not.
This analysis contains hot method `useVar`, in which we previously
iterated over all variables in LVT. This is done, since these variables
are seen by debugger and we assume they are alice.
However, this variables can be generated by inliner. In this case, the
LVT's size in huge. I.e. we have loop in hot method.

By hoisting the liveness analysis of the LVT and combining its result
with result of usual liveness analysis, we achieve speed-up from 2m30s
down to 5s.
 #KT-30603 Fixed
2019-04-24 13:04:40 +03:00
Steven Schäfer
f2392a6a28 Remove Concat and StringPlus intrinsics in favor of IrStringConcatenation. 2019-04-24 12:04:12 +02:00
Natalia Selezneva
26c9d69252 Check KotlinOutOfCodeBlockTracker in OutOfBlockModificationTest
General PsiModificationTracker.outOfCodeBlockModificationTracker was removed in IDEA 192
2019-04-24 11:45:03 +03:00
Natalia Selezneva
512a297e0a Process property setter parameter in UAST 2019-04-24 11:39:17 +03:00
Natalia Selezneva
d45644cea4 Fix path to TestNG library in tests for 191 2019-04-24 11:39:17 +03:00
Nicolay Mitropolsky
1db7754298 A workaround for the IDEA-211491 in IDEA 191 to make Kotlin tests pass
for instance `InspectionTestGenerated$Inspections.testOverridingDeprecatedMember_inspectionData_Inspections_test`
2019-04-24 11:21:30 +03:00
Dmitriy Dolovov
d90b63d928 Improve logging in NativeCompilerDownloader
Issue #KT-31158 fixed
2019-04-24 14:17:16 +07:00
Dmitriy Dolovov
63f58b4a4a Add applicability condition to KotlinNativeGradleConfigurator 2019-04-24 14:17:11 +07:00
Dmitriy Dolovov
e188c313e6 Fix: Add Native KLIBs as project-level libraries
Issue #KT-30966 Fixed
2019-04-24 14:17:03 +07:00
Sergey Rostov
cfa635b36a JPS Build: update artifacts for scripting-compiler-impl and js ir backend 2019-04-24 09:45:23 +03:00
Sergey Rostov
aac564872c Scripting, main-kts: temporary workaround to avoid IDE exceptions on Kotlin project
Exclude script definition from resources classpath to avoid IDE exceptions
on kotlin project. This is done by moving MainKtsScript to new `jar-resources`
 folder which is not resource root.

#EA-127827
#KT-31176
2019-04-24 09:14:34 +03:00
Svyatoslav Kuzmich
bb3b9a935f Command line interface 2019-04-23 23:19:12 +03:00
Roman Artemev
89500d776d [IR BE] Don't use symbol table in SuspendFunctionLowering 2019-04-23 22:30:00 +03:00
Alexey Tsvetkov
bec5879e3a Fix ABI plugin
It seems that I forgot to update compiler.pro.191,
so when we switched to IJ 191, ABI plugin has broken
2019-04-23 21:56:05 +03:00
nikita.movshin
deb416484c Update copyright. Fix 2 lines comments after rebase
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
2019-04-23 20:15:03 +03:00
nikita.movshin
a6230c1e2a Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update 1 line comment with dates from 2000 till 2017
2019-04-23 20:09:27 +03:00
nikita.movshin
86672df107 Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update TestGenerator.kt
2019-04-23 20:09:27 +03:00
nikita.movshin
abb7d3ab46 Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update 2 lines comment
2019-04-23 20:09:27 +03:00
nikita.movshin
a636e3d57d Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
2019-04-23 20:09:23 +03:00
nikita.movshin
2e59fdc157 Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update apache.xml
2019-04-23 20:09:23 +03:00
nikita.movshin
65244b4bea Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update only 2 lines copyright.
2019-04-23 20:09:22 +03:00
Vyacheslav Gerasimov
9f3495138f Build: Use embedded configuration in kapt embeddable project
#KT-31047
2019-04-23 19:32:55 +03:00
Vyacheslav Gerasimov
82f9757138 Build: Fix dependency leak on :kotlin-compiler in kotlin-native-library-reader
Introduce mavenCompileScope to manage compile records in pom.xml
2019-04-23 19:32:55 +03:00
Vyacheslav Gerasimov
57cb59bfc7 Remove 181 related warnings from inspection profile 2019-04-23 17:28:41 +03:00
Vyacheslav Gerasimov
210ee681a4 Cleanup bunch workarounds made for 181 2019-04-23 17:28:41 +03:00
Vyacheslav Gerasimov
2bc11cbd58 Remove as32 bunch files 2019-04-23 17:28:41 +03:00
Vyacheslav Gerasimov
952d2b6287 Remove 181 bunch files 2019-04-23 17:28:41 +03:00
Vyacheslav Gerasimov
e261e46e52 Remove 181 & as32 from .bunch 2019-04-23 17:28:40 +03:00
pyos
5b595b58b2 JVM_IR: fold constant string concatenations 2019-04-23 16:20:43 +02:00
Alexey Tsvetkov
1bc4a2eff9 Replace AbstractIncrementalJpsTest->AbstractIncrementalJvmJpsTest
It was accidentally replaced back when switching to IJ 191
2019-04-23 16:14:39 +03:00
Ilmir Usmanov
f94092e952 Add single 192 file for bunch not to fail 2019-04-23 15:57:51 +03:00
Jorge Antonio Díaz-Benito Soriano
3064601e5e Fix a typo
#KT-31138 Fixed
2019-04-23 13:38:19 +02:00
Steven Schäfer
8c06f7daae Fix IR declaration parents.
- Reparent declarations in FileClassLowering, InterfaceLowering,
  StaticDefaultFunctionsLowering, EnumClassLowering, and
  RenameFieldsLowering
- Set correspondingPropertySymbol in MoveCompanionObjectFieldsLowering
- Reparent field initializers in MoveCompanionObjectFieldsLowering and
  EnumClassLowering
- Ensure that parents are unique in PropertiesLowering
- Set declaration parent in SharedVariableManager
- Set field declaration parents in CallableReferenceLowering
- Set declaration parents in FunctionNVarargInvokeLowering
- Set declaration parents for external declaration fields
2019-04-23 12:51:27 +02:00
Yan Zhulanow
f39908b411 Minor: Fix configuration test, lower requirement on Kotlin plugin 2019-04-23 12:38:28 +03:00
Yan Zhulanow
b35ed2602c Pill: Fix test dependencies handling 2019-04-23 12:38:28 +03:00
Yan Zhulanow
038c320594 Pill: Filter duplicating entries for SelfResolvingDependencies 2019-04-23 12:38:28 +03:00
Yan Zhulanow
b8aaf017ea Pill: Update module names in tasks
Pill now uses module names based on Gradle project paths.
Run configurations should be aware of the new names.
2019-04-23 12:38:28 +03:00
Mikhail Glukhikh
4a5b900d28 FIR: get rid of library type parameter symbol 2019-04-23 11:51:36 +03:00
Simon Ogorodnik
649c2f6bcc FIR deserializer: load type-parameters correctly 2019-04-23 11:51:05 +03:00
Simon Ogorodnik
853167a24d FIR deserializer: handle class type parameters properly 2019-04-23 11:41:07 +03:00
Mikhail Glukhikh
2476c0299f FIR Java: fix constructor enhancements
Before this commit,
we generated regular member functions as constructor enhancement.
Now, we generate constructors as constructor enhancement.
2019-04-23 11:41:05 +03:00
Simon Ogorodnik
2e966a7ded FIR deserializer: load type-parameters for kotlin function properly 2019-04-23 11:41:03 +03:00
Simon Ogorodnik
9bbf5bebd2 Raw FIR: support typing for delegated constructor call 2019-04-23 11:41:01 +03:00
Simon Ogorodnik
73b1676a03 Raw FIR: fix unary operators (now convention calls use receivers) 2019-04-23 11:40:32 +03:00
Mikhail Glukhikh
77e83dd8cf Raw FIR: introduce string concatenation call
This removes some 'plus' calls to be resolved
2019-04-23 11:35:41 +03:00
Simon Ogorodnik
8d2acd790d FIR Java: use safer cases in use-site scope to allow constructors 2019-04-23 11:21:46 +03:00
Mikhail Glukhikh
618295f505 FIR: implement trivial typing for break & continue 2019-04-23 11:18:24 +03:00
Mikhail Glukhikh
b9f09afc6f Raw FIR: introduce lambda argument expressions
Without it we cannot distinguish lambda argument from just last argument
2019-04-23 11:15:26 +03:00
Mikhail Glukhikh
cf72b13d84 Add accessor symbols & test for property overriding in Java 2019-04-23 11:15:24 +03:00
Simon Ogorodnik
9abf4062b1 FIR tree: implement trivial expressions typing 2019-04-23 11:14:55 +03:00
Simon Ogorodnik
c3632487d0 FIR Java: improve symbol provider laziness 2019-04-23 09:49:29 +03:00
Simon Ogorodnik
98f4fa1f6c FIR Java: fix too strict cast in use-site scope 2019-04-23 09:49:29 +03:00
Simon Ogorodnik
539fcf82ef Fix deprecation in FIR super type resolver 2019-04-23 09:49:29 +03:00
Mikhail Glukhikh
47f61b2917 Revert "Include FIR modules into compiler #KT-30243 Fixed"
This reverts commit 053aa8ca. It causes
"IllegalArgumentException: org.gradle.*.DefaultClassLoaderScope@13fca663
must be locked before it can be used to compute a classpath!"
in Gradle integration tests
2019-04-23 09:47:18 +03:00
Ilya Kirillov
d2a3d00548 New J2K: fix existing test data 2019-04-22 22:54:48 +03:00
Ilya Kirillov
101ae75b8c New J2K: fix lost JavaMapForEachInspection in post-processing 2019-04-22 22:54:48 +03:00
Ilya Kirillov
c4d07bd7e7 New J2K: reduce boilerplate code in post-processings for registerDiagnosticBasedProcessing's 2019-04-22 22:54:48 +03:00
Ilya Kirillov
c0ec36b3e9 New J2K: fix wrong JKTypeCastExpression children initialisation 2019-04-22 22:54:48 +03:00
Ilya Kirillov
bb81ad7b5f New J2K: do not convert Java string type to a Kotlin one because of wrong constructor calls 2019-04-22 22:54:48 +03:00
Ilya Kirillov
7e7e8f7631 New J2K: add support of lambda expressions in nullabilityAnalysis 2019-04-22 22:54:48 +03:00
Ilya Kirillov
1ffe07bb6c New J2K: fix wrong psi modification in ConvertDataClass 2019-04-22 22:54:47 +03:00
Ilya Kirillov
f11311a20b New J2K: add support of method reference conversion 2019-04-22 22:54:47 +03:00
Ilya Kirillov
8f4f80256a New J2K: do not add extra !! in ImplicitCastsConversion because it would be added later in post-processing 2019-04-22 22:54:47 +03:00
Ilya Kirillov
67770eb86b Fix "New J2K: external annotations support for nullability analysis" 2019-04-22 22:54:47 +03:00
Ilya Kirillov
c39a54d40c Fix "New J2K: pass converter context to postprocessing" 2019-04-22 22:54:47 +03:00
Ilya Kirillov
9e1a858bed New J2K: fix exception in ConvertGettersAndSetters if function is called set 2019-04-22 22:54:47 +03:00
Ilya Kirillov
2ce7dc9d19 New J2K: external annotations support for nullability analysis 2019-04-22 22:54:47 +03:00
Ilya Kirillov
0a88276f68 Make mustNotBeNull function from JavaNullabilityChecker available for J2K 2019-04-22 22:54:47 +03:00
Ilya Kirillov
98651f3484 New J2K: add element info storage, pass info about types & functions via it 2019-04-22 22:54:47 +03:00
Ilya Kirillov
39b09b39ff New J2K: pass converter context to postprocessing 2019-04-22 22:54:46 +03:00
Ilya Kirillov
c4a238cca4 KT-26550: do not show "Convert Java File to Kotlin File" action for external libraries
#KT-26550 fixed
2019-04-22 22:54:46 +03:00
Vyacheslav Gerasimov
8723ad4f46 Switch to 191 platform 2019-04-22 21:52:19 +03:00
Sergey Rostov
21232d202e JPS Build, 191: update artifacts 2019-04-22 21:52:02 +03:00
Vyacheslav Gerasimov
1551f39daa Update asm version to 7.0.1 everywhere 2019-04-22 21:52:01 +03:00
Vyacheslav Gerasimov
aff9da72a8 Update 191 platform to 191.6707.61 2019-04-22 21:52:00 +03:00
Vyacheslav Gerasimov
67a194fa8c Remove broken 192 bunch files 2019-04-22 21:46:57 +03:00
Vyacheslav Gerasimov
6059725c76 Add 192 to .bunch 2019-04-22 21:00:10 +03:00
Svyatoslav Kuzmich
b1d303b027 Reorganize stdlib-js sources specific to the current JS backend
Move kotlin-stdlib-js project and the sources specific to the current backend to 'stdlib/js-v1' directory,
but leave sources that can be shared with the new IR backend in the common 'stdlib/js' location
with exception for 'stdlib/js/src/generated', which is used exclusively for current backend.
This simplifies sourceset configuration when building stdlib with the new backend.
2019-04-22 20:30:57 +03:00
Svyatoslav Kuzmich
9dd9efd4aa [JS IR BE] Fix isQUnit for JS IR BE 2019-04-22 20:30:57 +03:00
Svyatoslav Kuzmich
d7be91e8a4 [JS IR BE] Add SIZE_BYTES and SIZE_BITS to Long and Char 2019-04-22 20:30:57 +03:00
Alexander Gorshenev
3ae64061c1 Minimal tweaks in IR Validation code just to be able to turn it on in Native. 2019-04-22 19:42:33 +03:00
Mikhail Glukhikh
053aa8ca1e Include FIR modules into compiler #KT-30243 Fixed 2019-04-22 15:48:46 +03:00
Alexey Tsvetkov
77d74a261d Rename SourceFileToPathConverter->FileToPathConverter 2019-04-22 15:27:58 +03:00
Alexey Tsvetkov
f66d95545d Test JPS Kotlin caches don't change when project root is different 2019-04-22 15:27:57 +03:00
Alexey Tsvetkov
a7df7e2f9f Sort files when performing GC in lookup storage 2019-04-22 15:27:56 +03:00
Alexey Tsvetkov
ea4fc0fb6b Disable scripting plugin in JPS tests
JVM compiler loads scripting plugin by default,
which in turn performs script template discovery
in compile classpath.

Classloading and template discovery takes noticeable
amount of time in JPS tests, because of
relatively big number of short compilations.

Disabling scripting plugin in most JPS+JVM tests
speeds up JPS tests by ~8% compared to the result before all
optimizations.
2019-04-22 15:27:56 +03:00
Alexey Tsvetkov
175dd5679c Keep application environment alive between JPS tests
This speeds up JPS tests by ~16% compared to the result before all
optimizations. The speedup comes mostly from avoiding re-reading jar
files (like kotlin-stdlib.jar).
2019-04-22 15:27:55 +03:00
Alexey Tsvetkov
80c99eceff Rebuild once after each JPS test
After each test we rebuild everything,
then we compare incremental caches and output
with caches and output after rebuild.

For some reason we did rebuild and comparison
twice per test. This seems excessive.

Removing the second rebuild speeds up JPS tests by ~15%
compared to the result before all optimizations
2019-04-22 15:27:54 +03:00
Alexey Tsvetkov
61fbe43a3f Store relative paths in JPS caches if possible
So caches can be relocated from one machine to another
2019-04-22 15:27:53 +03:00
Alexey Tsvetkov
00de7b6c44 Allow customizing source file path conversion in lookup storage 2019-04-22 15:26:34 +03:00
Alexey Tsvetkov
79337a6b96 Allow customizing source file path conversion in local IC caches 2019-04-22 15:26:34 +03:00
Alexey Tsvetkov
146eebdc7e Print lookup storage as is in tests
This way it is easier to debug when
cache's content is different after rebuild
2019-04-22 15:26:34 +03:00
Nikolay Krasko
de548d6b8b Minor: do not assert psi state in RemoveUselessIsCheckFixForWhen 2019-04-22 15:11:10 +03:00
Nikolay Krasko
b83d07ae9a Assert new quick fixes don't use resolve 2019-04-22 15:11:10 +03:00
Nikolay Krasko
682183a150 Allow resolve in write action for injection for now 2019-04-22 15:11:09 +03:00
Svyatoslav Kuzmich
889b4d721d [JS IR BE] Use constructor parameter to determine underlying type for inline classes
Inline classes from lazy IR may not have files.
2019-04-22 13:18:01 +03:00
Svyatoslav Kuzmich
3fd55673a8 [JS IR BE] Workaround for println
IR backend has a bug in decomposition of dynamic calls.
Workaround: don't use inline function call inside dynamic call argument.
2019-04-22 13:18:00 +03:00
Svyatoslav Kuzmich
03ba0eae5a [JS IR BE] Minor: better internal error message in Namer 2019-04-22 13:18:00 +03:00
Svyatoslav Kuzmich
7c2ee41491 [JS IR BE] Fix boolean companion object 2019-04-22 13:18:00 +03:00
Toshiaki Kameyama
864f99782e Use property access syntax: fix problem text and highlight range
#KT-30910 Fixed
2019-04-22 16:19:37 +07:00
Toshiaki Kameyama
bf5b559923 Add function supertype: make abstract function in sealed class
#KT-30769 Fixed
2019-04-22 16:11:59 +07:00
Toshiaki Kameyama
f2c7b6b8c4 Convert to anonymous object: don't remove type arguments
#KT-30208 Fixed
2019-04-22 16:09:53 +07:00
Toshiaki Kameyama
075620daad Invert if condition intention: don't remove line breaks
#KT-30900 Fixed
2019-04-22 15:59:49 +07:00
Nikolay Krasko
a66aebdc2c Consider range marker with bad interval to be invalid (EA-141900, EA-135531) 2019-04-22 11:34:34 +03:00
Dmitry Gridin
3838976083 Fix false positive 'Remove redundant qualifier name' for property
#KT-31112 Fixed
2019-04-22 11:58:43 +07:00
Mikhail Zarechenskiy
673b54554c [NI] Also complete arguments for ambiguity calls
This is needed for IDE-tests and cases when integer literals are used
 in such ambiguity calls
2019-04-22 00:23:15 +03:00
Nikolay Krasko
088da3e807 Postpone no kotlin files in selection to CheckComponentsUsageSearch execution (KT-31092)
#KT-31092 Fixed
2019-04-19 17:12:12 +03:00
Nikolay Krasko
be471b29c4 Use bunch-specific version of gson in kotlin-gradle-plugin
While kotlin-gradle-plugin is not built for different bunches, bad
version still fails Gradle synchronize action in IDE.
2019-04-19 17:12:12 +03:00
Nikolay Krasko
04eeabcd98 Detect platform only for stdlib and use only roots for detection (KT-30442)
#KT-30442 Fixed
2019-04-19 17:12:12 +03:00
Dmitriy Novozhilov
bfb13803d5 [NI] Fix reporting of overload resolution ambiguity 2019-04-19 14:46:22 +03:00
Dmitriy Novozhilov
f9cc3d9be3 [NI] Fix determining type equality in replacing of extension receiver 2019-04-19 14:46:22 +03:00
Dmitriy Novozhilov
0739d13038 [NI] Record scope in trace for calls with enabled NI 2019-04-19 14:46:22 +03:00
Dmitriy Novozhilov
c86b8da982 [NI] Don't report overload ambiguity for error candidates 2019-04-19 14:46:22 +03:00
Kirill Rakhman
00c76593f2 fix typo in test data 2019-04-19 18:31:17 +07:00
Ilya Matveev
c0eba201a5 CocoaPods: Show error if a build is started not from Xcode
Issue #KT-31062 Fixed
2019-04-19 17:55:57 +07:00
Ilya Matveev
a1e20f8d2a Add tests for CocoaPods integration 2019-04-19 17:55:57 +07:00
Alexander Udalov
822b210e85 Minor, update argfile usage description 2019-04-19 12:55:23 +03:00
victor.petukhov
a567aa620b Fix headers in box and parsing spec tests 2019-04-19 11:55:30 +03:00
victor.petukhov
f6d67251fb Print info about all failed test cases in spec tests 2019-04-19 11:55:30 +03:00
victor.petukhov
86bb5d689d Add various tests for DFA testing 2019-04-19 11:55:30 +03:00
Sergey Rostov
15e3482eec JPS Build: add type-system to kotlin-reflect.jar 2019-04-19 11:51:34 +03:00
Dmitriy Novozhilov
f7b4b553b7 Minor: remove redundant import 2019-04-19 11:08:43 +03:00
Dmitriy Novozhilov
ad50bcaf09 Add extracting original value parameters and original source in IDEA Slicer
#KT-31113 Fixed
2019-04-19 10:53:19 +03:00
Dmitriy Novozhilov
94c4a68344 [NI] Fix determination of ArgumentMatchStatus
#KT-31081 Fixed
2019-04-19 10:53:19 +03:00
Dmitriy Novozhilov
e70bdb51c5 [NI] Automatically squash equal diagnostics in OI and NI in testdata 2019-04-19 10:53:19 +03:00
Dmitriy Novozhilov
642f8ecaf8 [NI] remove redundant replacing receiver in lambda function descriptor
#KT-30927 Fixed
#KT-31057 Fixed
2019-04-19 10:53:19 +03:00
Mikhail Zarechenskiy
2fe900d915 [NI] Resolve lambda against input types from expected type
This is needed to report more precise diagnostics and fix IDE-tests

 #KT-31059 Fixed
2019-04-19 09:08:31 +03:00
Mikhail Zarechenskiy
8f8e33f251 [NI] Strip only Exact-annotation preserving others during inference 2019-04-19 09:08:31 +03:00
Abduqodiri Qurbonzoda
3f08753f87 Move string-related files to text directory 2019-04-19 03:51:20 +03:00
Mikhael Bogdanov
dd005d3c02 Introduce IrLazyField 2019-04-18 19:56:19 +02:00
Sergey Igushkin
13120d23ce Fix Gradle task validation failure due to missing property annotation 2019-04-18 20:41:43 +03:00
Vyacheslav Gerasimov
f9d2601d92 Build: Remove kotlin-scripting-compiler-impl from kotlin-plugin.jar
It already copied to plugin lib as separate library
2019-04-18 20:05:09 +03:00
Ilmir Usmanov
eb5ea62da4 Use anonymous objects instead of lambdas as callbacks in java interop tests 2019-04-18 18:38:16 +03:00
Georgy Bronnikov
328b8f9725 Redirect EnumConstructorCall to IrFunctionAccess in IrElementTransformerVoid 2019-04-18 14:50:55 +03:00
Mikhael Bogdanov
dde28ddc52 Parallelize compiler tests 2019-04-18 13:24:58 +02:00
Mikhael Bogdanov
73836928ef Minor. Update folder suffix
Debug purpose
2019-04-18 13:24:57 +02:00
Ilya Chernikov
9900ac2462 Fix runtime compatibility with the obsolete script jvm eval config options...
also switch mainKtsTest to the mew option
2019-04-18 13:01:50 +02:00
Andrey Uskov
00c3550191 Add method 'addModuleDependencyIfNeeded' in order to keep
compatibility with AndroidStudio
#KT-31090 Fixed
2019-04-18 13:32:48 +03:00
Dmitry Gridin
9d3ebf4562 Minor: refactoring ReplaceJavaStaticMethodWithKotlinAnalogInspection 2019-04-18 15:33:48 +07:00
Dmitry Gridin
3bed360c98 Fix "Should be replaced with Kotlin function" warnings 2019-04-18 15:28:52 +07:00
Dmitry Gridin
d738a12b86 Fix false positive ReplaceJavaStaticMethodWithKotlinAnalog for java.io.PrintStream 2019-04-18 15:28:52 +07:00
Dmitry Gridin
fd47dc9b88 Replace popup with several quick-fixes in ReplaceJavaStaticMethodWithKotlinAnalog 2019-04-18 15:28:52 +07:00
Dmitry Gridin
ee304e92b5 Add Java Arrays.asList, Set.of, List.of to ReplaceJavaStaticMethodWithKotlinAnalogInspection
Relates to #KT-27782 #KT-21641
2019-04-18 15:28:52 +07:00
Dmitry Gridin
b5b5723ec3 Rename ReplaceJavaStaticMethodWithTopLevelFunctionInspection to ReplaceJavaStaticMethodWithKotlinAnalogInspection 2019-04-18 15:28:52 +07:00
Dmitry Gridin
23003c5d1a Add Java compare to ReplaceJavaStaticMethodWithTopLevelFunctionInspection 2019-04-18 15:28:51 +07:00
Dmitry Gridin
7f3c4a21d5 Add Java toString to ReplaceJavaStaticMethodWithTopLevelFunctionInspection 2019-04-18 15:28:51 +07:00
Dmitry Gridin
6afc0367c0 Merge ReplaceJavaIntegerToStringWithMemberInspection and ReplaceJavaStaticMethodWithTopLevelFunctionInspection
Relates to #KT-12721
2019-04-18 15:28:51 +07:00
Dmitry Gridin
6b7f4dda31 Merge ReplaceArraysCopyOfWithCopyOfInspection and ReplaceJavaStaticMethodWithTopLevelFunctionInspection
Relates to #KT-23023
2019-04-18 15:28:51 +07:00
Dmitry Gridin
50b89dd587 Add more cases for ReplaceJavaStaticMethodWithTopLevelFunction from java.lang.Math 2019-04-18 15:28:51 +07:00
Sergey Rostov
69120c0614 JPS build: note about updating artifacts configuration when updating bootstrap version 2019-04-18 10:36:22 +03:00
Sergey Rostov
30d1cc51bf JPS Build: update artifacts 2019-04-18 10:36:22 +03:00
pyos
b23f2a4dbb JVM_IR: set ConstantValue on static final primitive fields 2019-04-18 09:16:32 +02:00
Mikhael Bogdanov
14485c0e33 Switch default for parallel execution 2019-04-18 08:33:02 +02:00
Ilmir Usmanov
dc821a720b Fix test data 2019-04-18 01:13:01 +03:00
Ilmir Usmanov
a793055ec2 Check variables, captured by outer object when searching for suspend crossinline parameters 2019-04-18 01:12:58 +03:00
Ilmir Usmanov
7c14f4c6ae Do not duplicate $$forInline counterpart of inline capturing function 2019-04-18 01:12:56 +03:00
Ilmir Usmanov
20b9d8b2f3 Generate state-machine even if the object is going to be transformed
This fixes Java interop of inline functions, which use coroutines.
However, we cannot transform the state-machine. Thus, we generate
a $$forInline counterpart for suspend functions (similar to inline
suspend functions) and invokeSuspend$$forInline for lambdas if these
coroutines are going to transformed (i.e. are declared inside inline
functions).
During transformation we just skip method with state-machine and
transform the $$forInline counterpart. Of course, if inline site is
inline itself, we generate both state-machine version (which will be
dropped during the next transformation) and $$forInline version.
Consequently, the final version of the coroutines will not have
$$forInline counterpart.
Unfortunately, since CompileKotlinAgainstInlineKotlin tests do not allow
java sources, the tests for the interop are usual box tests.

 #KT-30707 Fixed
2019-04-18 01:12:52 +03:00
Mikhail Zarechenskiy
fe8bf98bce Fix project compilation against bootstrap compiler
Follow-up of 705a8a22, there were several usages of SAM conversions
 for Kotlin functions
2019-04-17 23:11:05 +03:00
Ilya Chernikov
ada3edb222 Fix after rebase - adapting to the new idea plugin handling scheme 2019-04-17 22:03:59 +02:00
Ilya Chernikov
4b4186ecb2 Switch to coroutines 1.1.1 2019-04-17 22:03:59 +02:00
Ilya Chernikov
7c4efb2772 Disable ScriptingGradleSubplugin if applied in the gradle prior to 5.0
Allows to avoid limiting scripting infrastructure to languageVersion 1.2,
since kotlin compiler 1.3+ is bundled with gradle only starting from 5.0
2019-04-17 22:03:59 +02:00
Ilya Chernikov
72736d78e4 Drop blocking transitive dependencies following for gradle subplugins
fixes scripting subplugin usage, since it requires some dependencies now
2019-04-17 22:03:59 +02:00
Ilya Chernikov
f688bc5140 Add diagnostics for plugin classpath problems 2019-04-17 22:03:59 +02:00
Ilya Chernikov
8a8de052a3 Fix JSR-223 and scripting samples dependencies 2019-04-17 22:03:59 +02:00
Ilya Chernikov
60b3fa3b07 Fix embeddable host test 2019-04-17 22:03:58 +02:00
Ilya Chernikov
090dadce3e Fix testdata - script extension hint is not generated anymore...
due to changes in the scripting initialization logic
2019-04-17 22:03:58 +02:00
Ilya Chernikov
64c3bcd9ab Drop refactored-out frontend.script module 2019-04-17 22:03:58 +02:00
Ilya Chernikov
a65dafc37d Move scripting support classes to the scripting compiler impl module 2019-04-17 22:03:58 +02:00
Ilya Chernikov
8df829a7cd Move scripting-compiler-impl definition to another package...
to continue merging with the refactoring with further scripting improvements
2019-04-17 22:03:58 +02:00
Ilya Chernikov
f71cc4e480 Drop long deprecated legacy script annotations and resolvers support 2019-04-17 22:03:58 +02:00
Ilya Chernikov
4f135a5fe5 Move REPL implementations to the scripting compiler impl module 2019-04-17 22:03:57 +02:00
Ilya Chernikov
199b32cad7 Merge scripting-impl to scripting-compiler-impl module...
to continue merging with the branch with further scripting refactorings
2019-04-17 22:03:57 +02:00
Ilya Chernikov
a82b386d81 Add a new module for scripting compilation infrastructure...
add embeddable variant as well
2019-04-17 22:03:57 +02:00
Ilya Chernikov
4625468de7 Expose project environment from core env, to allow usages of plugins...
before core env construction. Refactor script evaluation extension to
this scheme.
Plus some refactorings of the logic of script/repl evaluation in K2JVMCompiler
2019-04-17 22:03:57 +02:00
Igor Yakovlev
1178e94f50 Fixed intentions that used not valid PSI
Fixed ConvertToMemberIntention and ObjectLiteralToLambdaIntention that are used PSI after lazy block reparse.
2019-04-17 20:26:23 +03:00
Igor Yakovlev
1f29b42cd3 KtBlockExpression as lazy reparseable node (KT-13841)
Changed KtBlockExpression to support LazyReparseable behaviour
Added LazyKtBlockExpressionTest
Added new BlockWrapper delegations
2019-04-17 20:26:15 +03:00
Kirill Shmakov
e774f3fe77 Update iOS template for XCode 10.2
Info.plist generated by default does not provide required bundle id key.
Added separated Info.plist and its usage is explicitly specified.

See KOTLIN-CR-2913.
2019-04-17 18:54:45 +03:00
Mikhael Bogdanov
b70ff30dc3 Don't generate bridge flag for defaults in JVM IR backend 2019-04-17 14:53:30 +02:00
pyos
115b1c6b6e JVM_IR: force materialization of non-transparent block results 2019-04-17 14:14:21 +02:00
pyos
b1bba70e40 JVM_IR: elide static field initialization to default values 2019-04-17 14:14:21 +02:00
Mikhail Zarechenskiy
bcc8802014 [NI] Avoid constraints from expected type for effectively empty system
Expression will be checked against expected type later.

 Theoretically, this is not very good, but it aligns with the old
 inference, plus it helps avoiding multiple type mismatch diagnostics.
2019-04-17 12:55:12 +03:00
Mikhael Bogdanov
5dea14f4ce Reuse already created temp folder from UsefulTestCase 2019-04-17 11:22:19 +02:00
Mikhael Bogdanov
0d3f03a15a Support parallelization in another IDE tests 2019-04-17 11:22:18 +02:00
Mikhael Bogdanov
18f76c31ca Get rid of redundant UsefulTestCase 2019-04-17 11:22:18 +02:00
Mikhael Bogdanov
854b73b03c Specify test runners for IDE tests 2019-04-17 11:22:17 +02:00
Mikhael Bogdanov
aaf0fbdbd6 Fix debugger tests 2019-04-17 11:22:16 +02:00
Mikhael Bogdanov
51bc979edb Move parallelization utils to separate file, set test root for each process 2019-04-17 11:22:16 +02:00
Anton Bannykh
c6d177b467 JS: don't remove imports only used for fake overrides (KT-31007 fixed) 2019-04-17 11:41:47 +03:00
Anton Yalyshev
6113e66e7a removed forgotten and unnecessary code 2019-04-17 10:56:08 +03:00
Anton Yalyshev
f79517ee5d use new js gradle plugin and correct name of mpp plugin 2019-04-17 10:56:06 +03:00
Mikhael Bogdanov
3f1f335c47 Minor. Fix compilation 2019-04-17 09:50:49 +02:00
Mikhael Bogdanov
01dc66b53a Temporary workaround: use teamcity.build.tempDir instead of java.io.tmpdir
teamcity.build.tempDir is cleaned up between build executions,
 should be fixed soon on Teamcity side
2019-04-17 09:33:58 +02:00
Mikhail Zarechenskiy
e6e0b83184 [NI] Fix IDE-tests where integer types were used in unresolved calls
For example, test like CallExpression#testCallWithJavaClassReceiver

 #KT-31060 Fixed
2019-04-17 01:40:56 +03:00
Mikhail Zarechenskiy
705a8a2234 [NI] Disable SAM-conversions for Kotlin functions by default
#KT-30661 Fixed
2019-04-17 01:40:54 +03:00
Andrey Uskov
c6f29cbf38 Disable GradleInspectionTests in AndroidStudio 2019-04-17 00:17:41 +03:00
Andrey Uskov
364274ef90 Fix setting production-on-test flags in MPP projects
#KT-29854 Fixed
2019-04-17 00:17:21 +03:00
Leonid Startsev
1a0b7902c2 Create separate type arguments for writeSelf function, since it is static now.
Fixes kapt issue https://github.com/Kotlin/kotlinx.serialization/issues/429
2019-04-16 19:37:31 +03:00
Sergey Igushkin
bd1f95da04 Disable automatic JVM target 1.8 detection in Android projects, KT-31027
This is a soft revert of the fix for KT-21030 (commit ffbd0e8a).
The logic introduced for KT-21030 should now only run when a property
flag is provided, kotlin.setJvmTargetFromAndroidCompileOptions.

We can't set the JVM target to 1.8 automatically until an Android Gradle
plugin version appears that can correctly desugar the bytecode produced
by the Kotlin compiler.

So we disable the logic introduced in the fix for KT-26432
with the plan to enable it back and apply it conditionally once there is
an Android Gradle plugin version that processes the calls correctly.

Issue #KT-31027 Fixed
2019-04-16 19:02:44 +03:00
Mikhael Bogdanov
bec80dd27f Use Teamcity tmpdir to cleanUp it between executions 2019-04-16 15:37:07 +02:00
gcx11
164933a31e KT-22807: allow asynchronous testing in Kotlin/JS with QUnit 2019-04-16 14:17:22 +03:00
gcx11
b49c5bf74e KT-22807: allow asynchronous testing in Kotlin/JS with QUnit 2019-04-16 14:17:22 +03:00
Ilya Chernikov
d98b1dfa7e Fix testdata after adding main function to scripts 2019-04-16 11:55:24 +02:00
Ilya Chernikov
67ad3773de Implement main method generation in scripts and runnable jar saving
refactor necessary parts on the way
2019-04-16 11:55:23 +02:00
Ilya Chernikov
c896b4873b Rearrange scripting host classes, so the runner part is independent from the compiler 2019-04-16 11:55:23 +02:00
Ilya Chernikov
a6f0bd6677 Refactor jvm evaluation to make module operations cleaner and more robust
in addition:
- hide internal configuration keys
- add keys for flags controlling evaluation
- add initial module implementation for using scripts from a classpath
2019-04-16 11:55:22 +02:00
Ilya Chernikov
90444502a6 Extend evaluation API for easier passing of evaluation configuration
refactor helpers accordingly
2019-04-16 11:55:22 +02:00
Ilya Chernikov
fa58b41e43 Implement script evaluation configuration refinement 2019-04-16 11:55:21 +02:00
Ilya Chernikov
c51d4a4405 Implement simple "saving evaluators" to classes and to a jar 2019-04-16 11:55:20 +02:00
Mads Ager
a65f50bb00 JVM_IR: Generate java 8 parameter names when -java-parameters is passed.
The type mapper does not map enum parameters and outer this parameters
to the right parameter signature kinds so around half the tests
are still failing. Since a new type mapper is being worked
on I will not investigate that further right now.
2019-04-16 09:32:57 +02:00
Mikhail Zarechenskiy
e27f71c6f3 [NI] Add test for obsolete issue
#KT-30858 Obsolete
2019-04-16 10:32:12 +03:00
Mark Punzalan
9f4db04839 Change visibility of ForLoopsLowering from internal to public. 2019-04-16 09:31:40 +02:00
Vyacheslav Gerasimov
152d5a98e8 Build: Remove duplicate sam-with-receiver-compiler-plugin in libraries 2019-04-15 22:04:17 +03:00
Vyacheslav Gerasimov
f052f31c83 Build: Put gradle tooling model in kotlin plugin as separate jars
Those jars are loaded by gradle during import process
2019-04-15 22:04:17 +03:00
Vyacheslav Gerasimov
d6e2b5066b Build: Use sync task for copying idea plugin to the output
It will prevent files from previous builds remain in the target directory
Now we can remove `cleanArtifacts` kostyl from teamcity build
2019-04-15 22:04:17 +03:00
Vyacheslav Gerasimov
478208b070 Build: remove ideaPlugin helper
Plugin distribution building logic is now handled solely by idea-plugin project
2019-04-15 22:04:17 +03:00
Yan Zhulanow
7710942ec5 Kapt: Call next resolver in populateModuleExtraModels() (KT-30995) 2019-04-15 20:11:29 +03:00
Nikolay Krasko
27fd64ed42 Enable registration of CIDR bundle to prevent test failure in AS 3.5 (KT-26337) 2019-04-15 14:46:40 +03:00
Nikolay Krasko
1da51c118e Minor: fix too long strings 2019-04-15 14:46:40 +03:00
Nikolay Krasko
4691f6fed5 Don't read attributes in invalid files (EA-141259) 2019-04-15 14:46:39 +03:00
Nikolay Krasko
a3bd46858a Additional diagnostic added for bad class assert 2019-04-15 14:46:39 +03:00
Nikolay Krasko
28aa404356 Don't create intention for some bad psi (EA-141235) 2019-04-15 14:46:39 +03:00
Nikolay Krasko
bc258fa856 Fix RemoveUselessIsCheckFixForWhen - don't assert psi state in quick fixes (EA-141206) 2019-04-15 14:46:39 +03:00
Nikolay Krasko
55b2a7d051 Fix NPE in surround (EA-141193) 2019-04-15 14:46:39 +03:00
Ryan
916f871fd1 Wrong File name 'KotlinNativeTaretConfigurator.kt' 2019-04-15 17:40:15 +07:00
Nikolay Kasyanov
7d2041ed82 Fix fat dSYM Info.plist copying
Issue #KT-31008 Fixed
2019-04-15 17:34:32 +07:00
Yan Zhulanow
5825da8433 Fix binary compatibility with Android plugin (KT-30978) 2019-04-15 05:17:03 +03:00
Yan Zhulanow
0dfe122a40 Pill: Mark more projects as 'jps-compatible' in FULL variant 2019-04-15 05:17:03 +03:00
Yan Zhulanow
ae747196c2 Pill: Add kotlinVersion to the default JUnit configuration (for Gradle integration tests) 2019-04-15 05:17:03 +03:00
Yan Zhulanow
d5fa4f983e Pill: Resolve dependencies using ResolvedArtifact data 2019-04-15 05:17:03 +03:00
Svyatoslav Kuzmich
977d3ef840 [JS IR BE] New name generator 2019-04-13 14:19:36 +03:00
Svyatoslav Kuzmich
a16ca5e66c [JS IR BE] Static members lowering pass 2019-04-13 14:17:59 +03:00
Svyatoslav Kuzmich
38fc4b0c59 [JS IR BE] Hack irRuntime js function usage to compensate for implementation shortcomings 2019-04-13 14:17:59 +03:00
Svyatoslav Kuzmich
5c5d65bdb9 [JS IR BE] Lower dataClass hashCode and toString 2019-04-13 14:17:59 +03:00
Svyatoslav Kuzmich
e52ae38cf5 [JS IR BE] Minor: Use proper trow in js compiler test runtime 2019-04-13 14:17:59 +03:00
Svyatoslav Kuzmich
ce1ae417c2 [JS IR BE] Minor: don't use descriptors 2019-04-13 14:17:59 +03:00
Svyatoslav Kuzmich
7a6e245dba [JS] Minor: Use file path to V8 runner to show better error messages 2019-04-13 14:17:58 +03:00
Mikhail Zarechenskiy
1bc078769b Regenerate tests 2019-04-12 18:17:48 +03:00
Dmitriy Novozhilov
18f9272f56 [NI] Fix reporting smartcast diagnostics for intersection types
#KT-30826 Fixed
2019-04-12 17:36:59 +03:00
Dmitriy Novozhilov
ece3a0fe90 Minor: fix smartcast on var in IrUtils.kt 2019-04-12 17:36:59 +03:00
Roman Artemev
01878fe4b5 [JS IR BE] Remove unused lowering
* its functionality is merged into `FunctionInliner`
2019-04-12 15:23:28 +03:00
Roman Artemev
ece33f00a2 [IR] SuspendFunctionLowering refactoring
* distinguish common part which generates successor of `CoroutineImpl`
   into separate common lowering
 * merge it with K/N
2019-04-12 15:23:28 +03:00
Roman Artemev
bcc8f3e073 [IR] Move Ir utils from Kotlin/Native 2019-04-12 15:23:28 +03:00
Roman Artemev
cf9cce8a9b [JS IR BE] Fix type arguments stuff in Secondary Constructor lowering 2019-04-12 15:23:28 +03:00
Roman Artemev
e3699fbc31 [IR] CommonBackendContext and Symbols refactoring
* add [suspend]functionN factory factions
 * add `getContinuation` property
 * add `internalPackageName` property
 * fix lowerings
2019-04-12 15:23:28 +03:00
Mikhail Zarechenskiy
bdab7a88f6 [NI] Add test for obsolete issue
#KT-28658 Obsolete
2019-04-12 15:22:39 +03:00
Mikhael Bogdanov
d5cd49b2bf Don't delete Idea temporary folder on JVM shutdown
Before parallelization we don't delete Idea folders after test execution.
  Now there is problem with failing test on Teamcity.
  So try to keep folder undeleted (maybe there is some working daemon)
2019-04-12 14:13:53 +02:00
Ivan Gavrilovic
33e7a23208 Fix style in classpath snapshot class
Use filterTo instead of filter followed by forEach.
2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
c28ad116d0 Convert Windows-style path when calculating class internal name 2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
955a27ec77 Use MD5 when caching class ABI structure
This avoids Kotlin Gradle plugin dependency
on Guava, and it is a good hash function for this
use-case.

Also fix some formatting.
2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
e171199bf5 Do not track defined constants in source files
There is no need to track definitions of constants in sources for now.
References to constants are tracked in order to capture dependencies between types.
This ensures that any change to a type defining a constant (either from the
classpath or sources), will trigger reprocessing of the type that uses the
constant.
2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
929fca03fd Fixes to KAPT classpath change detection
1) Fix tests to use canonical path for comparison because Mac was failing
2) Update current classpath snapshot only with the missing entries from the previous one
3) Clean-up code and style
2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
7c78644eb9 Incremental KAPT - analyze classpath changes
Use artifact transforms to capture structure and
dependencies of classpath entries. In the KAPT task
this information is used to compare previous classpath
structure with the current one. Once changed classes are
detected, all classes that transitively depend on those
are identified, and that set is passed to KAPT invocation.

In order to avoid unrelated classpath changes, we record an
ABI snapshot of the classpath entry. This snapshot ignores
all private members, and @Metadata annotation.

 #KT-23880
2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
c85e21d43b Incremental KAPT - pass changed classpath entries
Pass computed list of changed classpath names to KAPT instead
of relying on the history files to be computed by stub generation.
Also, stop generating classpath history changes during the stub generation.

This commit does not compute the actual changed classpath entries,
and that will be done in the following commits.

 #KT-23880
2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
0c09f56118 Incremental KAPT - track constants usage
This commit adds support for tracking of used constants in
source files. For every constant used in a source file, class
that defines the constant and the constant name are tracked.

Value of the constant can be obtained using
annotation processing APIs, so if the constant value changes, a source file
using it has to be reprocessed.

 #KT-23880
2019-04-12 15:01:47 +03:00
pyos
57dca2ada5 JVM_IR: generate exception specifications 2019-04-12 13:00:54 +02:00
Ilya Matveev
f43579e9fc Update Kotlin/Native: 1.3-dev-9457 2019-04-12 17:53:34 +07:00
pyos
c7d7d903cd Add the IR version of CompileJavaAgainstKotlin tests
Only the WithoutJavac version for now, because the other one ignores
javac errors.
2019-04-12 12:43:37 +02:00
Dmitry Petrov
8a95da4a95 Minor: reformat DeepCopyIrTreeWithDescriptors.kt 2019-04-12 12:13:21 +03:00
Dmitry Petrov
bf2ab99b61 IR: IrSimpleTypeBuilder 2019-04-12 12:13:21 +03:00
Natalia Selezneva
2844d48f9f Refactoring: remove unused class 2019-04-12 11:42:56 +03:00
Natalia Selezneva
0da6d48d5e Minor: fix toString in KotlinSourceFilterScope 2019-04-12 11:42:56 +03:00
Natalia Selezneva
0c2e9f4d9a Scratch: prohobit closing scratch output content (KT-29642)
^KT-29642 Fixed
2019-04-12 11:42:56 +03:00
Natalia Selezneva
3eda40394a Impossible to run applications with long command lines on windows
^KT-29352 Fixed
2019-04-12 11:42:50 +03:00
Natalia Selezneva
dfa5f1f090 Refactoring: extract common parts for create command line for repl and scratch 2019-04-12 11:33:32 +03:00
Ting-Yuan Huang
0dd09ea7de JVM_IR: Lower IrGetEnumValue to this whenever possible.
The reference can be lowered to `this` if it is captured in the lexical
scope of the corresponding enum entry, and not used by the enum entry's
super constructor. Otherwise, it is lowered to
`GETFIELD SomeEnum.SomeEntry`.
2019-04-12 08:58:43 +02:00
Toshiaki Kameyama
faa6eacb25 Add "Replace Java static method with Kotlin top-level function" inspection
#KT-27411 Fixed
2019-04-12 11:35:46 +07:00
Rene Groeschke
6bef27e1e8 Forward stdout and stderr logger of out of process compiler through gradle logging
Issue #KT-30596 Fixed
2019-04-11 20:36:53 +03:00
Dereck Bridie
d86ffd3f34 Add inspection "Map replaceable with EnumMap" #KT-25439 Fixed 2019-04-11 19:01:02 +03:00
Toshiaki Kameyama
607325c6e5 Add "Round using roundToInt/roundToLong" quick fix
#KT-30389 Fixed
2019-04-11 18:58:05 +03:00
Burak Eregar
1455451601 Fix "Replace !! with if-then" inspection in receiver position
#KT-5412 Fixed
2019-04-11 18:58:05 +03:00
Jan Gerling
162de77b71 Add inspection to detect boxes *Range.start & endInclusive
These properties can be replaced with equivalent collections first & last.
#KT-15537 Fixed
2019-04-11 18:58:04 +03:00
Toshiaki Kameyama
401d8c2d70 Add braces: don't move EOL comment when if statement is single statement
#KT-28619 Fixed
2019-04-11 18:58:04 +03:00
Dmitriy Novozhilov
a92cf19641 Revert "[NI] Fix reporting smartcast diagnostics for intersection types"
This reverts commit 033d7262

That commit breaks bootstraping
2019-04-11 18:49:02 +03:00
Toshiaki Kameyama
849d18669b Replace assert boolean with assert equality: do not report when arguments type are not subtype
#KT-30761 Fixed
2019-04-11 18:36:50 +03:00
Toshiaki Kameyama
93d854362b Convert to anonymous function: do not name argument when lambda is Java method
#KT-30613 Fixed
2019-04-11 18:34:24 +03:00
Dmitriy Novozhilov
033d7262a2 [NI] Fix reporting smartcast diagnostics for intersection types
#KT-30826 Fixed
2019-04-11 18:10:59 +03:00
Toshiaki Kameyama
47b1ea7fa4 SimplifiableCallChainInspection: replace .sorted().first() with .min()
#KT-30725 Fixed
2019-04-11 18:07:06 +03:00
Toshiaki Kameyama
e4b10a156e SimplifiableCallChainInspection: fix tests 2019-04-11 18:07:06 +03:00
Alexander Gorshenev
ce6cda631d IrDelegatedProperty and IrDelegatedPropertyReference were missing from the serialization 2019-04-11 17:50:53 +03:00
Yan Zhulanow
e07821ca75 Debugger: Assume a class name from the coroutine metadata may be invalid (KT-30934) 2019-04-11 17:46:21 +03:00
Georgios Andrianakis
f11c5a335a KT-30343 Add new Quarkus preset to all-open compiler plugin 2019-04-11 17:46:21 +03:00
Yan Zhulanow
7ecd88aae3 AllOpen: Allow to specify presets in the Gradle plugin 2019-04-11 17:46:20 +03:00
Ting-Yuan Huang
4f64a52d33 Kapt: Fix NPE on JDK 10-11 (KT-26203)
Gradle worker throws NPE when the parameter to the runnable is null.
This patch works that around by passing URL spec as String instead of
File?
2019-04-11 17:46:19 +03:00
Yan Zhulanow
2314ca7a94 Debugger: Fix evaluation of lambda arguments (KT-10636) 2019-04-11 17:46:19 +03:00
Yan Zhulanow
fa5705cc68 Debugger: Fix missing read action in error reporting 2019-04-11 17:46:18 +03:00
Yan Zhulanow
4f6c8d2323 Fix type renderers for Kotlin (KT-18263, KT-18247) 2019-04-11 17:46:18 +03:00
Yan Zhulanow
15db1c8a8f Debugger: Do not validate line breakpoints for irrelevant classes (KT-30714) 2019-04-11 17:46:17 +03:00
Yan Zhulanow
2c5e8dab23 Debugger: Do not require a SourcePosition to exist 2019-04-11 17:46:16 +03:00
Yan Zhulanow
81a7f73db5 Refactoring: Inline getInvokePolicy() 2019-04-11 17:46:16 +03:00
Yan Zhulanow
b26f746514 Minor: Rename KotlinEvaluatorBuilder to match the superclass name 2019-04-11 17:46:15 +03:00
Yan Zhulanow
e31f195716 Minor: Remove unnecessary '!!' 2019-04-11 17:46:15 +03:00
Yan Zhulanow
fb3efd2d78 Debugger: Fix completion for synthetic '_field' extension properties (KT-23586) 2019-04-11 17:46:14 +03:00
Yan Zhulanow
0d04dc6f99 Debugger: Allow to touch experimental stuff from evaluator (KT-30216) 2019-04-11 17:46:13 +03:00
Yan Zhulanow
b7ea4ccc7e Debugger: Hide call-site 'this' in inline functions in Kotlin variables mode (KT-30610) 2019-04-11 17:46:13 +03:00
Yan Zhulanow
6dcaa64793 Pill: Fix platform source file location 2019-04-11 17:46:12 +03:00
Yan Zhulanow
9e99bca322 Pill: Fix artifact generation 2019-04-11 17:46:12 +03:00
Mikhael Bogdanov
5b49043939 Delete KotlinTestUtils.java.as32 and KtParsingTestCase.java.as32 2019-04-11 13:26:06 +02:00
Caleb Brinkman
c84c33cbd6 KT-30816 BasicJvmScriptEvaluator incorrect arg order
https://youtrack.jetbrains.com/issue/KT-30816

Change BasicJvmScriptEvaluator to pass constructor parameters in the
correct order, include tests for scripts w/ provided properties, and
implicit receiver, and both.
2019-04-11 10:17:55 +00:00
Dmitry Gridin
31ce6e1800 Minor: remove redundant qualifier names in QuickFixRegistrar 2019-04-11 15:13:17 +07:00
Dmitry Gridin
86a3daa302 Fix "Remove redundant qualifier name" for KtUserType with type parameter
#KT-30916 Fixed
2019-04-11 15:13:17 +07:00
Dmitry Gridin
f3faae7bb4 Fix 'Redundant qualifier name' warnings & refactoring in idea 2019-04-11 15:13:17 +07:00
Dmitry Gridin
646f325f57 Fix false positive "Redundant qualifier name" for functions with a receiver
#KT-30879 Fixed
2019-04-11 15:13:17 +07:00
Mark Punzalan
1b703448d3 Handle reversed() in ForLoopsLowering.
We get the info for the underlying progression and invert it. For
progressions whose last bound was open (e.g., `until` loop), the
reversed version will have an open first bound and so the induction
variable must be incremented first.

Also unified the way of extracting HeaderInfo out of changed calls
(e.g., `indices.reversed()`), and fixed declaration parents in
ForLoopsLowering.
2019-04-11 08:54:55 +02:00
Mikhael Bogdanov
3d1b6fb83c Minor. Fix AS32 compilation 2019-04-10 21:16:42 +02:00
pyos
b24690b35b Remove a redundant field 2019-04-10 20:51:46 +02:00
pyos
73bd683af1 Store InstructionAdapter, not ExpressionCodegen, in PromisedValue 2019-04-10 20:51:46 +02:00
pyos
96e2eb6fa1 Move PromisedValue to a separate file 2019-04-10 20:51:46 +02:00
pyos
e249c3c594 Return a stripped version of StackValue from ExpressionCodegen 2019-04-10 20:51:46 +02:00
pyos
c5f6be4282 Remove import of StackValue.* to better see use sites 2019-04-10 20:51:46 +02:00
pyos
a9bece9baa Allow intrinsics to be partial
Also, add an overridable invoke() method that skips the Callable step.
2019-04-10 20:51:46 +02:00
pyos
6e44b22340 Remove an unused non-IR IntrinsicMethod.toCallable 2019-04-10 20:51:46 +02:00
pyos
31eb542476 Return an immaterial value from Boolean.not 2019-04-10 20:51:46 +02:00
pyos
31c7183781 Return immaterial values from comparison intrinsics 2019-04-10 20:51:46 +02:00
pyos
9aff1cefb4 Make materialization of StackValues explicit 2019-04-10 20:51:46 +02:00
pyos
2356f72fd4 Make ExpressionCodegen a bit shorter in general 2019-04-10 20:51:46 +02:00
pyos
89cb31c387 Refactor try-catch covering computation 2019-04-10 20:51:46 +02:00
Mads Ager
a8e2893494 JVM_IR: Output EnclosingMethod attribute.
This works in many cases, however, it is incomplete since there
are cases where classes are extracted to top-level and therefore
reparented. Therefore, we lose the information about the function
class are nested inside.
2019-04-10 20:50:03 +02:00
Ilya Kirillov
8a94c66ce7 KT-29568, KT-26550: show "Convert Java File to Kotlin File" only for Java files
#KT-29568 fixed
#KT-26550 fixed
2019-04-10 21:29:18 +03:00
Ilya Kirillov
c7e08f9e5d New J2K: Fix existing test data 2019-04-10 21:29:18 +03:00
Ilya Kirillov
ae3920d535 New J2K: Finish DefaultArgumentsConversion 2019-04-10 21:29:18 +03:00
Ilya Kirillov
008e7a5add New J2K: do not use some keyword removing processings due to incorrect formatting after it 2019-04-10 21:29:18 +03:00
Ilya Kirillov
54d6fc846b New J2K: Add file range support for nullability analysis 2019-04-10 21:29:18 +03:00
Ilya Kirillov
33a42733f5 New J2K: make function parameters which is used as spread value argument to be not null 2019-04-10 21:29:18 +03:00
Ilya Kirillov
4844df2c6a New J2K: calculate for loop variable nullability 2019-04-10 21:29:18 +03:00
Ilya Kirillov
bd53772f5c New J2K: Fix explicit NPE cases in conversions 2019-04-10 21:29:17 +03:00
Ilya Kirillov
4c58016fa4 New J2K: remove SuppressWarnings annotation 2019-04-10 21:29:17 +03:00
Ilya Kirillov
ecf1ab7f04 New J2K: convert internal visibility to public one for annotation class members 2019-04-10 21:29:17 +03:00
Ilya Kirillov
f0b7f1e30b New J2K: Fix type parameters for array creation expressions 2019-04-10 21:29:17 +03:00
Ilya Kirillov
cb1b597b51 New J2K: save comments in data classed conversion 2019-04-10 21:29:17 +03:00
Ilya Kirillov
d4f6558e8a New J2K: Split convert file method in converters 2019-04-10 21:29:17 +03:00
Ilya Kirillov
af17db5f45 New J2K: handle more types of nullability annotations 2019-04-10 21:29:17 +03:00
Ilya Kirillov
d20e4bac1d New J2K: always print fully qualified names in printer to avoid name conflicts 2019-04-10 21:29:16 +03:00
Ilya Kirillov
aa53489e0b New J2K: Handle forced nullability correctly in nullability analysis 2019-04-10 21:29:16 +03:00
Ilya Kirillov
7d5793184f New J2K: Do not throw away incorrect code in switch statements 2019-04-10 21:29:16 +03:00
Ilya Kirillov
a98382a3cb New J2K: Fix wrong fqName for jvm annotations 2019-04-10 21:29:16 +03:00
Ilya Kirillov
e181c7f097 New J2K: save comments for annotation parameters 2019-04-10 21:29:16 +03:00
Ilya Kirillov
b430cfa953 New J2K: fix priority in PolyadicExpressionConversion 2019-04-10 21:29:16 +03:00
Ilya Kirillov
99d4accf2c New J2K: fix IDEA exceptions in post-processings 2019-04-10 21:29:16 +03:00
Ilya Kirillov
a5d64bf0b1 New J2K: Resolve symbols in correctly 2019-04-10 21:29:15 +03:00
Mikhael Bogdanov
d806320383 Rename tmpDirForReusableLibrary -> tmpDirForReusableFolder 2019-04-10 20:03:09 +02:00
Mikhael Bogdanov
8287e448d1 Support parallel execution of IDEA tests 2019-04-10 20:03:08 +02:00
pyos
8ae9e7a106 JVM_IR: unwrap fake overrides when computing property signatures 2019-04-10 19:21:37 +02:00
Vyacheslav Gerasimov
1b68b1d599 Build: embed jps artifact kotlin-plugin.jar into ideaPlugin 2019-04-10 17:54:07 +03:00
Vyacheslav Gerasimov
f71c2bf25e Build: Drop unused fromEmbeddedComponents helper 2019-04-10 17:54:07 +03:00
Vyacheslav Gerasimov
b741d393ed Build: make fatJar in JPS recursively using embedded configuration 2019-04-10 17:54:07 +03:00
Vyacheslav Gerasimov
adb896d74c Build: Introduce embedded configuration used for fatJars 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
a0adc97768 Build: Embed nj2k into kotlin-plugin.jar 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
da7a4a6d58 Build: Exclude trove4j from plugin since Idea already has it 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
c492c0c9f9 Build: Generate JPS artifacts for idea plugin from gradle configurations 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
92248d609f Build: Centralize build logic for kotlin-plugin in :prepare:idea-plugin 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
384f407af6 Minor: rename sideJars -> libraries 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
01aaaae5d0 Build: Pack markdown with dependencies (if any) to the ide plugin
Right now it doesn't have any dependencies
2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
909c6eef57 Build: Remove unnecessary stdlib dependencies in :prepare:idea-plugin 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
b68aee5ff8 Build: Fix missing coroutines-common in ide plugin
We shouldn't omit library dependencies while copying libraries to plugin
2019-04-10 17:54:05 +03:00
Vyacheslav Gerasimov
f4472fd68a Build: Depend on :prepare:idea-plugin via configuration in ultimate 2019-04-10 17:54:05 +03:00
Vyacheslav Gerasimov
d554b5aafa Build: Embed projects not published to maven into kotlin-plugin.jar 2019-04-10 17:54:05 +03:00
Vyacheslav Gerasimov
4ff1506161 Build: Use project dependency via configuration to build kotlin-plugin
Using configuration allows us to embed fat jars
Removed unnecessary shadowJar task, unnecessary unless relocation is required
2019-04-10 17:54:05 +03:00
victor.petukhov
3ba48f219c Remove debug code in the test for CheckerTestUtil class 2019-04-10 17:10:56 +03:00
Alexander Udalov
121f30d9cc Use IrType instead of KotlinType in SingleAbstractMethodLowering 2019-04-10 14:42:40 +03:00
Alexander Udalov
d257285c86 Load Java enums as final classes
In case Java enum has an abstract member, it has the ACC_ABSTRACT flag
set in the bytecode. However, we should still load it with final
modality to be consistent with Kotlin enums which are always considered
final

 #KT-23426 Fixed
2019-04-10 14:39:16 +03:00
Alexander Udalov
2f003ef545 Generate classes in MultifileClassCodegen exactly the same as in PackageCodegen
Two known issues with generateNonPartClassDeclarations that was here
before were the fact that we didn't sort sealed classes and its
subclasses which led to NoSuchMethodError (KT-27097), and the fact that
we didn't skip expect classes which led to incorrect duplicate JVM class
name diagnostic (KT-30843)

 #KT-27097 Fixed
 #KT-30843 Fixed
2019-04-10 14:39:16 +03:00
Alexey Tsvetkov
c8c630cecb Filter significant elements before creating ListRange
EA-134385
  EA-138187
2019-04-10 14:38:11 +03:00
Mikhail Glukhikh
568e831651 FIR: make rendering of type parameters similar to original Kotlin 2019-04-10 13:31:02 +03:00
Mikhail Glukhikh
0c334163ab FIR: add class type parameters to constructors & change their rendering 2019-04-10 13:31:01 +03:00
Toshiaki Kameyama
55a5ccac5c SimplifyAssertNotNullInspection: change level to INFORMATION
#KT-30876 Fixed
2019-04-10 16:06:37 +07:00
Georgy Bronnikov
43e87a1635 Merge pull request #2256 from pyos/flatten-phases
Flatten phase compositions
2019-04-10 10:43:14 +03:00
Dmitriy Dolovov
7beb49271f Fix: Navigation to inheritor class in non-JVM library source leads to opening stub
Issue #KT-30821 Fixed
2019-04-10 11:17:27 +07:00
Juan Chen
f489a47025 Fix SAM_WITH_RECEIVER_PLUGIN_NAME.
SAM_WITH_RECEIVER_PLUGIN_NAME in PathUtil was accidentally broken by
4c751cdd52 (diff-819dacd07c45ba85ba5459d8a09418daR34)
2019-04-09 15:19:00 +00:00
Ilmir Usmanov
00e952ab15 Introduce CHECK_TAIL_CALL_OPTIMIZATION directive
This directive generates TailCallOptimizationChecker in package helpers.
The check for tail call optimization is based on coroutine stack traces
bug (feature?): when tail call optimization hits, the continuation
object is not generated. Thus, there is no debug metadata for this
suspend function. Consequently, the coroutines stack trace does not
contain stack trace element for that function.
This check is performed by TailCallOptimizationChecker.

Since this is runtime check, unlike bytecode tests, it does not require
test data adjustments on each codegen or inliner change.

Since the check is based on debug metadata, which is JVM specific, there
is not support for other backends yet.
2019-04-09 18:01:21 +03:00
Mikhail Glukhikh
40441a18cc FIR2IR tests: do not try to dump & check external dependencies
(because both wrapped descriptors and FIR-based package descriptors
have no member scopes and aren't able to find class across module deps)
2019-04-09 15:36:18 +03:00
Mikhail Glukhikh
485035952a IR text tests: fix regex detection (like DUMP_EXTERNAL_CLASS)
Before this commit, DUMP_EXTERNAL_CLASS etc. didn't work on Windows
2019-04-09 15:36:18 +03:00
Mikhail Glukhikh
61ae365cfd IR text tests: remove some may-be-unnecessary dumps 2019-04-09 15:36:18 +03:00
Mikhail Glukhikh
02bdc826d5 IR text tests: throw an error when test fails to build an external dump 2019-04-09 15:36:16 +03:00
Vyacheslav Gerasimov
2937cb7237 Build: Fix Android Studio 3.5 unpacking, now published as tar.gz 2019-04-09 15:06:22 +03:00
Vyacheslav Gerasimov
83764c113f as35: Upgrade to AS 3.5 C10 2019-04-09 15:06:22 +03:00
Vyacheslav Gerasimov
8c9e1006f2 as35: Derive as35 bunch from 191 2019-04-09 15:06:22 +03:00
Steven Schäfer
26aeddf6d9 Remove broken KotlinType.toIrType function
The KotlinType.toIrType function sometimes produces unbound symbols
and was only used in IrIntrinsicFunction and SharedVariablesManager.

This change removes the broken function and changes SharedVariableManager
to use IrType consistently and IrIntrinsicFunction to use KotlinType
consistently.
2019-04-09 13:46:02 +02:00
pyos
048fd9fa25 Create a single instance of IrIntrinsicMethods per context.
This improves JVM_IR compilation times by 2%.
2019-04-09 11:56:58 +02:00
Dmitry Gridin
fceb5ee245 Fix AutoImport for import with alias
#KT-30663 Fixed
2019-04-09 16:34:26 +07:00
Andrey Uskov
a6ae1f2ba6 Fix import of compiler arguments in IDEA if source set dependencies
could not be resolved (e.g. due to misspelling in artifact name).
Fix works only in case when both new IDEA and gradle plugins are
used
#KT-28627 Fixed
2019-04-09 12:04:59 +03:00
Andrey Uskov
ed0dfaec36 Migrate GradleFacetImportingTest to testdata 2019-04-09 12:04:32 +03:00
Andrey Uskov
0f60daec25 Fix locking multiple threads during KotlinConfiguration check
#KT-29892 Fixed
2019-04-09 12:04:14 +03:00
Andrey Uskov
ff488bb871 Create android source root test added 2019-04-09 12:03:57 +03:00
Simon Ogorodnik
dc84e8fce5 Reformat PluginDeclarationProviderFactory 2019-04-09 11:53:54 +03:00
Simon Ogorodnik
f3268c99df EA-115037: Rebuild PerModulePackageCache on miss 2019-04-09 11:53:52 +03:00
Simon Ogorodnik
dd3dfedf81 KT-30688: Fix memory leak on module in disposer after onTooComplexChange
Remove explicit cache entry removal, use weak map instead

 #KT-30688 fixed
2019-04-09 11:53:22 +03:00
Nikolay Krasko
bfda9cc57b Fix inspection Integer.toString() -> int.toString() reports 2019-04-09 11:47:30 +03:00
Nikolay Krasko
a9beb04cb7 Fix RemoveExpressionTargetFix and don't remove the whole annotation (KT-25574) 2019-04-09 11:47:29 +03:00
Nikolay Krasko
ecda8cd889 Remove resolve in ChangeRetentionToSourceFix and RemoveExpressionTargetFix (KT-25574) 2019-04-09 11:47:29 +03:00
Toshiaki Kameyama
58b6360388 Add quick fixes for RESTRICTED_RETENTION_FOR_EXPRESSION_ANNOTATION (KT-25574) 2019-04-09 11:47:29 +03:00
pyos
f37d171a52 Flatten phase compositions.
This makes stack traces and flame graphs significantly more readable.
2019-04-09 10:15:45 +02:00
pyos
fb0261bfc1 Remove JvmDescriptorWithExtraFlags and fix syntheticness
(of fields and classes, it is already correct for methods).
2019-04-09 08:18:14 +02:00
pyos
3fdcf8376f Add IR equivalent of the WriteFlags test 2019-04-09 08:11:29 +02:00
Dmitriy Dolovov
f2d513a39c Fix: Unstable IDE navigation to expect/actual symbols in stdlib
Issue #KT-30790 Fixed
2019-04-09 10:24:58 +07:00
Anton Bannykh
9b5c8bbac9 JS: switch off inlined local declaration deduplication (KT-30877 fixed)
(cherry picked from commit 681e8dd968)
2019-04-08 21:22:43 +03:00
Ilmir Usmanov
2dee506022 Generate suspend markers for inline and crossinline parameters
if they are not inlined, but directly called.
Previously, all inline and crossinline lambda calls were treated by
codegen as if they are always going to be inlined. However, this is not
always the case.

Note, that we cannot generate these markers during codegen, since we
can inline code with no suspension points, but the whole inlined code
will become one giant suspension point. This, of course, breaks
tail-call optimization and, hence, slows down cold streams.

Because of that, we generate these markers, when we are sure, that they
are not going to be inlined. The only place, in which we know that, is
the inliner. During inlining of the inline function, we check, whether
the parameter is inline or crossinline and whether it is not an inline
lambda. If these checks pass, we generate the markers. Noinline
parameters are already covered by the codegen.
 #KT-30706 Fixed
 #KT-26925 Fixed
 #KT-26418 Fixed
2019-04-08 17:28:37 +03:00
Mikhael Bogdanov
eb1bfac83f Minor. Fix test data 2019-04-08 16:23:00 +02:00
Dereck Bridie
7da52b2df5 Fix KT-13962 with kotlin.collections constructors 2019-04-08 14:53:27 +03:00
Mikhael Bogdanov
10e3dfa980 Support anonymous function as inline parameters 2019-04-08 13:10:25 +02:00
Mikhael Bogdanov
2a3a9bb5fc Support properties reificaton 2019-04-08 13:10:25 +02:00
Mikhael Bogdanov
944c200a5d Initial support of try as expression in JVM IR 2019-04-08 13:10:24 +02:00
Mikhael Bogdanov
30aeb8dc0a Support finally blocks in non-local returns 2019-04-08 13:10:23 +02:00
Mikhael Bogdanov
4c59d161d4 Support basic reification in IR 2019-04-08 13:10:22 +02:00
Mikhael Bogdanov
02cb1d7dcc Change return target in $default function on transformation 2019-04-08 13:10:22 +02:00
Mikhael Bogdanov
694a7c329d Initial support of non-local return in IR 2019-04-08 13:10:21 +02:00
Mikhael Bogdanov
3f9154a4a1 Remove declaration that would be inlined 2019-04-08 13:10:20 +02:00
Alexander Udalov
dd2c7aff6e Implement IrType.equals/hashCode via isEqualTo/toHashCode 2019-04-08 13:06:01 +03:00
Alexander Udalov
8cce5dc8de Fix missing return for checkViaDescriptors in FqNameEqualityChecker 2019-04-08 13:06:01 +03:00
Alexander Udalov
bdfe82cfff Fix incorrect condition in CheckIrElementVisitor.ensureTypeIs
Apparently it has no effect on behavior of tests because no backend uses
the checkTypes mode of IR validation
2019-04-08 13:06:01 +03:00
Sergey Rostov
26a9b2b251 JPS Build: fix kotlin-main-kts-test dependency to kotlin-main-kts 2019-04-08 12:47:25 +03:00
Alexander Udalov
5bafd4008f Use correct class loader to load .kotlin_builtins in reflection
#KT-30749 Fixed
2019-04-08 12:43:53 +03:00
Toshiaki Kameyama
3de723b8d0 SimplifiableCallChainInspection: replace .sorted().firstOrNull() with .min()
#KT-30725 Fixed
2019-04-08 11:07:24 +03:00
Sergey Rostov
bdac47369c Gradle, Native: run tests with proper Test task, process test results
#KT-30529 Fixed
2019-04-08 09:38:33 +03:00
Sergey Rostov
d5e434e95b Gradle: move JS and Android platform specific files to targets package: add suppress PackageDirectoryMismatch 2019-04-08 09:38:33 +03:00
Sergey Rostov
9129c08fac Gradle: move JS and Android platform specific files to targets package 2019-04-08 09:38:33 +03:00
Sergey Rostov
09611a612a Gradle, Native: move all Native-related files to targets.native directory: add suppress PackageDirectoryMismatch 2019-04-08 09:38:33 +03:00
Sergey Rostov
1d1a560e32 Gradle, Native: move all Native-related files to targets.native directory 2019-04-08 09:38:33 +03:00
Dmitry Gridin
b45aeda711 Fix caret after "Introduce import alias" if invoke in import directive
#KT-30833 Fixed
2019-04-08 11:25:32 +07:00
Nikolay Krasko
814aca9c8b Single indent for declarations on adding new line (KT-26954)
#KT-26954 Fixed
2019-04-06 20:44:06 +03:00
Nikolay Krasko
e4cc94e0a8 Check bad root presence before checking platform (KT-30442)
Detect platform based on libraries content is a long operation and should
not be called from `isConversionNeeded`. Do other checks before it.
2019-04-06 20:44:05 +03:00
Nikolay Krasko
03c6e23448 Remove platform comparisons based on string dictionary order (KT-30356)
Comparison was changed in 641a9a7153 (diff-0895a6eaf69b9fd4d43f83db9889d103R109)

 #KT-30356 Fixed
2019-04-06 20:44:05 +03:00
Nikolay Krasko
53ab1e7c99 Minor: clean warnings in folding tests 2019-04-06 20:44:05 +03:00
Nikolay Krasko
aea33a3214 Move resolve during import optimizing to background thread (KT-27106, KT-30018)
#KT-27106 Fixed
2019-04-06 20:44:05 +03:00
Vyacheslav Gerasimov
25636c9c39 Build: Compile ultimate with kotlin-stdlib-jdk8 2019-04-05 20:37:19 +03:00
Igor Yakovlev
da4d8a8c90 Parser invalid error advancing for postfix type parameters list #KT-30835 Fixed 2019-04-05 19:50:42 +03:00
Austaon
0e716fd528 KT 13962: Intention to replace Java collection constructor calls with function calls from stdlib (ArrayList() → arrayListOf()) 2019-04-05 18:19:26 +03:00
Dmitry Petrov
bbeb65905e KT-30780 Fix erased inline class context in class context hierarchy
In SourceCompilerForInline we could enter ERASED_INLINE_CLASS context
from containing declaration context. That broke codegen context
hierarchy invariants assumed in accessor generation.
2019-04-05 17:27:04 +03:00
Mikhail Glukhikh
e1915ec99e FIR2IR: add bunch file for 181 to avoid compilation problems 2019-04-05 16:18:59 +03:00
Mikhail Glukhikh
ee28467a47 Raw FIR: add work-around for deeply nested String interpolations
Controversial (but prevents total kotlin test failing)
Related to KT-29222
2019-04-05 16:18:58 +03:00
Mikhail Glukhikh
881073b1c9 Add basic FIR -> IR converter with a set of text tests
Tests duplicate IrTextTestCaseGenerated
#KT-24065 Fixed
2019-04-05 16:18:58 +03:00
Mikhail Glukhikh
92adfd8946 Add stub implementation of compileTimeInitializer in wrapped descriptors 2019-04-05 16:18:58 +03:00
Mikhail Glukhikh
d736a7da6b Raw FIR: get rid of array gets, use array sets only for modifications
(a[b] += c etc. cannot be replaced with get/set calls easily)
2019-04-05 16:18:58 +03:00
Mikhail Glukhikh
a0c4e2f05f Raw FIR: convert in to contains and !in to contains.not 2019-04-05 16:18:58 +03:00
Mikhail Glukhikh
4482a8f794 Remove FirOperation.RANGE which was effectively unused
Associated KtTokens.RANGE is included into convention call table
2019-04-05 16:18:58 +03:00
Mikhail Glukhikh
007edcb4a4 Raw FIR: generate convention / infix binary expressions with receiver 2019-04-05 16:18:57 +03:00
Dmitry Gridin
4f8e29ad23 Fix import quickfix if import has import alias
#KT-30669 Fixed
 #KT-7380 Fixed
 #KT-30663 Fixed
2019-04-05 20:01:11 +07:00
Dmitry Gridin
6caf6858fa Minor: refactoring KotlinAddImportAction 2019-04-05 20:01:11 +07:00
Dmitriy Novozhilov
d8cbeb8d15 Add regression test for SPREAD_OF_NULLABLE diagnostic
#KT-30808 Fixed
2019-04-05 14:17:34 +03:00
Mikhail Zarechenskiy
ff2ce316e1 [NI] Resolve callable reference eagerly at the end of resolution parts
This way we'll resolve less callable references later as we'll have
 more constraints to clip wrong candidates for callable references
2019-04-05 13:16:58 +03:00
Mikhail Zarechenskiy
c3bc6ef2fa [NI] Make callable references more robust to overloads of outer call
#KT-30676 Fixed
2019-04-05 13:16:54 +03:00
Mikhail Zarechenskiy
20a7f387bf [NI] Resolve callable reference eagerly if there is only one candidate
#KT-30737 Fixed
2019-04-05 13:15:57 +03:00
Dmitriy Novozhilov
aa96a05469 [NI] Fix initial data flow info for analyzing lambdas
#KT-30734 Fixed
2019-04-05 12:52:29 +03:00
Anton Bannykh
b7ffdb9fde JS IR: support kotlin.test 2019-04-05 12:30:21 +03:00
Anton Bannykh
b0ed688986 Fix argument passing for smartJavaExec 2019-04-05 12:30:21 +03:00
Anton Bannykh
d04a0246db make smartJavaExec composable with NoDebugJavaExec 2019-04-05 12:30:21 +03:00
Anton Bannykh
8174d6c035 JS IR: eliminate quickIrTest 2019-04-05 12:30:21 +03:00
Anton Bannykh
ad4c2144a7 JS IR: moved klib creation to the serialization_test module 2019-04-05 12:30:20 +03:00
Anton Bannykh
0f183ed662 JS IR: split compilation and deserialization 2019-04-05 12:30:20 +03:00
Anton Bannykh
08785b7cea JS IR: split serialization into a separate module 2019-04-05 12:30:20 +03:00
Anton Bannykh
42f576f033 IR: move serialization to serialization.common 2019-04-05 12:30:20 +03:00
Steven Schäfer
59c5d8bdb8 Add an implicit cast to Unit in returns from a constructor. 2019-04-05 12:05:53 +03:00
Vasily Levchenko
826f55ecb4 Merge pull request #2240 from JetBrains/rr/minamoto/ir-IrFunctionInlineBodyImpl
[IR] introduced additional field 'inlineFunctionSymbol' to IrReturnableBlock
2019-04-05 11:49:08 +03:00
Vasily Levchenko
1ebf7faedc [IR][refactoring] g/c IrReturnableBlock[Impl]
- drop calculatable from 'inlineFunctionSymbol' fields: 'sourceFileSymbol' and 'sourceFileName' and
replace then with extension values

- drop unused constructors.
2019-04-05 11:47:45 +03:00
pyos
05e09df683 Throw a clearer error on unexpected IR nodes in expressions 2019-04-04 21:39:49 +02:00
pyos
c3a74ded0e Make isDefaultValueForType shorter 2019-04-04 21:39:47 +02:00
pyos
fb55e34b8f Merge generateBreakOrContinueExpression and doFinallyOnReturn 2019-04-04 21:39:46 +02:00
pyos
c0af91b6d1 Inline markFunctionLineNumber 2019-04-04 21:11:39 +02:00
pyos
9f28b2042a Move common declarations up 2019-04-04 21:11:37 +02:00
pyos
a7dbd08f45 Inline genFinallyBlockOrGoto 2019-04-04 21:11:35 +02:00
pyos
6690e50dd2 Remove direct block stack manipulation 2019-04-04 21:11:33 +02:00
pyos
57450912fb Remove a couple unused classes, inline a short method 2019-04-04 21:11:31 +02:00
Toshiaki Kameyama
bcfab83d1c Add "Constructor has non-null self reference parameter" inspection (KT-29799)
#KT-29799 Fixed
2019-04-04 17:25:37 +03:00
Zalim Bashorov
6634d7ab15 [psi2ir] Minor: dynamicWithImplicitCast.kt -> dynamicWithSmartCast.kt 2019-04-04 17:14:04 +03:00
Zalim Bashorov
57a6b53780 [psi2ir] Add tests for implicit casts "to" and "from" dynamic type 2019-04-04 17:14:03 +03:00
Toshiaki Kameyama
dffcfdc02f Add inspection to replace not-null assertion with elvis return
#KT-30381 Fixed
2019-04-04 20:29:17 +07:00
Vasily Levchenko
6f9feacf6e [IR] introduced additional field 'inlineFunctionSymbol' to IrReturnableBlock
This change let backend calculate and bind right function to the code block on generation debug information
e.g. for Kotlin/Native backend this let codegnerator to produce DILocation(..., inlinedAt:..) with correct value
for inlinedAt parameter, thus signifiacntly improve behaviour of debugger.
2019-04-04 16:14:34 +03:00
Dmitry Petrov
1c0c01725b Preserve original for constructors of LazySubstitutingClassDescriptor
We would like DeclarationDescriptor.getOriginal() to always point to a
(preferably unique) unsubstituted descriptors for the given possibly
substituted descriptor. In case of LazySubstitutingClassDescriptor
(which can be observed for nested generic Java classes), this invariant
was broken, because 'getOriginal()' for constructors of substituted
class returned a copy created for this particular substituted class.
2019-04-04 14:42:23 +03:00
Ilya Kirillov
966daf8341 Regenerate NullabilityAnalysisTestGenerated 2019-04-04 14:05:05 +03:00
Alexander Podkhalyuzin
1fbbd71085 Fixed DSL Marker icon
#KT-30470 Fixed
2019-04-04 13:59:49 +03:00
Dmitriy Dolovov
ea3f4ad47f Attach K/N stdlib sources on MPP project import
Issue #KT-30635:fixed
2019-04-04 17:34:42 +07:00
Dmitriy Dolovov
f9d9d7f737 Keep K/N stdlib upper than platform libraries in IDEA UI 2019-04-04 17:34:24 +07:00
Natalia Selezneva
97531c8ec2 Do not include buildSrc module dependencies into script dependencies (KT-30295)
^KT-30295 Fixed
2019-04-04 11:06:14 +03:00
Natalia Selezneva
aa99d8fcbe Rename extension point for additional dependencies of scripts 2019-04-04 11:06:14 +03:00
pyos
4c01614136 Avoid leaking SamConstructorDescriptors from psi2ir 2019-04-04 09:45:00 +02:00
pyos
23d742237f Add tests for merging SAM wrappers and references 2019-04-04 09:45:00 +02:00
pyos
e05c151a73 Remove explicit mention of an internal name from a test 2019-04-04 09:45:00 +02:00
pyos
ee59530f71 Fix casts of the null constant to SAM types 2019-04-04 09:45:00 +02:00
pyos
f47d9d54c0 psi2ir: add test for SAM-conversion of operator arguments 2019-04-04 09:45:00 +02:00
pyos
39c8939241 JVM_IR: optimize SAM conversion of lambda literals
Instead of materializing an invokable object and storing it in an
instance of the implementation, create a specialized class that calls
the lambda directly, resulting in one less nesting layer and one less
class.
2019-04-04 09:45:00 +02:00
pyos
b74586f84e JVM_IR: implement single-abstract-method conversions 2019-04-04 09:45:00 +02:00
Mikhail Glukhikh
141e8d553e FIR body resolve: support variable assignments 2019-04-04 10:31:15 +03:00
Mikhail Glukhikh
c56b471b71 FIR body resolve: handle constant types more precisely 2019-04-04 10:31:13 +03:00
Mikhail Glukhikh
cc2a5cfc06 FIR body resolve: calculate type even for resolved references 2019-04-04 10:31:12 +03:00
Mikhail Glukhikh
d7f0392f90 FIR body resolve: fix value parameter expected type 2019-04-04 10:31:11 +03:00
Mikhail Glukhikh
8a6c9a6aec FIR deserializer: read nullability & add constructors 2019-04-04 10:31:09 +03:00
Mikhail Glukhikh
6e9d78d431 FIR structure: make implicit built-in types resolved 2019-04-04 10:31:08 +03:00
Mikhail Glukhikh
bf0190d96c FIR structure: reuse StandardClassIds in implicit built-in typeRef 2019-04-04 10:31:07 +03:00
Mikhail Glukhikh
b3cf3c6579 FIR structure: include calleeReference into FirDelegatedConstructorCall 2019-04-04 10:31:05 +03:00
Mikhail Glukhikh
63d3100122 FIR structure: FirClassLikeDeclaration is now FirStatement
Done to support (in theory) local type aliases
2019-04-04 10:31:04 +03:00
Mikhail Glukhikh
4213a4c7e2 FIR Java: reuse StandardClassIds 2019-04-04 10:31:02 +03:00
Mikhail Glukhikh
a0fa9e6b48 Raw FIR: make component call a function call, its argument -> receiver 2019-04-04 10:31:01 +03:00
Mikhail Glukhikh
30697787a0 Raw FIR: set "implicit boolean" result type for some operator calls 2019-04-04 10:31:00 +03:00
Mikhail Glukhikh
eb1aaad41b Raw FIR: generate Unit at the end of empty lambda 2019-04-04 10:30:52 +03:00
Mikhail Glukhikh
eb86c9e540 FIR: get rid of ANDAND / OROR by replacing with when 2019-04-04 10:30:49 +03:00
Mikhail Glukhikh
395651a21e Raw FIR: swap branches in when for elvis and bang-bang 2019-04-04 10:30:48 +03:00
Mikhail Glukhikh
f77ba2dd3e Raw FIR: make object/sealed/enum constructor visibility private 2019-04-04 10:30:47 +03:00
Mikhail Glukhikh
057156f323 Raw FIR builder: cleanup code 2019-04-04 10:30:45 +03:00
Mikhail Glukhikh
33729aaf9b Raw FIR: add Any/Enum/Annotation to supertypes iff no supertypes exists 2019-04-04 10:30:44 +03:00
Mikhail Glukhikh
7dd89a48f0 Raw FIR: introduce FirConstructor.isPrimary 2019-04-04 10:30:43 +03:00
Mikhail Glukhikh
61c2e4e590 Raw FIR: handle local visibility for functions & classes 2019-04-04 10:30:41 +03:00
Mikhail Glukhikh
4187ea1f86 Raw FIR: add initializers to primary constructor properties 2019-04-04 10:30:40 +03:00
Ilya Matveev
1f2d31dffb Update Kotlin/Native: 1.3-dev-9301 2019-04-04 14:24:09 +07:00
Mark Punzalan
a0940b1342 Use stricter assertions in for-loop bytecode text tests. 2019-04-04 09:07:19 +02:00
Mark Punzalan
dd65e0876f Simplify loop building by encoding open/closed bound information in the
HeaderInfo object, and modifying the operator in the loop condition.

The "additional emptiness condition" is no longer necessary with this.
The open/closed property was removed from HeaderInfo in an earlier
commit, but bringing it back in to simplify the loop building makes
more sense.

Also expanded tests for evaluation order of range bounds.
2019-04-04 09:07:19 +02:00
Mark Punzalan
7680e7fd56 Use while loop for progressions that cannot overflow (instead of
do-while with enclosing "not empty" check).

Also do not add additional "not empty" condition for `until` loops when
the given bound is a constant != MIN_VALUE.
2019-04-04 09:07:19 +02:00
Mark Punzalan
ba0e016c4e Add bytecode tests for array for-loop iteration. 2019-04-04 09:07:19 +02:00
Mark Punzalan
7afe121238 Eliminated the redundant ForLoopHeader.needsEmptinessCheck property, cast "bound" to progression type if necessary, fixed variable declaration order. 2019-04-04 09:07:19 +02:00
Mark Punzalan
6b83c04472 Cast step expression to the correct Number type, if necessary. 2019-04-04 09:07:19 +02:00
Mark Punzalan
f6e74079bb Cleanup ForLoopsLowering: Add more comments, remove descriptor usages,
make code style consistent.
2019-04-04 09:07:19 +02:00
Mark Punzalan
ea9572ad28 Add DefaultProgressionHandler that handles for-loops over
non-specialized progressions, including "step" progressions.

DefaultProgressionHandler uses the "first/last/step" properties of
the progression when building the loop header.
2019-04-04 09:07:19 +02:00
Mark Punzalan
301ac90770 Remove "bound" and "closed" properties from HeaderInfo and
ForLoopHeader, instead assuming that all ranges are closed and that the
"last" property is already property calculated.

This means the HeaderInfo.last for arrays, "indices" and "until"
progressions are decremented from the bound. This simplifies the loop
construction and moves the work to the handlers. This will also simplify
the handling of "reversed()" in the future since we don't need to
consider the case where the lower bound is open.
2019-04-04 09:07:19 +02:00
Mark Punzalan
93deff5e57 Rename "lowerBound/upperBound" to "first/last" and move loopVariable to
ForLoopHeader base class.

These terms are less loaded and less confusing, especially with "downTo"
progressions, and once we start handling "reversed()".
2019-04-04 09:07:19 +02:00
Mark Punzalan
8e1be5424f Handle for (i in a until Int.MIN_VALUE) corner case by adding
an additional "not empty" condition produced by the UntilHandler.
2019-04-04 09:07:19 +02:00
Mark Punzalan
7b153b2b68 Move building of "not empty" condition (used to check if loop is empty)
from ForLoopsLowering into ForLoopHeader, reducing the building logic in
ForLoopsLowering.
2019-04-04 09:07:19 +02:00
Mark Punzalan
a2e3d3635e Replace HeaderInfo.increasing property with a "direction" enum property,
which is computed based on the value of "step" (if possible).
2019-04-04 09:07:19 +02:00
Mark Punzalan
ed9ede8936 Make HeaderInfo.step not nullable and have handlers explicitly provide
the step expression.

The semantics of "step" are now clearer: It will no longer be negated
based on the "increasing" property; if the progression is decreasing
(i.e., for "downTo" progressions), then it must be negative. The
"increasing" property is still used when building the emptiness
condition.
2019-04-04 09:07:19 +02:00
Mark Punzalan
40dbf8a3fd Move elementType() and getProgressionType() extension methods into
ProgressionType.
2019-04-04 09:07:19 +02:00
Mark Punzalan
409d99a52a Add ForLoopsLowering to JVM phases.
Also deleted StepHandler. Since the HeaderInfo.needLastCalculation is
only set to true for handling step progressions, deleted that property
and all associated logic around it.
2019-04-04 09:07:19 +02:00
Mark Punzalan
7276b7e66a Fix compilation errors after rebasing. 2019-04-04 09:07:19 +02:00
Mark Punzalan
656f6855bb Minimal porting of ForLoopsLowering from kotlin-native.
Diffs resulting from the port:
https://github.com/punzki/kotlin-native/compare/master...punzki:for-loop-diff

When ForLoopsLowering is added to the JVM lowering phases, this causes some of the forLoop bytecode tests to pass, and many still fail due to differences in behavior compared to non-IR backend:
- Generated conditions for lowered loop
- Generated temporary variables
- Supported iterables (e.g., withIndex(), CharSequences)
- Means of incrementing induction variable

The phase will be added once more TODOs are resolved and it is more functionally complete, to prevent breaking for loops.
2019-04-04 09:07:19 +02:00
Toshiaki Kameyama
f861b10798 Add "Add getter/setter" quick fix for uninitialized property
#KT-30078 Fixed
2019-04-04 11:10:39 +07:00
Austaon
efcc6f0967 Add inspection for Integer.toString(i) to i.toString() (KT-12721) 2019-04-03 19:12:54 +03:00
Ilya Gorbunov
dde2b30601 Clarify wording in Random.nextUInt docs: missed extra 'not' 2019-04-03 16:31:03 +03:00
Yan Zhulanow
69353ee9bf Async stack traces: fix compatibility with kotlin-stdlib 1.2.70 (KT-30611) 2019-04-03 15:46:33 +03:00
Yan Zhulanow
ef06009669 191: Fix test running for common modules in MPP/Gradle (KT-29908) 2019-04-03 15:46:32 +03:00
Yan Zhulanow
ee42c1211a 191: Update target IntelliJ SDK version to 191.6183 2019-04-03 15:46:32 +03:00
Ilya Kirillov
b7e6dc4f8b Fix as32 test generation 2019-04-03 14:48:54 +03:00
Sergey Igushkin
e23b74792d Fix Java sources inspected too early in Android variants (KT-30735)
The Android Gradle plugin can set Java sources after a variant is
created, similar to AP options. We need to inspect the Java sources
only from at `afterEvaluate` time.

Issue #KT-30735 Fixed
2019-04-03 14:45:52 +03:00
Ilya Matveev
5ab9723ee1 Configure CocoaPods plugin to be published at the plugin portal 2019-04-03 18:07:49 +07:00
Alexander Podkhalyuzin
a7b43a6bb7 Import only classes when setting add unambiguous on the fly is enabled
#KT-30514 Fixed
2019-04-03 13:51:21 +03:00
Mikhael Bogdanov
4450641321 Merge inlineCodegenUtils2.kt into inlineCodegenUtils.kt 2019-04-03 11:43:46 +02:00
Mikhael Bogdanov
be954c6e62 Rename LabelOwner into ReturnLabelOwner 2019-04-03 11:43:45 +02:00
Mikhael Bogdanov
20adce165f Convert CapturedParamDesc.java into Kotlin 2019-04-03 11:39:59 +02:00
Mikhael Bogdanov
a19cc8efa6 Rename .java to .kt 2019-04-03 11:39:58 +02:00
Mikhael Bogdanov
c6fb8ba08e Convert CapturedParamInfo.java into Kotlin 2019-04-03 11:39:58 +02:00
Mikhael Bogdanov
79c97ba21d Rename .java to .kt 2019-04-03 11:39:57 +02:00
Mikhael Bogdanov
d8336bd0a1 Convert ParameterInfo.java into Kotlin 2019-04-03 11:39:56 +02:00
Mikhael Bogdanov
53dd1dd76d Rename .java to .kt 2019-04-03 11:39:55 +02:00
Ilya Kirillov
243fd2f4f1 New J2K: Move nullability analysis tests to nullabilityAnalysis dir 2019-04-03 11:24:30 +03:00
Ilya Kirillov
854fc6a7d7 New J2K: Handle correctly modifiers of class members when there is no parent class in the AST 2019-04-03 11:24:29 +03:00
Ilya Kirillov
c05a01e12b New J2K: Fix NPE if no constructor was found in ImplicitInitializerConversion 2019-04-03 11:24:28 +03:00
Ilya Kirillov
6182edadfd New J2K: Move imports into JKImportList 2019-04-03 11:24:27 +03:00
Ilya Kirillov
86fa54fae9 New J2K: Convert Java method to Kotlin function independently of containing class 2019-04-03 11:24:26 +03:00
Ilya Kirillov
f28f340840 New J2K: Wrap ast to a JKTreeRoot 2019-04-03 11:24:26 +03:00
Ilya Kirillov
ddee0deeca New J2K: Move println conversion functionality to BuiltinMembersConversion 2019-04-03 11:24:25 +03:00
Ilya Kirillov
ce666295f7 New J2K: Fix npe when converting java member without parent 2019-04-03 11:24:24 +03:00
Ilya Kirillov
088241313a New J2K: Remove unused JKJavaDefaultNewExpressionImpl 2019-04-03 11:24:23 +03:00
Ilya Kirillov
50a4b9b2b5 New J2K: Remove debug println 2019-04-03 11:24:22 +03:00
Ilya Kirillov
31aea1e5e9 New J2K: Fix converting on copy-past 2019-04-03 11:24:22 +03:00
Ilya Kirillov
5ab9d6bba8 New J2K: Fix collected import inserting in J2K 2019-04-03 11:24:21 +03:00
Ilya Kirillov
1dd0a42298 New J2K: Escape name of declaration in convert data class 2019-04-03 11:24:20 +03:00
Ilya Kirillov
b411e8e18e New J2K: Split old j2k and new j2k tests 2019-04-03 11:24:19 +03:00
Ilya Kirillov
02a206bf7c New J2K: Fix converters spliting 2019-04-03 11:24:18 +03:00
Ilya Kirillov
db2ad96f00 New J2K: Fix ParameterModificationInMethodCallsConversion in a case of varargs parameter 2019-04-03 11:24:18 +03:00
Ilya Kirillov
8cec43fda3 New J2K: Assume KtConstructor as function for symbol provider 2019-04-03 11:24:17 +03:00
Ilya Kirillov
6d621a86d2 New J2K: Convert java.util.Objects.equals call to equals binary operator expression 2019-04-03 11:24:16 +03:00
Ilya Kirillov
a973f9b670 New J2K: Add support of package qualifiers for expressions 2019-04-03 11:24:16 +03:00
Ilya Kirillov
9fb6cfc26e New J2K: Collect imports to ImportStorage, not to JKFle 2019-04-03 11:24:15 +03:00
Ilya Kirillov
9d9c9f40db New J2K: Wrap adding imports to CommandProcessor.executeCommand 2019-04-03 11:24:14 +03:00
Ilya Kirillov
02c8e4cede New J2K: Do not remove semicolon after if expression when then branch is empty in RedundantSemicolonInspection 2019-04-03 11:24:14 +03:00
Ilya Kirillov
b13f7431f2 New J2K: Fix existing test data 2019-04-03 11:24:13 +03:00
Ilya Kirillov
76b73542d9 New J2K: Add type arguments to multi-dimension array initializers 2019-04-03 11:24:12 +03:00
Ilya Kirillov
99f3af9e85 New J2K: Move comments from primary constructor to init section 2019-04-03 11:24:11 +03:00
Ilya Kirillov
481b2feda3 New J2K: Collect annotations for parameters 2019-04-03 11:24:10 +03:00
Ilya Kirillov
b3af05e3ad New J2K: Fix comments order 2019-04-03 11:24:10 +03:00
Ilya Kirillov
1e73748ab4 New J2K: Fix gradle build for nj2k-services 2019-04-03 11:24:09 +03:00
Ilya Kirillov
7f9250c914 New J2K: Fix symbol provider compile error 2019-04-03 11:24:08 +03:00
Ilya Kirillov
32e69629f3 New J2K: Add imports of used kotlin functions 2019-04-03 11:24:08 +03:00
Ilya Kirillov
939b379694 New J2K: Fix old j2k build 2019-04-03 11:24:07 +03:00
Ilya Kirillov
dff4ab2437 New J2K: Fix nullability preserving in AST conversions 2019-04-03 11:24:06 +03:00
Ilya Kirillov
bdd773f806 New J2K: Add nullability analyser tests 2019-04-03 11:24:05 +03:00
Ilya Kirillov
f3b6c880d4 New J2K: Remove unused nj2k test & fix test generation 2019-04-03 11:24:04 +03:00
Ilya Kirillov
e3ee0dac6c New J2K: Add annotations to the import collector 2019-04-03 11:24:03 +03:00
Ilya Kirillov
0610583b80 New J2K: Fix RemoveRedundantExpressionQualifierProcessing 2019-04-03 11:24:02 +03:00
Ilya Kirillov
6f7f516a4f New J2K: Temporary ignore imports & error comments 2019-04-03 11:24:01 +03:00
Ilya Kirillov
bcee73ff01 New J2K: Fix debug tree printer 2019-04-03 11:24:01 +03:00
Ilya Kirillov
b81696947c New J2K: Do not call useless cast on null expression on post processing 2019-04-03 11:24:00 +03:00
Ilya Kirillov
54bd077994 New J2K: Fix type calculating 2019-04-03 11:23:59 +03:00
Ilya Kirillov
658f763887 New J2K: Save unused imports 2019-04-03 11:23:58 +03:00
Ilya Kirillov
a7d2238af4 New J2K: Add IDEA integration of J2k 2019-04-03 11:23:57 +03:00
Ilya Kirillov
a4e3e7abcc New J2K: Add !! when nullability mismatch on post processing 2019-04-03 11:23:56 +03:00
Ilya Kirillov
deb4129a16 New J2K: Add support of diagnostic based inspections on arbitrary PsiElements 2019-04-03 11:23:55 +03:00
Ilya Kirillov
47e722854c New J2K: Remove redundant modifiers in post processing 2019-04-03 11:23:55 +03:00
Ilya Kirillov
7adba40ea2 New J2K: Fix existing test data 2019-04-03 11:23:54 +03:00
Ilya Kirillov
8bd49c147c New J2K: Fix convert getters and setters 2019-04-03 11:23:53 +03:00
Ilya Kirillov
0340c218b9 New J2K: Do not show unknown comment for some kind of type types 2019-04-03 11:23:52 +03:00
Ilya Kirillov
c1ed2e020c New J2K: Fix formatting saving 2019-04-03 11:23:52 +03:00
Ilya Kirillov
13a9a56e85 New J2K: Remove redundant nullability AST conversions due to having them in nullability analyser 2019-04-03 11:23:51 +03:00
Ilya Kirillov
b24ce99097 New J2K: Process fields in modality conversion 2019-04-03 11:23:50 +03:00
Ilya Kirillov
b6625c536d New J2K: Add nullability analysis to post processing 2019-04-03 11:23:50 +03:00
Ilya Kirillov
63d3f90373 New J2K: Fix labeled statement conversion 2019-04-03 11:23:49 +03:00
Ilya Kirillov
0b92b3160f New J2K: Add parenthesis to binary expression in a case of line break before operator 2019-04-03 11:23:48 +03:00
Ilya Kirillov
c20e537b81 New J2K: Preserve comments and line breaks 2019-04-03 11:23:48 +03:00
Ilya Kirillov
b9f8ff9079 New J2K: Rearrange conversions 2019-04-03 11:23:47 +03:00
Ilya Kirillov
4aacb15872 New J2K: Add support of lambda expressions in LowerNullabilityInFunctionParametersConversion 2019-04-03 11:23:46 +03:00
Ilya Kirillov
197fda30e2 New J2K: Implement unimplemented symbol functions 2019-04-03 11:23:46 +03:00
Ilya Kirillov
779dc5c1e2 New J2K: Add RETURN_TYPE_MISMATCH_ON_OVERRIDE to postprocessing 2019-04-03 11:23:45 +03:00
Ilya Kirillov
a1e8d0a6be New J2K: Add Spread operator support 2019-04-03 11:23:44 +03:00
Ilya Kirillov
bf8acc57e3 New J2K: Make all types data classes 2019-04-03 11:23:44 +03:00
Ilya Kirillov
fb6560c1f1 New J2K: Assume parameters when prebuilding symbol provider symbols fro converting declarations 2019-04-03 11:23:43 +03:00
Ilya Kirillov
67a8f445b0 New J2K: Fix provideDirectSymbol in symbol provider fro decompiled declaratiosns 2019-04-03 11:23:42 +03:00
Ilya Kirillov
0456c6a897 New J2K: Make method open only if parent class is open 2019-04-03 11:23:42 +03:00
Ilya Kirillov
269d3f42c6 New J2K: Transfer java method to kotlin function symbol 2019-04-03 11:23:41 +03:00
Ilya Kirillov
cc3564395c New J2K: Promete class to object when init declaration present 2019-04-03 11:23:40 +03:00
Ilya Kirillov
b94ff8af36 New J2K: Clear nullability for methods 2019-04-03 11:23:40 +03:00
Ilya Kirillov
5ae1a819bc New J2K: Add support of Java static init declarations 2019-04-03 11:23:39 +03:00
Ilya Kirillov
ef89a249f2 New J2K: Add FunctionAsAnonymousObjectToLambdaConversion & ReturnStatementInLambdaExpressionConversion conversions 2019-04-03 11:23:38 +03:00
Ilya Kirillov
a659fcd6af New J2K: Move annotations from getters to properties 2019-04-03 11:23:38 +03:00
Ilya Kirillov
1fa0ddcbe8 New J2K: Add qualifiers for static methods, fields & enum consts 2019-04-03 11:23:37 +03:00
Ilya Kirillov
b355572aab New J2K: Add annotation list for JKVariable 2019-04-03 11:23:37 +03:00
Ilya Kirillov
40f5ebb77e New J2K: Fix incorrect imports collecting 2019-04-03 11:23:36 +03:00
Ilya Kirillov
8caf45820c New J2K: Add support of more operations on string conversion 2019-04-03 11:23:35 +03:00
Ilya Kirillov
e39fc53f25 New J2K: Correctly detect varargs argument in annotations & do not throw away named arguments in annotations 2019-04-03 11:23:35 +03:00
Ilya Kirillov
90c12736da New J2K: Convert to data class iff constructor parameter type equals property type 2019-04-03 11:23:34 +03:00
Ilya Kirillov
bcb8742120 New J2K: Add support of named parameters 2019-04-03 11:23:33 +03:00
Ilya Kirillov
ea2081c2f0 New J2K: Fix existing test data 2019-04-03 11:23:33 +03:00
Ilya Kirillov
9c71d5ca25 New J2K: Add repeatable post processing groups 2019-04-03 11:23:32 +03:00
Ilya Kirillov
c827247272 New J2K: Separate new j2k from old j2k 2019-04-03 11:23:31 +03:00
Ilya Kirillov
e6f0a242fd New J2K: Parenthesize qualifier for extension methods in BuiltinMembersConversion 2019-04-03 11:23:31 +03:00
Ilya Kirillov
c111f1c52f New J2K: Cache resolving by fqNames 2019-04-03 11:23:30 +03:00
Ilya Kirillov
ea6cb716e5 New J2K: Move optimize imports invocation out of processings 2019-04-03 11:23:29 +03:00
Ilya Kirillov
f8b8d07621 New J2K: Fix existing test data 2019-04-03 11:23:29 +03:00
Ilya Kirillov
7e30b9e7f5 New J2K: Add support of binary expressions conversion to ImplicitCastsConversion 2019-04-03 11:23:28 +03:00
Ilya Kirillov
208c33a51d New J2K: Add support of prefix expression in ImplicitCastsConversion 2019-04-03 11:23:27 +03:00
Ilya Kirillov
461ef071f4 New J2K: Add AssignmentStatementSplitAlsoConversion 2019-04-03 11:23:26 +03:00
Ilya Kirillov
58fbe7913e New J2K: Use type instead of typeElement to create JKType
because first one can fail on array type
2019-04-03 11:23:25 +03:00
Ilya Kirillov
71780ef442 New J2K: Fix creating expression instead of statement 2019-04-03 11:23:25 +03:00
Ilya Kirillov
4a9ba3c756 New J2K: Do not convert array types to specialized ones in a case of boxed inner type 2019-04-03 11:23:24 +03:00
Ilya Kirillov
7494488edb New J2K: Fix type parameters of JKUnresolvedClassSymbol for new expression 2019-04-03 11:23:23 +03:00
Ilya Kirillov
18e5c1b5f2 New J2K: Fix modality conversion 2019-04-03 11:23:23 +03:00
Ilya Kirillov
936c43d2bc New J2K: Assume specifyLocalVariableTypeByDefault in for loops initializers 2019-04-03 11:23:22 +03:00
Ilya Kirillov
1e7b1f8716 New J2K: Use converter settings values in post processing 2019-04-03 11:23:21 +03:00
Ilya Kirillov
f9a08ad770 New J2K: Add BoxedTypeOperationsConversion 2019-04-03 11:23:21 +03:00
Ilya Kirillov
8b12a9f723 New J2K: Fix support of kotlin method calls 2019-04-03 11:23:20 +03:00
Ilya Kirillov
9a8f8fbfe0 New J2K: Fix KotlinType to JKType conversion 2019-04-03 11:23:19 +03:00
Ilya Kirillov
7889756d1a New J2K: Convert type arguments in TypeMappingConversion 2019-04-03 11:23:19 +03:00
Ilya Kirillov
d2a4ff172d New J2K: Add Collection.remove conversion 2019-04-03 11:23:18 +03:00
Ilya Kirillov
9fcdb7dde7 New J2K: Fix statement conversion in a case of inner blocks 2019-04-03 11:23:17 +03:00
Ilya Kirillov
d7962afd05 New J2K: Add support of annotation classes 2019-04-03 11:23:17 +03:00
Ilya Kirillov
11f4df8173 New J2K: Add RemoveRedundantCallsOfConversionMethodsIntention post processing 2019-04-03 11:23:16 +03:00
Ilya Kirillov
e4c15c3fb9 New J2K: Fix adding JvmOverloads annotation in DefaultArgumentsConversion 2019-04-03 11:23:15 +03:00
Ilya Kirillov
962b971f07 New J2K: Add conflicts handling in for conversion 2019-04-03 11:23:14 +03:00
Ilya Kirillov
e43eb4da03 New J2K: Fix indicesByCollectionSize in for conversion 2019-04-03 11:23:14 +03:00
Ilya Kirillov
6c696f6c60 New J2K: Convert tiled prefix operation to inv invocation 2019-04-03 11:23:13 +03:00
Ilya Kirillov
d09e72656a New J2K: Add InterfaceWithFieldConversion 2019-04-03 11:23:12 +03:00
Ilya Kirillov
1d846085de New J2K: Add support of synchronized statement 2019-04-03 11:23:12 +03:00
Ilya Kirillov
0674e6462c New J2K: Fix conversions order 2019-04-03 11:23:11 +03:00
Ilya Kirillov
3c5bb0b259 New J2K: Fix symbols fqNames 2019-04-03 11:23:10 +03:00
Ilya Kirillov
34ca1e1c23 New J2K: Do not print debug trees 2019-04-03 11:23:09 +03:00
Ilya Kirillov
50278058ae New J2K: Fix nullability calculation 2019-04-03 11:23:08 +03:00
Ilya Kirillov
8aa28c0d50 New J2K: Use returnType instead of methodSymbol in operator expressions 2019-04-03 11:23:07 +03:00
Ilya Kirillov
a92c5ebe61 New J2K: Add builtIn operators conversion 2019-04-03 11:23:07 +03:00
Ilya Kirillov
fbcf2e1bcd New J2K: Move equals operator conversion from post processing to AST conversion 2019-04-03 11:23:06 +03:00
Ilya Kirillov
70c700f07a New J2K: Add post processings for removing redundant qualifiers 2019-04-03 11:23:05 +03:00
Ilya Kirillov
d0ba5e7fdf New J2K: Add missing override keyword insertion post processing 2019-04-03 11:23:04 +03:00
Ilya Kirillov
9eaa961a2a New J2K: Add support of deprecated annotation && fix annotations 2019-04-03 11:23:04 +03:00
Ilya Kirillov
3990e1d223 New J2K: Replace conversionContext to symbolProvider in JKExpression.type function 2019-04-03 11:23:03 +03:00
Ilya Kirillov
8df99e54f8 New J2K: Use JKBooleanLiteral for boolean literals 2019-04-03 11:23:02 +03:00
Ilya Kirillov
d3a6b4f12b New J2K: Fix labeled while conversion 2019-04-03 11:23:02 +03:00
Ilya Kirillov
b396ee0cca New J2K: Fix also expression && lambda parameter types 2019-04-03 11:23:01 +03:00
Ilya Kirillov
d56a52fce6 New J2K: Use protected visibility resolution from old j2k 2019-04-03 11:23:00 +03:00
Ilya Kirillov
4c880499fb New J2K: Adapt internal class conversion to old j2k 2019-04-03 11:22:59 +03:00
Ilya Kirillov
d1c1aeed0b New J2K: Fix supertypes constructor calls 2019-04-03 11:22:58 +03:00
Ilya Kirillov
5cdc01621d New J2K: Use parameter initializers as scope for nullability check in LowerNullabilityInFunctionParametersConversion 2019-04-03 11:22:57 +03:00
Ilya Kirillov
53fcf31f23 New J2K: Take parameter in data class iff constructor parameter type is subtype of property type in data class conversion 2019-04-03 11:22:56 +03:00
Ilya Kirillov
fc504c6fdc New J2K: Add ReplacePrimitiveCastWithNumberConversionFix post processing 2019-04-03 11:22:55 +03:00
Ilya Kirillov
23a42b36b4 New J2K: Add RemoveEmptyPrimaryConstructorIntention post processing 2019-04-03 11:22:55 +03:00
Ilya Kirillov
d5a3b5644c New J2K: Fix java classes mapped to kotlin ones in post processings 2019-04-03 11:22:54 +03:00
Ilya Kirillov
f603932284 New J2K: Do not merge function definitions whet it is not possible 2019-04-03 11:22:53 +03:00
Ilya Kirillov
46c7cd4b40 New J2K: Fix raw types in new expression 2019-04-03 11:22:52 +03:00
Ilya Kirillov
9b73db4308 New J2K: Add TypeParametersNullabilityConversion 2019-04-03 11:22:52 +03:00
Ilya Kirillov
6dae9da7e2 New J2K: Do not filter default imports 2019-04-03 11:22:51 +03:00
Ilya Kirillov
6e1adf9b6f New J2K: Add JvmOverloads annotation when merging methods 2019-04-03 11:22:50 +03:00
Ilya Kirillov
e232d70b52 New J2K: Add NullableQualifierConversion 2019-04-03 11:22:49 +03:00
Ilya Kirillov
95efc5eecf New J2K: Make annotation's type parameters not null 2019-04-03 11:22:48 +03:00
Ilya Kirillov
211405c034 New J2K: Cleanup code builder 2019-04-03 11:22:47 +03:00
Ilya Kirillov
2d256717ff New J2K: Make JKMethodCallExpression's arguments nullable 2019-04-03 11:22:46 +03:00
Ilya Kirillov
acd8985518 New J2K: Add JetbrainsNullableAnnotationsConverter 2019-04-03 11:22:46 +03:00
Ilya Kirillov
295a160f60 New J2K: Add DefaultNullabilityToNullableConversion 2019-04-03 11:22:45 +03:00
Ilya Kirillov
3d62734cc6 New J2K: Add types to JKExpression.type 2019-04-03 11:22:44 +03:00
Ilya Kirillov
2e353ccf86 New J2K: Use default nullability by default 2019-04-03 11:22:44 +03:00
Ilya Kirillov
f3cb76ff56 New J2K: Fix TypeMappingConversion 2019-04-03 11:22:43 +03:00
Ilya Kirillov
6b889bdf57 New J2K: Add ImplicitCastsConversion 2019-04-03 11:22:42 +03:00
Ilya Kirillov
2d37a2b28e New J2K: Fix type arguments for new expression 2019-04-03 11:22:41 +03:00
Ilya Kirillov
de26e2cfe7 New J2K: Add escaping of class symbol names in code builder 2019-04-03 11:22:40 +03:00
Ilya Kirillov
11da99a1d0 New J2K: Use binaryExpression instead of operatorExpression 2019-04-03 11:22:40 +03:00
Ilya Kirillov
84ad58b50b New J2K: Move literal conversion internals to expression.kt 2019-04-03 11:22:39 +03:00
Ilya Kirillov
60d498cedc New J2K: Add !! postfix expression support 2019-04-03 11:22:38 +03:00
Ilya Kirillov
a529dcce4c New J2K: Add charAt conversion to StringMethodsConversion 2019-04-03 11:22:37 +03:00
Ilya Kirillov
7dbe16d305 New J2K: Make polyadic expression converter to resolve real operator type 2019-04-03 11:22:36 +03:00
Ilya Kirillov
841cd9c749 New J2K: Do not remove redundant nullability in post precessing for variable if initializer is nullable 2019-04-03 11:22:36 +03:00
Ilya Kirillov
bbbadb0431 New J2K: Add support of vararg parameters in method declaration 2019-04-03 11:22:35 +03:00
Ilya Kirillov
6fbc180f92 New J2K: Do not create new line after each local declaration 2019-04-03 11:22:34 +03:00
Ilya Kirillov
51ee64a757 New J2K: Add java void type to JKClassLiteralExpression & make all inner types of JKClassLiteralExpression's classType to be notNull 2019-04-03 11:22:34 +03:00
Ilya Kirillov
5e6e5bcf8c New J2K: Fix modifiers of local class 2019-04-03 11:22:33 +03:00
Ilya Kirillov
ec1bc35df7 New J2K: Use real method symbols in ArrayInitializerConversion 2019-04-03 11:22:32 +03:00
Ilya Kirillov
71b194d0d6 New J2K: Get rid of JKUnresolvedClassType and use JKClassType(JKUnresolvedClassSymbol) instead 2019-04-03 11:22:31 +03:00
Ilya Kirillov
325eec2454 New J2K: Replace java instanceof with kotlin is expression 2019-04-03 11:22:31 +03:00
Ilya Kirillov
eda99a588d New J2K: Fix declarations creation 2019-04-03 11:22:30 +03:00
Ilya Kirillov
0feaad2205 New J2K: Fix enum constant symbol 2019-04-03 11:22:29 +03:00
Ilya Kirillov
1c4e811717 New J2K: Fix symbol's fqName 2019-04-03 11:22:29 +03:00
Ilya Kirillov
7c04590d82 New J2K: Fix method call expression printing 2019-04-03 11:22:28 +03:00
Ilya Kirillov
5fc9ca8fc7 New J2K: Add resolving for kotlin properties and object members calls 2019-04-03 11:22:27 +03:00
Ilya Kirillov
db8beab499 New J2K: Fix NPE in a case of unresolved symbols 2019-04-03 11:22:27 +03:00
Ilya Kirillov
410000f94c New J2K: Fix types for kotlin properties 2019-04-03 11:22:26 +03:00
Ilya Kirillov
667ead10a3 New J2K: Add finalize & clone to JavaStandartMethodsConversion 2019-04-03 11:22:25 +03:00
Ilya Kirillov
12fe096b82 New J2K: Fix class inheritance info 2019-04-03 11:22:25 +03:00
Ilya Kirillov
ad58772453 New J2K: Use IDEA analyzers on kotlin properties & functions 2019-04-03 11:22:24 +03:00
Ilya Kirillov
cc2f27f9cd New J2K: Add string.length conversion 2019-04-03 11:22:23 +03:00
Ilya Kirillov
9704a7aa7f New J2K: Add ReplaceCallWithBinaryOperatorInspection & MayBeConstantInspection to postProcessing 2019-04-03 11:22:22 +03:00
Ilya Kirillov
b7d6a905f3 New J2K: Fix extra spaces in StructuralPsiCompare 2019-04-03 11:22:22 +03:00
Ilya Kirillov
2c8483aef4 New J2K: Rearrange conversions & add new ones 2019-04-03 11:22:21 +03:00
Ilya Kirillov
7dd60a04ec New J2K: Add EnumClassConversion 2019-04-03 11:22:20 +03:00
Ilya Kirillov
17b96b8240 New J2K: Fix printing no semicolon in enum class 2019-04-03 11:22:19 +03:00
Ilya Kirillov
dcf7895314 New J2K: Make JKKtAssignmentStatementImpl field to be a child of JKBranchElement 2019-04-03 11:22:18 +03:00
Ilya Kirillov
56aa6f83af New J2K: Assume enum class in PrimaryConstructorDetectConversion 2019-04-03 11:22:18 +03:00
Ilya Kirillov
d02be5ae94 New J2K: Create init declaration from primary constructor in PrimaryConstructorDetectConversion 2019-04-03 11:22:17 +03:00
Ilya Kirillov
8ceca44b10 New J2K: Remove useless FieldInitializersInPrimaryFromParamsConversion 2019-04-03 11:22:16 +03:00
Ilya Kirillov
757675c4ca New J2K: Make JKType.updateNullability return the same type 2019-04-03 11:22:15 +03:00
Ilya Kirillov
104cf2eef5 New J2K: Add NATIVE to EXTERNAL modifiers conversion 2019-04-03 11:22:15 +03:00
Ilya Kirillov
5cb4abf95d New J2K: Add JavaStandardMethodsConversion 2019-04-03 11:22:14 +03:00
Ilya Kirillov
cd6bcb7878 New J2K: Assume that is expression type is always not null 2019-04-03 11:22:13 +03:00
Ilya Kirillov
1615b1c6b3 New J2K: Add support of Anonymous class initializers 2019-04-03 11:22:13 +03:00
Ilya Kirillov
be90db7fca New J2K: Add ParameterModificationInMethodCallsConversion 2019-04-03 11:22:12 +03:00
Ilya Kirillov
aa173783aa New J2K: Add check that field is not initialized in constructor in ImplicitInitializerConversion 2019-04-03 11:22:12 +03:00
Ilya Kirillov
730c8ca495 New J2K: Fix java assignment to also conversion 2019-04-03 11:22:11 +03:00
Ilya Kirillov
4194ace762 New J2K: Add super expression qualifier 2019-04-03 11:22:10 +03:00
Ilya Kirillov
d75549f443 New J2K: Fix grouping post processing 2019-04-03 11:22:09 +03:00
Ilya Kirillov
763ea3480d New J2K: Add support of enum consts initializingClass 2019-04-03 11:22:09 +03:00
Ilya Kirillov
49a8a8f116 New J2K: Add support of grouped postProcessings & introduce VarToVal inspection 2019-04-03 11:22:08 +03:00
Ilya Kirillov
c7df104b36 New J2K: Add ConvertDataClass PostProcessing 2019-04-03 11:22:07 +03:00
Ilya Kirillov
5c8035b339 New J2K: Add ConvertGettersAndSetters postProcessing 2019-04-03 11:22:07 +03:00
Ilya Kirillov
daf1f6154e New J2K: Add more types to JKExpression.type 2019-04-03 11:22:06 +03:00
Ilya Kirillov
d47543820a New J2K: Add collection classes mapping to TypeMappingConversion 2019-04-03 11:22:05 +03:00
Ilya Kirillov
df5c2f90c1 New J2K: Add basic import list mapping 2019-04-03 11:22:04 +03:00
Ilya Kirillov
213aa9a86d New J2K: Add annotations for JKField 2019-04-03 11:22:03 +03:00
Ilya Kirillov
2633834741 New J2K: Add conversion of some java modifiers to kotlin annotations 2019-04-03 11:22:03 +03:00
Ilya Kirillov
0e6e0e6df1 New J2K: Stop printing multiline lambdas in a case of single statement inside 2019-04-03 11:22:02 +03:00
Ilya Kirillov
0712db8bd3 New J2K: Add filtering local imports in ImportStatementConversion 2019-04-03 11:22:02 +03:00
Ilya Kirillov
d4077a1622 New J2K: Add boxed types support to PrimitiveTypesInitializersConversion 2019-04-03 11:22:01 +03:00
Ilya Kirillov
f14aa2292f New J2K: Implement primitive type case for ImplicitInitializerConversion 2019-04-03 11:22:00 +03:00
Ilya Kirillov
fb3c7e87a1 New J2K: Fix binaryExpressionMethodSymbol in a case of not JKMultiverseKtClassSymbol 2019-04-03 11:21:59 +03:00
Ilya Kirillov
2c7e44f41e New J2K: Add checking for receiver type in for conversion's indicesByCollectionSize 2019-04-03 11:21:59 +03:00
Ilya Kirillov
ffbdafbe69 New J2K: Add LowerNullabilityInFunctionParametersConversion 2019-04-03 11:21:58 +03:00
Ilya Kirillov
a15f51950b New J2K: Add collection operations conversion 2019-04-03 11:21:57 +03:00
Ilya Kirillov
254d2f8b67 New J2K: Fix JKType.toKtType function 2019-04-03 11:21:57 +03:00
Ilya Kirillov
77eb9b1b37 New J2K: Fix if statement printing with empty then body 2019-04-03 11:21:55 +03:00
Ilya Kirillov
b21c52aecd New J2K: Fix JKClassSymbol's name printing in a case of nested class 2019-04-03 11:21:54 +03:00
Ilya Kirillov
599aa9435f New J2K: Move postProcessingRegistrar to a NewJ2KPostProcessingRegistrarImpl and revert old one 2019-04-03 11:21:54 +03:00
Ilya Kirillov
a80a30e0af New J2K: Fix that RemoveExplicitPropertyType does not work on local variables 2019-04-03 11:21:53 +03:00
Ilya Kirillov
a5b7831773 New J2K: Add array operation conversion 2019-04-03 11:21:52 +03:00
Ilya Kirillov
1faaada01f New J2K: Add import statement conversion 2019-04-03 11:21:51 +03:00
Ilya Kirillov
a19ae4bcc2 New J2K: Fix accessing to non-existing psi in TypeMappingConversion 2019-04-03 11:21:50 +03:00
Ilya Kirillov
17f86d69a7 New J2K: Calculate function return type nullability in JavaMethodToKotlinFunctionConversion 2019-04-03 11:21:49 +03:00
Ilya Kirillov
b076e7e881 New J2K: Fix for conversion due to changing modifier types 2019-04-03 11:21:48 +03:00
Ilya Kirillov
70225ac3d0 New J2K: Fix class access expression fq name when it starts with b "java.lang." 2019-04-03 11:21:47 +03:00
Ilya Kirillov
4a16f4cc9f New J2K: Fix multiple update expressions in psi for statements 2019-04-03 11:21:46 +03:00
Ilya Kirillov
f6f619ea27 New J2K: Add blockStatementWithoutBrackets to for statement conversion 2019-04-03 11:21:46 +03:00
Ilya Kirillov
03131dc138 New J2K: Add JKBlockStatementWithoutBrackets 2019-04-03 11:21:45 +03:00
Ilya Kirillov
4b0840beb1 New J2K: Add multiple updaters to Java for loop 2019-04-03 11:21:43 +03:00
Ilya Kirillov
9532dec452 New J2K: Make JKExpression.type nullable 2019-04-03 11:21:42 +03:00
Ilya Kirillov
28aeaa040e New J2K: Split conversions to Java --> Kotlin conversions and Kotlin --> Kotlin conversions 2019-04-03 11:21:41 +03:00
Ilya Kirillov
67c6192425 New J2K: Remove unused symbolByName 2019-04-03 11:21:40 +03:00
Ilya Kirillov
2c3e8a3909 New J2K: Add print conversion to PrintlnConversion 2019-04-03 11:21:40 +03:00
Ilya Kirillov
71fcbcb60a New J2K: Change type of JKType.classSymbol to JKClassSymbol 2019-04-03 11:21:39 +03:00
Ilya Kirillov
2292e0b792 New J2K: Fix enum constant constructing 2019-04-03 11:21:38 +03:00
Ilya Kirillov
b3dc0d4aff New J2K: Add package & imports declarations to JKFile, simplify JKFile constructing 2019-04-03 11:21:37 +03:00
Ilya Kirillov
3ea4ee9110 New J2K: Add throws list for java method & add JKClassLiteralExpression 2019-04-03 11:21:36 +03:00
Ilya Kirillov
69633e7a0f New J2K: Split ModifiersList to visibilityModifier, modalityModifier, mutabilityModifier and extraModifiers & introduce JKVariable which may have any subset of modifiers 2019-04-03 11:21:35 +03:00
Ilya Kirillov
5c6092c98c New J2K: Add mangling of name identifiers 2019-04-03 11:21:34 +03:00
Ilya Kirillov
0e9abf8ca3 New J2K: Add assert statement conversion 2019-04-03 11:21:33 +03:00
Ilya Kirillov
633c29a2de New J2K: Fix when final fields become vars 2019-04-03 11:21:33 +03:00
Ilya Kirillov
8ba8a2f197 New J2K: Fix binary expression's method symbol search 2019-04-03 11:21:32 +03:00
Ilya Kirillov
bb2c32a402 New J2K: Fix package statement position 2019-04-03 11:21:31 +03:00
Ilya Kirillov
e1108e1764 New J2K: Add anonymous object creation support JKNewExpression 2019-04-03 11:21:30 +03:00
Ilya Kirillov
f58d791a05 New J2K: Introduce type arguments 2019-04-03 11:21:29 +03:00
Ilya Kirillov
40c5b56c10 New J2K: Refactor brackets in new expression printing 2019-04-03 11:21:28 +03:00
Ilya Kirillov
a30311da45 New J2K: Add dummy field to property conversion 2019-04-03 11:21:27 +03:00
Ilya Kirillov
e0ac21c4ad New J2K: Collect and print imports 2019-04-03 11:21:27 +03:00
Ilya Kirillov
c6006927ac New J2K: Add optimize import to post processing 2019-04-03 11:21:26 +03:00
Ilya Kirillov
8f960f2f47 New J2K: Fix do while loop spaces 2019-04-03 11:21:25 +03:00
Ilya Kirillov
b24d683ebe New J2K: Make JKJavaNewArrayImpl a PsiOwner 2019-04-03 11:21:24 +03:00
Ilya Kirillov
a1600bd83a New J2K: Add ForIn statement conversion 2019-04-03 11:21:23 +03:00
Ilya Kirillov
a0ab7492a8 New J2K: Add JavaTokenType.EXCL token to JKJavaOperatorToken.toKtToken() 2019-04-03 11:21:23 +03:00
Ilya Kirillov
bcaea3182e New J2K: Fix JKStatement.isEmpty method by not considering empty block statement as empty statement 2019-04-03 11:21:22 +03:00
Ilya Kirillov
f223a6ebd1 New J2K: Use default psiContext in AssignmentAsExpressionToAlsoConversion 2019-04-03 11:21:21 +03:00
Ilya Kirillov
28ef4c5dfa New J2K: Main function conversion 2019-04-03 11:21:21 +03:00
Ilya Kirillov
2f1a8831b2 New J2K: Add basic annotations support 2019-04-03 11:21:20 +03:00
Ilya Kirillov
f752796408 New J2K: Fix existing test data 2019-04-03 11:21:19 +03:00
Ilya Kirillov
5236858c20 New J2K: Add JKThrowStatement and JKContinueStatement to SwitchStatementConversion's falls fallsThrough() 2019-04-03 11:21:19 +03:00
Ilya Kirillov
42dc96d9a8 New J2K: Fix switch statement cases printing 2019-04-03 11:21:17 +03:00
Ilya Kirillov
3ea1a937c0 New J2K: Place else case in the end in switch statement conversion 2019-04-03 11:21:16 +03:00
Ilya Kirillov
115fe2cb88 New J2K: Fix statements in lambda expression 2019-04-03 11:21:15 +03:00
Ilya Kirillov
136a254da5 New J2K: Fix showing ":" in type parameter type 2019-04-03 11:21:14 +03:00
Ilya Kirillov
4080804391 New J2K: Add JKPackageDeclaration 2019-04-03 11:21:14 +03:00
Ilya Kirillov
2b6ac84dda New J2K: Add qualified label to JKThisExpression 2019-04-03 11:21:13 +03:00
Ilya Kirillov
71408c0b14 New J2K: Fix class modifiers conversion 2019-04-03 11:21:12 +03:00
Ilya Kirillov
eb0182c5a9 New J2K: Remove extra JKKtModifier.INTERNAL because there is already JKVisibilityModifier.INTERNAL 2019-04-03 11:21:11 +03:00
Ilya Kirillov
4f30283744 New J2K: Add printing of JKClassAccessExpression 2019-04-03 11:21:11 +03:00
Ilya Kirillov
2d9a9613f6 New J2K: Fix conversion of inner classed methods 2019-04-03 11:21:10 +03:00
Ilya Kirillov
f76a3504cc New J2K: Inherit JKBinaryExpression & JKUnaryExpression from JKOperatorExpression 2019-04-03 11:21:09 +03:00
Ilya Kirillov
9374816823 New J2K: Add conversion of prefix and postfix expressions 2019-04-03 11:21:08 +03:00
Ilya Kirillov
3d418d8904 New J2K: Add == to JKJavaOperatorToken.toKtToken 2019-04-03 11:21:07 +03:00
Ilya Kirillov
4310575de9 New J2K: Add ';' in a case of For loop and While loop empty body 2019-04-03 11:21:07 +03:00
Ilya Kirillov
3ddc05fdd9 New J2K: Add forEach statement generation 2019-04-03 11:21:06 +03:00
Ilya Kirillov
7b5ffce7aa New J2K: Separate statements in block 2019-04-03 11:21:05 +03:00
Ilya Kirillov
9a1e5582b6 New J2K: Render list separator as function 2019-04-03 11:21:04 +03:00
Ilya Kirillov
7af03c2859 New J2K: Set exception types as non nullable in try statement conversion 2019-04-03 11:21:04 +03:00
Ilya Kirillov
3771ccedb7 New J2K: Add JKType.updateNullability function 2019-04-03 11:21:03 +03:00
Ilya Kirillov
2e0c7e9128 New J2K: Fix spaces in structural tests 2019-04-03 11:21:02 +03:00
Ilya Kirillov
61d6709cb7 New J2K: Add temporary sorting of class declarations 2019-04-03 11:21:01 +03:00
Ilya Kirillov
03df0f1164 New J2K: Add default mutability to property in FieldToPropertyConversion 2019-04-03 11:21:01 +03:00
Ilya Kirillov
0873045718 New J2K: Print & filter primary constructor modifiers 2019-04-03 11:20:59 +03:00
Ilya Kirillov
7e7d865054 New J2K: Add enum constants 2019-04-03 11:20:59 +03:00
Ilya Kirillov
ff700b5399 New J2K: Add TypeElement.present() function 2019-04-03 11:20:58 +03:00
Ilya Kirillov
77713c1877 New J2K: Add NoType for ktProperty 2019-04-03 11:20:57 +03:00
Ilya Kirillov
a55d2b6597 New J2K: Add missing modifier priorities 2019-04-03 11:20:57 +03:00
Ilya Kirillov
55c304827a New J2K: Do not convert class to object in ClassToObjectPromotionConversion when it has inheritors 2019-04-03 11:20:56 +03:00
Ilya Kirillov
70def791c0 New J2K: Fix ClassToObjectPromotionConversion when empty constructor 2019-04-03 11:20:56 +03:00
Ilya Kirillov
44185c1246 New J2K: Fix adding init section with empty body 2019-04-03 11:20:55 +03:00
Ilya Kirillov
6a8f3a7a84 New J2K: Fix println's in printer 2019-04-03 11:20:55 +03:00
Ilya Kirillov
0bc1e96f0d New J2K: Add type parameter type 2019-04-03 11:20:54 +03:00
Ilya Kirillov
524b07f6ac New J2K: Add variance type parameters 2019-04-03 11:20:53 +03:00
Ilya Kirillov
14f5d866ee New J2K: Add type parameters to methods declaration 2019-04-03 11:20:53 +03:00
Ilya Kirillov
4097ebe583 New J2K: Add typeParameter's upper bounds 2019-04-03 11:20:52 +03:00
Ilya Kirillov
33b66ec17e New J2K: Add typeParameters to JKClass 2019-04-03 11:20:51 +03:00
Ilya Kirillov
1f59f91aeb New J2K: Add typeParameter & typeParameterList 2019-04-03 11:20:50 +03:00
Ilya Kirillov
b9d432bfac New J2K: Call RemoveEmptyClassBodyIntention 2019-04-03 11:20:49 +03:00
Ilya Kirillov
ba08f233b6 New J2K: Try with resource conversion 2019-04-03 11:20:48 +03:00
Ilya Kirillov
8d602b9e47 New J2K: Add "use" expression generator 2019-04-03 11:20:48 +03:00
Ilya Kirillov
8d45bce06a New J2K: Add try statement 2019-04-03 11:20:47 +03:00
Ilya Kirillov
594d0ba7e9 New J2K: Add throw statement 2019-04-03 11:20:46 +03:00
Ilya Kirillov
66f12d9fea New J2K: Do not print extra mutability modifier in ktProperty 2019-04-03 11:20:45 +03:00
Ilya Kirillov
5ba3d6bc67 New J2K: Fix parameters modifiers 2019-04-03 11:20:45 +03:00
Ilya Kirillov
9e98e36ac7 New J2K: Use RecursiveApplicableConversionBase in FieldInitializersInPrimaryFromParamsConversion 2019-04-03 11:20:44 +03:00
Ilya Kirillov
78c5b4acd5 New J2K: Add JKEmptyStatement 2019-04-03 11:20:43 +03:00
Ilya Kirillov
e10a81a942 New J2K: Use JKDeclaration instead of ValIdentifier in ForLoop 2019-04-03 11:20:43 +03:00
Ilya Kirillov
d228d6110c New J2K: Move expression creation functions to separated file 2019-04-03 11:20:42 +03:00
Ilya Kirillov
fad9c52853 New J2K: Add type calculating for equals operator 2019-04-03 11:20:41 +03:00
Ilya Kirillov
a1ac0c2e4b New J2K: Fix for conversion due to using operator tokens 2019-04-03 11:20:41 +03:00
Ilya Kirillov
1851239e7e New J2K: Add JKElement.detached function 2019-04-03 11:20:40 +03:00
Ilya Kirillov
753070b6c7 New J2K: Refactor code 2019-04-03 11:20:39 +03:00
Ilya Kirillov
3030a03584 New J2K: Replace backAnnotator with PsiOwner 2019-04-03 11:20:38 +03:00
Ilya Kirillov
c948e2d086 New J2K: Fix operatorName in JKKtSingleValueOperatorToken 2019-04-03 11:20:37 +03:00
Ilya Kirillov
6051b455bf New J2K: Add type for unresolved symbols 2019-04-03 11:20:36 +03:00
Ilya Kirillov
41640e1a15 New J2K: Add dependency to idea-core in j2k 2019-04-03 11:20:36 +03:00
Ilya Kirillov
29c536579f New J2K: Add converting type functions from kotlin one to j2k one 2019-04-03 11:20:35 +03:00
Ilya Kirillov
dbdd39c6ab New J2K: Add type calculating for more kinds of JKExpressions 2019-04-03 11:20:34 +03:00
Ilya Kirillov
71b3fe33a3 New J2K: Add operator tokens 2019-04-03 11:20:33 +03:00
Ilya Kirillov
cd2a17ae56 New J2K: Add calculating type for binary expressions & building binary expression with correct return type 2019-04-03 11:20:32 +03:00
Ilya Kirillov
5e4b39f10f New J2K: Add calculating type for JKExpression 2019-04-03 11:20:32 +03:00
Ilya Kirillov
27526cf866 New J2K: Add labeled statement 2019-04-03 11:20:31 +03:00
Ilya Kirillov
0a08467b45 New J2K: Add continue statement 2019-04-03 11:20:30 +03:00
Ilya Kirillov
ed61aac4fd New J2K: Add Java for loop to Kotlin while or for in loop conversion 2019-04-03 11:20:29 +03:00
Ilya Kirillov
07f99fe0d2 New J2K: Don't move initilizer to constructor if types are not the same 2019-04-03 11:20:29 +03:00
Ilya Kirillov
baa9b714d1 New J2K: Add init block 2019-04-03 11:20:28 +03:00
Ilya Kirillov
b6239a9130 New J2K: Fix InsertDefaultPrimaryConstructorConversion acceptability determining 2019-04-03 11:20:27 +03:00
Ilya Kirillov
d688b6c6da New J2K: Add filter & sort modifiers conversion 2019-04-03 11:20:26 +03:00
Ilya Kirillov
a7e0f18a57 New J2K: Add primary constructor initializers conversion 2019-04-03 11:20:25 +03:00
Ilya Kirillov
2aafeda33b New J2K: Add detect primary constructors conversion 2019-04-03 11:20:25 +03:00
Ilya Kirillov
44d2a6f432 New J2K: Add printing of Java new expression 2019-04-03 11:20:24 +03:00
Ilya Kirillov
6d283b0ac1 New J2K: Add operation's text for some java operators 2019-04-03 11:20:23 +03:00
Ilya Kirillov
451a462b07 New J2K: Add printing of do-while statement 2019-04-03 11:20:22 +03:00
Ilya Kirillov
19c569e8e2 New J2K: Add conversion of Java instanceof expression to Kotlin is expression 2019-04-03 11:20:21 +03:00
Ilya Kirillov
c3ffaa34f8 New J2K: Do not ignore unused vals in CanBeVal inspection in postprocessing 2019-04-03 11:20:20 +03:00
Ilya Kirillov
4d1b2a8d5b New J2K: Add Java switch statement to Kotlin when expression conversion 2019-04-03 11:20:20 +03:00
Ilya Kirillov
6e079e38fe New J2K: Add AST copy tree function 2019-04-03 11:20:19 +03:00
Ilya Kirillov
18164b116b New J2K: Add support of break statements 2019-04-03 11:20:18 +03:00
Simon Ogorodnik
7e2d0695fe New J2K: Use context type for lambda in block to run call conversion 2019-04-03 11:20:18 +03:00
Dimach
2f1c621b5f New J2K: Improve type system and nullability computation in type mapper 2019-04-03 11:20:17 +03:00
Dimach
abc4104ba7 New J2K: Implement Array init conversions 2019-04-03 11:20:17 +03:00
Dimach
f3ffb2acfd New J2K: Implement assignment simplify conversion 2019-04-03 11:20:16 +03:00
Simon Ogorodnik
77819be8f3 New J2K: Add function to lookup symbols by fqName 2019-04-03 11:20:15 +03:00
Dimach
c43bfcb185 New J2K: Introduce context type 2019-04-03 11:20:14 +03:00
Simon Ogorodnik
986b38102e New J2K: Add insert default constructor conversion 2019-04-03 11:20:13 +03:00
Simon Ogorodnik
aef8a7a8f1 New J2K: Clearer return type for recurse 2019-04-03 11:20:13 +03:00
Simon Ogorodnik
6fd2cc73cf New J2K: Remove incorrect ClassKind 2019-04-03 11:20:12 +03:00
Simon Ogorodnik
815070013f New J2K: Split conversions into sequential and batch 2019-04-03 11:20:11 +03:00
Simon Ogorodnik
d793769e92 New J2K: Add block statement to run conversion 2019-04-03 11:20:11 +03:00
Simon Ogorodnik
f496a472f4 New J2K: Even better test diff UI 2019-04-03 11:20:10 +03:00
Simon Ogorodnik
15981fed17 New J2K: Improve UI 2019-04-03 11:20:10 +03:00
Simon Ogorodnik
3dbdb2b64d New J2K: Support 'override' modality 2019-04-03 11:20:09 +03:00
Simon Ogorodnik
dcffb60dc9 New J2K: Create UI for tracking test changes 2019-04-03 11:20:08 +03:00
Simon Ogorodnik
e0d3ff7507 New J2K: WIP: Field to property conversion 2019-04-03 11:20:07 +03:00
Simon Ogorodnik
dbf4ba536f New J2K: Implement removing of explicit types in post-processing 2019-04-03 11:20:06 +03:00
Simon Ogorodnik
1c1804f22d New J2K: Fix after merge 2019-04-03 11:20:05 +03:00
Simon Ogorodnik
2844f8d5d9 New J2K: Add conversion to promote classes with only companions into objects 2019-04-03 11:20:04 +03:00
Simon Ogorodnik
fba5ac4c1a New J2K: Post-processing to remove redundant opens in objects 2019-04-03 11:20:03 +03:00
Simon Ogorodnik
ae1f27e327 New J2K: Add conversion that moves statics to companion object 2019-04-03 11:20:02 +03:00
Simon Ogorodnik
38760a8b7c New J2K: Support this qualifier in default arguments converter 2019-04-03 11:20:01 +03:00
Simon Ogorodnik
b868214992 New J2K: Improve debug tree printer, now it capable of printing universe symbols 2019-04-03 11:20:01 +03:00
Simon Ogorodnik
53ebdb4a02 New J2K: Add missing accept for NameIdentifier 2019-04-03 11:20:00 +03:00
Simon Ogorodnik
4eb070a2dc New J2K: Support QuickFixActionBase for inspections in J2K Post-processing 2019-04-03 11:19:59 +03:00
Simon Ogorodnik
bc5ff67aff New J2K: Correctly support variables mutability 2019-04-03 11:19:58 +03:00
Simon Ogorodnik
f147907799 New J2K: Fix incorrect testData (due to nullability bug in old j2k) 2019-04-03 11:19:57 +03:00
Simon Ogorodnik
b530a30882 New J2K: Support different testData for new converter
Sometimes old testData is incorrect
2019-04-03 11:19:56 +03:00
Simon Ogorodnik
800b09b183 New J2K: Add temporary conversion for println calls 2019-04-03 11:19:56 +03:00
Simon Ogorodnik
911f234ba4 New J2K: Implement basic default argument converter 2019-04-03 11:19:55 +03:00
Simon Ogorodnik
34b535c8ab New J2K: Add missing accept for null literal 2019-04-03 11:19:55 +03:00
Simon Ogorodnik
4637903e00 New J2K: Add conversion which will initialize java implicit initialized fields 2019-04-03 11:19:54 +03:00
Simon Ogorodnik
61fd76a89a New J2K: Support relaxed visibility for members of package-local classes 2019-04-03 11:19:53 +03:00
Simon Ogorodnik
1b7c980c83 New J2K: Put braces on same line, if block is empty 2019-04-03 11:19:52 +03:00
Simon Ogorodnik
63fd2439bf New J2K: Hack around type nullability calculation 2019-04-03 11:19:51 +03:00
Simon Ogorodnik
65e0694ba1 New J2K: Primary constructor conversion 2019-04-03 11:19:51 +03:00
Simon Ogorodnik
6793c1d08f New J2K: Constructor conversion 2019-04-03 11:19:50 +03:00
Simon Ogorodnik
e83844e941 New J2K: Inner class conversion 2019-04-03 11:19:49 +03:00
Simon Ogorodnik
c87cd20a9d New J2K: Add rendering for type-parameters 2019-04-03 11:19:48 +03:00
Simon Ogorodnik
b12a91c111 New J2K: Add test with structural compare and cleanup duplicated code in tests 2019-04-03 11:19:47 +03:00
Simon Ogorodnik
ac20e9ba83 New J2K: Render list of implemented correctly 2019-04-03 11:19:46 +03:00
Simon Ogorodnik
b8bbd85bc7 New J2K: Preserve text for unresolved types, and render it in code builder 2019-04-03 11:19:45 +03:00
Simon Ogorodnik
7e2be15fcc New J2K: Clean-up parenthesizing and block rendering in code builder 2019-04-03 11:19:44 +03:00
Simon Ogorodnik
07a33ceebd New J2K: Remove unnecessary modifiers in post-processing 2019-04-03 11:19:43 +03:00
Simon Ogorodnik
13a63e421b New J2K: Print function modifiers and relax method visibility in test 2019-04-03 11:19:43 +03:00
Dimach
fe180138f3 New J2K: Assignment conversion second part. 2019-04-03 11:19:42 +03:00
Dimach
3a2b2d9e97 New J2K: Assignment expression conversion improvements 2019-04-03 11:19:41 +03:00
Simon Ogorodnik
b702e207c0 New J2K: Add inheritance and support while & type-casts in code builder 2019-04-03 11:19:40 +03:00
Simon Ogorodnik
928647462e New J2K: Support general inspections with intention wrapper as quickFix 2019-04-03 11:19:39 +03:00
Simon Ogorodnik
c41be3274e New J2K: Cleanup code generation 2019-04-03 11:19:38 +03:00
Simon Ogorodnik
2e7940149f New J2K: Break line after class def 2019-04-03 11:19:37 +03:00
Simon Ogorodnik
049bb4a8af New J2K: Don't add abstract if not class 2019-04-03 11:19:37 +03:00
Dimach
d73b006b18 New J2K: Lambda expressions. 2019-04-03 11:19:36 +03:00
Dimach
795bfa4b2f New J2K: Fix array assignment. 2019-04-03 11:19:35 +03:00
Dimach
4a0df846de New J2K: Some changes to assignment expression. 2019-04-03 11:19:34 +03:00
Dimach
0078a5a61b New J2K: Symbol provider refactor. 2019-04-03 11:19:33 +03:00
Dimach
e1f47823d4 New J2K: Array access expression. 2019-04-03 11:19:32 +03:00
Dimach
81c0dae139 New J2K: Polyadic expression conversion. 2019-04-03 11:19:31 +03:00
Dimach
15ad2af268 New J2K: More binary expressions support and boolean literals. 2019-04-03 11:19:30 +03:00
Dimach
d183285a75 New J2K: Added unresolved field references. 2019-04-03 11:19:29 +03:00
Simon Ogorodnik
f6a5ac9d97 New J2K: Standardize modality and visibility 2019-04-03 11:19:28 +03:00
Simon Ogorodnik
0ec2fb3d17 New J2K: Introduce JKFile 2019-04-03 11:19:27 +03:00
Simon Ogorodnik
e4fc4b8218 New J2K: Create services for new j2k 2019-04-03 11:19:26 +03:00
Simon Ogorodnik
9d3805defe New J2K: Apply post-processing to nj2k results 2019-04-03 11:19:25 +03:00
Simon Ogorodnik
b216574298 New J2K: Support general inspections in j2k post-processing 2019-04-03 11:19:24 +03:00
Simon Ogorodnik
ccb941ab1c New J2K: Fix type mapper 2019-04-03 11:19:23 +03:00
Simon Ogorodnik
279c835d04 New J2K: Fix nullability for converted primitive types 2019-04-03 11:19:22 +03:00
Dimach
72c88c9003 New J2K: Reference resolve for parameters. 2019-04-03 11:19:22 +03:00
Dimach
6f84750af4 New J2K: Fixed resolve of class reference. 2019-04-03 11:19:21 +03:00
Dimach
97e38615f1 New J2K: Correct resolve of local variables. 2019-04-03 11:19:20 +03:00
Dimach
485f5c7e37 New J2K: Binary expression conversion 2019-04-03 11:19:19 +03:00
Dimach
674b3ce02e New J2K: Fixed modifiers conversion, expression test now can pass. 2019-04-03 11:19:18 +03:00
Dimach
b33f5ec58f New J2K: Fixed wrong whitespace 2019-04-03 11:19:18 +03:00
Dimach
8430ada13b New J2K: Fixed few bugs in conversions and symbols improvements. 2019-04-03 11:19:17 +03:00
Dimach
39cf373286 New J2K: Operators translation. 2019-04-03 11:19:16 +03:00
Dimach
21ae28025c New J2K: Declaration statement and local variables. 2019-04-03 11:19:16 +03:00
Dimach
14dd4fc92f New J2K: Added modifiers conversion and correct resolve of void type. 2019-04-03 11:19:15 +03:00
Dimach
ab723b1d39 New J2K: Added more cases to code builder. 2019-04-03 11:19:14 +03:00
Dimach
b06f0fe848 New J2K: Code builder now VoidVisitor 2019-04-03 11:19:14 +03:00
Dimach
8ce3673aaf New J2K: Fixed array initializer 2019-04-03 11:19:13 +03:00
Dimach
6096b1fd56 New J2K: Java polyadic expression 2019-04-03 11:19:13 +03:00
Dimach
4fe9b6a7c6 New J2K: If expression improvements.
Fixed field resolve.
2019-04-03 11:19:12 +03:00
Simon Ogorodnik
986cb5be27 New J2K: Add more elements to code builder 2019-04-03 11:19:11 +03:00
Simon Ogorodnik
a9ff38f1fa New J2K: Rename parameters to match supertype 2019-04-03 11:19:11 +03:00
Simon Ogorodnik
7fcdcb20d6 New J2K: Some code-builder basic stuff 2019-04-03 11:19:10 +03:00
Simon Ogorodnik
ad0721aae7 New J2K: Extract fqName resolution 2019-04-03 11:19:10 +03:00
Simon Ogorodnik
00c52df519 New J2K: Add missing accept's 2019-04-03 11:19:09 +03:00
Simon Ogorodnik
235dacfd88 New J2K: Copy return type 2019-04-03 11:19:09 +03:00
Simon Ogorodnik
caa4af07c1 New J2K: Fix crash in fqName resolution 2019-04-03 11:19:08 +03:00
Simon Ogorodnik
2c2bd9ab5a New J2K: Support all java operators 2019-04-03 11:19:07 +03:00
Dimach
6dc8933a93 New J2K: While, switch, conditional expression, moved if. 2019-04-03 11:19:07 +03:00
Simon Ogorodnik
d718fae6d9 New J2K: Deal with unresolved class types 2019-04-03 11:19:06 +03:00
Simon Ogorodnik
c53f56629e New J2K: Correctly resolve references to default constructor 2019-04-03 11:19:05 +03:00
Simon Ogorodnik
0e2dac0899 New J2K: Add nullability to all types 2019-04-03 11:19:05 +03:00
Simon Ogorodnik
58de0ae6bc New J2K: Always use text for literals 2019-04-03 11:19:04 +03:00
Dimach
7fbff168dd New J2K: Symbol provider improvements. 2019-04-03 11:19:03 +03:00
Dimach
45eecf2c90 New J2K: Added this and super expressions. 2019-04-03 11:19:02 +03:00
Dimach
a1d37034c4 New J2K: If, for, instanceof, code block statement. 2019-04-03 11:19:01 +03:00
Simon Ogorodnik
607d9820e7 New J2K: Add body stub for abstract methods & set return type to void for <init> 2019-04-03 11:19:01 +03:00
Simon Ogorodnik
cb4474b9a4 New J2K: Add literal conversion 2019-04-03 11:19:00 +03:00
Simon Ogorodnik
c84ecb162e New J2K: Extract common conversions logic to base class 2019-04-03 11:18:59 +03:00
Dimach
003cee8cc1 New J2K: Added assertion statement and more operators. 2019-04-03 11:18:59 +03:00
Dimach
3bbef363e6 New J2K: Added declaration statements, local variables and stub expression. 2019-04-03 11:18:58 +03:00
Simon Ogorodnik
26c011b44a New J2K: Add todo about missing lambda expression element 2019-04-03 11:18:58 +03:00
Simon Ogorodnik
a5f0097dc7 New J2K: Add conversion for assignment as expression to also call 2019-04-03 11:18:57 +03:00
Simon Ogorodnik
fd69efa4c2 New J2K: Add missing literals and cleanup literal handling in tree builder 2019-04-03 11:18:56 +03:00
Simon Ogorodnik
b7fd8e32cb New J2K: Introduce invalidate to mark element for removal, freeing it's children 2019-04-03 11:18:56 +03:00
Simon Ogorodnik
7c5e9cd669 New J2K: Add all primitive types 2019-04-03 11:18:55 +03:00
Simon Ogorodnik
77b6eca76e New J2K: Cleanup element impls to reference nested elements via delegates 2019-04-03 11:18:54 +03:00
Simon Ogorodnik
9f7146d8b9 New J2K: Prohibit to override acceptChildren for BranchElementBase 2019-04-03 11:18:54 +03:00
Simon Ogorodnik
855d713368 New J2K: Use require & check instead of assert in tree consistency check 2019-04-03 11:18:53 +03:00
Simon Ogorodnik
7c278bfbab New J2K: Extract base from concrete implementations 2019-04-03 11:18:52 +03:00
Dimach
bfb0f4a369 New J2K: Type system refactored, parents from types removed, added JKTypeElement 2019-04-03 11:18:52 +03:00
Simon Ogorodnik
bc645a12b5 New J2K: More info in TODO 2019-04-03 11:18:51 +03:00
Simon Ogorodnik
278cf82346 New J2K: Use proper tree structure in kt elements 2019-04-03 11:18:51 +03:00
Simon Ogorodnik
13475cde01 New J2K: Add accept 2019-04-03 11:18:50 +03:00
Simon Ogorodnik
4892784f70 New J2K: Improve debug tree printer for types 2019-04-03 11:18:49 +03:00
Dimach
aea0511486 New J2K: Resolve symbols properly 2019-04-03 11:18:49 +03:00
Dimach
f912639999 New J2K: Done symbols 2019-04-03 11:18:48 +03:00
Simon Ogorodnik
1e4737b4b2 New J2K: Fix reference resolution in type mapper conversion 2019-04-03 11:18:48 +03:00
Simon Ogorodnik
7cccb99982 New J2K: WIP: Type mapper 2019-04-03 11:18:47 +03:00
Dimach
f64c32fd71 New J2K: Changed references to symbols. 2019-04-03 11:18:46 +03:00
Simon Ogorodnik
985e94fbf3 New J2K: Add from argument to detach
Support detach/attach/multilist in applyRecursive

Clarify attach/detach/onElementChanged order
2019-04-03 11:18:46 +03:00
Simon Ogorodnik
9b205c2825 New J2K: Remove multiverse 2019-04-03 11:18:45 +03:00
Dimach
83f9054a7e New J2K: Added list child into JKBranchElement. Added attach and detach method to JKElement 2019-04-03 11:18:44 +03:00
Simon Ogorodnik
f691fb457e New J2K: WIP: Type mapping conversion 2019-04-03 11:18:44 +03:00
Simon Ogorodnik
a55591011a New J2K: WIP: New field to property conversion 2019-04-03 11:18:43 +03:00
Simon Ogorodnik
edd23c7a83 New J2K: WIP: Introduce symbols instead of references 2019-04-03 11:18:43 +03:00
Simon Ogorodnik
4b3fdbcb0b New J2K: Enable effect-system and new inference 2019-04-03 11:18:42 +03:00
Simon Ogorodnik
9ca6829bda New J2K: Cleanup 2019-04-03 11:18:41 +03:00
Simon Ogorodnik
254179321c New J2K: Rename visitable JKElement to JKTreeElement 2019-04-03 11:18:41 +03:00
Simon Ogorodnik
3aeffe25ee New J2K: Try another approach to tree structure 2019-04-03 11:18:40 +03:00
Simon Ogorodnik
4551d3921b New J2K: Fix after merge 2019-04-03 11:18:39 +03:00
Dimach
6806ef8cf6 New J2K: Separated multiverse and universe declarations 2019-04-03 11:18:39 +03:00
Dimach
c398940679 New J2K: Tree refactor.
Added parents, transformers removed.
2019-04-03 11:18:38 +03:00
Dimach
2ee7e3c0e8 New J2K: Fixed errors 2019-04-03 11:18:38 +03:00
Dimach
aeae668f3d New J2K: Addded kt expressions and changed literals logic. 2019-04-03 11:18:37 +03:00
Dimach
fb32783168 New J2K: ArrayType and PrimitiveType 2019-04-03 11:18:36 +03:00
Dimach
09d52d13b8 New J2K: Type system. 2019-04-03 11:18:36 +03:00
Dimach
dfd745d55b New J2K: Fixed errors. 2019-04-03 11:18:35 +03:00
Dimach
10ff8d500b New J2K: References base done. 2019-04-03 11:18:34 +03:00
knize
c8c9c19a91 New J2K: References base 2019-04-03 11:18:34 +03:00
Kirill Knize
70c291f222 New J2K: Add kotlin declarations to IR (#9) 2019-04-03 11:18:33 +03:00
Kirill Knize
c662813b09 New J2K: Implement transformChildren here and there
PR (#6)
2019-04-03 11:18:33 +03:00
Simon Ogorodnik
2f38edb55f New J2K: Display element type when hit visitElement 2019-04-03 11:18:32 +03:00
Simon Ogorodnik
a4630af109 New J2K: Simple code builder 2019-04-03 11:18:31 +03:00
Simon Ogorodnik
dc73d415ad New J2K: Fix declarations to JK conversion 2019-04-03 11:18:31 +03:00
Dimach
dd499d7a13 New J2K: Rebase to latest changes. 2019-04-03 11:18:30 +03:00
Dimach
a94957aa0f New J2K: Added java -> jk converter for new array, type cast, array access and parenthesized expression. 2019-04-03 11:18:30 +03:00
Dimach
4ecbd13e06 New J2K: Added java -> jk converter for new expression. 2019-04-03 11:18:29 +03:00
Dimach
5bf806b85c New J2K: Added java -> jk converter for field access. 2019-04-03 11:18:28 +03:00
Dimach
98d01d600a New J2K: Added java -> jk converter for method call. 2019-04-03 11:18:28 +03:00
Dimach
9bfd8e4453 New J2K: Added basic expression converter. 2019-04-03 11:18:27 +03:00
Knize
d17548ba73 New J2K: Nj2k modifiers hierarchy (#3) 2019-04-03 11:18:26 +03:00
Knize
24803e31fd New J2K: Add class mapper 2019-04-03 11:18:26 +03:00
knize
e3097d8c1f New J2K: class tree mapper 2019-04-03 11:18:25 +03:00
Simon Ogorodnik
e33df530cd New J2K: First conversion 2019-04-03 11:18:25 +03:00
Simon Ogorodnik
8ac5eadadc New J2K: Update transformers to new style 2019-04-03 11:18:24 +03:00
Simon Ogorodnik
517dd9a260 New J2K: Fix debug tree printer after switching to single visitor 2019-04-03 11:18:23 +03:00
Simon Ogorodnik
8ff78611ba New J2K: Make generics in transformers accept least common interface 2019-04-03 11:18:23 +03:00
Simon Ogorodnik
c1f50d3594 New J2K: Drop separated visitors 2019-04-03 11:18:22 +03:00
Simon Ogorodnik
68c03a6236 New J2K: Add transformers 2019-04-03 11:18:22 +03:00
Simon Ogorodnik
4f7c46741e New J2K: Add debug tree visitor and some tree elements 2019-04-03 11:18:21 +03:00
Simon Ogorodnik
3ff0287c9f New J2K: Stub for JavaField initializer 2019-04-03 11:18:20 +03:00
Simon Ogorodnik
e77fe74284 New J2K: Add Block primitive 2019-04-03 11:18:20 +03:00
Simon Ogorodnik
7ce3c57896 New J2K: Add some primitive tests for new converter 2019-04-03 11:18:19 +03:00
Simon Ogorodnik
66d6ac745f New J2K: Implement basic output generation 2019-04-03 11:18:18 +03:00
Simon Ogorodnik
5fd3a78dbe New J2K: Add basic tree structure and visitor generation script 2019-04-03 11:18:18 +03:00
Simon Ogorodnik
9d9dbb4c25 New J2K: Add stub for JKTree builder 2019-04-03 11:18:17 +03:00
Simon Ogorodnik
f50254d555 New J2K: Move TODO to NewJavaToKotlinConverter 2019-04-03 11:18:17 +03:00
Simon Ogorodnik
ff0b09f77b New J2K: Replicate J2K Single File test for New J2K 2019-04-03 11:18:16 +03:00
Simon Ogorodnik
b151e9c48c New J2K: Add New J2K entry-point stub 2019-04-03 11:18:15 +03:00
Simon Ogorodnik
fb49267819 New J2K: Cleanup J2K single file test and make it extensible 2019-04-03 11:18:15 +03:00
Simon Ogorodnik
f2595e58e5 New J2K: Add newSrc source root for J2K 2019-04-03 11:18:14 +03:00
Simon Ogorodnik
1fd5738a60 Add kapt3-idea to J2K classpath to avoid spam in logs 2019-04-03 11:18:14 +03:00
Vyacheslav Gerasimov
394031a183 Build: Fix upload_plugins.gradle broken after migration to gradle 5.0
`<< {` syntax is removed since gradle 5.0
2019-04-02 23:14:23 +03:00
Ilya Gorbunov
04bbf23936 Add explicit imports of kotlin.ranges more specific functions
The extensions 'contains' and 'reversed' from kotlin.ranges can be more
specific for IntRange, LongRange, etc than the same functions from
kotlin.collections, yet they lose in overload resolution to the latter
ones when invoked from kotlin.collections package
because of same package package extensions are preferred (KT-30633).
2019-04-02 21:28:33 +03:00
Ilya Gorbunov
d77f76bdb0 Clarify wording in Random.nextInt/Long/UInt/ULong docs
#KT-30704 Fixed
2019-04-02 21:28:32 +03:00
Andrey Uskov
792fae4afc Optimize memory usage during import of MPP projects
#KT-30767 Fixed
2019-04-02 21:23:07 +03:00
Dmitry Gridin
3ca1c7b55d "Convert property to function" intention should warn about the property overloads at child class constructor
#KT-29764 Fixed
2019-04-02 22:53:56 +07:00
Dmitry Gridin
c8ea62a0d9 Change function signature should change type parameters
#KT-22896 Fixed
2019-04-02 22:53:13 +07:00
Dmitry Gridin
5e613554ee Minor: refactoring ChangeMemberFunctionSignatureFix 2019-04-02 22:53:13 +07:00
Dmitry Gridin
c48c274e59 Minor: refactoring ChangeFunctionSignature quickfix 2019-04-02 22:53:13 +07:00
Ilya Matveev
cb38f13399 Gradle plugin: Enable missing mingw_x86 target for K/N 2019-04-02 20:59:12 +07:00
Alexander Gorshenev
4332ce9884 Grab constructor call type parameters from its class, not from the contructor 2019-04-02 16:55:58 +03:00
Toshiaki Kameyama
e082522cdf Strip trailing spaces on Save: do not strip trailing spaces inside raw String
#KT-13048 Fixed
2019-04-02 15:27:08 +03:00
Ting-Yuan Huang
9fc869397d IrBuiltins: refactoring for equality checks
Previously,
* Equals performs IEEE 754 equality check for floating points and
  byte-to-byte checks for other types, including references.
* Ieee754Equals performs IEEE 754 for primitive types
* TotalOrderEquals performs total order equals to all types, including
  floating points.

Now it is simplified,
* Equals performs total order checks for all types.
* Ieee754Equals performs IEEE 754 for primitive types.
* (TotalOrderEquals is removed.)
2019-04-02 13:16:31 +02:00
Ilya Chernikov
9ddb64288c Avoid warning about scripting subplugin for MPP project
Temporary solution, the subplugin should be adapted to the new MPP
#KT-30742 fixed
2019-04-02 12:28:06 +02:00
Mikhail Zarechenskiy
63bdabcfae [NI] Clean up after merge with 3998e842 2019-04-02 12:21:15 +03:00
Mikhail Zarechenskiy
c458393e2f [NI] Do not avoid trivial constraints if they aren't from upper bounds
Since we skipped trivial constraint with `Any?` from parameter type of
 function `equals`, the compiler thought that there is no proper
 constraints (upper bounds do not matter here) and marked resolved
 call as a failed one, then diagnostic about missing equals was added

 Also, tune `TrivialConstraintTypeInferenceOracle` for `Any?`-like
 constraints

 #KT-30724 Fixed
2019-04-02 12:21:14 +03:00
Mikhail Zarechenskiy
5fa518fd55 Revert "Temporary fix for NI to compile against bootstrap compiler"
This reverts commit 791ab05e08.

 Problem was fixed in 4a1b9dcc & 1ac35420
2019-04-02 12:21:14 +03:00
Nikolay Krasko
5723bfdcaf Add a point about invalidated state between inspection checks and quick-fix run 2019-04-02 11:48:47 +03:00
Burak Eregar
9ab54d0e44 Fix: String templates suggest removing curly braces for backtick escaped identifiers 2019-04-02 11:48:47 +03:00
Toshiaki Kameyama
17a4506575 Keyword completion: complete data class with parentheses
#KT-30511 Fixed
2019-04-02 11:48:47 +03:00
Nikolay Krasko
f1a31652b3 Add action for collection basic information about Kotlin project (KT-11242)
#KT-11242 Fixed
2019-04-02 11:48:47 +03:00
Sergey Rostov
3465a30201 JPS Build: exclude intellij-core that comes from android tools
#KT-30247 Fixed
2019-04-02 09:27:26 +03:00
Toshiaki Kameyama
61f3e776a7 Add 'Covariant equals' inspection
#KT-29798 Fixed
2019-04-02 13:19:05 +07:00
Simon Ogorodnik
3998e842f1 Abstract NewInference & related from KotlinType
Cleanup TypeConstructors & KotlinTypes in VariableFixationFinder
Cleanup TypeConstructors & KotlinTypes in TypeVariableDirectionCalculator
Cleanup KotlinTypes in TypeCheckerContext for ConstraintSystem
Cleanup KotlinTypes in NewCommonSuperTypeCalculator
Cleanup KotlinTypes in TypeApproximator
Cleanup type substitution
Cleanup NewTypeVariable
Cleanup StubType
Cleanup TypeCheckerContext creation, extract common supertype context
Provide TypeSystemInferenceExtensionContext via dependency injection
2019-04-01 22:08:04 +03:00
Leonid Startsev
0ffded5bac Insert correct dispatch receivers and type arguments for expression inside generated by plugin IR functions 2019-04-01 18:54:16 +03:00
Ilya Chernikov
075a902ceb Revert createClassLikeInfo method signature change, depreceate it ...
instead and make alternative method for refactored usages.
Should fix compatibility with the Spek framework plugin.
2019-04-01 17:37:33 +02:00
Ilmir Usmanov
070fb7c250 Fix test data 2019-04-01 18:19:34 +03:00
Ilmir Usmanov
d2a80e7938 Add $result to suspend functions' LVT
#KT-28535
2019-04-01 18:19:32 +03:00
Ilmir Usmanov
05937a28ee Rename result to $result
this way it does not interfere with user-defined variables.
 #KT-28535 Fixed
2019-04-01 18:19:31 +03:00
Alexander Podkhalyuzin
742ffb98ad Use indexes instead of slow directory search for script dependencies
#KT-30018 Comment
2019-04-01 17:54:28 +03:00
Natalia Selezneva
0de0321fa9 Do not call FileEditorManager.getSelectedEditor outside UI thread (KT-30130)
^KT-30130 Fixed
2019-04-01 14:28:17 +03:00
Sergey Rostov
0e0c78317d Gradle, Kotlin/JS: enable source maps by default, get it working on tests.
Publish kotlin-test-nodejs-runner separately from kotlin-gradle-plugin.
2019-04-01 08:42:10 +03:00
Mikhail Zarechenskiy
a4cbec64b7 [NI] Remove failing codegen tests and add similar diagnostic one
These tests were added for suspend-conversions, it worked only
 with new inference, but implementation was incorrect and had other
 bugs, which were fixed in 1ac25259.
 Support of suspend-conversions will be addressed later with a different
 implementation (#KT-30703)
2019-04-01 01:36:15 +03:00
Toshiaki Kameyama
4a3e4f099d KT-30451 Redundant call of selector in maxBy&minBy
Refactor maxBy & minBy: do not call selector when collection has single item
2019-03-31 05:11:05 +03:00
Ilmir Usmanov
8c8ad48152 Enable test 2019-03-30 04:18:55 +03:00
Ilmir Usmanov
ea1e72e7b4 Generate $this$<label> as receiver name instead of $receiver 2019-03-30 04:18:53 +03:00
Ilmir Usmanov
6f14dcfacb Put suspend lambda's parameters to LVT
#KT-26412 Fixed
 #KT-28534 Fixed
2019-03-30 04:18:50 +03:00
LepilkinaElena
21fe5ac415 Fix parser for linkerOpts/compilerOpts (KT-29970) (#2219) 2019-03-29 20:13:23 +03:00
Dmitry Gridin
09b58403b9 Improve "ReplaceWith" for class with generic parameter
#KT-27089 Fixed
2019-03-29 22:35:03 +07:00
Dmitry Gridin
88b0db6dd7 ReplaceWith intention could save generic type arguments
#KT-21195 Fixed
2019-03-29 22:35:03 +07:00
Dmitry Gridin
b0f7ddd693 Minor: refactoring replaceWith package 2019-03-29 22:35:03 +07:00
Dmitry Gridin
c343876f7c Minor: refactoring codeInliner package 2019-03-29 22:35:03 +07:00
Ilya Chernikov
16ae313b22 Apply scripting subplugin in gradle mpp plugin, so scripts could be added to mpp sources
#KT-30679 fixed
2019-03-29 15:48:45 +01:00
Ilya Chernikov
3a3ba5bd8d Fix scripts discovery in IDEA after adding optional marker extension 2019-03-29 15:47:39 +01:00
romanart
4f1ee649b0 [IR] Fix type mismatch in LocalDeclarationLowering
Note: fix is required to enable @OnlyInputTypes annotation in NI
2019-03-29 17:40:44 +03:00
Dmitriy Novozhilov
f5ca69c324 [NI] Add codegen test for IntegerLiteralType for js backend 2019-03-29 17:38:55 +03:00
Ilmir Usmanov
3e5bc674d6 Update test data 2019-03-29 17:02:44 +03:00
Ilmir Usmanov
3bfee39995 Generate debug metadata for lambdas which capture crossinline lambdas
After cold stream related fixes, we do not generate state machine until
the very last transformation of the lambda. Thus, it is safe to
generate debug metadata for that lambda.
 #KT-30694 Fixed
2019-03-29 17:02:42 +03:00
Ilmir Usmanov
f09457c569 Minor. Remove sourceFile from CoroutineTransformerMethodVisitor's parameters 2019-03-29 17:02:40 +03:00
Dmitry Petrov
2c9ed73ba8 IR: create stubs for constructor type parameters
Java constructors can have type parameters of their own:
  public class J<X extends Number> {
    public <Y extends CharSequence> J() {}
  }

When such constructors are called from Kotlin, type parameters for
constructor follow type parameters for class:
  fun test() = J<Int, String>() // <X=Int, Y=String>

Descriptor-based representation uses the same type parameters ordering.

Also, use 'withScope' in IrLazyFunction type parameters creation.
2019-03-29 16:00:56 +03:00
Dmitry Petrov
8be7f7f1f7 IR: Make sure that symbols refer to original descriptors only
If a descriptor is a WrappedDeclarationDescriptor, it SHOULD NOT be
substituted.
2019-03-29 16:00:56 +03:00
Alexander Udalov
cd6c88fa2c Do not use .kotlin_module files in reflection
Previously, we used a pretty roundabout way to load a MemberScope from a
single file facade represented by KPackageImpl, which involved going
through ModuleDescriptor, PackageFragmentProvider, PackagePartProvider
etc. The only advantage of this approach was that it sort of works
similarly as in the compiler, however mutable state in
RuntimePackagePartProvider and the fact that .kotlin_module files were
required for this to work diminished this advantage.

In this change, we load MemberScope from a KPackageImpl pretty much
directly, by using the existing method
`DeserializedDescriptorResolver.createKotlinPackagePartScope` and
caching the result in the new component PackagePartScopeCache.

 #KT-30344 Fixed
2019-03-29 13:44:23 +01:00
Alexander Udalov
7aa75ab89b Minor, update reflection tests on stdlib
Since functionFromStdlibSingleFileFacade.kt was introduced, lazyOf was
also moved to a multifile class, so we're using another function to test
that reflection on a single file package facade from stdlib works
2019-03-29 13:44:23 +01:00
Dmitriy Novozhilov
719e25c3dd [NI] Fix testdata of codegen test for IntegerLiteralType 2019-03-29 15:20:53 +03:00
Alexander Udalov
36efbc8920 JVM IR: rename JvmBackendContext.getClass and return symbol instead of descriptor 2019-03-29 12:07:11 +01:00
Alexander Udalov
b32241c967 JVM IR: build all needed stdlib symbols in JvmSymbols manually
This removes the mandatory dependency of all JVM IR tests on
kotlin-stdlib (ConfigurationKind.ALL in all IR test cases) and speeds up
tests which don't need kotiln-stdlib by about 20%. Another advantage of
this method is that all required dependencies are listed in one file,
are easy to grasp, and changes to the related code generation can be
done independently of the corresponding changes in the actual library,
which may help in bootstrapping the compiler
2019-03-29 12:07:11 +01:00
Roman Artemev
6b7eba485b [JS] Run all js tests in v8 2019-03-29 13:38:08 +03:00
Igor Chevdar
3838a2f648 [IR] Copied functions from IrGenerator to IrBuilder
With that the number of UNDEFINED_OFFSET should be greater reduced
2019-03-29 12:47:34 +03:00
Mikhail Zarechenskiy
1ac25259e8 [NI] Support callable references to suspend functions
#KT-30658 Fixed
2019-03-29 12:32:01 +03:00
Mikhail Zarechenskiy
017f9aea35 [NI] Builder-inference: fix unresolved reference for variable calls 2019-03-29 12:32:01 +03:00
Mikhail Zarechenskiy
d6db1a1b35 [NI] Relax requirement for stub types in builder-inference
For functions with implicit return type annotations will be replaced
 anyway in order to initialize return type, so this restriction in
 `StubType` was too strong

 #KT-30656 Fixed
2019-03-29 12:32:01 +03:00
Mikhail Zarechenskiy
b10d19dc78 [NI] Align builder inference with the old inference
#KT-29184 Fixed
2019-03-29 12:32:00 +03:00
Mikhail Zarechenskiy
1eb70ea19e [NI] Update test data related to builder-inference 2019-03-29 12:32:00 +03:00
Mikhail Zarechenskiy
b033b9180b [NI] Avoid builder-inference algorithm if types specified explicitly
#KT-30620 Fixed
2019-03-29 12:31:59 +03:00
Dmitriy Novozhilov
1ac3542036 [NI] Decrease priority of Integer Literal Types in type checking
#KT-30446
2019-03-29 11:55:30 +03:00
Dmitriy Novozhilov
4a1b9dcc3c [NI] fix approximation of not denotable types in lambda's function descriptors 2019-03-29 11:54:37 +03:00
Alexander Udalov
a9de157fd4 Exclude .kotlin_builtins files when proguarding kotlin-reflect.jar
Even though kotlin-annotations-jvm.jar itself doesn't contain those
files, ProGuard pulls them from the project dependency of
:kotlin-annotations-jvm on :core:builtins. They are already present in
kotlin-stdlib.jar and are thus not needed in kotlin-reflect.jar
2019-03-29 09:45:44 +01:00
Nicolay Mitropolsky
81e84fb62e LightElementsEqualsTest: removing quotes from test name
because of KT-19019
2019-03-29 11:29:22 +03:00
Ilya Gorbunov
91c7233ed8 Make Throwable.addSuppressed extension work without kotlin-stdlib-jdk7*
*given that it runs on JDK7 and higher. The addSuppressed member
is called with reflection when it's available.
kotlin-stdlib-jdk7 extension still overrides that and calls
addSuppressed member statically as before.

#KT-30560 Fixed
2019-03-28 22:42:20 +03:00
Ilya Gorbunov
e6e00483d4 Put kotlin-stdlib-jdk7/8 output in test classpath when running jdk6 tests
These tests ensure how compiled jdk6 binaries work in newer JDK7/8 environment,
and most likely the stdlib-jdk7/8 artifacts will be in that environment.

This reverts test classpath change (accidentally?) made in the commit 99f2cc3d.
2019-03-28 22:42:20 +03:00
Ilmir Usmanov
3724e05b63 Fix test data 2019-03-28 22:21:25 +03:00
Denis Zharkov
66293f4024 FIR: Add @Ignore for FirResolveTestTotalKotlin
Otherwise, it leads to OOM while running on teamcity
Of course, FIR parts might be optimized there but we'll do it later
2019-03-28 17:37:36 +03:00
Mikhael Bogdanov
1a4acb1694 Fix Android test compilation: remove license from generate file 2019-03-28 15:34:46 +01:00
Denis Zharkov
3164197b88 FIR: Fix compilation for bunch file AbstractFirTypeEnhancementTest.kt.181 2019-03-28 17:32:12 +03:00
Alexander Udalov
cb7727d51a Add explicit WITH_RUNTIME to boxAgainstJava tests which need stdlib 2019-03-28 14:26:10 +01:00
Alexander Udalov
15928c5b46 Minor, take String instead of Name in IrFunction.addValueParameter
All call sites of this method construct parameters with the given string
literal name (and more such call sites are coming in subsequent commits)
and it feels like a boilerplate to wrap it into Name each time manually
2019-03-28 14:26:09 +01:00
Alexander Udalov
4cb5a4fb6d Fix misc typos in IR backends 2019-03-28 14:26:09 +01:00
Alexander Udalov
6bd4d72b81 Use more correct KProperty type in PropertyReferenceLowering
Default type is `KProperty<R>` where R is KProperty's type parameter.
This type doesn't make much sense outside the KProperty's own class
declaration. A more correct type here is `KProperty<*>`, which is the
type used in property delegates in Kotlin
2019-03-28 14:26:09 +01:00
Alexander Udalov
73383d0c20 Extract JvmSymbols to separate file, pass lazyWrapper as SymbolTable 2019-03-28 14:26:09 +01:00
Alexander Udalov
1ee4313803 Minor, introduce IrType.classOrNull 2019-03-28 14:26:09 +01:00
Alexander Udalov
dada35d785 Remove obsolete and unused descriptors and utils 2019-03-28 14:26:09 +01:00
Alexander Udalov
72ca05f86a Add kotlin-stdlib explicitly to Gradle integration test data
This is required since ed86757817, otherwise an error "Cannot access
built-in declaration ..." is reported
2019-03-28 14:25:37 +01:00
Alexander Udalov
6223c4481f Minor, disable package mismatch inspection for Groovy
This should be fine because we don't have any production Groovy code in
the project. Otherwise any build.gradle file in
kotlin-gradle-plugin-integration-tests is highlighted as yellow.

Also update inspection profile to the latest version suggested by
IntelliJ
2019-03-28 14:25:37 +01:00
Mikhael Bogdanov
9c21c71c63 Fix IDE related test problems after adding ability to run test in parallel in compiler configuration 2019-03-28 13:51:28 +01:00
Sergey Rostov
4df31b2360 JPS Build: support building and running IDEA Ultimate 2019-03-28 15:48:35 +03:00
Sergey Rostov
283ad04f7c JPS Build: fix artifacts after moving dependencies repo 2019-03-28 15:48:35 +03:00
Mikhael Bogdanov
f34a2923b5 Fix IDE related test problems after adding ability to run test in parallel in compiler configuration 2019-03-28 13:17:38 +01:00
Mikhael Bogdanov
0c60ff0e80 Revert "Revert "Allow tests to be run in parallel.""
This reverts commit bdad3cac
2019-03-28 13:17:37 +01:00
Nicolay Mitropolsky
944bc31f69 Making Kotlin light elements isEquivalentTo to it's origins (KT-30583) 2019-03-28 13:19:42 +03:00
Ting-Yuan Huang
1bf0354e35 TotalOrderEquals: Handle nulls 2019-03-28 11:36:22 +03:00
Denis Zharkov
b1474b11f2 FIR: Fix FirSupertypeResolverTransformer for case of redeclarations
When transforming a specific class look for the exact match
Otherwise the last redeclaration will be overwritten by the first one
2019-03-28 11:19:52 +03:00
Simon Ogorodnik
a23e4bfdf1 Fix superType resolver 2019-03-28 11:19:52 +03:00
Simon Ogorodnik
49a0b29129 Store containers per symbol, not per callable id 2019-03-28 11:19:52 +03:00
Denis Zharkov
48f0790785 FIR: Fix bunch files for 181 2019-03-28 11:14:55 +03:00
Ilmir Usmanov
59398536d7 Generate inline site's file name in metadata
Otherwise, stacktraces will have invalid file name (declaration site).
 #KT-30508 Fixed
2019-03-28 11:14:17 +03:00
Sergey Rostov
23edafcaaf JPS Build: fix kotlin-main-kts-test 2019-03-28 10:06:36 +03:00
Sergey Rostov
7b89b0abbb JPS Build: exclude :core:builtins, use prebuilt bootstrap version 2019-03-28 10:06:35 +03:00
Sergey Rostov
fb3f28974e Build: support local.properties for JPS build. Apply JPS related tweaks only inside IDEA import. 2019-03-28 10:06:16 +03:00
Dmitry Gridin
5802928e52 False positive "unused constructor" for local class
#KT-30637 Fixed
2019-03-28 10:52:23 +07:00
Yan Zhulanow
0b94aa4be2 Pill: Disable a couple of scripting modules
Seems like these modules use the embeddable verson of the scripting host dependency that is not built in the Pill build.
2019-03-27 22:15:26 +03:00
Ilmir Usmanov
95f4115a10 Replace global mutable object with global variable 2019-03-27 21:40:13 +03:00
Ilya Kirillov
9813b748eb Fix android linting tests due to added external annotations support 2019-03-27 20:10:46 +03:00
Ilya Kirillov
f1f6740ec9 Show warnings for Java methods with external annotations when they called from Kotlin code 2019-03-27 20:10:46 +03:00
Mikhail Glukhikh
ba9b3397d0 Make Groovy-based inspections alive again
After commit 9b5b0447, declaration of Groovy-based inspections moved
into gradle-groovy.xml. However, this makes transitive-optional
dependency between plugin.xml, gradle-java.xml & gradle-groovy.xml
which doesn't work (see IDEA-209769) and inspections aren't loaded.

This commit breaks this transitivity by declaring dependency
to gradle-groovy.xml directly in plugin.xml.
This also fixes most tests from GradleInspectionTest group.
2019-03-27 18:06:24 +03:00
Ilmir Usmanov
0fec3470dd Regenerate anonymous object if call site of non-inlineable
functional argument is suspend
Split LambdaInfo into inlineable and non-inlineable
 #KT-26925
2019-03-27 17:44:37 +03:00
Ilmir Usmanov
1c2b8e6fad Fix wrong state-machine generation if inner object is retransformed
during inlining.
 #KT-29492 Fixed
2019-03-27 17:44:35 +03:00
Denis Zharkov
7b97c2a42a FIR: Weaken requirements for all symbols to have correct FIR
Currently, some cases like library type parameters are not supported properly
2019-03-27 17:17:59 +03:00
Denis Zharkov
825218b479 Replace FirSymbolProvider::getCallableSymbols with two methods
Requesting content of classes seems to be reasonable and at the same time
more easy to implement in Composite providers: they should find
just the first class' result instead of flatmapping all of them
2019-03-27 17:17:59 +03:00
Denis Zharkov
1426341e9f FIR: Support loading deserialized declarations from JVM class files 2019-03-27 17:17:59 +03:00
Denis Zharkov
0f9d54c4dc FIR: Support deserialization of nested classes 2019-03-27 17:17:59 +03:00
Denis Zharkov
82c6b51fab Simplify initialization process for JavaClassFinderImpl
After this change, it's not required to call "initialize" with
binding trace and KotlinCodeAnalyzer that is rather useful for FIR
2019-03-27 17:17:59 +03:00
Denis Zharkov
bb1acdbe95 Minor. Extract classes deserialization from BuiltInsPackageFragment 2019-03-27 17:17:59 +03:00
Denis Zharkov
b3e5e059bb Minor. Extract FirDeserializationContext factories 2019-03-27 17:17:59 +03:00
Denis Zharkov
aec5ec89e7 FIR: Support deserialization for built-in classes content 2019-03-27 17:17:59 +03:00
Denis Zharkov
f03c5e0583 FIR: Support loading built-in top-level functions 2019-03-27 17:17:59 +03:00
Denis Zharkov
705f97cbae FIR: Support type parameters in FirTypeDeserializer 2019-03-27 17:17:59 +03:00
Denis Zharkov
1d16008eab Do not request FirProvider for built-in synthesized classes
Because currently they don't have FIR and it might fail with an exception
2019-03-27 17:17:59 +03:00
Denis Zharkov
6daf414098 Add common supertype for FirFunction and FirProperty symbols 2019-03-27 17:17:59 +03:00
Denis Zharkov
466296bca0 Remove FirLibrarySymbolProviderImpl from FirJavaModuleBasedSession
It's anyway already being created within dependencies
2019-03-27 17:17:59 +03:00
Denis Zharkov
7a19e269fd FIR: Support import-references to callables 2019-03-27 17:17:59 +03:00
Leonid Startsev
ccca813792 Allow '@Serializable' on a type usage (for kotlinx.serialization/367) 2019-03-27 12:59:53 +03:00
Leonid Startsev
a2465910a3 Instantiating of Polymorphic in Companion.serializer() for JS and Native 2019-03-27 12:59:52 +03:00
Leonid Startsev
b108dbe568 Auto-applying @Polymorphic for interfaces and serializable abstract
classes
2019-03-27 12:59:51 +03:00
Leonid Startsev
859c95c3c4 Do not enable PolymorphicSerializer without special annotation 2019-03-27 12:59:49 +03:00
Leonid Startsev
9d707cb1d9 New instantiating type for polymorphic serializer 2019-03-27 12:59:48 +03:00
Sergey Rostov
30108d4cb9 CodeConformanceTest: revert formatting committed by mistake 2019-03-27 11:23:54 +03:00
Sergey Rostov
6bf82c1053 Gradle, Kotlin/JS: fix failing tests on Windows 2019-03-27 11:23:53 +03:00
Dmitry Gridin
0237dc3f4b Fix inspections test 'Unused symbol' for enum entry 2019-03-27 12:27:48 +07:00
Dmitry Gridin
d64702d87e Remove check "unused secondary enum class constructor"
#KT-14040 Fixed
2019-03-27 11:46:31 +07:00
Dmitry Gridin
dbe0b4aa71 Unused symbol inspection should detect enum entry
#KT-30612 Fixed
2019-03-27 11:46:30 +07:00
Dmitry Gridin
ce1ec49625 Add case for private nested class/object in KotlinSafeDeleteProcessor 2019-03-27 11:46:30 +07:00
Dmitry Gridin
4495c653cb Minor: move property from UnusedSymbolInspection to ktPsiUtil 2019-03-27 11:46:30 +07:00
Dmitry Gridin
3e0269a95a Minor: refactoring & fix warnings in ktPsiUtil 2019-03-27 11:46:30 +07:00
Dmitry Gridin
26575c9389 Minor: refactoring KotlinSafeDeleteProcessor 2019-03-27 11:46:30 +07:00
Sergey Igushkin
7aed9fd592 Fix Android AP in Kapt (KT-30632), run Android Kapt IT with AGP 3.3.2
Fixes a bug introduced by the commit 6fa610156e, which led to Kapt
options being imported from Android AP options too early (immediately at
creation time for each Android variant, while the Android plugin added
the options only afterwards).

Move Android subplugin options configuration to the time & scope where
it was prior to 6fa610156e.
2019-03-27 01:08:04 +03:00
Natalia Selezneva
ca49e17157 Run indexing for new script dependencies if they are updated from notification 2019-03-27 00:00:11 +03:00
Natalia Selezneva
776a89086f Fix NoSuchElementException editing script file
^KT-30440 Fixed
2019-03-26 23:58:59 +03:00
Natalia Selezneva
224f37ca00 Fix warning in scripts that dependencies are not available
^KT-30441 Fixed
2019-03-26 23:57:20 +03:00
Mikhail Zarechenskiy
791ab05e08 Temporary fix for NI to compile against bootstrap compiler 2019-03-26 22:51:20 +03:00
Mikhail Zarechenskiy
a50cc99b01 [NI] Discriminate integer literal types as they are less specific
Plus simplify code in `ResultTypeResolver` a bit
2019-03-26 22:32:14 +03:00
Mikhael Bogdanov
e01cac4c3d Fix test data 2019-03-26 17:17:54 +01:00
Anton Bannykh
b3f1908026 JS_IR: remove stub generator from IrBuiltins 2019-03-26 17:38:44 +03:00
Anton Bannykh
ed440fc060 JS IR: remove obsolete hack from SymbolTable 2019-03-26 17:38:43 +03:00
Anton Bannykh
530804d072 JS_IR: eager IrBuiltins 2019-03-26 17:38:43 +03:00
Anton Bannykh
45f5342911 JS IR: remove obsolete hacks 2019-03-26 17:38:43 +03:00
Anton Bannykh
bba4399910 JS IR: enable IR validation 2019-03-26 17:38:43 +03:00
pyos
ef5e02da84 JVM_IR: handle Nothing and Unit more consistently.
* In blocks, discard the result of any statement that has a return
   type other than void. This was previously done by wrapping each
   statement into an "implicit Unit conversion" that was actually
   compiled down to a stack pop instead. If an expression happened to
   already have type Unit, however, such a conversion was not inserted,
   resulting in a stray reference on the stack. These conversions are
   now redundant and should probably be removed.

 * In assignments and non-exhaustive conditionals, materialize a Unit
   on the stack to avoid depth mismatches that trip up the bytecode
   validator. Because such expressions are generally used at block level
   (and, indeed, the frontend will reject a non-exhaustive conditional
   used as an expression), combined with the above change this results
   in no additional GETSTATIC opcodes, as they are immediately removed
   by the peephole optimizer.
2019-03-26 13:32:02 +01:00
Zalim Bashorov
bdad3cace9 Revert "Allow tests to be run in parallel."
This reverts commit 21d81f35
2019-03-26 15:22:40 +03:00
Alexander Podkhalyuzin
37de9a0a26 Do not call find editor outside UI thread
#KT-30117 Fixed
2019-03-26 15:18:03 +03:00
Alexander Podkhalyuzin
c9581176d7 git longpaths info for Windows users 2019-03-26 15:17:21 +03:00
Alexander Podkhalyuzin
19f6290686 Fixed selection in case of empty class body
#KT-30597 Fixed
2019-03-26 15:13:54 +03:00
Steven Schäfer
29b7da7c49 Implement support for KClass fields in annotation classes. 2019-03-26 11:54:16 +01:00
Ting-Yuan Huang
4ff2825de0 Fix an assertion for type parameters 2019-03-26 10:44:06 +03:00
Ilya Matveev
acf8a0454f Store Kotlin/Native version in properties
Previously the Kotlin/Native version was hardcoded in sources of the
Gradle plugin. Such an approach is inconvenient when we want to
build Kotlin with a custom K/N version but without changes in sources
(e.g. during CI daily runs).

This patch adds a project property `versions.kotlin-native` which can
be set during build to override Kotlin/Native version. Also this
patch gets rid of hardcoding this version in sources and stores it in
a properties file packed with the Gradle plugin in a jar.
2019-03-26 12:50:53 +07:00
Andrey Uskov
a0b8140278 Fix creation of Android source roots
#KT-30464 Fixed
2019-03-26 08:28:23 +03:00
Andrey Uskov
01a100e2ef Fix KNE in intentions
EA-124846 Fixed
2019-03-26 08:27:24 +03:00
Dmitriy Dolovov
e33ea24dc7 Fix: Native libraries are not automatically unloaded from an IDE project
Issue #KT-30490 fixed
2019-03-26 09:43:06 +07:00
Toshiaki Kameyama
3b569737ad Redundant getter/setter: reduce hightlight range to header
#KT-30559 Fixed
2019-03-25 23:27:44 +03:00
Toshiaki Kameyama
0cf641398c Suspicious 'var' property: do not report when property has default getter
#KT-30565 Fixed
2019-03-25 23:26:24 +03:00
Dmitriy Novozhilov
a26df4b4c6 [NI] Update test data for spec tests 2019-03-25 23:04:50 +03:00
Victor Petukhov
568506e5c1 Exclude warning "Remove final upper bound" for functions with override modifier
^KT-25105 Fixed
2019-03-25 22:14:26 +03:00
Steven Schäfer
9cd005fbae Create temporary library directories for J2V8.
Workaround for https://github.com/eclipsesource/J2V8/issues/39
2019-03-25 19:50:37 +01:00
Steven Schäfer
21d81f353c Allow tests to be run in parallel. 2019-03-25 19:50:37 +01:00
Dmitriy Novozhilov
ca0e66bafc [NI] Refactor compiler representation of integer literals types
Add `IntegerLiteralTypeConstructor` that holds types, that can take
  integer literal with given value. It has two supertypes
  (`Number` and `Comparable<IntegerLiteralType>`) and have
  special rules for subtyping, `intersect` and `commonSuperType`
  functions with primitive number:

Example (assuming that ILT holds Int type):
* ILT <: Int
* Int :> ILT
* ILT intersect Int = Int
* commonSuperType(ILT, Int) = Int

#KT-30293 Fixed
#KT-30446 Fixed
2019-03-25 18:55:36 +03:00
Anton Bannykh
9c3e452396 IR: (update test data) NOT(Boolean) -> Boolean.not 2019-03-25 17:49:15 +03:00
Alexander Udalov
fff22d9372 Remove hack from JvmBuiltinOptimizationLowering related to booleanNotSymbol 2019-03-25 17:49:15 +03:00
Anton Bannykh
a382956c19 IR: use the correct descriptor for the booleanNotSymbol creation
NOTE corresponding function now has a dispatch receiver instead of a
single argument
2019-03-25 17:49:15 +03:00
Mikhail Glukhikh
0546548ff3 Raw FIR: add kotlin.Any super class if no super classes are visible 2019-03-25 17:17:14 +03:00
Alexey Tsvetkov
db6a7779b8 Check friend jars paths for exact match
Fixes CompileKotlinAgainstCustomBinariesTest.testInternalFromForeignModule
after unifying non-build-file mode and build-file mode.

Previously when the compiler was run without -Xbuild-file argument,
it was not using modules internally, so we were not checking if internal
descriptors were contained in destination dir of current module
(without -Xbuild-file we were returning false at `if (modules.isEmpty())
return false` in `ModuleVisibilityHelperImpl#isInFriendModule`).

After switching to using modules for CLI compilation,
any jar file contained in destination dir was considered friend,
because only a prefix was checked.
2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
0687b8eac3 Add argument to allow running compiler without sources
`-Xbuild-file` argument allows the compiler to run without
passing any Kotlin source file in arguments.
We have been using this property in
Kotlin Gradle plugin for a few important cases:
1. incremental compilation (to update caches when there are only removed files);
2. for KAPT (Kotlin sources don't make sense in context
of running APs).

We want to stop using `-Xbuild-file` in Kotlin Gradle plugin,
and avoid breaking the Gradle plugin or IC in other build-systems.

This change adds an argument to explicitly run
the compiler without specifying any Kotlin source file.
2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
97d3d38374 Always run codegen when IC is enabled
We may need to run code generation when no source files are specified
for incremental compilation (to update caches & metadata)
2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
5b7cee6221 Unify JVM compilation with and without -Xbuild-file 2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
4154e97aa3 Fixes after code review 2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
ada880fbad Fix non-incremental compilation 2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
337ca7021d Add test for IC of non-kts scripts in Gradle 2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
5f54f67f70 Stop using -Xbuild-file in Gradle Plugin
#KT-27640 fixed
    #KT-27778 fixed
    #KT-27638 fixed
2019-03-25 16:39:47 +03:00
Nikita Skvortsov
9b5b0447fa only load inspections when groovy plugin is present KT-30579
otherwise, a user who disables Groovy support gets NoClassDefFound errors
2019-03-25 16:06:55 +03:00
Svyatoslav Kuzmich
0504635254 Remove -ProperIeee754Comparisons test directive duplicate 2019-03-25 15:55:06 +03:00
Svyatoslav Kuzmich
70ef0e9431 Add '-ProperIeee754Comparisons' to some tests and disable them in JS_IR 2019-03-25 12:57:26 +03:00
Dmitriy Novozhilov
d3e98bc434 [NI] Update test data for diagnostic tests 2019-03-25 12:38:37 +03:00
Dmitry Gridin
74cd53963d Fix false positive "Unused symbol" for type alias & private nested class/object
#KT-21526 Fixed
 #KT-30527 Fixed
2019-03-25 16:32:28 +07:00
Dmitry Gridin
4441b1579f Minor: refactoring UnusedSymbolInspection 2019-03-25 16:32:28 +07:00
Mikhail Zarechenskiy
3eda7c462b [NI] Add Nothing constraint if it was inferred from a call 2019-03-25 12:17:28 +03:00
Mikhail Zarechenskiy
ca894a6a71 [NI] Don't complete nested call if there's no constraints at all 2019-03-25 12:17:28 +03:00
Dmitriy Novozhilov
9825984bc5 [NI] Update test data for diagnostic tests 2019-03-25 12:17:27 +03:00
Dmitry N. Petrov
c2a0e73a79 Merge pull request #2207 from ting-yuan/ieee754improper
Label improper IEEE 754 tests.
2019-03-25 12:10:59 +03:00
Mikhail Glukhikh
73ed52a511 Get rid of binding context in FirBodyResolveTransformer 2019-03-25 12:04:28 +03:00
Dmitry Petrov
8664fc3b28 psi2ir: add test for implicit cast on values of intersection type 2019-03-25 11:50:14 +03:00
Dmitry Petrov
d4525e19dd IR: get rid of descriptors in local delegated properties rendering 2019-03-25 11:50:14 +03:00
Dmitry Petrov
12e9943f8f IR: IrCallableReference now implements IrDeclarationReference 2019-03-25 11:50:14 +03:00
Dmitry Petrov
6ca61cf347 IR: symbol for IrLocalDelegatedProperty 2019-03-25 11:50:14 +03:00
Mikhail Glukhikh
aa6ba1cd4a Introduce typeRef for FirExpression
This helps both body resolve & conversion to IR
2019-03-25 10:38:45 +03:00
Ilya Gorbunov
adeeeeee48 Fix embedded version of kotlin-stdlib in buildSrc
To avoid bringing stdlib:1.2.30, which is a transitive dependency of
com.jakewharton.dex:dex-method-list:3.0.0, into compile classpath of
the project build scripts.
2019-03-25 03:28:06 +03:00
Georgy Bronnikov
7f8cbf5434 JVM_IR: handle new JVM targets in AdditionalClassAnnotationsLowering 2019-03-25 02:18:57 +03:00
Georgy Bronnikov
0a2450bcd5 Remove duplicate definitions 2019-03-23 19:04:36 +03:00
Georgy Bronnikov
451cda79de Rewrite AnnotationCodegen for IR, removing descriptors 2019-03-23 19:04:36 +03:00
Nikolay Krasko
8bd6e1b8e4 Rename action for throwing exception from Kotlin plugin
Make the name similar to other internal actions for throwing exceptions.
2019-03-23 11:54:57 +03:00
Nikolay Krasko
0c2bdc68f1 Additional checks for listed and approve in fetching release date (KT-30388) 2019-03-23 11:53:29 +03:00
Nikolay Krasko
27397f4131 Use xmlId for fetching release date (KT-30388) 2019-03-23 11:53:29 +03:00
Nikolay Krasko
fb2e5f970d Add intention/inspections/quickfix contribution quick notes 2019-03-23 11:53:29 +03:00
Nikolay Krasko
fdf2482600 Clean up findUsages package 2019-03-23 11:53:29 +03:00
Nikolay Krasko
046a35bcda Hide concrete classes for Kotlin nodes to avoid more compatibility problems 2019-03-23 11:53:28 +03:00
Nikolay Krasko
8ab10ebda3 Minor: remove warnings in CommonIntentionActionsTest.kt 2019-03-23 11:53:28 +03:00
Ilya Chernikov
99a5885aa7 Fix ScriptingCompilerPluginTest after creating a separate jar with shared plugin code 2019-03-23 09:52:02 +01:00
Abduqodiri Qurbonzoda
636ed025da Replace "binary representation of" with "bits of" 2019-03-22 21:18:27 +03:00
Abduqodiri Qurbonzoda
960797b926 Replace mistaken "bit sign" with "sign bit" 2019-03-22 21:18:27 +03:00
Abduqodiri Qurbonzoda
f36a8db8eb More detailed Primitive.toChar conversion documentation 2019-03-22 21:18:27 +03:00
Ting-Yuan Huang
caccb79324 Label improper IEEE 754 tests.
Those tests don't expect ProperIeee754Comparisons.
See KT-22723 for details.
2019-03-22 11:07:35 -07:00
Alexander Udalov
87c6b723f0 Add JvmBuiltIns.Kind instead of boolean flags in constructor 2019-03-22 14:59:03 +01:00
Alexander Udalov
c32d7ef116 Do not create additional module for built-ins in reflection 2019-03-22 14:59:03 +01:00
Alexander Udalov
ed86757817 Rework how built-in types are loaded in compiler for JVM
In TopDownAnalyzerFacadeForJVM, we now always use the "load built-ins
from module dependencies" behavior that was previously only enabled with
the dedicated CLI argument -Xload-builtins-from-dependencies. However,
sometimes we compile code without kotlin-stdlib in the classpath, and we
don't want everything to crash because some standard type like
kotlin.Unit hasn't been found.

To mitigate this, we add another module at the end of the dependencies
list, namely a "fallback built-ins" module. This module loads all
built-in declarations from the compiler's class loader, as was done by
default previously. This prevents the compiler from crashing if any
built-in declaration is not found, but compiling the code against
built-ins found in the compiler is still discouraged, so we report an
error if anything is resolved to a declaration from this module, via a
new checker MissingBuiltInDeclarationChecker.

Also introduce a new CLI argument -Xsuppress-missing-builtins-error
specifically to suppress this error and to allow compiling code against
compiler's own built-ins.

 #KT-19227 Fixed
 #KT-28198 Fixed
2019-03-22 14:59:03 +01:00
Alexander Udalov
8ce7742e7c Inject DeserializationConfiguration into JvmBuiltInsPackageFragmentProvider 2019-03-22 14:59:03 +01:00
Alexander Udalov
05700b8c43 Use JvmResolveUtil.createContainer in AbstractDescriptorRendererTest 2019-03-22 14:59:03 +01:00
Alexander Gorshenev
a3b1d3ff62 Allow forward declarations bring additional IR dependencies
for modules present in metadata.
2019-03-22 16:47:08 +03:00
Alexander Gorshenev
674580fdef File annotation deserialization is triggered by the first file use 2019-03-22 16:47:08 +03:00
Alexander Gorshenev
215da10687 A little refactoring of deserializer in preparation for the next commit. 2019-03-22 16:47:08 +03:00
Alexander Gorshenev
3bc4616a17 Eliminated global state in IR deserializer. 2019-03-22 16:47:08 +03:00
Ilya Matveev
8f9189d61e Update Kotlin/Native: 1.2-eap-8879 2019-03-22 20:27:18 +07:00
Simon Ogorodnik
b617c40051 FIR: Update testData for fir multi-module test (rendering+body resolve) 2019-03-22 16:25:24 +03:00
Simon Ogorodnik
85a096029c FIR: Do not fail on not calculated type 2019-03-22 16:25:24 +03:00
Simon Ogorodnik
70e324277e FIR: Stub for super references 2019-03-22 16:25:23 +03:00
Mikhail Glukhikh
9b4fe2f991 FIR: Fix part of problems with smoke tests 2019-03-22 16:25:22 +03:00
Simon Ogorodnik
3e7e9269ab FIR: Fix 2^n transform complexity in blocks/whens 2019-03-22 16:25:22 +03:00
Simon Ogorodnik
6799eeb084 FIR: Add CallKind 2019-03-22 16:25:21 +03:00
Simon Ogorodnik
a562f3db3c FIR: Re-implement call resolver with proper architecture 2019-03-22 16:25:21 +03:00
Simon Ogorodnik
33b44870d6 FIR: Add test for constructor 2019-03-22 16:25:20 +03:00
Simon Ogorodnik
5aa783a961 FIR: Fix visitors/transformers and testData 2019-03-22 16:25:19 +03:00
Simon Ogorodnik
2341692296 FIR: Change transform order in calls/variables to more appropriate 2019-03-22 16:25:19 +03:00
Simon Ogorodnik
071f324738 FIR: Prevent failing on implicit typed local declarations 2019-03-22 16:25:18 +03:00
Simon Ogorodnik
46e432df54 FIR: Prevent failing on constructor substitution 2019-03-22 16:25:18 +03:00
Simon Ogorodnik
cd7a96e91b FIR: Proper self-type for constructor return type 2019-03-22 16:25:17 +03:00
Simon Ogorodnik
6c7be3c547 FIR: Improve diagnostic in fir unsafe 2019-03-22 16:25:16 +03:00
Simon Ogorodnik
fedde668b3 FIR: Support captureFromArguments for ConeTypes 2019-03-22 16:25:16 +03:00
Simon Ogorodnik
6efb22cd45 FIR: Support typing of type operators 2019-03-22 16:25:15 +03:00
Simon Ogorodnik
79018abee2 FIR: Optimize name gathering in call resolver 2019-03-22 16:25:15 +03:00
Simon Ogorodnik
b574693916 FIR: Introduce function to render fir element with it's type 2019-03-22 16:25:14 +03:00
Simon Ogorodnik
24041828a9 FIR: Improve rendering for type operators 2019-03-22 16:25:14 +03:00
Simon Ogorodnik
27687602f8 FIR: Add functions to change nullability/arguments of ConeTypes 2019-03-22 16:25:13 +03:00
Simon Ogorodnik
2118f6008a Extract TypeArgumentListMarker.all 2019-03-22 16:25:12 +03:00
Simon Ogorodnik
d9c40c24ed FIR: Allow rendering ConeTypes 2019-03-22 16:25:12 +03:00
Simon Ogorodnik
818701b8df FIR: Implement cycle avoidance in implicit type resolution 2019-03-22 16:25:11 +03:00
Simon Ogorodnik
334c42e8ab FIR: Implement deep implicit types resolution 2019-03-22 16:25:11 +03:00
Simon Ogorodnik
70be1c1024 FIR: Update testData, now it resolves due to call resolver 2019-03-22 16:25:10 +03:00
Simon Ogorodnik
498fb94c37 FIR: Make FIR rendering more kotlin-styled 2019-03-22 16:25:10 +03:00
Simon Ogorodnik
9cc6e44158 FIR: Fix value-parameters redeclare in destructuring 2019-03-22 16:25:09 +03:00
Simon Ogorodnik
9a642ef2e5 FIR: Add test for three receivers 2019-03-22 16:25:08 +03:00
Simon Ogorodnik
43315fd61d FIR: Preparation for resolve to classifiers 2019-03-22 16:25:08 +03:00
Simon Ogorodnik
307b8a1d4c FIR: Support top-level constructors 2019-03-22 16:25:07 +03:00
Simon Ogorodnik
d817f719a4 FIR: Cleanup failures in body resolve 2019-03-22 16:25:07 +03:00
Simon Ogorodnik
3867b255f2 FIR: Support this resolve 2019-03-22 16:25:06 +03:00
Simon Ogorodnik
9dc6d93070 FIR: Resolve local callables 2019-03-22 16:25:06 +03:00
Simon Ogorodnik
61eb19fbbf FIR: Make possible to return variable symbols from scope 2019-03-22 16:25:05 +03:00
Simon Ogorodnik
02079bbeb5 FIR: Update fir hierarchy, decouple member declaration from callable 2019-03-22 16:25:04 +03:00
Simon Ogorodnik
7b6f4d8ba4 FIR: Implement implicit invoke desugaring in call resolver 2019-03-22 16:25:04 +03:00
Simon Ogorodnik
3be1d0f946 FIR: Add tests for invoke 2019-03-22 16:25:03 +03:00
Simon Ogorodnik
c58c1a6c4e FIR: Add operator test 2019-03-22 16:25:03 +03:00
Simon Ogorodnik
3ac495a45d FIR: Implement basic function call resolve 2019-03-22 16:25:02 +03:00
Simon Ogorodnik
099f98f817 FIR: Expression typing and simple call resolver 2019-03-22 16:25:02 +03:00
Alexey Tsvetkov
28873e61d4 Remove unused IncrementalCompilationServicesFacade 2019-03-22 16:13:45 +03:00
Ivan Gavrilovic
493a2006f1 Remove unused SimpleDirtyData from incremental compilation
This is not used any more and all information about
the changed symbols and fqNames is passed alongside artifacts.
2019-03-22 16:13:45 +03:00
Yan Zhulanow
49d94f72d2 Revert "Kapt: Generate constant value initializers for mutable properties (KT-30164)"
This reverts commit cce2b472
2019-03-22 15:17:12 +03:00
Yan Zhulanow
9aa6a10aff Revert "Kapt: Move out the 'final' fallback for initial field values"
This reverts commit 10e53a2e
2019-03-22 15:17:12 +03:00
Yan Zhulanow
4c794b1302 Revert "Kapt: Support default constant values for constructor parameters"
This reverts commit e4d758b6
2019-03-22 15:17:12 +03:00
Ilya Chernikov
215d24e12c Fix jps build after adding new scripting jar 2019-03-22 12:26:02 +01:00
Svyatoslav Kuzmich
8429734a67 [JS IR BE] Disable -ProperIeee754Comparisons tests 2019-03-22 13:49:37 +03:00
Sergey Rostov
d210255623 Gradle: Kotlin NodeJS tests runner for single target
#KT-30528
2019-03-22 09:57:21 +03:00
Sergey Rostov
04d8568fdc Build: fix DistModelBuilder for copy tasks without destination dir 2019-03-22 09:49:34 +03:00
Sergey Rostov
d467e4209a Gradle: Basic Kotlin NodeJS tests runner
#KT-30531 Fixed
#KT-30528 Fixed
2019-03-22 09:49:32 +03:00
Sergey Rostov
b6e675f934 Gradle: move buildCompilationProcessor from target preset to target configurator 2019-03-22 09:34:11 +03:00
Sergey Rostov
46c32f2aa6 Gradle: Supress PackageDirectoryMismatch in targets for gradle.plugin.mpp package 2019-03-22 09:34:11 +03:00
Georgy Bronnikov
e627f08614 Make wrong phase name an error 2019-03-21 23:32:25 +03:00
Georgy Bronnikov
fae003866b Use CLI compiler arguments directly in PhaseConfig creation 2019-03-21 23:32:25 +03:00
Georgy Bronnikov
40079f7cae Use default argument values in PhaseConfig constructor 2019-03-21 23:32:25 +03:00
Georgy Bronnikov
469fd20902 Warn about mistyped phase names in CLI 2019-03-21 23:32:25 +03:00
Alexander Udalov
0fb444a5d1 Move createPhaseConfig to module cli
To use things like MessageCollector to report errors/warnings related to
incorrect phase configuration flags
2019-03-21 23:32:25 +03:00
Alexander Udalov
2995be8bd2 Move usages of createPhaseConfig up to cli & test modules 2019-03-21 23:32:25 +03:00
Alexander Udalov
ddad3034da Extract createPhaseConfig from PhaseConfig
To remove dependency of PhaseConfig on CLI-dependent concepts such as
CompilerConfiguration
2019-03-21 23:32:25 +03:00
Nicolay Mitropolsky
ce40bfb259 191: Uast: making KotlinUObjectLiteralExpression provide a proper referenceNameElement (KT-30534) 2019-03-21 19:56:47 +03:00
Vyacheslav Gerasimov
e3a012cd19 Fix CodeConformanceTest after merging android-dx to prepare-deps 2019-03-21 18:15:55 +03:00
Nikolay Krasko
a5f96d6470 Minor: cleanup and remove outdated TODOs 2019-03-21 18:03:15 +03:00
Nikolay Krasko
04ecc913ef Show expression type for argument names (KT-30057)
#KT-30057 Fixed
2019-03-21 18:03:15 +03:00
Nikolay Krasko
ce2f738d9f Minor: fix Nullness deprecation warnings 2019-03-21 18:03:15 +03:00
Nikolay Krasko
77f1167773 Minor: remove bunch for KotlinSliceProvider.kt 2019-03-21 18:03:15 +03:00
Nikolay Krasko
026fc998c1 Allow resolve write action check for all plugins when enabled in registry 2019-03-21 18:03:15 +03:00
Ilya Matveev
7f08ecee39 CocoaPods: Use FQ name for the sync task during an Xcode build 2019-03-21 21:09:47 +07:00
Ilya Matveev
0a27699591 CocoaPods: Generate wrapper if the corresponding property enabled 2019-03-21 21:09:47 +07:00
Ilya Matveev
07c3ed5bd1 Fat frameworks: Use absolute path to lipo 2019-03-21 21:09:47 +07:00
Ilya Matveev
1f94224b52 Fat frameworks: Don't fail if plist has no device capabilities
The PlistBuddy fails when deleting an entry from a file which
has no such entry. This patch workarounds this by ignoring
PlistBuddy's exit code.
2019-03-21 21:09:47 +07:00
Ilya Matveev
300acafc63 CocoaPods: Don't generate a fat framework for a single device target 2019-03-21 21:09:47 +07:00
Ilya Matveev
c079543e7d Fat frameworks: Improve header merging
1. If header contents are identical, don't write all of them
   in the resulting header. Just write content of one of the
   headers without #ifdef-s.
2. Use #elif to separate declarations for different platforms.
2019-03-21 21:09:47 +07:00
Ilya Matveev
8b8028e10d Fat frameworks: Run PlistBuddy only once for all commands
Previously we executed the PlistBuddy utility for each command
separately. This patch gathers all commands and run PlistBuddy
for all of them at once.
2019-03-21 21:09:47 +07:00
Ilya Matveev
3f04bf119e Fat frameworks: Improve error messaging 2019-03-21 21:09:47 +07:00
Ilya Matveev
1c7866e81f CocoaPods: Require Gradle wrapper for Xcode build 2019-03-21 21:09:47 +07:00
Ilya Matveev
2e60b18570 CocoaPods: Rename: simple framework -> regular framework 2019-03-21 21:09:47 +07:00
Ilya Matveev
fd825e0601 CocoaPods: Detect the real path to Gradle wrapper.
Previously the CocoaPods plugin assumed that Gradle wrapper
is located in the project directory. But the project may be
a part of multiproject build and wrapper may be located in
the root directory of such a build. Also the build may not
have the wrapper at all.

This patch looks for the wrapper in the root directory of the
build and runs the local Gradle if there is no wrapper.
2019-03-21 21:09:47 +07:00
Ilya Matveev
4985b24b07 CocoaPods: Don't use realpath utility in script phase
The realpath utility may not be found on the user's machine
so we get rid of using it.
2019-03-21 21:09:47 +07:00
Ilya Matveev
5b4d83e770 CocoaPods: Build fat arm32/arm64 frameworks
Building for old iOS devices requires us to provide fat
arm32/arm64 frameworks. This patch uses the fat framework
task to build such a framework and provides it to Xcode
if a build for a device is executed. In other cases
(building for iOS simulator or macOS) simple frameworks
are still used.
2019-03-21 21:09:47 +07:00
Ilya Matveev
6621414d72 Provide a task for building a fat framework
This patch adds a task taking several iOS frameworks and
building one fat framework on their basis.

Issue #KT-24184 Fixed
2019-03-21 21:09:47 +07:00
Roman Artemev
538512fa2a [JS IR BE] Fix unbound symbols after deserialization
* restore broken psi2ir invariant
2019-03-21 16:26:51 +03:00
Dmitriy Novozhilov
58189c79ca Add regression test for PROTECTED_CONSTRUCTOR_NOT_IN_SUPER_CALL diagnostic
#KT-20507
2019-03-21 16:09:46 +03:00
Alexey Tsvetkov
42aa708f16 Minor: remove JVM-specific assertion from common test code 2019-03-21 15:23:48 +03:00
Ilya Chernikov
c56382a62b Move common idea and compiler parts of the scripting plugin to the new jar 2019-03-21 12:02:29 +01:00
Nicolay Mitropolsky
af63fcb3be KotlinElementActionsFactory: adding empty annotations without parenthesises 2019-03-21 12:47:27 +03:00
Nicolay Mitropolsky
1669b6aa9f 192: KotlinElementActionsFactory: changing parameters could add annotations 2019-03-21 12:47:27 +03:00
Nicolay Mitropolsky
6b91b7cce5 192: KotlinElementActionsFactory: support for keeping existing parameters on signature change 2019-03-21 12:47:26 +03:00
Nicolay Mitropolsky
713f73e414 Uast: getMaybeLightElement returns class for annotation primary constructor 2019-03-21 12:46:28 +03:00
Nicolay Mitropolsky
7b590055f8 Uast: resolveCallToDeclaration cleanup 2019-03-21 12:46:27 +03:00
Nicolay Mitropolsky
90894176f9 Uast: stop resolve parts of fqn to the full-name target 2019-03-21 12:46:27 +03:00
Dmitry Gridin
403801b0b3 Fix exception when add import
#KT-30524 Fixed
2019-03-21 16:35:43 +07:00
Dmitry Gridin
3ce002dd6e Improve: optimize ConvertMemberToExtension 2019-03-21 16:35:43 +07:00
Dmitry Gridin
e8eb9c3d58 Minor: refactoring ConvertMemberToExtensionIntention 2019-03-21 16:35:43 +07:00
Dmitry Gridin
e11072b8c2 Improve: add more cases for MoveVariableDeclarationIntoWhen
#KT-30499 Fixed
2019-03-21 16:32:41 +07:00
Dmitry Gridin
c84ff1d8b1 Inspection "MoveVariableDeclarationIntoWhen" should inline variable declaration 2019-03-21 16:31:29 +07:00
Dmitry Petrov
f9119c001e JVM_IR: generate file class without members if it has metadata 2019-03-21 11:23:51 +03:00
Dmitry Petrov
a5c95275f0 IR: get rid of descriptors in DumpIrTree 2019-03-21 11:23:51 +03:00
Dmitry Petrov
9a82f926a1 IR: descriptor-less rendering of IR elements (work in progress) 2019-03-21 11:23:51 +03:00
Dmitry Petrov
cd138bc022 IR: IrSymbolVisitor 2019-03-21 11:23:51 +03:00
Dmitry Petrov
110a15d395 IR: drop IrFile.fileAnnotations (it already has annotations anyway) 2019-03-21 11:23:51 +03:00
Dmitry Petrov
b42aa39033 IR: drop IrTypeAlias 2019-03-21 11:23:51 +03:00
Dmitry Petrov
e49eae528c IR: don't use descriptors in rendering (work in progress)
There's some descriptor-based code remaining. Need some more work on IR.
2019-03-21 11:23:51 +03:00
Toshiaki Kameyama
bd3d5a9dbb Use withIndex intention: fix false positive for destructuring declaration
#KT-30341 Fixed
2019-03-21 10:59:01 +03:00
Toshiaki Kameyama
cbdc79fcda Add when branches: remove unnecessary blank line
#KT-30426 Fixed
2019-03-21 10:58:11 +03:00
Mikhail Glukhikh
c1984d92ff Introduce FirFile.fileSession, get rid of most FirElement.session usages 2019-03-21 10:29:58 +03:00
Roman Artemev
698594b14d [IR] Fix classifier equality for Local classes 2019-03-20 23:45:03 +03:00
Vyacheslav Gerasimov
4cd95256b6 Build: Add tasks to clean repo directory and legacy repo directories 2019-03-20 23:38:36 +03:00
Ilya Chernikov
43e4dbb0b1 Fix tests after unblocking exceptions on loading script definitions
should be temporary, proper solution needed in the future
2019-03-20 21:19:25 +01:00
Ilya Chernikov
ffd1633e3e Write tests for dynamic versions with ivy and maven resolvers
and refactor tests
#KT-27051 fixed
this commit is just a confirmation of the fix: either it worked
from the beginning, or was fixed by some unrelated change
2019-03-20 21:19:24 +01:00
Ilya Chernikov
f2bddce4fd Refactor script definition loading error handling
reenable logging of failures
suppress loading from failed contributors
2019-03-20 21:19:24 +01:00
Ilya Chernikov
dd3ac74bd2 Refactor ivy resolver
add support for artifacts with type an classifier
use ibiblio resolver by default - it is designed for working with maven central
add test, but disable it - see comments for the reason and todos
2019-03-20 21:19:24 +01:00
Ilya Chernikov
fc9a6dec7e Add optional suffix to the script template markers
add suffix to the markers in the repo
#KT-28593 fixed
2019-03-20 21:19:24 +01:00
Ting-Yuan Huang
79fcaae991 Implement constant folding in the IR backend for JVM
The newly added pass folds the set of constant functions of the
current backend, plus IrBuiltIns.
2019-03-20 21:02:55 +01:00
Ting-Yuan Huang
7e4d33be24 ConstantExpressionEvaluator: make evaluate*naryAndCheck public 2019-03-20 21:02:55 +01:00
Ting-Yuan Huang
f352a4dcd4 IrBuiltIns: factoring out operator names
so that they can be used in other contexts.
2019-03-20 21:02:55 +01:00
Ilya Gorbunov
8021f9c4af Clarify toSortedMap and sortedMapOf docs (KT-30100)
Remove the note about iteration order so that toSortedMap is not misused
for sorting map entires with the comparator inconsistent with key equality.
2019-03-20 22:08:03 +03:00
Vyacheslav Gerasimov
c650206f54 Build: Fix hardcoded paths in artifacts for JPS build 2019-03-20 21:29:25 +03:00
Vyacheslav Gerasimov
d9b149fd2f Build: Rename kotlinBuildRepo -> kotlinBuildLocalRepo 2019-03-20 21:29:24 +03:00
Vyacheslav Gerasimov
a1a30ad041 Build: Rename nodeJS -> nodeJSPlugin 2019-03-20 21:29:22 +03:00
Vyacheslav Gerasimov
128b70e2c4 Build: Add property to enable dependency task output verification
Enabled on teamcity by default, disabled locally by default,
kotlin.build.dependency.output.verification may be used to specify explicitly
2019-03-20 21:29:21 +03:00
Vyacheslav Gerasimov
a543dee39a Build: Get jps-build-test directly from maven 2019-03-20 21:29:19 +03:00
Vyacheslav Gerasimov
d9d6e9b10a Build: Merge AndroidSdkDependencies.kt & intellijDependencies.kt 2019-03-20 21:29:18 +03:00
Vyacheslav Gerasimov
98a7c5264c Build: Move intellij-sdk contents to prepare-deps 2019-03-20 21:29:16 +03:00
Vyacheslav Gerasimov
139286bf44 Build: Merge prepare-deps/android-dx to intellij-sdk 2019-03-20 21:29:14 +03:00
Vyacheslav Gerasimov
fc8be48fa8 Build: Improve intellij-sdk repo up-to-date check time & layout
Up-to-date check is very heavy for intellij repo due to artifact size.
If module directory in repo is written only by one task we can assume
that task if up-to-date if target directory exists.
2019-03-20 21:29:13 +03:00
Vyacheslav Gerasimov
f890cab145 Build: Rename custom-dependencies -> dependencies 2019-03-20 21:29:11 +03:00
Vyacheslav Gerasimov
07b0129a6a Build: Build android-dx and intellij-sdk repo to dependencies/repo
From KOTLIN-CR-2801 reasons to move:
 - I've changed repo layout and build process in incompatible way and decided to change location
 - It was difficult to find and annoying to locate, it was very deep and long path
 - I think dependencies/repo path is very easy to remember and find
 - It was called dependencies some time ago
2019-03-20 21:29:09 +03:00
Vyacheslav Gerasimov
ef159a4fc9 Minor: Fix typo in build error message 2019-03-20 21:17:27 +03:00
Vyacheslav Gerasimov
9f64e0fa69 Build: Remove intellijEnforceCommunitySdk flag, use currentIde instead
Setup ultimate repositories only when currentIde is Intellij
2019-03-20 21:17:27 +03:00
Yan Zhulanow
683c2b0434 Don't use experimental features of Android Extensions in 'testAndroidDaggerIC()'
AndroidDaggerProject uses the @Parcelize functionality that was experimental until 1.3.30. Now it is not.
2019-03-20 20:52:23 +03:00
Yan Zhulanow
44f752d1c5 Always attach kotlin-android-extensions-runtime library
@Parcelize is now enabled by default, and it requires the runtime library.
Enabling it for all clients is a temporary solution.
In future, the runtime library will be split to two separate artifacts.
2019-03-20 20:52:23 +03:00
Jake Wharton
8e23555660 Make parcelize a non-experimental feature
It was already being added to the feature list by default, but was only enabled when isExperimental was true.
2019-03-20 20:52:23 +03:00
Yan Zhulanow
c40cc76ad3 Minor: Fix error message, add missing article 2019-03-20 20:52:23 +03:00
Yan Zhulanow
c7678a27e5 Kapt: Fix star indentation in stub Javadoc (KT-30163) 2019-03-20 20:52:23 +03:00
Yan Zhulanow
e4d758b614 Kapt: Support default constant values for constructor parameters 2019-03-20 20:52:23 +03:00
Yan Zhulanow
10e53a2e73 Kapt: Move out the 'final' fallback for initial field values 2019-03-20 20:52:22 +03:00
Yan Zhulanow
cce2b472bf Kapt: Generate constant value initializers for mutable properties (KT-30164) 2019-03-20 20:52:22 +03:00
Yan Zhulanow
ce13982cfc Kapt: Use constant value references where possible in property initializers 2019-03-20 20:52:22 +03:00
Yan Zhulanow
66754e62da Kapt: Always use raw types for annotation parameter types (KT-30346) 2019-03-20 20:52:22 +03:00
Yan Zhulanow
90e84aa15d Remove isAtBreakpoint checks as it's not valid in all cases
For example, when we stopped at a breakpoint and then did a 'step over' action, we aren't at that breakpoint any more.
However, we still can evaluate things.
2019-03-20 20:52:22 +03:00
Yan Zhulanow
bbdeb3efac Avoid using 'loadClass()' as it doesn't cache the results 2019-03-20 20:52:22 +03:00
Yan Zhulanow
e79ee1ba8e Use caching 'findClass()' instead of raw 'Class.forName()' call in async stack trace provider (KT-30268) 2019-03-20 20:52:22 +03:00
Yan Zhulanow
b2a47027fb Move eval4j to idea 2019-03-20 20:52:22 +03:00
Yan Zhulanow
65da7ba971 Add the whole content of the Apache 2.0 license to the Kotlin repo 2019-03-20 20:52:21 +03:00
Yan Zhulanow
6d90e850ff Refactoring: Incapsulate method calls into ExecutionContext 2019-03-20 20:52:21 +03:00
Yan Zhulanow
5d156c2edb Debugger: Fix indentation in code fragments 2019-03-20 20:52:21 +03:00
Yan Zhulanow
a1e5ce2c8b Don't activate Kotlin async stack trace provider in Java sources (KT-30318) 2019-03-20 20:52:21 +03:00
Yan Zhulanow
754a7bc554 Code fragment analysis: analyze parents if there's no sensible scope for the default element (KT-29179) 2019-03-20 20:52:21 +03:00
Yan Zhulanow
97f94700b9 Don't file an exception if we failed to calculate the anonymous class name 2019-03-20 20:52:21 +03:00
Yan Zhulanow
fd3fab5bcc Minor: Fix formatting in DebuggerClassNameProvider 2019-03-20 20:52:21 +03:00
Yan Zhulanow
d0a61fa7e2 Fix breakpoint handling in Kotlin scripts (KT-29234) 2019-03-20 20:52:20 +03:00
Yan Zhulanow
4870b2e6ba Fix asmTypeForAnonymousClassOrNull(): it should not throw an exception if a class name isn't found 2019-03-20 20:52:20 +03:00
Yan Zhulanow
3f92451fde Explicitly check for the callable class availability
'@NotNull' annotation generates a not-null assertion that caused exceptions to throw from 'asmTypeForAnonymousClassOrNull()'.
2019-03-20 20:52:20 +03:00
Yan Zhulanow
77c2a5c87c Debugger: Fix missing NOP in empty 'when' header (KT-29189) 2019-03-20 20:52:20 +03:00
Yan Zhulanow
ba0989801a Debugger: Show captured outer this in lambdas (Variables view) (KT-30220) 2019-03-20 20:52:20 +03:00
Yan Zhulanow
723f8df23e Hide '$delegate' variables in Kotlin variables mode 2019-03-20 20:52:20 +03:00
Yan Zhulanow
570421b831 Fix lambda evaluation on JDK 9-11 (KT-29423) 2019-03-20 20:52:20 +03:00
Sergey Igushkin
af7c35b5c7 Revert profile_settings.xml accidentally deleted in ffdd43b8 2019-03-20 19:56:50 +03:00
Jake Wharton
6ee987fa2e Add intrinsics for compile-time computing trimMargin/trimIndent
These only apply when the receiver can be resolved to a constant and the margin prefix, if specified, is also a constant.
2019-03-20 17:25:29 +01:00
Alexey Tsvetkov
2ec6ab92b5 Clear outputs before compiling with in-process/out-of-process execution mode
Issue #KT-30492 Fixed
2019-03-20 17:11:37 +03:00
Ivan Gavrilovic
b2ad82b7d2 Incremental KAPT - invalidate obsolete types
Once set of dirty symbols is computed, filter these types
when they are requested from the JavaFileManager. This is accomplished
by tracking all declared types in the sources and generated sources.
It is not necessary track types in generated class files, as these will
be removed before the APs are incrementally run.

Motivation: APs (e.g. Dagger) may use Elements.getTypeElement(String)
to determine if type is already present, and if it is, they will not
generate it. Therefore, whenever generated sources is invalidated, types
it defines need to be filtered in the JavaFileManager.

Issue is https://youtrack.jetbrains.com/issue/KT-23880
2019-03-20 16:43:13 +03:00
Ivan Gavrilovic
2f3d234516 Incremental KAPT - handle inherited annotations
Handle annotations with @Inherited. This is important for
the aggregating APs, as the current implementation passes all sources
annotated with claimed aggregating annotations.

Issue is https://youtrack.jetbrains.com/issue/KT-23880
2019-03-20 16:43:10 +03:00
Ivan Gavrilovic
9f14daa682 Incremental annotation processing with KAPT
Add support for incremental annotation processors in KAPT. These
processors conform to https://docs.gradle.org/current/userguide/java_plugin.html#sec:incremental_annotation_processing
specification.

Support is provided by using javac compiler APIs and
recording the source file structure. At runtime, processors
are instrumented with custom Filer that is used to keep track of generated
files. In order to support classpath changes, stub generation task is
used to generated a list of changed FQCNs, and this is simply used by KAPT.
Both worker and non-worker mode are supported.

 #KT-23880
2019-03-20 16:43:02 +03:00
Dmitry Gridin
600a955a51 Fix false positive "Unused import" for type alias
#KT-29977 Fixed
2019-03-20 20:28:22 +07:00
Dmitry Gridin
7e4b3ceede Minor: refactoring KotlinUnusedImportInspection 2019-03-20 20:28:22 +07:00
Toshiaki Kameyama
4e3d13fcee Change to star projection: do not suggest in arguments or receiver
#KT-23259 Fixed
2019-03-20 20:12:06 +07:00
Nikolay Krasko
73396b5018 Log connection problems during fetching release date 2019-03-20 14:23:43 +03:00
Nikolay Krasko
9a5b902766 Use special request for fetching plugin release date in exception reporter 2019-03-20 14:23:43 +03:00
Nikolay Krasko
a0d015dd4d Minor: document shortening and smart enter use resolve in write action 2019-03-20 14:23:42 +03:00
Nikolay Krasko
1060a24221 Don't allow to resolve anything within write action 2019-03-20 14:23:42 +03:00
Dmitry Petrov
7e4688da93 psi2ir: add test for reference to var with non-accessible setter 2019-03-20 11:57:57 +03:00
Dmitry Petrov
21dbe2e7e7 IR: symbolName mangling for IrTypeParameter
(original author: Alexander Gorshenev)
2019-03-20 11:57:57 +03:00
Roman Artemev
206e5d30d9 Regenerate protobuf 2019-03-20 11:57:57 +03:00
Dmitry Petrov
c86ef5da53 psi2ir: update testData for property references 2019-03-20 11:57:57 +03:00
romanart
5b5f3a7468 [IR] Fix classes TypeParameter [de]serialization 2019-03-20 11:57:57 +03:00
Dmitry Petrov
9f48695dde psi2ir: no unbound field symbols in delegated property references
#KT-30323 Fixed
2019-03-20 11:57:57 +03:00
Dmitry Petrov
15918fc475 IR: deprecations 2019-03-20 11:57:57 +03:00
Dmitry Petrov
bd9c5645cd IR: fix property reference symbol binding for generic properties 2019-03-20 11:57:57 +03:00
Dmitry Petrov
8b4dab7c25 JS_IR: fix property name generation 2019-03-20 11:57:57 +03:00
Dmitry Petrov
04fad012a0 IR: IrPropertySymbol introduced, some code cleaned up
#KT-30304
2019-03-20 11:57:57 +03:00
Anton Yalyshev
1bc35b1b0c updated TipsOfTheDay pics, as New Project Wizards got new names 2019-03-20 11:23:18 +03:00
Ting-Yuan Huang
f6cf434650 when: emit switch for String if possible
Effectively, the following when structure:

  when (s) {
    s1, s2 -> e1,
    s3 -> e2,
    s4 -> e3,
    ...
    else -> e
  }

is implemented as:

  when (s.hashCode()) {
    h1 -> {
      if (s == s1)
        e1
      else if (s == s2)
        e1
      else if (s == s3)
        e2
      else
        e
    }
    h2 -> if (s == s3) e2 else e,
    ...
    else -> e
  }

where s1.hashCode() == s2.hashCode() == s3.hashCode() == h1,
      s4.hashCode() == h2.

A tableswitch or lookupswitch is used for the hash code lookup.

Change-Id: I087bf623dbb4a41d3cc64399a1b42342a50757a6
2019-03-20 09:13:51 +01:00
Dmitriy Dolovov
1a9ed88be4 Don't publish CLion/AppCode plugins to IDEA channel at plugins.jetbrains.com 2019-03-20 12:19:30 +07:00
Sergey Igushkin
914f7c8719 KT-27675: Following the Gradle Java plugin, enable Kapt cache by default
As the Gradle Java plugin considers Java annotation processing cacheable
with any annotation processors, we can enable build cache by default
for Kapt tasks, leaving the opt-out flag just in case.

Issue #KT-27675 Fixed
2019-03-19 21:22:35 +03:00
Sergey Igushkin
ffbd0e8af1 Automatically detect Android Java 1.8 source+target (KT-21030)
When Android Java 8 desugaring is set as follows (or above):

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

set the Kotlin JVM target to 1.8

Issue #KT-21030 Fixed
2019-03-19 21:22:35 +03:00
Sergey Igushkin
70db646576 Fix wrong commits picked for master: restore changes from KOTLIN-CR-2817 2019-03-19 21:22:35 +03:00
Sergey Igushkin
ec3e5c6959 Revert "Use KotlinTarget.disambiguationClassifier for task & configuration names" 2019-03-19 21:10:26 +03:00
Roman Artemev
2ed29d8869 [IR BE] Use pure IrType instead of KotlinType
* clean up code
2019-03-19 20:09:07 +03:00
Ilya Chernikov
1823ba1c48 Fix deserialization of the compiled script
#KT-29741 fixed
2019-03-19 17:11:52 +01:00
Ilya Chernikov
b395cb120a Implement import test witch caching
reproduced KT-29741
plus some tests refactoring
2019-03-19 17:11:52 +01:00
Ilya Chernikov
931b1c66d8 Fix equality and serializability of scripting data, fix relevant caching behaviour 2019-03-19 17:11:52 +01:00
Ilya Chernikov
7a4d369c9f Extend script cache tests, revealing that cache doesn't work in fact 2019-03-19 17:11:52 +01:00
Ilya Chernikov
6e55116519 Relocate packages that could be possibly used in the scripts themselves
#KT-30210 fixed
2019-03-19 17:11:52 +01:00
Sergey Igushkin
91ce7ef5ca Introduce new Gradle plugin org.jetbrains.kotlin.js
This is the Gradle plugin that does not rely on the
Java model and uses the same Kotlin model
(target – compilation – source set) as MPP does.

Also add JS DCE support for this plugin.

Issue #KT-5756 Fixed
Issue #KT-13256 Fixed
Issue #KT-16355 Fixed
Issue #KT-20156 Fixed
Issue #KT-29284 Fixed
2019-03-19 16:32:11 +03:00
Sergey Igushkin
03b74343c8 Refactor & minor fix in software component logic of AbstractKotlinTarget
* Create the sources JAR for both Gradle 4.7+ and versions below 4.7
* Set `componentName` in all branches of `createKotlinVariant`
2019-03-19 16:24:37 +03:00
Sergey Igushkin
5b5316214f Apply user-defined attributes in single-platform plugins
The attributes applied by the user to the target and its compilations
were ignored in single-platform plugins while the target was not a part
of the API.

Since the user will be able to access and configure the target, we need
to apply the attributes to the relevant configurations in the same way
as in MPP.
2019-03-19 16:24:37 +03:00
Sergey Igushkin
8fa1630695 Add the single-platform target's 'components' to 'project.components' 2019-03-19 16:24:37 +03:00
Sergey Igushkin
a19e8fe03e Use KotlinTarget.disambiguationClassifier for task & configuration names
In MPP, the disambiguation classifier is always the same as the target
name. In single-platform projects, the task name suffix should be empty
for the JVM targets. Using the `disambiguationClassifier` for this
purpose is more consistent with other usages of
`disambiguationClassifier`.

The target name for all existing single-platform plugins will be just
'kotlin'.
2019-03-19 16:24:37 +03:00
Sergey Igushkin
4e711f9a0c Introduce single-project extensions with static types for Kotlin target 2019-03-19 16:24:37 +03:00
Sergey Igushkin
b3eef05e6e Fix user-specified attributes in Android targets (KT-27714)
Ensure that custom target and compilation attributes are copied to
relevant configurations of Android targets as well, which did not happen
because of Android variants (and missing simple apiElements,
runtimeElements) and Android compilations being created late in the
project configuration.

Issue #KT-27714 Fixed
2019-03-19 16:24:36 +03:00
Sergey Igushkin
6fa610156e Create and configure Android compilations earlier (KT-29964)
As Android variants are created after the project is evaluated,
the build script and plugins might have added some item handlers to the
domain object containers which are yet to be filled.

To ensure that those handlers see properly configured compilations and
their tasks, we need to add a compilations to the container only after
it has been properly configured.

Also, the `forEachVariant` handler is already executed in
`afterEvaluate`, and there seems to be no need to wrap our
code working with variants in `afterEvaluate`.

Issue #KT-29964 Fixed
2019-03-19 16:24:36 +03:00
Toshiaki Kameyama
e06514c945 Smart completing anonymous object: follow code style settings (KT-29572)
#KT-29572 Fixed
2019-03-19 16:09:07 +03:00
kenji tomita
e1f26ffc74 Remove spaces between accessor and its parameter list in formatter (KT-30393)
#KT-30393 Fixed
2019-03-19 16:09:07 +03:00
Toshiaki Kameyama
0acecb4936 Minor: fix caret behaviour in arg template test
#KT-29398 Fixed
2019-03-19 16:09:07 +03:00
Alexander Udalov
29d32b213e Cleanup modules descriptors.jvm, descriptors.runtime
Fix warnings and inspections
2019-03-19 13:01:03 +01:00
Alexander Udalov
b89d7029b2 Reformat modules descriptors.jvm, descriptors.runtime
Also remove several unused files (BuiltinOverridabilityCondition.kt,
PackageMappingProvider.kt)
2019-03-19 13:01:02 +01:00
pyos
39adfcced1 Add more comments to PropertyReferenceLowering 2019-03-19 12:00:29 +01:00
pyos
ed298c48b7 Unmute a test fixed by a combination of PR #2151 and #2184 2019-03-19 12:00:29 +01:00
pyos
6c68474489 JVM_IR: use correct signatures for local delegated property references
Which is `<v#N>` where N is the index of that property in the containing
class.
2019-03-19 12:00:29 +01:00
pyos
8c55376f0c Unmute almost all JVM_IR tests that use property references 2019-03-19 12:00:29 +01:00
pyos
330c4648cb Implement property references in JVM_IR 2019-03-19 12:00:29 +01:00
Dmitry Gridin
43be01bbc8 Fix false positive 'Introduce import alias' on this/super 2019-03-19 16:42:41 +07:00
Dmitry Gridin
1626bc4751 Optimize "Introduce import alias"
Relates to #KT-30462
2019-03-19 16:42:41 +07:00
Dmitry Gridin
ccb1ae13ea Fix local conflicts in 'Introduce import alias' 2019-03-19 16:42:41 +07:00
Dmitry Gridin
9659453351 Improve: intention "Introduce Import Alias" should suggest new names for the new alias
#KT-30456 Fixed
2019-03-19 16:42:41 +07:00
Dmitry Gridin
ff34788eb3 Minor: refactoring KotlinNameSuggester 2019-03-19 16:42:41 +07:00
Nicolay Mitropolsky
0d2426b081 191: Uast: isJvmElement check added to the newly added conversion methods (EA-125791) 2019-03-19 12:24:44 +03:00
Mikhail Glukhikh
a07502374e Rename (style): russian "С" to english "C" 2019-03-19 12:23:47 +03:00
pyos
82ccf81da8 Fix this remapping in inner class constructors
Inner class constructors should use the argument instead of reading
outer `this` from a field because if such an access happens before a
delegating constructor call, e.g. when evaluating an argument, a JVM
bytecode validation error will be thrown. (The only operation on `this`
allowed before a delegating constructor call is SETFIELD, and only if
the field in question is declared in the same class.)
2019-03-19 09:20:41 +01:00
pyos
7e8db4cc4a Refactor InnerClassesLowering 2019-03-19 09:20:41 +01:00
Toshiaki Kameyama
a2adfd0cc0 Nested lambda has shadowed implicit parameter: do not report when lambda is in scope function
#KT-30173 Fixed
2019-03-19 10:37:47 +03:00
Dmitry Gridin
daf8df9e4b Fix flaky test AddReturnToUnusedLastExpressionInFunction/Nothing 2019-03-19 11:29:53 +07:00
Ilya Matveev
fd9ac54d81 Improve deprecation warning about usage of old binary DSL
Previously we showed list of all deprecated APIs even if a user uses
only one of them. This patch changes the behaviour and shows only
APIs really used by the user. An approach similar to the one used by
SingleWarningPerBuild in applied here.

Issue #KT-29998 Fixed
2019-03-19 11:19:49 +07:00
Ilya Matveev
bfb0d738b1 Disable C2 compiler for HotSpot VM when running K/N tools 2019-03-19 11:19:48 +07:00
Ilya Gorbunov
b74fe7c1c3 Clarify floor and ceil docs (KT-30418) 2019-03-19 03:12:12 +03:00
Ilya Gorbunov
b0a234ec74 Minor: collection docs formatting 2019-03-19 03:12:09 +03:00
Ilya Gorbunov
bc444df20c Clarify behavior of MutableSet.add (KT-29373) 2019-03-19 03:12:04 +03:00
Alexander Gorshenev
e9ad9273b1 Proper KotlinIr protobuf location. 2019-03-18 23:29:44 +03:00
Dmitriy Novozhilov
d01b6ef900 Revert "[NI] Support @OnlyInputTypes annotation. #KT-29307 fixed"
This reverts commit 90628112
With that annotation there is complex bug that breaks build of Kotlin compiler
2019-03-18 18:53:38 +03:00
Ilya Gorbunov
25b3f62767 Clarify yield/yieldAll function suspending the caller behavior 2019-03-18 18:01:39 +03:00
Mikhail Glukhikh
16f9eecb29 Fix "/ by zero" in FirResolveBench & switch progress OFF in smoke tests 2019-03-18 17:12:02 +03:00
Mikhail Glukhikh
741bdccca5 Enhance progress logging in FIR total resolve tests 2019-03-18 14:49:11 +03:00
Mikhail Glukhikh
a334ca6224 Move FIR total kotlin resolve in IDE test into performance group 2019-03-18 14:48:50 +03:00
Anton Yalyshev
71eb540eaf improved english in wizard's descriptions. also now user knows about project's build system from its name 2019-03-18 14:15:35 +03:00
Svyatoslav Kuzmich
1d6cd90043 [JS IR BE] Clean up compiler driver api
This is a preparation step for JS-IR CLI:
- CompiledModule was overused. Split it into KlibModuleRef and TranslationResult
- Deserialize klib dependencies from klibs itself
2019-03-18 14:13:28 +03:00
Svyatoslav Kuzmich
e302f63d9a [JS IR BE] Remove generateModuleInGlobalScope for code generator
This method used to be a workaround for test speedup.
Now we use proper close world module with runtime+stdlib module
as pre-serialized klib.
2019-03-18 14:13:28 +03:00
Ilmir Usmanov
d154cf9a59 Fix test data 2019-03-18 14:04:04 +03:00
Ilmir Usmanov
c68413b953 Do not generate StateMachineChecker if CHECK_STATE_MACHINE directive is
not present.
Otherwise, since it uses suspend functions, it breaks IR tests.
2019-03-18 14:04:03 +03:00
Ilmir Usmanov
7956ef18b2 Generate RETURN instead of ARETURN if (cross)inline suspend lambda returns Unit
#KT-30073 Fixed
2019-03-18 14:04:02 +03:00
Ilmir Usmanov
cc9a0041e0 Check number of suspensions in crossinline tests 2019-03-18 14:04:01 +03:00
Ilmir Usmanov
df52c5217d Add facility to check number of suspensions in coroutine tests 2019-03-18 14:04:01 +03:00
Maxim Shafirov
ca35c9e2ff Update copyright dates 2019-03-18 12:52:27 +03:00
Nikolay Krasko
b0156bc5db Minor: cleanup KotlinTypeCheckerTest.java 2019-03-18 11:56:20 +03:00
Burak Eregar
db4144426a Fix SimplifiableCallChain inspection quick fix removes comments for intermediate operations 2019-03-18 11:35:32 +03:00
Toshiaki Kameyama
8728bc0820 Convert to scope function: also convert binary expression
#KT-30228 Fixed
2019-03-18 11:18:23 +03:00
Toshiaki Kameyama
e340af51df Add "Rename class to containing file name" intention
#KT-25262 Fixed
2019-03-18 11:09:09 +03:00
Toshiaki Kameyama
39016594b1 Replace return with 'if'/'when': don't drop return label
#KT-30414 Fixed
2019-03-18 09:46:10 +03:00
victor.petukhov
9a2178d96b Split 'nothingTypedSuspendFunction' test into two separate tests (for old and new coroutines) 2019-03-16 21:39:44 +03:00
victor.petukhov
29493a4977 Fix 'nothingTypedSuspendFunction' test after 70c35f4186 2019-03-16 14:15:08 +03:00
Alexander Gorshenev
51e862e793 Fix file descriptor unlimited growth. 2019-03-16 13:45:45 +03:00
victor.petukhov
5fc0d85b3c Regenerate FIR tests (include tests for implicit nothing as type parameter) 2019-03-16 00:41:58 +03:00
Alexander Udalov
2539873492 Remove CommonBackendContext.getClass
This function is unused in backend.common (and actually throws exception
in Native), therefore it makes sense to move it down to subtypes
2019-03-15 19:27:48 +01:00
Alexander Udalov
e13b8eb039 Remove CommonBackendContext.getInternalFunctions
Similarly to getInternalClass, move to subclasses
2019-03-15 19:27:48 +01:00
Alexander Udalov
bd694105e9 Remove CommonBackendContext.getInternalClass
Move to subclasses: getJvmInternalClass, getJsInternalClass and
getKonanInternalClass (in Kotlin/Native). The advantage of this is that
this API need not be shared between backends any longer, which makes
sense because implementation details differ across platforms
2019-03-15 19:27:48 +01:00
Alexander Udalov
4ab1916ebf Cleanup Symbols and JvmIr.JvmSymbols 2019-03-15 19:27:47 +01:00
Alexander Udalov
e9c2bc81aa Remove lateinitIsInitializedPropertyGetter, introduce static check function
This will be helpful in JVM IR tests without stdlib where it's not
necessary to have 'isInitialized' in dependencies
2019-03-15 19:27:47 +01:00
Alexander Udalov
c730de13df Minor, add missing copyright to compiler modules 2019-03-15 19:27:46 +01:00
Alexander Udalov
9ca7719d1f Minor, inline obsolete and deprecated createFunctionSymbol
Also undeprecate 'createSymbolForScopeOwner' and make it private
2019-03-15 19:07:16 +01:00
Alexander Udalov
0c8e58936c Remove DeepCopyIrTree and most "Creates unbound symbol" deprecated members 2019-03-15 19:05:19 +01:00
victor.petukhov
70c35f4186 Introduce warning about implicitly inferred Nothing as a type parameter
^KT-20849 Fixed
2019-03-15 19:28:38 +03:00
Roman Artemev
1f98eaa27b [JS IR BE] Fix Callable reference with vararg
* Update tests
2019-03-15 19:21:38 +03:00
Roman Artemev
a2d65e8a60 [IR] Code clean up 2019-03-15 19:21:38 +03:00
Roman Artemev
95821313e3 [IR BE] Get rid of usages of descriptor-based IrType utils 2019-03-15 19:21:38 +03:00
Roman Artemev
238f1b2b06 [IR] * Implement isSubtypeOfClass and commonSuperclass based on pure Ir
* Implement type strict equality check
     * Move type checkers into Ir
     * Implement strict Fqn-based classifier equality checker
2019-03-15 19:21:38 +03:00
Simon Ogorodnik
e056882aa6 Add DiagnosticsTest testData based smoke test for FIR #KT-29962 Fixed
Yet seven of these tests fail with an exception in RawFirBuilder
2019-03-15 18:31:55 +03:00
Mikhail Glukhikh
0d976a4870 FIR: forbid supertype resolve in local classes 2019-03-15 18:31:49 +03:00
Abduqodiri Qurbonzoda
35c6f09886 Implement coerce extension functions for unsigned types 2019-03-15 17:46:48 +03:00
Abduqodiri Qurbonzoda
a369496aca Throw IOOB on invalid index in JS StringBuilder.get to adhere contract 2019-03-15 17:40:31 +03:00
Abduqodiri Qurbonzoda
814d6cf39c Document Array and String get() function behavior (KT-30141) 2019-03-15 17:40:19 +03:00
Anton Bannykh
a4c693ec29 [JS IR BE] updated inliner to the most recent version
FunctionInlining.kt commit 364b7ae72a :
364b7ae72a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt
2019-03-15 14:56:33 +03:00
Anton Bannykh
0249e33f3e IR: add skipExternalProperties flag to PropertiesLowering
Same problem as in deafult argument lowering: JVM and JS semantics differ.
Same solution: skip in common lowerings, process if needed in platform ones.
2019-03-15 14:56:31 +03:00
Anton Bannykh
9a56b0e6d6 [JS IR BE] Reorder phases in order to extract a common prefix 2019-03-15 14:56:31 +03:00
Anton Bannykh
017cd3a0f6 IR: more verbose unsatisfied phase requirement reporting 2019-03-15 14:55:10 +03:00
Anton Bannykh
9dd9ef1cf0 IR: Make Phaser complain about duplicate phase names
(instead of silently throwing away all but the last phase
with the same name)
2019-03-15 14:55:10 +03:00
Anton Bannykh
bb1660c688 JS: better error reporting for V8 runner
In case of stack overflow both the code and the memory release
caused an exception. Only the latter was shown, and it did
not contain much useful information.
2019-03-15 14:55:10 +03:00
Anton Bannykh
b61a520da9 [JS IR BE] unmute tests 2019-03-15 14:07:53 +03:00
Svyatoslav Kuzmich
41a45d98e7 [JS IR BE] Regenerate & unmute tests 2019-03-15 13:53:23 +03:00
Svyatoslav Kuzmich
0f07209490 [JS IR BE] Remove unnecesary println from tests 2019-03-15 13:53:21 +03:00
Svyatoslav Kuzmich
d203e062bb [JS IR BE] Remove package from operators.kt 2019-03-15 13:53:21 +03:00
Svyatoslav Kuzmich
7b3416c99f [JS IR BE] Disable @library test for JS IR
@library is an internal annotation used in legacy stdlib to expose
declarations written in JS.

IR BE based stdlib will not include JS code thus annotation will not
be supported.
2019-03-15 13:53:21 +03:00
Svyatoslav Kuzmich
41bbd4d2d6 [JS IR BE] Support property accessors with @JsName 2019-03-15 13:53:21 +03:00
Svyatoslav Kuzmich
c7f1238a07 [JS IR BE] Add @JsName to inheritanceInNativeClass.kt test to avoid relying on mangling 2019-03-15 13:53:21 +03:00
Svyatoslav Kuzmich
9230b70294 [JS IR BE] Minor dynamic refactoring 2019-03-15 13:53:20 +03:00
Svyatoslav Kuzmich
94dc6ff24a [JS IR BE] Disable legacy test 2019-03-15 13:53:20 +03:00
Svyatoslav Kuzmich
4005b5ce10 [JS IR BE] Fix fqNames in moveBodilessDeclarationsToSeparatePlace 2019-03-15 13:53:20 +03:00
Dmitry Gridin
d333a0ad4e Allow "Create class" action in return statement
#KT-22137 Fixed
2019-03-15 17:33:14 +07:00
Dmitry Gridin
41cfb4e2ed Minor: refactoring createClassUtils.kt 2019-03-15 17:33:14 +07:00
Dmitry Gridin
220cb95b85 Move caret to class name after creating it from "CreateFromUsage" action
Relates to #KT-24631
2019-03-15 17:27:06 +07:00
Alexander Gorshenev
0c8f0a433d Copying kotlin-native fix
* commit 575cbf48c3
    | Author: SvyatoslavScherbina <Svyatoslav.Scherbina@jetbrains.com>
    | Date:   Thu Mar 14 14:25:10 2019 +0300
    |
    |     Optimize DescriptorReferenceDeserializer again (#2755)

to common ir deserializer.
2019-03-15 12:48:48 +03:00
Anton Bannykh
826b9d935d JS/JS IR: split testing tasks for the two backends
Run jsTest for current backend, and jsIrTest for the JS-IR backend tests
2019-03-15 12:19:33 +03:00
Dmitriy Novozhilov
b07aed7a00 [NI] Fix determination of completion mode. #KT-30406 Fixed 2019-03-15 10:39:50 +03:00
Dmitriy Novozhilov
1c92c22dee [NI] Add support ExpectedTypeFromCast to new inference. #KT-30405 Fixed 2019-03-15 10:39:29 +03:00
Dmitriy Novozhilov
9062811231 [NI] Support @OnlyInputTypes annotation. #KT-29307 fixed
Also KT-26698 fixed in new inference
2019-03-15 10:39:11 +03:00
Dmitriy Novozhilov
0ba163d70b [NI] Fix testdata of inference lambdas with SAM conversions
Tetdata was broken in 3e147af3c0
#KT-27565 related
2019-03-15 10:39:11 +03:00
Mark Punzalan
3585792b3b Break out bytecodeText/conditions tests into smaller tests for if/while/do-while. 2019-03-15 08:32:22 +01:00
Mark Punzalan
9eb11ff3e9 Generate conditional jumps with optimizations for loops, if possible. 2019-03-15 08:32:22 +01:00
Mikhail Glukhikh
2aaf13e734 FIR: fix test compilation for 181 patchset 2019-03-15 10:24:15 +03:00
Ilya Gorbunov
7a038f1330 Refactor sanitizeStackTrace function to spare allocations
Use Arrays.copyOfRange instead of List.subList.toArray.
2019-03-15 06:26:59 +03:00
Alexander Gorshenev
ee7660065b Changes after code review 2019-03-15 03:03:08 +03:00
Alexander Gorshenev
f8be378a65 Port of native fix to common deserializer
* commit 347e2dadc6
    | Author: Igor Chevdar <igor.chevdar@jetbrains.com>
    | Date:   Wed Mar 6 12:51:40 2019 +0300
    |
    |     [Serializer] More graceful fix of parents
2019-03-15 03:03:08 +03:00
Alexander Gorshenev
cc93239397 Commonized native and js IR serialization infrastructure 2019-03-15 03:03:08 +03:00
Mikhail Glukhikh
909a5fd32d FIR: implement named arguments #KT-24081 Fixed 2019-03-14 18:30:13 +03:00
Mikhail Glukhikh
d65b30dd82 Fix corner-cases in ConeTypeContext / FIR builder / FIR enhancements
This fixes a pack of FIR smoke diagnostic tests, now all of them pass
Related to KT-29962
2019-03-14 18:30:12 +03:00
Mikhail Glukhikh
8ea347653b Remove some FirElement.session usages in FIR resolve 2019-03-14 18:23:25 +03:00
Mikhail Glukhikh
63cb8bb1a7 Remove FirElement.session usages from RawFirBuilder & around
Related to KT-30187
2019-03-14 18:23:11 +03:00
Mikhail Glukhikh
e6bb920a1d FIR Java: support Kotlin extension overriding: at last, #KT-29937 Fixed 2019-03-14 18:18:40 +03:00
Mikhail Glukhikh
d00d078b4f FIR Java: implement "appendErasedType" thus adding predefined signatures
Related to KT-29937
2019-03-14 18:18:20 +03:00
Mikhail Glukhikh
43d06f85e3 Add raw type comparison for Java (J2K mapping is taken into account)
NB: Java enhancement scope does not perform substitution, so we could
have some duplicates inside "type enhancement" testData

Related to KT-29937
2019-03-14 18:17:58 +03:00
Mikhail Glukhikh
f5e2cd2ac4 No override check in FirClassUseSiteScope, fix nasty substitution bug
This fixes MPP override test
(see mppFakeOverride in FirMultiModuleResolveTestGenerated)
2019-03-14 18:17:44 +03:00
Mikhail Glukhikh
de14dd1b9f FIR type enhancements: more accurate * handling 2019-03-14 18:17:31 +03:00
Mikhail Glukhikh
c708171add FIR type enhancements: support annotations for default parameter values
Related to KT-29937
2019-03-14 18:17:17 +03:00
Mikhail Glukhikh
5f3a01c25a Get rid of FirElement.session usages inside fir:java 2019-03-14 18:16:58 +03:00
Mikhail Glukhikh
6c12fabf74 FIR: make JavaClassEnhancementScope use-site, get rid of scope providers
Related to KT-29937
2019-03-14 18:09:41 +03:00
Mikhail Glukhikh
e0348b56a1 FIR type enhancement: extract indexed Java type qualifiers 2019-03-14 18:08:16 +03:00
Mikhail Glukhikh
be412baf9f FIR type enhancement: fold flexible types when it's possible
Related to KT-29937
2019-03-14 18:08:01 +03:00
Mikhail Glukhikh
3d29b31177 FIR type enhancements: handle class qualifiers, add new JSR 305 tests
Related to KT-29937
2019-03-14 18:07:46 +03:00
Mikhail Glukhikh
6c8aba8039 FIR: support callable symbols in dependencies provider
This breaks mppFakeOverrides test because of bug in FIR fake overrides
2019-03-14 18:07:32 +03:00
Mikhail Glukhikh
33fb3d154b FIR Java model: support static members & enum entries
Related to KT-29218
2019-03-14 18:07:17 +03:00
Mikhail Glukhikh
0434a55ea2 FIR: add initial JSR 305 tests for Java type enhancements 2019-03-14 17:57:28 +03:00
Mikhail Glukhikh
14fb495ab6 Support Java constructors in FIR (related to KT-29218) 2019-03-14 17:57:13 +03:00
Mikhail Glukhikh
484e67727f JavaClassifierTypeImpl: convert to Kotlin & cleanup 2019-03-14 17:56:57 +03:00
Mikhail Glukhikh
21d19f4144 JavaClassifierTypeImpl.java -> kt 2019-03-14 17:56:41 +03:00
Mikhail Glukhikh
fb788dc4c0 Fix null Java type argument problem & add relevant test 2019-03-14 17:56:23 +03:00
Mikhail Glukhikh
7563a98999 FIR type enhancement: make J2K mapping and changed handling more exact
Related to KT-29937
2019-03-14 17:56:05 +03:00
Mikhail Glukhikh
9bb2278fd4 Simplify JavaClassEnhancementScope: callback -> TypeInSignature 2019-03-14 17:55:47 +03:00
Mikhail Glukhikh
226cf8e42c FIR Java types: handle wildcard types correctly
Related to KT-29937, KT-29218
2019-03-14 17:55:25 +03:00
Mikhail Glukhikh
6c79b184c0 FIR Java types: add Kotlin/Java mapping & mutability enhancements
Related to KT-29937
2019-03-14 17:55:10 +03:00
Mikhail Glukhikh
e7ac88d326 FIR: implement Java fields (in provider, type enhancement, scopes)
Related to KT-29218
2019-03-14 17:54:53 +03:00
Mikhail Glukhikh
4255c9f774 Add FIR enhancement tests, fix some exceptions / problems around them
Test data and tests themselves are based on
compiler/testData/loadJava/compiledJava
2019-03-14 17:52:33 +03:00
Mikhail Glukhikh
f31faafd72 Introduce initial version of FIR Java type enhancement
Java type enhancement is performed by a special scope kind
Java FIR dump was added for multiplatform tests to look at enhancements
Overrides, J2K mapping, special cases does not work yet

Related to KT-29937
2019-03-14 17:51:00 +03:00
Mikhail Glukhikh
060bd1b464 Add separate FirJava elements (class, method, parameter, type reference)
Related to KT-29218
2019-03-14 17:40:04 +03:00
Mikhail Glukhikh
109f1938f6 FIR: make simplification around class substitution scope 2019-03-14 17:39:49 +03:00
Mikhail Glukhikh
8ac34e1a0f Reformat: context (Java resolve) 2019-03-14 17:39:25 +03:00
Denis Zharkov
6740cdabac Get rid of ConeAbbreviatedType::directExpansion
It becomes necessary after extracting supertypes resolution into a
separate phase.
But also it looks reasonable because direct expansion actually depends
on the module we are looking from.
2019-03-14 17:06:45 +03:00
Denis Zharkov
92defc2ae3 Extract supertypes resolution into a separate FIR phase 2019-03-14 17:06:45 +03:00
Steven Schäfer
3f4c5c8d53 Resolve type aliases when looking for default arguments to actual methods.
Change-Id: I059093c1af32fcd7a2de36c25160c352d6f03a3c
2019-03-14 14:59:34 +01:00
Toshiaki Kameyama
dfd3947856 Keyword completion: add 'fun' after 'suspend' (KT-29038)
#KT-29038 Fixed
2019-03-14 15:35:45 +03:00
Toshiaki Kameyama
fd262bcd8d Smart completion: fix anonymous object code style (KT-29572)
#KT-29572 Fixed
2019-03-14 15:35:44 +03:00
Toshiaki Kameyama
6acf3ad629 Add "arg" postfix template (KT-29398)
#KT-29398 Fixed
2019-03-14 15:35:44 +03:00
Ilmir Usmanov
0c0f035241 Set default value of releaseCoroutines in TypeSignatureMapping to true 2019-03-14 15:06:07 +03:00
Dmitriy Dolovov
5af2cbeacd Fix MPP wizard tests
Issue #KT-30003 fixed
2019-03-14 18:11:25 +07:00
Nicolay Mitropolsky
69ea0175a2 KotlinElementActionsFactory.createAddAnnotationActions: adding @field annotation target for targetless annotations (KT-18459) 2019-03-14 10:59:00 +03:00
Dmitry Gridin
3bf0fb8957 Intention “Introduce import alias” shouldn't modify other files
#KT-30412 Fixed
2019-03-14 12:09:41 +07:00
Dmitry Gridin
179dfce3a8 Fix false positive for type error in intentions AddReturnTo...
Relates to #KT-25272
2019-03-14 10:52:59 +07:00
Georgy Bronnikov
d7ce24410d Remove descriptors from SharedVariablesManager 2019-03-13 23:13:41 +03:00
Ilya Gorbunov
edc766af56 Document exception thrown for negative n in take/takeLast/drop/dropLast
#KT-29151
2019-03-13 17:58:19 +03:00
Ilya Gorbunov
6bc7c06038 Add samples for is(|Not|NullOr)Empty and is(|Not|NullOr)Blank functions 2019-03-13 17:58:05 +03:00
Ilya Gorbunov
ed878be1f7 Docs: reword summaries for a couple of experimental annotations 2019-03-13 17:53:37 +03:00
Ilya Gorbunov
ffe8b4419c Docs: use consistent kotlinlang.org url in references 2019-03-13 17:53:37 +03:00
Dmitry Gridin
479e812bbc Fix false positive "Redundant lambda arrow" inspection
#KT-29590 Fixed
 #KT-19462 Fixed
 #KT-29124 Fixed
2019-03-13 20:57:30 +07:00
Sergey Igushkin
49ee197578 Ignore deprecated configurations in a test with Gradle 5.3+ (KT-30378) 2019-03-13 16:39:56 +03:00
Sergey Igushkin
0830977d16 Exclude the configurations of source sets from dependency resolution
The `*Api`, `*Implementation`, `*CompileOnly`, and `*RuntimeOnly`
configurations of a `KotlinSourceSet` must not be resolved directly, as
they lack attributes needed to choose a Kotlin MPP variant, and they
must not be candidates in variant-aware resolution of a project
dependency either.

With Gradle 5.3, these configurations failed to resolve anyway, as they
had no proper `org.gradle.usage` attribute, and the disambiguation
rules of the 'java-base' plugin conflicted with the Kotlin rules.
2019-03-13 16:39:55 +03:00
Sergey Igushkin
7c139e059a Fix publishing with Gradle 5.3 (KT-30379)
In Gradle 5.3, there was a change to the internal logic of publishing
`SoftwareComponent`s with the 'maven-publish' plugin, and,
simultaneously, a new public API was introduced for user-defined
software components, see https://github.com/gradle/gradle/pull/8399

Earlier, the 'maven-publish' plugin used the Gradle `Usage` attribute
values to arrange the dependencies of a software component's
`UsageContext`s into the Maven scopes. Now that mechanism doesn't work
and a `SoftwareComponent` must provide an explicit mapping of the
variants to POMs by using the `SoftwareComponentFactory.adhoc` API.

However, the new API lacks some features we need to properly publish an
MPP, such as adding a component to another one as a variant, so we still
create old-style software components under the hood and
then wrap them into the new API (and then wrap the adhoc components once
again).

We also continue to use the old-style components for Kotlin-specific
logic like finding a target in another project that a dependency
resolved to, as the components produced by the new API lack crucial
information that is used in the logic, like references to
`KotlinCompilation`s.

Issue #KT-30379 Fixed
2019-03-13 16:39:55 +03:00
Sergey Igushkin
eedb8b0ae1 Run tests against Gradle 5.3 RC2 2019-03-13 16:39:55 +03:00
Sergey Igushkin
17df1ce096 Support a Gradle Usage value 'java-api-jars'
The support on our side involves:

* using the new value for Maven publishing, as the 'maven-publish'
plugin now expects 'java-api-jars' for dependency scopes ordering where
it used to expect 'java-api'

* accepting the new value in KotlinUsages compatibility and
disambiguation rules
2019-03-13 16:39:55 +03:00
Nikolay Krasko
491fb40dd3 Fix INRE from find usages activated with Ctrl + Click (EA-137655)
Only Ctrl + Click is affected as find usages from Alt + F7 is a different
action (`GotoDeclarationAction` is `DumbAware`, but `ShowUsagesAction` is not).
2019-03-13 15:30:06 +03:00
Dmitriy Dolovov
40474bee3f Update Kotlin/Native project templates
Use modern "binaries" DSL
2019-03-13 18:53:47 +07:00
Dereck Bridie
a02ad76b16 KT-25272: Unused expression as last expression of normal function should have quickfix to add "return" Fixed 2019-03-13 17:53:48 +07:00
Burak Eregar
e02877d1dc Disable WhenWithOnlyElse by default. 2019-03-13 13:25:00 +03:00
Abduqodiri Qurbonzoda
a0e2ca669b Write docs for primitive types conversions 2019-03-13 13:14:37 +03:00
Nikolay Krasko
76d4a2fd17 Minor: cleanup org.jetbrains.kotlin.idea package 2019-03-13 12:55:02 +03:00
Nikolay Krasko
08b93b0ba0 Make internal mode controlled from execution arguments 2019-03-13 12:55:00 +03:00
Nikolay Krasko
8e7145d6ff Allow to pass addition system properties to runIde task 2019-03-13 12:54:58 +03:00
Toshiaki Kameyama
bee7736baf Find Java usage of @JvmField declared in primary constructor (KT-18322)
#KT-18322 Fixed
2019-03-13 12:54:55 +03:00
Mads Ager
8b566fda76 JVM_IR: Perform asm type conversion for string concat arguments.
This ensures that the Unit instance is loaded when string
concatenation contains a sub part that is a call of a Unit
return-type method.
2019-03-13 10:01:21 +01:00
Ting-Yuan Huang
013ad4b8e4 JVM_IR: defer some branch optimizations to codegen.
Specifically, defer the removal of hand-written "if (true|false)" from
JvmBuiltinOptimizationLowering into codegen so that appropriate debug
info (and a NOP) can be inserted.

Change-Id: Ia11af05ad8b4251946bd3e685fb7c3319f0f433f
2019-03-13 08:48:20 +01:00
Ting-Yuan Huang
6bbb0269b1 IR: Set when.origin for IrIfElseImpl
Change-Id: I38510b59e3dc936baadbfe3ef2702990493815e5
2019-03-13 08:48:20 +01:00
Ilya Chernikov
18198987a3 Restore jvmTarget 1.6 for scripting libraries that could be used externally
#KT-29319 fixed
2019-03-13 08:47:17 +01:00
Mikhael Bogdanov
1e3277d0e6 Set proper origin for cascaded if expression 2019-03-13 08:27:07 +01:00
Max Medvedev
1040665471 add missing && 2019-03-13 09:09:19 +03:00
Dmitry Gridin
8f9c536a82 Change priority of the quick fixes
#KT-30233 Fixed
2019-03-13 11:07:05 +07:00
Dmitry Gridin
3d66147685 Minor: fix warnings & refactoring 2019-03-13 11:07:05 +07:00
Abduqodiri Qurbonzoda
ba61695a45 Check for index-out-of-bound in elementAt function (KT-30051) 2019-03-12 21:39:09 +03:00
Alexander Udalov
584137121b Do not write version requirements in metadata for lambdas
#KT-29790 Fixed
2019-03-12 18:53:08 +01:00
Alexander Udalov
e942bff4a2 Reformat module 'serialization', fix inspections 2019-03-12 18:53:08 +01:00
Alexander Udalov
a269e9bc00 JVM IR: fix typo in condition in KCallableNamePropertyLowering
This however makes testLocalFunctionName fail because currently
isSubclassOf (incorrectly) returns false and therefore an anonymous
class is generated and the name is taken from there. The name there is
"box$OK" which is incorrect. The isSubclassOf issue is KT-28198 and will
be fixed separately; the incorrect name issue will be investigated later
2019-03-12 18:49:41 +01:00
Mikhael Bogdanov
dd59deb977 Mute failed test 2019-03-12 13:33:35 +01:00
Mikhail Zarechenskiy
f95fdb3cf1 Advance bootstrap to include fix in NI about Nothing-expressions
See 1594c1fc for details. Also, remove fix from f07fed9a.
2019-03-12 15:27:12 +03:00
Alexey Tsvetkov
efe93176ab Fix inter-project IC for kaptGenerateStubs task with AGP
In Android projects we need to detect modules by inspecting jar files
in order to find build history files.
However `useModuleDetection` property was not set up correctly for
KaptGenerateStubsTask.

    #KT-29761 Fixed
2019-03-12 15:10:49 +03:00
Nikolay Krasko
1bfd6705cc Minor: fix junit.framework.Assert deprecation warnings 2019-03-12 14:28:31 +03:00
Nikolay Krasko
213b98fefe Review changes: revert compiler behaviour, add test, remove inner classes 2019-03-12 14:28:31 +03:00
Harry Billinis
6ba134b1be Better names suggestion for constant like reference expressions (KT-28485)
Code was simplified after @igorwojda suggestions

 #KT-28485 Fixed
2019-03-12 14:28:31 +03:00
Nikolay Krasko
7886095327 Prevent constant reporting from released plugin versions in EA (KT-30388)
Apply a compromise strategy between "no report" and "always report".
Report only for several days after release and don't bother users afterwards.

 #KT-30388 Fixed

All exceptions still can be found in Idea Log.
2019-03-12 12:13:24 +03:00
Nikolay Krasko
7f07782095 Allow to throw plugin exception when plugin version is patched 2019-03-12 12:05:21 +03:00
Nikolay Krasko
ddc9d0eba1 Allow to override plugin version with system property
Need this during testing and development.
2019-03-12 12:05:21 +03:00
Steven Schäfer
9ea39d2b7c Fix return types for while loops. 2019-03-12 09:33:00 +01:00
Steven Schäfer
4c8425caeb Run ExpectDeclarationsRemoving in the JVM_IR backend. 2019-03-12 09:29:00 +01:00
Abduqodiri Qurbonzoda
82002e5e73 Remove implementations of conversions from UByte/UShort to Float/Double 2019-03-12 02:56:44 +03:00
Alexander Udalov
d12e5ddafc Generate bytecode for array intrinsics manually
#KT-28285 Fixed
2019-03-11 18:36:10 +01:00
Alexander Udalov
dd0b087b92 Add StackValue.put(InstructionAdapter) for convenience 2019-03-11 18:36:09 +01:00
Alexander Udalov
f9be21c935 Report warning on @Synchronized on inline methods
Until KT-27310 is supported, we warn users that this has no effect.

 #KT-29884 Fixed
2019-03-11 18:32:44 +01:00
Alexander Udalov
76aff56b04 Remove unneded parameter of ResolverForProjectImpl 2019-03-11 18:31:59 +01:00
Alexander Udalov
0ccf7345e3 Move JsAnalyzerFacade from ide-common to js.frontend
To be used in diagnostic tests now, and as a replacement for
TopDownAnalyzerFacadeForJS in the future
2019-03-11 18:31:59 +01:00
Dmitry Gridin
6b8547f57b Fix "Specify type explicitly" intention with generic type
#KT-27641 Fixed
 #KT-30252 Fixed
2019-03-11 23:38:19 +07:00
Dmitry Gridin
57040f6f9d Minor: refactoring & fix warnings 2019-03-11 23:38:19 +07:00
Toshiaki Kameyama
f1e66d0654 Add "Replace 'associate' with 'associateBy' or 'associateWith'" inspection
#KT-26269 Fixed
2019-03-11 19:33:17 +03:00
Ilya Gorbunov
42120b93b8 KT-29151 Provide specialized string samples for all drop/take functions
These include:
- take, takeLast, takeWhile, takeLastWhile,
- drop, dropLast, dropWhile, dropLastWhile
2019-03-11 19:30:59 +03:00
Burak Eregar
991e739693 KT-29151 Fix the problematic pages - CharSequence.take() & String.take() 2019-03-11 19:30:58 +03:00
Toshiaki Kameyama
0f45e3d238 Fix false positive for HasPlatformType with member extension on 'dynamic'
#KT-29812 Fixed
2019-03-11 19:28:08 +03:00
Mikhail Zarechenskiy
1594c1fc6b [NI] Don't consider Nothing-constraint as proper to complete call
Follow-up of 9b3e17f0. There we decided to complete call if a type
 variable from a return type has proper lower constraints, now we refine
 this rule wrt `Nothing`-like constraints to avoid inferring type variables
 to Nothing, which is quite useless

 #KT-30370 Fixed
2019-03-11 19:14:29 +03:00
Dmitriy Dolovov
77ab15ec65 Add a hint to the message about not found Kotlin Gradle plugin version
Issue #KT-19788
2019-03-11 18:15:05 +07:00
Dmitry Gridin
6ba0a182bb Fix false positive "Insert explicit type arguments" intention
#KT-16139 Fixed
2019-03-09 14:01:04 +07:00
Dmitry Gridin
212e573c26 Minor: refactoring InsertExplicitTypeArgumentIntention 2019-03-09 14:01:04 +07:00
Ilya Gorbunov
6ae5e91930 Move UArraysKt into kotlin.collections.unsigned package
Provide UArraysKt class in kotlin.collections for binary compatibility
instead of removed multipart facade class. It contains only non-inline
functions of the latter.
2019-03-08 23:35:40 +03:00
Ilya Gorbunov
db4c4132f6 Make JvmPackageName a common internal annotation 2019-03-08 23:35:37 +03:00
Ilya Gorbunov
f07fed9afa Temporary fix to avoid runtime exception due to incorrect inferred type
Caused by: java.lang.ClassCastException:
kotlin.collections.EmptySet cannot be cast to java.lang.Void
  at org.jetbrains.kotlin.codegen.coroutines.CoroutineTransformerMethodVisitorKt.findSafelyReachableReturns(CoroutineTransformerMethodVisitor.kt:984)

Co-authored-by: Alexander Udalov <alexander.udalov@jetbrains.com>
2019-03-08 23:35:32 +03:00
Ilya Gorbunov
1f83a48839 Advance bootstrap to 1.3.40-dev-310 2019-03-08 23:34:36 +03:00
Abduqodiri Qurbonzoda
be6c2d8c7d Implement min max minOf maxOf functions for unsigned types (KT-30035) 2019-03-08 23:34:36 +03:00
Abduqodiri Qurbonzoda
bf83f0e070 Implement contains extension functions for URanges (KT-26378) 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda
cb587893c0 Implement sorting extension functions for UArrays 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda
c42dbb34ca Implement drop, take & filter extension functions for UArrays 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda
abb275775e Implement map, flatMap, zip & groupBy extension functions for UArrays 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda
503264b996 Implement folding extension functions for UArrays 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda
7695b5e575 Implement sum extension function for UArrays (KT-28779) 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda
690e35f11a Implement reduce, forEach, min & max extension functions for UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda
fc85781bfc Implement asList, slice & sliceArray extension functions for UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda
114736c09b Implement reversing extension functions for UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda
92cd84682c Implement first, last & single extension functions for UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda
299fac8e2d Implement conversion from typed array and collection to UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda
bbaabb90e4 Implement any, all, none, count & sumBy functions for UArrays 2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda
512d986006 Implement index-requesting extension functions for UArrays
Contains implementations of `indexOf`, `lastIndexOf`, `indexOfFirst`,
`indexOfLast`, `lastIndex` and `indices` extension functions.
2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda
876dff6d22 Implement fill extension function for UArrays (KT-28339) 2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda
6b92190726 Implement component(N) functions for destructuring UArrays 2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda
550c74bb6b Implement binarySearch method for UArrays (KT-27262) 2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda
6cd9858147 Specialize plus operator for UArrays (KT-28397) 2019-03-08 23:34:32 +03:00
Nikolay Krasko
8977d0e26d Setup Missing API inspection 2019-03-08 19:13:07 +03:00
Alexander Udalov
d8b364ea40 Mark KAnnotatedElement.hasAnnotation as experimental
#KT-29041 Fixed
2019-03-08 14:57:01 +01:00
Kerooker
a342f844b8 Implements KAnnotatedElement.hasAnnotation()
This commit fixes KT-29041, by adding a convenience method to verify if a certain `KAnnotatedElement` has an annotation or not
2019-03-08 14:53:51 +01:00
Ilya Matveev
3a33f68fc9 Fix compilation after refactoring MPP extension access 2019-03-07 20:04:59 +03:00
Kirill Shmakov
fe9236f91e Add key 'module' into interop definitions file 2019-03-07 19:42:32 +03:00
Ilya Matveev
607288b089 Update Kotlin/Native: 1.2-eap-8365 2019-03-07 18:36:56 +03:00
Ilya Matveev
45c2489a53 CocoaPods: Replace '-' with '_' in podspec name 2019-03-07 18:08:50 +03:00
Ilya Matveev
230f11df42 CocoaPods: Refactor framework name mangling 2019-03-07 18:08:50 +03:00
Ilya Matveev
226da18e3a CocoaPods: Rename user-visible: Cocoapods -> CocoaPods 2019-03-07 18:08:50 +03:00
Ilya Matveev
7ac7ea58f8 CocoaPods: Rename podspec task: generatePodspec -> podspec 2019-03-07 18:08:50 +03:00
Ilya Matveev
2f45206268 CocoaPods: Replace dynamic dummy framework with a static one 2019-03-07 18:08:50 +03:00
Ilya Matveev
1f2f0244a1 Refactor kotlin multiplatform extension access 2019-03-07 18:08:50 +03:00
Ilya Matveev
52c9c74f52 CocoaPods: Use regex to split quoted compiler args 2019-03-07 18:08:50 +03:00
Ilya Matveev
3b80ffe1d6 CocoaPods: Add 'native' in the plugin ID
kotlin-cocoapods -> kotlin-native-cocoapods
org.jetbrains.kotlin.cocoapods ->
org.jetbrains.kotlin.native.cocoapods
2019-03-07 18:08:50 +03:00
Ilya Matveev
3cd20fab75 Support -Xstatic-framework in DSL
In Kotlin/Native 1.3.30 EAP1 an ability to build
a static ObjC framework has been added. This patch
adds support for this feature in the kotlin-multiplatform
plugin.
2019-03-07 18:08:50 +03:00
Ilya Matveev
60026c8aa1 Update Kotlin/Native: 1.3.30-eap-8089 2019-03-07 18:08:50 +03:00
Ilya Matveev
21a69b0e5b CocoaPods: Basic support
This patch adds a separate Gradle plugin allowing
a user to import Kotlin/Native modules in Cocoapods
projects and use Cocoapods dependencies in Kotlin
code via cinterop.

The plugin when applied does the following things:

1. Add a framework binary for each supported (iOS
   or macOS) platform in the project.

2. Add a Cocoapods extension allowing one to configure
   Cocoapods dependencies of the project.

3. Create cinterop tasks for each dependency from the
   previous point. The tasks are added for main
   compilations of each supported platform.

4. Add a task to generate a podspec-file which includes
   the framework from the point 1, script to
   build it and dependencies from the point 2.

So the Cocoapods import procedure is the following:

1. A user runs `./gradlew generatePodspec`. The plugin
   creates a podspec-file with all dependencies.

2. The user adds a dependency on this podspec in his Podfile
   and runs `pod install`. Cocoapods downloads dependencies
   and configures user's XCode project.

3. The user runs XCode build. XCode builds dependencies and then
   runs Gradle build. Gradle performs interop processing and
   builds the Kotlin framework. Compiler options and header
   search paths are passed in the Gradle from XCode environment
   variables. After that the final application is built by XCode.

Issue #KT-30269 Fixed
2019-03-07 18:08:50 +03:00
Ilya Matveev
2999cdd3e0 Avoid resolution ambiguity for cinterop DSL
Earlier we used to have two methods: cinterops(Container.() -> Unit) and
cinterops(Action<Container>). It's OK for Groovy DSL but causes resolution
ambiguity in Kotlin DSL. This patch removes the first overload to avoid
this situation. The second overload still can be called in Kotlin DSL
as `cinterops { ... }`.
2019-03-07 18:05:54 +03:00
Ilya Matveev
8a012c83e5 Deprecate old DSL method for binary configuration
In 1.3.20 a new binaries DSL was introduced. This
patch deprecates old DSL methods used for binary
configuration in 1.3.0 and 1.3.1x.

Issue #KT-29998 Fixed
2019-03-07 18:05:54 +03:00
Ilya Matveev
b971a91a8c Add main interop libraries in test interop dependencies
Earlier we added interop libraries built for a main compilation
in dependencies of a corresponding test compilation. But we didn't
add them in dependencies of interop libraries built for the test
compilation. It caused cinterop failures when the test compilation
has interop libraries. This patch fixes it by adding main interop
libraries in dependencies of test ones.

Also earlier interop libraries of test compilations were
unintentionally added in apiElements and publication. This patch
fixes this issue too.

Issue #KT-30290 Fixed
2019-03-07 18:05:54 +03:00
Dmitriy Novozhilov
b681e4bda3 NI. Fix call commonSuperType for 0 types (bug introduced in cbf1d773) 2019-03-07 17:50:30 +03:00
Roman Elizarov
4f532a7c05 Invoke probeCoroutineResumed on each unroll of the frame from heap
Fixes KT-29997
2019-03-07 17:04:11 +03:00
Dmitriy Novozhilov
9b50d31169 NI. Fix StackOverFlow in type approximation. #KT-30021 Fixed 2019-03-07 16:24:53 +03:00
Dmitriy Novozhilov
cbf1d773f7 NI. Coerce return type of lambda function descriptor to Unit. #KT-30242 Fixed 2019-03-07 14:36:09 +03:00
Dmitriy Novozhilov
77c98bef4d Fix recursion in contract declaration analysis. KT-26386 Fixed
Issue fixed only in old inference
2019-03-07 14:35:18 +03:00
Dmitriy Novozhilov
d0462859bf Minor. Fix reporting diagnostic in contract with callable reference 2019-03-07 14:35:13 +03:00
Alexander Udalov
518b03125c Support JVM target versions up to 12
#KT-26240 Fixed
2019-03-07 11:42:31 +01:00
Alexander Udalov
9f75fd0d62 Minor, remove confusing logic from GenericReplChecker 2019-03-07 11:42:31 +01:00
Alexander Udalov
c7c377e1b1 Use JvmTarget.DEFAULT instead of JVM_1_6 where applicable 2019-03-07 11:42:31 +01:00
Pavel Nikitin
a6b7aa3257 KT-30322 Memory leak in CompilationSourceSetUtil (#2158)
Issue #KT-30322 Fixed
2019-03-07 12:57:48 +03:00
Anton Yalyshev
b3cbd7d5bd update names for Kotlin Gradle DSL wizards as well 2019-03-07 10:44:58 +03:00
Dmitriy Dolovov
dbc66bd0ae Native: Support 2- and 3-digit Kotlin/Native versions 2019-03-07 12:59:27 +07:00
Nikolay Krasko
ec0084ef61 Minor: remove outdated ant mentioning 2019-03-06 18:16:30 +03:00
Nikolay Krasko
878e56f2ab Minor: clean deprecated warnings in KotlinTestFinder.kt 2019-03-06 18:16:29 +03:00
Nikolay Krasko
606a7766af Make colours for lambda return hints similar to other hints (KT-30203)
Works for IntlliJ and Darcula themes but doesn't work with High Contrast
2019-03-06 18:16:29 +03:00
Nikolay Krasko
0e990ae01b Update inserting algorithm to preserve order for tags with the same offset 2019-03-06 18:16:29 +03:00
Nikolay Krasko
06dbe1ec09 Avoid adding DYNAMIC_PROPERTY_CALL highlighting twice
Tested in idea/testData/highlighter/Dynamic.kt
2019-03-06 18:16:29 +03:00
Nikolay Krasko
1cc59f4b18 Mute false positive duplicate warnings in highlighting in 191 2019-03-06 18:16:28 +03:00
Mikhael Bogdanov
6a893ba196 Regenerate test data 2019-03-06 16:12:43 +01:00
Steven Schäfer
eec25dbea2 Avoid true condition generation for do while loop, since it confuses the Java verifier.
Change-Id: I96eca6623a91a8365090768f42c6e865b612e1cc
2019-03-06 16:04:23 +01:00
Alexander Udalov
59fda8d7ce Support JvmPackageName with JvmMultifileClass
This is an internal feature of our standard library needed to compile
new API for unsigned types
2019-03-06 15:34:23 +01:00
Alexander Udalov
ea21cda4df Reformat MultifileClassCodegen, fix inspections 2019-03-06 15:33:45 +01:00
Alexander Udalov
670b06ae97 Minor, ignore tests on typeOf without reflection on Android
Currently all Android tests are run with kotlin-reflect in the
classpath, so these tests can't succeed
2019-03-06 15:25:21 +01:00
Sergey Igushkin
7d9405a9cb Warning for Kotlin plugins loaded multiple times (KT-30276)
Print a warning with an instruction on how to fix this. Don't warn about
different versions and duplicate plugins in composite build.

Issue #KT-30276 Fixed
2019-03-06 16:05:02 +03:00
Sergey Igushkin
42a7c87e2e Setup conf2ScopeMappings for 'api' configuration with 'maven' plugin
The 'java' plugin doesn't expect the 'api' configuration to exist (it
is only introduced by the 'java-library' plugin) and doesn't map it
to the compile scope when publishing with the legacy 'maven' plugin.

This commit adds the missing conf2ScopeMapping for 'api' -> 'compile'
2019-03-06 16:04:08 +03:00
Sergey Igushkin
803af3e040 Fix ConcurrentModificationException iterating over tasks (KT-29971)
Issue #KT-29971 Fixed
2019-03-06 16:04:08 +03:00
Sergey Igushkin
4aaa1a8067 Rewrite MPP dependencies in POMs of single-platform projects (KT-27059)
This is needed to ensure that POMs of single-platform Kotlin projects
depending on MPP libraries contain dependencies (Maven coordinates)
of the platform-specific modules of the libraries.

The mechanism and rationale are the same as in KT-28482

Issue #KT-27059 Fixed
2019-03-06 16:04:07 +03:00
Sergey Igushkin
51279a8195 Add a switch that disables dependencies rewriting in POMs
This covers the cases when a user knows what they do and doesn't want
anything to do any changes to the POMs, e.g. they want to manually
replace all of the dependencies, so they need the original dependencies.
2019-03-06 16:04:07 +03:00
Sergey Igushkin
2f8baf6715 Refactor: move all tools for MPP dependencies rewriting to a utils file 2019-03-06 16:04:07 +03:00
Natalia Selezneva
f98429c509 Preprocess script dependencies before running UnusedSymbolInspection
^KT-29474
2019-03-06 15:42:50 +03:00
Natalia Selezneva
47a4500eaa Show notification that script dependencies are not ready yet 2019-03-06 15:42:49 +03:00
Natalia Selezneva
1d56f44093 Show progress for loading script dependencies even show notification is true when there are more than 3 scripts in queue
We are trying to update script dependencies silently when 'Reload script dependencies on file change' is off,
but in case when the queue for update is too long we need to make process visible to user and make it cancelable.
2019-03-06 15:42:49 +03:00
Natalia Selezneva
8331d9789e Fire one 'roots changed' event after all scripts dependencies loaded
^KT-29474
2019-03-06 15:42:49 +03:00
Natalia Selezneva
6bc6dea916 Check project.isDisposed before attaching script reports 2019-03-06 15:42:48 +03:00
Natalia Selezneva
c2dd365158 Do not search for text occurrences if this option is switched off 2019-03-06 15:40:59 +03:00
Natalia Selezneva
4a0574dc5f Scratch can be modified during execution (KT-30200)
^KT-30200 Fixed
2019-03-06 15:40:46 +03:00
Natalia Selezneva
0dbbd8e08c Introduce ScratchPanelListener to set module in the created panel (KT-30049)
^KT-30049 Fixed
2019-03-06 15:40:30 +03:00
Ting-Yuan Huang
c1d721a15f when: emit lookupswitch/tableswitch if possible
A lookupswitch or tableswitch can be used if all conditions are equality
checks to constants. To be more specific, it can be done if:
  1. All conditions are CALL 'EQEQ(Any?, Any?)': Boolean
  2. All types of variables involved in comparison are in the same group
     of Char/Byte/Short/Int, String or enum.
  3. All arg0 refer to the same value.
  4. All arg1 are IrConst<*>.

Change-Id: Ifd7cb618395f6c5cc64601018b446f0bb7f5891c
2019-03-06 13:33:55 +01:00
Sergey Rostov
f5d0a38629 JPS Build: update artifacts 2019-03-06 14:42:49 +03:00
Simon Ogorodnik
3950dec4db Implement TypeSystemContext for FIR #KT-29968 Fixed
Use this context in FirClassUseSiteScope for type comparison
2019-03-06 13:36:00 +03:00
Simon Ogorodnik
85cd4f3cdf Extract common code (TypeSystemContext) 2019-03-06 13:33:29 +03:00
Igor Chevdar
2c7b05a67b Wrapped descriptors: supported complex annotations 2019-03-06 13:25:06 +03:00
Toshiaki Kameyama
6b35c06d50 Add intention to replace '!isNotEmpty()' to 'isEmpty()'
#KT-30123 Fixed
2019-03-06 11:06:40 +03:00
Mikhail Zarechenskiy
88ee0bf6af Swap arguments for diagnostic message about incompatible enums
This commit is restoring previous behavior changed in c4b69b65 and
 fixing `DiagnosticMessageTestGenerated.testIncompatibleEnums` test
2019-03-06 10:44:45 +03:00
Yan Zhulanow
3315c1c35b Debugger: Call invokeMethod() safely, through the execution context (KT-30268, EA-131589) 2019-03-06 03:30:56 +03:00
Yan Zhulanow
9d176917e6 Fix EA-138393: Calculate async stack traces only on breakpoints 2019-03-06 03:30:55 +03:00
Yan Zhulanow
eb1543c71a Minor: Fix a few compilation warnings in compiler and compiler tests, fix formatting 2019-03-06 03:30:55 +03:00
Yan Zhulanow
5564760ebf Pill: Recognize non-default test source roots 2019-03-06 03:30:55 +03:00
Yan Zhulanow
bab1c63126 Fix EA-135863: Access allLineLocations() safely 2019-03-06 03:30:54 +03:00
Yan Zhulanow
b54f9a0c05 Fix EA-105847, use 'location()' safely 2019-03-06 03:30:54 +03:00
Roman Artemev
e3e3fcded1 Fix windows j2v8 artifact 2019-03-05 22:56:48 +03:00
Alexander Udalov
2bec72d46a Additional cleanup of KotlinTypeMapper after J2K 2019-03-05 20:34:32 +01:00
Mikhael Bogdanov
20da778046 Add default values to KotlinTypeMapper constructor, remove them from call sites
~
2019-03-05 20:34:25 +01:00
Mikhael Bogdanov
cc0c3b1592 Specify default value for irBackend 2019-03-05 20:33:35 +01:00
Mikhael Bogdanov
a3c3282362 Minor. Clean up code after convertion 2019-03-05 20:33:34 +01:00
Mikhael Bogdanov
315df81397 Convert KotlinTypeMapper to Kotlin 2019-03-05 20:33:33 +01:00
Mikhael Bogdanov
61a95b440f Rename .java to .kt 2019-03-05 20:33:32 +01:00
Mikhael Bogdanov
b43622b87f Minor. Code clean 2019-03-05 20:33:31 +01:00
Alexander Udalov
d1e33534db Implement typeOf intrinsic on JVM
#KT-29915 Fixed
2019-03-05 18:16:31 +01:00
Alexander Udalov
5d297c40fd Minor, move ReifiedTypeParameterSubstitutionChecker to PlatformConfiguratorBase 2019-03-05 17:58:10 +01:00
Alexander Udalov
c61fe16202 Minor, fix inspections, remove unused in codegenUtil.kt 2019-03-05 17:58:10 +01:00
Alexander Udalov
e3779b1883 Minor, relax parameter type of AsmUtil.putJavaLangClassInstance 2019-03-05 17:58:10 +01:00
Alexander Udalov
afe3bed7e1 Minor, remove unused functions from inlineCodegenUtils.kt 2019-03-05 17:58:09 +01:00
Alexander Udalov
214ef0c3c2 Move generation of inline intrinsics to inlineIntrinsics.kt 2019-03-05 17:58:09 +01:00
Alexander Udalov
69eae035f6 JVM IR: do not add kotlin-reflect in tests unconditionally 2019-03-05 17:58:09 +01:00
Alexander Udalov
4d817aa6cf Minor, simplify/optimize FunctionTypeConstructor.computeSupertypes 2019-03-05 16:28:53 +01:00
Alexander Udalov
b73a927133 Remove KotlinTestUtils.replaceHash
Both package parts and SAM wrappers have no hashes in their names for a
long time already
2019-03-05 16:28:53 +01:00
Alexander Udalov
74b14f14bd Minor, refactor parseLanguageVersionSettings
Get rid of code duplication, use a more type-safe approach to
enumerating analysis flags
2019-03-05 16:28:53 +01:00
Alexander Udalov
4136fd1dbb Minor, remove unused parameter of LazyImportResolver.collectFromImports 2019-03-05 16:28:53 +01:00
Alexander Udalov
c069371591 Inline LazyImportScope.selectSingleFromImports 2019-03-05 16:28:52 +01:00
Alexander Udalov
b6e745fe52 Minor, rename InlineExposed -> PublishedApi in readme 2019-03-05 16:28:52 +01:00
Alexander Udalov
9d94a54f03 Simplify ExternalDependenciesGenerator
Remove unused parameters, inline inner class
2019-03-05 16:28:34 +01:00
Alexander Udalov
4b712bd14b Remove dependency of backend-common on descriptors.jvm 2019-03-05 16:28:34 +01:00
Alexander Udalov
d7fd4987ae Remove dependency of ir.tree on frontend.java 2019-03-05 16:28:34 +01:00
Alexander Udalov
45e8d2e1df Do not use JVM-specific code for SAM conversions in psi2ir
Extract all JVM-specific code into GeneratorExtensions.SamConversion.
This is needed in order to remove dependency of ir.tree on frontend.java
2019-03-05 16:28:33 +01:00
Alexander Udalov
aaa2bad719 Do not use IR_EXTERNAL_JAVA_DECLARATION_STUB in DeclarationStubGenerator
This code is common across backends and it should not depend on
JVM-specific behavior. Introduce GeneratorExtensions to reverse the
dependency here
2019-03-05 16:28:33 +01:00
Alexander Udalov
f29012a78f Remove unreachable code in psi2ir tests, delete unused tests 2019-03-05 16:28:33 +01:00
Mikhail Glukhikh
8e29ee53a4 Deprecate session in FirElement (related to KT-30275) 2019-03-05 18:23:17 +03:00
Denis Zharkov
2dbe96c853 Extract ConeClassifierLookupTag (aka SearchSymbol)
So, for classifiers there are both Symbols and LookupTags
The difference between them is that the former are assumed to have
a reference to the actual FirDeclaration while LookupTags
effectively contain only classId and
something informative may only be obtained by FirSession

#KT-24075 Fixed
2019-03-05 18:23:17 +03:00
Toshiaki Kameyama
6b5ba272a0 Import members from: suggest on type reference
#KT-29927 Fixed
2019-03-05 18:19:33 +03:00
Abduqodiri Qurbonzoda
3af6b36401 Write docs for unsigned types conversions 2019-03-05 17:34:15 +03:00
Nicolay Mitropolsky
f664499708 Uast: getMaybeLightElement cleanup 2019-03-05 14:30:08 +03:00
Nicolay Mitropolsky
ec1badf60d Uast: testing resolve for method called on variables of parametrized types 2019-03-05 14:30:08 +03:00
Nicolay Mitropolsky
5268cd4663 Uast: type-parameter references resolves to type-parameters 2019-03-05 14:30:07 +03:00
Nicolay Mitropolsky
ec26ea4e36 Uast: TypeReferences log test added 2019-03-05 14:30:07 +03:00
Nicolay Mitropolsky
adb13b2f9e Uast: ResolveEverythingTest tests for generics added 2019-03-05 14:30:07 +03:00
Nicolay Mitropolsky
337f16194a Uast: resolving references to local function declarations 2019-03-05 14:30:07 +03:00
Nicolay Mitropolsky
72860fb695 Uast: making KotlinUSimpleReferenceExpression able to resolve to types 2019-03-05 14:30:07 +03:00
Nicolay Mitropolsky
e1e1e53e4a Uast: setup for KotlinUastResolveEverythingTest 2019-03-05 14:30:07 +03:00
Mikhail Zarechenskiy
c4b69b65bc Gradually prohibit comparison of incompatible enums
#KT-22043 Fixed
2019-03-05 13:33:23 +03:00
Mikhail Zarechenskiy
82c8289666 Refactoring: move getRepresentativeUpperBound method to core
Plus prettify it a bit
2019-03-05 13:33:23 +03:00
Mikhail Zarechenskiy
7c357c0ec0 [NI] Complete calls during one inference session only once
The problem is that delegated properties resolve two calls together:
 `getValue`/`setValue` with a common receiver, which can contain
 callable references. For each completion new anonymous descriptor
 was created and caused "rewrite at slice" exceptions later.
 Now there is a little hack to check that during one inference session
 we don't complete one call more than one time.

 More correct fix would be to explicitly specify common receiver for
 inference session but it requires quite big refactoring, which will
 be done later with a whole refactoring of the common solver

 #KT-30250 Fixed
2019-03-05 13:33:22 +03:00
Stanislav Erokhin
14c93c7c0e Remove obsolete ant build file: build-docs.xml 2019-03-05 12:54:02 +03:00
Anton Yalyshev
52f297c644 renewed pictures of our wizards in TipOfTheDay #KT-28941 Fixed 2019-03-05 11:40:19 +03:00
Anton Yalyshev
8a3659008e unified naming of Kotlin projects #KT-17829 Fixed 2019-03-05 11:40:19 +03:00
Anton Yalyshev
415793be1c better look for wizards names and descriptions: removed word dups and specified build system #KT-27183 Fixed 2019-03-05 11:40:19 +03:00
Simon Ogorodnik
dc56fd873a Add missing type-system dependency to ultimate 2019-03-05 01:52:03 +03:00
Roman Artemev
88d365328a [JS IR BE] Run JS IR tests in V8 engine 2019-03-04 23:24:18 +03:00
Roman Artemev
2ccd093099 Update test data 2019-03-04 23:24:18 +03:00
Roman Artemev
80a2be50c3 Regenerate tests 2019-03-04 23:24:18 +03:00
romanart
8e02964112 Make test be language version agnostic 2019-03-04 23:24:17 +03:00
romanart
2d6b291998 Rename test 2019-03-04 23:24:17 +03:00
romanart
5d6f42e4e6 Fix rebase 2019-03-04 23:24:17 +03:00
Roman Artemev
3770d310f1 Deserialization code clean up 2019-03-04 23:24:17 +03:00
Roman Artemev
d085e66aa3 [JS IR BE] Optimize test performance
* temporary disable verification
 * restore default/full runtime source set scheme
2019-03-04 23:24:16 +03:00
Roman Artemev
5033d99380 [JS IR BE] Update test data 2019-03-04 23:24:16 +03:00
Roman Artemev
a19bdd0c18 [JS IR BE] Refactored klibs proto files 2019-03-04 23:24:16 +03:00
Roman Artemev
52baf90518 Drop DebugJsAstProtoBuf 2019-03-04 23:24:15 +03:00
Roman Artemev
cae800b24e [JS IR BE] Fix deserialization performance 2019-03-04 23:24:15 +03:00
Roman Artemev
079f2534c7 [JS IR BE] Support compilation and tests against klib 2019-03-04 23:24:15 +03:00
Roman Artemev
b99377fd69 [JS IR BE] Fix backend to be able compile test against klib 2019-03-04 23:24:15 +03:00
Roman Artemev
0ec75f1534 [JS IR BE] Temporary fix K/JS stdlib 2019-03-04 23:24:14 +03:00
Roman Artemev
b0b6b359b1 [JS IR BE] Do not produce KotlinType creating IrType 2019-03-04 23:24:14 +03:00
Roman Artemev
6863f9e4f3 [JS IR BE] Make backend be able work with unbound symbols
* Fix array type deserialization
 * Prepare to compilation against klibs
2019-03-04 23:24:14 +03:00
Roman Artemev
2334ea2742 [JS IR BE] Support IrDynamicExpression in proto and deserializer 2019-03-04 23:24:13 +03:00
Roman Artemev
44010cc6ef [JS IR BE] Refactored compiler interface 2019-03-04 23:24:13 +03:00
Roman Artemev
67f0d49ea1 [JS IR BE] Fix rebase 2019-03-04 23:24:13 +03:00
Roman Artemev
4ede02f5b2 [JS IR BE] Update test data 2019-03-04 23:24:12 +03:00
Roman Artemev
b2cfef4902 [JS IR BE] Lazy initialize lowering properties 2019-03-04 23:24:12 +03:00
Roman Artemev
c95d99dbe0 [JS IR BE] Use symbol instead of declaration 2019-03-04 23:24:12 +03:00
Roman Artemev
862ccd05df [JS IR BE] Merge native fixes into Ir Serializer 2019-03-04 23:24:12 +03:00
Roman Artemev
813fef6f26 [JS IR BE] Get rid of usages of KotlinType 2019-03-04 23:24:11 +03:00
Roman Artemev
d034ce106e [JS IR BE] Implement isPrimitiveArray with pure Ir 2019-03-04 23:24:11 +03:00
Roman Artemev
3a444cd0f3 [JS IR BE] Move IrSerializer from native to JS
* Fix issues
2019-03-04 23:24:10 +03:00
Roman Artemev
5384f23f30 [JS IR BE] Extract metadata deserializer to keep binary compatibility
* add UniqId extension to metadata protobuf
2019-03-04 23:24:10 +03:00
Roman Artemev
3718edb6bc [JS IR BE] Some preparation for IrSerialization 2019-03-04 23:24:09 +03:00
Ilya Gorbunov
d4b97d33ef Introduce kotlin.ExperimentalStdlibApi annotation for prerelease API
#KT-30174
2019-03-04 20:47:49 +03:00
Kirill Shmakov
05be09c839 Explicitly order projects for cidr plugin build
With additional module included, evaluation of :prepare:idea-plugin
is requested prior to :prepare evaluation. See KOTLIN-CR-2775.
2019-03-04 20:21:52 +03:00
Mikhail Glukhikh
14a6f684dc Reformat "make constructor parameter a property" quick-fix 2019-03-04 17:57:52 +03:00
Mikhail Glukhikh
9e2ee6183c Fix "make constructor parameter a property" for vararg case
Same should work for annotated parameters
#KT-29312 Fixed
2019-03-04 17:57:52 +03:00
Mikhail Glukhikh
c714e599ea Don't report "Unsafe call with ? extension receiver" with smart-cast
#KT-29499 Fixed
2019-03-04 17:57:52 +03:00
Mikhail Glukhikh
4d19120d84 Don't report "main parameter not necessary" in objects #KT-29414 Fixed 2019-03-04 17:57:52 +03:00
Mikhail Glukhikh
022c625d2d MPP web builder: upgrade Ktor version to 1.1.3 #KT-29918 Fixed 2019-03-04 17:57:52 +03:00
Simon Ogorodnik
4882627712 Make type-system KotlinType-independent
- Port NewKotlinTypeChecker.equalTypes
- Decouple new-type transform from isSubtypeOf
- Port isSubtypeForSameConstructor
- Port checkSubtypeForSpecialCases
- Port isSubTypeOf without internals
- Port anySupertype
- Port isSubtypeForSameConstructor, findCorrespondingSupertypes
- Port isSubtypeOfForSingleClassifierType
- Port NullabilityChecker
- Reorder checks for performance
2019-03-04 17:27:45 +03:00
Simon Ogorodnik
d210e8bad0 Introduce optional optimization parameters for type system context 2019-03-04 17:10:47 +03:00
Simon Ogorodnik
8992537180 Place instance markers in KotlinType hierarchy 2019-03-04 17:10:46 +03:00
Stanislav Erokhin
be79aeafa7 Create first draft of AbstractStrictEqualityTypeChecker 2019-03-04 17:10:46 +03:00
Stanislav Erokhin
f7702d3e43 Create new core module: type-system 2019-03-04 17:10:45 +03:00
Natalia Selezneva
fe278ea0a0 Add test for build.gradle.kts highlighting 2019-03-04 16:13:23 +03:00
Mikhael Bogdanov
6d9c49e55e Add IrCompileKotlinAgainstKotlinTest tests 2019-03-04 13:59:58 +01:00
Toshiaki Kameyama
1b7627e039 Surround with null check: suggested for an assignment
#KT-30215 Fixed
2019-03-04 15:11:57 +03:00
Toshiaki Kameyama
2314a38342 Reformat SurroundWithNullCheckFix 2019-03-04 15:11:57 +03:00
Sergey Rostov
f467d892ca Gradle: Supress PackageDirectoryMismatch in targets for gradle.plugin.mpp package 2019-03-04 13:12:34 +03:00
Sergey Rostov
88c04f75f1 Gradle: Move files from org.jetbrains.kotlin.gradle.plugin.mpp to org.jetbrains.kotlin.gradle.targets 2019-03-04 13:12:22 +03:00
Sergey Igushkin
51234d10b9 Actual change for splitting files preserving Git history
Remove resulting redeclarations and finish the split in files below:

  - from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt
2019-03-04 13:12:10 +03:00
Sergey Igushkin
b096057bdc (step 8/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves the temporary files back to their original paths.
2019-03-04 13:11:42 +03:00
Sergey Igushkin
0473bd2c4c Merge commit 'ffdd43b8083c4fd7795799e351f23d997534a43e'; commit 'af3bf257ba1584fd2f3d690fe76c48778699e29b'; commit '83d22a3744df1b79545070fbb9ea13ee1182a614'; commit 'b7cf915e884caea8cabc2db5f611fa5d5a7536e8'; commit '522a5b8c3ffd84c11cb70efead9c152e8d62cd37'; commit '37a117574f314263360350964e80ce182c093e31' into move-packages-on-master 2019-03-04 13:11:35 +03:00
Sergey Igushkin
bb90cf7831 (step 7/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves the original files to
temporary files suffixed with '.git_split_tmp'
2019-03-04 13:11:35 +03:00
Sergey Igushkin
37a117574f (step 6/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves:

  mpp\kotlinTargetPresets.kt -> mpp\KotlinMetadataTargetPreset.kt
  mpp\kotlinCompilations.kt -> mpp\KotlinWithJavaCompilation.kt
2019-03-04 13:11:32 +03:00
Sergey Igushkin
522a5b8c3f (step 5/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves:

  mpp\kotlinTargetPresets.kt -> mpp\KotlinJvmWithJavaTargetPreset.kt
  mpp\kotlinCompilations.kt -> mpp\KotlinNativeCompilation.kt
  mpp\KotlinCompilationFactory.kt -> mpp\KotlinWithJavaCompilationFactory.kt
2019-03-04 13:11:31 +03:00
Sergey Igushkin
b7cf915e88 (step 4/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves:

  mpp\kotlinTargetPresets.kt -> mpp\KotlinJvmTargetPreset.kt
  mpp\kotlinCompilations.kt -> mpp\KotlinJsCompilation.kt
  mpp\KotlinCompilationFactory.kt -> mpp\KotlinNativeCompilationFactory.kt
2019-03-04 13:11:28 +03:00
Sergey Igushkin
83d22a3744 (step 3/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves:

  mpp\kotlinTargets.kt -> mpp\KotlinWithJavaTarget.kt
  mpp\kotlinTargetPresets.kt -> mpp\KotlinJsTargetPreset.kt
  mpp\kotlinCompilations.kt -> mpp\KotlinJvmAndroidCompilation.kt
  mpp\KotlinCompilationFactory.kt -> mpp\KotlinJvmAndroidCompilationFactory.kt
2019-03-04 13:11:26 +03:00
Sergey Igushkin
af3bf257ba (step 2/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves:

  mpp\kotlinTargets.kt -> mpp\KotlinNativeTarget.kt
  mpp\kotlinTargetPresets.kt -> mpp\KotlinNativeTargetPreset.kt
  mpp\kotlinCompilations.kt -> mpp\KotlinJvmCompilation.kt
  mpp\KotlinCompilationFactory.kt -> mpp\KotlinJvmCompilationFactory.kt
2019-03-04 13:11:24 +03:00
Sergey Igushkin
ffdd43b808 (step 1/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves:

  KotlinTargetConfigurator.kt -> KotlinNativeTaretConfigurator.kt
  mpp\kotlinTargets.kt -> mpp\KotlinAndroidTarget.kt
  mpp\kotlinTargetPresets.kt -> mpp\KotlinAndroidTargetPreset.kt
  mpp\kotlinCompilations.kt -> mpp\KotlinCommonCompilation.kt
  mpp\KotlinCompilationFactory.kt -> mpp\KotlinJsCompilationFactory.kt
  mpp\kotlinCompilationOutputs.kt -> mpp\KotlinWithJavaCompilationOutput.kt
2019-03-04 13:11:22 +03:00
Dmitry Gridin
dce2139eb0 Fix KNPE from "Create" quick fix
#KT-27289 Fixed
2019-03-04 13:01:18 +03:00
Dmitry Gridin
78bee70946 Refactoring 2019-03-04 13:01:18 +03:00
Nikolay Krasko
b458e187af Extract ITNReporter.submit() compatibility problem to separate file 2019-03-04 12:14:23 +03:00
Nikolay Krasko
a5434d7d9e Add internal action for reporting exceptions from Kotlin plugin 2019-03-04 12:14:23 +03:00
Nikolay Krasko
6504cb285b Add internal action for continuous enabling and disable dumb mode 2019-03-04 12:14:22 +03:00
Nikolay Krasko
27ba9b5481 Fix Goto tests by invoking action directly instead of using handler
Problem introduced in
1f7f3d9fdc

Implementation CodeInsightActionHandler was returned for GotoDeclarationAction later.
2019-03-04 12:14:22 +03:00
Mikhail Zarechenskiy
93e79afab4 [NI] Preserve nullability of resulting type from CST if it's possible
Consider common supertype of `S` and `Nothing`, where `S` has nullable
 upper bound or it's flexible. Before the fix, result was `S?`, which
 is correct but too conservative. Now, we'll preserve nullability of
 resulting type if it's already nullable.

 This happened because we were failing to find path of not-nullable
 types from `Nothing` to `S`, which should obviously exists by
 semantics of Nothing
2019-03-04 11:29:39 +03:00
Mikhail Zarechenskiy
9b3e17f0d7 [NI] Avoid building controversial systems by clipping extra constraints
#KT-23854 Fixed
2019-03-04 11:29:38 +03:00
Mikhail Zarechenskiy
92b40ea9d5 [NI] Refactor adding expected type constraint
Add comments, make computation needed for expected type more clear
2019-03-04 11:29:38 +03:00
Mikhail Zarechenskiy
43cf6623f9 [NI] Added test for controversial common system
See KT-23854
2019-03-04 11:29:38 +03:00
Dmitry Gridin
5927032143 Fix "Introduce import alias" on extensions
#KT-30214 Fixed
2019-03-04 10:15:52 +03:00
Pavel V. Talanov
853e9a2aa0 Prevent calls to onFirstRun default implementation for gradle rc
This is temporary until we get compatible API from IDEA
    to support gradle run configurations for MPP projects in IDEA 191+
2019-03-04 02:52:41 +01:00
Andrey Uskov
25dc81c2bd Fix memory leak in gradle import
#KT-30076 Fixed
2019-03-03 20:28:04 +03:00
Andrey Uskov
3919898d19 Minor. Reformat code in multiplatform project importer 2019-03-03 20:27:12 +03:00
Ilya Chernikov
db3eb5707b Drop redundant usages of the ScriptDefinitionProvider 2019-03-02 08:10:17 +01:00
Ilya Chernikov
e99715cf82 Extract extra imports provision into an extension, implement one ...
for script in the plugin, drop direct dependency on scripts from
FileScopeFactory
2019-03-02 08:10:17 +01:00
Ilya Chernikov
57ac149f5b Extract script cli evaluation to the plugin 2019-03-02 08:10:17 +01:00
Ilya Chernikov
7c3bdde102 Fix sequence of the script definitions search - explicit ones should be tried first 2019-03-02 08:10:16 +01:00
Ilya Chernikov
196e274929 Move calculating dependencies from script sources to plugin 2019-03-02 08:10:16 +01:00
Ilya Chernikov
336f43dbf2 Reorganize files and folders in the scripting plugin 2019-03-02 08:10:16 +01:00
Ilya Chernikov
adb4d264ec Move script definition extraction functions to the plugin
plus finish refactoring of these functions
2019-03-02 08:10:16 +01:00
Nicolay Mitropolsky
815fcd062d Uast: caching isJvmElement if all modules are Jvm (KT-28564) 2019-03-01 20:14:57 +03:00
Alexander Udalov
8ef7f73164 Fix incorrect enum comparison in kotlinx-metadata
Previously, we compared instances of different enums and thus the
conditions were always true. This did not affect visible behavior of the
program except the fact that we've been writing default field values
(kind and level) for version requirements to protobuf where they
could've been omitted
2019-03-01 17:09:03 +01:00
Shagen Ogandzhanian
ed4e93cc98 Fix for npm publishing configuration
This reverts commit 0188cd5330.
Turns out it's not a url after all
2019-03-01 15:46:28 +01:00
Dmitry Gridin
2a940f5b0a Fix KT-26965 2019-03-01 17:43:56 +03:00
Shagen Ogandzhanian
7162dd9807 Prepare JsTestChecker (but not introduce so far) for J2V8 adoption 2019-03-01 15:29:35 +01:00
Wil
d3ac50f694 Minor: typo fix in Writer.buffered docs 2019-03-01 17:09:27 +03:00
Dereck Bridie
4156a76129 #KT-26965 Add inspection + quickfix for replacing Collection<T>.count() with .size 2019-03-01 16:58:36 +03:00
Toshiaki Kameyama
240ff08069 Specify type: escape with backticks if need
#KT-29677 Fixed
2019-03-01 16:43:02 +03:00
Toshiaki Kameyama
1a818970c3 Add inspection to replace Java Map.forEach with Kotlin's forEach
#KT-17278 Fixed
2019-03-01 16:15:23 +03:00
Nicolay Mitropolsky
9c674cb7c3 Uast: support for KtDelegatedSuperTypeEntry (KT-30033) 2019-03-01 15:00:31 +03:00
Dmitriy Novozhilov
2f5843f764 Move detecting of illegal call of contract function into call checker
(#KT-26153, #KT-26191) fixed
2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov
54e5cce9be Prohibit declaring multiple callsInPlace contract on same lambda.
#KT-26150 fixed
2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov
4a7420d77d Allow declaring contracts on suspend functions. KT-27468 Fixed 2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov
84da8b6279 Report CONTRACT_NOT_ALLOWED diagnostic on extension property getter/setter
KT-27090
2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov
b484e03fa8 Allow use contract function by FQN. #KT-29772 fixed 2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov
7072b9d179 Fix order of fixing type variables for callable references. KT-25433 Fixed 2019-03-01 14:50:33 +03:00
Andrey Uskov
735f86a50e Fix creation of KotlinSDK. GradleFacetImportTest fixed 2019-03-01 13:12:43 +03:00
Andrey Uskov
325ed8eb32 Change class hierarchy of KotlinSourceRootType. Deadlock during concurrent classloading fixed
#KT-30137 Fixed
2019-03-01 13:12:16 +03:00
Toshiaki Kameyama
87dc1a035b Convert property initializer to getter: suggest on property name
#KT-29344 Fixed
2019-03-01 11:37:42 +03:00
Toshiaki Kameyama
20aa8ebdb0 Add "Throwable not thrown" Inspection
#KT-11629 Fixed
2019-03-01 11:35:12 +03:00
Toshiaki Kameyama
e0aeb8f7ec Remove redundant let: rename invoke call
#KT-29556 Fixed
2019-03-01 11:31:07 +03:00
Toshiaki Kameyama
df3953f03a Redundant Unit: fix false positive when return type is nullable Unit
#KT-30038 Fixed
2019-03-01 11:12:25 +03:00
Toshiaki Kameyama
d67c793a9b map.get() with not-null assertion: add quick-fixes
#KT-30010 Fixed
2019-03-01 11:11:05 +03:00
Mikhail Glukhikh
84a3239cdf FIR: extract "toTypeProjection" 2019-03-01 10:36:19 +03:00
Mikhail Glukhikh
f8497bc339 FIR: extract "constructType" from type resolver 2019-03-01 10:36:19 +03:00
Mikhail Glukhikh
1cefcc1438 Add "firCompilerTest" configuration & include it into compiler tests 2019-03-01 10:36:19 +03:00
Natalia Selezneva
bc1e836f01 Fix saving Kotlin Scripting Setting to xml
^KT-30146 Fixed
2019-03-01 09:42:43 +03:00
Ilya Gorbunov
640699e076 Do not expose internal copyOfUninitializedElements and copyOfNulls 2019-02-28 23:44:00 +03:00
Ilya Gorbunov
2e9497f8f8 Rewrite copyOfUninitializedElements with templates without using copyRangeTo 2019-02-28 22:57:45 +03:00
Ilya Gorbunov
c1a51d44a4 Rewrite copyInto without using copyRangeTo
Rename array copying implementation to arrayCopy
2019-02-28 22:57:45 +03:00
Ilya Gorbunov
b8d9e896c2 Move sorting implementations for Native to kotlin.collections
- Move Array.sortWith to generated code
2019-02-28 22:57:45 +03:00
Svyatoslav Kuzmich
e11fda1c49 [JS IR BE] Skip external methods in js default arguments stub generators 2019-02-28 20:13:56 +03:00
Svyatoslav Kuzmich
8da076c1ed [JS IR BE] Fix basic reflection for primitive types 2019-02-28 20:13:56 +03:00
Svyatoslav Kuzmich
a01407eec9 [JS IR BE] Don't mangle Any::equals method 2019-02-28 20:13:56 +03:00
Svyatoslav Kuzmich
27005d7c2e [JS IR BE] Basic support for external varargs 2019-02-28 20:13:56 +03:00
Svyatoslav Kuzmich
0d9218b017 [JS IR BE] Refactor namer 2019-02-28 20:13:55 +03:00
Svyatoslav Kuzmich
e9cdad1143 [JS IR BE] Remove support for dynamic symbols and descriptors
Dynamic expressions in IR are now represented as IrDynamicOperatorExpression

We don't have dynamic functions, dynamic dispatch receivers anymore
2019-02-28 20:13:55 +03:00
Svyatoslav Kuzmich
d323dce2b6 [JS IR BE] Fix codegen for nested external objects 2019-02-28 20:13:55 +03:00
Dmitry Gridin
41f3316981 Fix caret position in "Convert function to property" intention
#KT-19944 Fixed
2019-02-28 15:59:50 +03:00
Dmitry Gridin
29a63ae58c Refactoring & fix warnings 2019-02-28 15:59:50 +03:00
Vadim Brilyantov
bd2e51ded5 Fix for bug introduced in moveConflictUtils (never show warnings when moving to the same scope) 2019-02-28 15:52:28 +03:00
victor.petukhov
bd03ecf4a0 Rename helper file with typealias samples for spec tests 2019-02-28 14:55:41 +03:00
victor.petukhov
b7a5d73bf0 Add type inference tests by specification to remote run tests 2019-02-28 11:55:16 +03:00
Georgy Bronnikov
c618ef9304 Correct phase argument names and cli test outputs 2019-02-28 11:53:02 +03:00
Georgy Bronnikov
5ff1337ec8 Add some phase checkers 2019-02-28 11:53:02 +03:00
Georgy Bronnikov
da13d3288e Check pre- and postconditions on phases 2019-02-28 11:53:02 +03:00
Natalia Selezneva
48433110a4 Do not threat modifications inside lambdas in KtScriptInitializer block as out of code block 2019-02-28 10:59:15 +03:00
Natalia Selezneva
49277bb5e4 Optimize MemberVisibilityCanBePrivateInspection: check that descriptor is in class before resolving it 2019-02-28 10:59:14 +03:00
Natalia Selezneva
560acd631c KtScriptInitializer doesn't has a descriptor 2019-02-28 10:59:13 +03:00
Natalia Selezneva
3b4d1dd7bf Optimize ChangeVisibilityModifierIntention: do not analyze element if declaration isn't local 2019-02-28 10:59:12 +03:00
Natalia Selezneva
869fb46c0b Optimize KotlinUFunctionCallExpression.isAnnotationArgumentArrayExpression 2019-02-28 10:59:12 +03:00
Toshiaki Kameyama
6ca22fbf34 Remove redundant let: do not report for function stored in variable call
#KT-30082 Fixed
2019-02-28 10:44:05 +03:00
Dmitry Gridin
304007f602 Fix false positive "Redundant companion reference"
#KT-30166 Fixed
2019-02-28 10:42:22 +03:00
Sergey Rostov
50263ed7cd JPS Build: update artifacts configuration (bootstrap) 2019-02-28 09:16:10 +03:00
Yan Zhulanow
7c0233dfeb 191: 191: Fix test compilation, remove deleted test 2019-02-27 21:41:09 +03:00
Kirill Shmakov
262b3fde3d Fix Gradle MPP integration tests
#KT-30056 Fixed
2019-02-27 20:51:04 +03:00
Dmitry Gridin
3756b6f54d Add inspection to remove redundant qualifier name
#KT-12134 Fixed
2019-02-27 20:43:35 +03:00
Dmitry Gridin
d0c3a28996 Move canBePossibleToDropReceiver to Companion object & fix warnings 2019-02-27 20:43:35 +03:00
Ilya Gorbunov
19bd326810 Swap mismatched docs for Result.onSuccess/onFailure KT-30109 2019-02-27 17:53:11 +03:00
Ilya Gorbunov
908009bf42 Improve double-to-ulong conversion tests
#KT-27108
2019-02-27 17:49:41 +03:00
Mikhail Zarechenskiy
892fb9f39e Increment metadata version and improve message for error type
Follow-up of 617bed1b
2019-02-27 14:03:22 +03:00
Vyacheslav Gerasimov
f7428e7161 Build: Add diagnostic for publish() helper 2019-02-27 13:21:17 +03:00
Vyacheslav Gerasimov
a42f607ecf Build: Fix artifacts signing for maven central
With gradle > 5.0 `publish()` helper call should be done before
`noDefaultJar()` or any other artifact hacks, otherwise singing plugin doesn't sign any jars
2019-02-27 13:21:17 +03:00
Vyacheslav Gerasimov
df3aa48c9b Build: Apply java plugin in kotlin-annotation-processing-embeddable
Otherwise artifact signature works incorrectly for this project
2019-02-27 13:21:17 +03:00
Vyacheslav Gerasimov
f4c157a9bc Build: properly remove artifact from archives in runtimeJar helper 2019-02-27 13:21:17 +03:00
Alexander Podkhalyuzin
6098e97ae5 Do not go to the same type twice during contains search
This fixes exponent in algorithm for scala.FunctionN.curried, where N can be up to 22.

#KT-29435 Fixed
2019-02-27 12:36:43 +03:00
Nicolay Mitropolsky
c151be5547 Uast multiresolve key description fix 2019-02-27 12:15:32 +03:00
Mark Punzalan
fc5eac26cd Extracted complex string concatenation bytecode test case into separate test data file. 2019-02-27 08:36:35 +01:00
Mark Punzalan
d4d5a6011c Flatten nested string concatenation expressions into a single IrStringConcatenation, in a separate lowering phase.
Consolidating these into IrStringConcatenations allows the backend to produce efficient code for string concatenations (e.g., using StringBuilder for JVM).
2019-02-27 08:36:35 +01:00
Natalia Selezneva
ae22bdee15 Add scripting resolver extension to plugin-kotlin-extensions.xml 2019-02-27 09:37:07 +03:00
Sergey Rostov
63dca7b3b5 Build: exclude annotations.jar from Intellij 2019-02-27 09:11:42 +03:00
Sergey Rostov
17c0422d8f Build: got rid of @TestOnly annotations on fields and classes 2019-02-27 09:08:34 +03:00
Dmitry Gridin
c89d1af9fa Improve Create property from Usage
Place generated property next to other properties
 #KT-14886 Fixed
2019-02-27 00:07:55 +03:00
Dmitry Gridin
5d599ee2ff Refactoring 2019-02-27 00:07:55 +03:00
Alexander Udalov
76e133014b Minor, explain why we don't store array type arguments in ::class in proto 2019-02-26 19:09:42 +01:00
Alexander Udalov
736ac12374 Prohibit type parameters in class literals in annotation arguments
#KT-27799 Fixed
2019-02-26 19:09:42 +01:00
Vadim Brilyantov
c633f7568f #KT-25674: Fix unexpected reference renames in literals when moving referenced files. 2019-02-26 15:37:48 +03:00
Vadim Brilyantov
c7acd89fad #KT-19799: Add initialDirectory to KotlinAwareMoveFilesOrDirectoriesDialog 2019-02-26 15:37:47 +03:00
Vadim Brilyantov
0c1e7e1d63 #KT-23099: Fix name clashes when moving top-level objects with same signature 2019-02-26 15:37:45 +03:00
Vadim Brilyantov
f7c4760cb9 #KT-17825: Filter PackageLookupObjects as available for completion 2019-02-26 15:37:42 +03:00
Vadim Brilyantov
c5d1190d15 #KT-26611: Change mnemonic for "search references" checkbox to Alt+R 2019-02-26 15:37:40 +03:00
Vadim Brilyantov
01200252f5 #KT-22721: Fix move refactoring to make it check previous PsiElement before a whitespace 2019-02-26 15:37:39 +03:00
Vadim Brilyantov
e413395cbf #KT-19661: Create missing directories when moving to a user-defined path 2019-02-26 15:37:34 +03:00
Vadim Brilyantov
dc2c8140a9 Add optimize imports with timeout for move refactoring 2019-02-26 15:35:17 +03:00
Vadim Brilyantov
0ec3d15218 #KT-19924: Fix usability issue with extract declaration from file intention
Fix ExtractDeclaration intention name in tests

Fix ExtractDeclaration intention folder and description to avoid "not found Dir URL" exception
2019-02-26 15:35:15 +03:00
Alexander Gorshenev
888641e7f1 Use file symbol instead of a file name string in IrReturnableBlockImpl 2019-02-26 13:54:04 +03:00
Alexander Udalov
e2106d4d08 Do not assert that function is inline in MemberDescriptor.isInlineOnly
This is a more accurate fix of the problem described in 946acd2416
2019-02-26 11:16:01 +01:00
Alexander Udalov
b8bc79e17c Support non-trivial default argument values in expected functions on JVM
#KT-22818 Fixed
2019-02-26 11:02:30 +01:00
Ting-Yuan Huang
b2cc661783 Set target backend of BytecodeTextTestGenerated to JVM
as BytecodeTextTestGenerated is only available to JVM.

Change-Id: I0bb15b35ab3b8418434875971a572f3e49a516a5
2019-02-26 09:22:43 +01:00
Alexander Udalov
cfcd0d7b4a Minor, fix localClassLiteral.kt on JDK 9 2019-02-25 23:37:43 +01:00
Abduqodiri Qurbonzoda
ae47130c8e Implement UArray.contains(element) workaround for JS 2019-02-25 21:58:53 +03:00
Abduqodiri Qurbonzoda
c1b523ddef Fix UArray.containsAll(Collection<Any?>) 2019-02-25 21:58:53 +03:00
Abduqodiri Qurbonzoda
60e83383ad Add containsAll(Any?) check to CollectionBehaviors 2019-02-25 21:58:53 +03:00
Abduqodiri Qurbonzoda
1b6b44c805 Implement conversion between floating point numbers and unsigned integers
KT-27108
2019-02-25 21:58:03 +03:00
Yan Zhulanow
a970de51ab Debugger: Fix 182 bunch, add missing scratch extensions 2019-02-25 21:35:00 +03:00
Yan Zhulanow
55db2abd89 Debugger: Fix 191 bunch file, add new debugger extensions 2019-02-25 21:35:00 +03:00
Alexander Udalov
3f1533c35b Restore support for local class literals in annotation arguments
This was broken in c1ab08c8ce where we started to represent KClassValue
as a ClassId of the referenced class + number of times it's been wrapped
into kotlin.Array. Local classes do not have a sane ClassId, so in this
change we restore the old behavior by representing KClassValue with a
sealed class value instead

 #KT-29891 Fixed
2019-02-25 19:22:09 +01:00
Alexander Udalov
f733bda912 Fix compilation error introduced in d374723e3c 2019-02-25 19:22:09 +01:00
Pavel Punegov
86ac5e97e4 Update Kotlin/Native to 1.2-rc2-7869 2019-02-25 20:42:02 +03:00
Ilya Chernikov
d374723e3c Restore default jvmTarget for scripts that was lost after refactoring 2019-02-25 18:22:27 +01:00
Nicolay Mitropolsky
e0e5009f3f 191: Uast: StringTemplateComplexForUInjectionHost testdata fix 2019-02-25 19:24:51 +03:00
Leonid Startsev
472d91e0de Do not return whole list of generated property descriptors for type
arguments' serializers when only one name is needed.

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/383
2019-02-25 19:21:29 +03:00
Nicolay Mitropolsky
f9813af3ff 191: Uast: KotlinUSimpleReferenceExpression bunch fix 2019-02-25 18:13:18 +03:00
Nikolay Krasko
6813402abf Fix INRE from KotlinQuickDocumentationProvider (KT-30058, EA-137533)
Show a warning like CtrlMouseHandler does.

Fixed in 191 branch in CtrlMouseHandler.updateOnPsiChanges().
b116dcaf99

 #KT-30058 Fixed
2019-02-25 17:43:57 +03:00
Alexey Tsvetkov
f38ad0fe8a Fix inter-project IC with new MPP for JS/JVM targets
#KT-26275 Fixed
   #KT-29966 Fixed
2019-02-25 17:12:14 +03:00
Nicolay Mitropolsky
5786ab5140 Uast: making KotlinClassViaConstructorUSimpleReferenceExpression also handle deserialized descriptors 2019-02-25 16:35:46 +03:00
Nicolay Mitropolsky
25e00c9079 Uast: making KotlinClassViaConstructorUSimpleReferenceExpression resolve to class in case of SAM (KT-28272) 2019-02-25 16:35:46 +03:00
Nicolay Mitropolsky
d7584df01b Uast: making ULambdaExpression.functionalInterfaceType return non-null values for explicitly typed SAM-s with Java interfaces (KT-28272) 2019-02-25 16:35:46 +03:00
Anton Yalyshev
a326ba60a3 metadata contains Common target, so we need to track it as well 2019-02-25 16:26:12 +03:00
Max Medvedev
526e49d68a fix test icons for methods
#KT-25956
2019-02-25 16:02:42 +03:00
Sergey Igushkin
03e36334cf Push Gradle version for kotlin-gradle-plugin-integration-tests to 5.2 2019-02-25 15:43:40 +03:00
Sergey Igushkin
43de81e4c8 Fix MPP publishing with metadata on Gradle 5.2 (KT-29758)
In publishing, use attribute containers of detached configuration
instead of HierarchyAttributeContainer, which is rejected by Gradle for
not being an AttributeContainerInternal.

Using attributes of a detached configuration is a small and
conservative fix; we may need to either not filter the attributes,
which will lead to [ProjectLocalConfigurations.ATTRIBUTE] being
published in the Gradle module metadata, which will potentially
complicate our attributes schema migration, or create proper,
non-detached configurations for publishing that are separated from the
configurations used for project-to-project dependencies.

Issue #KT-29758 Fixed
2019-02-25 15:43:40 +03:00
Svyatoslav Kuzmich
beb5f73a2b Remove duplicate tests from JS compiler test set. Merge chages to common compiler tests 2019-02-25 15:09:27 +03:00
Svyatoslav Kuzmich
a736756ceb [JS IR BE] Fix and refactor interop tests 2019-02-25 15:09:27 +03:00
Svyatoslav Kuzmich
569187a751 [JS IR BE] Use Char boxing rules of current backend 2019-02-25 15:09:26 +03:00
Svyatoslav Kuzmich
de020ed58a [JS IR BE] Generate and export JS properties 2019-02-25 15:09:26 +03:00
Svyatoslav Kuzmich
fc5636b7c1 [JS IR BE] Fix: Don't generate built-in "Function" interface 2019-02-25 15:09:26 +03:00
Svyatoslav Kuzmich
326cbcc218 [JS IR BE] Unmute tests 2019-02-25 15:09:26 +03:00
Svyatoslav Kuzmich
1184c158e4 [JS IR BE] Support @JsName in bridges 2019-02-25 15:09:26 +03:00
Svyatoslav Kuzmich
e09a6f0007 [JS IR BE] Fix codegen for external companion objects 2019-02-25 15:09:25 +03:00
Svyatoslav Kuzmich
c4ffe36a21 [JS IR BE] Add CharSequence type check 2019-02-25 15:09:25 +03:00
Svyatoslav Kuzmich
3be4248791 [JS IR BE] Disable deprecated jsName tests 2019-02-25 15:09:25 +03:00
Svyatoslav Kuzmich
74c8f54fc8 [JS IR BE] Support cast to native interface 2019-02-25 15:09:25 +03:00
Kirill.Shmakov
4a3476a87c Merge rr/kishmakov/KT-30056 into master 2019-02-25 11:45:55 +00:00
Yan Zhulanow
e43fd713ef Fix new compiler tests (new receiver name mangling – $this$label) 2019-02-25 14:44:00 +03:00
Yan Zhulanow
133f021b26 Async stack traces: Fix compilation on IDEA 182 and older AS versions 2019-02-25 14:44:00 +03:00
Yan Zhulanow
cadb70f64a Evaluator: Allow to evaluate expression on synthetic lines in .kt files 2019-02-25 14:44:00 +03:00
Yan Zhulanow
16266259f5 Evaluator: Handle function context gracefully. Use file scope as a fallback instead of error scope 2019-02-25 14:44:00 +03:00
Yan Zhulanow
5035de24ac Code fragments: Use file scope as a fallback when a more specific one is not available 2019-02-25 14:44:00 +03:00
Yan Zhulanow
316dcccc30 Minor: Capitalize word "Kotlin" in error messages 2019-02-25 14:43:59 +03:00
Yan Zhulanow
28e4356e6e Restore original variable name mangling for captured/receiver $this
Design for the new one is still not finished.
2019-02-25 14:43:59 +03:00
Yan Zhulanow
1edacbbb5e Evaluator: Don't rely on moduleDescriptor presence in DebugLabel descriptor generation
The containing moduleDescriptor may not exist for the Java context.
2019-02-25 14:43:59 +03:00
Yan Zhulanow
a21802ee51 Pill: Fix new annotations-13.0 configuration 2019-02-25 14:43:59 +03:00
Yan Zhulanow
632b9ac38c Evaluator: Support 'field' variable evaluation for top-level properties 2019-02-25 14:43:59 +03:00
Yan Zhulanow
81f4e2fb3b Evaluator: Support delegated local variables 2019-02-25 14:43:59 +03:00
Yan Zhulanow
77bec27c99 Evaluate parameter value instead of backing field in primary constructor 2019-02-25 14:43:59 +03:00
Yan Zhulanow
592083bc5b Debugger: Support DebugLabel descriptors in completion 2019-02-25 14:43:58 +03:00
Yan Zhulanow
bff3f28a72 Pill: Fix IdeaPlugin artifact configuration 2019-02-25 14:43:58 +03:00
Yan Zhulanow
b9f76683dd Simplify 'suppressDiagnosticsInDebugMode'
In the new evaluator, suppressDiagnosticsInDebugMode is never set, and effectively the only check is that if a particular file is a KtCodeFragment.
2019-02-25 14:43:58 +03:00
Yan Zhulanow
6cb2146d31 Remove 'allowSpecialClassNames' extraction option 2019-02-25 14:43:58 +03:00
Yan Zhulanow
11dfbd5d3d Allow '$this$label$<somethingElse>' for extension receivers
Our mangling works poorly with nested inline function calls (saying, `apply()` inside an another `apply()`). In that case, the generated local variable name for both cases will be `$this$apply`. As the debugger sees only the last (the closest) variable with the same name, we loose the ability to get the first one.
This means we might want to add some additional information to the mangling (e.g. add the trailing indices `$this$apply$1`). This commit supports this case.
2019-02-25 14:43:58 +03:00
Yan Zhulanow
34b03c45d7 Add a test for escaped names supported in the new evaluator (KT-29661) 2019-02-25 14:43:58 +03:00
Yan Zhulanow
51b26325c6 Coroutine stack trace provider: check thread state before invokeMethod() 2019-02-25 14:43:58 +03:00
Yan Zhulanow
24cdd3f857 Remove 'debugTypeInfo' key
The key became obsolete as the new evaluator doesn't use it anymore.
2019-02-25 14:43:57 +03:00
Yan Zhulanow
6a81c2e1e4 Minor: Extract 'this' local variable name in DefaultImpls 2019-02-25 14:43:57 +03:00
Yan Zhulanow
65b6098242 Further refinements in variable displaying (Kotlin mode)
- Remove synthetic outer this for lambdas
- Recognize captured this for interface default methods
2019-02-25 14:43:57 +03:00
Yan Zhulanow
300c102c3f Remove BeforeExtractFunctionInsertionTest, the new evaluator doesn't depend on the 'extract function' refactoring 2019-02-25 14:43:57 +03:00
Yan Zhulanow
0657a3d399 New evaluator that doesn't depend on the 'extract function' refactoring (KT-28192, KT-25220, KT-25222, KT-21650) 2019-02-25 14:43:57 +03:00
Yan Zhulanow
3e849294f0 Extract the common part from bunched KtCodeFragment 2019-02-25 14:43:57 +03:00
Yan Zhulanow
b4002accfb Extract label name calculation from 'recordCallLabelForLambdaArgument()' 2019-02-25 14:43:56 +03:00
Yan Zhulanow
34c5954d75 Minor: Reformat evaluator code 2019-02-25 14:43:56 +03:00
Yan Zhulanow
eaed6855ac Minor: Add proper nullability check in generateExtensionReceiver() 2019-02-25 14:43:56 +03:00
Yan Zhulanow
d039e3b1c0 Hide synthetic variables for local functions and destructured lambda parameters (Kotlin variables) 2019-02-25 14:43:56 +03:00
Yan Zhulanow
ed88020a84 Minor: Reformat extraction engine files 2019-02-25 14:43:56 +03:00
Yan Zhulanow
488418d960 Change mangling for local functions 2019-02-25 14:43:56 +03:00
Yan Zhulanow
aca3be12e9 Change illegal local variable mangling rules 2019-02-25 14:43:56 +03:00
Yan Zhulanow
47f0b68a8c Change mangling for destructured lambda parameters 2019-02-25 14:43:56 +03:00
Yan Zhulanow
d2c2a6c99f Debugger: Support inline functions in Variables view 2019-02-25 14:43:55 +03:00
Yan Zhulanow
7fb8357b28 Allow '// PRINT_FRAME' option for multi-breakpoint stepping tests 2019-02-25 14:43:55 +03:00
Yan Zhulanow
16b94feea6 Minor: Remove an obsolete TODO comment 2019-02-25 14:43:55 +03:00
Yan Zhulanow
6cd980765c Do not issue exceptions for non-captured local variables
This partly fixes KT-28192.
2019-02-25 14:43:55 +03:00
Yan Zhulanow
4ae01badff Extract function: avoid same parameter names 2019-02-25 14:43:55 +03:00
Yan Zhulanow
7de5ddaac9 Fix receiver evaluation for primitive receiver types 2019-02-25 14:43:55 +03:00
Yan Zhulanow
f6cc686095 Minor: Extract a const for continuation variable name 2019-02-25 14:43:55 +03:00
Yan Zhulanow
cf9461847b Hide unrelated this entries in Kotlin Watches mode 2019-02-25 14:43:54 +03:00
Yan Zhulanow
e5b0d2e34f Refactoring: Extract list field search 2019-02-25 14:43:54 +03:00
Yan Zhulanow
c5061e7997 Replace 'visibleVariablesByName()' calls with a safe implementation 2019-02-25 14:43:54 +03:00
Yan Zhulanow
757fc421f7 Refactoring: Extract wrapping 'try' expressions 2019-02-25 14:43:54 +03:00
Yan Zhulanow
f5a3a46e76 Watches: Hide 'this' if it's a continuation 2019-02-25 14:43:54 +03:00
Yan Zhulanow
227a7e5609 Provide access to 'coroutineContext' inside suspend functions/lambdas (KT-24829) 2019-02-25 14:43:54 +03:00
Yan Zhulanow
cf925fc2ad Activate Kotlin stack frame even if there is no Kotlin strata 2019-02-25 14:43:54 +03:00
Yan Zhulanow
f6b2e673f7 Debugger: Display async stack trace elements for suspend callers (KT-28728) 2019-02-25 14:43:53 +03:00
Yan Zhulanow
e8c066605b Do not drop analysis results for the code fragment context, allow to re-use it
Otherwise labels declared in the expression context become unresolved.
This is needed for the `this@label` expression evaluation support (KT-28134).
2019-02-25 14:43:53 +03:00
Yan Zhulanow
4c681c787d Watches: Add Kotlin/JVM views to watches window (KT-28134, KT-28087, KT-22250)
Kotlin mode: show only Kotlin variables and captured values. The variable names are Kotlin-friendly.
JVM mode: show all variables available in the current stack position, including synthetic ones.
2019-02-25 14:43:53 +03:00
Yan Zhulanow
5c419fc629 Evaluator: New implementation for variable finder
Support both old and new receiver variable conventions in variable finder.
2019-02-25 14:43:53 +03:00
Yan Zhulanow
df7bbf707b Refactoring: Rename a function to 'getArgumentsForEvaluation()' 2019-02-25 14:43:53 +03:00
Yan Zhulanow
ea462091c4 Support new convention for local variables name mangling: '$receiver' -> '$this$<label>' (KT-26913) 2019-02-25 14:43:53 +03:00
Yan Zhulanow
b5f9149702 Minor: Get rid of some magic constants 2019-02-25 14:43:53 +03:00
Kirill Shmakov
2a3473f275 Better string builder. 2019-02-25 14:43:32 +03:00
Kirill Shmakov
c43024a9c7 Version is backed. 2019-02-25 14:34:47 +03:00
Kirill Shmakov
02c9afcb6f Last test 2019-02-25 14:15:30 +03:00
Ilya Chernikov
b1ab2ead61 Restore find script definition behaviour (mostly) and relevant comments broken with refactoring 2019-02-25 11:57:13 +01:00
Kirill Shmakov
fb14128cbd All but one 2019-02-25 13:46:34 +03:00
Nicolay Mitropolsky
6b792c36f0 KotlinUastApiTest: using kfail alias 2019-02-25 12:26:22 +03:00
Nicolay Mitropolsky
712c897472 Uast: fix for UVariables missing typeReferences 2019-02-25 12:26:21 +03:00
Nicolay Mitropolsky
98740138f3 Uast: yet another check for invalid context before resolve (EA-137191, EA-137193) 2019-02-25 12:26:21 +03:00
Nicolay Mitropolsky
bd0c6736ce Uast: implementing specific javaPsi for UVariables 2019-02-25 12:26:21 +03:00
Nicolay Mitropolsky
7dc818d42b 191: KotlinUastApiTest.kt missed bunch aligning fix 2019-02-25 12:26:21 +03:00
Andrey Uskov
63a1bba6d9 Fix importing compiler arguments if worker api is used #KT-29564 Fixed 2019-02-25 12:20:27 +03:00
Natalia Selezneva
8453c1ff4d Scratch: hide 'make module' checkbox when no module is selected
^KT-23985
2019-02-25 11:20:49 +03:00
Natalia Selezneva
e2b5134048 Allow to run scratch without module selected
^KT-23985 Fixed
2019-02-25 11:20:49 +03:00
Natalia Selezneva
8d4ca4d1c5 Scratch: Fix "Read access is allowed from event dispatch thread or inside read-action only"
^KT-28958 Fixed
2019-02-25 11:19:36 +03:00
Dmitry Savvinov
ba36fafb84 Create JsAnalyzerFacade with allowSliceRewrite=true
Other facades (JVM, Common, Native) are already created with such flag.
This should stop some known 'rewrite at slice'-exceptions from being
thrown (KT-21405, KT-29705).

For a more thorough investivation and details, refer to KT-30031.

Also, see KT-30030: even though it was fixed by the different commit,
the same scenario probably can be used to investigate other rewrites
(even though they will reproduce much less frequently than original
issue)

^KT-21405 Fixed
^KT-29705 Fixed
2019-02-25 11:10:16 +03:00
Dmitry Savvinov
50d1c013fc Force-resolve body in contract computation under lock
Even though acquire/release pattern guarantees memory visibility across
threads, it doesn't prevents concurrent access to critical section (i.e.
to force-resolve of the corresponding body).

This can lead to multiple resolution passes over one and the same PSI in
IDE, which, in turn, leads to 'rewrite at slice'-exceptions. See
KT-30030 for case description and details.

^KT-30030 Fixed
2019-02-25 11:10:16 +03:00
Dmitry Savvinov
705ec503cf Minor optimization: don't put 'null' for ContractProvider in user data 2019-02-25 11:10:16 +03:00
Dmitry Savvinov
2359944fa7 Minor: add debugName to JS-slices 2019-02-25 11:10:16 +03:00
Mikhail Glukhikh
c084eefb65 Fix a bunch of IDE quick-fix tests (related to "convert to run/...")
These actions became available more often some days ago
2019-02-25 10:37:46 +03:00
Dmitriy Dolovov
4ef12b1ed7 CIDR: New way of building CLion and AppCode plugins v2 2019-02-25 14:06:51 +07:00
Mikhail Glukhikh
de93aad8aa FIR total resolve in IDE test: fix accidentally wrong project path :( 2019-02-25 09:53:21 +03:00
Mikhail Zarechenskiy
617bed1bf1 Fix nested typealiases expansion and as a result fix serialization
Consider the following situation:
 ```
 class Inv<T>
 typealias A<K> = Inv<K>
 typealias B<V> = Inv<A<K>>

 fun <U> materialize(): B<U> = TODO()
 ```

 Type `B<U>` is expanding to `Inv<Inv<U>>` and for this type `B<U>` and
 `Inv<A<U>>` are abbreviated types, but due to a bug we forgot to make
 substitution for `Inv<A<U>>` and were getting abbreviated type
 `Inv<A<K>>` where `K` is a type parameter from the typealias declaration.

 This bug didn't affect subtyping anyhow but the incorrect type was
 serialized and caused problems during deserialization as there wasn't
 `K` in deserialization context.

 #KT-24964 Fixed
 #KT-20780 Fixed
 #KT-20065 Fixed
 #KT-28236 Fixed
 #KT-21775 Fixed
2019-02-25 00:28:45 +03:00
Stanislav Erokhin
f1d5912f05 Update Kotlin/Native: 1.2-rc1-7773 2019-02-23 11:39:10 +03:00
Georgy Bronnikov
67656a447a Add a test 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
3531f47bfb Remove descriptors from ToArrayLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
c3652a47c6 Remove descriptors from JvmStaticAnnotationLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
28bab6510e Remove descriptors from JvmOverloadsAnnotationLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
f61072873f remove descriptors from createInnerClassConstructorWithOuterThisParameter 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
72ea4cc3d7 Remove descriptors from BridgeLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
c9b8f58a10 Restore overriddenSymbols consistency in InterfaceDelegationLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
68f9f4b3b5 Add a test 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
cb757f1cbc Remove descriptors from SyntheticAccessorLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
9078cb87e8 Remove descriptors from InitializersLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
5d7a736cb1 Remove desriptors from ObjectClassLowering 2019-02-23 00:42:16 +03:00
Georgy Bronnikov
5f4b8dd0aa Remove descriptors from EnumClassLowering 2019-02-23 00:42:16 +03:00
Ilya Gorbunov
8f6d73fd32 Use JS stdlib merger from bootstrap compiler 2019-02-22 21:22:19 +03:00
Ilya Gorbunov
0a0f81486f Advance bootstrap to 1.3.30-dev-1945 2019-02-22 21:22:07 +03:00
Dmitry Petrov
b792f3f12f KT-30020 expressions without resolved calls in augmented assignment LHS
Augmented assignment operator (e.g., '+=') can be resolved to simple
function call ('plusAssign'). In that case, augmented assignment LHS
can be an arbitrary expression, and may have no associated ResolvedCall.

For example:
    (a as MutableList<Int>) += 42

Note that it can happen only in case of augmented assignment operator
convention resolution, because all other forms of assignment-like
operator desugaring require some kind of 'store' operation
(property setter, 'set' operator for array element expression, etc),
and should resolve to some combination of calls.

In that case we simply generate LHS on 'load', and throw assertion on
'store'.
2019-02-22 17:45:27 +03:00
Ilmir Usmanov
1777849ff3 Generate correct linenumber for the debugger to see the return value
of suspend function.

 #KT-20322 Fixed
2019-02-22 17:37:32 +03:00
Nicolay Mitropolsky
9bf55d81ca Making kts-compiler able to dig out the ClassPath from the intellij PluginClassLoader 2019-02-22 13:51:47 +03:00
Ilmir Usmanov
ec7315e6da Add $completion entry to suspend functions' LVT
#KT-28810 Fixed
2019-02-22 13:50:35 +03:00
Dmitriy Novozhilov
677987c85f Add diagnostics on annotations on super types. KT-23992 fixed 2019-02-22 10:28:21 +03:00
Dmitriy Novozhilov
1fc6f30c50 Add test for KT-23992 2019-02-22 10:22:19 +03:00
Dmitriy Novozhilov
92bd907983 Fix checking repeatablilty of use-site target annotations. KT-26638 fixed 2019-02-22 10:15:37 +03:00
Dmitriy Novozhilov
cfda468f13 Add test for KT-26638 2019-02-22 10:15:37 +03:00
Dmitriy Novozhilov
3e147af3c0 KT-27565 fix 2019-02-22 10:15:16 +03:00
Dmitriy Novozhilov
cd2b8839b4 Add test for KT-27565 2019-02-22 10:15:16 +03:00
Ilya Gorbunov
eca1af4091 Temporary restore kotlin-stdlib-js-merger for bootstrapping 2019-02-22 02:37:31 +03:00
Ilya Gorbunov
98c6c925fc Move JS stdlib merger into cli compiler module
Refactor: use stdlib function to relativize paths.
2019-02-22 02:37:24 +03:00
Dmitry Gridin
b58bfff843 Fix paramTypeLambdaMismatch test 2019-02-21 19:08:02 +03:00
Kirill Shmakov
b695f20526 Candidate 2019-02-21 19:00:37 +03:00
Nikolay Krasko
e495bfc570 Stop failing when there's no CIDR classes during running tests 2019-02-21 18:01:57 +03:00
Ilya Chernikov
d1a1594f26 Remove redundant direct usages of the ScriptDefinition in compiler
plus some refactoring around definition extraction
2019-02-21 15:59:48 +01:00
Ilya Chernikov
5bc262fcb4 Add scripting resolver extension to the IDEA plugin as well 2019-02-21 15:59:48 +01:00
Ilya Chernikov
cc4aedb807 Move the rest of script descriptor implementation details to plugin, cleanup 2019-02-21 15:59:48 +01:00
Ilya Chernikov
29fa0f5dff Replace unnecessary direct usages of the LazyScriptDescriptor with ScriptDescriptor interface
lift result property to the interface to implement it
2019-02-21 15:59:48 +01:00
Ilya Chernikov
e28017039d Split scripts and class/object declarations in DeclarationsProvider
simplifies code in most places, avoids filtering in places where they
should be processed independently
2019-02-21 15:59:48 +01:00
Ilya Chernikov
a218455193 Extract script descriptor creation to scripting plugin 2019-02-21 15:59:48 +01:00
Ilya Chernikov
4359919e10 Add package-level class descriptors generation to the SyntheticResolveExtension
required for extracting script descriptors generation to an extension
2019-02-21 15:59:48 +01:00
Ilya Chernikov
0839b44ebb Replace explicit ScriptDescriptor in resolver with appropriate superclass 2019-02-21 15:59:47 +01:00
Ilmir Usmanov
6e120b2173 Do not generate state-machines for suspend lambdas, which capture any
crossinline lambda, not only suspend.
 #KT-29912 Fixed
2019-02-21 17:44:41 +03:00
Alexander Podkhalyuzin
931e1aa213 Removed 2x svg files from Android Studio 3.3 as it renders it anyway
#KT-29533 Fixed
2019-02-21 16:52:45 +03:00
Dmitry Petrov
c248dd29c2 IR: declaration builders, initial iteration, use in some JVM lowerings 2019-02-21 16:03:11 +03:00
Kirill Shmakov
1846ec83e1 Return app name of the main folder
Better fix for KT-29804 aligned with KT-30003

KT-29804
KT-30003
2019-02-21 14:43:34 +03:00
Dmitry Gridin
147521d6cb Add intention to introduce import alias
#KT-16118 Fixed
 #KT-30007 Fixed
2019-02-21 12:25:09 +03:00
Dmitry Gridin
6bf119b262 Refactoring 2019-02-21 12:25:08 +03:00
Dmitriy Novozhilov
d58ee133a2 Fix type constraints of empty lambda (KT-28654 fix) 2019-02-21 12:04:23 +03:00
Dmitriy Novozhilov
2ba33c3b8a Fix testdata broken in 46bd5ba 2019-02-21 12:04:23 +03:00
Dmitriy Novozhilov
10b7baf69a Add test for KT-28654 2019-02-21 12:04:23 +03:00
Dmitriy Novozhilov
f186c83b15 KT-25383 fix 2019-02-21 12:04:23 +03:00
Ilya Gorbunov
7b55e72583 Remove dead teardown code for builtins uninvalidation in tests
VirtualFile.isStdLibFile always returns false, therefore unInvalidateFile is never executed

See also commit 358e64fdb
2019-02-20 19:14:31 +03:00
Natalia Selezneva
254374c619 Use ModuleInfo in VirtualFileFinder to add script dependencies in search scope
Otherwise it prevent to inline functions from those dependencies during scratch compilation
2019-02-20 18:36:38 +03:00
Natalia Selezneva
f3c828a17d Get platform for scripts from script definition
Introduce 'platform' property in KotlinScripDefinition (should have a value which exists in TargetPlatform.ALL_KINDS)

^KT-27684 Fixed
2019-02-20 15:59:44 +03:00
Shagen Ogandzhanian
0188cd5330 Publish npm artifacts over encrypted connection
https://youtrack.jetbrains.com/issue/KT-29988
2019-02-20 13:22:25 +01:00
LepilkinaElena
39bdc1cc2c Change short form of flag name to full one for cinterop tool (#2117) 2019-02-20 15:14:08 +03:00
Alexander Udalov
946acd2416 Minor, ignore test for JVM_IR
It started to fail with AssertionError in inlineOnly.kt after
d267f1e875 because "$annotations" methods have annotations from the
corresponding property (which can include InlineOnly), but are never
inline. The test will be unmuted as soon as we stop using wrapped
descriptors in the IR backend to determine access flags which should be
generated on a declaration in the bytecode
2019-02-20 10:56:14 +01:00
Ilya Matveev
588236391e Build: Fix Kotlin/Native composite build 2019-02-20 12:14:17 +03:00
Igor Chevdar
1d0fdd7976 [IR] Some fixes to wrapped descriptors 2019-02-20 10:39:30 +05:00
Yaroslav Russkih
9ac52fad17 Use https everywhere - documentation and samples 2019-02-19 21:35:36 +01:00
Yaroslav Russkih
028a311949 Use https everywhere - tests and test data 2019-02-19 21:35:36 +01:00
Yaroslav Russkih
7135f1972a Use https everywhere - production code 2019-02-19 21:35:36 +01:00
Vyacheslav Gerasimov
7d5158c439 Build: Fix internal api usage in DistModelBuilder
MapFileTree interface changed in gradle 5.1
2019-02-19 20:06:24 +03:00
Vyacheslav Gerasimov
f8266a5109 Build: Update gradle version to 5.1 2019-02-19 20:06:24 +03:00
Alexander Udalov
d267f1e875 JVM IR: generate synthetic $annotations methods for properties 2019-02-19 17:25:47 +01:00
Alexander Udalov
c92c50aa98 JVM IR: generate JVM signatures of companion object properties 2019-02-19 16:37:47 +01:00
Alexander Udalov
c357967c2c JVM IR: generate Kotlin metadata
Introduce MetadataSource as a way to store the original descriptor for
any element (before any lowerings) and maintain it until the end of the
codegen where it's used in generating the metadata. Note that JVM
signatures written to the metadata are formed from the _resulting_
generated elements, not by mapping the original descriptors.

Some corner cases are not supported yet, namely properties declared in
companion objects, synthetic methods for property annotations,
JvmPackageName, etc.

 #KT-29119 Fixed
2019-02-19 16:37:47 +01:00
Alexander Udalov
3d1858a8c5 Refactor and rename CodegenUtil.getDeclarationsToGenerate
Move logic regarding expect classes to the only relevant call site at
PackageCodegenImpl, and return the list of members to remove code
duplication at remaining call sites
2019-02-19 16:37:46 +01:00
Alexander Udalov
4487c7a988 JVM IR: rename private fields for properties with same name
This is needed to get rid of the code that appends "$companion" to
properties moved from companion, because it caused inconsistencies in
the ABI and in JVM signatures stored in the metadata
2019-02-19 16:37:46 +01:00
Nikolay Krasko
b4571fd548 Minor: cleanup tests in org.jetbrains.kotlin.idea.navigation 2019-02-19 18:27:50 +03:00
Toshiaki Kameyama
80e1fc2ace Navigation to implementation / overriding method: do not show method of inline class twice
#KT-28661 Fixed
#KT-26924 Fixed
2019-02-19 18:27:50 +03:00
Ilmir Usmanov
aa9ce7b2e9 Minor. Update test data 2019-02-19 18:09:23 +03:00
Mads Ager
057bdb3954 Generate better code for branches based on comparisons.
For comparison intrinsics and for instanceof checks, make
it possible to get the the stack value produced and branch
on that directly instead of materializing a boolean to
branch on from it.

That reduces code such as

```
    IF_CMPEQ L1
    CONST_0
    GOTO L2
L1: CONST_1
L2: IFEQ L3
```

to just one IF_CMP instruction.
2019-02-19 15:46:52 +01:00
Leonid Startsev
7d2c59fb70 Fix missing optionality of property when generating descriptor in Native 2019-02-19 15:52:04 +03:00
Leonid Startsev
8b16801f0d Insert correct offsets in a lot of places in IR
Use correct type arguments when invoking a generic functions
Fix missing parent in initializer
2019-02-19 15:52:04 +03:00
Leonid Startsev
66272bfa74 Fix impossibility to make @Optional field in a class hierarchy on JS 2019-02-19 15:52:04 +03:00
Leonid Startsev
18667a5a34 Add validator for unique serial names 2019-02-19 15:52:04 +03:00
Leonid Startsev
36e1d6668b Make write$Self a static function 2019-02-19 15:52:04 +03:00
Leonid Startsev
7c942af13d Add synthetic companion with .serializer() getter even if default serializer is overridden. (kotlinx.serialization/228) 2019-02-19 15:52:04 +03:00
Leonid Startsev
1e440efc01 Ban primitive arrays in JVM codegen too (fixes kotlinx.serialization/260) 2019-02-19 15:52:04 +03:00
Leonid Startsev
5231ef9966 Don't generate writeSelf/internal constructor if corresponding serialize/deserialize aren't auto-generated 2019-02-19 15:52:04 +03:00
Leonid Startsev
a6651fd6f9 Call superclass deserialization constructor if superclass is also internal serializable or no-arg ctor of non-serializable class on Native and JS 2019-02-19 15:52:04 +03:00
Leonid Startsev
e02cfcb8ea Replace @Optional with @Required 2019-02-19 15:52:04 +03:00
Leonid Startsev
04706f4473 Support classes with more than 32 serializable properties
Via increasing count of int bit masks in synthetic constructor
2019-02-19 15:52:04 +03:00
Leonid Startsev
08f983ef52 Semantic change:
Now properties with default values are @Optional by default, and properties without backing fields are @Transient by default.
2019-02-19 15:52:04 +03:00
Leonid Startsev
cca03e9586 Make enums and interfaces not serializable internally. However, they
still can be serialized using custom companion object.
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/138 and https://github.com/Kotlin/kotlinx.serialization/issues/304
2019-02-19 15:52:04 +03:00
Nikolay Krasko
c41d6c427d Fix flaky navigation tests by refreshing file system before find 2019-02-19 15:42:32 +03:00
Mads Ager
e9ec8e2cee JVM_IR: Do not generate annotations on $default methods. 2019-02-19 13:23:42 +01:00
Mikhael Bogdanov
19d2bac2f8 Temporary disable test in IR 2019-02-19 13:05:05 +01:00
Toshiaki Kameyama
8cdf901538 Keyword completion: do not suggest const except inside top level or object
#KT-23026 Fixed
#KT-29840 Fixed
2019-02-19 14:57:44 +03:00
Mikhail Glukhikh
7d809bc1d5 Fix 181 compilation (AbstractFirResolveWithSessionTestCase)
We could fix it better, but anyway FIR & its tests aren't important
for this branch
2019-02-19 14:33:47 +03:00
Mikhail Glukhikh
7952249cd9 FIR: prevent SDK leak error in total kotlin IDE test
Related to KT-24077
2019-02-19 14:12:43 +03:00
Mikhail Glukhikh
2bc22fc2a6 FIR: fix Gradle configurator exception in total IDE test 2019-02-19 14:12:26 +03:00
Simon Ogorodnik
a6297f5f2f Refactor FIR total resolve in IDE test fixing various problems
Related to KT-24077
2019-02-19 14:11:43 +03:00
Simon Ogorodnik
5cef869d36 FIR: add symbol provider for IDE #KT-24097 Fixed
Functions & properties aren't yet supported
2019-02-19 14:11:11 +03:00
Mikhail Glukhikh
12ee81358c FIR: Add total resolve test in IDE mode (related to KT-24077) 2019-02-19 14:02:01 +03:00
Toshiaki Kameyama
779d536605 Redundant getter: fix false positive for 'external' getter
#KT-29416 Fixed
2019-02-19 13:03:11 +03:00
Mikhael Bogdanov
3b57ceeafe Don't generate annotations on $default methods
#KT-29965 Fixed
2019-02-19 10:51:37 +01:00
Mikhael Bogdanov
a020170a92 Report missed INLINE_FROM_HIGHER_PLATFORM diagnostic for derived class
Inline function descriptor in derived class represented as FAKE_OVERRIDE.
 So we should find it in base class declaration
 (not interface cause inline function can't be virtual, but always final)
 and then check class version.

 #KT-29402 Fixed
2019-02-19 10:51:36 +01:00
Mikhael Bogdanov
b03065b2ba Minor. Reformat 2019-02-19 10:51:35 +01:00
Kirill Shmakov
b844e587ed Fix KT-29804: rename app -> main
#KT-29804 Fixed
Reviewed at KOTLIN-CR-2735
2019-02-19 12:14:34 +03:00
Sergey Rostov
db8f423880 JPS Build, update artifacts: fix js stdlib, remove stdlib-jdk7 and 8 2019-02-19 11:39:53 +03:00
hisaaki.sioiri
f1cc7cecce Escaping quotes in live-templates (KT-2387)
#KT-2387 Fixed
2019-02-19 11:18:13 +03:00
Toshiaki Kameyama
7149d4cd1c Group by file structure: show groups on text search (KT-28838)
#KT-28838 Fixed
2019-02-19 11:18:13 +03:00
Stanislav Erokhin
76f2430e7c Code of Conduct for Kotlin project 2019-02-19 11:04:37 +03:00
Toshiaki Kameyama
5f7dee4194 Convert to scope function: enable on single function call
#KT-29099 Fixed
2019-02-19 10:41:20 +03:00
Dmitry Petrov
e1fdf0aa43 KT-29959 fix IR generation for 'd.m = e' 2019-02-19 09:59:42 +03:00
Mikhail Glukhikh
7f9b3a98b4 Fix corner cases (no expression, not resolved label) in raw FIR builder 2019-02-19 09:54:39 +03:00
Mikhail Glukhikh
552b137852 FIR: get rid of fictitious function symbols 2019-02-19 09:54:37 +03:00
Mikhail Glukhikh
74d89b1be2 JavaSymbolProvider: support different kinds of literals in annotations
Constants, enum entries, class references, arrays are covered here
Related to KT-29218
2019-02-19 09:54:34 +03:00
Mikhail Glukhikh
f8e165dbe4 Integrate nullability into cone types, add & use FIR flexible type
FIR fake overrides are rendered now more precisely to test this process
2019-02-19 09:54:32 +03:00
Mikhail Glukhikh
3d77f3d129 Fix rendering of ConeClassErrorType
This commit fixes total kotlin resolve test
2019-02-19 09:54:30 +03:00
Simon Ogorodnik
9ebefa3ba6 FIR: make FunctionType class-like, refactor built-ins resolution
This breaks total kotlin resolve test because of incorrect rendering
of ConeClassErrorType (we are trying to read its symbol)
2019-02-19 09:54:28 +03:00
Simon Ogorodnik
3edd82b602 FIR: make JavaSymbolProvider return error-type on not found symbols 2019-02-19 09:54:26 +03:00
Simon Ogorodnik
5afb0a6f4a FIR rename: FirType -> FirTypeRef and related 2019-02-19 09:54:24 +03:00
Mikhail Glukhikh
1c76a612f9 FIR rename: isNullable -> isMarkedNullable 2019-02-19 09:54:21 +03:00
Simon Ogorodnik
3a237416c9 Implement FIR loading for Java (classes, supertypes, parameters, funs)
Properties aren't implemented yet
FIR symbol provider functions return more specialized types now
Related to KT-28918, KT-29636, KT-29218

#KT-28788 Fixed
2019-02-19 09:54:20 +03:00
Mikhail Glukhikh
4ea3df53cc Implement FIR loading for libraries (classes, supertypes, parameters)
Members aren't implemented yet
Related to KT-28788, KT-28918
2019-02-19 09:54:18 +03:00
Mikhail Glukhikh
0bef9f2afe Rename in FIR provider: getSymbolByFqName -> getClassLikeSymbolByFqName 2019-02-19 09:54:17 +03:00
Simon Ogorodnik
bd769f8fd7 Add multiplatform test with substitution, fix deep supertypes
This commit fixes ambiguity problems introduced before
in MPP tests with deep supertypes

#KT-29636 Fixed
2019-02-19 09:54:16 +03:00
Simon Ogorodnik
0e3fecf614 Implement fake override mapping for functions
Related to KT-29636
2019-02-19 09:53:33 +03:00
Mikhail Glukhikh
1f5e89cd32 Disable JavaElementFinder in FIR tests to avoid old FE 2019-02-19 09:52:20 +03:00
Simon Ogorodnik
840750ee40 Implement basic use-site scopes and override mapping
This commit also introduces separate scope processors:
processFunctionsByName and processPropertiesByName, in addition to
existing processClassifiersByName

Ad-hock call resolver starts to discover ambiguities, which leads
to some ambiguity problems in MPP tests with deep supertype hierarchy

Related to KT-29636
2019-02-19 09:52:20 +03:00
Mikhail Glukhikh
6ea2abfc46 FIR override resolve: lookup also interfaces 2019-02-19 09:52:20 +03:00
Mikhail Glukhikh
b3c8e83c58 FIR: make override resolve in use-site session (and module)
Related to KT-24078
2019-02-19 09:52:19 +03:00
Mikhail Glukhikh
84b3a17e2b Type resolve transformer: reorder tower scope
This commit prioritizes inner scopes above outer scopes
(before this commit, inner scopes had lowest priority).
NB: really it's not precise enough too,
because explicit importing scope should have higher priority
than inner scopes.
Also fixes problem with total Kotlin resolve test introduced
in previous commit.
2019-02-19 09:52:19 +03:00
Mikhail Glukhikh
bec62acf5b FIR: introduce callable member symbols & initial member scopes
Initial member scopes cover top-level, class-level, and  supers

Ad-hock version of call resolve was introduced to test them
NB: after this commit, total Kotlin resolve test cannot finish
because of scope problems in type resolve transformer

Related to KT-24078
#KT-24083 Fixed
2019-02-19 09:52:19 +03:00
Mikhail Glukhikh
95678a4d64 Extract FirAbstractTreeTransformer and *WithSuperTypes 2019-02-19 09:52:19 +03:00
Mikhail Glukhikh
0e179f6b44 Extract FirAbstractProviderBasedScope & fix potential KNPE 2019-02-19 09:52:19 +03:00
Dmitriy Dolovov
83cb2cb99e CIDR: Patch LLDB pretty printers for K/N < 1.1.1
Issue #KT-29625 Fixed
2019-02-19 10:49:08 +07:00
Ilya Gorbunov
ce577ac06b Minor: remove redundant imports in sample 2019-02-18 21:09:18 +03:00
Kevin Peek
565727e302 KT-20357 - Add sample for Regex.findAll() 2019-02-18 21:05:46 +03:00
Kirill Shmakov
a8777a8bb3 Add forgoten file 2019-02-18 20:57:28 +03:00
Kirill Shmakov
478c18f194 Move data of handmade test from auto-generated tests data dir
KT-29187
2019-02-18 20:36:26 +03:00
Vyacheslav Gerasimov
2bec617446 Build: Fix npmInstall task inputs validation problem
NpmInstall task adds $nodeModulesDir/package.json to input and fails validation with:
 "File '.../package.json' specified for property '$1' does not exist."
2019-02-18 20:00:05 +03:00
Vyacheslav Gerasimov
333eb9701c Build: Fix JPS importer (DistModelBuilder) for Gradle 5.0 2019-02-18 20:00:05 +03:00
Vyacheslav Gerasimov
3d0cd57e31 Build: Drop testDistProjects, root :dist task was already in list 2019-02-18 20:00:05 +03:00
Vyacheslav Gerasimov
a4cfd37203 Minor: Reformat dependencies.kt 2019-02-18 19:59:37 +03:00
Vyacheslav Gerasimov
294ba51d0b Build: Drop obsolete dependency handlers 2019-02-18 19:59:37 +03:00
Vyacheslav Gerasimov
25128f07f2 Build: Reformat artifacts.kt & fix some warnings, drop some dead code 2019-02-18 19:59:37 +03:00
Vyacheslav Gerasimov
14d9ec9fb2 Build: Use javadocJar helper to specify artifact explicitly
Creating javadocJar task for every project produces lots of unnecessary
tasks, some project don't even have code. Jar task without outDir
property set fails idea import with gradle 5.0+
2019-02-18 19:59:36 +03:00
Vyacheslav Gerasimov
e09802289d Build: Workaround SOE in kotlin-stdlib-common-sources
Probably gradle bug
2019-02-18 19:58:57 +03:00
Sergey Igushkin
2a14301c75 Fix Gradle plugin build with Gradle 5.0
* Due to 'improved POM support' introduced in 5.0, runtime dependencies
of the `compileOnly 'com.android.tools.build:gradle:...'` dependency
were no more transitively available. Add them manually;

* Add `!!` to usages of `resourcesDir`, which became nullable;

* Replace the dropped `classesDir` method usages with reflection;
2019-02-18 19:58:57 +03:00
Vyacheslav Gerasimov
e8f1e2d022 Build: Use latest version of build-scan plugin 2019-02-18 19:58:57 +03:00
Vyacheslav Gerasimov
7e1f64b712 Build: Fix generateVisitors task outputs 2019-02-18 19:58:56 +03:00
Vyacheslav Gerasimov
d32f6fb382 Build: Fix compatibility with shadow plugin
Apply java-base plugin since shadow task requires sourcesets
2019-02-18 19:58:56 +03:00
Vyacheslav Gerasimov
df9ca1b6d9 Build: Update shadow plugin version to 4.0.3 2019-02-18 19:58:56 +03:00
Vyacheslav Gerasimov
f2bf33fe2a Build: Update gradle version to 5.0 2019-02-18 19:58:56 +03:00
Ilya Gorbunov
5cc2215338 Extend compileOnly configuration from builtins
to avoid adding builtins configuration to classpath manually
2019-02-18 19:30:24 +03:00
Ilya Gorbunov
441e7cc15d Always use singleFile when passing a configuration as a zipTree parameter 2019-02-18 19:30:24 +03:00
Ilya Gorbunov
6bcd112062 Drop obsolete artifact kotlin-runtime
Remove suppresses used to compile some parts of stdlib
as a non-multiplatform project.
2019-02-18 19:20:30 +03:00
Ilya Gorbunov
8ed2facc8c Remove integration test involving kotlin-stdlib-jre7/8 2019-02-18 18:45:20 +03:00
Ilya Gorbunov
811566bbe0 Drop obsolete artifacts kotlin-stdlib-jre7/8 2019-02-18 18:44:35 +03:00
Dmitry N. Petrov
4e05c2305e Merge pull request #2121 from jimgoog/mutable-origin
Make IrDeclaration.origin mutable
2019-02-18 16:48:50 +03:00
Toshiaki Kameyama
8e61a13809 Move lambda argument out of parentheses: fix false negative when function type is type parameter
#KT-26979 Fixed
2019-02-18 16:48:11 +03:00
Toshiaki Kameyama
b4789b95ef Rename: fix renaming of label by label reference in loop
#KT-29796 Fixed
2019-02-18 15:12:39 +03:00
Nicolay Mitropolsky
76bdfddfea Making KotlinAnnotatedElementsSearcher able to search for parameters (KT-27794) 2019-02-18 14:08:09 +03:00
Simon Ogorodnik
2b9cf06c3f Enable debug log for PerModulePackageService only in J2K 2019-02-18 13:42:12 +03:00
Nikolay Krasko
9a99f832e5 Fix blinking parameter info popup for nested places (KT-29574)
#KT-29574 Fixed
2019-02-18 13:25:45 +03:00
Nikolay Krasko
5f7815bd54 Attempt to fix invalid element exception at suppress intention (EA-135693) 2019-02-18 13:25:44 +03:00
Nikolay Krasko
8a97cd3a15 Fix PIEAE on getting current editor (EA-135969) 2019-02-18 13:25:44 +03:00
Nikolay Krasko
16ff522cd3 Check element disposed before getting component in migration (EA-134713)
Check if it can reduce the exceptions rate and check for deeper exceptions.
2019-02-18 13:25:44 +03:00
Dmitriy Novozhilov
d1b7c0f683 Fix testdata for try/catch inference and DFA 2019-02-18 12:43:42 +03:00
Dmitriy Novozhilov
8fc7b4436b Revert "Temporary fix to compile project with the snapshot compiler"
This reverts commit acb83f1a
2019-02-18 12:43:42 +03:00
Dmitriy Novozhilov
5d0074bda5 Fix bug in try/catch resolution in NI
Bug was presented in a236ad5
2019-02-18 12:43:42 +03:00
Ilmir Usmanov
1e4b7e1ef1 Put $assertionDisabled field into inline-site's class
The generated code is more inline with java, and we avoid the error of
accessing package-private field outside of the package.
However, this changes semantics a bit. Now, a user should set assertion
status of inline-site's package, instead of inline function's one.
 #KT-28317: Fixed
2019-02-18 12:39:03 +03:00
Mikhail Zarechenskiy
acb83f1af1 Temporary fix to compile project with the snapshot compiler
The problem is in NI and can relate to a236ad5686
2019-02-18 11:45:02 +03:00
Dmitriy Dolovov
45f028d353 CIDR: Avoid Java errors during KTS analysis in CIDR
There is no Java support in CIDR. Therefore:
- analyze KTS in CIDR using Common platform
- disable error highlighting for KTS in CIDR

Issue #KT-29953 Fixed
2019-02-18 11:27:31 +07:00
Dmitriy Novozhilov
a4d6f72ad1 Split testdata of #KT-25432 and #KT-29767 2019-02-17 13:03:01 +03:00
Dmitriy Novozhilov
49a42f9434 Fix #KT-28999. Prohibit type parameters on anonymous objects 2019-02-17 13:02:22 +03:00
Dmitriy Novozhilov
11e5ddf9ae Add test for #KT-28999 2019-02-17 13:02:22 +03:00
Dmitriy Novozhilov
4a298d1413 NI: introduce new data flow analysis for try/catch (#KT-28370) 2019-02-17 12:51:25 +03:00
Dmitriy Novozhilov
a236ad5686 NI: resolve try catch as synthetic function call (#KT-25435 fixed) 2019-02-17 12:46:11 +03:00
Dmitriy Novozhilov
4e64b07727 Add some tests for inference and DFA of try/catch/finally 2019-02-17 12:46:11 +03:00
Dmitriy Novozhilov
8d3271cc68 Refactor if expressions resolving
Context without expected type became redundant after synthetic
  call resolving was added for inference of `if` expression type

`isStatement` flag removed, because it was effectively unused
2019-02-17 12:46:11 +03:00
Dmitriy Novozhilov
1a1375240b Minor: reformat PSICallResolver according to codestyle 2019-02-17 12:46:11 +03:00
Andrey Uskov
a106085e67 Update kotlin gradle plugin used in import tests 2019-02-17 12:42:31 +03:00
Andrey Uskov
b5e6752656 Migrate import tests of composite MPP build to new version of MPP 2019-02-17 12:42:15 +03:00
Andrey Uskov
ed87a4a00d Add memory leak detection in import tests 2019-02-17 12:41:21 +03:00
Andrey Uskov
3a27192241 Remove dependency on dev version of gradle plugin in import tests 2019-02-17 12:41:04 +03:00
Andrey Uskov
ec9ee8ce40 Remove platform 173 in build script bunch 2019-02-17 12:40:50 +03:00
Andrey Uskov
6dee81f653 Cleanup Kotlin SDK in MavenImportingTestCase 2019-02-17 12:39:23 +03:00
Andrey Uskov
7890037d90 Move KotlinSdkCreationChecker to idea-test-framework module 2019-02-17 12:38:59 +03:00
Andrey Uskov
ec08d0bc27 Minor. Get rid of KotlinMavenImporter bunch 2019-02-17 12:30:29 +03:00
Andrey Uskov
b3593e87c0 Create Kotlin SDK for non-MPP JS projects
#KT-29467 Fixed
2019-02-17 12:30:06 +03:00
Andrey Uskov
8063c6511c Create Kotlin SDK on reopen project for native platform
#KT-29464 Fixed
2019-02-17 12:29:42 +03:00
Andrey Uskov
9a5fe43468 Create Kotlin SDK action moved to pooled thread
#KT-29551 Fixed
2019-02-17 12:29:24 +03:00
Andrey Uskov
59bcd608a1 Minor. Remove useless code related to IJ 173 and AS 3.1 in build scripts 2019-02-17 12:29:01 +03:00
Andrey Uskov
52be952fb7 Refactor gradle importing tests. Add possibility to test various
versions of gradle kotlin plugin
2019-02-17 12:28:19 +03:00
Andrey Uskov
5c82daf7a1 Improve bunches of GradleImportingTestCase 2019-02-17 12:27:33 +03:00
Jim S
47d63fc9be Make IrDeclaration.origin mutable 2019-02-16 09:55:03 -08:00
Yan Zhulanow
a7ea252973 Refactoring: Split KotlinCoreEnvironment setup functions for Android Lint 2019-02-15 21:23:27 +03:00
Yan Zhulanow
1fbf51ea13 Kapt: Ignore imports for enum entries on import conversion (KT-28220) 2019-02-15 21:23:27 +03:00
Yan Zhulanow
87cad2af02 Kapt: Fix "no interface expected here" in class implementing interface with secondary constructor (KT-27506) 2019-02-15 21:23:27 +03:00
Yan Zhulanow
a9eaf1c345 Pill: Rename Pill configurations, make its name not capital 2019-02-15 21:23:27 +03:00
Yan Zhulanow
770a2e3f2d Attach expect sources to all source set tasks (KT-26977)
If kapt is enabled, there are several Kotlin compilation tasks for one source set (stub generator + compile). We should attach the expect sources to all of them.
2019-02-15 21:23:26 +03:00
Yan Zhulanow
1c824655d4 Kapt: Fix supertype conversion for DefaultImpls (KT-28306) 2019-02-15 21:23:26 +03:00
Ting-Yuan Huang
3a768060ca Skip annotation processing when there's no AP specified
This also fixes KT-29302 where stub generation is skipped while the
subsequent annotation processing phase anticipates the generated stubs.

This patch addresses cases where kapt.use.worker.api=true. The cases
where kapt.use.worker.api=false are handled in the same place of stub
generation.
2019-02-15 21:23:25 +03:00
Yan Zhulanow
53fa647d41 Revert "Kapt: Do not treat initially empty configurations specially (KT-27404)" (KT-29481)
This partially reverts commit 2cb2141e07.
2019-02-15 21:23:25 +03:00
Yan Zhulanow
0444203b9b Ignore non-jar files in ServiceLoaderLite (KT-29513) 2019-02-15 21:23:25 +03:00
Yan Zhulanow
15a316ff90 Fix keyword completion for code fragments (KT-28680) 2019-02-15 21:23:25 +03:00
Yan Zhulanow
088b89b534 Pill: Add a dependency to backend.ir, fix JPS build 2019-02-15 21:23:25 +03:00
Alexander Udalov
f2bf81e799 Fix UOE when using Java annotation with infinity/NaN as default value
The root problem is the fact that ConstantExpressionEvaluator returns
null for values such as infinity and NaN loaded from cls psi (see
IDEA-207252). This commit simply reverts a part of 8ab9226805 where we
started to compute default values more often than needed. In
LazyJavaClassMemberScope, we only need to check whether or not there
_is_ a default value, not compute its value.

 #KT-29792 Fixed
2019-02-15 19:13:53 +01:00
Alexander Udalov
b2cdf2dc74 Simplify AnnotationSplitter creation and target set computation 2019-02-15 17:53:27 +01:00
Alexander Udalov
4692247897 Do not check backing field presence in AnnotationSplitter
This code can be invoked early, during body resolution and before the
fact that a property has backing field (which is only known for certain
after body resolution, because an implicit 'field' identifier may be
used). Since split annotations are cached until the end of the program,
they may end up on incorrect elements in the bytecode (or disappear
completely) as in KT-29507 or KT-28182.

Because the FIELD target has the lowest priority among implicit
annotation targets (see TARGET_PRIORITIES), it's safe to always assume
that FIELD is a valid target when splitting annotations. This only
changes the way annotations are split in case of incorrect code, as
changes in test data show.

 #KT-28182 Fixed
 #KT-29507 Fixed
2019-02-15 17:53:27 +01:00
Kirill Shmakov
5595a2dd1b Add highlighting for exceptions stacktrace on Mac
KT-29817
Review: KOTLIN-CR-2722
2019-02-15 18:33:14 +03:00
Dmitry Petrov
08de82db85 Added tests for KT-29833 2019-02-15 16:25:16 +03:00
Dmitry Petrov
4c3d0cd9d7 KT-29861 startOffset/endOffset for 'valueOf' function of enum class 2019-02-15 16:25:16 +03:00
Dmitry Petrov
1b0d410a6f KT-29862 startOffset of class declaration
NB startOffset of primary class constructor declaration should still
point to the 'class' keyword (because of debugger requirements).
2019-02-15 16:25:16 +03:00
Natalia Selezneva
92a160e6c3 Fix navigation to buildSrc from scripts
buildSrc folder should be placed under project dir (root or included project)
^KT-29707 Fixed
2019-02-15 16:06:55 +03:00
Natalia Selezneva
830973a93c Fix "Multiple Script Definitions" notification for settings.gradle.kts
^KT-29832 Fixed
2019-02-15 16:06:55 +03:00
Natalia Selezneva
d8080f205c Always scan root for script templates in background
^KT-29893 Fixed

Provide AsyncScriptDefinitionsContributor.
Show a notification if the highlighting for script is requested when not all script templates are loaded
2019-02-15 16:06:54 +03:00
Natalia Selezneva
00cd6a698d Do not run multiple script dependencies updates if dependencies weren't saved yet
^KT-29770 Fixed
2019-02-15 16:06:54 +03:00
Natalia Selezneva
8918a83fb4 Unify cache size for script dependencies 2019-02-15 16:06:54 +03:00
Natalia Selezneva
abc2dbba39 Minor: fix typo in package name 2019-02-15 16:06:54 +03:00
Natalia Selezneva
889396ec27 Cache 10 + 5 scripts in KotlinCacheService
This may be useful for find usages (and inspections that uses it) of declaration from buildSrc which may be used in several scripts
2019-02-15 16:06:54 +03:00
Natalia Selezneva
74909c4d09 Do not run unused symbol inspection if declaration in used in more than 3 scripts 2019-02-15 16:06:53 +03:00
Ilya Chernikov
c29332e290 Regenerate tests 2019-02-15 13:15:47 +01:00
Toshiaki Kameyama
cd13648906 Object literal can be converted to lambda: report if "return" is only one and is in the last statement
#KT-29763 Fixed
2019-02-15 13:52:19 +03:00
Ilya Matveev
7c3c21790b Fix subplugin options for K/N 2019-02-15 13:37:16 +03:00
Nicolay Mitropolsky
2678ada5ae 191: AbstractModelBuilderTest: addExtraProjectModelClasses was removed in platform 2019-02-15 11:39:54 +03:00
Dmitriy Dolovov
375697c413 User friendly presentation of KLIBs in IDEA
Missed fixes in 181 bunch
2019-02-15 15:32:22 +07:00
Dmitriy Dolovov
05323f8a30 CIDR: Avoid exception in JavaDocumentationProvider
as there is no Java support in CIDR
2019-02-15 11:12:28 +07:00
Nicolay Mitropolsky
a29bf61d05 191: fix for KotlinUastReferencesTest reference target assertion added in 191 2019-02-14 20:44:17 +03:00
Ilmir Usmanov
d269ff8ac8 Update test data 2019-02-14 18:33:20 +03:00
Ilmir Usmanov
19d2262cf1 Generate call of throwOnFailure instead of manual check
whether coroutine is resumed with exception.
 #KT-28015 Fixed
2019-02-14 18:33:17 +03:00
Nikolay Krasko
7c83d5df93 Move queue back to class instance after bad refactoring in search package
Relevant commit: 7f1e7cc461
2019-02-14 18:26:55 +03:00
Dmitry Gridin
33954c7632 Add inspection to move the variable declaration into when
#KT-29001 Fixed
2019-02-14 17:45:53 +03:00
Nikolay Krasko
7abe9333c8 Minor: remove deprecated usages of PsiSearchHelper.SERVICE 2019-02-14 17:23:49 +03:00
Nikolay Krasko
7f1e7cc461 Minor: reformat and cleanup org.jetbrains.kotlin.idea.search package 2019-02-14 17:23:49 +03:00
Nikolay Krasko
16c79b562e Minor: cleanup warnings in KotlinFunctionParameterInfoHandler.kt 2019-02-14 17:23:49 +03:00
Nicolay Mitropolsky
a3bd70a76e KotlinDeclarationSearcher: return backing fields for parameters (KT-29034) 2019-02-14 17:12:17 +03:00
Dmitry Petrov
6aff53204f psi2ir: support dynamic infix calls ('foo bar 42' is 'foo.bar(42)') 2019-02-14 16:03:11 +03:00
Dmitry Petrov
740d5ec468 Mute some tests in JS_IR after adding basic dynamic expressions support 2019-02-14 16:03:11 +03:00
Dmitry Petrov
77cbd10f9c psi2ir: don't generate temporaries in dynamic array augmented assignment
In constructs such as 'd[i] += x', where both indexed get and indexed
set are dynamic calls, it's safe to generate augmented assignment body
directly, without temporary variables for array ('d') and index ('i').
Note that corresponding IntermediateValue's are OnceExpressionValue's,
which would throw an exception if this assumption is violated.
2019-02-14 16:03:11 +03:00
Dmitry Petrov
580eb6fcac JS_IR: support dynamic expressions in block decomposition 2019-02-14 16:03:11 +03:00
Dmitry Petrov
03c35a4f44 JS_IR: support dynamic expressions in JS tree generation 2019-02-14 16:03:11 +03:00
Dmitry Petrov
4cee8c6f00 Minor: fix IrDynamicOperatorExpressionImpl double dispatch methods 2019-02-14 16:03:11 +03:00
Dmitry Petrov
5b4b22a8b6 psi2ir: additional tests for dynamic expressions: '?:', '!!' 2019-02-14 16:03:11 +03:00
Dmitry Petrov
83b2fed5be psi2ir: minor: drop unused import 2019-02-14 16:03:11 +03:00
Dmitry Petrov
6889e470d1 psi2ir: minor: move array access generation code 2019-02-14 16:03:11 +03:00
Dmitry Petrov
50269d3a5c psi2ir: minor: simplify code for dynamic array element assignment 2019-02-14 16:03:11 +03:00
Dmitry Petrov
cf29dce4c2 pri2ir: dynamic unary & binary expressions
NB1 Not every dynamic unary or binary expression is translated to
dynamic operator expressions literally. For example, assignments and
increments can have safe calls in LHS, which require some extra logic.

NB2 There are some open design questions left regarding how dynamic
expressions should actually be translated.
2019-02-14 16:03:11 +03:00
Dmitry Petrov
82701de87b psi2ir: minor: drop some unused params/imports 2019-02-14 16:03:11 +03:00
Dmitry Petrov
fbbe4f6e92 psi2ir: dynamic array element get/set 2019-02-14 16:03:11 +03:00
Dmitry Petrov
9a2bd5f4e6 psi2ir: dynamic member simple assignment/augmented assignment/++/-- 2019-02-14 16:03:11 +03:00
Dmitry Petrov
fc76d0970b psi2ir: Implicit casts with 'dynamic' 2019-02-14 16:03:11 +03:00
Dmitry Petrov
3c8f52b436 psi2ir: simple dynamic member calls 2019-02-14 16:03:11 +03:00
Dmitry Petrov
ddb1ea2047 psi2ir: dynamic member access ('d.x', 'd?.x') 2019-02-14 16:03:11 +03:00
Dmitry Petrov
6e7ccfbfff Introduce IrDynamicExpression and children
Dynamic expressions are represented as either operator expressions -
e.g., `d1 + d2`, `d[e]`, `d(e1, e2, e3)`, `d += e` -
where "operator" is a one of the known operators,
or as member reference expressions - e.g., `d.memberName` - where
member name is some arbitrary name (unresolved at compile-time and
represented as String).
2019-02-14 16:03:11 +03:00
Anton Bannykh
f8dc6763bd JS: minor review fixes 2019-02-14 15:14:28 +03:00
Anton Bannykh
4e298ae5cb JS: Inlined local declarations should be positioned after imports 2019-02-14 15:14:28 +03:00
Anton Bannykh
0bfd332580 JS: improve a test (review fix) 2019-02-14 15:14:28 +03:00
Anton Bannykh
9ad1d8d054 JS: improve inline suspend function declaration splitter 2019-02-14 15:14:28 +03:00
Anton Bannykh
4b39e2df12 JS: (review fix) Header -> InlineData 2019-02-14 15:14:28 +03:00
Anton Bannykh
0fa87e3baa JS: advance IC version 2019-02-14 15:14:28 +03:00
Anton Bannykh
5c1664ebf8 JS: collect label definitions, not some of their usages 2019-02-14 15:14:28 +03:00
Anton Bannykh
b7bea3242e JS: fix fragment info loading
The very first fragment didn't got processed, thus inline cycle
reporter was not failing tests
2019-02-14 15:14:28 +03:00
Anton Bannykh
370194796e JS: fix synthethic name bindings for the inlined local declarations
TODO add synthetic order-based namebindings for inlined local
declarations AFTER all post-processings. This would be a more robust
approach imho
2019-02-14 15:14:28 +03:00
Anton Bannykh
32de99fe32 JS: review fixes 2019-02-14 15:14:28 +03:00
Anton Bannykh
8f68c47225 JS: support inline function definitions without wrappers
Apparently function literals are translated without hiding the local declarations
in the wrapFunction call.

Which makes sense. Apart from the fact that it would also make
sense to do the same for private inline functions and function
literals inside other inline functions.
2019-02-14 15:14:28 +03:00
Anton Bannykh
6e74c4ce71 JS: switch off the validator until class translation is fixed 2019-02-14 15:14:28 +03:00
Anton Bannykh
0daa6675bd JS: comments, review fixes 2019-02-14 15:14:28 +03:00
Anton Bannykh
1c67e4cf21 JS: simplify and fix the AST visitor code. 2019-02-14 15:14:28 +03:00
Anton Bannykh
11265f1424 JS: review fixes (renamings, etc.) 2019-02-14 15:14:28 +03:00
Anton Bannykh
990ee849e2 JS: test local declaration deduplication with name clash; fix the test 2019-02-14 15:14:28 +03:00
Anton Bannykh
60aa6e4971 JS: a cross-module local declaration fake override test;
Also describe an alternative, more robust approach in a TODO comment
2019-02-14 15:14:28 +03:00
Anton Bannykh
b4b406af99 JS: explain what validateJsAst does; enable validation in non-incremental tests 2019-02-14 15:14:28 +03:00
Anton Bannykh
a35fc4fa3c JS: use string table for module names and inline function tags 2019-02-14 15:14:28 +03:00
Anton Bannykh
d7499363bc JS: review fixes 2019-02-14 15:14:28 +03:00
Anton Bannykh
44dedf3a64 JS: minor refactoring 2019-02-14 15:14:28 +03:00
Anton Bannykh
396ec20788 JS: add constructor binding and inlining test 2019-02-14 15:14:28 +03:00
Anton Bannykh
92401f0561 JS: fix primary constructor name tag generation 2019-02-14 15:14:28 +03:00
Anton Bannykh
36fd4d24fb JS: move label renaming to new fragment post-processing
Also remove metadata renaming from the global passes
2019-02-14 15:14:28 +03:00
Anton Bannykh
6921d4d128 JS: minor 2019-02-14 15:14:28 +03:00
Anton Bannykh
2022a9c887 JS: fix inheriting fake overrides in inlined object literals 2019-02-14 15:14:28 +03:00
Anton Bannykh
9716abcc12 JS: inline private properties 2019-02-14 15:14:28 +03:00
Anton Bannykh
50aeeee462 JS: fix the test 2019-02-14 15:14:28 +03:00
Anton Bannykh
21cbc7b018 JS: add incremental test for local declarations change 2019-02-14 15:14:28 +03:00
Anton Bannykh
299a45ccbf JS: validate AST when serializing to IC cache 2019-02-14 15:14:28 +03:00
Anton Bannykh
e4b081e1bf JS: fix inline cycle reporting 2019-02-14 15:14:28 +03:00
Anton Bannykh
b5b770c804 JS: line number fix 2019-02-14 15:14:28 +03:00
Anton Bannykh
47a219eeff JS: refactorings & cleanup 2019-02-14 15:14:28 +03:00
Anton Bannykh
e76f80cbc6 JS: prevent duplicate imports inside inline function definition 2019-02-14 15:14:28 +03:00
Anton Bannykh
13844bd08e JS: FunctionReader cleanup 2019-02-14 15:14:28 +03:00
Anton Bannykh
6d5ef2d324 JS: fix long constants importing 2019-02-14 15:14:28 +03:00
Anton Bannykh
cd0fd569b4 JS: visit tests and main in import remover; update line numbers 2019-02-14 15:14:28 +03:00
Anton Bannykh
52b705e7ae JS: Fix local aliases
Local aliases can be copied as-is to a different fragment now. Before this change we would have had to extract the local alias tag (if any) from the source fragment and add to the destination fragment name bindings.
2019-02-14 15:14:28 +03:00
Anton Bannykh
3a258ad08a JS: fix module references in case of @JsModule annotation 2019-02-14 15:14:28 +03:00
Anton Bannykh
a1649e9e4d JS: fix import cleaner
The tag generated during the source file translation could differ from
the tag generated based on the import statement (e.g. "intrinsic:..."
during generation becomes "'Kotlin'...." later on).

This means that the same function imported from the start and imported
during inlining has different tags. Which makes duplicate import removal
trickier. The best solution would be to make sure the tag generation
algorithms are consistent.

Current solution: rewrite the tags in terms of the Inliner tag
generation algorithm right after the source file translation.

Also it seems that some `var` statements we treated as imports, even
though they were not. Supported this behavior for now.

TODO: Get rid of these workaround
2019-02-14 15:14:28 +03:00
Anton Bannykh
c1fbeeb7d9 JS: fix bugs 2019-02-14 15:14:28 +03:00
Anton Bannykh
a30c7fbee1 JS: Support imported wrapper serialization 2019-02-14 15:14:28 +03:00
Anton Bannykh
75668826d3 JS: simplification in process 2019-02-14 15:14:28 +03:00
Anton Bannykh
2cbdc7ecb0 JS: store whole JsImportedModule's in the module local alias
Module references were stored as plain JsName's. When inlining a function
from one fragment to another, those references should be re-interpreted
in terms of the destination fragment. Storing the whole module information
makes that much easier.
2019-02-14 15:14:28 +03:00
Anton Bannykh
a0ff581a2f JS: refactoring 2019-02-14 15:14:28 +03:00
Anton Bannykh
6d26bf9622 JS: don't load binary AST unless required by the inliner 2019-02-14 15:14:28 +03:00
Anton Bannykh
c83b6d46cc JS: split JsInliner 2019-02-14 15:14:28 +03:00
Anton Bannykh
c65383fa3f JS: postpone JS AST merging 2019-02-14 15:14:28 +03:00
Anton Bannykh
ec276dbea4 JS: convert JsInliner to Kotlin 2019-02-14 15:14:28 +03:00
Anton Bannykh
039625bb7e JS: convert K2JSTranslator to Kotlin 2019-02-14 15:14:28 +03:00
Anton Bannykh
1052ec898c JS: review fixes (mostly tests) 2019-02-14 15:14:28 +03:00
Anton Bannykh
3529114913 JS: incremental translation of tests and main fun invocation 2019-02-14 15:14:28 +03:00
Anton Bannykh
0397af79b4 JS: convert from java to kotlin JsProgramFragment 2019-02-14 15:14:28 +03:00
Toshiaki Kameyama
d583c1be58 Can be replaced with binary operator: do not suggest when receiver or argument is floating point type
#KT-28596 Fixed
2019-02-14 15:10:26 +03:00
Nicolay Mitropolsky
48619a49ed RenameKotlinPropertyProcessor made not update the property before all references are updated (KT-27602)
because otherwise language independent bean property references couldn't properly handle rename in some cases.

Groovy references were also affected by this bug because they weren't able to resolve to original property
2019-02-14 13:27:06 +03:00
victor.petukhov
2bcdadf17f Add positive diagnostic tests for smartcasts from nullability condition using if expression 2019-02-14 13:11:14 +03:00
Dmitriy Dolovov
75250cf1a0 User friendly presentation of KLIBs in IDEA
Adds friendly names for KLIBs imported as file dependencies from Gradle project.

Issue #KT-29613 Fixed
Issue #KT-29783 Fixed
2019-02-14 16:55:45 +07:00
victor.petukhov
06b5a42d0d Improve test exceptions fixation:
- exceptions is analyzed if it's specified explicitly only,
- compute test case number for diagnostic tests in which an exception is thrown.
2019-02-14 12:31:43 +03:00
victor.petukhov
317da3d481 Add NOTE and UNSPECIFIED BEHAVIOUR fields to spec tests 2019-02-14 12:31:43 +03:00
victor.petukhov
ec8a6cbe9c Alphabetical sort wrapped intersection types for rendered diagnostics 2019-02-14 12:31:43 +03:00
victor.petukhov
acd6d354dc Support several spec places to which tests are linked and require specify spec version for each test 2019-02-14 12:31:43 +03:00
victor.petukhov
cb5f497cbe Alphabetical sort wrapped intersection types for rendered diagnostics 2019-02-14 12:31:42 +03:00
victor.petukhov
30762a450a Wrap diagnostic parameters to double quotes and split by comma instead of semicolon 2019-02-14 12:31:42 +03:00
victor.petukhov
46bd5ba107 Add alphabetical sorting diagnostics with same ranges 2019-02-14 12:31:42 +03:00
victor.petukhov
fad59e200c Code stylistic improvements in BaseDiagnosticTest 2019-02-14 12:31:42 +03:00
victor.petukhov
b354518a41 Add lazy debug diagnostic DEBUG_INFO_EXPRESSION_TYPE 2019-02-14 12:31:42 +03:00
victor.petukhov
f92232f015 Decompose and rewrite CheckerTestUtil to Kotlin 2019-02-14 12:31:42 +03:00
victor.petukhov
9e06e1eec0 Move and rename into .kt files around CheckerTestUtil for rewrite to Kotlin 2019-02-14 12:31:42 +03:00
victor.petukhov
8a9c7a69f3 Move checkType directives for tests to separate folder 2019-02-14 12:31:42 +03:00
Ilmir Usmanov
440cccae73 Loosen tail call check
Check that any source of ARETURN is inside a suspension point, not all
of them.
 #KT-27190 Fixed
2019-02-14 12:21:44 +03:00
Sergey Rostov
cc62c971e7 JPS Build: update artifacts for IDEA 2019.1 module names 2019-02-14 10:32:28 +03:00
Dmitriy Dolovov
3df5123d0d CIDR: New way of building CLion and AppCode plugins
- Move `prepare/cidr-plugin`, `prepare/clion-plugin` and `prepare/appcode-plugin` modules from `kotlin` to `kotlin-ultimate` project
- Move `versions.clion.*` and `versions.appcode.*` properties from `kotlin` to `kotlin-ultimate` project
- Drop `cidr183` bunch in `kotlin` project
- Drop useless `cidrPluginDir`, `clionPluginDir`, `clionSandboxDir`, `appcodePluginDir`, `appcodeSandboxDir` Gradle properties in `kotlin` project
- Drop `cidrPlugin` Gradle task in `kotlin` project
- Total: Add ability to build `kotlin-ultimate` both as part of multi-project build with `kotlin` project, and as a standalone build
2019-02-14 12:28:57 +07:00
Alexey Tsvetkov
d5507734e8 Fix maven plugin after IC build reports were introduced to Gradle 2019-02-13 22:04:07 +03:00
Anton Yalyshev
b8d9b563a9 inlined field for better look 2019-02-13 21:48:18 +03:00
Anton Yalyshev
2ccc79b536 Adapted statistics logging to new FUS API. Removed Context usage. 2019-02-13 21:48:18 +03:00
Anton Yalyshev
77d7b8fa1d Plugin util seems better for getting plugin version 2019-02-13 21:47:04 +03:00
Anton Yalyshev
586d2a548b attr. name was changed in FUS API 2019-02-13 21:47:04 +03:00
sashache
7e9f8df43a Allow IDE plugin for 2019.1 platform to run with IDEA 2019.2. 2019-02-13 21:30:57 +03:00
Yan Zhulanow
9729932fe4 191: Update Android plugin changes to AS33 (KT-29847) 2019-02-13 16:35:46 +03:00
Alexander Podkhalyuzin
a2d702c2a7 Fixed 182 patchsets 2019-02-13 16:31:25 +03:00
Denis Zharkov
abad408d7b Do not implicitly propagate deprecations originated in Java
^KT-29604 Fixed
2019-02-13 16:21:05 +03:00
Alexander Podkhalyuzin
2f546d1003 Test for multline todo comments support to Kotlin 2019-02-13 15:59:14 +03:00
Alexander Podkhalyuzin
6c2af0741a Added multline todo comments support to Kotlin
#KT-26950 Fixed
2019-02-13 15:34:00 +03:00
Nikolay Krasko
0d1460ac04 Add "Hard wrap at" and "Wrap on typing" to UI (KT-28905)
#KT-28905 Fixed
2019-02-13 13:56:34 +03:00
Nikolay Krasko
9c47fc6d4d Don't auto close simple long template entry if it's already finished (KT-11143)
#KT-11143 Fixed
2019-02-13 13:56:34 +03:00
Nikolay Krasko
9fe82524e5 Rename in wrapping settings: method -> function (KT-29304) 2019-02-13 13:56:34 +03:00
Ilya Gorbunov
f50820045a Allow setting seed only once, as it is set from superclass constructor
Add tests for Java<->Kotlin Random wrappers.

#KT-29520 Fixed
2019-02-13 00:21:22 +03:00
Ilya Chernikov
4d0261fc45 Fix parsing tests 2019-02-12 21:02:56 +01:00
Alexey Tsvetkov
37e74e0949 Add debugKotlinDaemon shortcut to Gradle tests 2019-02-12 22:10:11 +03:00
Alexey Tsvetkov
560a9d6ae6 Add smoke test 2019-02-12 22:10:11 +03:00
Alexey Tsvetkov
690f6fdd32 Print build overview 2019-02-12 22:10:11 +03:00
Alexey Tsvetkov
7084fd8966 Do not print tasks info when no Kotlin task was run 2019-02-12 22:10:11 +03:00
Alexey Tsvetkov
dbdc7a5b07 Add verbose mode to build reports
#KT-12700

Verbose mode can be enabled by adding `kotlin.build.report.verbose=true`
to `gradle.properties` file.
2019-02-12 22:10:11 +03:00
Alexey Tsvetkov
01c23510c7 Print recompilation reasons in build report 2019-02-12 22:10:11 +03:00
Alexey Tsvetkov
47bb938b94 Adjust build report verbosity 2019-02-12 22:10:11 +03:00
Alexey Tsvetkov
98ef00b957 Add build reports for diagnosing build problems in Gradle
#KT-12700 Fixed

To turn build reports, add 'kotlin.build.report.enable=true' to
gradle.properties file
(or pass it in CLI via`-Pkotlin.build.report.enable=true`).
By default build reports are created in
`rootProject/build/reports/kotlin-build`.
Build report dir can be customized via `kotlin.build.report.dir`
property.
2019-02-12 22:10:11 +03:00
Alexey Tsvetkov
8fc8b95d83 Move TaskLoggers to org.jetbrains.kotlin.gradle.plugin.internal.state 2019-02-12 22:10:11 +03:00
Svyatoslav Kuzmich
d0e7fb7af3 [JS IR BE] Copy Runtime IR after inline preparation passes 2019-02-12 18:45:35 +03:00
Svyatoslav Kuzmich
74ee64fcf1 [JS IR] Workaround: don't try to use generated js files for secondary modules 2019-02-12 18:45:35 +03:00
Svyatoslav Kuzmich
cfde97a7a0 [JS IR BE] Support nested external classes 2019-02-12 18:45:35 +03:00
Svyatoslav Kuzmich
0ff23544fc [JS IR BE] Initial support for mudule wrapper generation 2019-02-12 18:45:35 +03:00
Svyatoslav Kuzmich
d8b1d09566 [JS IR BE] Support codegen for external objects and properties 2019-02-12 18:45:35 +03:00
Svyatoslav Kuzmich
53d15ea27c [JS IR BE] Fix arrays type checks 2019-02-12 18:45:34 +03:00
Vyacheslav Karpukhin
9d4e161324 Updated AppCode dependency 2019-02-12 16:27:07 +01:00
Pavel Punegov
52055ecc94 Add classifier for the artifact to be resolved correctly 2019-02-12 16:01:45 +03:00
Dmitry Gridin
5089df2441 Fix convert unary operator to function call
#KT-25501 Fixed
2019-02-12 11:57:40 +03:00
Kirill Shmakov
e341286fb1 Bump gradle version in template projects
#KT-28522 supposed to be fixed with this
2019-02-11 15:53:24 +03:00
Sergey Rostov
70ffb14d0a JPS Build: update artifacts 2019-02-11 15:18:43 +03:00
Toshiaki Kameyama
4113d06767 Add "Change type to mutable collection" quick fix for NO_SET_METHOD
#KT-29193 Fixed
2019-02-11 10:17:51 +03:00
Toshiaki Kameyama
52c2547d95 Create extension function '.set' quick fix: do not suggest for read-only collestions
# KT-29193 Fixed
2019-02-11 10:17:51 +03:00
Toshiaki Kameyama
d6e21b1c21 Convert to secondary constructor: do not suggest when property has val/var and no name
#KT-29056 Fixed
2019-02-11 10:04:33 +03:00
Ilya Chernikov
dab97ac936 Use KotlinPaths to access jars 2019-02-10 13:35:59 +01:00
Ilya Chernikov
66107d430e Fix maven plugin after moving scripting to the compiler plugin 2019-02-10 13:35:58 +01:00
Ilya Chernikov
d0e78b95c3 Introduce classpath for compiler with scripting in KotlinPaths, fix JSR-223 for Idea 2019-02-10 13:35:58 +01:00
Ilya Chernikov
4c751cdd52 Refactor KotlinPaths - make it easier to extend and keep track of supported entities 2019-02-10 13:34:28 +01:00
Ilya Chernikov
b0c86647ed Convert KotlinPaths to kotlin 2019-02-10 13:33:22 +01:00
Ilya Chernikov
d1da1dd410 Rename .java to .kt 2019-02-10 13:33:22 +01:00
Ilya Chernikov
c6a24c03e4 Move CliScriptDefinition provider to the plugin too, fix tests 2019-02-10 13:33:22 +01:00
Ilya Chernikov
731df8d3cc Proper handling of the scripting compiler plugin in JSR-223 with daemon 2019-02-10 13:33:21 +01:00
Ilya Chernikov
df0b648cea Add scripting configuration to daemon repl, fix and add tests 2019-02-10 13:33:21 +01:00
Ilya Chernikov
be95acd897 Load scripting plugin explicitly in repl tests and JSR-223 2019-02-10 13:33:21 +01:00
Ilya Chernikov
2f52df0640 Initialize scripting plugin in other tests 2019-02-10 13:31:57 +01:00
Ilya Chernikov
5ef6ad916f Apply scripting compiler plugin to the jvm scripting host compiler 2019-02-10 13:31:57 +01:00
Ilya Chernikov
2c02ee3d29 Rename test files to scripts to trigger proper scripting initialization
fix generation config accordingly
2019-02-10 13:31:57 +01:00
Ilya Chernikov
2b67dbe8dd Initialize scripting in tests if script is passed as a source 2019-02-10 13:31:56 +01:00
Ilya Chernikov
89fc7eba95 Make script infrastructure providers optional 2019-02-10 13:31:56 +01:00
Ilya Chernikov
0732b48701 Move script related configuration to the plugin 2019-02-10 13:31:55 +01:00
Ilya Chernikov
dafb2a7519 Drop unused classes and references 2019-02-10 13:31:55 +01:00
Toshiaki Kameyama
6f7830a4b2 Make public: reformat after removing primary constructor visibility modifier
#KT-29444 Fixed
2019-02-09 02:56:14 +03:00
Alexander Udalov
c2968b6a68 Minor, use kotlin.Pair in JvmSerializationBindings.FIELD_FOR_PROPERTY 2019-02-07 23:33:29 +01:00
Alexander Udalov
23298af5a4 Implement fillInStackTrace and others in TestsError
This fixes exception stack traces in some compiler tests. Also provide
explicit return types to get rid of platform type inspections
2019-02-07 23:33:29 +01:00
Alexander Udalov
ce7d8a6874 JVM IR: replace unnecessary property accessor calls with field access
Split the ConstAndJvmFieldPropertiesLowering into two: ConstLowering
which replaces const vals with their values, and
PropertiesToFieldsLowering which removes unnecessary property accessors
(such as for JvmField or private properties with default accessors) and
replaces calls to those accessors with field access
2019-02-07 23:32:32 +01:00
Alexander Udalov
1c143310ac JVM IR: coerce call result to expected expression type
The boundWithSerializableReceiver.kt test is muted since property
references are not yet supported in the JVM IR backend. Previously it
passed by accident
2019-02-07 21:26:00 +01:00
Alexander Udalov
8b395589be JVM IR: fix incorrect IR types in inner and enum class lowerings
In InnerClassesLowering, the type of the "outer$0" expression should be
the outer class, not the inner class. In EnumClassLowering, the type of
the enum entry is the type of its class or the type of the enum class,
but not the type of initialierExpression which is always Unit
2019-02-07 21:25:59 +01:00
Alexander Udalov
4bfa98144b JVM IR: fix compound access to JvmField properties 2019-02-07 21:23:02 +01:00
Alexander Udalov
5c807266f6 JVM IR: fix origin of file class in FileClassLowering
IrDeclarationOrigin.FILE_CLASS is used in CallableReferenceLowering to
generate correct declaration owner.

Many reflection tests start to fail with this commit because they are
now treating callable references to top level declarations as Kotlin
symbols and fail because there's no JVM signature for them; this is
fixed in subsequent commits (previously, they worked because without
Kotlin metadata, these files were treated as Java classes)
2019-02-07 21:23:02 +01:00
Alexander Udalov
8ae03b54d9 JVM IR: generate correct .kotlin_module files 2019-02-07 21:23:02 +01:00
Alexander Udalov
aa0882a74f Refactor .kotlin_module-writing code, simplify PackagePartRegistry 2019-02-07 21:23:01 +01:00
Alexander Udalov
be74f36acc Add module backend.jvm to kotlin-compiler.jar JPS artifact 2019-02-07 21:23:00 +01:00
Alexander Udalov
246346367c Minor, don't use experimental coroutines in kotlinp test 2019-02-07 21:23:00 +01:00
Mikhael Bogdanov
4dc304b24e Move IrBytecodeText tests to ir package 2019-02-07 16:14:20 +01:00
Mads Ager
b902da55d5 JVM_IR: Block with nothing type do not generate values on the stack. 2019-02-07 16:05:16 +01:00
Denis Zharkov
b37aeb8f14 Remove accidentally committed test data bunch for as33 2019-02-07 16:24:23 +03:00
Vyacheslav Karpukhin
ec2dacf9a2 AppCode: minor refactoring in the build script 2019-02-07 13:21:26 +01:00
Mikhael Bogdanov
267925ef14 Update bootstrap to 1.3.30-dev-1419 2019-02-07 11:55:02 +01:00
Mikhael Bogdanov
6aaa601239 Add tests for obsolete issues
#KT-21085 Obsolete
 #KT-13846 Obsolete
2019-02-07 11:39:48 +01:00
Mikhael Bogdanov
6d24d50df6 Remove obsolete test 2019-02-07 11:39:48 +01:00
Dmitriy Novozhilov
c5c43d89d3 Fix testdata of #KT-28598 2019-02-07 13:27:05 +03:00
Dmitriy Novozhilov
3f4df6160c Minor: reformat NewCapturedType.kt according to code style 2019-02-07 12:12:34 +03:00
Dmitriy Novozhilov
9129210cfe Move changes from dfb379d under new language feature (#KT-28672)
Changes from that commit are breaking, and should be pass throw LC
2019-02-07 12:12:34 +03:00
Dmitriy Novozhilov
cf25cab773 Add test for #KT-28598 2019-02-07 12:12:34 +03:00
Dmitriy Novozhilov
6878abe8b4 Add test for #KT-25432 2019-02-07 12:12:34 +03:00
Dmitriy Novozhilov
93de13d931 Fix behaviour of NI in testData
After one of previous commits (my or Mikhail Zarechenskiy) that test
  was broken and it's behaviour was not fixed. That test's behaviour
  is strange (why at one case we have `UNREACHABLE_CODE` and haven't
  at other) and needs further investigation
2019-02-07 12:12:34 +03:00
Dmitriy Novozhilov
b9c5b63d69 Fix #KT-28993 2019-02-07 12:12:34 +03:00
Dmitriy Novozhilov
c60bce88c2 Add test for #KT-28993 2019-02-07 12:12:34 +03:00
kirill.shmakov
4b1e5e8005 Resolve #KT-26865 and related issues
CLITool.exec is used in konanc to perform compilation of native project.
Due to some internal limitation, this function runs in separate process.

After this change, there will be a possibility to choose MessageRenderer
used in CLITool.exec via system property
org.jetbrains.kotlin.cliMessageRenderer.

Reviewed at KOTLIN-CR-2698.
2019-02-07 11:29:16 +03:00
Denis Zharkov
2518ddd87d Fix test data for 181/as33 2019-02-07 11:25:25 +03:00
Ilya Matveev
25bc88f33d Fix K/N framework naming in test 2019-02-06 18:21:42 +03:00
Ilya Matveev
ecbadcdf6f Use project.container instead of WrapUtil
In Gradle 5.2 the 'WrapUtil.toNamedDomainObjectSet' method
was removed. This patches replaces usage of this method
with call of the 'Project.container' method.

Issue #KT-29725 Fixed
2019-02-06 18:21:42 +03:00
Denis Zharkov
1a630773cf Fix parent and containingFile for throws-reference list
Otherwise, exception is thrown during type inference
because default implementations effectively return null

^KT-29287 Fixed
2019-02-06 16:26:28 +03:00
Mikhail Glukhikh
f040eaff27 FIR expressions: perform some names refactoring
FirAccess -> FirQualifiedAccess
FirAccessExpression -> FirQualifiedExpression
FirPropertyAssignment -> FirVariableAssignment
Introduce lValue & rValue in FirAssignment
Introduce separate indexes in FirArraySetCall
2019-02-06 11:59:06 +03:00
Mikhail Glukhikh
8ea4500ab4 Add test for PSI consistency #KT-24080 Fixed
This test checks that we handled all PSI elements properly
2019-02-06 11:59:03 +03:00
Mikhail Glukhikh
5e6ccb4b10 FIR total kotlin test: calculate also KtExpression/Declaration number 2019-02-06 11:59:02 +03:00
Mikhail Glukhikh
8dce8c1549 Make correct traverse in both FIR consistency tests 2019-02-06 11:59:01 +03:00
Mikhail Glukhikh
db2fb86c8e Raw FIR: implement expression trees & conversions from PSI
Testing: total kotlin test controls no stubs in FIR in non-stub-mode
#KT-29002 Fixed
2019-02-06 11:58:59 +03:00
Mikhail Glukhikh
aa97175d40 FIR generator: support type parameters with bounds for interfaces
This commits also reorders bridge visit functions
2019-02-06 11:58:58 +03:00
Toshiaki Kameyama
fa1f3871c0 Add "Redundant 'requireNotNull' or 'checkNotNull' call" inspection
#KT-29113 Fixed
2019-02-06 11:10:27 +03:00
Mikhail Glukhikh
c234683770 Fix changelog for 1.3.21 2019-02-06 11:03:13 +03:00
Mikhail Glukhikh
df0e2dd50a Fix for canBeResolvedViaImport: check isExtension earlier
This commit fixes mistake in d202e96e and fixes broken tests
Related to KT-29713
2019-02-06 10:59:53 +03:00
Georgy Bronnikov
ab1e334847 Reorganize phaser 2019-02-06 07:26:18 +03:00
Nikolay Krasko
89c5549b0a Refactoring: extract urls to separate class and remove long strings 2019-02-06 03:17:25 +03:00
shiraji
d3895c519c Display Quick Documentation for reserved words
#KT-9934 Fixed
2019-02-06 03:17:24 +03:00
Mikhail Glukhikh
53607ba8d4 Add changelog for 1.3.21 2019-02-05 20:02:58 +03:00
Mikhael Bogdanov
0ce4c9bf00 Upgrade proguard to 6.0.3 to avoid corrupted stack maps 2019-02-05 16:14:51 +01:00
Mikhael Bogdanov
b2606735c5 Properly capture local delegated properties in object constructor
#KT-23117 Fixed
2019-02-05 16:14:51 +01:00
Mikhael Bogdanov
9ab6062295 Properly capture extension receiver for array convention expressions in object constructor
#KT-19389 Fixed
2019-02-05 16:14:50 +01:00
Ilya Chernikov
3943bd1b15 Make toString for repl return function types nicer, drop obsolete isFunctionType 2019-02-05 16:13:06 +01:00
Ilya Chernikov
b7e1dd96b2 Supply proper classloader to the evaluator, add another test for function type
and some minor refactoring
2019-02-05 16:13:06 +01:00
Nikolay Krasko
aac9a3e953 Update since to 183.3283.2 as we already use API from it
Thanks to "Usage of Intellij API not available in older IDEs" inspection.
2019-02-05 16:54:34 +03:00
Nikolay Krasko
22a46d96c1 Update copyright in test module 2019-02-05 16:54:34 +03:00
Timo Obereder
ff4279762e Fix comment placement on if/else in if or when condition #KT-28224 Fixed 2019-02-05 14:07:28 +03:00
Mikhael Bogdanov
520679a2b4 Regenerate JS tests 2019-02-05 11:55:42 +01:00
Mikhail Glukhikh
d202e96ea1 Extract and use for inline KtSimpleNameExpression.canBeResolvedViaImport
Related to KT-29486
#KT-29713 Fixed
2019-02-05 13:32:33 +03:00
Mikhail Glukhikh
cccc6bf315 Redundant enum constructor invocation inspection: minor rename 2019-02-05 12:57:14 +03:00
Toshiaki Kameyama
7cba11ff28 Can be private: don't report if it's used in inline property
#KT-29085 Fixed
2019-02-05 11:34:08 +03:00
Toshiaki Kameyama
2a7eb2fb0e Redundant lambda arrow: do not report on nested lambda
#KT-29093 Fixed
2019-02-05 11:27:41 +03:00
Toshiaki Kameyama
bf7f7c81b1 Redundant explict type: do not report for aliased types
#KT-29128 Fixed
2019-02-05 11:24:32 +03:00
Toshiaki Kameyama
25952036af Reformat RedundantExplicitTypeInspection 2019-02-05 11:24:32 +03:00
Toshiaki Kameyama
b9d8466fc0 Replace rangeTo with until: fix false negative with parenthesized expression
#KT-29153 Fixed
2019-02-05 11:22:59 +03:00
Toshiaki Kameyama
c183f0285d Reformat ReplaceRangeToWithUntilInspection 2019-02-05 11:22:59 +03:00
Toshiaki Kameyama
9c468ef2aa Convert member to extension: preserve visibility
#KT-29248 Fixed
2019-02-05 11:22:02 +03:00
Toshiaki Kameyama
e8a8bc89c9 Add "Redundant enum constructor invocation" inspection
#KT-29321 Fixed
2019-02-05 11:16:01 +03:00
Mads Ager
542d3c3532 JVM_IR: Fix stack underflow for unit coercion of when expressions.
Code such as

```
val b = getBoolean()
if (b) 4
else if (b) 5
```

didn't generate a value on the stack always and therefore would
have control-flow paths leading to a pop instruction with nothing
on the stack.

Change-Id: I09d059f361e56a41880006e3f4e51e9acdbd167d
2019-02-05 08:52:18 +01:00
Mark Punzalan
e91a16556c JVM_IR: Do not add redundant field initializers.
Initializers are "set field" expressions and are considered redundant
when they are:
1. In the primary constructor; and
2. Set the field to `0`, `false`, or `null`; and
3. Have a `null` origin. I.e., not in an initializer block or
constructor body, and therefore the field could not have been set by a
prior expression.
2019-02-05 08:44:33 +01:00
kirill.shmakov
9e8972f1f9 Correct typo in comments 2019-02-04 14:30:37 +03:00
Mikhael Bogdanov
53aca0069c Update bootstrap version to 1.3.30-dev-1297 2019-02-04 09:04:44 +01:00
Kirill Shmakov
aafb8473e9 Correct typo 2019-02-04 10:00:43 +03:00
kirill.shmakov
566dac8599 Correct suppress directive 2019-02-04 09:48:03 +03:00
Nikolay Krasko
a75da632a6 Revert extension function in IndexUtils and better testing 2019-02-03 17:32:05 +03:00
Nikolay Krasko
c89bee624a Minor: remove DocumentAdapter usage 2019-02-03 17:32:05 +03:00
Nikolay Krasko
b8bbe10086 Support global inspections in tests (KT-29549)
#KT-29549 Fixed
2019-02-03 17:32:05 +03:00
Nikolay Krasko
56d56ab842 Make package name inspection global (KT-29549)
Report same package only once.

 #KT-29549 Fixed
2019-02-03 17:32:04 +03:00
Nikolay Krasko
6ee78fb629 Refactoring: extract name verifier code to settings class 2019-02-03 17:32:04 +03:00
Ilmir Usmanov
39de3c2ab1 Fix test data on JVM_IR BE 2019-02-01 21:45:44 +03:00
Ilmir Usmanov
20e4efaeab Fix test data 2019-02-01 17:33:49 +03:00
Vadim Brilyantov
4d68e08ab7 Change 191 idea version to 191.4738.6 2019-02-01 16:47:04 +03:00
Vadim Brilyantov
6a657714ec Move usage statistics to idea source root 2019-02-01 16:47:03 +03:00
Vadim Brilyantov
032a784d0b Implement statistics for the new API for intellij 191 2019-02-01 16:47:02 +03:00
Alexander Podkhalyuzin
495030ad9b Back to png icons in Android Studio
It's not support 16px @2x.svg icons yet, we need to wait for AS 3.4

#KT-29533 Fixed
2019-02-01 16:41:21 +03:00
kirill.shmakov
6c8b3d03fd Add syntax highlighting for *.def files 2019-02-01 16:34:00 +03:00
Alexander Udalov
8b286faa6a Workaround issue with unsupported report-cdata-event in XMLInputFactory on IBM JDK
#KT-29596 Fixed
2019-02-01 14:27:43 +01:00
Mikhail Glukhikh
bef0249347 UAST: do not analyze KtPsiFactory-created files #KT-29486 Fixed 2019-02-01 13:26:17 +03:00
Toshiaki Kameyama
bd467f39d6 Convert to scope function: Also convert call expression
#KT-28698 Fixed
2019-02-01 12:13:05 +03:00
Toshiaki Kameyama
f15c8f78fa Convert to scope function: refactor 2019-02-01 12:13:05 +03:00
Dmitriy Novozhilov
0501a108c0 Fix tests in DiagnosticsTestWithStdLibGenerated with NI 2019-02-01 11:40:20 +03:00
Toshiaki Kameyama
98810ba750 Add intention to replace snake-case test function name with a space-separated
#KT-27143 Fixed
2019-02-01 11:07:00 +03:00
Pavel V. Talanov
5226ea5cda Add missing bunch files
#KT-27769 Fixed
2019-01-31 17:38:05 +01:00
Ilya Gorbunov
bd2e00ae99 Exclude kotlin.native internal package from modular kotlin-stdlib
Otherwise jlink fails to consume this library due to Java keyword in
package name.

#KT-29612
2019-01-31 19:18:55 +03:00
Ilya Gorbunov
9c7a785d78 Add an integration test of using modular artifacts with jlink in JDK9
Setup maven plugin integration test execution with JDK9 as java home.
2019-01-31 19:18:55 +03:00
Toshiaki Kameyama
804e03379d Remove unused function parameter: do not propose for property setter parameter
#KT-29606 Fixed
2019-01-31 18:56:59 +03:00
Igor Chevdar
5b0d1bb6e4 Unmuted passing tests 2019-01-31 18:19:41 +03:00
Igor Chevdar
c257af31f4 Added test 2019-01-31 18:19:41 +03:00
Igor Chevdar
0ca28914a5 Minor changes in default arguments lowering
Calls to a function with default args can be not only
from function bodies, but for example from initializers
2019-01-31 18:19:40 +03:00
Igor Chevdar
9d84576021 Hack to help lowerings communisation in K/N
The hack breaks dependency LocalDeclarationsLowering —> CallableReferenceLowering
2019-01-31 18:19:40 +03:00
Igor Chevdar
07a576ec79 Supported enums in LocalDeclarationsLowering 2019-01-31 18:19:40 +03:00
Igor Chevdar
414899b482 Fixed copy/paste 2019-01-31 18:19:40 +03:00
Igor Chevdar
c765bd74d7 Made LateInitLowering the same in K/N as in other BEs 2019-01-31 18:19:39 +03:00
Alexander Udalov
db487a622a Add -Xsanitize-parentheses to workaround ASM 6.1 issue in frame computation
#KT-29475 Fixed
2019-01-31 15:47:43 +01:00
Dmitriy Novozhilov
dfb379d999 Expand Effect System with receiver values (#KT-28672)
Add some classes to hierarchy of `ESValue`:
- `ESReceiver` -- representation of receiver
  of lambda function
- `ESDataFlow` and `ESDataFlowReceiver` -- little refactoring of entities
  that holds information for DFA (description in comments in code).

Also add kdoc to classes of `ESValue` hierarchy
2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
932e0234e7 Add testdata for issue #KT-28672 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
ba71bbde6a Extract InvocationKind class into separate file 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
44ae7a19e6 Reformat ContractSerializer.kt according to code style 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
b86ea7621c Cleanup code in PseudocodeTraverser 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
0e8c43f8c0 Generify key type parameter of ControlFlowInfo
Previously only `VariableDescriptor` was key of `ControlFlowInfo`.
Now it's generic parameter `K: Any`, so there is a possibility of using
  different object's inside CFA
2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
efe891bb47 Remove duplicate of typealiases for javaslang collections 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
68d2cbf91f Extract classes used in control flow analysis of variable into variable package 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
1dd7365e9f Reformat some classes in org.jetbrains.kotlin.cfg according to code style 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
fa79f7bf30 Reformat ControlFlowProcessor according to code style 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
80835fe6ea Add ability to configure environment in AbstractLoadJavaTest
There is two methods added into `AbstractLoadJavaTest`:
- `configureEnvironment(KotlinCoreEnvironment environment)` allow to
  configure environment that will be used two compilation of source test
  data and loading generated `.class` files (e.g. you can register extensions)
- `getExtraClasspath()` allow to add custom libraries to classpath of
  compiler

Similar methods exists in `AbstractDiagnosticsTest`
2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
68d7e51d32 Support test directive for rendering full diagnostic messages
New `RENDER_DIAGNOSTICS_MESSAGES` directive forces test system render
full messages for all diagnostics that found in test file
2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
2866bd84a1 Reformat BaseDiagnosticTest according to code style 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
047f9abaf7 Make order of rendered diagnostics more stable
There was a bug that sometimes diagnostics on the same element with
same names but with different parameters had been reshuffled.
2019-01-31 17:25:13 +03:00
Tor Norbye
a42406f2aa KT-29586: Add android.annotation annotations
KT-29586 Fixed
2019-01-31 17:12:56 +03:00
Pavel V. Talanov
f1f2d5b4d3 Change dsl marker gutter icon to use different colors
#KT-27769 Fixed
2019-01-31 14:06:10 +01:00
Ilya Matveev
6b14271931 Declare K/N platform libraries as files instead of modules
Earlier the K/N platform libraries were looked for in a local ivy
repository created on basis of a K/N compiler distribution. Such
an approach allowed correctly showing such dependencies in
IDEA using the "group:name:version" format (e.g.
"Kotlin/Native:Accounts:ios_arm64:1.1.1"). But it caused looking
for there libraries in all other declared repositories too
making IDE import slower (see KT-28128).

This patch declares these dependencies as files and gets rid of
the local repo to avoid this problem. The downside of this change
is less informative output in the IDE:
"Kotlin/Native:Accounts:ios_arm64:1.1.1" -> "Accounts".

Issue #KT-28128 Fixed
2019-01-31 19:32:26 +07:00
Ilya Matveev
88d35cb798 Don't embed bitcode for ios simulator 2019-01-31 19:32:26 +07:00
Sergey Igushkin
c5ce32653d Fix POM not rewritten correctly with custom artifact IDs (KT-29485)
When the plugin rewrites a POM, it establishes the mapping of the
original Maven coordinates to the modified ones. As one of the steps,
this requires finding the original Maven coordinates to rewrite – these
should be exactly the coordinates that Gradle writes to the POM.

In MPP, these are the coordinates of the 'root' (Gradle module metadata)
publication. If those are modified in the publication, the plugin relies
on delegating to the publication in the root module's SotwareComponent
(the only reasonable fallback is the project's name, and in this case
it obviously doesn't match the Maven artifact ID that was modified).

In 1.3.20, the publication delegate was never assigned. To fix the
issue, it is enough to correctly assign the publication delegate for the
root module's SoftwareComponent.

Issue #KT-29485 Fixed
2019-01-31 15:18:15 +03:00
Sergey Igushkin
55cc5e84fc Fix publishing dependencies of Android libraries (KT-29476)
* Add the extendsFrom relation between the Kotlin MPP compilation's
  configurations (`*Api`, `*Implementation`, `*RuntimeOnly`) and
  the Android variant's `*Elements` configurations, as those
  dependencies currently are not added to the Android source sets and
  are thus missing from the published dependencies.

* Fix a `this is KotlinCompilationToRunnableFiles` check that
  mistakenly referenced the Project receiver of `whenEvaluated { ... }`

Issue #KT-29476 Fixed
2019-01-31 15:16:06 +03:00
Nikolay Krasko
64b2527e31 Revert allowing upper case letters in packages (KT-27900) 2019-01-31 13:40:37 +03:00
Nikolay Krasko
726e18333d Fix infinite recursion during indexing types (EA-86494) 2019-01-31 12:39:08 +03:00
Nikolay Krasko
d95189281d Regenerate AddImportTestGenerated 2019-01-31 12:39:08 +03:00
Dmitry Savvinov
4694a7963b Allow actuals with more permissive visibility
Allow non-virtual expects to have actuals with more permissive
visibility.

^KT-19664 Fixed
2019-01-31 12:29:27 +03:00
Dmitry Savvinov
0338753c11 Add test on actual with more permissive visibility
Currently the behaviour is undesired, see KT-19664. The next commit
fixes it.
2019-01-31 12:26:58 +03:00
Mikhael Bogdanov
a122cba862 Switch Kotlin project to jvm-target 1.8
#KT-29405
2019-01-31 07:43:05 +01:00
Georgy Bronnikov
3e9c290a3a Remove references to invisible fakes from IR backend 2019-01-31 07:55:39 +03:00
Georgy Bronnikov
ee43b5f1e9 IR. Do not generate invisible fakes 2019-01-31 07:55:39 +03:00
Leonid Startsev
8eeb9d4faa [kx.serialization] Fix serializer resolving for file-level annotations:
Instantiating ContextSerializer for primitives with boxing (fixes https://github.com/Kotlin/kotlinx.serialization/issues/349)
Unwrap nullable type when looking for general-defined serializer (fixes https://github.com/Kotlin/kotlinx.serialization/issues/351)

Add lost java collection types and fix annotation name (fixes https://github.com/Kotlin/kotlinx.serialization/issues/343)
2019-01-30 19:42:08 +03:00
Mikhail Zarechenskiy
738271aba6 Refactoring: rename CheckArguments -> CheckArgumentsInParenthesis 2019-01-30 14:56:33 +03:00
Mikhail Zarechenskiy
6705803d83 [NI] Fix coercion to Unit for lambdas with empty labeled return 2019-01-30 14:56:31 +03:00
Mikhail Zarechenskiy
147d7844bc [NI] Dont' add trivial constraints with Nothing from incorporation
#KT-24490 Fixed
 #KT-26816 Fixed
2019-01-30 13:48:33 +03:00
Mikhail Zarechenskiy
662e2287cc [NI] Discriminate resulting type Nothing(?) at fixation stage 2019-01-30 13:48:28 +03:00
Mikhail Zarechenskiy
0b0e335cdd [NI] Discriminate constraints with Nothing(?) lower bounds 2019-01-30 13:44:48 +03:00
Nicolay Mitropolsky
dcbd441814 Uast: aligning bunches after moving all convert* methods to KotlinConverter in 191 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
b45172a7f8 191: Uast: support convertToAlternatives for KtFile 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
4df72b4f79 191: Uast: refactoring: all convert* methods were moved to KotlinConverter 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
28e19ed8c7 191: Uast: AlternativesRenderLogTest introduced 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
8ad06314f0 191: Uast: support convertToAlternatives for KtClassOrObject 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
9e2358e8ff 191: Uast: support convertToAlternatives for KtParameter 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
f4c51dc6d0 191: Uast: support convertToAlternatives for KtProperty 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
114c3be632 191: Uast: KtParameter can be converted to field 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
529d0b8326 191: Uast: initial support for multiple required types 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
731956db71 191: Uast: UInjectionHost moved under flag kotlin.uast.force.uinjectionhost (KT-27283) 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
9ecd69760b 191: Revert KotlinStringTemplateUPolyadicExpression implement UInjectionHost testdata changes 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
56dfde0428 191: Uast: making KotlinStringTemplateUPolyadicExpression implement UInjectionHost (KT-27283) 2019-01-30 12:35:17 +03:00
victor.petukhov
6f04deff0e Remove old grammar files
The new grammar is located in the Kotlin spec repo: https://github.com/JetBrains/kotlin-spec/tree/spec-rework/src/grammar
2019-01-30 11:48:01 +03:00
kenji tomita
cbf6aa4ac3 Fix #KT-29567 "Remove empty class body" is a poor name for inspection text 2019-01-30 09:53:16 +03:00
Nikolay Krasko
52c46811ff Enable JPS test runner for new JPS build (KT-29368)
#KT-29368 Fixed
2019-01-30 01:13:23 +03:00
Svyatoslav Kuzmich
c9e2ed4e1f Undo unnecessary changes to stdlib
Partially revert "[stdlib] Reduce usage of extension functions"
2019-01-29 19:06:32 +03:00
Svyatoslav Kuzmich
0ef4194770 [JS IR BE] Support String companion object 2019-01-29 19:06:31 +03:00
Svyatoslav Kuzmich
24ab36616e [JS] Fix runtime file order in runIrTestInNode.js 2019-01-29 19:06:31 +03:00
Svyatoslav Kuzmich
b239c80531 [JS IR BE] Add a few kotlin.test stubs to IR runtime 2019-01-29 19:06:31 +03:00
Svyatoslav Kuzmich
b49ec3edb8 Disable generation of 1.2 coroutine tests for JS_IR
Add directive DONT_TARGET_EXACT_BACKEND.
This directive is needed to exclude JS_IR backned but keep "compatible"
JS backend.
2019-01-29 19:06:31 +03:00
Svyatoslav Kuzmich
ab3eb06a62 [JS IR BE] Fix lowering Long comprising operators 2019-01-29 19:06:31 +03:00
Mikhail Zarechenskiy
5bcd974944 Temporary remove failing test for new inference about SAM conversions
Currently, it's easier to remove test completely rather than mute it
 somehow as it throws exception at compile-time

 #KT-29561 Open
2019-01-29 17:24:49 +03:00
Ilya Chernikov
f125600af1 Restore returning of functional types from repl eval
add tests for the broken case as well for the return value representation
#KT-29490 fixed
2019-01-29 15:05:37 +01:00
Mads Ager
52464fd103 JVM_IR: do not generate line number info for temporary loads.
Loads from compiler-introduces temporary variables to do not
correspond to loads in user code.
2019-01-29 14:25:17 +01:00
Anton Bannykh
b1f6a05aa0 JS: fix incremental suspend inline test (KT-29360 fixed) 2019-01-29 13:16:39 +03:00
Anton Bannykh
5c7072ec44 JS: add incremental suspend inline test 2019-01-29 13:16:39 +03:00
Nicolay Mitropolsky
aa88e579a6 Uast: checking that element is valid before running into resolve
probably will fix EA-134193
2019-01-29 11:05:27 +03:00
Dmitriy Dolovov
e59a5de314 CLion: New version 2018.3.3 (183.5153.40) 2019-01-29 09:23:50 +07:00
Alexey Tsvetkov
1103ca3a38 Fix logging in workers
Setting `forkMode` to `ForkMode.NEVER` switches
`isolationMode` to `IsolationMode.CLASSLOADER`.
Classloader isolation mode prevented passing task's
logger to the unit of work.
Also it might resulted in multiple daemon instances starting
in parallel.

This change removes setting `forMode` (it was unnecessary).
Also a logger is used for the fallback message instead of printing it
to stderr. An assertion is added to tests, ensuring that
the fallback does not happen.

    #KT-29394 Fixed
2019-01-28 21:33:22 +03:00
Mads Ager
bb0cd92da0 JVM_IR: Fix codegeneration for missing branches.
This used to generate an ACONST_NULL instruction leading to incorrect
stack height for code such as:

```
if (condition) else 32
```
2019-01-28 15:41:48 +01:00
Alexander Udalov
37a149b218 Allow to specify builtInsModule for DefaultBuiltIns
Similarly to JvmBuiltIns, this will be needed to load built-ins from
compilation dependencies rather than the compiler class loader
2019-01-28 15:18:53 +01:00
Alexander Udalov
f2bf0dc236 Drop unneeded synthetic package fragment construction from KotlinBuiltIns
Instead use package views of builtInsModule
2019-01-28 15:18:52 +01:00
Alexander Udalov
e19c6ce23c Use KotlinBuiltIns.getBuiltInsPackageScope instead of getBuiltInsPackageFragment
In general case, the module where built-ins are looked up
(builtInsModule) can have multiple package fragments corresponding to
the package "kotlin". Remove the misleading method
getBuiltInsPackageFragment along with its implementation details and use
the package view's scope instead (by changing
KotlinBuiltIns.getBuiltInsPackageScope), since it'll iterate over all
fragments accessible in the module and its dependencies.

The only difference between scopes of package fragment and package view
is that the latter also contains package views for subpackages, which is
why the change in BuiltInsReferenceResolverTest is necessary
2019-01-28 15:18:52 +01:00
Alexander Udalov
a419112c25 Refactor class lookup methods in KotlinBuiltIns
Remove external usages of get*Nullable methods, inline/remove other
methods to simplify the API facade
2019-01-28 15:18:52 +01:00
Alexander Udalov
aa8938cc1b Minor, cleanup KotlinBuiltIns
Remove unused code, fix inspections
2019-01-28 15:18:52 +01:00
Alexander Udalov
4a7bd9467c Remove obsolete BuiltInsInitializer
JvmBuiltIns do not use it for a long time already and work fine. It
seems that other implementations do not need it either
2019-01-28 15:18:52 +01:00
Alexander Udalov
6cd3d9f19a Do not use DefaultBuiltIns.Instance in ESConstant
Add ESComponents and ESConstants to encapsulate usages of built-ins in
different functors and operators
2019-01-28 15:18:52 +01:00
Alexander Udalov
9516d6e89b Do not use DefaultBuiltIns in contracts
Default built-ins represent built-ins loaded from the compiler jar via
class loader, and they may not be equivalent to the built-ins present in
the standard library that is used in compilation dependencies, in case
the compiler and stdlib versions do not match. Use built-ins from the
given module instead.

This commit deals with more-or-less obvious usages of DefaultBuiltIns;
next commits refactor the ESConstant values and related code to support
injected built-ins
2019-01-28 15:18:52 +01:00
Alexander Udalov
7561502956 Refactor AndFunctor/OrFunction: do not use strictPartition
Instead use a filter with a simple check. This seems to be slightly
better both for readability (`strictPartition` gave an impression that
two its parameters were related in some way, but they were totally
independent) and for performance (do not create unnecessary objects,
instead decompose the existing objects and check their structure)
2019-01-28 15:18:52 +01:00
Alexander Udalov
07931451b1 Add utilities to check if ESValue is boolean/wildcard constant 2019-01-28 15:18:51 +01:00
Alexander Udalov
cf19fa832c Add utility to check if effect is ESReturns
Somewhat simplify related code in AbstractBinaryFunctor and
AbstractUnaryFunctor
2019-01-28 15:18:51 +01:00
Vadim Brilyantov
de22c133c7 Fix redundant statistics extensions in plugin-common.xml 2019-01-28 17:17:46 +03:00
Mikhail Glukhikh
04bd5139d5 Don't suggest "return type is..." inspections for anonymous functions
#KT-29290 Fixed
2019-01-28 16:03:55 +03:00
Ilya Chernikov
4f9e844735 Improve standard libs search logic for script compilation:
- refactor appropriate functions to accept optional classloader (not used yet)
- try to load from thread context classloader first
- fallback to marker class classloader in the appropriate function
2019-01-28 13:15:36 +01:00
Ilya Chernikov
95d782b6ca Implement diagnostics for ignored compiler arguments on script compilation 2019-01-28 13:15:36 +01:00
Ilya Chernikov
7ee9801c5f Implement additional compiler arguments support in scripts 2019-01-28 13:15:36 +01:00
Ilya Chernikov
04b04ea0ee Refactor compiler arguments to configuration conversion:
extract into independent functions, rearrange logic
2019-01-28 13:15:36 +01:00
Ilya Chernikov
298aaf999e [minor] fix function name typo 2019-01-28 13:15:36 +01:00
Ilya Chernikov
d5d60cbc6b Convert CliCompiler class to Kotlin 2019-01-28 13:15:35 +01:00
Ilya Chernikov
025d2d1b66 Rename .java to .kt 2019-01-28 13:15:35 +01:00
Sergey Rostov
f5b7b5990f Build: fix PILL for JPS build. 2019-01-28 13:43:09 +03:00
Sergey Rostov
30cc70d4c3 JPS build: move idea configuration to separate script 2019-01-28 13:43:09 +03:00
Sergey Rostov
46d616641f JPS build workarounds for gradle import 2019-01-28 13:43:08 +03:00
Sergey Rostov
ca47247e5d Build: got rid of useBootstrapStdlib flag (replaced with jpsBuild flag) 2019-01-28 13:43:08 +03:00
Sergey Rostov
82e56f9cdd Build: fail on attempt to include anntations.jar from intellij 2019-01-28 13:43:08 +03:00
Sergey Rostov
f35185b261 Build: remove explicit dependencies to org.jetbrains.annotations 2019-01-28 13:43:08 +03:00
Sergey Rostov
78630fec41 Build: add annotations-13.0.jar to compilerManifestClassPath
This is required since intellijCore/annotations.jar was removed from
koltin-compiler.jar
2019-01-28 13:43:08 +03:00
Sergey Rostov
0f2fb4ff82 Build: remove intellijCore/annotations.jar usages 2019-01-28 13:43:08 +03:00
Sergey Rostov
c716ef112e Got rid of @TestOnly usages on fields 2019-01-28 13:43:08 +03:00
Sergey Rostov
efa3201a68 JPS build: add dependencies to stdlib 2019-01-28 13:43:08 +03:00
Sergey Rostov
e8e2a5b047 Build: update pill comments in build scripts to distinguish from JPS 2019-01-28 13:43:07 +03:00
Sergey Rostov
2dad03f817 JPS Build: Temporary solution for creating IDEA artifacts settings
This script traverses all Gradle copy task, build virtual files model
and generates IDEA artifacts configuration based on this. Unfortunately
this is not fully working and needs manual fixing, so the actual artifacts
configurations are commited by hand for now. By the way, this script also
visits copy task's internals which leads that Gradle generates
manifests in `build` folders during IDEA import. This files are referenced
in artifacts configurations. So, despite the fact that artifacts
configurations created by this script is not used, we need to run them
to generate required manifests.

This solution will be replaced with DSL that produces both Gradle
copy tasks and IDEA artifacts configuration which is coming soon.
2019-01-28 13:43:07 +03:00
Sergey Rostov
d81f9dc24d JPS build: artifacts 2019-01-28 13:43:07 +03:00
Sergey Rostov
9fa8a80c6c JPS build: add JUnit run configuration and defaults
#KT-29335 Fixed
#KT-29211 Fixed
2019-01-28 13:43:07 +03:00
Sergey Rostov
f2fd28e84f JPS build: add idea settings to build.gradle.kts
#KT-29323 Fixed
2019-01-28 13:43:07 +03:00
Sergey Rostov
21ae6e272d Build utils: Kotlin DSL for idea-ext plugin 2019-01-28 13:43:07 +03:00
Sergey Rostov
12cfd6396d JPS build flag: exclude java9 when jps build enabled 2019-01-28 13:43:07 +03:00
Sergey Rostov
1031edc933 JPS build flag: exclude modules that we are currently cannot compile with jps 2019-01-28 13:43:07 +03:00
Nikolay Krasko
4b3ff05af4 Fix several problems with bunch file synchronize in plugin-common
Drop plugin-common bunches.
2019-01-28 13:30:29 +03:00
Vyacheslav Gerasimov
b78627f572 Build: Merge sources to single jar (idea can't handle multiple) 2019-01-28 01:27:53 +03:00
Svyatoslav Kuzmich
75328f26ea [JS IR BE] Add missing KJS_WITH_FULL_RUNTIME to some tests
+ ranges test generator
2019-01-27 01:14:51 +03:00
Mikhael Bogdanov
ac7517dd76 Minor. Reformat 2019-01-26 08:26:50 +01:00
Mikhael Bogdanov
f2a51d3b80 Support reflection tests on Android 2019-01-26 08:26:49 +01:00
Burak Eregar
91980c5293 KT-27869: Make Java to Kotlin dialog show yes/no button according to it's question
* Change `showOkCancelDialog` to `showYesNoDialog`
 #KT-27869 Fixed
2019-01-25 18:53:35 +03:00
Nicolay Mitropolsky
ef48373109 191: Update intellijSdk=191.4212.41 2019-01-25 18:34:49 +03:00
Mikhail Glukhikh
10b6ab949e Explanation for BaseTransformedType 2019-01-25 18:05:09 +03:00
Mikhail Glukhikh
dbdc57769b Explanation for VisitedSupertype 2019-01-25 18:05:09 +03:00
Simon Ogorodnik
dcd41bd26f FIR: Add test for total kotlin resolve #KT-24077 Fixed 2019-01-25 18:05:08 +03:00
Mikhail Glukhikh
619bddfdbc FIR: handle recursion in super-types correctly
Related to KT-24077
2019-01-25 18:05:08 +03:00
Alexander Udalov
a2f4efbc2a Report error on state in multi-file class with -Xmultifile-parts-inherit
Simplify MultifileClassPartCodegen, remove related tests and change some
tests to use const val instead of val because backing fields for const
properties are stored in the facade, not parts

 #KT-23701 Fixed
2019-01-25 15:57:13 +01:00
Alexander Udalov
6b5a16884c Refactor inheritMultifileParts to be a JVM analysis flag
Instead of a JVMConfigurationKeys key. This will allow to use it in a
checker in 'frontend.java'
2019-01-25 15:57:13 +01:00
Roman Artemev
f3758771c9 Update tests 2019-01-25 17:17:16 +03:00
Roman Artemev
fd9a72b627 [JS IR BE] Fix traits super calls 2019-01-25 17:17:16 +03:00
Dmitriy Novozhilov
af964d56c7 Fix testdata with new inference after fix in 65e6e21 2019-01-25 15:59:57 +03:00
Alexander Podkhalyuzin
4f4099796d Use 16px logo instead of 13px for run configurations 2019-01-25 14:33:13 +03:00
Alexander Podkhalyuzin
63cec94dbc Cleanup after review 2019-01-25 14:33:13 +03:00
Alexander Podkhalyuzin
4c674ae27a Updated icons to svg version. 2019-01-25 14:33:13 +03:00
Toshiaki Kameyama
fe006cf342 Boolean literal arguments: do not report in batch (offline) mode with INFORMATION severity
#KT-29494 Fixed
2019-01-25 14:25:38 +03:00
Max Medvedev
6f95030fe4 Don't perform potentially long operation in FindImplicitNothingAction#update
#KT-29457 fixed
2019-01-25 12:49:17 +03:00
Alexander Udalov
38fd2b9ed6 Fix reflection-related codegen tests on JDK 9+
In JDK 9, Class.simpleName changed behavior for local/anonymous Kotlin
classes (see KT-23072), this is why we now check for both variants of
the name in tests. Also, the format of annotation arguments changed a
little, where float parameters no longer have the trailing "f", and
class literals are rendered with ".class" at the end
2019-01-25 10:14:25 +01:00
Nicolay Mitropolsky
795f9d83e1 191: Uast: implementation of UReferenceExpression.referenceNameElement (KT-29025) 2019-01-25 11:13:43 +03:00
Nicolay Mitropolsky
a3ea7bcd3b Uast: property resolve arrayOf in nested annotations (KT-29434) 2019-01-25 11:10:59 +03:00
Toshiaki Kameyama
4ffeff5e6c Redundant lambda arrow: do not report on type parameter
#KT-28131 Fixed
2019-01-25 10:53:04 +03:00
Svyatoslav Kuzmich
8fbf1ed683 [JS IR BE] Unmute tests 2019-01-24 23:05:56 +03:00
Svyatoslav Kuzmich
2818d3767e [JS IR BE] Covert Char into inline class 2019-01-24 23:05:56 +03:00
Svyatoslav Kuzmich
a5f537adc5 [JS IR BE] Implement *Array.plus(Collection<>) in typed Kotlin without dynamic helper 2019-01-24 23:05:56 +03:00
Svyatoslav Kuzmich
8c89ffbe2d [JS IR BE] Load builtins from code to runtime
Bypass builtins deserialization mechanism in legacy JS backend and load
bultins direcly as kotlin code.

This way we won't have separated IR declarations for Enum, Char, Long

Some "native" builtins are implemented in libraries/stdlib/js/irRuntime/builtins/
Other builtins are moved by MoveExternalDeclarationsToSeparatePlace and
used only in compile-time
2019-01-24 23:05:56 +03:00
Svyatoslav Kuzmich
7e263fd68e Allow primitive types to be vararg elements disregarding their inline class status 2019-01-24 18:58:51 +03:00
Nikolay Krasko
80f1efaddc Dispose range markers in UI thread to prevent race condition at getting range (KT-28870)
#KT-28870 Fixed
2019-01-24 17:05:56 +03:00
Nikolay Krasko
f19f38a4db Rework "lambda return expression" hint (KT-28870)
Move the hint to the end of the line, to avoid breaking indentation.

Also use `EditorLinePainter` API for painting to prevent problems with
typing at the line end, when caret is placed after the hint
(See IDEA-204702 for implementing such hints in platform).

 #KT-28870 Fixed
2019-01-24 17:05:55 +03:00
Nikolay Krasko
547357baa1 Don't check intentions without categories for description presence 2019-01-24 17:05:55 +03:00
Nikolay Krasko
a41dcd2af2 Fix NPE in coverage (EA-134461) 2019-01-24 17:05:55 +03:00
Svyatoslav Kuzmich
29eb3c745c [JS IR BE] Support two versions of test runtime: full and reduced 2019-01-24 16:14:40 +03:00
Svyatoslav Kuzmich
a40448aebc [JS IR BE] Use unsigned types lowering lazily 2019-01-24 16:14:40 +03:00
Svyatoslav Kuzmich
eea7e85d3a [stdlib] Reduce usage of extension functions 2019-01-24 16:14:40 +03:00
Svyatoslav Kuzmich
aa811dcfb3 [JS IR BE] Add KJS_WITH_FULL_RUNTIME directive to compiler tests 2019-01-24 16:14:40 +03:00
Felix Guo
185d0c6165 Remove unnecessary constructor keyword intention (KT-29143)
#KT-29143 Fixed
2019-01-24 14:32:21 +03:00
Roman Artemev
c10eadfa77 Add 1.3.20 Changelog 2019-01-24 14:12:09 +03:00
Alexander Podkhalyuzin
5aa7216c13 Rewritten resolving conflicting imports on adding new import with star action (KT-18503)
#KT-18503 Fixed
2019-01-24 11:40:25 +03:00
Nikolay Krasko
ed5051a5e3 Fix exception in imports folding when there're two imports lists (KT-29455)
Probably caused by modifications of the recovery for import lists
65e6e21d0f

 #KT-29455 Fixed
2019-01-24 11:23:47 +03:00
Nikolay Krasko
92a50b2880 Minor: explicitly use FULL mode for resolve, tests are falling otherwise 2019-01-24 11:23:46 +03:00
Nikolay Krasko
a0b8980d77 Show lambda exist points when cursor is at the correspondent call (KT-29381)
#KT-29381 Fixed
2019-01-24 11:23:46 +03:00
Mikhail Glukhikh
5ec7643b5a Fix two QF tests (new add underscores action, KT-28953) 2019-01-24 11:00:59 +03:00
Toshiaki Kameyama
7cad0052d9 "Add parameter to constructor": fix for enum entry
#KT-28995 Fixed
#KT-29051 Fixed
#KT-29052 Fixed
2019-01-24 11:00:59 +03:00
Dmitriy Novozhilov
2c74796b0b Fix detecting upper bounds of generics of typealiases constructors in NI 2019-01-24 10:53:58 +03:00
Dmitriy Novozhilov
21f0557502 Fix compatibility of CapturedTypeConstructor and NewCapturedTypeConstructor
Now both of those classes implements one interface with `TypeProjection`
  property. That allows old captured type approximator use new captured types.

That change fixes tests related to diagnostics:
- SETTER_PROJECTED_OUT
- DEBUG_INFO_UNRESOLVED_WITH_TARGET
- UNRESOLVED_REFERENCE_WRONG_RECEIVER

Also `typeProjection` property renamed to `projection` according to naming in NI.
2019-01-24 10:53:58 +03:00
Dmitriy Novozhilov
42b333f6fd Update some testdata according to new inference behaviour 2019-01-24 10:53:58 +03:00
Dmitriy Novozhilov
667f5032b6 Minor: reformat CapturedTypeConstructor.kt according to code style 2019-01-24 10:53:58 +03:00
Dmitriy Novozhilov
53432eaf99 Minor: reformat CapturedTypeApproximation.kt according to code style 2019-01-24 10:53:58 +03:00
Dmitriy Novozhilov
2da3366a47 Fix PROTECTED_CONSTRUCTOR_NOT_IN_SUPER_CALL diagnostic in new inference 2019-01-24 10:53:58 +03:00
Dmitriy Novozhilov
090c2998d2 Add running additional receiver checkers in new inference
That commit fix next diagnostics:

* RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS
* NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS (partially, see #KT-29367)
2019-01-24 10:53:58 +03:00
Dmitriy Novozhilov
7f48897e21 Add NON_VARARG_SPREAD and SPREAD_OF_NULLABLE diagnostics to new inference 2019-01-24 10:53:58 +03:00
Toshiaki Kameyama
622fd8d8cf Add intention to add/remove underscores in numeric literal
#KT-28953 Fixed
2019-01-24 09:52:21 +03:00
Toshiaki Kameyama
225a6ea288 Convert parameter to receiver: don't remove 'override' and 'vararg' when function has 'vararg' parameter
#KT-28851 Fixed
2019-01-24 09:49:53 +03:00
Toshiaki Kameyama
de7adf55ff Non-canonical modifiers order: do not highlight annotation
#KT-29238 Fixed
2019-01-24 09:47:54 +03:00
Toshiaki Kameyama
0075e90042 Convert to lambda: report at INFORMATION level if anonymous object super type does not match function parameter type exactly
#KT-28081 Fixed
2019-01-24 09:42:16 +03:00
Toshiaki Kameyama
3649e61c2f Boolean literal arguments: do not report for varargs parameters
#KT-29469 Fixed
2019-01-24 09:40:21 +03:00
Alexey Tsvetkov
8672d2adc0 Remove call to await after kapt work is submitted
Await blocks parallel execution within a project.
Since there are no actions in the task after
`await()`, it is safe to delete the call.
2019-01-23 23:30:28 +03:00
Alexey Tsvetkov
5a6df10522 Measure time spent on backing up and restoring outputs 2019-01-23 23:30:28 +03:00
Alexey Tsvetkov
beabbb95db Enable assertions for Kotlin daemon in Gradle tests 2019-01-23 23:30:28 +03:00
Alexey Tsvetkov
9176f9b254 Fix clearing IC caches on rebuild
Previously IC caches in Gradle were not cleared correctly on rebuild,
because only `clean` method was called, but `flush` and `close`
were not.
2019-01-23 23:30:28 +03:00
Alexey Tsvetkov
7dcdba7e1a Restore outputs when Kotlin task fails
#KT-12295 Fixed

Gradle forces non-incremetnal builds,
when a task failed, but its outputs were changed.
This is an issue for Kotlin incremental compilation,
because it also forces all dependent modules to be rebuilt.
This change fixes the issue by reading all output and
restoring it on a compile error/exception.
This change does not affect non-incremental builds.
2019-01-23 23:30:28 +03:00
Alexey Tsvetkov
467090bd9e Don't override task action in KaptGenerateStubsTask 2019-01-23 23:30:28 +03:00
Mikhail Glukhikh
f782f26c4f ClassClsStubBuilder: do not report errors for nested stubs
We log differently case with obfuscated library (KT-29427)
and regular case (KT-9618 and others)

#KT-29427 Fixed
#KT-9618 Fixed
2019-01-23 18:42:58 +03:00
Denis Zharkov
ae9cd4aa55 Require JVM_TARGET=1.8 in test that depends on the method from JDK8 2019-01-23 18:25:10 +03:00
Mads Ager
fb6eafddf1 JVM_IR: Generate better code for null checks.
Simplify ifs when branches have condition true/false.

Simplify blocks containing only a variable declaration
and a variable get of the same variable. Simplify to
just the condition.

Do not introduce temporary variables for constants for
null checks. Constants have no side-effects and can be
reloaded freely instead of going through a local.

This simplifies code such as "42.toLong()!!" so that the
resulting code has no branches and uses no locals. The
simplifications happen as follows:

```
block
  temp = 42.toLong()
  when
    (temp == null) throw NPE
    (true) load temp

---> null test simplification

block
  temp = 42.toLong()
  when
    (false) throw NPE
    (true) load temp

---> when simplification

block
  temp = 42.toLong()
  load temp

---> block simplification

42.toLong()
```
2019-01-23 15:11:14 +01:00
Vadim Brilyantov
d8309f3bd7 Remove statistics extension points for 182 and 191 bunches 2019-01-23 10:49:56 +03:00
Natalia Selezneva
85bd729715 Fix NPE starting IDE Repl Console
consoleView field is initialized in initAndRun inside invokeLaterIfNeeded call.
This may cause NPE in setupGutters if consoleView isn't initialized yet
^KT-29400 Fixed
2019-01-23 10:39:18 +03:00
Nikolay Krasko
0548454581 Minor: clean warnings in KotlinTypedHandler 2019-01-22 17:07:58 +03:00
Nikolay Krasko
5587af95de Auto-close {}` before identifiers in string only after typed '$' (KT-11143)
#KT-11143 Fixed
2019-01-22 17:07:58 +03:00
Yaroslav Ulanovych
30c2b26339 Do not insert closing brace for string template between open brace and identifier (KT-11143)
#KT-11143 Fixed
2019-01-22 17:07:57 +03:00
Nicolay Mitropolsky
44926df47e DelegatingProgressIndicator.setModalityProgress param made nullable in 191 2019-01-22 16:22:04 +03:00
Dmitry Petrov
ae8a90f7b4 KT-29144 Interface companion object field should always be ACC_PUBLIC 2019-01-22 15:05:51 +03:00
Dmitry Petrov
129ea49d64 Use effective modality for enum class in JVM_IR 2019-01-22 10:52:54 +03:00
Dmitry Petrov
360bfcaf6a KT-29340 Provide effective modality for enum class in IR
* if enum class has abstract members, then it is ABSTRACT
* otherwise, if enum class has entries with members, then it is OPEN
* otherwise, it is FINAL.
2019-01-22 10:52:54 +03:00
Denis Zharkov
efdb4e1d5d Fix assertion caused by wrong equality of DescriptorBasedFunctionHandleForJvm
In case of the same class defined in different modules they contain
different descriptors instances in their scope that might lead
to failing assertion in findConcreteSuperDeclaration
because there are overridden from different modules

It might happen even in the compiler because of different built-in modules
defined for sources-module and for dependencies' one

^KT-29320 Fixed
2019-01-22 09:48:42 +03:00
Vyacheslav Gerasimov
168d2d8cce Add more accept android sdk license hashes 2019-01-22 00:16:24 +03:00
Alexey Tsvetkov
12e481192a Don't use project root as working directory for Kotlin daemon
On windows using a project's root
as a working directory for the daemon
seems to prevent removing the directory
when the daemon runs.

Different projects may share an instance of the daemon,
so the issue will be present only in a project
which started the daemon.
2019-01-21 22:42:55 +03:00
Vyacheslav Gerasimov
f58acbeef5 Build: implement useBootstrapStdlib flag
Excludes stdlib projects from build and uses bootstrap stdlib artifacts

 #KT-29205
2019-01-21 21:09:40 +03:00
Vyacheslav Gerasimov
9973446e02 Update bootstrap to 1.3.30-dev-991 2019-01-21 21:09:40 +03:00
Alexander Udalov
4daee6d282 Extract JVM IR backend module out of compiler/backend
The old backend does not depend on IR modules anymore
2019-01-21 19:06:41 +01:00
Yan Zhulanow
ad974137b8 Remove Android Extensions from the default JPS classpath 2019-01-21 18:50:11 +03:00
Vyacheslav Gerasimov
f30a14ff0f as34: Set until-build to 183.* to support AS 3.4 Beta 2 2019-01-21 18:05:52 +03:00
Vyacheslav Gerasimov
082217a2bd Build: Publish internal maven artifact for jvm-minimal-for-test
#KT-29204
2019-01-21 17:01:43 +03:00
Vyacheslav Gerasimov
1ba80adc7f Build: Publish internal maven artifact for builtins
#KT-29204
2019-01-21 17:01:43 +03:00
Vyacheslav Gerasimov
46d9d5456f Build: Change builtins artifact configuration to default 2019-01-21 17:01:43 +03:00
Vyacheslav Gerasimov
0d8c779190 Build: Change builtins serialization task output directory to local 2019-01-21 17:01:43 +03:00
Mikhail Glukhikh
8201756a4c Use correct project for settings.gradle manipulations #KT-29333 Fixed
Otherwise we get an error "Element from alien project".
See details in added comment.
2019-01-21 14:30:44 +03:00
Mikhael Bogdanov
f10c9206e2 Minor. Fix test data 2019-01-21 12:12:34 +01:00
Mikhael Bogdanov
b763104ca0 Fix package name to fix android tests 2019-01-21 11:21:16 +01:00
Dmitry Petrov
202e992ae3 psi2ir: handle 'this' as reference to a super companion object
In super class constructor arguments, 'this' can be resolved
as a reference to a companion object of a superclass.
This breaks an assumption in psi2ir that 'this' can only refer to some
receiver from the current scope.

If 'this' refers to an 'object' (including 'companion obejct'),
and we are not inside the corresponding class scope,
then 'this' represents a reference to a singleton instance "by name"
(represented as IrGetObjectValue).
2019-01-21 10:56:02 +03:00
Nicolay Mitropolsky
9c8188002d 191: ProjectScopeStatsReporters.kt: adding KotlinMavenTargetTrigger and KotlinJPSTargetTrigger to the bunch 2019-01-19 12:06:42 +03:00
Mads Ager
690b8e0ac9 JVM_IR: Optimize null checks.
Introduce lowering to remove null checks for primitive type
expressions and replace them with true/false. Side-effects
are preserved.

Generate ifnull/ifnonnull instructions for null checks instead
of materializing a null literal for an equality check.
2019-01-19 09:43:43 +01:00
Vadim Brilyantov
f5312f42c5 Collect Maven and JPS targets 2019-01-19 02:37:09 +03:00
Vyacheslav Gerasimov
04b705ef2c 183: Set until-build to 183.*
We have separate plugin for 191 now
2019-01-18 22:52:57 +03:00
Vyacheslav Gerasimov
ff34078663 191: Temporary drop ProjectScopeStatsReporters (apis heavily refactored) 2019-01-18 21:52:45 +03:00
Ilya Chernikov
877dd7ee47 Change default jvmTarget for scripts compilation via jvmhost to 1.8
#KT-29319 fixed
2019-01-18 18:17:47 +01:00
Ilya Chernikov
a6c90f13c2 Implement test for #KT-29301, #KT-29296 and #KT-29293 2019-01-18 18:17:46 +01:00
Ilya Chernikov
5fffeda534 Keep ivy resolvers in the main-kts.jar
#KT-29301 fixed
2019-01-18 18:17:45 +01:00
Ilya Chernikov
2bb5e8f51f Implement and use helpers for economical classpath update in script configs 2019-01-18 18:17:45 +01:00
Ilya Chernikov
c7e5ad861c Allow explicit nulls for props with default, allow null as base classloader for evaluation
and use proper default evaluation configuration if not supplied explicitly;
also add reset method to the properties builder and containsKey method to
the properties collection
#KT-29296 fixed
2019-01-18 18:17:44 +01:00
Ilya Chernikov
086c4fd5b9 Add stdlib, etc. to the script dependencies on compilation
#KT-29293 fixed
2019-01-18 18:17:44 +01:00
Vyacheslav Gerasimov
cf5657e916 as34: Limit AS 3.4 until-build to be lesser than AS 3.5 2019-01-18 20:09:10 +03:00
Vyacheslav Gerasimov
b2db027ded Add constant for AS 3.5 to IdeCompatibilityDsl 2019-01-18 20:09:10 +03:00
Vyacheslav Gerasimov
7aee03a2b0 as35: Set since build to AS 3.5 C1 build number 2019-01-18 20:09:09 +03:00
Vyacheslav Gerasimov
9a4a4d0c14 as35: Add bunch files for AS 3.5 2019-01-18 20:09:09 +03:00
Nikolay Krasko
ad3114aa5f Allow generate closed start tags and do not reorder specific tags 2019-01-18 19:42:44 +03:00
Nikolay Krasko
3548d25095 Introduce wrapper for EditorFactoryListener to warn about compatibility issues 2019-01-18 19:42:43 +03:00
Nikolay Krasko
74bc440e44 Remove all that left from 173 branch 2019-01-18 19:42:43 +03:00
Nikolay Krasko
046a0e059c Always add last version of idea for which change is needed to BUNCH
BUNCH directive should contain last idea IDEA version this change is
meant for.
2019-01-18 19:42:43 +03:00
Alexander Podkhalyuzin
36b2640ab7 Removed usages to deprecated API, which is going to be removed in 2019.1 2019-01-18 17:17:30 +03:00
Natalia Selezneva
76b06cd747 Scratch: associate inlay with preceding text
This allow to avoid some unintentional movements of caret after inserting scratch output
2019-01-18 16:04:53 +03:00
Natalia Selezneva
290ae16235 Scratch: implement interactive mode
^KT-27955 Fixed
2019-01-18 16:04:53 +03:00
Max Medvedev
9b0b3971e4 Wrong position of type hint while renaming Kotlin variable
#KT-19558 fixed
2019-01-18 14:31:46 +03:00
Max Medvedev
a9362d844a Implemented "Complete statement" for completion
#KT-18663 fixed
2019-01-18 14:28:49 +03:00
Ilmir Usmanov
e8c52e0a8f Do not mark fake inliner variables as alive
This prevents them from spilling.
 #KT-29317 Fixed
2019-01-18 13:45:20 +03:00
Ilmir Usmanov
7e4e1b9a4d Add regression test
#KT-29327
2019-01-18 13:44:07 +03:00
Ilmir Usmanov
dc6bb4cd08 Revert "Simplify tail-call optimisation check"
This reverts commit a5bcd3495e.

 #KT-27190: Open
 #KT-29327: Fixed
2019-01-18 13:44:05 +03:00
Mikhael Bogdanov
8fb2633bf4 Minor. Patch test to avoid failing in Native 2019-01-18 09:52:56 +01:00
Anton Yalyshev
a4386cf28a Merge remote-tracking branch 'origin/master' 2019-01-18 11:14:17 +03:00
Andrey Uskov
2659011440 Fix compilation of GradleImportingTestCase in bunches 2019-01-18 00:45:20 +03:00
Georgy Bronnikov
c3352d5fdb Unmute several tests, mute one 2019-01-17 23:46:26 +03:00
Georgy Bronnikov
7df0cffac9 Move declaration origins to IrDeclarationOrigin.kt 2019-01-17 23:46:26 +03:00
Georgy Bronnikov
bccb451afd Add isSyntheic flag to IrDeclarationOrigin 2019-01-17 23:46:26 +03:00
Georgy Bronnikov
ec0842c0f4 Remove descriptors from CallableReferenceLowering 2019-01-17 23:46:26 +03:00
Georgy Bronnikov
67ab8624c3 Add DeepCopyIrTreeWithDescriptors 2019-01-17 23:46:26 +03:00
Georgy Bronnikov
da0a823992 Remove descriptors from LocalDeclarationslowering 2019-01-17 23:46:26 +03:00
Vyacheslav Gerasimov
b525146009 Build: Switch to prebuilt protobuf-lite from teamcity repo
#KT-29202
2019-01-17 20:45:11 +03:00
Vyacheslav Gerasimov
1efd859909 Exclude protobuf-relocated build directory in CodeConformanceTest
#KT-29202
2019-01-17 20:45:11 +03:00
Vyacheslav Gerasimov
c7ab69829e Build: Convert protobuf to includable build with maven publication
#KT-29202
2019-01-17 20:45:11 +03:00
Vyacheslav Gerasimov
6a3e5c4c94 Build: Move protobuf projects to subdirectory
#KT-29202
2019-01-17 20:45:11 +03:00
Ilya Gorbunov
0ac85ad715 Document that sorting is stable in each platform
#KT-12473 Fixed
2019-01-17 18:38:37 +03:00
Ilya Gorbunov
56672c2564 Ensure stable sorting in MutableList.sort/sortWith
MutableList.sortWith now works correctly in JS_IR backend too

#KT-12473
2019-01-17 18:38:23 +03:00
Andrey Uskov
7191624a92 Fix compilation of KotlinGradleProjectResolverExtension in bunches 2019-01-17 17:20:43 +03:00
Denis Zharkov
82537cdc8b Add recovery for missing comma between arguments
^KT-13497 Fixed
2019-01-17 14:58:01 +03:00
Denis Zharkov
37614254d7 Fix test on unused import suppression
Before the fix for KT-7185, the file looked like:
package suppression
@file:Suppress("UnusedImport")

import java.io.* // unused

And it was parsed incorrectly, because @file: annotations
should come before package directive
But after fix, import directives started being parsed that lead
to wrong unused import (because suppression wasn't parsed still)
2019-01-17 14:56:42 +03:00
Denis Zharkov
db53c4bea4 Add test for obsolete recovery case (semi-finished extension)
^KT-7405 Obsolete
2019-01-17 14:56:42 +03:00
Denis Zharkov
65e6e21d0f Add recovery for import lists in the middle of the file
Note, that it only works for top-level declarations

^KT-7185 Fixed
2019-01-17 14:56:42 +03:00
Denis Zharkov
e6710b6fa2 Add recovery for value parameter without type or name
The case for KT-7237 belongs to /NoGTInTypeArguments test
It was fixed implicitly: before it recovery was working but the name for
the next parameter was attached to type argument list.
After that change, parameter without name gets parsed correctly (with an
error of course)

^KT-13731 Fixed
^KT-7237 Fixed
2019-01-17 14:56:42 +03:00
Denis Zharkov
5437a0e478 Add recovery for enum declaration without 'class' keyword
^KT-13703 Fixed
2019-01-17 14:56:42 +03:00
Denis Zharkov
1688fed0b7 Minor. Rename PropertyParsingMode -> DeclarationParsingMode 2019-01-17 14:56:42 +03:00
Denis Zharkov
8b3ffee183 Minor. Rename defaultDetected -> companionDetected 2019-01-17 14:56:42 +03:00
Denis Zharkov
ee75b8c7e5 Minor. Extract KotlinParsing::parseCommonDeclaration 2019-01-17 14:56:42 +03:00
Dmitry Petrov
c1de845d29 Generate switch instruction for 'when' with unsigned subject 2019-01-17 13:49:39 +03:00
Dmitriy Dolovov
3c2d026128 CIDR: Always relax upper limit of product version in K/N plugin for non-public CIDR builds
Issue #KT-29338:fixed
2019-01-17 17:30:16 +07:00
Andrey Uskov
618a7c3747 Improve logging in gradle import tests 2019-01-17 13:20:58 +03:00
Andrey Uskov
5302470f6b Fix "testUnresolvedDependency"
This fix is work-around fixing incompatibility issue between gradle
tooling api bundled in IDEA and gradle tooling api in gradle 4.x.
When null messages were logged it resulted in the following error:
"java.io.StreamCorruptedException: invalid stream header: ED000573"
2019-01-17 13:20:28 +03:00
Dmitry Savvinov
e483f83666 Make 'is'-operator more stupid
Consider following expression: 'call() is Foo'. Suppose that we know
something about the 'call()', e.g. 'returns(foo) -> <condition>'

Previously, we've tried to re-use knowledge about 'call()', constructing
some smart clause, like 'returns(true) -> foo is Foo && <condition>'.

The conceptual error here is that *we can't* argue that <condition>
holds. Imagine that 'call()' actually has unspecified 'returns(foo2) ->
<!condition>', and 'foo2 is Foo' also holds. Then we would get
'returns(true) -> foo2 is Foo && <condition>' <=> 'returns(true) ->
<condition>' for the whole call, which is not correct.

More concrete example would be something like:
'if (!x.isNullOrEmpty() is Boolean)'

^KT-27241 Fixed
2019-01-17 12:47:27 +03:00
Dmitry Savvinov
04ff2a3ee7 Add test on isNullOrEmpty-like contract
Currently, behavior is undesired, see KT-27241
2019-01-17 12:47:27 +03:00
Anton Yalyshev
fe746bd505 drop 182 support, as context info works from 183 2019-01-17 12:43:20 +03:00
Anton Yalyshev
23b0f27f3b moved PluginVersion from collector instance to context for each trigger() 2019-01-17 12:43:18 +03:00
Anton Yalyshev
124ab5a896 added Kotlin plugin version Collector 2019-01-17 12:42:41 +03:00
Andrey Uskov
48d832298b Compile Kotlin project with "-Xjvm-default=compatibility" flag
#KT-29073 Fixed
2019-01-17 12:40:10 +03:00
Andrey Uskov
7da8c41f3f Remove build script bunches in idea/idea-maven 2019-01-17 12:40:09 +03:00
Andrey Uskov
99de00362e Fix NSME during reimport of maven project
#KT-29251 Fixed
2019-01-17 12:40:08 +03:00
Andrey Uskov
68347e89cf Remove build script bunch for 191. The -Xjvm-default flag should be set in the whole project 2019-01-17 12:39:11 +03:00
Anton Yalyshev
53f07536f9 Merge remote-tracking branch 'origin/master' 2019-01-17 11:12:32 +03:00
Mikhail Glukhikh
40b88d874e Fix broken test (KT-18715) 2019-01-17 10:41:31 +03:00
Anton Yalyshev
ebeff1e0d8 Merge remote-tracking branch 'origin/rr/ayalyshev/stat-refactorings-fixes' into rr/ayalyshev/stat-refactorings-fixes
# Conflicts:
#	idea/src/org/jetbrains/kotlin/idea/refactoring/rename/RenameKotlinFileProcessor.kt.173
2019-01-16 22:31:58 +03:00
Anton Yalyshev
30df986f93 removed unused collectors 2019-01-16 22:26:51 +03:00
Anton Yalyshev
e434733341 removed trigger() calls when refactoring is performed automatically or recursively 2019-01-16 22:26:50 +03:00
Anton Yalyshev
70d6020025 Removed second override as findReferences(element: PsiElement) is called anyway. It duplicates trigger(). 2019-01-16 22:26:50 +03:00
Ilmir Usmanov
2ec1222cd1 Fix test data 2019-01-16 20:40:33 +03:00
Ilmir Usmanov
76e9b574cd Put default value to vars iff they are not boxed
#KT-24672 Fixed
2019-01-16 20:40:29 +03:00
Svyatoslav Kuzmich
62322dec5c Regenerate and unmute tests 2019-01-16 16:37:52 +03:00
Mikhail Glukhikh
7908663687 Fix part of tests broken by a71bb709 (too many line breaks were added) 2019-01-16 16:07:41 +03:00
Alexey Tsvetkov
b6102c52b9 Fix kotlin-serialization plugins build scripts
1. There is no need to specify repositories.
2. We don't use 'org.jetbrains.kotlin:gradle-api:1.6' anymore.
3. kotlin-serialization-unshaded does not need dependencies,
because it does not contain source code (it simply packages jar).
2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
3a91db836a Minor: remove workaround for KT-24915 from tests
The issue was fixed in AGP 3.2.0-beta02
2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
c59c5361d1 Test KAPT with AGP 3.1.0 2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
d1cd98cf8b Minor: remove repositories blocks from subprojects of databinding test
Repositories are set in top-level build.gradle file
2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
a59be05792 Fix testDatabinding with AGP 3.0.x
AGP 3.0.x requires explicit 'kapt' dependency on databinding compiler.
Also databinding v2 (enabled by default in AGP 3.2.0) generates different
java classes.
2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
3b806dca68 Drop support for gradle 4.0
#KT-29275 Fixed
2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
9de66c4165 Fix Gradle JS test with Gradle 4.0+ 2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
4110eb3587 Fix AGP version checks in kapt android tests 2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
6782d8c5c8 Use class instead of string to hold AGP version in tests 2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
ca79efdeec Remove unused methods from Gradle plugin 2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
e9abd69fc0 Drop support for Android Gradle plugin 2.x
#KT-27886 Fixed
2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
b51461b5c5 Drop support for Gradle 3.x
#KT-27885 Fixed
2019-01-16 15:57:32 +03:00
Svyatoslav Kuzmich
c92a6f9ca2 [JS IR BE] Unmute inlineClasses tests 2019-01-16 12:11:28 +03:00
Svyatoslav Kuzmich
befc371f6a [JS IR BE] Fix bridges construction function handle 2019-01-16 12:11:28 +03:00
Svyatoslav Kuzmich
912f0a267f [JS IR BE] Use return type in function signature for inline classes
Bridge function should be created when return type of override function
is specialised to unboxed inline class. Thus return type should be used in
function signature.

Non-inline-class return types are not added to signature for interop and
infrastructure reasons ("toString" would become "toString_ret$kotlin_String")
2019-01-16 12:11:27 +03:00
Svyatoslav Kuzmich
ebdbe7ec30 [JS IR BE] Fix fake override functions resolve
Use signature of function 'target' (a real function that will
be called instad of fake override) to make boxing/unboxing decision for
return value and type parameters on call site.
2019-01-16 12:11:27 +03:00
Dmitry Petrov
08abf5f2a2 Specialize unsigned range and progression iterator calls 2019-01-16 11:00:23 +03:00
Dmitry Petrov
723e739960 Minor: convert ProgressionIteratorBasicValue to Kotlin 2019-01-16 11:00:23 +03:00
Felix Guo
a71bb70901 KT-18715: don't swallow comments for if->elvis
Adds a CommentSaver to the IfThenToElvis intention that will save and
restore comments when converting an if expression to elvis expression.
2019-01-16 09:41:06 +03:00
Alexander Udalov
05c25342ad Make CommonToolArguments.nullable
#KT-28974 Fixed
2019-01-15 17:21:43 +01:00
Nicolay Mitropolsky
9559346199 191: Uast: implementation of UMethod.returnTypeReference (KT-29012) 2019-01-15 18:51:50 +03:00
Nicolay Mitropolsky
630b39d6b0 191: Uast: compiling with -Xjvm-default=compatibility 2019-01-15 18:51:49 +03:00
Nicolay Mitropolsky
f4d585f836 Uast: removing unused KotlinUComponentQualifiedReferenceExpression 2019-01-15 17:22:07 +03:00
Nicolay Mitropolsky
c139901889 Uast: all Kotlin versions of org.jetbrains.uast.test.* moved to org.jetbrains.uast.test.*.kotlin
To avoid having same class names in Kotlin and IDEA
2019-01-15 17:22:04 +03:00
Sergey Igushkin
3d208c31c8 Run Gradle integration tests against Gradle 5.1.1 2019-01-15 15:50:15 +03:00
Alexander Gorshenev
2775153c1a Got rid of an unecessary explicit cast. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev
606c622e61 Removed unnecessary nullability marks. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev
1e6240730b Added a TODO statement on special treatment of properties in deserializer. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev
f10e826b52 Less eagerly fail on the boundary between deserializer and DeclarationStubGenerator. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev
884e6e15e9 Added a comment for separate treatment of properties in IrDeserializer interface. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev
32c2e841f2 Reversed DumpIrTree.kt fix for now, as it breaks tests comparing textual IR representation. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev
1ba4770800 A little fix to allow Wrapped and non-Wrapped descriptors to coexist. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev
cea32bd4e3 Minor changes in preparation for IR deserialization. 2019-01-15 14:54:27 +03:00
Mikhail Zarechenskiy
01ab4965b1 [NI] Support SAM conversions in backend for special expressions 2019-01-15 13:14:41 +03:00
Mikhail Zarechenskiy
bcc720f1db [NI] Run arguments checker before outer call checker
This is needed because arguments checker updates unsubstituted and
 non-denotable types (type variables, IntegerValueType...)

 #KT-28718 Fixed
2019-01-15 13:14:41 +03:00
Nikolay Krasko
55498450d1 Minor: extract function without manager parameter 2019-01-15 12:49:48 +03:00
Nikolay Krasko
4e9c8cee70 Drop bunch code by introduction wrapper for PopupChooserBuilder 2019-01-15 12:49:48 +03:00
Denis Zharkov
3707812fc2 Revert "Temporary remove some tests after a fix for KT-24937"
This reverts commit ddb4e8b128.
2019-01-15 12:35:12 +03:00
Ilya Matveev
ac1b4cf6b2 Allow setting test binary linker options using a test compilation
#KT-29254 Fixed
2019-01-15 12:07:55 +07:00
Vyacheslav Gerasimov
2157c777b3 Remove obsolete bunch fixes for 173 & as31 2019-01-14 21:29:03 +03:00
Vyacheslav Gerasimov
b1f25874d8 Remove warnings from incompatible api inspection 2019-01-14 21:29:03 +03:00
Vyacheslav Gerasimov
13d87e8eae Remove as31 bunch files 2019-01-14 21:29:02 +03:00
Vyacheslav Gerasimov
818910267e Remove 173 bunch files 2019-01-14 21:29:02 +03:00
Vyacheslav Gerasimov
96c21297b6 Remove 173 and AS 3.1 from .bunch 2019-01-14 21:29:02 +03:00
Yan Zhulanow
e4087b5a7a Fix testJavacIsLoadedOnce() kapt integration test 2019-01-14 17:41:09 +03:00
Max Medvedev
99ffcda5fc Type hints: don't show hint for qualified constructor calls or enum cases
#KT-29196 fixed
2019-01-14 17:23:45 +03:00
Denis Zharkov
2a156fe90c Do not check target when generating bridges with default impl
In many other places, e.g. org.jetbrains.kotlin.codegen.ClassBodyCodegen#generateDelegatesToDefaultImpl
we implicitly assume that whenever we use a default interface method
our target is 1.8

But here, we don't and it might lead to exception in org.jetbrains.kotlin.backend.common.bridges.BridgesKt#findConcreteSuperDeclaration
when actual target is 1.6 and we extend some AbstractMap implementation
with JDK8 (i.e., with @PlatformDependent getOrDefault)
2019-01-14 14:54:18 +03:00
Denis Zharkov
5ec93f2718 Avoid assertion in bridges-generation for light classes
^KT-11656
2019-01-14 14:54:18 +03:00
Denis Zharkov
e0ff7281b4 Minor. Introduce FunctionHandle::mightBeIncorrectCode 2019-01-14 14:54:18 +03:00
Denis Zharkov
cd51658976 Replace JvmTarget with GenerationState in DescriptorBasedFunctionHandleForJvm 2019-01-14 14:54:18 +03:00
Denis Zharkov
254380d418 Generate special bridges for removeAt/getOrDefault
In case we extending some Map specialization with non-trivial type arguments,
e.g. Map<String, String> from Kotlin point-of-view it has
"remove(String, String)" signature while in Java it's "remove(Object, Object)".

So, we generate an override "remove(String, String)" in first Kotlin class of the hierarchy,
which body delegates to "super.remove(Object, Object)"

Also, we generate a final override for "remove(Object, Object)" to allow
for Java inheritors choose only the version with String while overriding.

The main idea of the fix is to make mayBeUsedAsSuperImplementation
return true in case of PlatformDependent annotations.
Otherwise, we weren't able to choose the impl from the java.util.Map
as a delegate in our bridge.

Another part of the fix is overriding `isDeclaration`:
it was necessary because otherwise bridge-generation algorithm
was assuming that there's already an actual declaration
in the first sub-class (TestMap) in the test and we need to
delegate to the latter instead of the method from the interface

^KT-26069 Fixed
2019-01-14 14:54:18 +03:00
Denis Zharkov
949214c10b Refactor bridges generation for JVM
Make a separate subclass for DescriptorBasedFunctionHandle
to allow customize the behavior without complex abstract concepts
like `areDeclarationAndDefinitionSame`
2019-01-14 14:54:18 +03:00
Denis Zharkov
5cc242e878 Refactor FunctionHandle::isInterfaceDeclaration
- Give it more clear name mayBeUsedAsSuperImplementation
  because defining if it can be used as super-implementation
  this is what it used for
- The meaning is negated, so it's needed to negate its usages and impls
- Also, reuse it in findSuperImplementationForStubDelegation
2019-01-14 14:54:18 +03:00
Denis Zharkov
9736975d52 Minor. Reformat builtinSpecialBridges.kt 2019-01-14 14:54:18 +03:00
Dmitry Petrov
9973d59643 Use java.lang.Long.divideUnsigned/remainderUnsigned in Java 1.8+
#KT-24876
2019-01-14 14:17:52 +03:00
Dmitry Petrov
a344feff5c Convert IntrinsicsMap to Kotlin 2019-01-14 14:17:52 +03:00
Dmitry Savvinov
a4d1a8f60a Get rid of FUNCTOR slice, use lazy value in ContractDecription instead
Functor is an imperative representation of function's contract (contrary
to ContractDescription, which is a declarative one). ContractDescription
is convenient when we deal with sources of contracts declarations
(binaries, source), while Functors are convenient for analyzing code
with contracts.

It means that we have to convert ContractDescription into Functor when
we start working with contracts. This computation isn't trivial, and
Functor and ContractDescription are in 1-1 correspondence, so we would
like to cache Functor for each ContractDescription somewhere.

We used to do this in binding trace, in slice FUNCTOR.

Now, it turns out that this approach causes "Rewrite at slice"
exception, see KT-28847. We won't go into details of why that happens
here, you can see the issue comments for details (but be prepared for the
very long and nitty-gritty story)

This commit removes the problematic slice and introduces another
approach, where Functor is attached to the ContractDescription, computed
lazily and cached here.

^KT-28847 Fixed
2019-01-14 11:11:03 +03:00
Dmitry Savvinov
594a6588f9 Add test on rewrite at slice FUNCTOR 2019-01-14 11:10:37 +03:00
Dmitry Savvinov
0b1ff1a457 Minor: improve rendering of Traces in debugger
- add toString for ObservableBindingTrace (for debugging)
- add toString for LockProtectedTrace (for debugging)
- extract anonymous AbstractFilteringTrace to EffectFilteringTrace
2019-01-14 11:10:37 +03:00
Dmitry Savvinov
69fff12384 Drop LockBasedStorageManager.defaultDebugName, use meaningful name everywhere
Also, drop `createDelegatingWithSameLock` as it was unused
2019-01-14 11:10:37 +03:00
Alexander Podkhalyuzin
893479bd5e Implemented KotlinResolveScopeEnlarger for modules
Before that we had dependency to iml file, which is incorrect
2019-01-14 10:53:41 +03:00
Ting-Yuan Huang
72e351a0e3 Allow specifying isolation mode for KAPT workers
There are a few isolation modes for Gradle workers. KAPT uses 2 of them.

IsolationMode.NONE is the default. It runs workers in Gradle daemon and
is more memory efficient.

IsolationMode.PROCESS forks workers into individual processes. This
keeps some resource leaking annotation processors from affecting the
rest of compilation.

Users can specify kapt.workers.isolation=process, if they need to use
some annotation processor that are known to be resource leaking.
2019-01-11 23:48:09 +03:00
Ilya Gorbunov
a26aa30714 Change implementations of contentEquals and minOf/maxOf for Native
To conform to the behavior in other platforms.
2019-01-11 21:49:19 +03:00
Ilya Gorbunov
a951805218 Refactor: introduce PrimitiveType.isFloatingPoint 2019-01-11 21:49:19 +03:00
Ilya Gorbunov
23950042f6 Clarify how elements of arrays are compared by contentEquals function
Add clarification only for the particular group of overloads including
 arrays of object and floating point numbers.

#KT-22942 Fixed
2019-01-11 21:04:03 +03:00
Ilya Gorbunov
ef278ea030 Improve Any.equals/hashCode docs
- add code formatting
- remove 'reference' adjective, as Kotlin doesn't distinguish primitives from reference types
- add the requirement of inequality to null
- replace inaccurate note with a link to the reference (relates to KT-26604)

#KT-14866
2019-01-11 21:03:19 +03:00
Ilya Gorbunov
51eb21d44b Provide stable sorting when JS engine sorting doesn't look stable
#KT-12473
2019-01-11 20:53:29 +03:00
Ilya Gorbunov
7c3c454654 Remove specialization of toTypedArray for LongArray and BooleanArray in JS
The default implementation for primitive arrays returns an array of correct type.

#KT-29187 Fixed
2019-01-11 20:53:29 +03:00
Sergey Igushkin
8bc7ac32f3 Fixes for review KOTLIN-CR-2599
* Move source artifacts to KotlinVariant classes (since joint Android
 variants may have multiple source artifacts, make it a set)

* Change lowerSpinalCaseName to dashSeparatedName (doesn't transform
 the strings to lower case inside)

* Don't transform the project name to lower case (in the future, it may
 be reasonable to stop transforming the target and component names, too)
 Still transform the target names and the component names.
 Currently, this is the way we don't break existing publications and may
 still reconsider this in the future.

* Add a workaround for a list of GString's assigned to
 publishLibraryVariants

* Check for Android library variants existence in a more strict way,
 report existing variants that are not library variants.
2019-01-11 20:32:38 +03:00
Sergey Igushkin
7e6527ca65 Properly setup localToProject attribute in jvmWithJava (KT-29035)
A dependency on a multiplatform module with a jvmWithJava target failed
to resolve because the 'apiElements' and 'runtimeElements'
configurations didn't have the attribute 'localToProject' set to
'public'.

Those configurations need to have have the attribute set as per the
fix of KT-28795, but it doesn't happen.

Issue #KT-29035 Fixed
2019-01-11 20:32:37 +03:00
Sergey Igushkin
0abd044800 Expose 'allKotlinSourceSets' in KotlinCompilation (KT-28749)
As KotlinCompilation only contains the directly added source sets in its
`kotlinSourceSets` property, we need to provide a convenient way to
collect the whole source sets hierarchy for a compilation.

We added internal `allKotlinSourceSets` some time ago, and it seems
reasonable to expose it as public API.

Issue #KT-28749 Fixed
2019-01-11 20:32:37 +03:00
Sergey Igushkin
0cf95f84cb Link the 'api' configuration to 'apiElements' (KT-28355)
As we introduced the 'api' configurations for Kotlin source sets, the
Java plugin did not link these configurations to its 'apiElements', and
those dependencies would only get published with the 'runtime' scope
through the 'implementation' configuration.

To fix this, manually specify that 'apiElements' extendsFrom 'api'.

Issue #KT-28355 Fixed
2019-01-11 20:32:37 +03:00
Sergey Igushkin
82f13b90e6 Fix transitive dependencies overriding default Kotlin version (KT-28820)
In Gradle 5.0, the 'prefer' function semantics has changed, and now a
transitive dependency version wins over the 'preferred' one. Instead,
'require' has been introduced in 5.0 with the old semantics.

Our users expect that the default Kotlin dependency version will be
at least as new as the plugin version, so we now need to use 'require'
with Gradle 5.0+

Issue KT-28820 Fixed
2019-01-11 20:32:37 +03:00
Sergey Igushkin
f9c45c30a2 Always rewrite dependencies in POMs when publishing an MPP (KT-28482)
As non-Gradle consumers and Gradle consumers with metadata disabled
cannot read Gradle metadata, in POMs (the only source of dependencies
for the consumers mentioned above), we should publish the dependencies
on modules with metadata as the target artifact IDs rather than the root
MPP module ID (e.g. 'foo-jvm' rather than 'foo').

To do that, we rewrite the POMs of the publications even when Gradle
metadata is enabled. Note: in the POMs, a project dependency is already
written in the form of the artifact ID of the root Kotlin software
component, so it complicates the dependencies rewriting a little.

To rewrite third-party dependencies, we detect dependencies that
resolved to no artifact and have a single child in the Gradle
dependencies graph of the resolved configuration – this is what a
dependency looks like which was redirected to another module via
'available-at'.

Issue #KT-28482 Fixed
2019-01-11 20:32:37 +03:00
Sergey Igushkin
2fd524f1c0 Fix failure when creating a compilation in afterEvaluate (KT-28896)
To configure a compilation's sources, we run an action in
`whenEvaluated { ... }`, expecting that the compilation's task already
exists. This was not true with compilations created from a user build
script or a 3rd-party plugin in `afterEvaluate { ... }`.

Fix this by expecting that a task may possibly not exist at that point,
and also using `whenEvaluated { ... }` instead of
`afterEvaluate { ... }` in several places that are executed for each new
compilation as a workaround for
https://github.com/gradle/gradle/issues/1135.

Issue #KT-28896 Fixed
2019-01-11 20:32:37 +03:00
Sergey Igushkin
de5e86ae9f Publish Android variants from multiplatform projects
Also update the code for rewriting the dependencies, as Android variants
have their dependencies configurations formed a bit differently, and
also introduce the logic for choosing the right component by the
configuration name the dependency resolves to.

Issue #KT-27535 Fixed
2019-01-11 20:32:37 +03:00
Sergey Igushkin
9a2dce7ea5 Restructure source JARs logic, move it to components management
Move the logic of attaching a source JAR to a publication to the
components management part, as building a source JAR will be done
differently for Android.
2019-01-11 20:32:36 +03:00
Sergey Igushkin
d211bd53c9 Allow a target to have multiple publications, restructure the code
Instead of exposing a single `component` in a target, allow it to have a
set of `components`, then create a Maven publication for each of the
components.

Move `createUsageContexts` to private API since a target that has
multiple publications may need to create the usage contexts for those
publications differently.

Move some of the components technical stuff to interfaces
`DelegatedToPublication` and
`ComponentWithCoordinatesDelegatedToPublication` in order to reuse it
later for Android's components.
2019-01-11 20:32:36 +03:00
Sergey Igushkin
a6b55cc5d7 refactor: Support creating AndroidProjectHandler from outside the plugin 2019-01-11 20:32:36 +03:00
Roman Artemev
d35b20f764 [JS IR BE] Implement private members lowering to extract private methods from class and transform them into static function
* fix kotlin.Long
 * update tests
2019-01-11 20:28:04 +03:00
Roman Artemev
75996b1c8e [JS IR BE] Fix class generator 2019-01-11 20:28:04 +03:00
Roman Artemev
23fc950ae6 [JS IR BE] Fix suspend function lowering 2019-01-11 20:28:04 +03:00
Ilya Gorbunov
fcef876c7e Update copyright in generated stdlib sources 2019-01-11 19:23:12 +03:00
Andrey Uskov
da6de11c15 Disable GradleFacetImportTest for AS33 and AS34 2019-01-11 18:51:21 +03:00
Andrey Uskov
a9be8aac5a Create Kotlin SDK on load or import project with JS/Common modules
#KT-22590 Fixed
2019-01-11 18:48:24 +03:00
Andrey Uskov
a9df9b22e9 Fix scope detection for MPP projects
#KT-27718 Fixed
#KT-28626 Fixed
2019-01-11 18:47:20 +03:00
Ilya Gorbunov
de1d15aa9a Improve test coverage for contentEquals and minOf/maxOf 2019-01-11 17:41:52 +03:00
Pavel Punegov
dc8cb103c5 Replace class instantiation with object in JS tests 2019-01-11 17:38:58 +03:00
Pavel Punegov
1c4ecd287d DefaultAsserter object. Add function to replace constructor invoke. 2019-01-11 17:38:58 +03:00
Pavel Punegov
ac0f612781 Make kotlin.test asserter be ThreadLocal 2019-01-11 17:38:58 +03:00
Pavel Punegov
4b3693bf37 Exclude native annotations in JS IR tests 2019-01-11 17:38:58 +03:00
Pavel Punegov
122ec85bf0 Add ThreadLocal and SharedImmutable native annotations as OptionalExpectation
to kotlin.native.concurrent
2019-01-11 17:38:58 +03:00
Mikhael Bogdanov
2bdf68ad67 Delete dead code on last optimization step, otherwise ASM will split exception table on it.
ASM has logic that splits exception tables in MethodWriter.computeAllFrames:
     // Loop over all the basic blocks and visit the stack map frames that must be stored in the
     // StackMapTable attribute. Also replace unreachable code with NOP* ATHROW, and remove it from
     // exception handler ranges.
     ...
     firstHandler = Handler.removeRange(firstHandler, basicBlock, nextBasicBlock);
     ...
  https://gitlab.ow2.org/asm/asm/issues/317867

  #KT-28546 Fixed
2019-01-11 15:27:52 +01:00
Mikhael Bogdanov
306a982722 Temporary disable line numbers generation for default values from expect declarations
Proper SMAP support for default values from expect declarations is required.
 Default value in expect declaration could has line number that
 exceed line count in actual file that causes an error

  #KT-23739 Fixed
  #KT-29174 Open
2019-01-11 15:27:51 +01:00
Roman Artemev
c725f4ce32 [JS IR BE] Secondary constructors lowering refactoring
* make it per-file
2019-01-11 16:13:26 +03:00
Anton Yalyshev
e49c350550 removed unused collectors 2019-01-11 15:31:07 +03:00
Anton Yalyshev
4b5c5d77bc removed trigger() calls when refactoring is performed automatically or recursively 2019-01-11 15:31:07 +03:00
Anton Yalyshev
5672e0fb6e Removed second override as findReferences(element: PsiElement) is called anyway. It duplicates trigger(). 2019-01-11 15:31:07 +03:00
Mikhail Glukhikh
927b94a6e0 Regenerate FIR test 2019-01-11 15:14:14 +03:00
Mikhail Zarechenskiy
6361df28fe Fix dependency for Gradle integration tests module
After d5ebe2e6
2019-01-11 14:47:11 +03:00
Sergey Rostov
75e59fdc46 JPS: exclude source roots from other targets
Previously `findJavaRootDescriptor` was return source root for random
module. This cause build errors for mpp (same file may appear in
multiple source roots of common and platform modules)

#KT-28988 Fixed
2019-01-11 12:53:11 +03:00
Dmitry Savvinov
8a0057b387 Introduce specific version of NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY for KT-28061
In 1.3.0 there was introduced KT-28061 bug, which caused some of the
NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY diagnostics to be lost (turning
"red" code into "green")

500dc11514 fixes the bug and returns
lost diagnostics back. This commit adds additional information for some
of the cases where diagnostics were list and then brought back (for the
user sanity).

The heuristic used for detecting cases which need additional information
is simple: if function has return in in-place called lambda, and
NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY should be reported, then we
enhance it with additional information.

^KT-28061 Fixed
2019-01-11 11:44:39 +03:00
Mikhail Glukhikh
4fd773a38b IDEA plugin: remove "Show FIR action" and fir-view without fir.enabled
#KT-28813 Fixed
(it's planned to include FIR in artifacts after 1.3.30)
2019-01-11 09:55:40 +03:00
Mikhail Glukhikh
f0c9a3daa2 FIR: add default simple importing scope to support kotlin.ByteArray etc 2019-01-11 09:55:40 +03:00
Mikhail Glukhikh
6e369e156d FIR: implements multi-module resolve, add tests #KT-24093 Fixed
This commit introduces FIR session provider, dependency provider,
library session + other infrastructure necessary for multi-module resolve
2019-01-11 09:55:40 +03:00
Mikhail Glukhikh
bc82f2f940 Use FirModuleBasedSession with module info, use platform default imports
In this commit, FIR sessions made bound to a particular module
2019-01-11 09:55:40 +03:00
Ilya Matveev
9ca07bc706 Fix linkTaskName getters of K/N compilations 2019-01-11 13:21:46 +07:00
Ilya Matveev
5eea0145b3 Support getting the default K/N test binary from a compilation
Fix for https://github.com/JetBrains/kotlin-native/issues/2487
2019-01-11 13:21:46 +07:00
Mikhail Zarechenskiy
d5ebe2e66a Reorganize dependencies around kotlin-compiler.jar
#KT-26807 Fixed
2019-01-11 00:14:23 +03:00
Ilya Gorbunov
30c769c19a Avoid hitting max argument limit in String(chars)
Rewrite CharArray to String conversions to appending chars one by one.

Refine parameter checking in String(chars, offset, length) to adhere to
the common exception contract and document it.

#KT-29003
2019-01-10 23:35:52 +03:00
Dmitry Petrov
b878626919 Intrinsify 'in' with unsigned ranges 2019-01-10 17:17:51 +03:00
Dmitry Petrov
e6e0e9976c Tests for for-in optimization with unsigned ranges 2019-01-10 17:17:51 +03:00
Dmitry Petrov
a2c618366b Tests for loops with possible index variable overflow 2019-01-10 17:17:51 +03:00
Dmitry Petrov
54cba32426 Support unsigned range and progression values in range intrinsics 2019-01-10 17:17:51 +03:00
Dmitry Petrov
68e2d8dcd9 Support unsigned integers in intrinsic range values 2019-01-10 17:17:51 +03:00
Dmitry Petrov
d22a31cb90 Use elementKotlinType in primitive number range intrinsics 2019-01-10 17:17:51 +03:00
Dmitry Petrov
5ae8df4d88 Use ComparisonGenerator for range element type in counter loops 2019-01-10 17:17:51 +03:00
Dmitry Petrov
4e48ce02f1 Minor: move RangeCodegenUtil to range package 2019-01-10 17:17:51 +03:00
Dmitry Petrov
fc94254320 Minor: refactor getRangeOrProgressionElementType + reformat 2019-01-10 17:17:51 +03:00
Dmitry Petrov
6414abb277 Minor: reformat & optimize imports 2019-01-10 17:17:51 +03:00
Igor Chevdar
e640f01b4e Fixed bug with IR parameter copying.
Constructors don't have their own type parameters
but rather inherit them from the parent.
2019-01-10 14:35:11 +03:00
Igor Chevdar
1bef26c80e [JS IR] Fixed bug with constructors type parameters 2019-01-10 14:35:11 +03:00
Igor Chevdar
5afa44edea Added a coroutine test 2019-01-10 14:35:11 +03:00
Igor Chevdar
1eaf2d2c42 Typo fix 2019-01-10 14:35:11 +03:00
Igor Chevdar
2c0f93b133 IR: Supported special coroutine intrinsic
See https://youtrack.jetbrains.com/issue/KT-26317 for details
2019-01-10 14:35:11 +03:00
Igor Chevdar
621a9bd1df Removed a Native specific lowering 2019-01-10 14:35:10 +03:00
Igor Chevdar
9fee03ca81 IR: Fixed some parents 2019-01-10 14:35:10 +03:00
Igor Chevdar
a78b80f8bf IR fixes to help symbolization of K/N 2019-01-10 14:35:10 +03:00
Roman Artemev
d363763420 Fix wrapped descriptors 2019-01-10 14:35:10 +03:00
Denis Zharkov
2b40ecfd29 Fix exception in ultra-light classes in case of complex mpp hierarchy
Without the introduced override, default implementation of isEquivalentTo
runs delegate computation of `another` that is illegal
for KtUltraLightClass

^KT-28912 Fixed
2019-01-10 14:11:20 +03:00
denisgaebler
be881442da One more fix for MinGW path in K/N runner 2019-01-10 17:29:34 +07:00
Ilya Chernikov
02f2c941c8 Add import support to main-kts, with test 2019-01-10 10:59:32 +01:00
Ilya Chernikov
4571e273a4 Add shared script instances support, fix and refactor evaluation accordingly
also fix arguments order in the evaluator
2019-01-10 10:59:32 +01:00
Ilya Chernikov
7bb4233e17 Add mapping function for transformations with ResultsWithDiagnostics
also improve chaining helpers
2019-01-10 10:59:32 +01:00
Ilya Chernikov
01f2a21192 [minor] add comment to the "Fix locking in script definition provider" commit 2019-01-10 10:59:32 +01:00
Ilya Chernikov
e5febddaf7 [minor] fix scripting test on windows 2019-01-10 10:59:32 +01:00
denisgaebler
1ca2e4fdba Update JavaSdkUtil.java
Added path for IBM JDK on platform z/OS
2019-01-10 12:46:05 +03:00
Anton Yalyshev
c809cfd800 Merge branch 'rr/ayalyshev/KT-29062' 2019-01-10 12:05:53 +03:00
Mikhail Glukhikh
7095182e2d FIR: support suspend functions #KT-24084 Fixed 2019-01-10 10:51:28 +03:00
Mikhail Glukhikh
7aba441234 FIR tree: support const expressions (adds IR dependency) #KT-24023 Fixed
Also support generic tree elements in FIR visitor generator
2019-01-10 10:51:08 +03:00
Mikhail Glukhikh
18ea86cfb4 Remove parentheses: add semicolon before lambda if necessary
In 2010b175, it was suggested just not to suggest parentheses removal.
However, it contradicts with behaviour of "Replace contains" which
adds semicolon before lambda in this case. So in this commit I made
behaviour of remove parentheses the same.

This commit reverts production part of 2010b175
Fixes failing test of "replace contains"
2019-01-10 10:45:46 +03:00
Sergey Rostov
62222460b6 JPS build, workarounds for idea importing: fix runtime classpath 2019-01-10 08:50:41 +03:00
Sergey Rostov
5cda676c9f JPS: Print components of CacheVersion, add tests 2019-01-10 08:50:39 +03:00
Sergey Rostov
b3985d2735 JPS: remove cache version from test data 2019-01-10 08:50:38 +03:00
Andrey Uskov
b6aed5b98a Change task creation with task registration in Kotlin plugin
#KT-27657 Fixed
2019-01-10 01:41:21 +03:00
Yan Zhulanow
7d660834e1 Fix 'CommandLineProcessor' extension point calling, switch it to using ServiceLoaderLite 2019-01-09 21:54:52 +03:00
Yan Zhulanow
34818b0bbe Remove JPS support for Android Extensions 2019-01-09 21:54:52 +03:00
Alexander Udalov
cca6ba38be Add tests for obsolete codegen issues
#KT-16790 Obsolete
 #KT-16858 Obsolete
 #KT-17441 Obsolete
2019-01-09 19:18:54 +01:00
Mikhael Bogdanov
0bb97cf590 Add test for Obsolete issue
#KT-12208 Obsolete
2019-01-09 16:00:03 +01:00
Ilya Matveev
dcaa56bc0b Fix MinGW path in Kotlin/Native runner 2019-01-09 20:43:29 +07:00
Anton Yalyshev
ef8bbafeff Checked null condition for JPanel createDestinationRootPanel() #KT-29062 Fixed 2019-01-09 13:04:23 +03:00
Anton Yalyshev
bec07ae7d9 createFileFromTemplate() call from ExtractSuperRefactoring doesn't affect statistics trigger anymore 2019-01-09 12:29:15 +03:00
Anton Yalyshev
a893a26585 Added statistics for Scratches to new_file_templates collector 2019-01-09 12:29:15 +03:00
Anton Yalyshev
6510c17804 Added statistics collector for new_file_templates and set trigger to createFileFromTemplate 2019-01-09 12:29:14 +03:00
Mikhael Bogdanov
f7ce8c18c6 Add tests for Obsolete issues
#KT-18977 Obsolete
2019-01-09 10:20:54 +01:00
Toshiaki Kameyama
f389c31d8e Replace with binary operator: don't highlight when receiver is dynamic type
#KT-28773 Fixed
2019-01-09 12:17:40 +03:00
Toshiaki Kameyama
2010b1756e Remove unnecessary parentheses: don't suggest when parentheses are for lambda 2019-01-09 12:16:01 +03:00
Toshiaki Kameyama
05d8932fa6 Remove useless cast: don't remove parentheses for lambda
#KT-28641 Fixed
2019-01-09 12:16:01 +03:00
Toshiaki Kameyama
d02867a831 Add "Wrap with array literal" quick fix for annotation parameters
#KT-28969 Fixed
2019-01-09 12:12:27 +03:00
Toshiaki Kameyama
53b0aa5813 "Wrap element with arrayOf() call": don't suggest for annotation parameters
#KT-28969 Fixed
2019-01-09 12:12:27 +03:00
Nicolay Mitropolsky
41b6bcf8c3 Converting object literal to class allows to choose a name (KT-19254) 2019-01-09 11:12:47 +03:00
Alexander Udalov
a9afee77d7 Add tests for obsolete codegen issues
#KT-8203 Obsolete
 #KT-15950 Obsolete
2019-01-08 20:43:46 +01:00
Mikhael Bogdanov
9a059809bf Add test for Obsolete issues
#KT-15956 Obsolete
 #KT-15751 Obsolete
 #KT-16417 Obsolete
 #KT-21787 Obsolete
2019-01-08 13:52:47 +01:00
Mikhael Bogdanov
6a19e45e27 Avoid ConcurrentModificationException
#KT-26384 Fixed
2019-01-08 13:52:46 +01:00
Mikhael Bogdanov
8ce7112123 New tests for TYPE_USE annotations in enums and inner classes
Main test data  (testName.txt) a not totally valid cause of IDEA-205039.
 Javac test data (testName.javac.txt) a not valid
 cause of type annotations support absence.
 Runtime tests are disabled cause reflection support absence.
2019-01-08 13:52:45 +01:00
Mads Ager
57489febf0 JVM IR: simplify chains of negations in if conditions.
Introduce lowering phase that turns !!exp -> exp for the boolean
'not' builtin. This makes sure that code such as

```
if (!!!!!booleanValue) {
    doStuff()
}
```

generates only one branch.
2019-01-08 12:09:23 +01:00
Mikhael Bogdanov
90c787e102 Minor. Reformat code 2019-01-07 15:49:27 +01:00
Mikhael Bogdanov
cfc21ffa56 Test for obsolete KT-16496
#KT-16496 Obsolete
2019-01-07 15:49:26 +01:00
Nikolay Krasko
c968a362f6 Fix test data after file rename 2019-01-06 01:08:25 +03:00
Toshiaki Kameyama
827e04ae3e Keyword completion: add "class/interface/object + filename" completion for top level (KT-28394)
#KT-28394 Fixed
2019-01-05 19:06:22 +03:00
Toshiaki Kameyama
ed9d53acaa Keyword completion: do not add braces after 'companion object' (KT-27915)
^KT-27915 Fixed
2019-01-05 19:00:25 +03:00
Toshiaki Kameyama
18ed031e7e Fix completion for back-ticked name (KT-19863, KT-19864)
^KT-19863 Fixed
^KT-19864 Fixed
2019-01-05 18:52:26 +03:00
Mads Ager
864b90f8c0 JVM_IR: Do not materialize negated boolean for branches.
Instead, flip the branch targets. This generates java byte code
such as:

   L2
    IFNE L3
    ALOAD 0
    INVOKEVIRTUAL A.getX ()F
    GOTO L4
   L3

instead of:

   L2
    IFNE L3
    ICONST_1
    GOTO L4
   L3
    ICONST_0
   L4
    IFEQ L5
    ALOAD 0
    INVOKEVIRTUAL A.getX ()F
    GOTO L6
   L5
2019-01-03 08:21:31 +01:00
Mikhael Bogdanov
02d9c526e2 Proper resort variables on inlining lowered ir closures
Original problem is that lowered ir closures doesn't meet inliner expectations
 about captured variable position in inlining method.
 E.g.: Call 'foo(valueParam) { capturedParam }' to
  inline function 'foo' with declaration

      inline fun foo(valueParam: Foo, inlineParamWithCaptured: Bar.() ->) ....

 is reorganized through inlining to equivalent call foo(valueParam, capturedParam1, cp2 ...).
 But lowered closure for lambda parameter has totally different parameters order:

     fun loweredLambda$x(extensionReceiver, captured1, cp2..., valueParam1, vp2...)

 So before inlining lowered closure should be transformed to

     fun loweredLambda$x(extensionReceiver, valueParam1, vp2..., captured1, cp2..)

 #KT-28547 Fixed
2019-01-03 07:57:36 +01:00
Mikhael Bogdanov
fcf8ea44b2 Update copyright in generated FIR related stuff 2019-01-03 07:45:16 +01:00
Mikhael Bogdanov
dfee1787e5 Regenerate builtins 2019-01-02 14:47:48 +01:00
Mikhael Bogdanov
e963c52c80 Update copyright in generated non-compiler tests 2019-01-02 13:34:03 +01:00
Mikhael Bogdanov
e0bcba5c0e Add test for obsolete KT-17431 issue
#KT-17431 Obsolete
2019-01-02 12:37:07 +01:00
Mikhael Bogdanov
cf47bc0130 Update copyright in generated compiler tests 2019-01-02 12:37:06 +01:00
Mikhael Bogdanov
6bf70a5dd2 Properly find invoke method on default lambda inlining
In general case parameter type could differ from actual default lambda type.
  E.g.: fun inlineFun(s: (Child) -> Base = { a: Base -> a as Child}),
  where type of default lambda is '(Base) -> Child'.
  In such case we should find somehow actual invoke method in bytecode knowing
  only name, number of parameters and that's actual invoke is non-synthetic
  regardless of bridge one.

  #KT-21946 Fixed
2019-01-02 12:37:06 +01:00
Toshiaki Kameyama
3040a2b145 Add quickfix for RETURN_TYPE_MISMATCH_ON_OVERRIDE
#KT-27972 Fixed
2018-12-29 10:41:14 +03:00
Vyacheslav Gerasimov
683ed4eb95 Build: Add asm-7 sources
#KT-29044 Fixed
2018-12-28 21:18:33 +03:00
Vyacheslav Gerasimov
ad85707a2d Build: move buildscripts & versions from root directory to ./gradle
javaInstrumentation.gradle.kts
report.gradle.kts
versions.gradle.kts
and all versions.properties
2018-12-28 21:18:33 +03:00
Nikita Katkov
4db9174b4d Error on calling suspend functions inside Lock.withLock body
See SuspensionPointInsideCriticalSectionChecker
2018-12-28 19:56:26 +03:00
Ilmir Usmanov
1d52fb2e26 Fix test data 2018-12-28 19:51:59 +03:00
Vyacheslav Gerasimov
343560c533 181: Fix QuickFixTestGenerated$TypeMismatch.testParamTypeLambdaMismatch 2018-12-28 19:01:39 +03:00
Nicolay Mitropolsky
19108d8821 InterpolatedStringInjectorProcessor in functional-style 2018-12-28 15:12:54 +03:00
Ilmir Usmanov
8a01da6ec6 Support val initialization in non-inline function with EXACTLY_ONCE effect
by generating a box for the value.
 #KT-26126 Fixed
2018-12-28 15:09:11 +03:00
Ilmir Usmanov
a52f430d8f Put default value (null or zero) to slot for uninitialized values
This way range of the variable is correct in LVT.
 #KT-24672 Fixed
2018-12-28 15:09:07 +03:00
Alexander Udalov
8ab9226805 Fix loading default Java annotation values in actual typealias from binary classes
#KT-22704 Fixed
2018-12-28 13:02:15 +01:00
Alexander Udalov
3fee84b966 Use fast .class file reading implementation in boxAgainstJava tests
Since these tests compile Kotlin code against compiled Java code, it's
only reasonable to use the same .class file reading implementation as is
used in production for the same purpose
2018-12-28 12:53:10 +01:00
Ilmir Usmanov
871134cff8 Update test data
#KT-28309
2018-12-28 14:18:39 +03:00
Ilmir Usmanov
666fec41b9 Do not spill fake variables
#KT-28309
2018-12-28 14:18:39 +03:00
Ilmir Usmanov
ab472793ed Add continuation parameter of suspend lambda's invoke to frame map
thus it will not overlap with $i$a and $i$f fake variables.
 #KT-28309
2018-12-28 14:18:38 +03:00
Ilmir Usmanov
a107b5d6b6 Set type of inliner's fake variable slots to int by storing 0
Otherwise, D8 drops the whole LVT.
 #KT-28309 Fixed
2018-12-28 14:18:37 +03:00
Nicolay Mitropolsky
55404ea00d 191: Making MockExternalAnnotationsManager not throwing exceptions in non action-required cases 2018-12-28 11:56:08 +03:00
Nicolay Mitropolsky
5d2002c742 Fixes to be compatible with IDEA 191 2018-12-28 11:54:30 +03:00
Simon Ogorodnik
cfb446df9e Move FIR tests to fir modules 2018-12-27 21:32:22 +03:00
Mikhail Glukhikh
95af0268b8 FIR: add transformer consistency test 2018-12-27 21:32:22 +03:00
Mikhail Glukhikh
cdc536b147 Add visitor consistency test 2018-12-27 21:32:21 +03:00
Mikhail Glukhikh
5716bda15d Raw FIR builder: add performance test to build FIR for all Kotlin
#KT-24086 Fixed
2018-12-27 21:32:21 +03:00
goodsauce
72be9ef738 #KT-27670 Add quick fix: wrap expression in a lambda if compatible functional type is required (#2010) 2018-12-27 20:12:10 +03:00
Mikhail Glukhikh
ed8d9be483 Fix EA-125880 2018-12-27 20:10:05 +03:00
Mikhail Glukhikh
8de2ff2163 Improve expect / actual markers on one line
Before this commit, only one-line enums and annotation classes were
considered. Now we can have enum header on one line and
some entries on another lines, and it still works.
Same with primary constructor parameters.

#KT-22637 Fixed
2018-12-27 19:45:28 +03:00
Mikhail Glukhikh
cdef811c55 Do not report "redundant arrow" with parameters without expected type
#KT-29049 Fixed
Part of KT-29005
2018-12-27 19:21:34 +03:00
Nicolay Mitropolsky
ebd6caaa71 Light-annotations: fix for reading class-literal varargs (KT-29027, IDEA-204252) 2018-12-27 16:04:05 +03:00
Alexander Udalov
bcb220b919 Minor, uncomment previously non-working code in test data 2018-12-27 13:12:38 +01:00
Dmitriy Dolovov
af4c2b8030 Fix: Rebuild common or native module with Delegate to gradle does nothing
Issues #KT-27295:fixed, #KT-27296:fixed
2018-12-27 18:24:43 +07:00
Nikolay Krasko
3b0cb2258a Notify about incompatible methods in ExtensionPointName 2018-12-26 21:10:03 +03:00
Nikolay Krasko
5a40fc8679 Add UI options for comments generation (KT-5590)
#KT-5590 Fixed
2018-12-26 21:10:03 +03:00
Nikolay Krasko
3eb4895acf Refactoring: rewrite without local any values 2018-12-26 21:09:28 +03:00
Nikolay Krasko
b232386d9d Fix losing suffix in multiline literals with interpolation (KT-29013)
Element was looped in internal loop, but this was missing in add suffix
check.
2018-12-26 21:09:28 +03:00
Vadim Brilyantov
6d8439e9fb add kotlinTarget field to non-mpp kotlin gradle model 2018-12-26 20:09:14 +03:00
Vadim Brilyantov
7e41384a60 add more precise target reporting with presets
fix report message to be more useful
2018-12-26 20:09:13 +03:00
Vadim Brilyantov
7e374e0f5a fix target statistics: report target_platform_id istead of target_name 2018-12-26 20:09:11 +03:00
Ilya Gorbunov
743d0f4917 Refactor kotlin-stdlib-gen
- Make targetsToGenerate Collection to accept set in addition to list
- Unify generated file name schema to '_<source name><platform suffix>.kt'
2018-12-26 19:53:11 +03:00
Ilya Gorbunov
5584b435dc Provide implementation templates for Native platform 2018-12-26 19:52:50 +03:00
Ilya Gorbunov
f05efd58de Support Native target platform in kotlin-stdlib-gen
- Allow to select target platform and target directory to generate source for
- Put copyright profile to resources to have it in the resulting jar
- Output error for missing bodies, but do not stop generation on the first error
2018-12-26 19:52:49 +03:00
kenji tomita
7b43d5c972 Add inspection for converting !collection.isEmpty() -> isNotEmpty()
#KT-27556 Fixed
2018-12-26 19:25:14 +03:00
Toshiaki Kameyama
538a746df9 Introduce "Function with = { ... }" inspection
#KT-17119 Fixed
2018-12-26 19:14:06 +03:00
Toshiaki Kameyama
301b3aad06 Condition of 'if' expression is constant: report enum entries comparison
#KT-28803 Fixed
2018-12-26 19:04:22 +03:00
Leonid Startsev
662c1b6d4a Make serialization plugin for Maven consistent with all other plugins:
Use correct import handler because old one was not working in IDE
Change maven artifact id to match pattern from other plugins
2018-12-26 18:53:53 +03:00
Mikhail Glukhikh
8420fceb8c Support '.toType()' and literal fixes related to unsigned type mismatch
#KT-26836 Fixed
2018-12-26 18:21:49 +03:00
Mikhail Glukhikh
73b6148407 Do not suggest cast for SIGNED_CONSTANT_CONVERTED_TO_UNSIGNED
Related to KT-27590
2018-12-26 18:21:49 +03:00
Mikhail Glukhikh
d7ce79cc76 Suggest quick-fixes for SIGNED_CONSTANT_CONVERTED_TO_UNSIGNED
#KT-27590 Fixed
2018-12-26 18:21:49 +03:00
Ilya Gorbunov
9289a2c573 Remove redundant clause from 'until' function docs 2018-12-26 17:54:56 +03:00
Natalia Selezneva
022b21efa0 Scratch: move 'Make module' checkbox closer to modules combobox
^KT-28910
2018-12-26 16:56:49 +03:00
Natalia Selezneva
404c3ea57b Set scratch file extension using API for IDEA 182 or higher 2018-12-26 16:56:49 +03:00
Natalia Selezneva
6eff314b9d Script tests: check that script is highlighted 2018-12-26 16:56:49 +03:00
Natalia Selezneva
d389c9fd85 Refactoring: move scratch options to ScratchFile from ScratchPanel 2018-12-26 16:56:49 +03:00
Natalia Selezneva
a408711f37 Scratch: do not show error message when scratch execution is cancelled by user 2018-12-26 16:56:49 +03:00
Natalia Selezneva
2fbbf2400d Refactoring: unify methods to report errors in scratches 2018-12-26 16:56:48 +03:00
Natalia Selezneva
2f32c6e164 Refactoring: move test output handler to separate class 2018-12-26 16:56:48 +03:00
Natalia Selezneva
392e69c690 Refactoring: add composite output handler to avoid multiple forEach calls 2018-12-26 16:56:48 +03:00
Natalia Selezneva
2511f70bd9 Scratch: implement stop action
^KT-28643 Fixed
2018-12-26 16:56:48 +03:00
Natalia Selezneva
d403514cee Scratch: get scratch panel from selected editor
CommonDataKeys.EDITOR key isn't present for some events (for example when user click on isRepl checkbox on scratch panel or there isn't any file open in the editor)
^KT-28045 Fixed
2018-12-26 16:56:47 +03:00
Natalia Selezneva
59a32ff94d Refactoring: use output handlers to make action enabled or disabled 2018-12-26 16:56:47 +03:00
Vyacheslav Gerasimov
38d836dece Build: Don't instrument NotNulls during form instrumentation 2018-12-26 16:39:24 +03:00
Vyacheslav Gerasimov
f40635c2d2 Reformat instrument.kt 2018-12-26 16:39:23 +03:00
Nikolay Krasko
571ee4a1fe Don't ruin indentation for comments inside expression declarations (KT-23295)
#KT-23295 Fixed
2018-12-26 15:39:40 +03:00
Nikolay Krasko
36a6c0881c Check file is valid before executing toPsiFile (EA-133882) 2018-12-26 15:39:40 +03:00
Nikolay Krasko
3e55b6e9f5 Consider qualified name is null if some part is null (EA-126499) 2018-12-26 15:39:39 +03:00
Andrey Uskov
62c5972eca Minor refactoring in MoveKotlinDeclarationsHandler during unique container calculation 2018-12-26 15:31:44 +03:00
Mikhail Glukhikh
c0c9841e62 Switch laziness OFF in script light classes tests
Laziness works no more in this tests after dummyContextProvider is removed
for script light classes (see fix of KT-25395).

However, now 2/2 script light classes tests still fail in IDE mode,
because after fix of KT-26505 IDE light classes do not see
ScriptTemplateWithArgs as super-class
2018-12-26 15:11:26 +03:00
Max Medvedev
2621c7fc9e Appcode/CLion: fix a couple of boolean property usages 2018-12-26 14:32:02 +03:00
Mikhail Glukhikh
a9147ff446 More tests for KT-28997, fix isLocal for anonymous object in script 2018-12-26 12:53:25 +03:00
Mikhail Glukhikh
661ac711c0 Fix light class generation for local classes in scripts
Before this commit, we used script context for all classes
defined in script. However, for local classes in scripts it's mistake,
and now we generate them as usual, despite of the fact we are in script.

#KT-28997 Fixed
2018-12-26 12:53:24 +03:00
Sergey Rostov
883970fadb Add explicit dependencies to nullable annotations 2018-12-26 09:07:06 +03:00
Sergey Rostov
423653d225 JPS build: workarounds for idea importing 2018-12-26 09:02:44 +03:00
Sergey Rostov
ea0cf659b0 AbstractMultiPlatformIntegrationTest: search stdlib-common in dist 2018-12-26 08:43:00 +03:00
Sergey Rostov
c6b4117fb9 ScriptGenTest: search classes in JPS from native IDEA gradle import output too 2018-12-26 08:43:00 +03:00
Sergey Rostov
8d8d6ece88 kotlin-ant: move resources to separate folder 2018-12-26 08:43:00 +03:00
Sergey Rostov
74271cfecd JPS: Use module name from compiler arguments (JVM) 2018-12-26 08:43:00 +03:00
Ilya Gorbunov
37e706ef12 Remove fixed default values of org.gradle.* properties
To allow overriding them with local host gradle.properties, for example to enable locally 'org.gradle.parallel=true'.
2018-12-26 05:17:08 +03:00
Ilya Gorbunov
7f8263ec4e Fix gradle default encoding to UTF-8
To avoid platform-dependent filtering charset in copy tasks.
2018-12-26 05:17:08 +03:00
Ilya Gorbunov
6a9ceb2af7 Add more convenient aggregate tasks for core libraries
Add 'coreLibs*' aggregate tasks for 'clean', 'assemble', 'install'
and 'dist' tasks of core libs projects.
Remove '-jre7/8' libs from the list of core libs.
2018-12-25 19:34:25 +03:00
Andrey Uskov
bc71a7605a Fix KNPE in introduce when expression (EA-118718) 2018-12-25 19:27:02 +03:00
Andrey Uskov
69613d25f0 Fix KNPE during enable unsupported feature (EA-129025) 2018-12-25 19:26:14 +03:00
Andrey Uskov
467d5a3cf0 Fix KNPE during move nested class to upper level (EA-128165) 2018-12-25 19:25:47 +03:00
Andrey Uskov
9ec8ec4f3d Fix KNPE during lookup items calculation (EA-130318) 2018-12-25 19:25:27 +03:00
Andrey Uskov
95caabf22f Fix KNPE in introduce new variable (EA-131176) 2018-12-25 19:25:06 +03:00
Andrey Uskov
710baf969f Fix KNPE during adding new parameter to constructor (EA-125789) 2018-12-25 19:24:37 +03:00
Andrey Uskov
d4e5620b9c Fix KNPE in FacetSettings (EA-132084) 2018-12-25 19:22:25 +03:00
Andrey Uskov
1ec63c16f8 Fix KNPE in Introduce new variable (EA-132675) 2018-12-25 19:22:08 +03:00
Andrey Uskov
7dcb9db8cb Fix KNPE during language level calculation (EA-132679) 2018-12-25 19:21:29 +03:00
Andrey Uskov
c24520e2bd Fix KNPE in build template (EA-133006) 2018-12-25 19:21:03 +03:00
victor.petukhov
04fa6e8ab4 Add tests for local variables with type parameters (KT-8341) 2018-12-25 17:51:05 +03:00
victor.petukhov
a72515d822 Add tests for constructors of annotation classes with JvmOverloads (KT-25702) 2018-12-25 17:50:55 +03:00
Simon Ogorodnik
ea24a3c602 KT-28898: Optimize type-alias extensions and type-alias expansions lookup
#KT-28898 Fixed
2018-12-25 16:49:47 +03:00
Natalia Selezneva
9dc57567e4 Kotlin code fragments in markdown should have script definition because they are parsed as scripts 2018-12-25 15:32:27 +03:00
Natalia Selezneva
4e6fb84bae Create one instance of StandardIdeScriptDefinition per project
ScriptModuleInfo for scripts outside source roots in compared by virtualFile and script definition.
So when we use ScriptDefinitionsManaged.getDefaultScriptDefinition we shouldn't create a new one on each call

EA-132810 - assert: DiagnoseUnknownModuleInfoReporter.report
2018-12-25 15:32:26 +03:00
Natalia Selezneva
ba2f211384 Remove ScriptModificationListener from 183 branch
Since 183 changes in .gradle.kts files are tracked correctly by platform and notification 'Gradle project needs to be imported' is shown when those files are modified
2018-12-25 15:32:26 +03:00
Natalia Selezneva
6042a3a0f7 Scripts: fix NPE during accessing ScriptDependenciesCache
Getting value from SLRUMap needs write lock, because it can move value from one queue to another
EA-105195 Fixed
2018-12-25 15:32:26 +03:00
Natalia Selezneva
8ceae8bd6d Fix 'Invalid file' exception during script dependencies update
Fix EA-125840 - assert: FileManagerImpl.findFile
2018-12-25 15:32:25 +03:00
Natalia Selezneva
816a8d74a2 Fix order of initialization of project language version in ConfigureKotlinTest
Project.getLanguageVersion with contextModule == null returns latest stable version.
But Module.getLanguageVersion save it's version to project setting if useProjectSettings checkbox is selected.
So Project.getLanguageVersion can return different versions before and after invocation Module.getLanguageVersion
2018-12-25 15:32:25 +03:00
Dmitriy Dolovov
073c02c0f5 CIDR: Ability to relax upper limit of product version in K/N plugin
Issue #KT-29006:fixed
2018-12-25 18:54:21 +07:00
Dmitry Petrov
61ebe6a9aa Minor: add non-intrinsified cases for javaObjectType/javaPrimitiveType 2018-12-25 13:23:48 +03:00
Toshiaki Kameyama
d00236d366 "Remove redundant backticks": Fix false positive for underscore
#KT-28592 Fixed
2018-12-25 10:37:18 +03:00
Mikhail Zarechenskiy
84222afe2f Fix exception when expected type is subtype of a function type
#KT-28984 Fixed
 #EA-132850 Fixed
2018-12-24 19:41:51 +03:00
Simon Ogorodnik
68c65a5014 KT-25156: Fix stack overflow on top level destructuring with lambda init
Support destructuring in additional resolve pass (resolveToElements)
 #KT-25156 Fixed
2018-12-24 18:29:48 +03:00
Simon Ogorodnik
fefd2bf427 KT-23268: Highlight destructuring declaration entries as properties
#KT-23268 Fixed
2018-12-24 18:29:47 +03:00
Dmitry Petrov
a4897641d4 Minor: mute some tests in JS/JS_IR 2018-12-24 16:10:35 +03:00
Dmitry Petrov
6768ae02c3 Support inline classes in javaObjectType/javaPrimitiveType
#KT-28290 Fixed Target versions 1.3.30
2018-12-24 16:10:31 +03:00
Dmitry Petrov
5abbf3562b Unbox possibly null inline class value mapped to primitive type 2018-12-24 16:09:48 +03:00
Dmitry Petrov
2f6c4a0472 Use original method signature to call accessor for hidden constructor
#KT-28855 Fixed Target versions 1.3.30
2018-12-24 16:09:44 +03:00
Ilmir Usmanov
10f0a2f660 Obtain correct captured suspend local function
if we call the function inside, for example, lambda.
 #KT-28844 Fixed
2018-12-24 15:58:10 +03:00
Mikhael Bogdanov
ac5f5bd453 Get rid of jvm specific code in some tests 2018-12-24 13:40:40 +01:00
Mikhail Glukhikh
7d51be17c8 Extract 'PsiElement.hasJavaResolutionFacade()' (related to KT-28199) 2018-12-24 15:00:57 +03:00
Mikhail Glukhikh
d599bb160f Launch constructor delegation search only for elements from a file
This should fix EA-133791
2018-12-24 14:58:25 +03:00
Mikhail Glukhikh
399ec5c961 Launch convention method reference search only for elements from a file
#KT-28199 Fixed
2018-12-24 14:57:53 +03:00
Mikhail Zarechenskiy
e4a4d1169e Prohibit JvmOverloads on constructors of annotation classes
In LV >= 1.4 & -progressive

 #KT-25702 Fixed
2018-12-24 12:48:00 +03:00
Mikhail Zarechenskiy
958aeff94b Prohibit type parameters for local variables in LV >= 1.4 & -progressive
#KT-8341 Fixed
2018-12-24 12:47:58 +03:00
Mikhail Zarechenskiy
e509649132 Fix mapping of platform inline class types
For the inline class:
 ```
 inline class IC(val x: Int)
 ```

 Type (IC..IC?) should be mapped to the wrapper `IC`
 because it can hold object and also because it does so for primitives

 #KT-28983 Fixed
2018-12-24 12:32:22 +03:00
Dmitriy Dolovov
7c9ca99388 CLion: New version 2018.3.2 (183.4886.39) 2018-12-24 11:35:10 +07:00
Max Medvedev
ef49e792b0 AppCode/CLion: patch java plugin xmls in AppCode as well 2018-12-21 23:43:17 +03:00
Bernhard Posselt
19906f13ea Update Maps.kt 2018-12-21 22:01:01 +03:00
Bernhard Posselt
300f68e0d8 Add documentation on how merging works for toMap() for Iterables, Arrays and Sequences 2018-12-21 22:01:01 +03:00
Mads Ager
48bd99730d Suppress final failure which relies on line numbers. 2018-12-21 16:20:45 +01:00
Mads Ager
3a11322506 Enable bytecode text tests for the JVM_IR backend. 2018-12-21 16:20:45 +01:00
Mikhael Bogdanov
d1efac617d Get rid of reduntant jvm parts in tests 2018-12-21 16:09:12 +01:00
Mikhael Bogdanov
f59b6a350f Specify JVM target backend for other java related tests 2018-12-21 16:09:11 +01:00
Mikhael Bogdanov
d76cb32781 Specify JVM target backend for test with java type inheritance 2018-12-21 16:09:11 +01:00
Mikhael Bogdanov
3c048d7f57 Specify JVM target backend for test with casts to jvm types 2018-12-21 16:09:10 +01:00
Mikhael Bogdanov
3e6f8db975 Specify JVM target backend for test with 'import kotlin.reflect.jvm' 2018-12-21 16:09:09 +01:00
Mikhael Bogdanov
a75d57a20b Remove redundant jvm reflection import 2018-12-21 16:09:09 +01:00
Mikhael Bogdanov
a2904b8e53 Regenerate test data 2018-12-21 16:09:08 +01:00
Mikhael Bogdanov
f4e532e449 Specify JVM target backend for test with '@JvmXXX' annotations 2018-12-21 16:09:07 +01:00
Mikhael Bogdanov
a8a1bfca72 Specify JVM target backend for test with '// File: *.java' 2018-12-21 16:09:06 +01:00
Mikhael Bogdanov
3ef06c1e44 Specify JVM target backend for test with 'import java...' 2018-12-21 16:09:06 +01:00
Mikhael Bogdanov
f36519d4f5 Specify JVM target backend for test with '.javaClass' usage 2018-12-21 16:09:05 +01:00
Mikhael Bogdanov
1217d3591b Specify JVM target backend for test with '::class.java' usage 2018-12-21 16:09:04 +01:00
Mikhael Bogdanov
a2e4553040 Minor. Remove obsolete supressions 2018-12-21 16:09:04 +01:00
Ilya Chernikov
c4b3580c31 Implement script filename extensions discovery via artifact transforms
to avoid using never-up-to-date task and make discovery cacheable and
checkable for up-to-dateness
#KT-28469 fixed
2018-12-21 15:44:48 +01:00
Ilya Chernikov
a3217982f7 Fix script filename extension discovery from asm-readed class
and improve diagnostics on definition loading failure
2018-12-21 15:44:28 +01:00
Ilya Gorbunov
7c7c11e916 Fix current Kotlin version to avoid changing it in local builds 2018-12-21 17:21:50 +03:00
Shagen Ogandzhanian
6dd69ea3d6 Support named constructors in idl-backed code generation
this resolves https://youtrack.jetbrains.com/issue/KT-27361
2018-12-21 14:53:59 +01:00
Ilya Gorbunov
68f898153c Fix link to sealed classes doc page
#KT-28829 Fixed
2018-12-21 16:25:43 +03:00
Marcin Moskala
686cfa6fd2 Fix common misspellings 2018-12-21 16:13:42 +03:00
Marcin Moskala
33961acb8d Fix typos in spec-docs 2018-12-21 16:06:51 +03:00
Nikolay Krasko
5d08df1bf7 Remove ignore roots added by IdeaOpenApiClassFinder
Fixed in newer IDEA build.
2018-12-21 16:06:51 +03:00
Nikolay Krasko
9dd40cb904 Extract contributing guide for better GitHub integration 2018-12-21 16:06:51 +03:00
Nikolay Krasko
58b7277ea8 Update to 183.4886.37 2018-12-21 16:06:51 +03:00
Nikolay Krasko
f03a3945c5 Rethrow IndexNotReady exceptions without modifications 2018-12-21 16:06:50 +03:00
Ilya Gorbunov
614139755c Minor: fix Random companion reference in docs
Random's companion is named 'Default' rather than 'Companion'
2018-12-21 14:17:25 +03:00
Ilya Chernikov
71729f8e8f [minor] use psi original file if virtual file is not available...
for script dependencies, fixes completion tests
2018-12-20 17:09:24 +01:00
Ilya Chernikov
44ea2bf1d4 Introduce script names and location ids, use them in diagnostics and...
for virtual file names. Also fix compiled script serialization.
2018-12-20 17:09:23 +01:00
Ilya Chernikov
77095cb895 [minor] add missing dependency 2018-12-20 17:09:22 +01:00
Ilya Chernikov
e4f245d15a Implement script dependencies collection tests 2018-12-20 17:09:22 +01:00
Ilya Chernikov
48965fb64a [minor] refactor scripting tests: extract cli testdata into separate dir, remove annotation 2018-12-20 17:09:21 +01:00
Ilya Chernikov
c165666d94 Refactor core env: extract script compilation dependencies collection 2018-12-20 17:09:20 +01:00
Ilya Chernikov
8529ed314c [minor] fix compilation - avoid proguarding of addToStdLib.kt 2018-12-20 17:09:20 +01:00
Ilya Chernikov
1e74ab5a62 Implement import test, fix import support in compiler and evaluator 2018-12-20 17:09:19 +01:00
Ilya Chernikov
fce68102bd Implement imported scripts evaluation and construction 2018-12-20 17:09:18 +01:00
Ilya Chernikov
19a969a521 Implement script import support in the compiler 2018-12-20 17:09:17 +01:00
Ilya Chernikov
729ebcac9b Implement simple "add to compilation" functionality for scripts
(incomplete import - scripts added to the compilation but not yet
imported into scope)
Base functionality needed for #KT-27960
2018-12-20 17:09:16 +01:00
Dmitry Petrov
57c12476d7 Provide parent reference for temporary variables immediately 2018-12-20 15:57:31 +03:00
Mikhael Bogdanov
4e53e7d663 Inline OPTIMIZATION_ASM_API_VERSION constant 2018-12-20 12:55:12 +01:00
Mikhael Bogdanov
026ac1bee6 Inline API constant 2018-12-20 12:55:11 +01:00
Mikhael Bogdanov
f900d598c7 Inline ABI_EXTENSION_ASM_API_VERSION 2018-12-20 12:55:10 +01:00
Mikhael Bogdanov
87d99907f6 Remove redundant proguard option
Removed option is covered by
 -keep class org.jetbrains.org.objectweb.asm.Opcodes { *; }
2018-12-20 12:55:09 +01:00
Mikhael Bogdanov
c19c979b7d Use last asm api for visitor construction 2018-12-20 12:55:09 +01:00
Mikhael Bogdanov
c2837cf7d9 Switch buildSrc to ASM7 Jetbrains ASM 2018-12-20 12:55:08 +01:00
Mikhael Bogdanov
2072d7806f Switch kotlinp to ASM7 Jetbrains ASM 2018-12-20 12:55:07 +01:00
Alexander Udalov
f5ff3d2fa9 Remove directives that have no effect from bytecode text tests
All bytecode text tests are run with stdlib in the classpath and only
for JVM backend, therefore directives WITH_RUNTIME, TARGET_BACKEND,
IGNORE_BACKEND are not needed
2018-12-20 12:53:24 +01:00
Alexander Udalov
00caa23307 Do not support LANGUAGE_VERSION directive in codegen tests
Test data of crossinline_1_2.txt has changed because now we do not
automatically enable 1.2 (with _all_ of its features) when we're
executing a common coroutines test with old coroutines; and so the
NewCapturedReceiverFieldNamingConvention language feature (which is
introduced in 1.3) is now enabled in this test
2018-12-20 12:53:24 +01:00
Alexander Udalov
77c87fa6c9 Remove API_VERSION 1.3 from compiler tests
So that these tests will now check behavior on the latest API version
2018-12-20 12:53:23 +01:00
Alexander Udalov
37e1b486f4 Minor, remove obsolete API_VERSION directives 2018-12-20 12:53:23 +01:00
Alexander Udalov
d58cf4a83a Minor, fix language versions in two diagnostic tests on coroutines 2018-12-20 12:53:23 +01:00
Alexander Udalov
a0a70dd60d Remove LANGUAGE_VERSION from compileKotlinAgainstKotlin tests
Support test directives not at the beginning of the test file for
multi-file tests where separate files need separate language features
2018-12-20 12:53:23 +01:00
Alexander Udalov
ec2dd58165 Remove LANGUAGE_VERSION from codegen tests on coroutines
Use `// !LANGUAGE: -ReleaseCoroutines` instead in tests which require
old (1.2) coroutines, and nothing in tests which require new coroutines
because master is already 1.3. Also remove superfluous API_VERSION and
other directives which have no effect anymore. Do not include runtime
automatically with `WITH_COROUTINES`/`COMMON_COROUTINES_TEST` in box
tests; require `WITH_RUNTIME` for that (majority of tests already had it
anyway), but remove it from bytecode text tests where runtime is always
added automatically. Fix the coroutine package selection code in
KotlinTestUtils and update the bunch files correspondingly.

Disable tests in `box/coroutines/noStdLib` on JVM: despite the name,
these tests were launched with stdlib because of the code in
CodegenTestCase, and they do not work without it because at least
CoroutineUtil.kt requires stdlib to compile correctly
2018-12-20 12:53:23 +01:00
Alexander Udalov
5b58eb8491 Remove LANGUAGE_VERSION from non-coroutine codegen tests
Most of these tests used this directive as a way to opt in to a new
language feature, and most of those features are already stable for a
long time, so no opt-in is needed. Some other tests used the directive
to opt out from a language feature, replace those by the `LANGUAGE`
directive. One test used the directive to test behavior that actually
depended on the API version; use `API_VERSION` directive there instead.
2018-12-20 12:53:23 +01:00
Alexander Udalov
e3c381a298 Remove API_VERSION 1.3 from tests on JvmDefault
So that these tests will now check behavior on the latest API version
2018-12-20 12:53:23 +01:00
Alexander Udalov
9b6a52ccba Remove LANGUAGE_VERSION from boxInline tests 2018-12-20 12:53:22 +01:00
Alexander Udalov
0871a3cc4d Use API_VERSION instead of LANGUAGE_VERSION in IEEE754 tests
See `ExpressionCodegen.genEqualsForExpressionsPreferIeee754Arithmetic`:
the behavior here actually depends on the API version, not any language
feature
2018-12-20 12:53:22 +01:00
Alexander Udalov
83528a75be Minor, fix typo in IEEE754 bytecode text tests
The runtime function in kotlin.jvm.internal.Intrinsics is called
"areEqual", not "areEquals"
2018-12-20 12:53:22 +01:00
Andrey Uskov
250eee48a1 Fix reimport of Kotlin projects created via wizard
#KT-27941 Fixed
2018-12-20 13:56:41 +03:00
Ilya Matveev
e520c98182 Fix K/N test for windows: rename target usage 2018-12-20 10:24:48 +03:00
Vyacheslav Gerasimov
95a3b337c6 Build: add instrumentation to all JavaCompile tasks 2018-12-19 20:59:34 +03:00
Vyacheslav Gerasimov
9ad899fb01 Fix splitExportedSuspendInlineFunctionDeclarations usages, argument must not be null 2018-12-19 20:43:15 +03:00
Mikhail Glukhikh
93882736ed OverrideMemberChooserObject refactoring: introduce MemberGenerateMode 2018-12-19 19:56:16 +03:00
Mikhail Glukhikh
ca3d758fba Create expect/actual class: fix inline class generation
#KT-28744 Fixed
#KT-28745 Fixed
2018-12-19 19:55:56 +03:00
Mikhail Glukhikh
d3a5b0dcd6 MPP JVM/JS wizard: fix classpath of 'run' task #KT-28869 Fixed 2018-12-19 19:55:40 +03:00
Mikhail Glukhikh
55666f3f03 MPP wizard tests: use 1.3.20-eap-25 2018-12-19 19:55:27 +03:00
Dmitry Petrov
e5d946a96c Parent for thisReceiver of IrLazyClass is the corresponding class
Fixes issue in Kotlin/Native.
2018-12-19 15:48:07 +03:00
Ilya Matveev
c5783c5abd Fix native binary tests for Windows 2018-12-19 19:20:04 +07:00
Toshiaki Kameyama
c248fa71c8 Add ConvertToAlsoIntention to plugin-common.xml 2018-12-19 15:10:34 +03:00
Dmitry Petrov
85f55dec9a Support SAM conversion in psi2ir
SAM conversion takes a function value (function type or a subtype),
and produces a SAM interface value.
2018-12-19 10:58:34 +03:00
Dmitriy Dolovov
2c327564d5 CIDR: Better detection when running in CIDR-based IDE
- Drop unnecessary bunch files for `KotlinFacetType` and `KotlinFacetTypeImpl`
- Use cached val `isRunningInCidrIde` to check if the code is running under CIDR
2018-12-19 11:20:54 +07:00
Vyacheslav Gerasimov
38efc7e823 Remove useless bunch for KaptWithKotlincTask 2018-12-18 21:58:32 +03:00
Alexander Udalov
c1ef89df2c Make anonymous classes for callable references synthetic
#KT-28453 Fixed
2018-12-18 17:48:19 +01:00
Shagen Ogandzhanian
ca4521d57d Support ClipboardEvent in definitions generated from idl 2018-12-18 15:07:34 +01:00
Pavel Punegov
d90a92ae06 Add stdlib to composite build of Kotlin + Kotlin/Native 2018-12-18 16:06:17 +03:00
Roman Artemev
e436e7cf61 [JS IR BE] Support call super with default parameters 2018-12-18 15:55:09 +03:00
Alexey Tsvetkov
df69e25d56 Refactor: move logging code to org.jetbrains.kotlin.gradle.logging 2018-12-18 15:23:13 +03:00
Alexey Tsvetkov
c87c5f11aa Report compiler messages from daemon in Gradle thread
#KT-28836 fixed

RMI messages are reported from RMI threads.
When Gradle logger is used from non-Gradle thread,
messages are not grouped in command-line
and they are not shown in build scans.
To fix this, we store all messages from Kotlin daemon
in a buffer, then report them from a Gradle thread.
2018-12-18 15:23:13 +03:00
Alexey Tsvetkov
78d9cd1277 Use task's logger where appropriate
KT-28836

Using project's logger prevents messages
from showing in task's output (in command-line and build scans)
2018-12-18 15:23:13 +03:00
Roman Artemev
256317da15 [IR BE] Fix SharedVariableLowering
* make it able to detect shared vars under any declaration kind, not only IrFunction
 * Add & update tests
2018-12-18 15:19:17 +03:00
Vadim Brilyantov
04395366fa add stats collertors extensions to plugin-common_xml 2018-12-18 15:06:21 +03:00
Ilya Matveev
eed41ea405 Add a klib export method consuming a configure action 2018-12-18 18:34:56 +07:00
Ilya Matveev
b668a896ba Don't create run tasks for non-host targets 2018-12-18 18:34:56 +07:00
Ilya Matveev
0a253ef30a Change executable of a run task when binary's baseName is changed 2018-12-18 18:34:56 +07:00
Ilya Matveev
7b1552f3d6 Add tests for new binaries DSL 2018-12-18 18:34:55 +07:00
Ilya Matveev
833e9a90a2 Update Kotlin/Native: 1.1.0-rc1-5227 2018-12-18 18:34:55 +07:00
Ilya Matveev
6f6764a42f Fix existing MPP tests 2018-12-18 18:34:55 +07:00
Ilya Matveev
2a889ef350 Don't hardcode a toolchain path for K/N on Windows 2018-12-18 18:34:55 +07:00
Ilya Matveev
1748eef4cd Fix error message about incorrect kotlin.native.home property 2018-12-18 18:34:55 +07:00
Ilya Matveev
9592a14367 Support aggregate tasks to build binaries per compilation 2018-12-18 18:34:55 +07:00
Ilya Matveev
ad3aac6f90 Support free compiler args for binaries 2018-12-18 18:34:55 +07:00
Ilya Matveev
89c1170e5d Allow changing base name for a Kotlin/Native binary 2018-12-18 18:34:54 +07:00
Ilya Matveev
a28902d358 Support bitcode embedding for frameworks 2018-12-18 18:34:54 +07:00
Ilya Matveev
c963da7761 Support -Xexport-library for K/N in the MPP plugin 2018-12-18 18:34:54 +07:00
Ilya Matveev
0bcb253e53 Provide aggregate link tasks 2018-12-18 18:34:54 +07:00
Ilya Matveev
ea21662bed Provide an extended DSL for final native binaries
In 1.3.0 only basic settings for final native binaries (e.g.
executables or frameworks) are available. They allow a user to
specify what kinds of binaries should be produced from one or another
compilation but they don't allow specifying different options for
different binaries or creating more than 2 (debug and release)
binaries of the same kind (e.g. executable) from the same
compilation. Also link tasks for these binaries are created after
project evaluation thus they are inaccessible for a user outside
of an afterEvaluate block.

This patch adds an extended binary DSL allowing a user to declare
binaries independently from compilations and to specify different
options (e.g. linker arguments) for different binaries. Also
link tasks for binaries declared in this DSL are created at a
configuration time so user can access them outside of an
afterEvaluate block.

Also this patch adds creating run tasks for all executables
declared in the buildscript (KT-28106)

Initial DSL methods for binaries declaration are still supported.

Kotlin DSL example is the following:

kotlin {
    macosX64 {
        binaries {
            // Create debug and release executable with
            // a name prefix 'Foo'.
            // Two domain objects will be created:
            // fooDebugExecutable and fooReleaseExecutable
            executable("Foo", listOf(RELEASE, DEBUG)) {
                compilation = compilations["foo"]
                entryPoint = "foo.main"
                linkerOpts.add("-Llib/path")
                println(runTask.name)
            }

            // Name prefix and build types are optional.
            // debugFramework and releaseFramework are created here.
            framework()
        }
    }
}
2018-12-18 18:34:54 +07:00
Shagen Ogandzhanian
44af5b783f Introduce TrackEvent, MediaStreamTrackEvent-related IDL definitions 2018-12-18 12:19:12 +01:00
Georgy Bronnikov
3b16fa6af9 Do not generate interface delegation for default parameter stubs 2018-12-18 13:57:23 +03:00
Mikhail Zarechenskiy
c924a6efe8 Fix unbound class literals for inline classes
#KT-28361 Fixed
2018-12-18 11:35:36 +03:00
Mikhail Glukhikh
8f821c9ef5 Merge pull request #2033 from t-kameyama/KT-28699
KT-28699 Add "Convert to also" intention
2018-12-18 09:37:34 +03:00
Denis Zharkov
5052623c0b Minor. Add a comment to KtLightElement::givenAnnotations 2018-12-18 09:31:13 +03:00
Denis Zharkov
e0975df1c0 Create annotation arguments in ultra-light classes via PsiElementFactory 2018-12-18 09:31:13 +03:00
Denis Zharkov
5c083d798e Restrict search scope for KtUltraLightParameter
^KT-28365 Fixed
2018-12-18 09:31:13 +03:00
Denis Zharkov
859223baa2 Fix throws-list for case of kotlin.Throwable in ultra-light classes 2018-12-18 09:31:13 +03:00
Denis Zharkov
b16bfad079 Do not generate no-arg constructor for sealed ultra-light class 2018-12-18 09:31:13 +03:00
Denis Zharkov
2f8b214e76 Support annotation based on descriptor in ultra-light classes
It helps to generate properly the annotations for delegates
Also note in test, that annotations in Base class have really weird
text of arguments and also don't have names
2018-12-18 09:31:13 +03:00
Denis Zharkov
63907b1a6b Minor. Introduce typeMapper val into UltraLightSupport
To avoid multiple creation
2018-12-18 09:31:13 +03:00
Toshiaki Kameyama
f2cf3a8e7b Replace with binary operator: don't suggest for non-operator function
#KT-12273 Fixed
2018-12-18 09:30:38 +03:00
Toshiaki Kameyama
ea0f9d124d Split property declaration: don't add parentheses for anonymous function
#KT-7593 Fixed
2018-12-18 09:28:57 +03:00
Toshiaki Kameyama
6a4c6eacd7 Add "Convert to also" intention
#KT-28699 Fixed
2018-12-18 12:21:56 +09:00
Shagen Ogandzhanian
c1f75d2324 Introduce idl definition for SVGMaskElement 2018-12-17 16:11:22 +01:00
Vyacheslav Gerasimov
7155c5c0be 173: Remove obsolete bunch file for idea-gradle/build.gradle.kts 2018-12-17 16:17:20 +03:00
Sergey Igushkin
67e82a54e5 Fix Gradle 5.0 deprecation warnings:
* DefaultSourceDirectorySet constructor is deprecated -> objects()
* IvyRepository.layout('pattern') { } is deprecated -> patternLayout { }

Issue #KT-26808 Fixed
2018-12-17 16:09:57 +03:00
Sergey Igushkin
557fb07f44 Fix the localToProject attribute schema for Gradle 4.10.2+
In Gradle 4.10.2, a change was made in the attributes disambiguation
process: if some of the candidates have a single attribute value and
others don't have that attribute (i.e. have a null value), the
disambiguation rule for that attribute doesn't get called.
Effectively, null values are excluded from disambiguation, but still may
cause ambiguity (sic!)

See: https://github.com/gradle/gradle/issues/6747#issuecomment-445921139

This change affected our attribute `localToProject` that we use to
disambiguate the deprecated but still consumable configurations like
`compile`, `runtime`, `testCompile`, `testRuntime` from those
configurations which should have priority during project dependency
resolution: the `*Element` ones. Our scheme marked the former
configurations with the attribute and the latter were not marked, with
a disambiguation rule that preferred null values.

To fix this logic with Gradle 4.10.2, we instead mark both kinds of
configurations with the attribute, which now has a value 'public'
that is preferred by the rule over the other values. We also make sure
that the attribute doesn't leak into the published Gradle metadata, as
it is only needed for project-to-project dependencies resolution.

Issue #KT-28795 Fixed
2018-12-17 16:09:57 +03:00
Sergey Igushkin
2349aaf488 Workaround for ConcurrentModificationException in KotlinModelBuilder
In Gradle 5.0, iterating over the `.withType<...>()` result below
caused a ConcurrentModificationException. Workaround that by first
collecting the items into a list.
2018-12-17 16:09:56 +03:00
Sergey Igushkin
d7522e2283 Fix some tests for Gradle 5.0 and update some dependency versions
* Introduce GradleVersionRequired.InRange and thus prevent older
tests (e.g. Android 2.3.0) from running with newer Gradle versions

* Add a task outputs pattern suitable for Gradle 5.0

* Run some of the Android tests with AGP 3.1.0 (and Gradle 4.4) instead
of 3.0.0 to ensure compatibility with Gradle 5.0

* Update test projects according to Gradle 5.0 dropped deprecated
features: classesDir, left-shift operator, default org.gradle.util.*
imports

* Fix a Gradle test after Gradle 5.0 changed `publishing` behavior to
run the closure eagerly rather than after evaluation
2018-12-17 16:09:56 +03:00
Sergey Igushkin
5f21ced26b Advance test Gradle version to 5.0 2018-12-17 16:09:56 +03:00
Vyacheslav Gerasimov
e422eb56b2 173: Fix test compilation for AS 3.1 2018-12-17 15:57:06 +03:00
Alexey Tsvetkov
2196d81322 Enable JS IC by default
#KT-28842 Fixed
2018-12-17 15:46:11 +03:00
Alexey Tsvetkov
ce9150f2b2 Add project property to disable AP discovery in compile classpath
AP discovery in compile classpath can be disabled in all subprojects
by adding "kapt.include.compile.classpath = false" to 'gradle.properties' file.

KT-24530

The setting can be overrided per project by using KAPT DSL
in a 'build.gradle' file:
```
kapt {
    includeCompileClasspath = false
}
```
2018-12-17 15:41:34 +03:00
Vadim Brilyantov
7fb43144d4 fix KotlinVersion and set it to be 1_3_0 2018-12-17 15:07:10 +03:00
Mikhael Bogdanov
1a0c3dfaa6 Use last ASM version to read binaries
#KT-28798 Fixed
2018-12-17 12:18:52 +01:00
Alexey Tsvetkov
0ea7716eb1 Test that javac is loaded once when worker is reused 2018-12-16 04:28:44 +03:00
Ting-Yuan Huang
6c627fa5c1 Cache classloaders for tools.jar and kapt in Gradle workers
#KT-28852 fixed

The loaders and hence some classes were repeatedly loaded and
jit-compiled everytime when KaptExecution were dispatched. Those
classes, like JavaCompiler, can be very large and therefore created a
significant overhead. In some projects, the overhead accounted for more
than 40% of total CPU time of annotation processing.

This change tries to cache the classloaders so that they won't be
reloaded and re-jitted.
2018-12-16 04:28:44 +03:00
Alexey Tsvetkov
1ba6d5361b Run in-process compiler in separate thread
The compiler uses thread local values,
so when the compiler runs Gradle's thread,
it leaks classes preventing
a compiler's classloader from being collected.

    #KT-28037 fixed
2018-12-15 23:39:06 +03:00
Alexey Tsvetkov
a6fca47871 Minor: remove unused util 2018-12-15 23:39:06 +03:00
Alexey Tsvetkov
cab32f0e43 Print stacktrace to Gradle logger instead of writing directly to stderr 2018-12-15 23:39:06 +03:00
Vadim Brilyantov
bc08c966a8 fix RenameKotlinFileProcessor for 173 bunch 2018-12-14 20:20:57 +03:00
Vadim Brilyantov
1fcf8a5587 add 173 bunch for build_gradle_kts of usage-statistics 2018-12-14 20:19:23 +03:00
Vadim Brilyantov
fb12de8ff6 fix stats reporters (dummies) Rename Handlers for 181 bunch files
fix bunch files again

fix RenameBackingFieldReferenceHandler for 181 bunch

fix RenameKotlinImplicitLambdaParameter for 181 bunch
2018-12-14 20:19:22 +03:00
Vadim Brilyantov
65982bbee8 disable statistics for 181 as FUS is only available since 182 2018-12-14 20:19:22 +03:00
Vadim Brilyantov
15fec50a0f remove intensions and quickfixes triggers (already present in Idea) 2018-12-14 20:19:20 +03:00
Vadim Brilyantov
93d93cd40e fix report kotlin targets for android case 2018-12-14 20:19:19 +03:00
Vadim Brilyantov
df5ec5c218 report stats for pullUp/pushDown refactorings
tmp
2018-12-14 20:19:19 +03:00
Vadim Brilyantov
37239cbcd7 report stats for all renaming refactorings 2018-12-14 20:19:18 +03:00
Vadim Brilyantov
00f630b31d add target reporting 2018-12-14 20:19:17 +03:00
Vadim Brilyantov
c307d07b47 fix build for idea plugin with usage statistics 2018-12-14 20:19:16 +03:00
Vadim Brilyantov
ae9f16d964 trigger intentions, inspections and some of rename refactorings 2018-12-14 20:19:15 +03:00
Vadim Brilyantov
1b716ea2ee create usage-statistics module 2018-12-14 20:19:14 +03:00
Shagen Ogandzhanian
714b4f25c0 Introduce better typing for on[event-name] attributes from idl
see https://upsource.jetbrains.com/kotlin/review/KOTLIN-CR-2548
2018-12-14 13:17:41 +01:00
victor.petukhov
8c0ad321e2 Add black box tests for objects inheritance problem (KT-25289) 2018-12-14 14:36:17 +03:00
victor.petukhov
fc381e25c8 Remove diagnostic tags from black box spec tests for annotations 2018-12-14 14:36:17 +03:00
victor.petukhov
f3774b8e19 Add black box spec tests validation 2018-12-14 14:36:16 +03:00
Denis Zharkov
a422db91b2 Transform KotlinClassFinder::findKotlinClass to extension 2018-12-13 20:38:25 +03:00
Denis Zharkov
f153d97f40 Avoid multiple subsequent reading of the same class-file in front-end
^KT-23466 Fixed
2018-12-13 20:38:24 +03:00
Denis Zharkov
bc61e5a3bc Minor. Reformat BinaryJavaClass 2018-12-13 20:37:46 +03:00
Denis Zharkov
e59d9bf9e4 Convert JavaClassFinder.java to kotlin 2018-12-13 20:37:46 +03:00
Denis Zharkov
9ddee565e0 Convert JavaClassFinder.java to kotlin: rename file 2018-12-13 20:37:46 +03:00
Denis Zharkov
0a70a957e9 Minor. Reformat LazyJavaPackageScope.kt 2018-12-13 20:37:46 +03:00
Ilya Chernikov
77a4505ec2 [minor] get rid of obsolete "environment" wording 2018-12-13 18:00:12 +01:00
Ilya Chernikov
0b9770f8d1 Refactor scripting - rename env vars to provided properties everywhere 2018-12-13 18:00:12 +01:00
Ilya Chernikov
9e5d04b836 Add generic interfaces to dependency resolvers 2018-12-13 18:00:11 +01:00
Ilya Chernikov
e0a542234f Add script config refinement before compilation into API 2018-12-13 18:00:10 +01:00
Ilya Chernikov
3fe324bbb4 Add UrlScriptSource 2018-12-13 18:00:08 +01:00
Ilya Chernikov
fb929c290d [minor] copy utility fun to reduce dependencies 2018-12-13 18:00:08 +01:00
Ilya Chernikov
5602bcf9e1 Fix vararg argument mapping for generic args convertor 2018-12-13 18:00:07 +01:00
Ivan Gavrilovic
6b20ef0208 Complete Java usage tracker if analysis extension finishes (KT-27487)
In cases when kapt compiler plugin runs in stubs generation mode,
Java usage tracker was not completed. This caused issues with
the incremental compilation if Java files changed.

E.g. if a constant defined in Java source file changed, stubs
would not be recompiled because the Java usage tracker would
not report changed type. This commit fixes that issue.
2018-12-13 17:12:08 +03:00
Pavel V. Talanov
dec2da8247 dumbUtils: remove console spam 2018-12-13 14:35:05 +01:00
Pavel V. Talanov
1d7a74bfcd Minor: fix exception message 2018-12-13 14:35:04 +01:00
Alexander Udalov
8c74312cf6 Fix isInitialized for companion lateinit properties
Instead of trying to access a missing field `Foo.foo`, call the
synthetic accessor `Foo.access$getFoo$cp` which, as per previous commit,
no longer contains the lateinit assertion

 #KT-21862 Fixed
2018-12-13 14:12:33 +01:00
Alexander Udalov
43413fcc44 Move lateinit assertion for companion property to companion object
Previously, for a property named `x` in the companion object of a class
named `Foo`, we generated:
- `Foo.access$getX$cp`, consisting of `GETFIELD Foo.x` and lateinit
  assertion
- `Foo.Companion.getX`, consisting of `INVOKEVIRTUAL Foo.access$getX$cp`

Now, we generate:
- `Foo.access$getX$cp`, consisting of `GETFIELD Foo.x`
- `Foo.Companion.getX`, consisting of `INVOKEVIRTUAL Foo.access$getX$cp`
  and lateinit assertion

The reason is that this way we can avoid generating another accessor and
reuse `Foo.access$getX$cp` in case `isInitialized` is called on a
lateinit property from companion.

For private properties, getX is not generated, but instead the assertion
is generated on each access to the field (which can be improved, see
KT-28331). The same happens for access to non-private properties from
inside the same context where they're declared.

 #KT-21862 In Progress
2018-12-13 14:12:33 +01:00
Alexander Udalov
8617365983 Minor, reformat & fix warnings in intermediateValueForProperty 2018-12-13 14:12:32 +01:00
Alexey Tsvetkov
8aa069a774 Make AbstractJvmAbiContentTest system independent 2018-12-13 15:39:39 +03:00
Alexey Tsvetkov
7953a9154c Register classpath as inputs of SmartJavaExec tasks 2018-12-13 15:39:39 +03:00
Alexander Udalov
bbc7edf9d1 Fix incorrect character replacement in ClassName.jvmInternalName
#KT-28682 Fixed
2018-12-13 13:23:45 +01:00
victor.petukhov
725832a281 Fix incomplete printing of exceptions (of the all types) in tests 2018-12-13 12:50:10 +03:00
Nikolay Krasko
0a8e29838f Add file comparison feature to surround with tests 2018-12-13 12:36:02 +03:00
Nikolay Krasko
0482fe9414 Move check with selection tags to base check 2018-12-13 12:36:02 +03:00
shiraji
06dad5f45b Surround with try/catch should generate more Kotlin-style code (KT-5435)
#KT-5435 Fixed
2018-12-13 12:36:02 +03:00
Nikolay Krasko
c7c51a3d6b Refactoring: drop MoveDeclarationsOutHelper object 2018-12-13 12:36:02 +03:00
Nikolay Krasko
8dd02126d9 Convert MoveDeclarationsOutHelper to Kotlin and minor improvements 2018-12-13 12:36:02 +03:00
Nikolay Krasko
eda1f1f3a0 Convert MoveDeclarationsOutHelper to Kotlin - rename 2018-12-13 12:36:02 +03:00
Nikolay Krasko
5fb90a8a81 Better caret position after Insert curly braces around variable (KT-28739)
Introduce helper class and move caret to it's original position.

 #KT-28739 Fixed
2018-12-13 12:36:01 +03:00
Nikolay Krasko
44a36e70ec Exit when property has no name (EA-129932) 2018-12-13 12:36:01 +03:00
Nikolay Krasko
aada1e4c1b Do not try to run reformat inspection on read-only file (EA-126979) 2018-12-13 12:36:01 +03:00
Nikolay Krasko
fc4971aa98 Minor: log instead of asserting error (EA-126493) 2018-12-13 12:36:01 +03:00
Nikolay Krasko
a5724293b0 Diagnostic null value in operations node (EA-126606) 2018-12-13 12:36:01 +03:00
Nikolay Krasko
7c23564bc5 Minor: fix nullability warnings and extract method 2018-12-13 12:36:00 +03:00
Nikolay Krasko
1d3d86023e Log NPE from getting operation reference in binary expression (EA-129499) 2018-12-13 12:36:00 +03:00
Andrey Uskov
ffb277d978 Fix KT-28626, KT-27263, KT-27718 in Idea 191 2018-12-12 19:04:56 +03:00
Andrey Uskov
595e75e059 Fix build in bunch 191 2018-12-12 19:04:15 +03:00
Vyacheslav Gerasimov
201522c6c8 as31: Fix KaptWithKotlincTask compilation 2018-12-12 17:58:29 +03:00
Vyacheslav Gerasimov
b942f00409 as31: set intellijUltimateEnabled flag 2018-12-12 17:58:29 +03:00
victor.petukhov
ee0fa2220e Fix incomplete printing of runtime exceptions in box tests 2018-12-12 17:44:05 +03:00
Mikhail Zarechenskiy
1d69f35f27 Revert "[NI] Take into account captured types for type depth computation"
This reverts commit 383c2d1bff.

 It seems this commit causes problems with bootstraping, so it'll be
 investigated and refined later
2018-12-12 17:41:30 +03:00
Leonid Startsev
fdf4f02dde Declare real external symbols for overriden by synthetic function
instead of unbound

Unbound symbols were throwing an exception on attempt to analyze them
in the other parts of compiler and are generally incorrect
2018-12-12 17:26:01 +03:00
Mikhail Glukhikh
a15b47c93c Add "Ambiguous context due to scope receiver in suspend fun" inspection
#KT-28696 Fixed
2018-12-12 17:10:37 +03:00
Shagen Ogandzhanian
44da3c89b7 Introduce PointerEvent-related definitions
* Resolves https://youtrack.jetbrains.com/issue/KT-23932
 * Backed by review https://upsource.jetbrains.com/kotlin/branch/KT-23932-POINTER-EVENT-FROM-REMOTE-IDL
2018-12-12 14:53:18 +01:00
Shagen Ogandzhanian
2d49268a0b Support float initializers in fun params generated from idl definitions 2018-12-12 14:12:27 +01:00
Mikhail Glukhikh
42fa6ce6f0 Refactor "change type to mutable" in suspicious collection reassignment
Related to KT-20626
2018-12-12 15:56:12 +03:00
Mikhail Glukhikh
b17ee60c6f Change description of boolean argument/augmented assignment inspections 2018-12-12 15:56:12 +03:00
Mikhail Glukhikh
13b09f532c Boolean literal arguments: check previous arg, fix all args in a row 2018-12-12 15:56:12 +03:00
Mikhail Glukhikh
235b50d86e Boolean literal arguments: do not highlight with single boolean argument 2018-12-12 15:56:12 +03:00
Mikhail Glukhikh
d31e0b9632 Boolean literal arguments: don't report on a call, just on an element 2018-12-12 15:56:12 +03:00
Toshiaki Kameyama
0d7116aa5d Introduce "Boolean literal arguments" inspection #KT-2029 Fixed 2018-12-12 15:56:11 +03:00
Mikhail Glukhikh
aa9e48b9b6 Augmented list assignment inspection: add "replace with ordinary" fix
Relates to KT-20626
2018-12-12 15:56:11 +03:00
Mikhail Glukhikh
ed8305995e Don't highlight "replace with +=" for read-only collections
Related to KT-20626
2018-12-12 15:56:11 +03:00
Mikhail Glukhikh
c560aada3d Add "Suspicious collection reassignment" inspection #KT-20626 Fixed 2018-12-12 15:56:11 +03:00
Mikhail Glukhikh
3e936f64bf Introduce KtReferenceSearch to use LocalSearchScope, when possible
This fixes a set of problems in J2K tests in 183
#KT-28368 Fixed
2018-12-12 15:56:10 +03:00
Yan Zhulanow
ef08110354 Evaluator: Render inline class values using its toString() implementation (KT-27414) 2018-12-12 21:40:46 +09:00
Yan Zhulanow
425467ca99 Kapt: Switch to more appropriate way of converting URIs to Files 2018-12-12 21:40:46 +09:00
Yan Zhulanow
eb28ce3007 Fix Android Lint tests (182 bunch only) 2018-12-12 21:40:45 +09:00
Yan Zhulanow
f5bb9d5866 Remove Lint tests for annotation argument API check.
Looks like newer Lint API checker ignores type usage in annotations, so these tests are no more needed.
2018-12-12 21:40:45 +09:00
Yan Zhulanow
aa5f1cefd0 Fix testSimple() for "Remove Parcelable" action 2018-12-12 21:40:45 +09:00
Yan Zhulanow
648fb2ef0b AllOpen: Update test data (enum constructors are now private) 2018-12-12 21:40:45 +09:00
Yan Zhulanow
9ec321b918 Update debugger test data, fix the current behavior 2018-12-12 21:40:45 +09:00
Yan Zhulanow
1734726d50 Remove a magic constant from 'KotlinLambdaMethodFilter' 2018-12-12 21:40:45 +09:00
Yan Zhulanow
a6ba7e6e87 Revert "Remove unneeded usage of the blocking invokeInManagerThread() (KT-24282)"
This reverts commit 6c868701
2018-12-12 21:40:45 +09:00
Yan Zhulanow
79bb609e1e Uast: Update test data (enum constructors are now private) 2018-12-12 21:40:44 +09:00
Yan Zhulanow
0dda7bd7ca NoArg: Update test data (enum constructors are now private) 2018-12-12 21:40:44 +09:00
Yan Zhulanow
a090541108 Kapt: Update test data (stub converter tests) 2018-12-12 21:40:44 +09:00
Yan Zhulanow
1963571be3 Add missing 'disallowRootAccess()' to debugger and stub tests 2018-12-12 21:40:44 +09:00
Yan Zhulanow
dd49d35320 Fix backend tests after changing format of synthetic variables for inline functions 2018-12-12 21:40:44 +09:00
Yan Zhulanow
e6643ef2b7 Fix quick evaluation for array expressions (KT-13268) 2018-12-12 21:40:44 +09:00
Yan Zhulanow
4b4d8dd660 Fix breakpoints for the same inline function nested calls (KT-22366)
This commit changes the format of the synthetic local variables for inline functions.
2018-12-12 21:40:44 +09:00
Yan Zhulanow
ae4f05cf62 Remove unneeded usage of the blocking invokeInManagerThread() (KT-24282) 2018-12-12 21:40:44 +09:00
Yan Zhulanow
e12af0e2d1 Fix evaluation for captured inline classes (KT-28487) 2018-12-12 21:40:44 +09:00
Yan Zhulanow
27ea02929a Fix evaluation for static interface methods declared in Java (KT-23585) 2018-12-12 21:40:43 +09:00
Yan Zhulanow
3d7b503cd6 Fix source mapping for stepping into package facades from libraries (KT-28028) 2018-12-12 21:40:43 +09:00
Yan Zhulanow
3c8714696d Add a LookupLocation to 'getSyntheticExtensionProperties()', use it in 'DebuggerFieldSyntheticScopeProvider' 2018-12-12 21:40:43 +09:00
Yan Zhulanow
dc34f11f50 Evaluate: Enable 'foo_field' convention only for Jvm/Common code 2018-12-12 21:40:43 +09:00
Yan Zhulanow
8334769eb0 Refactoring: Replace 'ParametersDescriptor' with a simple 'List' 2018-12-12 21:40:43 +09:00
Yan Zhulanow
c88d8a5e0d Evaluate: Support synthetic 'field' variable evaluation (KT-28342) 2018-12-12 21:40:43 +09:00
Yan Zhulanow
60d2490c45 Minor: Move changeSuperToMagicAccessor() function to its single use site, J2K it 2018-12-12 21:40:43 +09:00
Yan Zhulanow
9498eb8d4d Kapt: Preserve 'getJarPathForClass()' (used in kapt-cli) 2018-12-12 21:40:43 +09:00
Yan Zhulanow
ada71ce3cd Evaluate: Use '<name>_field' syntax for field value evaluation (KT-14075) 2018-12-12 21:40:42 +09:00
Yan Zhulanow
c2f33c0dfd Provide a default implementation for 'SyntheticScope' 2018-12-12 21:40:42 +09:00
Denis Zharkov
a83f0e5fb7 Add diagnostic for calling ConcurrentHashMap::contains by convention
^KT-18053 Fixed
2018-12-12 15:37:50 +03:00
Simon Ogorodnik
f8e7c8856a PerModulePackageCache: Process events where whole psi file was added 2018-12-12 15:28:16 +03:00
Simon Ogorodnik
1f6fde4bc2 KT-20706: Fix auto-popup completion after digit in KDoc
#KT-20706 Fixed
2018-12-12 15:27:20 +03:00
Alexander Podkhalyuzin
c607b8e556 Removed unnecessary warning
#KT-28360 Fixed
2018-12-12 14:34:04 +03:00
Mikhail Glukhikh
3889bb05d6 Do not modify highlighting settings for non-Kotlin files #KT-28716 Fixed 2018-12-12 14:20:06 +03:00
Alexey Tsvetkov
01fbcfad23 Minor: replace UsefulTestCase with KtUsefulTestCase
For some reason assertSameLinesWithFile from UsefulTestCase
fails with exception on TeamCity, whereas the one KtUsefulTestCase
does not
2018-12-12 02:53:13 +03:00
Alexey Tsvetkov
7c767e0789 Exclude InsnList from proguard
It is used by jvm-abi-gen plugin
2018-12-12 02:52:07 +03:00
Shagen Ogandzhanian
03966985a1 Add mininal test suite to idl2k, remove deprecated ANTLRFileStream 2018-12-11 22:46:01 +01:00
Alexey Tsvetkov
57f8f216d1 Exclude local variables and try catch blocks of non-inline functions from ABI 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
495cfec9e9 Check descriptor visibility before excluding method from ABI class 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
34d96dff28 Minor: rename const according to style guide 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
b87058b532 Attempt to fix ABI tests on TC
Locally they work fine
2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
09dbf427ee Disable removing private/synthetic/local classes temporarily 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
96f3c67b3b Report output classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
05c5196aaa Reuse BytecodeListingTextCollectingVisitor in tests 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
497df17eb7 Reuse TransformationMethodVisitor in ABI gen plugin 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
82eb7c17e6 Convert TransformationMethodVisitor: step 2 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
56b72c96eb Convert TransformationMethodVisitor: step 1 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
50d8fe611c Minor fixes after review 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
d54ce2da6f Exclude nested classes of private classes from ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
64380f55d2 Report locations of errors in ABI classes tests 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
9dd09151f0 Add tests for compilation against abi classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
8992ee6280 Add tests for non-compatible ABI changes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
5891617674 Exclude clinit from ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
519211036d Exclude synthetic classes from ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
fe047a0092 Minor: extract function 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
f231817559 Delay I/O when transforming ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
d74185a74d Remove unused cosntant pool entries from ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
3a29b337a0 Exclude private typealiases from ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
1f5ca7274d Exclude local and private classes from ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
7c2f7cab9a Exclude non-inline method bodies from ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
903f6bc79b Exclude private members from ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
33faa00184 Add plugin for JVM ABI classes generation
#KT-25128 Fixed

ABI class generation is implemented as a compiler plugin.
Command-line usage:
1. Add a path to 'jvm-abi-gen.jar' to the plguin classpath argument
(`-Xplugin`). By default the jar is located at
'kotlinc/lib/jvm-abi-gen.jar' in the kotlinc distribution archive.
2. Specify an output directory for ABI classes via
`-Pplugin:org.jetbrains.kotlin.jvm.abi:outputDir=<DIR>`.
2018-12-11 22:48:53 +03:00
Mikhail Glukhikh
7fcd29843e Fix JS compilation for branch 181 2018-12-11 22:14:44 +03:00
Mikhail Glukhikh
588e94b917 File rename: TargetPlatform.kt -> PlatformConfiguratorBase.kt
Made to match file content better
2018-12-11 22:07:41 +03:00
Simon Ogorodnik
e3aed04d96 Extract module info & target platform to separate frontend.common 2018-12-11 22:07:41 +03:00
Vyacheslav Gerasimov
cd614b5bf8 Build: fix missing dx sources 2018-12-11 21:59:52 +03:00
Vyacheslav Gerasimov
02fbdc54d9 Build: Fix up-to-date for :kotlin-compiler-client-embeddable:shadowJar
The task was never up-to-date because default jar and shadowJar tasks overwritten each other's output

 #KT-28656 Fixed
2018-12-11 18:11:53 +03:00
Ilya Chernikov
abc13589c8 Fix locking in script definition provider
fixes possible parallel modifications on definitions loading, e.g.
as in https://github.com/shyiko/ktlint/issues/287
2018-12-11 15:20:08 +01:00
Mikhail Glukhikh
b143a1c8f7 For each parameter not used: handle char sequences correctly
An enhancement for KT-27209
2018-12-11 16:42:04 +03:00
Mikhail Glukhikh
833f564f0e Disable extract actions on non-JVM classes #KT-28476 Fixed 2018-12-11 16:42:03 +03:00
Mikhail Glukhikh
11909a86a8 For each parameter not used: introduce "replace with repeat"
An enhancement for KT-27209
2018-12-11 16:42:03 +03:00
Mikhail Glukhikh
e06c995516 For each parameter not used: cleanup 2018-12-11 16:42:03 +03:00
Mikhail Glukhikh
9aa1d1495b Redundant arrow: don't report on forEach call with underscore
#KT-27209 Fixed
2018-12-11 16:42:03 +03:00
Mikhail Glukhikh
c8c485d27e Redundant arrow: support removing of 'it ->' #KT-28631 Fixed 2018-12-11 16:42:03 +03:00
Denis Zharkov
92150d847a Unwrap InvocationTargetException in dependency injection
^KT-28348 Fixed
2018-12-11 16:12:28 +03:00
Denis Zharkov
957e7cd5f3 Optimize searching constructor delegation calls
^KT-28755 Fixed
2018-12-11 16:12:28 +03:00
Denis Zharkov
9e07b0d31a Minor. Reformat usagesSearch/utils.kt 2018-12-11 16:12:28 +03:00
Roman Artemev
2b436b493c Move test from js to common part 2018-12-11 16:11:01 +03:00
Alexey Tsvetkov
b6c975739c Deprecate AP discovery in compile configurations in Gradle
#KT-24368 Fixed
2018-12-11 16:08:16 +03:00
Alexey Tsvetkov
d6459e6c49 Add option to disable AP discovery in compile classpath
#KT-24530 Fixed

To disable discovery and enable avoidance for kapt tasks,
use "kapt.includeCompileClasspath = false"
2018-12-11 16:08:16 +03:00
Simon Ogorodnik
445c85f829 Support overriding module/library/sdk for particular light PsiClass
To support light R classes
2018-12-11 15:46:11 +03:00
Ilmir Usmanov
7f9e91eabe Use File.pathSeparator instead of : 2018-12-11 15:08:34 +03:00
Dmitry Petrov
08d1c47ac3 KT-14227 Intrinsify MutableMap.set
This fixes the most common (and rather annoying) bug in augmented
assignment desugaring with collection element receiver.

Fix is somewhat hackish: introduce an intrinsic for MutableMap.set,
thus bypassing discrepancies in 'get' and 'set' call generation.
Fixing it properly requires design decisions for corner cases where
ad hoc augmented assignment desugaring with collection element receiver
"accidentally" works, producing identical objects and vararg arrays for
arguments of 'get' and 'set'.
2018-12-11 12:43:03 +03:00
Yan Zhulanow
9a98a4525b ServiceLoaderLite: Support paths with spaces (KT-28527) 2018-12-11 17:45:46 +09:00
Mikhail Zarechenskiy
e8a8318ead [NI] Fix input/output types for callable reference atom
Input and output types are crucial for type variable fixation order and
 analysis of postponed arguments (callable references, lambdas).

 Specifically, if there is non-fixed type variable inside input types of
 a callable reference, then we'll postpone resolution for such callable
 reference.

 Initial example with the expected type `KMutableProperty1<*, F>` caused
 problems because input types were computed incorrectly (while there
 aren't input types here)

 #KT-25431 Fixed
2018-12-11 11:33:29 +03:00
Mikhail Zarechenskiy
6ebbb6eae3 [NI] Fix not-null smartcast on intersection of nullable types
#KT-28670 Fixed
2018-12-11 11:29:59 +03:00
Mikhail Zarechenskiy
383c2d1bff [NI] Take into account captured types for type depth computation
It's needed to estimate the count of steps for type approximation algorithm.
 After the estimated count of steps, we consider such type recursive and this
 algorithm returns some default value

 #KT-28598 Fixed
2018-12-11 11:29:55 +03:00
Denis Zharkov
ddb4e8b128 Temporary remove some tests after a fix for KT-24937
Otherwise, our project is failed to be indexed
2018-12-11 09:45:39 +03:00
Denis Zharkov
5992896d76 Relax assertion in parser for a recovery case with annotations
^KT-24937 Fixed
2018-12-11 09:45:14 +03:00
Nicolay Mitropolsky
3727fabb0f AddConstModifierFix and AddReifiedToTypeParameterOfFunctionFix updated to implement invokeImpl 2018-12-11 08:46:02 +03:00
Dmitry Batkovich
654f728c12 AddModifierFix and RemoveModifierFix made extend KotlinCrossLanguageQuickFixAction 2018-12-11 08:46:02 +03:00
Georgy Bronnikov
2b0ec8abe3 Update tests 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
5dd9cfca4d Repair after merge 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
a695e21e44 Introduce IrLazyProperty 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
f4a189fe82 Change order of arguments in IrValueParameter.copyTo 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
c018109bca React to review comments 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
c9343c89bc Mark java external declarations in IrFunction.origin 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
1764423860 JVM_IR. Mostly remove descriptors from InterfaceDelegationLowering 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
cbc46fe6e4 JVM_IR. Mostly remove descriptors from InterfaceLowering
Descriptors are only used to generate a new method name via a call to
KotlinTypeMapper.
2018-12-10 17:26:55 +03:00
Georgy Bronnikov
55b65546fa IR. Take care of type parameters for calls in DefaultArgumentStubGenerator 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
bba711a189 JVM_IR. Remove descriptors from ConstAndJvmFieldPropertiesLowering 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
41da078de5 IR. Create IrAnonymousInitializerSymbolImpl using a class symbol 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
481bef9799 JVM_IR. Copy annotations properly in MoveCompanionObjectFieldsLowering 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
a5fea34f12 Remove some dead code 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
bf4f552478 IR. Remove descriptors from KCallableNamePropertyLowering 2018-12-10 17:26:55 +03:00
Simon Ogorodnik
33f937c923 Remove property with @JvmDefault to make test pass
In sake of #KT-28708
2018-12-10 16:08:54 +03:00
Simon Ogorodnik
2165cfe91d JavaAgainstKotlinBinaries: Allow specifying extra compiler options 2018-12-10 16:08:53 +03:00
Simon Ogorodnik
bd774766f1 Add test debug logging for PerModulePackageCacheService 2018-12-10 16:08:52 +03:00
Simon Ogorodnik
e3b181e412 Restore processing of delete events 2018-12-10 16:08:51 +03:00
Dmitry Petrov
8ede477f99 KT-28585 Fix boxing for values of captured vars of inline class type 2018-12-10 14:57:09 +03:00
Dmitry Petrov
45035d3e11 KT-28405 Fix toString for inline classes with underlying arrays 2018-12-10 14:57:09 +03:00
Dmitry Savvinov
500dc11514 Fix missed returned expression if the last expression was condition jump
See ticket comments for the detailed description

^KT-28061 Fixed
2018-12-10 13:38:43 +03:00
Dmitry Savvinov
c9e87bf353 Add test on in-place lambda with return + safecall
Currently, diagnostics behavior is undesired. The next commit fixes it

^KT-28061 In Progress
2018-12-10 13:38:43 +03:00
Nicolay Mitropolsky
b918786336 Uast: enabling multiresolve by default 2018-12-10 13:26:25 +03:00
Toshiaki Kameyama
07ffac72cf Assign backing field: don't add empty line
#KT-28694 Fixed
2018-12-10 12:06:55 +03:00
Mikhail Glukhikh
79537a5fdb Fix check in isSameRootType. May fix KT-28626. Related to KT-27718 2018-12-07 18:57:09 +03:00
victor.petukhov
6c4f255393 Actualize PSI spec tests after fix KT-27762 2018-12-07 18:35:43 +03:00
victor.petukhov
60def724be Fix invalid package pattern in spec tests parser 2018-12-07 18:35:43 +03:00
victor.petukhov
b9d1825765 Implement tests exceptions fixation mechanism 2018-12-07 18:35:43 +03:00
Nikolay Krasko
8da9bdf928 Relax package convention name inspection for Kotlin project 2018-12-07 18:32:10 +03:00
Nikolay Krasko
2373c9d838 Allow underscore in packages and forbid uppercase letters (KT-27900) 2018-12-07 18:32:09 +03:00
Nikolay Krasko
e0d3abc819 Do not indent and align initializer list in enums (KT-28070)
#KT-28070 Fixed
2018-12-07 18:32:07 +03:00
Nikolay Krasko
bbf05eaaba Fix test compilation because of using HierarchyViewTestFixture in <= 181 2018-12-07 18:24:41 +03:00
Shagen Ogandzhanian
1f0bca12e1 Leave undefined values for undefined params in idl-generated code unassigned
https://upsource.jetbrains.com/kotlin/review/KOTLIN-CR-2535
2018-12-07 16:05:00 +01:00
Roman Artemev
1ad2434fa0 Add changelog for 1.3.11 2018-12-07 17:58:20 +03:00
Roman Artemev
4e05be9a96 Update tests 2018-12-07 17:58:20 +03:00
Roman Artemev
eff81525d3 Make IrField be IrDeclarationParent
* fix parent in TypeOperatorLowering
2018-12-07 17:58:20 +03:00
Roman Artemev
ce70e5850f [JS IR BE] New Inliner from native 2018-12-07 17:58:20 +03:00
Ilya Gorbunov
7b08f6f8f1 readLine: extend buffer to decode surrogate pairs from utf-8 correctly
CharBuffer had capacity to hold 2 chars, which was not enough to append
a surrogate pair when the buffer was not empty.

The buffer was extended and the decoding algorithm rewritten to deal with
a buffer of any length.

#KT-28572 Fixed
2018-12-07 17:42:09 +03:00
Nikita Katkov
297054037c Dispatchers IO is now considered non-blocking context
See BlockingMethodInNonBlockingContextInspection
2018-12-07 15:19:12 +03:00
Mikhail Glukhikh
3b33d3e58d MPP wizard: drop some target names to use defaults instead 2018-12-07 13:18:56 +03:00
Mikhail Glukhikh
8e81d9a44f Migrate mobile (shared) / native / shared library MPP wizards to new DSL
#KT-28458 Fixed
2018-12-07 12:48:31 +03:00
Mikhail Glukhikh
9a0facf56a Upgrade MPP wizard tests to use kotlin 1.3.20-dev with new MPP DSL 2018-12-07 12:46:14 +03:00
Dmitry Petrov
0561cb6c0d Fix KT-24804 PSI2IR Crashes on loop with two labels 2018-12-07 10:51:55 +03:00
Dmitry Petrov
6f97db81c8 Update testData after IR type rendering changes 2018-12-07 10:51:55 +03:00
Dmitry Petrov
f8582c1929 psi2ir: ersatz type approximation for intersection types
Emulate old JVM back-end behavior for intersection type mapping.

IrType renderer should render the IR type, not the original Kotlin type.
2018-12-07 10:51:55 +03:00
Natalia Selezneva
0e4908087c Fix NoReadAccessException running scratch file in Android Studio
KtScratchSourceFileProcessor accesses PsiElement.getText
2018-12-07 10:25:09 +03:00
Natalia Selezneva
62584f2483 Fix IndexNotReadyException during runnning scratch file in Android Studio 2018-12-07 10:25:06 +03:00
Natalia Selezneva
84aef9cf2d Minor: remove unnecessary parameter 2018-12-07 10:25:04 +03:00
Natalia Selezneva
b8007f1ee9 Scratch: filter out fake gradle modules from combobox
^KT-23523 Fixed
2018-12-07 10:25:01 +03:00
Natalia Selezneva
4a2e8849b9 Tests: allow file access to KotlinTestUtils.getHomeDirectory() in AbstractConfigureKotlinTest
This test configure kotlin standard library, so it should have access to .jar files from project dist directory
2018-12-07 10:22:59 +03:00
Andrey Uskov
abadfbb632 Fix dependencies after removal of build scripts bunches 2018-12-06 22:58:39 +03:00
Andrey Uskov
235b6ca6cd Fix stacktrace check for KT-27718. This work-around should be removed after fix of IDEA-203651
#KT-27718 Fixed
2018-12-06 20:23:05 +03:00
Vyacheslav Gerasimov
d84c5b1608 Switch to 183 platform 2018-12-06 20:16:58 +03:00
Toshiaki Kameyama
5aa0b7d2aa Extend Selection: whole literal with braces is selected after parameters (KT-13420)
#KT-13420 Fixed
2018-12-06 19:48:04 +03:00
Nikolay Krasko
05269cea2f Reformat in idea.editor package 2018-12-06 19:48:03 +03:00
Andrey Uskov
c85f56a0a8 Remove some bunches for build scripts. 2018-12-06 19:44:09 +03:00
Denis Zharkov
d8ebb70151 Advance enum entries in smart completion list
^KT-22579 Fixed
2018-12-06 17:38:31 +03:00
Denis Zharkov
d2d81d6ddc Minor. Reformat StaticMembers.kt 2018-12-06 17:38:31 +03:00
Ilmir Usmanov
1336e8f3e3 Take java 9 modules into account in coroutines debug metadata
reading
 #KT-28237
2018-12-06 16:59:15 +03:00
Ilmir Usmanov
bdd1eef39a Use class name instead internal name in coroutines debug metadata
I.e. instead of slashes use dots in fqnames.

 #KT-28237 Fixed
2018-12-06 16:59:12 +03:00
Ilmir Usmanov
5483ce0933 Do not map this when remapping parameters of static function inside
inline lambda.

 #KT-23543 Fixed
2018-12-06 15:46:22 +03:00
Mikhail Glukhikh
de33905c44 Fix formatting in "simplify call chain" #KT-28576 Fixed 2018-12-06 15:37:47 +03:00
Mikhail Glukhikh
a3909d8e47 Refactor code in "simplify call chain" (relates to KT-28576) 2018-12-06 15:37:47 +03:00
Dmitriy Dolovov
33d89005b7 K/N fix: Built-ins initialization refactoring
- Use language settings from IDELanguageSettingsProvider
- Don't use dependencies of root modules to looks up for K/N stdlib
2018-12-06 19:05:17 +07:00
Dmitriy Dolovov
0a55c586d2 K/N fix: Use BindingTrace that allows overwriting slices
Issue #KT-21791
2018-12-06 19:05:11 +07:00
Dmitriy Dolovov
d4df5e132e CLion: Hide JVM- and JS-specifics in Preferences
Issue #KT-28465:fixed
2018-12-06 19:03:43 +07:00
Andrey Uskov
273dbc823e Fix "Kotlin not configured" issue in common MPP tests.
#KT-27718 Fixed
2018-12-06 14:50:26 +03:00
Andrey Uskov
5a8621d7c7 Fix build of bunch 191 2018-12-06 14:50:05 +03:00
Mikhail Glukhikh
25f393d299 MPP JVM/JS wizard: add head & title to HTML #KT-27491 Fixed 2018-12-06 13:09:23 +03:00
Mikhail Glukhikh
6d72032b82 MPP JVM/JS wizard: upgrade Ktor to 1.0.1 (part of KT-27491) 2018-12-06 13:09:22 +03:00
Dmitriy Dolovov
782f221a9c CLion: New version 2018.3.1 (183.4588.63) 2018-12-06 16:44:50 +07:00
Roman Elizarov
75e2dfda19 Added COROUTINE_SUSPENDED docs
Fixes KT-28488
2018-12-06 11:00:32 +03:00
Natalia Selezneva
6291cfee49 Fix 'read action required' exception in scratch 2018-12-06 09:33:34 +03:00
Natalia Selezneva
9e2ff04e1b Fix build module in AndroidStudio for REPL and Scratch
^KT-23560 Fixed
2018-12-06 09:33:33 +03:00
Natalia Selezneva
ee5ede08c1 Tests: do not use hardcoded stdlib jar name 2018-12-06 09:33:32 +03:00
Natalia Selezneva
7b6508a8f9 Tests: refresh file system looking for recently copied file 2018-12-06 09:33:32 +03:00
Natalia Selezneva
6d41834282 Allow file access to KotlinTestUtils.getHomeDirectory() in IdeaModuleInfoTest 2018-12-06 09:33:31 +03:00
Natalia Selezneva
f3328b119c Fix missing changes in bunch files in ConfigureKotlinTest 2018-12-06 09:33:30 +03:00
Natalia Selezneva
d25c4a8d3e Rewrite ConfigureKotlinTest.testJsLibraryWrongKind
After the fix of KT-20511 we now detect library kind from it's jars, so even if LibraryKind is not set, it's effective kind is JSLibraryKind for this test
2018-12-06 09:33:30 +03:00
Natalia Selezneva
7d66e3f6f2 Fix AbstractExtractionTest for scripts
It fails with 'Descriptor wasn't found for declaration SCRIPT' because PsiElement was invalidated during test because of restaring highlighting in case of new script dependencies
2018-12-06 09:33:29 +03:00
Toshiaki Kameyama
9ee9965c7a Convrt anonymous function to lambda: fix incorrectly conversion
#KT-28618
2018-12-06 09:28:56 +03:00
Toshiaki Kameyama
f6323cdee4 Replace assert boolean with assert equality: add import statement
#KT-28540 Fixed
2018-12-06 09:27:35 +03:00
Dave Leeds
6ff3ae3447 KT-20357: Add samples for commonPrefixWith and commonSuffixWith 2018-12-05 19:21:57 +03:00
Ilya Chernikov
6e27bc0fb3 Fix scratch testdata after introducing result vals into repl 2018-12-05 16:02:31 +01:00
Ilya Chernikov
8e72495ded Add repl line result tests, refactor repl tests 2018-12-05 16:02:30 +01:00
vitaly.khudobakhshov
396ba6cdd5 Display function value properly 2018-12-05 16:02:29 +01:00
vitaly.khudobakhshov
c901d6cebc Implement support for "resX" result fields in REPL 2018-12-05 16:01:32 +01:00
Nikolay Krasko
79e577ae27 Remove unused deprecated configureAs methods 2018-12-05 17:46:31 +03:00
Nikolay Krasko
9cc88c13f5 Rewrite KotlinHierarchyViewTestBase with light fixture tests 2018-12-05 17:46:30 +03:00
Nikolay Krasko
5055308064 Rewrite AbstractNavigateToLibraryTest with light fixture tests 2018-12-05 17:46:28 +03:00
Nikolay Krasko
8a63a1655f Rewrite NavigateToStdlibSourceTest with project descriptors 2018-12-05 17:46:26 +03:00
Vyacheslav Gerasimov
96282b3c52 Update 183 platform to 183.4588.61 (2018.3.1) 2018-12-05 16:44:09 +03:00
Denis Zharkov
e88ed25f26 Support targeted annotations on property accesors in ultra-light classes 2018-12-05 16:34:44 +03:00
Denis Zharkov
52d5143dd7 Support delegating to interfaces in ultra-light classes 2018-12-05 16:34:44 +03:00
Denis Zharkov
dbf9ff29a9 Support data classes in ultra-light classes 2018-12-05 16:34:44 +03:00
Denis Zharkov
8b65311769 Minor. Extract KtUltraLightMethodForSourceDeclaration 2018-12-05 16:34:44 +03:00
Denis Zharkov
b73760c3fc Get rid of redundant method KtUltraLightParameter::annotatedOrigin 2018-12-05 16:34:44 +03:00
Denis Zharkov
bbaa4c225d Introduce subclasses for KtUltraLightParameter
Mostly, it's needed for clarity and to simplify
what exactly `kotlinOrigin` means in each case:
- Note, that annotatedOrigin() is always kotlinOrigin
- We don't need to store another field for receiver
- Now, kotlinOrigin is consistent with KtLightParameter::kotlinOrigin
2018-12-05 16:34:44 +03:00
Denis Zharkov
ad2f02b12e Minor. Get rid of redundant is check and unused method
Now, nullability for ultra-light elements is processed via KtUltraLightNullabilityAnnotation
2018-12-05 16:34:44 +03:00
Denis Zharkov
28d3a62567 Separate nullability annotation processing for ultra-light classes
KtLightNullabilityAnnotation is specifically designed for old light classes
and includes a bunch of hacks that are applicable for them

So, we have to introduce own hack into it
(see org.jetbrains.kotlin.asJava.classes.KtUltraLightParameter#getTypeForNullability)
that is a bit of hard to support when extending hierarchy
2018-12-05 16:34:44 +03:00
Denis Zharkov
30c60c7b1f Do not render nullability in UltraLightChecker when it's irrelevant
It's necessary because after next changes,
they become different for ultra and old light classes.
The former (ultra) is more correct but it doesn't help when
we need to compare our implementation with reference
2018-12-05 16:34:44 +03:00
Denis Zharkov
d7d0407afb Fix parameters nullability for generated overloads in light classes
When making KtLightNullabilityAnnotation after test org.jetbrains.kotlin.idea.caches.resolve.IdeLightClassTestGenerated.NullabilityAnnotations#testJvmOverloads
started failing the wrong assumption was made that for
@JvmOverloads-generated overloads their last parameter is always nullable
(see removed isNullableInJvmOverloads function) and that lead to a bug,
namely KT-28556.

The actual problem of this test started failing was incorrect definition
of kotlinOrigin in KtLightParameter for case of JvmOverloads:
wrong KtParameter was being chosen before

This commit fixes the issue by propagating how actually generated
parameters in codegen relate to source KtParameters'

^KT-28556 Fixed
2018-12-05 16:34:44 +03:00
Denis Zharkov
ac19cc9376 Extract kotlinType property in KtUltraLightField
It's gonna be used in the later commits

Also simplify a bit related code in `_type` initializer:
it seems safe just to map `kotlinType` as is for all non-trivial cases,
also note that all of them are actually generated without generic signature
2018-12-05 16:34:44 +03:00
Denis Zharkov
efc39c6137 Minor. Reformat KtLightModifierList.kt and make function private 2018-12-05 16:34:44 +03:00
Vyacheslav Gerasimov
508fe28781 Build: Add NoDebugJavaExec to filter out debugger arguments added by Idea
Workaround for IDEA-200192:
IDEA makes all JavaExec tasks not up-to-date and attaches debugger making our breakpoints trigger during irrelevant task execution
2018-12-05 16:23:25 +03:00
Leonid Startsev
f2e27da5bb Support @SerialInfo annotation for Native 2018-12-05 15:16:17 +03:00
Leonid Startsev
13af036024 Fix problem with encodeUnitElement : Unit instance is not needed in Native IR 2018-12-05 15:16:16 +03:00
Leonid Startsev
b775501042 Translate KClass references to built-in types in serialization plugin correctly.
Add overload with ClassDescriptor to `getPrimitiveClass` translation function and increase it visibility to public to be usable from plugin.
2018-12-05 15:16:15 +03:00
Leonid Startsev
5f2cea917f Remove redundant check for 'all parameters are properties' in a case of fully-customized serializer 2018-12-05 15:16:15 +03:00
Leonid Startsev
7e32e2e9b9 Increase priority of @ContextualSerialization annotation on types 2018-12-05 15:16:14 +03:00
Leonid Startsev
f13f54d5ad Fix "kotlin.UninitializedPropertyAccessException: lateinit property typeTranslator has not been initialized" in Native IR serialization plugin 2018-12-05 15:16:13 +03:00
Leonid Startsev
7c8b34fe1c Fix unresolved symbol to SerialDescriptor in KSerializer if it was
referenced from user custom serializer code (kotlinx.serialization/290)
2018-12-05 15:16:12 +03:00
Leonid Startsev
58c145210c Support for @UseSerializers annotation 2018-12-05 15:16:11 +03:00
Dmitry Savvinov
f174ee863d Don't run ExpectedActualDeclarationChecker on property accessors
One might think that it shouldn't be run because of 'if (declaration
!is KtNamedDeclaration) return' check in the 'check'-overload.

However, for default accessors we pass PSI for property, i.e.
KtProperty (see 'DeclarationCheckers.checkAccessors'), which
obviously passes this check

Note that we can't use `DescriptorToSourceUtils` here, because it's
returns `KtProperty` for default accessor too.

This commits adds specific check for that case, to avoid exception in
KT-28385. Ideal solution would be to either don't launch checkers on
such parameters, or explicitly declare semantic of the
'declaration'-parameter, e.g. to rename it to 'reportOn' (see KT-28403
for discussion)

^KT-28385 Fixed
2018-12-05 11:50:35 +03:00
Dmitry Savvinov
415fcf70e9 Add test on incomplete code in MPP
Currently, the behavior is undesired. See the next commit for the fix

^KT-28385 In Progress
2018-12-05 11:50:35 +03:00
Georgy Bronnikov
a35f368ce0 Switch off logging for failing IrBlackBox tests
Logging of tests that are expected to fail is controlled by
kotlin.suppress.expected.test.failures project property.
2018-12-05 01:48:43 +03:00
Shagen Ogandzhanian
b154d10cc5 Merge pull request #2013 from JetBrains/KT-16305-MUTATION_OBSERVER_INIT
Skip assignment for null-value ArrayLike object in idl-based generate…
2018-12-04 20:33:24 +01:00
Roman Artemev
30cc5f6d3c Support Ir Validation in phaser 2018-12-04 19:45:15 +03:00
Roman Artemev
de1cbc396e Implement JS IR Phaser 2018-12-04 19:45:15 +03:00
Roman Artemev
2d9d9484b3 Refactored Common & JVM IR Phaser 2018-12-04 19:45:15 +03:00
Cuihtlauac ALVARADO
094dc2ae45 Remove useless parameter
Private function convertToOverloadResults() has two call sites, both:

* inside member functions of the NewResolutionOldInference class
* passing NewResolutionOldInference.languageVersionSettings

Therefore, it is safe to remove this parameter from the signature of
convertToOverloadResults(). The occurence of languageVerstionSetting
in it's return statement will refer (implicitly) to the definition from
its class.
2018-12-04 19:07:27 +03:00
Cuihtlauac ALVARADO
ece745966b Remove CandidateWithBoundDispatchReceiverImpl
Interface CandidateWithBoundDispatchReceiver had a unique
implementation, which was private.

Turned interface CandidateWithBoundDispatchReceiver into a
class. Removed CandidateWithBoundDispatchReceiverImpl. Removed
string "Impl" suffix at constructor call sites.
2018-12-04 19:01:48 +03:00
Vyacheslav Gerasimov
2791a679aa Minor: add TaskAction & Option to Unused symbol inspection exclusions 2018-12-04 15:38:56 +03:00
Vyacheslav Gerasimov
17a60e3fd3 Build: use UtilityJavaExec task for compileJs and generateVisitors 2018-12-04 15:38:56 +03:00
Vyacheslav Gerasimov
da46164896 Build: use UtilityJavaExec task to serialize builtins 2018-12-04 15:38:56 +03:00
Vyacheslav Gerasimov
35c2de08b0 Build: Add UtilityJavaExec task needed to avoid JavaExec tasks
This task does the same as original JavaExec task
We avoid using JavaExec tasks due to IDEA-200192: IDEA makes all JavaExec tasks not up-to-date and attaches debugger making our breakpoints trigger during irrelevant task execution.
2018-12-04 15:38:56 +03:00
Vyacheslav Gerasimov
99c149bb8b Build: Update url for android build tools 2018-12-04 15:38:56 +03:00
Vyacheslav Gerasimov
a112bebf78 Build: Configure cache-redirector in allprojects block 2018-12-04 15:38:56 +03:00
Vyacheslav Gerasimov
3ee8cae48d Build: Update cache redirector url list 2018-12-04 15:38:56 +03:00
Simon Ogorodnik
2556d64459 Provide findModuleDescriptor for ResolutionFacadeWithDebugInfo
Fixes Move refactoring tests
Broken after introduction of ResolutionFacadeWithDebugInfo
2018-12-04 15:13:40 +03:00
Shagen Ogandzhanian
8294309e5b Skip assignment for null-value ArrayLike object in idl-based generated code 2018-12-04 12:44:43 +01:00
Dmitry Zhuravlev
ab259c2d6f Consider Kobalt libraries as external for Kotlin 2018-12-04 13:51:23 +03:00
Toshiaki Kameyama
7bf51f1533 Expand selection for class members #KT-28289 Fixed 2018-12-04 11:17:27 +03:00
Ilya Gorbunov
736818dfa7 Use Before/AfterMethod from TestNG as kotlin.test.Before/AfterTest
According to their documentation they should be invoked before and after
each test method runs.

#KT-27629 Fixed
2018-12-03 21:46:26 +03:00
Ilya Gorbunov
48c80e247e Move kotlin.test common annotations tests
Place them in tests of kotlin-test-annotations-common, so that every
platform module that implements that common module (e.g. kotlin-test-junit,
kotlin-test-junit5, kotlin-test-testng) gets these tests run.

Improve test for BeforeTest/AfterTest annotations to check that they are
invoked before/after _each_ test method.

#KT-27629
2018-12-03 21:46:26 +03:00
Ilmir Usmanov
4a828f839f Support recursive local suspend functions
Previously they were trying to call constructor (incorrectly) for
recursive calls. This is redundant, since this.invoke creates one
automatically.

In addition, support callable references to recursive local suspend
functions.

 #KT-24780 Fixed
2018-12-03 18:49:23 +03:00
Svyatoslav Kuzmich
8359887696 [JS IR BE] Fix inline classes workarounds
- Remove uninitialized return type check
- Remove unbound classifier symbol check
2018-12-03 13:07:41 +03:00
Mikhail Glukhikh
7cbc8e8b76 Introduce "Redundant else in if" inspection #KT-19668 Fixed 2018-12-03 09:39:22 +03:00
Mikhail Glukhikh
ca87e53f04 Introduce DeferredIsResultInspection #KT-25620 Fixed 2018-12-01 11:07:02 +03:00
Georgy Bronnikov
f4aad70b36 Fix KotlinFrameworkSupportProviderTest 2018-11-30 18:00:27 +03:00
Corey
ae7cc8a133 Consider non-existent AttributeContainers empty
Given the prior faulty logic, no tree of `HierarchyAttributeContainer`s would ever report itself as empty (not even a 'tree' consisting of a single, attribute-less/empty HierarchyAttributeContainer), since every tree will have a root, which will lack a parent, and it considered the lack of existence of a parent to mean that that root container is not empty.
2018-11-30 16:21:33 +03:00
Sergey Igushkin
8cec50e6e2 Reorder MPP plugin logic to fix eager publishing configuration
In Gradle 5.0, the `publishing` extension is configured eagerly, so
we need to make sure everything we use in publishing setup is already
available at the point when it's triggered:

* the `metadata` target
* the source JARs

Issue #KT-28520 Fixed
2018-11-30 15:34:58 +03:00
Sergey Igushkin
0f670f806f Fix Android Extensions early dependency resolution
Make compiler plugin options evaluate lazily, with Lazy<String> and
FileCollection as replacements for the eagerly-evaluated data.

Adjust compiler plugin option usages so that their evaluation is not
triggered when not necessary.

Issue #KT-26065 Fixed
2018-11-30 15:34:21 +03:00
Alexey Tsvetkov
201c16ecb0 Reformat incremental-compilation-impl tests 2018-11-30 15:26:34 +03:00
Alexey Tsvetkov
db0d549f02 Minor: remove usage of Intellij hashmap 2018-11-30 15:26:34 +03:00
Mikhail Glukhikh
a7ad1113b2 Redundant async: do not suggest for calls with 'start'
The reason with 'withContext' does not have such parameter anymore
2018-11-30 15:14:27 +03:00
Mikhail Glukhikh
3d15cbcced Redundant async inspection: run "optimize imports" after quick-fix 2018-11-30 15:14:27 +03:00
Mikhail Glukhikh
fd3c6496fb Redundant async inspection: support case with explicit scope
#KT-28504 Fixed
2018-11-30 15:14:27 +03:00
Mikhail Glukhikh
9f5255da02 SimplifyCallChainFix: take Conversion instead of raw text, polish a bit 2018-11-30 15:14:27 +03:00
Mikhail Glukhikh
b6630699aa SimplifyCallChainFix: implement 'modifyArguments' as lambda 2018-11-30 15:14:26 +03:00
Mikhail Glukhikh
5947ca1142 Redundant async cleanup: use CAPS for constant names 2018-11-30 15:14:26 +03:00
Mikhail Glukhikh
e6a1b96c53 Redundant async inspection: support case with GlobalScope
Partial implementation of KT-28504
2018-11-30 15:14:26 +03:00
Mikhail Glukhikh
138e36aa66 Simplify call chain fix: extract 'apply' 2018-11-30 15:14:26 +03:00
Mikhail Glukhikh
c4717d17d9 Redundant async: extract generateConversion, integrate arguments inside 2018-11-30 15:14:26 +03:00
Mikhail Glukhikh
d909162a89 Rename "Result is Result" inspection to "Direct use of result type" 2018-11-30 15:14:26 +03:00
Sergey Rostov
5237079c5d Move resources: fix copy-resources kotlin compiler maven plugins 2018-11-30 15:01:02 +03:00
Sergey Rostov
2fac72cd99 Move resources: remove build code that not required anymore 2018-11-30 15:01:02 +03:00
Sergey Rostov
d3dc1d8164 Move resources: update writePluginVersion 2018-11-30 15:01:02 +03:00
Sergey Rostov
487c57e2e0 Move resources, kotlin-reflect.jar: remove manually included META-INF/services/*
Now it already included. Manually including causes duplicated contents
in resulting files, for example:

1	   kotlin.reflect.jvm.internal.impl.load.java.FieldOverridabilityCondition
2	   kotlin.reflect.jvm.internal.impl.load.java.ErasedOverridabilityCondition
3	   kotlin.reflect.jvm.internal.impl.load.java.JavaIncompatibilityRulesOverridabilityCondition
4	+  kotlin.reflect.jvm.internal.impl.load.java.FieldOverridabilityCondition
5	+  kotlin.reflect.jvm.internal.impl.load.java.ErasedOverridabilityCondition
6	+  kotlin.reflect.jvm.internal.impl.load.java.JavaIncompatibilityRulesOverridabilityCondition

Removing this line fixes that.
2018-11-30 15:01:02 +03:00
Sergey Rostov
74f6c8ac5c Move resources: remove includes from src to resources, include resource folder in custom build scripts 2018-11-30 15:01:02 +03:00
Sergey Rostov
5623c74543 Move resources: fix pill 2018-11-30 15:01:02 +03:00
Sergey Rostov
df2e4524d7 Move resources from /src to separate /resources directory.
Previously this files was stored in /src directory and was included in
resources mainly by SourceSet.projectDefault from sourceSets.kt:

val processResources = tasks.getByName(processResourcesTaskName) as ProcessResources
processResources.from("resources") { include("**") }
processResources.from("src") { include("META-INF/**", "**/*.properties") }

Also there are some custom rules like this:

resources.srcDir("../idea-analysis/src").apply { include("**/*.properties") }
resources.srcDirs("idea-repl/src").apply { include("META-INF/**") }

All this rules are synthesized in script
https://github.com/snrostov/kotlin-migrate-resources/blob/master/src/main/kotlin/main.kt

This commit created using that script. See README.md for more details on
 script.
2018-11-30 15:01:01 +03:00
Ilya Matveev
093b9d174d Update Kotlin/Native: 1.0.3 2018-11-30 18:58:01 +07:00
Alexander Podkhalyuzin
c416b192ef Cleanup, all bunches are completely the same... 2018-11-30 14:30:43 +03:00
Denis Zharkov
2182be82e6 Fix message text for INCOMPATIBLE_ENUM_COMPARISON
^KT-28516 Fixed
2018-11-30 10:34:00 +03:00
Ilya Gorbunov
a534bfc32f Move index overflow tests to another test source set
To avoid reporting them as ignored and to make it more easy to run them
when needed.
2018-11-30 07:27:07 +03:00
Roman Artemev
c5922bf74b Refact stdlib generator, add support for different backends
[JS IR BE] Runtime fixes
 * Do not generate external declarations for IR BE
 * Move `arrayToString` helper function out of shared JS stdlib
 * Fix arrays type check for IR BE
2018-11-29 22:04:53 +03:00
Mikhail Glukhikh
05b1a99022 Fix "redundant async" for coroutines 1.*, forbid explicit scopes case
Related to KT-28504
#KT-28445 Fixed
2018-11-29 21:17:57 +03:00
Mikhail Glukhikh
93fff99d8d Extract stub library file from "Result is Result" inspection tests 2018-11-29 21:17:33 +03:00
Mikhail Glukhikh
6b60d49e09 Extract stub library file from "Redundant async" inspection tests 2018-11-29 21:17:16 +03:00
Mikhail Glukhikh
4e1d8fcfd0 Allow to convert nullable local / top to late-init since version 1.2
Enhancement for KT-12743
2018-11-29 19:58:11 +03:00
Toshiaki Kameyama
4cf266e99f Add intentions to convert nullable <--> lateinit var #KT-12743 Fixed 2018-11-29 19:45:10 +03:00
Mikhail Glukhikh
9049af3bdf Quick-fixes for SMARTCAST_IMPOSSIBLE: refactor
Enhancement for KT-27184
2018-11-29 19:26:58 +03:00
Toshiaki Kameyama
cf3215b96e Add quick fixes for SMARTCAST_IMPOSSIBLE in 'if' #KT-27184 Fixed 2018-11-29 19:26:58 +03:00
Toshiaki Kameyama
a0162adbf9 Nested lambda has shadowed implicit parameter: do not report when outer lambda 'it' is not used
#KT-26710 Fixed
2018-11-29 19:19:19 +03:00
Mikhael Bogdanov
7ee13ca353 Generalize parameter index calculation in ASM 7 support
Second part for d2a205c72d commit

 #KT-27774 Fixed
2018-11-29 16:45:50 +01:00
Alexander Podkhalyuzin
e044ec78a1 Do not duplicate build number of IDEA in code 2018-11-29 16:37:33 +03:00
Nikolay Krasko
e4da6c268a Generate new Gradle dependency directives when is version above 3.4 (KT-22571)
^KT-22571 Fixed
2018-11-29 16:23:24 +03:00
Juan Chen
7aa195b017 Use "implementation" in build scripts when configuring Kotlin (KT-22571)
Currently "compile" is used when adding kotlin dependencies to build
scripts, which is deprecated.
2018-11-29 16:23:23 +03:00
Nikolay Krasko
76a3c58aaf Better check when to apply old syntax for configuration (KT-28513, KT-22571)
^KT-28513 Fixed
2018-11-29 16:23:22 +03:00
Nikolay Krasko
93b7f05287 Add exceptions to VfsRootAccess in gradle tests 2018-11-29 16:23:21 +03:00
Svyatoslav Kuzmich
59032c384e [JS IR BE] Validate parents 2018-11-29 15:36:57 +03:00
Svyatoslav Kuzmich
39cdee8d6c [JS IR BE] Enable IrValidator 2018-11-29 15:36:56 +03:00
Svyatoslav Kuzmich
2172a12df4 [JS IR BE] Eliminate identical IrElements duplicates 2018-11-29 15:36:56 +03:00
Svyatoslav Kuzmich
ba0f652e02 [JS IR BE] Fix parameters parents 2018-11-29 15:36:56 +03:00
Svyatoslav Kuzmich
d5f8c63130 [IR] Add returnType to consturcotrs of IrFunctionBase 2018-11-29 15:36:56 +03:00
Svyatoslav Kuzmich
fe6b36391d [JS IR] JsIrBuilder - add returnType and parent to buildFunction 2018-11-29 15:36:56 +03:00
Ilmir Usmanov
0934db8fbd Do not transform state-machine when inlining
Sometimes, state-machine, generated in inline functions with
crossinline parameter, is transformed, since all usages should be
renamed.
However, this is wrong: in this case, we will have state-machine
inside state-machine.
This fix addresses the issue.

 #KT-25893 Fixed
2018-11-29 14:58:35 +03:00
Toshiaki Kameyama
d3908aeb2e Add "map.get() with not-null assertion operator" inspection #KT-25171 Fixed 2018-11-29 14:42:18 +03:00
Mikhail Glukhikh
c5c0cbccde Redundant companion reference: simplify name conflict checking code
Before this commit, function with same name but different signature
wasn't counted as name conflict, now it is - just because that exact
check in this place could be too complex and error-prone

Enhancement for KT-27539
2018-11-29 14:32:08 +03:00
Toshiaki Kameyama
1db7a0e0cc Redundant companion reference: don't report in case of name conflicts
#KT-27539 Fixed
2018-11-29 14:32:08 +03:00
Mikhail Zarechenskiy
6e27d7a2a5 [NI] Refactor common supertype calculator
Make filtration phases more explicit, get rid of `filterNot`
2018-11-29 14:08:04 +03:00
Mikhael Bogdanov
623f31a178 Remove redundant tests 2018-11-29 12:02:05 +01:00
Mikhael Bogdanov
aa12439e65 Add 'visitAnnotableParameterCount' to MethodBodyVisitor.kt 2018-11-29 12:02:04 +01:00
Mikhael Bogdanov
c6268d72c9 Separate RemapVisitor and MethodBodyVisitor 2018-11-29 12:02:03 +01:00
Nikolay Krasko
226ade615c Show build number in internal mode (KT-28254)
^KT-28254 Fixed
2018-11-29 13:31:09 +03:00
Nikolay Krasko
0aec18c440 Minor: explain in comment when light class can be null 2018-11-29 13:31:08 +03:00
Nikolay Krasko
05b2443988 Make assignment indent conforms with indent for expression bodies (KT-28484)
Do not make plain list of binary expression for assignment expressions.

 #KT-28484 Fixed
2018-11-29 13:31:07 +03:00
Nikolay Krasko
699e3397d9 Warn about bad options in usage parsers in tests 2018-11-29 13:31:04 +03:00
Mikhail Glukhikh
9b4bcabbd3 Fold initializer & if to elvis: add test, rename tests, simplify code
Enhancement for KT-27016
2018-11-29 13:20:54 +03:00
Toshiaki Kameyama
fd6f34f8ca "Replace 'if' with elvis operator": don't suggest on super type check
#KT-27016 Fixed
2018-11-29 13:20:54 +03:00
Georgy Bronnikov
ffa3d7c57a Update test data 2018-11-29 12:48:52 +03:00
Georgy Bronnikov
32640750ee Add CompilerPhase and corresponding compiler keys 2018-11-29 12:48:52 +03:00
Alexander Prendota
ecba313223 ReadMe: update Kotlin playground link 2018-11-29 12:16:57 +03:00
Ilya Chernikov
7719a5849f Refactor templates from dependencies loading:
move into background thread
avoid parallel execution
other refactorings

#KT-27669 fixed
2018-11-29 09:47:15 +01:00
Ilya Chernikov
e91fd63a15 Add config entry for main.kts to recognise it in all locations 2018-11-29 09:47:15 +01:00
Ilya Chernikov
c67df19281 Improve classpath calculation for locally-defined script templates
Since at least in gradle-imported projects, the template could be found
in several modules, some of them - incomplete (parent/buildscript module)
the previous logic of filtering for already processed templates and roots
is incorrect, and therefore removed.
Also fixes the exception in our project "cannot load script definition"
2018-11-29 09:47:15 +01:00
Natalia Selezneva
4b5ba83c77 Tests: synchronize script dependencies in the beginning of the test because it invalidates the tested psi file
Fix for StandaloneScriptRunConfigurationTest.testOnFileMoveWithNonDefaultWorkingDir
2018-11-28 16:04:50 +03:00
Natalia Selezneva
9f372c3c66 Update dependencies for AS34 (Canary 3.4.0.5) 2018-11-28 16:04:50 +03:00
Natalia Selezneva
25043a720c Tests: allow document modification during highlighting for scripts in LocalInspectionTest
Fix 'java.lang.AssertionError: PSI/document/model changes are not allowed during highlighting'
For script when there are some new dependencies we are restarting highlighting (see ScriptDependenciesCache)
2018-11-28 16:04:49 +03:00
Natalia Selezneva
902c4688a2 Tests: register jdk in project table to avoid leaking of VirtualPointer 2018-11-28 16:04:49 +03:00
Natalia Selezneva
1b0919a019 Fix navigation on stdlib in non-gradle projects (KT-28398)
In non-gradle project kotlin-stdlib-sources.jar contains sources for common and jvm part, so both (expect and actual) declarations are present in the same library sources scope.
We are moving expect declarations in the bottom of this list to avoid navigation on expect declaration when actual declaration is present in the same scope
^KT-28398 Fixed
2018-11-28 16:04:49 +03:00
Natalia Selezneva
8033ec469c Revert wrong testdata fix in NavigateToStdlibSourceTest 2018-11-28 16:04:49 +03:00
Simon Ogorodnik
29a1204b48 Fix test failures on CI due to ProGuard-ed Guava 2018-11-28 15:29:01 +03:00
Dmitriy Dolovov
42392fff23 Fix: Analysis in scratch ends with ISE
Issue #KT-28427:fixed
2018-11-28 18:58:57 +07:00
Toshiaki Kameyama
dc2a707444 Keyword completion: add 'class' after 'data' #KT-26632 Fixed 2018-11-28 14:47:37 +03:00
Dmitry Petrov
42e253b5ff KT-28456 generate index arguments per expression
In the desugaring for compound assignment to a collection element,
argument expression 'i' is mapped to value parameters 'iG' and 'iS' of
corresponding 'get' and 'set' operators.
In general, these value parameters can have different indices.

This requires extra machinery in argument generation - that is, to be
able to generate a particular expression argument using an arbitrary
callback. In the vast majority of the cases this callback will just use
the corresponding StatementGenerator to generate IR subtree for the
provided expression. In case of 'get' and 'set' operator calls for an
augmented assignment expression this will map corresponding argument
expressions to pregenerated temporary variables.

Thus, in the following context:
```
  class A

  operator fun A.get(vararg xs: Int) = 0
  operator fun A.set(i: Int, j: Int, v: Int) {}
```

statement `a[1, 2] += 3` will be desugared as (in a really pseudo
Kotlin):
```
  {
    val tmp_array = a
    val tmp_index0 = 1
    val tmp_index1 = 2
    tmp_array.set(
      i = tmp_index0,
      j = tmp_index1,
      v = tmp_array.get(xs = [tmp_index0, tmp_index1]).plus(3)
    )
  }
```
2018-11-28 14:36:44 +03:00
Toshiaki Kameyama
036b12f408 Extract interface: do not show private contstractor parameter on dialog
#KT-28408 Fixed
2018-11-28 13:46:57 +03:00
Mikhail Glukhikh
8fb213021c Create expect: remove false positive in inaccessible type detector 2018-11-28 12:36:29 +03:00
Mikhail Glukhikh
9ae7bc935d Create expect / actual refactoring: extract AbstractCreateDeclarationFix 2018-11-28 12:36:22 +03:00
Mikhail Glukhikh
222939efe7 Create expect / actual refactoring: extract common part to utilities 2018-11-28 12:00:55 +03:00
Mikhail Glukhikh
17e0e529e0 Create actual refactoring: get rid of actualNeeded 2018-11-28 12:00:54 +03:00
Mikhail Glukhikh
d54b5b68cc Create expect / actual refactoring: get element description at one place 2018-11-28 12:00:54 +03:00
Mikhail Glukhikh
933d10e75d Create expect / actual refactoring: remove all declarations at start 2018-11-28 12:00:54 +03:00
Mikhail Glukhikh
d3fada89b7 Generate enum entries in create actual / expected fixes as all other
This makes code a bit cleaner
2018-11-28 12:00:54 +03:00
Cuihtlauac ALVARADO
a9280cdbcd Add support for proxies to scripts
Update jcabi-aether dependency from 0.10.1 to 1.0-SNAPSHOT. In order to
do that, add https://oss.sonatype.org/content/repositories/snapshots to
the repositories in tools/kotlin-script-util/build.gradle.kts

Script dependencies are resolved using jcabi-aether. Unfortunately "stable"
release (0.10.1) does not support proxies. Therefore, script dependencies
are not pulled behind a proxy. Issue is fixed in SNAPSHOT release of
jcabi-aether.

FIXED: KT-22363
2018-11-28 09:30:05 +01:00
Natalia Selezneva
e3eda012c4 Tests: synchronize script dependencies in the beggining of the test because it invalidates the tested psi file 2018-11-28 11:16:26 +03:00
Natalia Selezneva
2d2a073c55 Tests: replace immediate run with TransactionGuard.submitTransaction to fix write in write-unsafe context in tests 2018-11-28 11:16:26 +03:00
Sergey Rostov
62b0b3e4e9 JPS: report about unsupported targets once
Report about unsupported targets once per target type, show presentable
chunks list and don't show more then 5 chunks.

Example: "Native is not yet supported in IDEA internal build system.
Please use Gradle to build a, b, c, d, e and 10 other  (enable 'Delegate
IDE build/run actions to Gradle' in Settings)."

#KT-26980 Fixed
#KT-28316 Fixed
2018-11-28 11:08:57 +03:00
Sergey Rostov
ab2b4311fd JPS: fix SimpleKotlinJpsBuildTest.testDaemon
Make it the same as testJpsDaemonIC
2018-11-28 10:46:57 +03:00
Sergey Rostov
0c39358b5f JPS: fix testJpsDaemonIC
1. Checking for COMPILE_DAEMON_CUSTOM_RUN_FILES_PATH_FOR_TESTS was moved to COMPILE_DAEMON_DEFAULT_RUN_DIR_PATH.

Looks like COMPILE_DAEMON_CUSTOM_RUN_FILES_PATH_FOR_TESTS was introduced incorrectly in 220fab0d3f.
Checking of this property was added in DaemonOptions.runFilesPathOrDefault, while DaemonOptions.runFilesPath was internally used in runFilesPathOrDefault and in many other places.
For example DaemonOptions.runFilesPath used to pass this option to daemon server.
So daemon was started with runFilesPath that ignores COMPILE_DAEMON_CUSTOM_RUN_FILES_PATH_FOR_TESTS.

2. JpsKotlinCompilerRunner._jpsCompileServiceSession was leaked between tests.

Fixed by extracting @TestOnly releaseCompileServiceSession() and calling it in tests tearDown()

3. The result of compileWithDaemon was ignored in compileWithDaemonOrFallback.

So, the fallback was never called, and the FAIL_ON_FALLBACK_PROPERTY was actually was never worked.
This was fixed. Also the message was improved to make it easier to find the original fail cause.
2018-11-28 10:46:57 +03:00
Sergey Rostov
c06b000e8d JPS: Test for "Cyclically dependent modules should have same compiler"
KT-27285
2018-11-28 10:46:57 +03:00
Sergey Rostov
3c8b15ca54 JPS: Report "Cyclically dependent modules should have same compiler" as build error rather than exception
#KT-27285 Fixed
2018-11-28 10:46:57 +03:00
Sergey Rostov
ce4422e2ef JPS, tests: Support multimodule mpp tests without steps 2018-11-28 10:46:58 +03:00
Ilya Gorbunov
beec6a7c4a Update line numbers after reformatting coroutines stdlib sources 2018-11-28 06:05:03 +03:00
Ilya Gorbunov
d7ff6c48ea Leave only 1.3 JS IR runtime sources
Update exclusions after merging coroutines sources into stdlib.
2018-11-28 06:05:03 +03:00
Ilya Gorbunov
5c94ef229b Move release coroutines sources into the corresponding stdlib sourcesets 2018-11-28 06:05:03 +03:00
Ilya Gorbunov
7d61a2de73 Reformat coroutine sources 2018-11-28 06:05:03 +03:00
Ilya Gorbunov
ec3692026d Rename coroutines sourceset to coroutinesExperimental
Restore experimental coroutine tests as they were before e22ca022
and compile and run them twice:
 - first time with LV=1.2
 - second time with LV=1.3
2018-11-28 06:05:02 +03:00
Ilya Gorbunov
673844a059 Move coroutine tests to other stdlib-jvm tests 2018-11-28 06:05:02 +03:00
Georgy Bronnikov
1a529bd601 Revert "Switch off logging for failing IrBlackBox tests"
This reverts commit d23964034b.
2018-11-28 00:00:13 +03:00
Yan Zhulanow
6590497b8d Revert "Minor: Remove a deprecated method usage"
The method is still actual in IDEA 181 and Android Studio 3.1/3.2.
2018-11-28 02:25:34 +09:00
Yan Zhulanow
9bc02279c4 Kapt: Fix Maven build, add 'getJarPathForClass()' to the ProGuard configuration 2018-11-28 02:25:34 +09:00
Sergey Igushkin
a0399d0541 Add new-mpp-lib-with-tests Kotlin DSL build script and test 2018-11-27 19:47:49 +03:00
Sergey Igushkin
202c86aafe Add a function attributes { } to KotlinTarget and KotlinCompilation
Gradle has a function `attributes { ... }` for `Configuration`, so we
can introduce one, too, for uniformity of the DSLs. This will configure
the `val attributes: AttributeContainer` of the `KotlinTarget` and
`KotlinCompilation`.

Issue #KT-27682 Fixed
2018-11-27 19:47:48 +03:00
Sergey Igushkin
5c5c161d59 Enable resources processing for Kotlin/JS target in MPP
Issue #KT-28363 Fixed
2018-11-27 19:47:47 +03:00
Sergey Igushkin
4dd95e331f Add missing DSL features to the MPP dependencies DSL
* Add DSL for project(...) with path and configuration
* Add DSL for e.g. api(someDependency) { /* ... */ }
* Add DSL for e.g. api(kotlin("stdlib"))

Issue #KT-26663 Fixed
2018-11-27 19:47:45 +03:00
Sergey Igushkin
cee52c095f Add and generate Groovy-friendly DSL members
As Gradle Groovy DSL does out-of-the box not allow working with
SAM-receiving functions in the same way as those accepting a Closure,
and, moreover, does not work with Kotlin default parameters, we need
to provide Groovy-friendly DSL functions along with Kotlin DSL functions

This commit adds those additional members for all of the newly
introduced MPP DSL members.
2018-11-27 19:47:44 +03:00
Sergey Igushkin
88fa85fc1f Don't set the default Maven coordinates that are derived from project
In Gradle, a publication's Maven coordinates are by default derived from
the project. Setting them explicitly breaks the link, and the
coordinates are no more updated when the project's group and version
change.

Setting the coordinates in our code breaks with Gradle Kotlin DSL, where
the plugin is applied before the build script can even update the
project's group and version -- our code could set empty values, which
would update no more. Not setting them helps: the values are still
delegated to the project.
2018-11-27 19:47:43 +03:00
Sergey Igushkin
a3b50e33b8 Remove the out-projection from kotlinSourceSets in kotlin extension
Gradle versions older than 4.10 could not correctly provide access to
the source set via delegation (i.e. `getting`, `creating` etc.) because
of the out-projection.

Remove the out-projection and expose just
`DomainObjectContainer<KotlinSourceSet>`, as under the hood we can still
use the `DefaultKotlinSourceSet` type for the items.
2018-11-27 19:47:42 +03:00
Sergey Igushkin
207bf7cf4a Add test for multiplatform projects with Gradle Kotlin DSL
* Adjust some of the test tools to work with *.kts scripts
* Expose the tool for version substitution into plugins DSL and use it
* Transform the lib-and-app test case to Gradle Kotlin DSL
2018-11-27 19:47:41 +03:00
Sergey Igushkin
fe64d33ae4 Add defaultSourceSet to KotlinCompilation
Previously, the connection between a `KotlinCompilation` and its
default `KotlinSourceSet` (the one automatically created and added into
the compilation) was not expressed in the MPP model in any reasonable
way that can be used in the build scripts.

However, this connection seems to have settled in the build logic, and
it may be useful to be able to get the default source set from a
compilation, for example, to be able to configure dependencies across
several targets in a uniform way.

The metadata compilations don't have their dedicated source sets, but
we can think of commonMain as a default source set for the project's
metadata, is it is currently in fact only contains the declarations from
commonMain.

Issue #KT-27685 Fixed
2018-11-27 19:47:39 +03:00
Sergey Igushkin
581b161611 Expose statically-typed kotlinOptions and compileKotlinTask in DSL
To simplify configuring a `KotlinCompilation` with Gradle Kotlin DSL, it
is essential to expose statically-known types where possible.

This commit parametrizes `KotlinCompilation` with its Kotlin options
type (a subtype of `KotlinCommonOptions`) and adds `kotlinOptions` and
`compileKotlinTask` to `KotlinCompilation`.

(minor) Also reduce the visibility of `attachClassesDir` and
`setupPlugins` to internal, since this API is not for external use.
2018-11-27 19:47:38 +03:00
Sergey Igushkin
1e2436b1c1 Make KotlinNativeCompile implement the <...>.dsl.KotlinCompile interface
This is required for KotlinCompilation to be able to generically expose
the Kotlin compile tasls.
2018-11-27 19:37:50 +03:00
Sergey Igushkin
ae5d59caf0 Add a new root of <...>.dsl.KotlinCompile hierarchy in API
This new interface uses a more general type for its kotlinOptions,
KotlinCommonToolOptions rather than KotlinCommonOptions. This is
needed for the Kotlin/Native task to implement a common interface
with the other Kotlin compilation tasks.
2018-11-27 19:37:50 +03:00
Sergey Igushkin
ecd54d9b21 (minor) Move KotlinCommonToolOptions to kotlin-gradle-plugin-api
This change is needed to expose `kotlinOptions { ... }` in the
API interfaces.
2018-11-27 19:37:50 +03:00
Sergey Igushkin
635d436f02 Provide preset-like factory functions for creating targets in new MPP
* Pull the `targets` and `presets` properties of the `kotlin` extension
  up to an interface in `kotlin-gradle-plugin-api`

* Generate the code: we need type-safe statically-typed functions for
  different target type, which seems to be only possible to achieve by
  providing a function per preset.

* Place these functions in the top-level `kotlin` Gradle extension,
  rather than extension functions for `kotlin.targets`:

  - `kotlin.jvm { ... }` will work, while `kotlin.targets.jvm { ... }`
    won't, the extension function needs to be somehow brought into scope

  - reducing the nesting level by one seems to be a good move here

Issue #KT-26389 Fixed
2018-11-27 19:37:49 +03:00
Georgy Bronnikov
d23964034b Switch off logging for failing IrBlackBox tests
Logging of tests that are expected to fail is controlled by
kotlin.suppress.expected.test.failures project property.
2018-11-27 16:53:34 +03:00
Yan Zhulanow
57d8e9457c Evaluate: Pass a constructor with loaded classes to 'runEval4J()'
So even if 'evaluateWithCompilation()' fails, 'runEval4J()' can use the additional classes.
2018-11-27 22:21:28 +09:00
Yan Zhulanow
1d1f3c3fd6 Minor: Remove a deprecated method usage 2018-11-27 22:21:27 +09:00
Yan Zhulanow
4cfd028768 Do not ignore an evaluation exception in StepOver command 2018-11-27 22:21:27 +09:00
Yan Zhulanow
03a6066ce0 Call 'StackFrameProxy::visibleVariables()' in a safe way (KT-27462) 2018-11-27 22:21:27 +09:00
Yan Zhulanow
47657df8da Kapt: Convert valid references to qualified names (KT-26304) 2018-11-27 22:21:27 +09:00
Yan Zhulanow
6a8a8b794d Kapt: Support correctErrorTypes in suspend functions (KT-27711) 2018-11-27 22:21:27 +09:00
Yan Zhulanow
4c5e982f3e Kapt: Fix an ArrayIndexOutOfBoundsException for suspend functions with generated return types 2018-11-27 22:21:26 +09:00
Yan Zhulanow
69633e6686 Kapt: Fix stubs for delegated properties with anonymous types (KT-27910) 2018-11-27 22:21:26 +09:00
Yan Zhulanow
5fd070a9b9 Kapt: Add option for showing annotation processor timings (KT-28024) 2018-11-27 22:21:26 +09:00
Yan Zhulanow
9feb834d97 Kapt: Support paranoid mode in memory leak searcher 2018-11-27 22:21:26 +09:00
Yan Zhulanow
ecc44419b6 Kapt: Support KotlinOptions class in KaptWithoutKotlincTask 2018-11-27 22:21:25 +09:00
Yan Zhulanow
7e4069f114 Kapt, Refactoring: Introduce 'KaptOptions'
1. Use 'KaptOptions' for all kapt options, including paths and flags.
2. Use a single 'KAPT_OPTIONS' compiler configuration key for setting all options (using a mutable KaptOptions.Builder).
3. Pass 'KaptOptions' instead of separate flags.
4. Remove 'KaptPaths'.
5. Remove deprecated 'aptOnly' CLI option.
2018-11-27 22:21:25 +09:00
Toshiaki Kameyama
a621171d9b KT-24515 Intention to add an exception under the cursor to @Throws annotations 2018-11-27 22:21:25 +09:00
Yan Zhulanow
3918ec71be Kapt: Suppress warnings for deprecated kapt option usage 2018-11-27 22:21:25 +09:00
Yan Zhulanow
abd1646d42 Kapt: Detect memory leaks in annotation processors (KT-28025) 2018-11-27 22:21:24 +09:00
Yan Zhulanow
eb3511164f Fix DataBinding kapt integration test 2018-11-27 22:21:24 +09:00
Yan Zhulanow
911ad32580 Kapt: Check if the psiElement is bound to some Document instance before asking for its text range
textRange has an assertion that fails if the Document is not set.
2018-11-27 22:21:24 +09:00
Yan Zhulanow
cd968ba8fe Kapt: Clear Javac shared ZIP cache after annotation processing or stub generation (KT-25756) 2018-11-27 22:21:24 +09:00
Yan Zhulanow
0ffa901859 Switch plugin and annotation processor loading to the own implementation of ServiceLoader
'ServiceLoader' in JDK8 leaks file handles (https://bugs.openjdk.java.net/browse/JDK-8156014).
New implementation uses the ZipFile API, it also doesn't operate on the whole classpath which is not often needed.
2018-11-27 22:21:24 +09:00
Yan Zhulanow
11e23ecc70 Kapt: Fix 'apt+compile' mode, clear package caches directly 2018-11-27 22:21:23 +09:00
Yan Zhulanow
4e84a6b601 Kapt: Do partial analysis only for stub generation
Kapt has a 'compile' mode which repeats analysis after the annotation processing.
It should not run in the partial analysis mode.
2018-11-27 22:21:23 +09:00
Yan Zhulanow
69ec958aab Kapt: Add tests for the command-line 'kapt' tool 2018-11-27 22:21:23 +09:00
Yan Zhulanow
6e5eb0fdd4 Kapt: Implement 'kapt' command-line tool (KT-24998, KT-24997) 2018-11-27 22:21:23 +09:00
Yan Zhulanow
2e56feed73 Performance optimization: do not create a new list object on each new option 2018-11-27 22:21:23 +09:00
Yan Zhulanow
b6aecf3933 Remove hacky PluginURLClassLoader
It was once needed for the compiler plugins bundled straight into the compiler (read: kapt1). Since there are no bundled plugins anymore, the parent-last plugin classloader itself is not needed anymore.
2018-11-27 22:21:22 +09:00
Yan Zhulanow
02340a4fe3 Removed obsolete 'BundledCompilerPlugins' class
It was used once in kapt1, but since it's gone, there is no need in this anymore.
2018-11-27 22:21:22 +09:00
Yan Zhulanow
c5e241d5c6 Remove deprecated usages of CliOption in official compiler plugins 2018-11-27 22:21:22 +09:00
Yan Zhulanow
49941339a3 Introduce AbstractCliOption, rewrite all possible kapt options as enum values 2018-11-27 22:21:22 +09:00
Yan Zhulanow
546eff6e45 Kapt: Use light analysis by default 2018-11-27 22:21:21 +09:00
Yan Zhulanow
fa0f447a23 Minor: Refactor AptMode a bit 2018-11-27 22:21:21 +09:00
Yan Zhulanow
fe0f9005b0 Kapt: Allow to use class output directory as a generated class output 2018-11-27 22:21:21 +09:00
Yan Zhulanow
7893bb60a6 Kapt: Using 'kapt' configuration without the 'kotlin-kapt' plugin applied should throw an error (KT-26145) 2018-11-27 22:21:21 +09:00
victor.petukhov
f5d44003cd Add tests for type annotations with unresolved reference and invalid target (KT-28424, KT-28449) 2018-11-27 13:55:12 +03:00
Andrey Uskov
620969652a Fixed dependency resolution of root project
#KT-28389 Fixed
2018-11-27 13:46:56 +03:00
Toshiaki Kameyama
4abcd9a053 Make internal: don't suggest for @JvmField property inside companion object of interface #KT-27138 Fixed 2018-11-26 18:39:54 +03:00
Pavel Punegov
9cc93e9e55 Fix Contracts deserialization for native plugin 2018-11-26 18:19:03 +03:00
Pavel Punegov
fe0a2bc75e Provide SerializerExtension methods with child DescriptorSerializer instance
to make Native be able to serialize backing properties and inline bodies.
Change visibility for functions and properties of DescriptorSerializer.
2018-11-26 18:15:30 +03:00
Toshiaki Kameyama
726b9272f3 Move out of companion object: don't suggest for @JvmField property inside companion object of interface #KT-28443 Fixed 2018-11-26 18:01:43 +03:00
Nikolay Krasko
3ca934e5ea Update test data for gradle migration test 2018-11-26 17:23:00 +03:00
Nikolay Krasko
bc6f53d023 Auto-indent || and && operator typed on a new line (KT-28402)
#KT-28402 Fixed
2018-11-26 17:22:59 +03:00
Nikolay Krasko
9c41ec46ee Auto-indent elvis operator on new line (KT-28371)
#KT-28371 Fixed
2018-11-26 17:22:58 +03:00
Nikolay Krasko
8fad4db8ce Auto-popup lambda type parameter info (KT-28401)
#KT-28401 Fixed
2018-11-26 17:22:45 +03:00
Vyacheslav Gerasimov
d30b66467b 183: Update 183 Idea version to the release one 2018-11-26 17:00:38 +03:00
Simon Ogorodnik
fd1a6f3830 KT-20725: Fix storing NotProperty settings
#KT-20725 fixed
2018-11-26 16:38:23 +03:00
Mikhail Glukhikh
cb7f7b1de5 Report "use of non-const Kotlin property" also on some assignments
#KT-25536 Fixed
2018-11-26 15:54:20 +03:00
Mikhail Glukhikh
651faa4ab2 Report "use of non-const Kotlin property" also on Java case labels
#KT-25536 Fixed
2018-11-26 15:54:07 +03:00
Denis Zharkov
23c43cd124 Support retrieving class of enum entry in ultra-light classes 2018-11-26 11:36:43 +03:00
Denis Zharkov
5cf2d659dc Minor. Split ultraLightPsi.kt into three files
By one for PsiClass, PsiField and PsiMethod implementations
2018-11-26 11:36:31 +03:00
Denis Zharkov
5231da4320 Fix hasAlias check when resolving annotation in ultra-light classes
When trying to estimate if annotation entry might be resolved
to a specified fqName we should track the short name from entry itself
instead of the short name of desired annotation
2018-11-26 11:36:30 +03:00
Denis Zharkov
aa5a2a2643 Support @JvmField on primary ctr properties in ultra-light classes 2018-11-26 11:36:29 +03:00
Denis Zharkov
206466f6ce Support enums in ultra-light classes
There's no need to add "values"/"valueOf" methods for them
(see com.intellij.psi.impl.compiled.StubBuildingVisitor#visitMethod that ignores them too)

We already have tests that check enum entries/synthetic methods
are properly resolved in Java:
idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/*Enum*
2018-11-26 11:36:28 +03:00
Denis Zharkov
d5a640b82d Get rid of checks for ultra-light classes unsupported annotations
Seems like all of the Jvm* annotations related to classes are supported by now
2018-11-26 11:36:28 +03:00
Denis Zharkov
ca9f42f449 Support @JvmName in ultra-light classes 2018-11-26 11:36:27 +03:00
Denis Zharkov
17328a442a Support @JvmSynthetic in ultra-light classes 2018-11-26 11:36:26 +03:00
Denis Zharkov
91c86f7f56 Fix refactorings that remove parameter based on ultra-light classes
This commit fixes the exception attached to the bottom of the message
The problem is that when creating ChangeSignatureProcessor for old PsiMethod
that points to the parameter that is already removed from PSI, some pieces
of platform code run resolution on the light PSI that eventually checks
if the source element is valid.

For KtUltraLightParameter, it inherits "isValid" from LightElement and
the latter is defined as getNavigationElement().isValid(),
while here navigationElement points to already removed parameter,
and marked as invalid.

The simplest solution was to define KtUltraLightParameter::isValid
as it was before ultra-light classes, i.e. checking if parent is valid
(see KtLightElementBase::isValid)

com.intellij.psi.PsiInvalidElementAccessException: Element: class com.intellij.psi.impl.compiled.ClsJavaCodeReferenceElementImpl #JAVA  because: File language:Language: JAVA != Provider base language:Language: kotlin
invalidated at: no info
	at com.intellij.psi.util.PsiUtilCore.ensureValid(PsiUtilCore.java:482)
	at com.intellij.psi.impl.source.PsiClassReferenceType.resolveGenerics(PsiClassReferenceType.java:190)
	at com.intellij.psi.impl.source.PsiClassReferenceType.resolve(PsiClassReferenceType.java:138)
	at com.intellij.psi.util.PsiUtil.resolveClassInType(PsiUtil.java:445)
	at com.intellij.psi.util.PsiUtil.convertAnonymousToBaseType(PsiUtil.java:484)
	at com.intellij.psi.impl.light.LightTypeElement.<init>(LightTypeElement.java:33)
	at com.intellij.psi.impl.PsiElementFactoryImpl.createTypeElement(PsiElementFactoryImpl.java:142)
	at com.intellij.refactoring.changeSignature.JavaChangeInfoImpl.fillOldParams(JavaChangeInfoImpl.java:218)
	at com.intellij.refactoring.changeSignature.JavaChangeInfoImpl.<init>(JavaChangeInfoImpl.java:127)
	at com.intellij.refactoring.changeSignature.JavaChangeInfoImpl.<init>(JavaChangeInfoImpl.java:86)
	at com.intellij.refactoring.changeSignature.ChangeSignatureProcessor.generateChangeInfo(ChangeSignatureProcessor.java:121)
	at com.intellij.refactoring.changeSignature.ChangeSignatureProcessor.<init>(ChangeSignatureProcessor.java:88)
	at org.jetbrains.kotlin.idea.refactoring.changeSignature.KotlinChangeInfo$getOrCreateJavaChangeInfos$3.invoke(KotlinChangeInfo.kt:400)
	at org.jetbrains.kotlin.idea.refactoring.changeSignature.KotlinChangeInfo$getOrCreateJavaChangeInfos$5.invoke(KotlinChangeInfo.kt:469)
	at org.jetbrains.kotlin.idea.refactoring.changeSignature.KotlinChangeInfo.getOrCreateJavaChangeInfos(KotlinChangeInfo.kt:498)
	at org.jetbrains.kotlin.idea.refactoring.changeSignature.KotlinChangeSignatureUsageProcessor.processUsage(KotlinChangeSignatureUsageProcessor.kt:847)
	at com.intellij.refactoring.changeSignature.ChangeSignatureProcessorBase.doChangeSignature(ChangeSignatureProcessorBase.java:218)
2018-11-26 11:36:25 +03:00
Denis Zharkov
7de8b4de4e Support declarations returning object literals in ultra-light classes 2018-11-26 11:36:25 +03:00
Denis Zharkov
28f20a97f8 Support @JvmOverloads annotation in ultra-light classes 2018-11-26 11:25:42 +03:00
Denis Zharkov
41997769e3 Support @JvmField annotation in light classes 2018-11-26 11:25:42 +03:00
Sergey Rostov
dcc47fd8ef JPS: support KotlinResourceSourceRootType
Implementation is similar to KotlinSourceRootProvider.
This workaround is required since ResourcesTarget.computeRootDescriptors
supports only JavaResourceRoots.

#KT-27622 Fixed
2018-11-26 09:29:49 +03:00
Sergey Rostov
1301333e37 JPS, tests, minor: rename test files in modules for better readability 2018-11-26 09:29:38 +03:00
Sergey Rostov
63c6e3e1b4 JPS, minor: formatting 2018-11-26 09:29:38 +03:00
Sergey Rostov
32bd4d5936 JPS, tests: update removeAndRestoreCompanion[WithImplicitUsages] test data
src/A.kt is affected by removed classes
2018-11-26 09:29:38 +03:00
Sergey Rostov
7cdd5257c8 JPS: clear target local cache version file when caches are not required anymore
Makes changeIncrementalOption/incrementalOff test green
2018-11-26 09:29:38 +03:00
Sergey Rostov
1f162cfacf JPS, tests, minor: reformat test data for changeIncrementalOption/incrementalOff 2018-11-26 09:29:38 +03:00
Sergey Rostov
4cd4e230bf JPS, tests: update test data for cacheVersionChanged/withError
In this test only lookups caches are invalidated and only in first step.
module4 shouldn't be rebuilt since is compiled in step 1 and it is independent of all dirty modules.

Previously this module was rebuilt because of #KT-27044 which is fixed
by 5232f08
2018-11-26 09:29:38 +03:00
Sergey Rostov
a508f53f9d JPS, tests, minor: reformat test data for cacheVersionChanged/withError 2018-11-26 09:29:38 +03:00
Sergey Rostov
06b908d48f JPS, tests: Add docs for incremental/cacheVersionChanged tests 2018-11-26 09:29:38 +03:00
Ilya Gorbunov
290efe3749 BFS improvement in Gradle importer
Avoid queuing duplicate dependencies and excessive `contains` checks
by tracking discovered modules instead of processed.

Use ArrayDeque instead of LinkedList
2018-11-24 16:20:29 +03:00
Toshiaki Kameyama
e409007749 Join Lines: join initializer + if null check to elvis (KT-22388)
#KT-22388 Fixed
2018-11-24 02:30:10 +03:00
Vyacheslav Gerasimov
0708872f62 Remove kotlin-ultimate from VcsDirectoryMappings 2018-11-23 22:29:08 +03:00
Alexander Udalov
a796f11934 Support calling methods annotated with PolymorphicSignature
#KT-14416 Fixed
 #KT-26165 Fixed
2018-11-23 18:41:33 +01:00
Alexander Udalov
b940418604 Compute default method signature lazily in CallableMethod
To prevent calling mapDefaultMethod for methods which are guaranteed
not to have default parameters (e.g. signature-polymorphic methods)
2018-11-23 18:41:32 +01:00
Alexander Udalov
0331f84ccd Make parameter descriptor in CallGenerator.genValueAndPut optional
The main implementation in DefaultCallGenerator did not use anything
from that parameter anyway in 99% cases, except the type, which is
passed separately now as JvmKotlinType. This will be useful to implement
call generation for functions which do not have descriptors for their
value parameters (such as signature-polymorphic)

 #KT-14416 In Progress
2018-11-23 18:41:32 +01:00
Alexander Udalov
7766f0a89d J2K CallBasedArgumentGenerator: convert and prettify 2018-11-23 18:41:32 +01:00
Alexander Udalov
b66755b2d6 J2K CallBasedArgumentGenerator: rename .java -> .kt 2018-11-23 18:41:32 +01:00
Dmitriy Dolovov
bdaf762d93 CLion/AppCode: Disable action items in IDE:
- Convert Java File to Kotlin File
- Decompile Kotlin To Java

Issue #KT-28345:fixed
2018-11-23 22:27:23 +07:00
Dmitriy Dolovov
597d119ab7 CLion/AppCode: New plugin versioning schema
Use -PdeployVersion=<kotlin_version> to specify Kotlin version
Use -PcidrPluginVersion=<plugin_version> to specify CLion or AppCode plugin version (default is "beta-1")
2018-11-23 22:27:23 +07:00
Dmitriy Dolovov
b39656a85a CLion/AppCode: Use LLDB bindings in Kotlin/Native debugger 2018-11-23 22:27:23 +07:00
Dmitriy Dolovov
5dca9b3de5 CLion/AppCode: Re-enable specific EPs for Kotlin/Native
Issue #KT-26717
2018-11-23 22:27:23 +07:00
Simon Ogorodnik
8ed63d1c18 CLion: Patch some xml's of Java plugin to make it work more stable
To get rid of exceptions while startup and indexing
2018-11-23 22:27:23 +07:00
Simon Ogorodnik
2b3b5876aa CLion/AppCode: Use default platform for libraries, if no LibraryKind is specified
To avoid Unknown platform JVM
2018-11-23 22:27:23 +07:00
Vyacheslav Karpukhin
1b9b545643 CLion: limit plugin compatibility 2018-11-23 22:27:23 +07:00
Simon Ogorodnik
a8e5c01126 CLion/AppCode: Build artifacts via compilations, not via tasks 2018-11-23 22:27:23 +07:00
Simon Ogorodnik
7f0fcf7ef1 CLion/AppCode: Do not import sourceSets with unsupported platforms 2018-11-23 22:27:22 +07:00
Simon Ogorodnik
4a99cb274b CLion/AppCode: Provide proper TargetPlatform & TargetPlatformVersion to FE 2018-11-23 22:27:22 +07:00
Simon Ogorodnik
49de7becfd CLion/AppCode: Disable module type check for Kotlin Facet adding 2018-11-23 22:27:22 +07:00
Simon Ogorodnik
64800266f5 CLion/AppCode: Provide proper default platform instead of JVM 2018-11-23 22:27:22 +07:00
Simon Ogorodnik
39b151e37b CLion/AppCode: Fix facet configuring 2018-11-23 22:27:22 +07:00
Vyacheslav Karpukhin
6dccafb469 CLion/AppCode: Move KotlinMPPGradleProjectResolver declaration from gradle-java.xml to gradle.xml 2018-11-23 22:27:22 +07:00
Vyacheslav Karpukhin
632dcc31bd CLion/AppCode: Added kotlin-ultimate repository. 2018-11-23 22:27:21 +07:00
Mikhail Zarechenskiy
7b108541a9 [NI] Add test for obsolete issue
It was fixed after c6712ff861

 #KT-25182 Obsolete
2018-11-23 17:30:37 +03:00
Mikhail Zarechenskiy
30aee3bfb6 [NI] Update test data 2018-11-23 17:30:37 +03:00
victor.petukhov
68c1e70b74 Add real literals spec tests 2018-11-23 17:24:13 +03:00
victor.petukhov
73ecde6cc3 Add boolean literals diagnostic spec tests 2018-11-23 17:24:01 +03:00
victor.petukhov
1af1eed31c Add when expression PSI spec tests 2018-11-23 17:23:51 +03:00
victor.petukhov
64f531fc93 Reorganize spec tests infrastructure code
- Add the tests mute system for the diagnostic tests
- Move the code for the test info parsing to the separate package `parsers`
- Unification of the `linked` and `not linked` spec tests
- Package structure is refactored
- Change the multiline comment format with a test information
- Actualize `PrintSpecTestsStatistic`
- Other different code improvements
2018-11-23 17:23:41 +03:00
Mikhail Glukhikh
2af9efa4a0 Fix failing test (related to KT-28381, KT-28382 commits) 2018-11-23 15:43:39 +03:00
Mikhail Glukhikh
d59ea4c087 Move member to companion object: reformat 2018-11-23 15:35:19 +03:00
Mikhail Glukhikh
88cea0a88c Navigation to implementation: do not try to find expect enum inheritors
Before this commit, expect enum could find actual enum entries
as its implementation, now it cannot.
#KT-28206 Fixed
2018-11-23 15:35:19 +03:00
Mikhail Glukhikh
5502d2de6a Fix KNPE in "Move member to companion" for expect class #KT-28383 Fixed 2018-11-23 15:35:19 +03:00
Mikhail Glukhikh
41b75346fe Forbid "introduce backing property" for expect classes #KT-28382 Fixed 2018-11-23 15:35:19 +03:00
Mikhail Glukhikh
10cc4959cc Forbid "move property to constructor" for expect classes #KT-28381 Fixed 2018-11-23 15:35:18 +03:00
Andrey Uskov
f960ed9a46 Fix gradle-api version in bunch 173 (KT-27337) 2018-11-23 13:43:52 +03:00
Andrey Uskov
8fc005d8fd Versions of components were moved from versions.gradle.kts to versions.properties in order to avoid unnecessary buildscript recompilation
#KT-27337 Fixed
2018-11-23 13:26:12 +03:00
Nikolay Krasko
d2b0ccd341 Restrict index search to declarations visible from Java
Fix KotlinStdLibInJavaCompletionTestGenerated.testList
Regression after KotlinShortNamesCache rewrite.
2018-11-23 01:59:15 +03:00
Nikolay Krasko
b79f8ff8fa Fix completion tests after "cast required" color change (KT-18089)
#KT-18089 Fixed
2018-11-23 01:59:14 +03:00
Toshiaki Kameyama
d06b04f025 Add intention to convert SAM lambda to anonymous object #KT-25718 Fixed 2018-11-23 01:05:42 +03:00
Andrey Uskov
eedb69b5e4 Improve diagnostics in GradleInspectionTest 2018-11-22 20:18:03 +03:00
Ilya Gorbunov
cff32e46bb Provide expect declarations for String.startsWith/endWith overloads
Mark the existing declarations as actual.
2018-11-22 19:17:24 +03:00
Mikhail Zarechenskiy
b48614df47 Add test for class literals on inline classes
#KT-28361 Obsolete
2018-11-22 18:10:41 +03:00
Mikhail Zarechenskiy
7a9fb3ca26 [NI] Fix coercion to Unit for explicitly specified type argument
#KT-25424 Fixed
2018-11-22 18:10:39 +03:00
Mikhail Zarechenskiy
c6712ff861 [NI] Correctly compute definitely not null type for intersection one
{ T : Any? & Foo & Bar? }!! -> { T!! & Foo & Bar }

 Also, fix bug with loosing non-representative number type.
 For example, for type { Byte & SomeType } we lost type `Byte` because
 `getDefaultPrimitiveNumberType` returns null for it

 Fixes #KT-28334 for NI
2018-11-22 18:10:37 +03:00
Mikhail Zarechenskiy
aa224558bd Convert and simplify IntersectionTypeConstructor 2018-11-22 18:10:35 +03:00
Mikhail Zarechenskiy
8340bff113 Rename .java to .kt for IntersectionTypeConstructor 2018-11-22 18:08:30 +03:00
Toshiaki Kameyama
f1a0cefde0 Convert concatenation to template: remove 'toString()' call #KT-6025 Fixed 2018-11-22 15:55:32 +03:00
Toshiaki Kameyama
825d1d8b35 Extract 'isToString()' function to Utils 2018-11-22 15:55:32 +03:00
Nikolay Krasko
a0c25c7a87 Revert running AS in internal mode
Patch isn't needed anymore, because it was resolved in Android Studio.

Reverts: 11bcd84f57
2018-11-22 13:07:58 +03:00
Nikolay Krasko
dfa0ca1192 Some better colours for unmatched elements (KT-18089)
Platform requires a single color for both selected/not-selected item and
so colour selection isn't easy (see https://youtrack.jetbrains.com/issue/IDEA-191959
for details)

 #IDEA-191959 Fixed
2018-11-22 13:07:57 +03:00
Mikhail Glukhikh
d50c4d7211 Fix failing IR tests because of CCE in WrappedValueParameterDescriptor
In previous commits, renderValueParameter began to calculate its
containing declaration. However, WrappedValueParameterDescriptor
assumes that parent of IrParameter is IrFunction, which is not true
for dispatch receiver parameters. The correct fix would be not to create
WrappedValueParameterDescriptor for dispatch receivers at all and use
WrappedReceiverParameterDescriptor instead. In this fix, I just moved
parameter' containing declaration calculation inside specific option
which is usually false, thus hiding the found problem.
2018-11-22 13:03:05 +03:00
Andrey Uskov
22830ebbf8 Disable irrelevant importing tests in AS 3.3 and 3.4 2018-11-22 12:52:04 +03:00
Andrey Uskov
ef6aae0f4a Migrate importing tests to new configuration management 2018-11-22 12:51:47 +03:00
Andrey Uskov
903a048fcd Enabled tests for gradle 4.9 2018-11-22 12:51:33 +03:00
Andrey Uskov
0fd9e06f8a Fix import tests after KT-27832 2018-11-22 12:51:20 +03:00
Nikolay Krasko
9a79f43a50 Restore support for 173 branch 2018-11-22 11:25:56 +03:00
Nikolay Krasko
3e11fc1824 Extract common pattern in KotlinShortNamesCache and more arrays reuse 2018-11-22 11:25:55 +03:00
Nikolay Krasko
175ed533ee Implement another method in KotlinShortNamesCache with processor 2018-11-22 11:25:53 +03:00
Nikolay Krasko
98c6b6837a Rewrite fetching methods in KotlinShortNamesCache with processor 2018-11-22 11:25:50 +03:00
Nikolay Krasko
25fff006ef Minor: rearrange and add regions in KotlinShortNamesCache 2018-11-22 11:25:48 +03:00
Nikolay Krasko
001d4875c8 Rewrite fetching fields in KotlinShortNamesCache with processor 2018-11-22 11:25:47 +03:00
Nikolay Krasko
21ea17b398 Rewrite processClassesWithName with processors 2018-11-22 11:25:45 +03:00
Nikolay Krasko
0ffec69d12 Use processors in KotlinShortNamesCache and remove deprecated methods 2018-11-22 11:07:05 +03:00
Dmitry Petrov
7dd906db44 KT-28324 More exact startOffset for function/constructor declarations
Function/constructor declaration start offset is the start offset of the
corresponding declaration token, if available.
2018-11-22 10:09:31 +03:00
Sergey Rostov
dfe662364d JPS, minor: remove unused parameter 2018-11-22 08:40:32 +03:00
Sergey Rostov
f70d01f657 Fix updating complementary files map in case of compilation errors
#KT-27868 Fixed

Previously given dirtyFiles was removed from complementaryFilesMap
exactly on call of clearComplementaryFilesMapping. This causes fail
of next build in case of compilation error of previous build on JPS
(since complementary files not known on second build). The right way
to do it is removing (replacing) them only after successful
build.

This was working on Gradle since Gradle rebuilds whole module (project)
in case of build error.
2018-11-22 08:40:32 +03:00
Sergey Rostov
cc9892a27d JPS: Add tests for mpp complementary files tracking after build error (KT-27868) 2018-11-22 08:40:32 +03:00
Sergey Rostov
84d6c1df5a Add assertion for overwriting common sources flag
Wrong flag state causes compilation errors for optional expectation
(this flag is used to pass -Xcommon-sources)
2018-11-22 08:40:32 +03:00
Sergey Rostov
5a25d3ef58 Workaround for KT-28099 Duplicated dependency to common module
Duplicated dependencies causes duplicated source roots which in turns
causes duplicated files dirty state tracking.
2018-11-22 08:40:31 +03:00
Nicolay Mitropolsky
daef6f09b9 183: IdeaKotlinUastResolveProviderService.kt.183 compilation fix 2018-11-21 18:55:07 +03:00
Nicolay Mitropolsky
ebefcd476f 183: CliKotlinUastResolveProviderService.kt.183 compilation fix 2018-11-21 18:12:44 +03:00
Mikhail Glukhikh
914620fd1f FIR: introduce status & status transformer (no override resolve)
So #KT-24021 Fixed
2018-11-21 18:04:15 +03:00
Mikhail Glukhikh
65d89a61bf FIR: constructor refactoring, now there are callable members 2018-11-21 18:04:14 +03:00
Mikhail Glukhikh
a07b9a70f7 FIR builder: do not generate implicit types for getters 2018-11-21 18:04:14 +03:00
Mikhail Glukhikh
dadc028884 FIR: support delegated types in secondary constructors
So #KT-24088 Fixed
2018-11-21 18:04:14 +03:00
Mikhail Glukhikh
c06b0efdfa FIR: add implicit primary constructors, add delegated types to them
So #KT-24088 In Progress
2018-11-21 18:04:14 +03:00
Simon Ogorodnik
1c6490a1be FIR: Fix resolution of type parameter in ext property receiver
Also cleanup FirTypeResolveTransformer
2018-11-21 18:04:14 +03:00
Simon Ogorodnik
6bca2d1045 FIR: Get rid of delegation in resolved imports
This prevents strange visitors behaviour
2018-11-21 18:04:14 +03:00
Simon Ogorodnik
e010a96055 FIR: Fix super-type nested qualifier resolution 2018-11-21 18:04:13 +03:00
Mikhail Glukhikh
06cb24db7c FIR builder: do various stub-based optimizations #KT-24090 Fixed 2018-11-21 18:04:13 +03:00
Mikhail Glukhikh
73235885e7 FIR: get rid of FirUnitType in default setters 2018-11-21 18:04:13 +03:00
Mikhail Glukhikh
c2686872ae FIR: use implicit Unit type in setters 2018-11-21 18:04:13 +03:00
Mikhail Glukhikh
bcb27f212c FIR: support resolve of implicit Unit types 2018-11-21 18:04:13 +03:00
Mikhail Glukhikh
65f1a6c041 FIR: introduce FictitiousFunctionSymbol making it not FIR-based 2018-11-21 18:04:13 +03:00
Mikhail Glukhikh
5cdf938902 FIR: temporary implementation of kotlin.FunctionX resolve 2018-11-21 18:04:12 +03:00
Mikhail Glukhikh
82ae3f8f10 FIR resolve: add nested companion scope #KT-24095 Fixed 2018-11-21 18:04:12 +03:00
Mikhail Glukhikh
98abe08056 Add Java symbol resolve in default star importing scope
Related to KT-24098
2018-11-21 18:04:12 +03:00
Mikhail Glukhikh
5c572aa56e Add java.lang & kotlin.jvm to default star importing scope 2018-11-21 18:04:12 +03:00
Mikhail Glukhikh
b58e372db3 FIR: include properties from primary constructors in tree 2018-11-21 18:04:12 +03:00
Mikhail Glukhikh
e2cec9125d FIR: resolve annotations on value & type parameters 2018-11-21 18:04:12 +03:00
Mikhail Glukhikh
78d45f3f90 FIR: resolve constructor delegated calls (types are all error yet) 2018-11-21 18:04:11 +03:00
Mikhail Glukhikh
ea86c3d2b3 FIR: resolve bounds of function type arguments 2018-11-21 18:04:11 +03:00
Simon Ogorodnik
6c3fe5dc98 FIR: refactor cone types (arguments, projections) 2018-11-21 18:04:11 +03:00
Simon Ogorodnik
02bedeca05 FIR: introduce Java type resolve and JavaSymbolProvider #KT-24098 Fixed 2018-11-21 18:04:11 +03:00
Mikhail Glukhikh
5c53bdb142 FIR: support inline classes + render class attributes nicer 2018-11-21 18:04:11 +03:00
Mikhail Glukhikh
124c11df08 FIR: support lateinit properties 2018-11-21 18:04:11 +03:00
Mikhail Glukhikh
7279d696d2 FIR: support annotation resolve & rendering 2018-11-21 18:04:10 +03:00
Mikhail Glukhikh
c31513837b FIR: fix resolve of function type & its parameters in supertype position 2018-11-21 18:04:10 +03:00
Simon Ogorodnik
6cfe935c2a FIR: Switch to | in fir resolved type renderer
Otherwise it clashed with qualified names
2018-11-21 18:04:10 +03:00
Simon Ogorodnik
4fb321fa00 FIR: Support function type resolve #KT-24092 Fixed 2018-11-21 18:04:10 +03:00
Simon Ogorodnik
0ea1a5b30f FIR: Various random optimization 2018-11-21 18:04:10 +03:00
Simon Ogorodnik
140120abc2 FIR: Optimize iteration 2018-11-21 18:04:10 +03:00
Mikhail Glukhikh
cce741eef8 FIR: partial function type resolve + some rendering fixes 2018-11-21 18:04:09 +03:00
Simon Ogorodnik
29ee4371d0 FIR: Optimize fqName creation in ImportResolveTransformer 2018-11-21 18:04:09 +03:00
Simon Ogorodnik
8a5a43d670 Add IDEA action to show raw FIR of currently opened file
This action works correctly with fir.enabled=true in Gradle properties
2018-11-21 18:04:09 +03:00
Toshiaki Kameyama
e5f0f2489f Introduce backing property: fix false positive for const property #KT-28341 Fixed 2018-11-21 17:51:34 +03:00
Andrey Uskov
7080559cb4 Remove empty build.gradle.kts.191 2018-11-21 17:37:16 +03:00
Nicolay Mitropolsky
0ee98a8d1d 183: Uast: multiresolve (KT-27244) 2018-11-21 17:24:14 +03:00
Leonid Startsev
2e83ec1551 Restrict auto-implementing serializers methods to certain type of classes 2018-11-21 16:00:04 +03:00
Leonid Startsev
1535426a11 Don't add GeneratedSerializer as a supertype for user-defined serializers 2018-11-21 16:00:03 +03:00
Leonid Startsev
a3e34af2f1 Increase priority of overridden serializer on type
Fixes Kotlin/kotlinx.serialization/252
2018-11-21 16:00:02 +03:00
Leonid Startsev
127ceaca34 Fix commented check when generating descriptor initializer:
It was needed before `save` because save references symbol of initializer,
yet we don't need to generate it if user provided its own getter
2018-11-21 16:00:01 +03:00
Leonid Startsev
b76116a077 Do not add any .childSerializers() stuff if user explicitly marked custom serializer as KSerializer
todo: better design for user-provided descriptors and and schema hierarchy
2018-11-21 16:00:00 +03:00
Leonid Startsev
80c262ec66 Fix instantiation of generic serializers on JS
(Kotlin/kotlinx.serialization/244, which was fixed already by lookuping descriptor, but still had a bug)
2018-11-21 15:59:59 +03:00
Leonid Startsev
a163e62f5f Rebased on master, adopt to new constant values from deserialized
annotations
Fix issue with generating redundant constructors for custom generic
seralizers
2018-11-21 15:59:58 +03:00
Leonid Startsev
2444a6680e .shouldEncodeElementDefault for JVM 2018-11-21 15:59:57 +03:00
Leonid Startsev
662e918a7b Support skipping values equals to defaults in output stream for JS and IR backends 2018-11-21 15:59:56 +03:00
Leonid Startsev
dba6396e95 Support enums according to new design 2018-11-21 15:59:55 +03:00
Leonid Startsev
f101e17dfa Support reference array and context serializers
Enum serializers are also instantiated, but won't work on native because of lack of KClass<E: Enum<E>>.enumValues()
2018-11-21 15:59:54 +03:00
Leonid Startsev
ef42201b05 Fix order of overriding @Serializable(with) on property: check override, than @ContextualSerialization.
This will apply Context serializer event if class annotated @Serializable
2018-11-21 15:59:53 +03:00
Leonid Startsev
abb8e5e914 Support @Transient properties initializers and init blocks in IR plugin 2018-11-21 15:59:52 +03:00
Leonid Startsev
104368de3b Better lookup for serializer() function in companion for generic classes because user can define a parameterless shorthand one
Fixes Kotlin/kotlinx.serialization/#228
2018-11-21 15:59:51 +03:00
Leonid Startsev
077f51e2f4 Generics serialization in IR 2018-11-21 15:59:50 +03:00
Leonid Startsev
a4a1df0a81 Add information about secondary constructors to synthetic classes.
Before this, descriptors for such constructors were created in-place where they needed by the codegens.
However, presence of symbol table in IR backend requires the single instance of constructor descriptor across all compilation to be able to reference it and create a symbol. This support of generics in kotlinx.serialization on Kotlin/Native.
2018-11-21 15:59:49 +03:00
Leonid Startsev
01d3c7bdc8 Descriptors for IR 2018-11-21 15:59:48 +03:00
Leonid Startsev
3010814327 .childSerializers for JS 2018-11-21 15:59:47 +03:00
Leonid Startsev
baf8cb6e9b Replace imported serialization-ide.jar with serialization-compiler.jar so JPS build also start working 2018-11-21 15:59:46 +03:00
Leonid Startsev
e40383b1ce Introduce GeneratedSerializer and childSerializers
Descriptors passing on JVM
2018-11-21 15:59:45 +03:00
Leonid Startsev
f0e81c6eb8 Respect @ContextualSerialization on file
Add common ancestor to all serializable generators
2018-11-21 15:59:44 +03:00
Leonid Startsev
82fa152514 Remove auto-applying ContextSerializer 2018-11-21 15:59:43 +03:00
Nicolay Mitropolsky
0cfce8bd99 Evaluating string constants in injections in String Interpolations (KT-25906) 2018-11-21 15:37:57 +03:00
Mikhail Glukhikh
0489efc0ae Get rid of !! in getDataFlowAwareTypes #KT-28200 Fixed 2018-11-21 15:13:35 +03:00
Mikhail Glukhikh
5385efd7d7 Do not start import fixes in write action because pop-up is possible
I was not able to reproduce the issue. However, according the rules
quick-fixes working with pop-ups should not start in write action
#KT-28196 Fixed
2018-11-21 15:13:22 +03:00
Mikhail Glukhikh
1585461a68 Fix create expected for classes with anonymous initializers 2018-11-21 15:13:02 +03:00
Mikhail Glukhikh
99388c304f Fix create expected for non-actual nested class case 2018-11-21 15:13:02 +03:00
Mikhail Glukhikh
a4214f13c8 Forbid create expected on class member when class has no expected itself
Related to KT-27075
2018-11-21 15:13:01 +03:00
Mikhail Glukhikh
8b7c7dbe25 Create expected quick-fix: check types accessibility before creation
Related to KT-27075
2018-11-21 15:13:01 +03:00
Mikhail Glukhikh
f31428257d Add a set of new tests for KT-27075 (create expected class) + some fixes 2018-11-21 15:13:01 +03:00
Mikhail Glukhikh
4ab4358d22 OverrideMemberChooserObject cleanup: remove forceAbstract (function gen) 2018-11-21 15:13:01 +03:00
Mikhail Glukhikh
2277dcc76f Introduce quick-fix "create expected class / function / property"
#KT-27075 Fixed
2018-11-21 15:13:01 +03:00
Mikhail Glukhikh
5c6f776c09 Add actual: handle already existing declarations more precisely
#KT-23693 Fixed
2018-11-21 15:13:00 +03:00
Mikhail Glukhikh
46a5d76254 Create actual: add delegation to secondary constructor, if needed
#KT-26518 Fixed
2018-11-21 15:13:00 +03:00
Mikhail Glukhikh
90a2f70fd1 Use OverrideMemberChooserObject to generate also primary constructors
Relates to KT-27093 and similar problems
2018-11-21 15:13:00 +03:00
Mikhail Glukhikh
cd041cca71 Use OverrideMemberChooserObject to generate also abstract actual decls
Relates to KT-27093 and similar problems
2018-11-21 15:13:00 +03:00
Mikhail Glukhikh
3612c2983e Use OverrideMemberChooserObject to generate actual decls in quick-fixes
This can fix a lot of issues related to inexact generation, in particular
#KT-27093 Fixed
2018-11-21 15:12:59 +03:00
Sergey Rostov
5645b6c1b7 Add upsource IDEA plugin shared configuration 2018-11-21 14:36:20 +03:00
Dmitry Petrov
b3ce2eea39 Add LanguageVersionSettings to KotlinTypeMapper
KotlinTypeMapper clients should use proper LanguageVersionSettings when
possible.
2018-11-21 12:01:41 +03:00
Yan Zhulanow
5636227857 Android Extensions: Use lazy package fragment descriptors only in IDE 2018-11-21 12:34:01 +09:00
Yan Zhulanow
4f3f813b32 Android Extensions: Make AndroidPackageFragmentProviderExtension lazy 2018-11-21 12:34:01 +09:00
Yan Zhulanow
6f8d44750a Android Extensions: analyze layout XMLs lazily 2018-11-21 12:34:01 +09:00
Yan Zhulanow
12a05e0006 Android Extensions: Use smart pointers in 'AndroidResource' 2018-11-21 12:34:01 +09:00
Ilya Gorbunov
3d2a3cddff Stop producing empty kotlin-stdlib-coroutines jar 2018-11-21 03:42:27 +03:00
Simon Ogorodnik
bc7ef66a28 Fix codeStyleSettings damaged test failure properly 2018-11-20 22:13:06 +03:00
Alexander Udalov
67bc8d62fc Do not store JVM reflection objects by soft reference
Otherwise they might be garbage-collected before being made accessible
with `isAccessible = true` and the reflective call.

Also, compute BoxUnboxData in InlineClassAwareCaller right away, to
prevent storing a hard reference on the descriptor (all descriptors and
related data are stored by soft references in kotlin-reflect).

 #KT-27585 Fixed
2018-11-20 17:54:01 +01:00
Mikhail Zarechenskiy
9d2524a790 Fix failing test because of lack of inference annotation
LINENUMBER was incremented because of added import
2018-11-20 19:36:50 +03:00
Mikhail Zarechenskiy
761cf0812b Minor: add test for obsolete issue
#KT-8050 Obsolete
2018-11-20 19:36:50 +03:00
Mikhail Zarechenskiy
7327928449 Refactoring: extract common code into the method 2018-11-20 19:36:50 +03:00
Ilmir Usmanov
fda0901b39 Remove usages of kotlin-stdlib-coroutines.jar in tests 2018-11-20 19:09:27 +03:00
Igor Chevdar
2f3ff60abc Fixed bug with fake overridden functions with defaults 2018-11-20 12:11:29 +03:00
Toshiaki Kameyama
c49770d9a7 Unused symbol: don't report for type parameter in open class #KT-23639 Fixed 2018-11-20 11:18:18 +03:00
Toshiaki Kameyama
bc4d353134 Unused symbol: fix message for interface #KT-28286 Fixed 2018-11-20 11:14:45 +03:00
Matthew Runo
56d354223e Updated suggested issues link to only query the KT project rather than all projects. 2018-11-20 10:52:14 +03:00
Matthew Runo
08d70cbfe8 Update to better describe first time import of project. Changed URL for up for grabs to filter to only show Open issues. 2018-11-20 10:52:14 +03:00
Dmitry Petrov
3efb07bf7b Return kotlin ctor mapped to a java ctor even if java ctor is synthetic
This allows working with constructors with inline class parameters using
Kotlin reflection, as described in
https://youtrack.jetbrains.com/issue/KT-27429#focus=streamItem-27-3161148-0-0

 #KT-27913
 #KT-27429
2018-11-20 09:53:18 +03:00
Dmitry Petrov
9082f19c00 KT-25907: Use proper loop parameter type in for-in-CharSequence 2018-11-20 09:52:09 +03:00
Natalia Selezneva
b8086d9093 Do not start multiple background threads loading dependencies for different scripts
^KT-27743 Fixed
2018-11-20 08:51:03 +03:00
Natalia Selezneva
8ce63f6567 Fix extension for ErrorGradleScriptDefinition 2018-11-20 08:48:58 +03:00
Nikolay Krasko
5ab812e29e Enlarge scope for auto-import and completion with extensions (KT-27944)
Android R classes provided with scope enlarger and they can be found
during resolve, but ignored during auto-import search.
2018-11-19 16:47:21 +03:00
Nikolay Krasko
be92c5e787 Return back to using Exec task instead of JavaExec for serializing builtins
Idea patches all JavaExec tasks and enables debugger for them. This
causes unexpected breakpoints stops during serialization (IDEA-200192).

An attempt with explicit removing added agentlib:jdwp= parameter breaks
Gradle up-to-date check for this task:

> Task ':core:builtins:serialize' is not up-to-date because:
>   Value of input property 'jvmArgs' has changed for task ':core:builtins:serialize'

Co-authored-by: Ilya Gorbunov <ilya.gorbunov@jetbrains.com>
2018-11-19 15:06:36 +03:00
Denis Zharkov
580d03be5f Support JvmWildcard/JvmSuppressWildcard in ultra-light classes
The idea is reusing logic from KotlinTypeMapper for that
2018-11-19 14:40:51 +03:00
Denis Zharkov
ce3b489fa9 Avoid using CheckSignatureAdapter in ultra-light classes 2018-11-19 14:40:51 +03:00
Denis Zharkov
037ad2923c Minor. Rename parameter in KtUltraLightClass::asJavaMethod 2018-11-19 14:40:51 +03:00
Denis Zharkov
e15e82e1a9 Refactor KotlinType::asPsiType for ultra-light classes
- Extract HOF that UltraLightSupport::mapType that allows to call
arbitrary functions of type mapper
- Use it for computing return type of functions
- "declaration: KtDeclaration" parameter became unused since it was only
used for return types
2018-11-19 14:40:51 +03:00
Egor Ushakov
06d91fd95f use CharSequence methods where available (KOTLIN-CR-2456) 2018-11-19 13:06:40 +03:00
Toshiaki Kameyama
35cc6ff495 Keyword completion: add 'val' after 'const' #KT-27916 Fixed 2018-11-19 11:51:45 +03:00
Natalia Selezneva
1b715ab253 "Add non-null asserted (!!) call": Fix for array access expression (KT-27071)
^KT-27071 Fixed
2018-11-19 11:09:32 +03:00
Dmitry Petrov
90da274eaa KT-28054: Treat inline class constructor accessors specially 2018-11-19 09:42:03 +03:00
Mikhail Zarechenskiy
3a93cab3b6 Mark JVM specific test with TARGET_BACKEND directive
This is needed to avoid test failing for Kotlin/Native
2018-11-17 22:55:18 +03:00
Ilya Chernikov
c05c46d50f Convert to release coroutines (kotlinx-coroutines.1.0.1) 2018-11-17 19:24:34 +01:00
Toshiaki Kameyama
89ba7a7ae8 Make abstract: do not suggest for inline classes #KT-28268 Fixed 2018-11-17 18:07:15 +03:00
Toshiaki Kameyama
e671318653 Formatting: add line break between '{' and enum entry (KT-28227)
#KT-28227 Fixed
2018-11-17 01:26:27 +03:00
Ilya Gorbunov
7d3de70754 Correct replacement for js Math.log
The correspondent kotlin.math function is ln(x)

#KT-28251 Fixed
2018-11-17 00:20:54 +03:00
Ilya Gorbunov
e81859b50d Document exceptions that can be thrown from MatchGroupCollection.get(name) 2018-11-16 20:29:38 +03:00
Ilya Gorbunov
8d0d6d1bf3 Do not mutate Matcher in MatchResult.next()
Instead of mutating the matcher create a new one when `next()` is called.
This allows getting named groups from that matcher later.

Add lookbehind in matchSequence test to ensure this change doesn't alter
the existing behavior.

Also fixes #KT-20865
2018-11-16 20:29:38 +03:00
Ilya Gorbunov
f76c0568ea Additionally run kotlin-stdlib-jdk8 tests on jdk9 and jdk10/11 if available 2018-11-16 19:46:38 +03:00
Ilya Gorbunov
c0a7c5cff4 Refactor: use ArrayDeque instead of Stack in FileTreeWalkIterator
Cleanup modifiers, replace if with when.

#KT-27251 Fixed
2018-11-16 19:40:40 +03:00
Toshiaki Kameyama
52ca1803d3 Call chain into sequence: use registerProblemWithoutOfflineInformation() #KT-28231 Fixed 2018-11-16 18:20:40 +03:00
Nikolay Krasko
6c3f01ce2c Refactoring: move channels titles and urls to single place 2018-11-16 17:45:04 +03:00
Nikolay Krasko
bc85b531ee Include jre -> jdk library replacement to cleanup 2018-11-16 17:45:02 +03:00
Nikolay Krasko
c568ea043f Reformat parameterInfo 2018-11-16 17:45:01 +03:00
Nikolay Krasko
b1cf98d82a Reformat completion.handlers 2018-11-16 17:45:00 +03:00
Toshiaki Kameyama
8b2fef3812 Remove explicit type specification: don't propose for ext function type
#KT-8875 Fixed
2018-11-16 16:35:04 +03:00
Dmitry Savvinov
c8cbe05722 [Minor] Add even more logging for EA-119635 2018-11-16 14:46:46 +03:00
Toshiaki Kameyama
8089d2e9e3 Replace deprecated symbol usage in whole project: enable on annotation declared without parentheses #KT-12479 Fixed 2018-11-16 13:07:36 +03:00
Toshiaki Kameyama
fa51354ef9 Reformat: DeprecatedSymbolUsageInWholeProjectFix 2018-11-16 13:07:36 +03:00
Toshiaki Kameyama
75755afc00 Remove redundant spread operator: don't remove inner argument spread operator #KT-27699 Fixed 2018-11-16 13:06:25 +03:00
Toshiaki Kameyama
52c499166e Reformat: RemoveRedundantSpreadOperatorInspection 2018-11-16 13:06:25 +03:00
Denis Zharkov
aa63ad4a45 Report a warning when comparing incompatible enums
I've put `isIncompatibleEnums` to TypeIntersector because I placed
all of its usages after all of the TypeIntersector::isIntersectionEmpty ones

^KT-28225 Fixed
2018-11-16 10:36:09 +03:00
Dmitry Petrov
a0d74be7cf KT-28235: Make sure array access produces unique elements
This requires generating calls on-demand in
LValueWithGetterAndSetterCalls.
2018-11-16 10:33:30 +03:00
Dmitry Petrov
080c177ed2 Minor: formatting 2018-11-16 10:33:30 +03:00
Mikhail Zarechenskiy
090d3327c0 Use wrapper class of an inline one as a result for javaClass
#KT-28185 Fixed
 #KT-28246 Open
2018-11-16 00:55:01 +03:00
Alexander Udalov
1a2579d8e8 Minor, add test for obsolete issue
#KT-21692 Obsolete
2018-11-15 20:29:34 +01:00
Igor Chevdar
2ff87ab1ce Fixed tests on IR copier 2018-11-15 19:13:06 +03:00
Igor Chevdar
728b7b130b Removed descriptors usage from IR copier 2018-11-15 19:13:06 +03:00
Nikolay Krasko
2d1c76344c Store presence of spread operator for value argument in stubs 2018-11-15 18:55:56 +03:00
Alexander Udalov
4c64db66dc Use File.toPath instead of Paths.get+File.toURI in moduleVisibilityUtils
#KT-27930 Fixed
2018-11-15 16:51:37 +01:00
Roman Artemev
d5acc8ff5b [JS BE] Set enclosing exception state in finally block
[Fix KT-28207]
2018-11-15 18:44:22 +03:00
Denis Zharkov
353b469f4a Update bootstrap to 1.3.20-dev-1708 2018-11-15 17:17:41 +03:00
Simon Ogorodnik
ad6ae3ba48 Fix failing test for AS33 2018-11-15 16:27:57 +03:00
Simon Ogorodnik
2d514d410f Update testData due to platform changes 2018-11-15 16:27:56 +03:00
Simon Ogorodnik
6b07cd1950 Update testData due to changes in stdlib
New function equals, and kotlin.js.JsName in common
2018-11-15 16:27:20 +03:00
Toshiaki Kameyama
2a03e1b3da Leaking this: fix for 'this' in enum class #KT-15835 Fixed 2018-11-15 15:16:48 +03:00
Xavi Arias Seguí
14311e77c2 Fix typo in Kotlin doc for contract method
Fix the typo in "Specifies the contact of a function."
2018-11-15 03:58:41 +03:00
Alexander Udalov
9b07bbdf56 Do not use backslash for escaping outside of string literals in argfiles
This fixes CLI tests testArgfileWithEscaping and
testApiVersionLessThanLanguageUsingArgfile on Windows

 #KT-28180 Fixed
2018-11-14 12:53:24 +01:00
Ilya Gorbunov
607b11e6b9 Replace kotlin-stdlib-jre8 dependency with -jdk8 in 'idea' module
No API is used from -jre8 artifact and -jdk8 is required in runtime for tests
2018-11-14 14:28:34 +03:00
Ilya Gorbunov
3e72c0bece Add stdlib-jdk7/8 to Kotlin IDEA plugin classpath
Motivation: standard library dynamically loads its JDK7/8 extensions by class name.
When these extensions are missing from the plugin classloader, they are loaded by
the parent classloader thus becoming assignment incompatible with the base class.

Fixes EA-120914
2018-11-14 14:28:33 +03:00
Mikhail Glukhikh
ad4ebcd953 Do not run MPP wizard tests for AS34 (fixes test suite warning) 2018-11-14 13:14:22 +03:00
Dmitry Petrov
08f23d981b Minor: generated tests 2018-11-14 13:01:00 +03:00
Alexey Tsvetkov
5fa627c501 Add flag to enable intra-project parallel tasks
To enable parallel tasks execution within a project,
add 'kotlin.parallel.tasks.in.project=true'
to gradle.properties or local.properties file .

    #KT-28155 fixed
2018-11-14 11:41:43 +03:00
Alexey Tsvetkov
4678a00324 Always clear local state directories for non-incremental build 2018-11-14 11:41:43 +03:00
Alexey Tsvetkov
21289722b7 Move after-compilation cleanup actions to GradleKotlinCompilerWork
Otherwise cleanup actions would run in-parallel or before
compilation when Gradle Workers are used
2018-11-14 11:41:43 +03:00
Alexey Tsvetkov
ff81a46233 Pass arguments to GradleKotlinCompilerWork in GradleKotlinCompilerWorkArguments
It's less error prone to add/remove/reorder arguments this way,
because named arguments can be used and the compiler actually
checks that all arguments are passed to GradleKotlinCompilerWorkArguments's
constructor.
2018-11-14 11:41:43 +03:00
Alexey Tsvetkov
349386960e Minor: remove unnecessary return 2018-11-14 11:41:43 +03:00
Alexey Tsvetkov
4fc05f74c3 Wrap null values into serializable optional
Otherwise worker executor fails with NPE
2018-11-14 11:41:43 +03:00
Alexey Tsvetkov
a41c2d759a Avoid catching exceptions from workers in GradleKotlinCompilerRunner
Exceptions were catched in `KotlinCompilerRunner.runCompiler`.
When the method from superclass is not used in
`GradleKotlinCompilerRunner`, the superclass does not make much sense
anymore, so I turned it into util object.
2018-11-14 11:41:43 +03:00
Alexey Tsvetkov
37dfe2b608 Use Workers API for NMPP tasks
This change enables parallel execution of compile tasks in NMPP projects
within a subproject.

    #KT-28155 In Progress
2018-11-14 11:41:43 +03:00
Alexey Tsvetkov
ba5795519b Minor: move compile iteration result to daemon common
The class is used on both server and client, but it was defined in
server module.
Gradle plugin worked, because all classes are present in kotlin compiler
embeddable, but the code was red in IDE (which is correct because
Gradle plugin does not depend on daemon server module).
2018-11-14 11:41:43 +03:00
Alexey Tsvetkov
80597b6206 Update dokka to 0.9.17 2018-11-14 11:40:13 +03:00
Mikhail Zarechenskiy
35fb3ba096 Fix CCE when unboxed inline class receiver is passed to inline function
Initial problem is started in `capturedBoundReferenceReceiver` method
 where we assume that bound receiver is captured for usual call.

 Note that if method is inline then we don't pass actual name reference
 receiver, but pass special CAPTURED_RECEIVER_FIELD, which is then
 is used to find special instructions during inline and fold several
 instructions in `foldFieldAccessChainIfNeeded`.

 As a result, we got unboxed reference receiver for inline call, which
 caused CCE and to fix it we should box receiver one more time during
 inline

 #KT-28188 Fixed
2018-11-14 11:21:04 +03:00
Dmitry Petrov
99d8f2eb0c Support 'call' for primary value of an inline class
Getter of a primary value of an inline class belongs to the box class.
Its arguments should not be unboxed when the method is called.
However, its result might require boxing if it's an inline class value.

When we have an internal primary value, there's no getter method.
In fact, we can use box/unbox methods for inline class directly
(don't forget to box the result, it may be an inline class type value).

 #KT-26748
2018-11-14 09:57:51 +03:00
Alexey Tsvetkov
78ee48e1cd Minor: add missing import 2018-11-13 22:11:18 +03:00
Alexey Tsvetkov
22192e7008 Stop using experimental coroutines in kotlin-scripting-jvm-host tests 2018-11-13 21:54:36 +03:00
Alexey Tsvetkov
f2ae857780 Include tests from kotlin-scripting-jvm-host in compiler tests
Previously these tests were not executed during CI test run
2018-11-13 21:54:36 +03:00
Alexander Udalov
3bfe138dbe Support KClassValue in JavaActualAnnotationArgumentExtractor
#KT-22704 Fixed
2018-11-13 19:05:14 +01:00
Alexander Udalov
49d6a7a7cb Refactor and improve code obtaining actual Java annotation parameter values
Extract Java-specific code into module 'frontend.java' and use already
existing JavaAnnotationArgument facilities to determine the default
parameter value in an actual Java annotation class.

Annotation arguments are not yet supported because to create an instance
of AnnotationValue, we need a descriptor, which is not available at this
point.

 #KT-22704 In Progress
 #KT-28077 Open
2018-11-13 19:05:14 +01:00
Ricardo Meneghin Filho
c08540175b Allow expect annotations with actual typealias to Java have default arguments 2018-11-13 19:05:14 +01:00
Andrey Uskov
53414aca87 Cache module dependencies on project import
#KT-27832 Fixed
2018-11-13 20:46:42 +03:00
Nikolay Krasko
daa54978d1 Do not fail in diagnostic code 2018-11-13 19:38:03 +03:00
Nikolay Krasko
eb45848beb Update to AS 3.3 16 2018-11-13 19:38:03 +03:00
Vyacheslav Gerasimov
dee2449ee1 Build: Fix idea sources import broken during upgrade to gradle 4.10
#KT-28030 Fixed
2018-11-13 18:36:05 +03:00
Vyacheslav Gerasimov
022691384a Build: Minor refactoring intellij-sdk build.gradle.kts 2018-11-13 18:36:02 +03:00
Mikhail Zarechenskiy
45541296ad Stop building separate jar with unsigned types
Now this is not needed as unsigned types were merged into stdlib
2018-11-13 15:47:06 +03:00
Fedor Korotkov
797784ff34 [idea-gradle] improved transitive resolution
Fixed BFS. We need to either mark dependency nodes as visited after adding them to the queue or double check if a node has been already processed.
2018-11-13 14:27:30 +03:00
Mikhail Zarechenskiy
d28488eaed Remove WITH_UNSIGNED directive from tests
#KT-25226 Fixed
2018-11-13 11:48:32 +03:00
Toshiaki Kameyama
cbaa8e5be2 Remove single lambda parameter declaration: fix false positive on property with implicit type #KT-23134 2018-11-13 10:42:16 +03:00
Aleksei Semin
793cac02e8 Add inspection and quick-fix to remove empty parentheses in annotation entries 2018-11-13 10:38:08 +03:00
Toshiaki Kameyama
e903b2f92a Unused symbol: don't report for finalize() method #KT-13311 Fixed 2018-11-13 10:26:06 +03:00
Mikhail Glukhikh
503f061c8c Forbid suggesting "iterate over" on expression with Nothing type
#KT-14555 Fixed
2018-11-13 10:15:49 +03:00
Mikhail Glukhikh
1e0746ebcd Unused symbol: handle internal constructor used in Java #KT-27708 Fixed 2018-11-13 10:15:49 +03:00
Mikhail Glukhikh
da39d45cb1 Add more "non properties" for atomic classes #KT-25953 Fixed 2018-11-13 10:15:49 +03:00
Mikhail Glukhikh
92bbf885f7 "Generate member" actions: do not show any dialogs for expect class
Related to KT-27595
2018-11-13 10:15:48 +03:00
Mikhail Glukhikh
b15b993b26 Reformat: "Generate member" actions 2018-11-13 10:15:48 +03:00
Mikhail Glukhikh
cb28387da4 Fix KNPE in different "Generate members" for expect class
#KT-27595 Fixed
2018-11-13 10:15:48 +03:00
Mikhail Glukhikh
38c3f13b12 Remove unnecessary main arguments from MPP wizard builders 2018-11-13 10:15:48 +03:00
Mikhail Glukhikh
a04321478d Fix isEffectivelyActual to work with constructors correctly 2018-11-13 10:15:47 +03:00
Mikhail Glukhikh
589b377ef3 Minor: remove unused parameter in both buildNavigate to markers 2018-11-13 10:15:47 +03:00
Mikhail Glukhikh
d7d1b0420d Do not show non-actual members in actual gutter #KT-27951 Fixed 2018-11-13 10:15:47 +03:00
Nicolay Mitropolsky
4a64edd610 KotlinStringLiteralTextEscaper: provides offsets for already decoded (KT-27380) 2018-11-13 10:01:52 +03:00
Nicolay Mitropolsky
6342bc378e KotlinLanguageInjector: removing kotlin.annotation.injection.enabled key 2018-11-13 10:01:51 +03:00
Natalia Selezneva
a8b55740a1 Scratch: include all related module dependencies in ScriptModuleInfo
^KT-28094 Fixed
2018-11-13 08:47:19 +03:00
Natalia Selezneva
4661ab9961 Fix loading Kotlin Scripting options from kotlinScripting.xml
^KT-28046 Fixed
2018-11-13 08:47:19 +03:00
Natalia Selezneva
da71a35187 Update highlighting in UI thread 2018-11-13 08:47:19 +03:00
Natalia Selezneva
372daa0463 Do not attach script report if they didn't changed 2018-11-13 08:47:19 +03:00
Natalia Selezneva
ad43c2dc1c Simplify logic in ScriptDependenciesLoader 2018-11-13 08:47:18 +03:00
Natalia Selezneva
18c9d968f9 Pass ResolveResult to ScriptNotificationPanel 2018-11-13 08:47:18 +03:00
Mikhail Zarechenskiy
ed2b9172da Support unsigned integers in kotlinx-metadata-jvm
#KT-25371 Fixed
2018-11-13 01:29:39 +03:00
Andrey Uskov
dac4cb5d06 Fix source sets in all bunches except AS 33 in idea-android 2018-11-12 21:23:14 +03:00
Simon Ogorodnik
7f5f6ad76f Update QuickDoc testData due to platform changes 2018-11-12 20:56:26 +03:00
Alexander Udalov
a2612c1eae Fix generic signature for KSuspendFunction types in bytecode
#KT-27560 Fixed
2018-11-12 18:53:23 +01:00
Andrey Uskov
7b0c7ec400 Get rid of bunch 191 for build scripts (Continuation of "Replace bunch copies for some of build.gradle.kts files with a DSL") 2018-11-12 17:43:20 +03:00
Sergey Igushkin
308eafe0e1 (test data) Revert removal of coroutines opt-in from a test
This test checks the coroutines opt-in, so it should stay there.

Revert the change made in a64a76d5
2018-11-12 17:26:07 +03:00
Mikhail Zarechenskiy
79159947a5 Coerce last value of delegated expression for inline classes
Note that this commit doesn't fix case when some inline class over
 `Any` is returned from a lambda, it'll be fixed further as part of the
 #KT-27586

 #KT-27737 Fixed
2018-11-12 14:21:24 +03:00
Mikhail Zarechenskiy
a97867ccb8 Add test for obsolete issue
#KT-23531 Obsolete
2018-11-12 14:12:59 +03:00
Nikolay Krasko
9dab32f67d Re-implement getBodyBlockExpression() in stubbed elements
Avoid delegation to getBodyExpression() to monitor AST loading abuses.
2018-11-12 13:38:29 +03:00
Nikolay Krasko
2284028bbe Add bodyBlockExpression() helper function to KtDeclarationWithBody 2018-11-12 13:38:28 +03:00
Nikolay Krasko
2b8a81c5a8 Don't force getting body psi if null is predicted by stubs but allow it for resolve
We can't avoid loading AST in general, because there're no stubs for
expression bodies.
2018-11-12 13:38:27 +03:00
Nikolay Krasko
e2269e13af Move AstLoadingFilter to incompatible API and update usages 2018-11-12 13:38:26 +03:00
Nikolay Krasko
02d7e701d0 Allow getting initializer from psi during resolve as there're no stubs 2018-11-12 13:38:25 +03:00
Nikolay Krasko
d1e7229b7a Allow getting operation node in annotation qualified expressions for now 2018-11-12 13:38:24 +03:00
Nikolay Krasko
ff9477554f Do not check and load psi for modifier list with stub 2018-11-12 13:38:22 +03:00
Nikolay Krasko
04559800f1 Ignore reporting "literal prefixes and suffixes" for stubbed elements 2018-11-12 13:38:21 +03:00
Nikolay Krasko
710f3e8551 Make an excuse for contracts for loading psi for now 2018-11-12 13:38:20 +03:00
Nikolay Krasko
349f1e2e6a Update to AS 3.3 14 2018-11-12 13:38:19 +03:00
Nikolay Krasko
11bcd84f57 Disable internal mode in AS 3.3 and AS 3.4 to avoid using core class loader
Core class loader doesn't include Kotlin plugin dependencies and Kotlin
plugin becomes unusable (for example Gradle sync always fail).

https://issuetracker.google.com/issues/119250571
2018-11-12 13:38:18 +03:00
Nikolay Krasko
01bea14f09 Allow to fetch name for mock virtual machine to fix tests in 183 2018-11-12 13:38:17 +03:00
Mikhail Zarechenskiy
021732f74a [NI] Consider type non-nullable only if it has non-null supertype
Fixes #KT-12684 for NI
2018-11-12 12:42:03 +03:00
Mikhail Zarechenskiy
20ff74a726 Fix mapping for inline classes when JvmSuppressWildcards mode is using
#KT-28097 Fixed
2018-11-12 09:36:05 +03:00
Pavel V. Talanov
24f1db811a Fix running JUnit test method in abstract class
Previously led to running all methods in an inheritor class
Untested because behaviour is rare and we don't have test covering JUnit run configuration

 #KT-28080 Fixed
2018-11-09 15:51:36 +01:00
Pavel V. Talanov
aae023909d Minor: refactor KotlinJUnitRunConfigurationProducer
Clarify 'getTestMethod' and 'onFirstRun' functions
2018-11-09 15:51:35 +01:00
Pavel V. Talanov
47935c19e6 Show line markers for JUnit test methods in abstract class
#KT-27977 Fixed
2018-11-09 15:51:34 +01:00
Ilya Chernikov
9c51f521a9 Add embeddable version of the jvm scripting host
#KT-27382 fixed
2018-11-09 15:57:09 +03:00
Toshiaki Kameyama
d64ca8a8f9 Insert paird brackets: enable on before colon #KT-9840 Fixed 2018-11-09 15:15:59 +03:00
Ilya Gorbunov
5f4e8bf4fb Correct abstract mutable collections declarations in kotlin-stdlib-common
Add SinceKotlin(1.3) to the new and substantially changed common declarations

#KT-28091
2018-11-09 13:39:44 +03:00
Ilya Gorbunov
4f2ec3533a Remove inline modifier from expect functions without lambda or reified types
This gives more flexibility when providing actuals for them.
2018-11-09 13:39:07 +03:00
Mikhael Bogdanov
3e26f17e9d Update proguard config for AS 34 2018-11-09 10:30:00 +01:00
Denis Zharkov
fadd2c12c2 Update idea to 2018.2.6 RC (182.5107.16) 2018-11-09 11:59:25 +03:00
Toshiaki Kameyama
2683b25728 "Change type" quick fix: fix false negative in 'when' branch #KT-8820 Fixed 2018-11-09 11:09:02 +03:00
Dmitry Petrov
6d0a403ead KT-26765: Support 'call' for constructors with inline class parameters 2018-11-09 10:21:46 +03:00
Ilya Gorbunov
23ead5e430 Remove extensive testing of the discontinued jre7/8 artifacts 2018-11-09 04:00:26 +03:00
Ilya Gorbunov
b026b9eb22 Remove +ReleaseCoroutines explicit feature enabling
It's enabled by default in Kotlin 1.3
2018-11-09 04:00:26 +03:00
Ilya Gorbunov
a64a76d5fc Remove experimental coroutines opt-in from build scripts
It has no effect in Kotlin 1.3

Only enable coroutines if '-ReleaseCoroutines' is used
2018-11-09 04:00:26 +03:00
Ilya Gorbunov
ea0030f324 Actualize Deprecated annotation and DeprecationLevel enum docs
...to clear some confusion from KT-25643.
Describe level property usage scenario in detail.
2018-11-08 19:39:41 +03:00
Roman Artemev
8f2117685f [JS BE] Support contracts in JS Fix KT-27946 2018-11-08 17:35:06 +03:00
Roman Artemev
b010d9eef8 Add Contract tests for JS 2018-11-08 17:35:06 +03:00
Mikhail Glukhikh
caad0d5a74 ExposedVisibilityChecker refactoring: make trace BindingTrace 2018-11-08 17:16:06 +03:00
Mikhail Glukhikh
d464b441c8 ExposedVisibilityChecker refactoring: extract 'reportExposure' 2018-11-08 17:16:06 +03:00
Mikhail Glukhikh
b3857e85e0 Report exposed type for properties in class primary constructor
Before this commit, we compared property visibility with constructor
visibility only, which is incorrect. Now we compare property visibility
also with class visibility

#KT-19613 Fixed
2018-11-08 17:16:06 +03:00
Mikhael Bogdanov
f160eabaf6 Switch snapshot to exact IDEA 183 dependency 2018-11-08 13:47:17 +01:00
Mikhael Bogdanov
e8db36e2f1 Update dependencies for AS34 2018-11-08 13:47:16 +01:00
Simon Ogorodnik
cf9b2e6377 Fix potential CCE in LightCodeInsight tests in non-JVM 2018-11-08 15:31:30 +03:00
Simon Ogorodnik
f40cc2eb3f Fix CCE in JSBasicCompletionTest 2018-11-08 15:31:29 +03:00
Denis Zharkov
d74c12323f Fix ambiguity when KtUltraLightClass contains overrides
#KT-27987 Fixed
2018-11-08 15:25:41 +03:00
Denis Zharkov
234776820b Use KotlinLightReferenceListBuilder for type parameters bounds
It doesn't run resolve() on freshly added reference, thus the latter is
not failing in recursive case like T : Enum<T>
2018-11-08 15:25:41 +03:00
Denis Zharkov
a4cc67d0a0 Refine isInlineOnly check in KtUltraLightClass 2018-11-08 15:25:41 +03:00
Denis Zharkov
34f9a1e70e Do not build no-arg constructor overload for inner KtUltraLightClass 2018-11-08 15:25:41 +03:00
Denis Zharkov
8999a21764 Refine visibility computation for lateinit's field in KtUltraLightClass 2018-11-08 15:25:41 +03:00
Denis Zharkov
99afc40d93 Use ModuleDescriptor::stableName for mangling in KtUltraLightClass 2018-11-08 15:25:41 +03:00
Denis Zharkov
6fc8c98aea Avoid calling PsiType::resolve while adding supertype references
Otherwise, e.g. in case of inner classes it may lead to
StackOverflowError:
- Someone tries to resolve supertypes
- We're starting building extends/implements lists
- Then calling resolve on the type references leads that some logic
in Java resolution again is trying to resolve supertype of the same
class (only in case of inner ones)

Probably, it could be fixed on the side of Java resolve
but at the same time it's clear that calling `resolve` while building
extends list it's really somewhat not very cool

The exception is following:
	at org.jetbrains.kotlin.asJava.classes.KtLightClassForSourceDeclaration$_extendsList$2.invoke(KtLightClassForSourceDeclaration.kt:77)
	at org.jetbrains.kotlin.asJava.classes.KtLightClassForSourceDeclaration$_extendsList$2.invoke(KtLightClassForSourceDeclaration.kt:73)
	at kotlin.SafePublicationLazyImpl.getValue(LazyJVM.kt:107)
	at org.jetbrains.kotlin.asJava.classes.KtLightClassForSourceDeclaration.get_extendsList(KtLightClassForSourceDeclaration.kt)
	at org.jetbrains.kotlin.asJava.classes.KtLightClassForSourceDeclaration.getExtendsList(KtLightClassForSourceDeclaration.kt:320)
	at com.intellij.psi.impl.PsiClassImplUtil.getExtendsListTypes(PsiClassImplUtil.java:1017)
	at com.intellij.psi.impl.light.AbstractLightClass.getExtendsListTypes(AbstractLightClass.java:137)
	at com.intellij.psi.impl.ScopedClassHierarchy.getSuperTypes(ScopedClassHierarchy.java:95)
	at com.intellij.psi.impl.ScopedClassHierarchy.visitType(ScopedClassHierarchy.java:80)
	at com.intellij.psi.impl.ScopedClassHierarchy.getSuperClassSubstitutor(ScopedClassHierarchy.java:115)
	at com.intellij.psi.impl.JavaClassSupersImpl.getSuperSubstitutorWithCaching(JavaClassSupersImpl.java:111)
	at com.intellij.psi.impl.JavaClassSupersImpl.getSuperClassSubstitutor(JavaClassSupersImpl.java:71)
	at com.intellij.psi.util.TypeConversionUtil.getMaybeSuperClassSubstitutor(TypeConversionUtil.java:1089)
	at com.intellij.psi.util.TypeConversionUtil.getClassSubstitutor(TypeConversionUtil.java:1055)
	at com.intellij.psi.impl.compiled.ClsJavaCodeReferenceElementImpl.advancedResolveImpl(ClsJavaCodeReferenceElementImpl.java:143)
	at com.intellij.psi.impl.compiled.ClsJavaCodeReferenceElementImpl.access$000(ClsJavaCodeReferenceElementImpl.java:43)
	at com.intellij.psi.impl.compiled.ClsJavaCodeReferenceElementImpl$Resolver.resolve(ClsJavaCodeReferenceElementImpl.java:121)
	at com.intellij.psi.impl.compiled.ClsJavaCodeReferenceElementImpl$Resolver.resolve(ClsJavaCodeReferenceElementImpl.java:115)
	at com.intellij.psi.impl.source.resolve.ResolveCache.lambda$resolveWithCaching$1(ResolveCache.java:203)
	at com.intellij.openapi.util.RecursionManager$2.doPreventingRecursion(RecursionManager.java:99)
	at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:202)
	at com.intellij.psi.impl.compiled.ClsJavaCodeReferenceElementImpl.multiResolve(ClsJavaCodeReferenceElementImpl.java:223)
	at com.intellij.psi.impl.compiled.ClsJavaCodeReferenceElementImpl.advancedResolve(ClsJavaCodeReferenceElementImpl.java:213)
	at com.intellij.psi.impl.source.PsiClassReferenceType.resolveGenerics(PsiClassReferenceType.java:191)
	at com.intellij.psi.impl.source.PsiClassReferenceType.resolve(PsiClassReferenceType.java:138)
	at org.jetbrains.kotlin.asJava.classes.LightReferenceListBuilder.addReference(LightReferenceListBuilder.java:53)
	at org.jetbrains.kotlin.asJava.classes.KtUltraLightClass.createExtendsList(ultraLightPsi.kt:91)
	at org.jetbrains.kotlin.asJava.classes.KtLightClassForSourceDeclaration$_extendsList$2.invoke(KtLightClassForSourceDeclaration.kt:77)
	at org.jetbrains.kotlin.asJava.classes.KtLightClassForSourceDeclaration$_extendsList$2.invoke(KtLightClassForSourceDeclaration.kt:73)
	at kotlin.SafePublicationLazyImpl.getValue(LazyJVM.kt:107)
	at org.jetbrains.kotlin.asJava.classes.KtLightClassForSourceDeclaration.get_extendsList(KtLightClassForSourceDeclaration.kt)
	at org.jetbrains.kotlin.asJava.classes.KtLightClassForSourceDeclaration.getExtendsList(KtLightClassForSourceDeclaration.kt:320)
	at com.intellij.psi.impl.PsiClassImplUtil.getExtendsListTypes(PsiClassImplUtil.java:1017)
	at com.intellij.psi.impl.light.AbstractLightClass.getExtendsListTypes(AbstractLightClass.java:137)
	a
2018-11-08 15:25:41 +03:00
Denis Zharkov
34e8ce6a48 Fix data race in LightReferenceListBuilder
Effectively this is a cherry-pick of
7503200869
2018-11-08 15:25:41 +03:00
Denis Zharkov
94d9fd8b72 Add our own version of LightReferenceListBuilder
There are some issues with one from the platform that may be backported
at some moment, but now it's faster to have our own implementation
2018-11-08 15:25:41 +03:00
Denis Zharkov
875e9d2a36 Fix KtUltraLightMethod::getParameterList
There's already a correct override in KtLightMethodImpl
Otherwise the tests is failing because clsDelegate.parameterList
has a wrong parent
2018-11-08 15:25:41 +03:00
Denis Zharkov
3814c7687b Add JavaAgainstKotlinSourceCheckerWithUltraLightTestGenerated 2018-11-08 15:25:41 +03:00
Denis Zharkov
5f45ab1e2b Support forcing usage of ultra-light classes in tests 2018-11-08 15:25:41 +03:00
Denis Zharkov
03e937ddfa Minor. Reformat KtLightClassForSourceDeclaration.kt 2018-11-08 15:25:41 +03:00
Svyatoslav Kuzmich
0bf3199c19 Support nullable inline classes 2018-11-08 15:00:33 +03:00
Svyatoslav Kuzmich
5ea7673950 [JS IR BE] Mute inline class tests 2018-11-08 15:00:32 +03:00
Svyatoslav Kuzmich
43b4b6eaae Add more specific fail messages in inline class box tests 2018-11-08 15:00:31 +03:00
Svyatoslav Kuzmich
370b04df35 [JS IR BE] Inline classes lowering 2018-11-08 15:00:30 +03:00
Svyatoslav Kuzmich
4866c2b36a [IR] Move irCall from JS backend to common utils 2018-11-08 15:00:09 +03:00
Svyatoslav Kuzmich
81d61aefff [IR] Specify IrType in irTemporary 2018-11-08 15:00:09 +03:00
Svyatoslav Kuzmich
dd20775662 [IR] Move IrFunction.isStatic from JS to Common 2018-11-08 15:00:08 +03:00
Svyatoslav Kuzmich
4f6a18e29a [IR] Update parents when transforming declaration containers 2018-11-08 15:00:08 +03:00
Svyatoslav Kuzmich
38b31e8f7d [JS IR BE] Fix reusing expression instances 2018-11-08 15:00:08 +03:00
Svyatoslav Kuzmich
47b0f94903 [JS IR BE] Fix funny safe call 2018-11-08 15:00:08 +03:00
Svyatoslav Kuzmich
27ff4da94d [JS IR BE] Bugfix: set overriden symbols for generated bridges 2018-11-08 15:00:08 +03:00
Pavel V. Talanov
54dc1a779e Fix test: experimental API usage error reporting in js module
Make module a js module so that test passes
2018-11-08 11:22:46 +01:00
Toshiaki Kameyama
6971ca44e7 Generate equals and hashCode: enable for data classes #KT-17502 Fixed 2018-11-08 12:51:29 +03:00
Dmitry Petrov
b5664755c8 Minor: remove IGNORE_BACKEND for passing JS_IR tests 2018-11-08 12:29:15 +03:00
Dmitry Petrov
8262d4a4b9 psi2ir: Don't generate constructor bodies for 'external' classes
#KT-27934
2018-11-08 12:29:15 +03:00
Dmitry Petrov
51002ee620 psi2ir: Handle missing "then" branches as empty blocks
#KT-27933
2018-11-08 12:29:15 +03:00
Dmitry Petrov
bd1491ac8a psi2ir: Merge constant entries in string template expressions
This is required to handle UCNs properly, see KT-28006.

 #KT-28006
2018-11-08 12:29:15 +03:00
technoir
6bb5e028a5 Multiple templates with concatenation generator should add spaces after commas (KT-27954) 2018-11-08 11:21:11 +03:00
Ilya Matveev
798b4a8164 Update Kotlin/Native: 1.0.2 2018-11-08 11:06:49 +03:00
Mikhail Glukhikh
772ae60512 Extract inspection names from GradleInspectionTest into testData 2018-11-08 11:04:04 +03:00
Mikhail Glukhikh
52815f5eb5 Extract test files from GradleInspectionTest into testData 2018-11-08 11:04:04 +03:00
Denis Zharkov
eae7e43583 Avoid redundant String allocations in JvmDescriptorTypeWriter
In most cases, jvmCurrentTypeArrayLevel == 0 and we can just use `type`
The change was initially suggested by @gorrus
2018-11-08 10:44:13 +03:00
Toshiaki Kameyama
4ae837e669 Redundant lambda arrow: fix false positive in 'when/if' without block #KT-28047 Fixed 2018-11-08 10:40:02 +03:00
Toshiaki Kameyama
0bfcfb5716 ProtectedInFinalInspection: don't report for finalize() method #KT-13311 Fixed 2018-11-08 10:37:36 +03:00
Toshiaki Kameyama
b935f52a63 ProtectedInFinalInspection: reformat 2018-11-08 10:37:36 +03:00
Toshiaki Kameyama
9c18e24de5 Change to function invocation fix: use parentheses in string template
#KT-5071 Fixed
2018-11-08 10:33:50 +03:00
Timo Obereder
3c75d46328 Correctly handle end-of-line comment in "Add braces to if"
#KT-27408 Fixed
2018-11-08 10:33:15 +03:00
Alexander Udalov
61d3b6ee1f Restore heuristic to compute inner class names in ClassifierResolutionContext
This commit restores the heuristic removed in 9df02b2366, but only
enables it in case the class wasn't found with the name mapped initially
according to the InnerClasses attribute values. This helps to support
class files which do not have the InnerClasses attribute for all nested
referenced classes, such as those generated by Groovy.

Note that in theory it's still possible for this code to behave
incorrectly, for example a reference to a class `C` nested in a
_top-level_ class named `A$B` will not be loaded by this code correctly.
This is a lower-priority issue and it will need to be fixed later.

 #KT-27874 Fixed
2018-11-07 18:12:58 +01:00
Alexander Udalov
a3231e561c Remove unneeded name-handling code in ClassifierResolutionContext
The only place where a name with dots was passed to
ClassifierResolutionContext.mapInternalNameToClassId was in
BinaryClassSignatureParser.parseParameterizedClassRefSignature, where
for some reason names can be both of internal (`a/b$c`) and canonical
(`a/b.c`) form. Supporting both names in mapInternalNameToClassId was
confusing because JVM internal names cannot contain dots. Replace dots
with dollars in parseParameterizedClassRefSignature to get rid of the
dot-name handling in mapInternalNameToClassId and rely on the correct
(simplified) InnerClasses-based name resolution later instead.

Also inline mapDescToClassId to its only usage.
2018-11-07 18:12:58 +01:00
Georgy Bronnikov
c20f93ddbf Mute failing test 2018-11-07 19:09:15 +03:00
Georgy Bronnikov
dbfbfa65a6 Remove IrClass.isFileClass as unneeded 2018-11-07 19:09:15 +03:00
Georgy Bronnikov
a814e4a314 IR. Remove ClassLowerWithContext
The code is never used and shows some signs of bit rot.
2018-11-07 19:09:15 +03:00
Georgy Bronnikov
1aec16ca29 JVM_IR. Remove FileClassDescriptor, no longer used 2018-11-07 19:09:15 +03:00
Georgy Bronnikov
0a43054a92 JVM_IR. Remove descriptors from FileClassLowering 2018-11-07 19:09:15 +03:00
Georgy Bronnikov
95fbe29350 JVM_IR: remove descriptors from JvmCoercionToUnitPatcher 2018-11-07 19:09:15 +03:00
Toshiaki Kameyama
c9477d94ad Replace if with when: fix behavior on 'else if' #KT-4645 Fixed 2018-11-07 19:02:11 +03:00
Dmitry Petrov
1523185734 KT-27948: Use proper KotlinType when comparing with literal 0
#KT-27948
2018-11-07 18:17:29 +03:00
Dmitry Petrov
e14f74bc18 KT-27948: Properly coerce values when generating areEqual call
#KT-27948
2018-11-07 18:17:29 +03:00
Dmitry Petrov
ac7cc0c08e KT-27706: Dispatch receiver type for constructor accessor is Object 2018-11-07 18:17:29 +03:00
Dmitry Petrov
ea4afdaebe KT-27705: Use proper types for captured outer class instance
Call typeMapper only if we have an inline class.
2018-11-07 18:17:29 +03:00
Mikhael Bogdanov
60986293bf Minor. Use until in for iterator 2018-11-07 15:42:58 +01:00
Mikhael Bogdanov
d2a205c72d Update synthetic parameter processing logic according to ASM 7 changes
#KT-27774 Fixed
2018-11-07 15:42:57 +01:00
Toshiaki Kameyama
23b9889ebb Redundant companion reference: Fix false negative in enum entry #KT-27861 Fixed 2018-11-07 17:21:41 +03:00
Monchi
07ca958ff0 Add the quickfix to add property to supertype #KT-17004 Fixed 2018-11-07 17:00:26 +03:00
Simon Ogorodnik
aa8031691e Fix picocontainer version 2018-11-07 15:16:39 +03:00
Toshiaki Kameyama
0fcd1a2072 Introduce "Delegate to 'var' property" inspection #KT-26724 Fixed 2018-11-07 13:59:00 +03:00
Alexander Udalov
17d740a373 Do not try computing return type in OverloadChecker
Return type is not needed for checking overloads, but querying it may
involve resolving function bodies, which usually happens after overload
checking (see LazyTopDownAnalyzer.analyzeDeclarations) and at this point
can lead to incorrect BACKING_FIELD_REQUIRED value being computed for
some properties (see KT-27895)

 #KT-27895 Fixed
2018-11-07 11:00:15 +01:00
Anton Bannykh
829bdf6061 JS: fix noInline version of inline suspend fun (KT-27611 fixed) 2018-11-07 12:34:00 +03:00
Toshiaki Kameyama
455db32199 "Remove parameter" quick fix: remove also type constraint
#KT-26673 Fixed
2018-11-07 12:20:35 +03:00
Anton Bannykh
59009430e5 JS: report inline suspend functions to IC
* Also inline suspend lambda'a
* Also use correct JsName's in exported suspend inline fun's
* Also use less unused imports
2018-11-07 12:11:01 +03:00
Anton Bannykh
82268cd95d JS: fix concurrent access to NameSuggestion.cache 2018-11-07 12:07:58 +03:00
Anton Bannykh
5dae00182d JS: fix suspend lambda inlining
* Also avoid casts when setting inline metadata
2018-11-07 12:07:02 +03:00
Anton Bannykh
4c5201d30e JS: fix module parameter linking 2018-11-07 12:06:09 +03:00
Mikhail Glukhikh
da02acd6e9 Fix flaky "plugin & stdlib versions different" #KT-23744 Fixed
Before this commit, kotlin-stdlib-common or -jdk8 can be accidentally
detected as kotlin-stdlib with the following strange version resolve.
Now we check for dash after name, so it's not possible.
2018-11-07 11:56:55 +03:00
Mikhail Glukhikh
fcfeb33501 Don't suggest "Implement as constructor parameters" in actual class
This applies if expect class has primary constructor declared
#KT-27791 Fixed
2018-11-07 11:56:55 +03:00
Mikhail Glukhikh
63856cff1b Fix failing GradleImportingTestCase-based tests in 183 #KT-28026 Fixed
To fix this, we say explicitly not to use qualified module names option
during Gradle import

Related to IDEA-201249
2018-11-07 11:56:55 +03:00
Mikhail Glukhikh
e597dda526 AndroidViewConstructorFix: do not reformat while creating constructor
Before this commit, it was done by createDeclarationByPattern,
preventing later reformatting in addAnnotation

Related to KT-27945
2018-11-07 11:56:54 +03:00
Toshiaki Kameyama
d0d98dc283 Redundant companion reference: fix false positive for class with name Companion #KT-27861 Fixed 2018-11-07 11:53:22 +03:00
Bradley Smith
4b8f8604f2 Change kotlinSourceSets -> allKotlinSourceSets
This ensures that transitive SourceSets are also merged and included in
the model.
2018-11-06 20:19:02 +03:00
Bradley Smith
f426fda18b Remove unused inport 2018-11-06 20:19:02 +03:00
Bradley Smith
1e37785de1 Populate the SourceSets with more relevant information. 2018-11-06 20:19:02 +03:00
Bradley Smith
f3482d1251 Register KotlinModelBuilder for kotlin-android plugin 2018-11-06 20:19:02 +03:00
Dmitry Savvinov
939b58f8f4 Fix testdata to incorrect to keep local testruns green
This test was originally written with fix for KT-22379

Lately, fix was proven to be wrong and reverted (KT-27084), which made
this test fail.

Correct solution here would be to mute test with link to YT issue, but
unfortunately we don't have infrastructure to mute tests locally (yet),
which is a major issue because this tests is a part of very popular for
local smoke-testing test suite (DiagnosticTestsGenerated).
2018-11-06 19:29:28 +03:00
Leonid Startsev
facd2d7aec Call Gradle import handlers when importing Gradle modules from new mpp plugin
This enables serialization and other plugins in IDE with new mpp
2018-11-06 16:21:32 +03:00
Simon Ogorodnik
3590d534e5 KT-24788: Fix exceptions in offline inspections
When there is severe memory load SLRUCache inside getResolutionFacade
may cause double computation of ResolutionFacade, thus will cause
moduleDescriptor to be recreated, and it will be different from one
that is stored in declarationDescriptor
Newer resolutionFacade will actually not built for old moduleDescriptor
and will cause exception

 #KT-24788 fixed
2018-11-06 15:49:01 +03:00
Nikolay Krasko
6c67cb3d7f Prioritize failure in expect file over stub validation problem in tests 2018-11-06 13:43:24 +03:00
Nikolay Krasko
6dcc3374fe Get string entries from stubs (KT-23738) 2018-11-06 13:43:23 +03:00
Nikolay Krasko
359e16eb82 Get argument name from stubs if possible (KT-23738) 2018-11-06 13:43:22 +03:00
Nikolay Krasko
3f53f9d9fb Allow storing dot qualified expression in annotations arguments (KT-23738) 2018-11-06 13:43:21 +03:00
Nikolay Krasko
a794d26493 Get stubbed expressions in value arguments (KT-23738) 2018-11-06 13:43:20 +03:00
Nikolay Krasko
a9c3b27d3e Don't generate stub for value arguments list when no arguments present (KT-23738)
Need this to conform stubs list obtained by decompiler.
Also ignore green stub, because is might not contain actual psi node.
2018-11-06 13:43:19 +03:00
Nikolay Krasko
efa59bfc7e Make stubs for string entries (KT-23738) 2018-11-06 13:43:17 +03:00
Nikolay Krasko
37d7e618da Stub element for KtStringTemplateExpression (KT-23738) 2018-11-06 13:43:16 +03:00
Nikolay Krasko
11543ba897 Make possible store constant values in stubs (KT-23738) 2018-11-06 13:43:15 +03:00
Nikolay Krasko
d9bc512556 Put arguments name to stubs in annotations (KT-23738) 2018-11-06 13:43:14 +03:00
Nikolay Krasko
12f127d631 Add stub for annotations value arguments (KT-23738) 2018-11-06 13:43:13 +03:00
Nikolay Krasko
fbb0e7d927 Stubbed VALUE_ARGUMENT_LIST and store it for annotations (KT-23738) 2018-11-06 13:43:12 +03:00
Nikolay Krasko
0f0dfe725e Refactoring: move KtExpression.unpackFunctionLiteral to utils file 2018-11-06 13:43:10 +03:00
Nikolay Krasko
7c49eeded7 Make KtProperty.getInitializer() use stub check 2018-11-06 13:43:09 +03:00
Nikolay Krasko
4f52f62b44 Use stubs in KtProperty for getDelegate() and getDelegateExpression() 2018-11-06 13:43:08 +03:00
Nikolay Krasko
f892714bea Test for stubs in annotations (KT-23738) 2018-11-06 13:43:07 +03:00
victor.petukhov
9a61998fca Add lexer test runner and whitespace characters tests
Whitespace characters for the tests are U+000B, U+000C, U+000D, U+0085, U+2028, U+2029
2018-11-06 11:19:15 +03:00
victor.petukhov
fe072e3366 Fix the lack of the handling of whitespace characters in the KDoc lexer
Affected characters are U+000B, U+000C, U+000D, U+0085, U+2028, U+2029
This problem reproduces with JFlex since 1.5.0: http://jflex.de/changelog.html#jflex-1.5.0-jan-21-2014
2018-11-06 11:18:58 +03:00
victor.petukhov
9e6ac6cb2a Fix the lack of the handling of whitespace characters in the Kotlin lexer
Affected characters are U+000B, U+000C, U+000D, U+0085, U+2028, U+2029
This problem reproduces with JFlex since 1.5.0: http://jflex.de/changelog.html#jflex-1.5.0-jan-21-2014
2018-11-06 11:18:38 +03:00
Toshiaki Kameyama
4a82f50e79 Convert concatenation to template: omit braces when converting 'this' #KT-7555 Fixed 2018-11-06 11:03:08 +03:00
Toshiaki Kameyama
7a9effe30d Redundant companion reference: Fix false positive in enum entry #KT-27861 Fixed 2018-11-06 11:02:35 +03:00
Karen Schwane
d88fd8aa6f KT-20357 Add samples for maxBy and minBy 2018-11-04 22:34:16 +03:00
Alexey Tsvetkov
aae24c993d Revert usage of lazy task API
We want to be compatible with Gradle 4.0+
where the API is not available.
Use eager task creation API for now.
Lazy API support should be added later with
proper Gradle versions checks.
2018-11-03 00:59:27 +03:00
Ivan Gavrilovic
c42b3b8ff8 Do not resolve configuration for scripting Gradle plugin
Avoid resolving kotlinScriptDef configurations during
configuration phase. Also, make task creation lazy.

   #KT-27160 fixed
2018-11-03 00:59:27 +03:00
Mikhail Glukhikh
22fa9b6b92 AndroidViewConstructorFix: add white space after annotation explicitly
This fixes Android formatter-related issue
#KT-27945 Fixed
2018-11-02 19:51:44 +03:00
Mikhail Glukhikh
279203e2e1 FIR visitor generator: fix copyright generator to pass conformance test 2018-11-02 19:44:56 +03:00
Mikhail Glukhikh
631adde3f5 Regenerate FIR resolve tests 2018-11-02 19:44:56 +03:00
Mikhail Glukhikh
2bc063b230 FIR: implement default star importing scope 2018-11-02 19:44:56 +03:00
Mikhail Glukhikh
284b21b2a6 Get rid of descriptors, resolved classifiers, + some cleanup 2018-11-02 19:44:55 +03:00
Mikhail Glukhikh
8035be07e2 FIR: built-in resolve, preliminary version #KT-24091 Fixed 2018-11-02 19:44:55 +03:00
Mikhail Glukhikh
ce113fbe2e FIR: introduce class & type alias symbols 2018-11-02 19:44:55 +03:00
Mikhail Glukhikh
093a236e34 FIR resolve: support star imports, enum entries 2018-11-02 19:44:55 +03:00
Mikhail Glukhikh
929573e0d5 FIR type transformer: minor optimization: do not create empty scopes 2018-11-02 19:44:54 +03:00
Mikhail Glukhikh
dfa8c32c5d FIR: minor cone types refactoring 2018-11-02 19:44:54 +03:00
Mikhail Glukhikh
4d48c40832 FIR tree & builder: support expect / actual 2018-11-02 19:44:54 +03:00
Mikhail Glukhikh
d16303342e FIR: do not allow to resolve to type parameters in supertype position 2018-11-02 19:44:54 +03:00
Mikhail Glukhikh
e46074dee6 FIR: simplify type parameter scopes 2018-11-02 19:44:54 +03:00
Mikhail Glukhikh
9aaec1efda FIR: resolve function type parameters 2018-11-02 19:44:54 +03:00
Simon Ogorodnik
25ae12fe07 FIR: implement early type alias expansion 2018-11-02 19:44:54 +03:00
Mikhail Glukhikh
d15fb1963b FIR: introduce symbols + type parameter resolve #KT-24064 Fixed 2018-11-02 19:44:53 +03:00
Mikhail Glukhikh
3495f09ac4 Fix visiting of resolved FIR nodes 2018-11-02 19:44:53 +03:00
Mikhail Glukhikh
a99578c354 FIR: handle unresolved modality as questionable 2018-11-02 19:44:53 +03:00
Mikhail Glukhikh
737ec37486 FIR visibility rendering: unknown -> public with question 2018-11-02 19:44:53 +03:00
Mikhail Glukhikh
b83d921445 FIR: add type alias descriptors 2018-11-02 19:44:53 +03:00
Simon Ogorodnik
bc9175c4e8 FIR: Refactor nested scope, fix super-type resolving jump context
#KT-24017 Fixed
2018-11-02 19:44:52 +03:00
Mikhail Glukhikh
f82ad6ac20 FIR: support type alias resolve 2018-11-02 19:44:52 +03:00
Mikhail Glukhikh
d5463193fd FIR: introduce classifier scopes #KT-24022 Fixed 2018-11-02 19:44:52 +03:00
Mikhail Glukhikh
1ba498b021 FIR: transform types inside functions & properties 2018-11-02 19:44:52 +03:00
Mikhail Glukhikh
be35b904f2 FIR: replace UnambiguousFqName with ClassId 2018-11-02 19:44:52 +03:00
Mikhail Glukhikh
6c8a326e15 FIR: split transformer into three (imports / types / descriptors) 2018-11-02 19:44:52 +03:00
Simon Ogorodnik
8933c9035b FIR: introduce FIR importing scopes #KT-24096 Fixed 2018-11-02 19:44:51 +03:00
Mikhail Glukhikh
e6cd07b46e FIR: support tailrec & external modifiers 2018-11-02 19:44:51 +03:00
Mikhail Glukhikh
fa80f40e74 FIR: no nullability in error type 2018-11-02 19:44:51 +03:00
Simon Ogorodnik
3e7b9c4e27 FIR: introduce type resolvers #KT-24019 Fixed 2018-11-02 19:44:51 +03:00
Simon Ogorodnik
aa20d88dff FIR: Create ad-hoc fir by name provider 2018-11-02 19:44:51 +03:00
Simon Ogorodnik
9976eff03a FIR: Add components storage to FirSession 2018-11-02 19:44:50 +03:00
Simon Ogorodnik
7e95eee9f1 FIR: Introduce new classifier descriptors aka 'cones' 2018-11-02 19:44:50 +03:00
Simon Ogorodnik
ce7456c93d FIR: Introduce new kotlin types aka 'cones' #KT-24063 Fixed 2018-11-02 19:44:50 +03:00
Simon Ogorodnik
12acbaaa21 FIR: Add module for new types aka 'cones' (of fir tree)
Start of KT-24063
2018-11-02 19:44:50 +03:00
Mikhail Glukhikh
9daa84c5a9 FIR: add resolve module 2018-11-02 19:44:50 +03:00
Simon Ogorodnik
3e06f426d0 Raw FIR: support a bunch of new elements + some fixes
Support: calls, constructor calls, annotation calls, arguments
Support: enums, primary constructors, const modifier
Support: inner modifier, qualified types
Add: some base transformed types
Fix: acceptChildren etc.
Progress: #KT-24013
2018-11-02 19:44:49 +03:00
Simon Ogorodnik
2ddf52123a Create FIR transformer generator #KT-24062 Fixed 2018-11-02 19:44:49 +03:00
Simon Ogorodnik
fda49736ee Regenerate visitors 2018-11-02 19:44:49 +03:00
Simon Ogorodnik
f33c16a7db Fix various inconsistencies in visitor generator output 2018-11-02 19:44:49 +03:00
Mikhail Glukhikh
2c626d6c5d Implement raw FIR builder (initial version)
All necessary FIR tree implementations were created
FIR renderer & three first builder tests were added
#KT-24013 Fixed
2018-11-02 19:44:49 +03:00
Simon Ogorodnik
1a80477c1c Create visitor generator for FIR (KT-24062 in progress) 2018-11-02 19:44:47 +03:00
Mikhail Glukhikh
4755a494f1 Create basic version of FIR interfaces (mostly declarations)
#KT-24014 Fixed
2018-11-02 19:44:47 +03:00
Simon Ogorodnik
0f02622e32 Create modules for Frontend IR & its builder from PSI 2018-11-02 19:44:46 +03:00
Ilya Gorbunov
332b843301 kotlin-bom: Add distributionManagement and signing profile
Since kotlin-bom intentionally has no parent these settings have to be duplicated
same as in the root kotlin-project pom.

#KT-18398
2018-11-02 19:04:10 +03:00
Ilya Gorbunov
11519e40cc Add scripting dependencies to kotlin-bom
#KT-18398
2018-11-02 18:52:40 +03:00
Ilya Gorbunov
119385839a Provide bom (bill-of-materials) pom for kotlin libraries
#KT-18398 Fixed
2018-11-02 18:52:40 +03:00
Mikhail Glukhikh
329e4f6000 New MPP highlighting test: add test without errors (KT-27494) 2018-11-02 15:42:39 +03:00
Mikhail Glukhikh
62e9eae48d New MPP highlighting test: check also line markers (KT-27494)
We have to do complex operations with tags, because otherwise
tags in different files prevent correct analysis of the current one
2018-11-02 15:42:06 +03:00
Mikhail Glukhikh
9be23bb21c Add first test for new multiplatform highlighting #KT-27494 Fixed 2018-11-02 15:41:45 +03:00
Mikhail Glukhikh
948e4a48af Delete deprecated old MPP wizard 2018-11-02 15:41:29 +03:00
Andrey Uskov
b9753164c9 Fix dependency resolution on model post-processing
#KT-27265 Fixed
2018-11-02 13:12:37 +03:00
Andrey Uskov
080681ea2f Fix NPE in KotlinJavaMPPSourceSetDataService.postProcess 2018-11-02 13:09:48 +03:00
Vyacheslav Gerasimov
e9c0dea70e Register stream-debugger for AS 3.2, 3.3, 3.4 2018-11-01 20:07:11 +03:00
Alexey Tsvetkov
d68cac314a Do not fail builds during lint checks in Gradle tests
Tests fail with unrelevant checks like recommended
target SDK for play store
2018-11-01 19:35:20 +03:00
Ilya Gorbunov
cad8b81dcb Update selenium version to 2.53.1
This change is required to fix failing tests of browser-example and browser-example-with-library.
Tests began to fail recently because `htmlunit-driver` had a dependency on `selenium-support`
constrained to [2.53.0,4.0.0) range. Apparently the recently released 3.141.0 version of that artifact
became incompatible with the rest of selenium 2.52.

This fix advances the version of selenium to 2.53.1. This version has a dependency on
`selenium-support:2.53.1`. Since it goes earlier in dependency tree and satisfies the range constraint,
it is used for `htmlunit-driver` too.
2018-11-01 17:52:48 +03:00
Ilya Gorbunov
2b699f8f07 Add a test for CharSequence/String.regionMatches 2018-11-01 17:51:24 +03:00
Pavel V. Talanov
02f5891ee0 multiplatformUtil: Do not fail on non-physical classes from java
#KT-27907 Fixed
2018-11-01 15:48:43 +01:00
Nikolay Krasko
5b6437876f Refactoring: use isNamed utility function for value arguments 2018-11-01 17:12:46 +03:00
Nikolay Krasko
6fcb1716eb Do additional resolve for inline properties for backend (KT-27460)
There's an additional resolve for inline declarations to make backend
happy with the passed binding context object. Unlike functions,
properties were not processed.

 #KT-27460 Fixed
2018-11-01 17:12:45 +03:00
Nikolay Krasko
9978ba4aaa Validate new file or class name for empty parts (KT-27903)
#KT-27903 Fixed
2018-11-01 17:12:44 +03:00
Roman Artemev
0e7520fde3 [JS IR BE] Fix GetClass on primitive type 2018-11-01 16:51:44 +03:00
Roman Artemev
2d03f87ea5 [IR BE] Support lateinit locals and isInitialized property
* update tests
2018-11-01 16:51:43 +03:00
Roman Artemev
535eea7f48 [JS IR BE] fix enum initialization 2018-11-01 16:51:42 +03:00
Roman Artemev
b86e2e6dc0 [JS IR BE] Fix EnumClassLowering
* make it incremental
 * fix access to enum entry from different module
 * drop ExternalEnumLowering
2018-11-01 16:51:42 +03:00
Roman Artemev
7f215d3f52 Update tests 2018-11-01 16:51:38 +03:00
Roman Artemev
12848d4eff [JS IR BE] Support in callable references
* default params
 * vararg
Minor refactoring
2018-11-01 16:18:44 +03:00
Roman Artemev
fb709cae92 [JS IR BE] Fix private field names 2018-11-01 16:18:44 +03:00
Nicolay Mitropolsky
bf42bd1226 Uast: fixes and tests for descriptors leak (KT-27663) 2018-11-01 15:23:54 +03:00
Natalia Selezneva
e48fbe4aa3 Do not insert additional new lines in REPL 2018-11-01 15:00:41 +03:00
Natalia Selezneva
468404c6c3 Repl: refactoring, move common parts to utils 2018-11-01 15:00:41 +03:00
Natalia Selezneva
ce424d27e8 Scratch tests: compile java files to temp directory 2018-11-01 15:00:40 +03:00
Natalia Selezneva
2e3c645bf6 183: Implement new API from git plugin.
That allows hide checkbox for additional java to kotlin renames if there isn't any converted files

#KT-26073 Fixed
2018-11-01 15:00:39 +03:00
Natalia Selezneva
ccf49f9d1c Update notifications in script file when script reports are attached (KT-24705)
^KT-24705 Fixed
2018-11-01 15:00:02 +03:00
Natalia Selezneva
ec14fdd94f Do not attach script reports if 'reload dependencies' isn't pressed (KT-24706)
^KT-24706 Fixed
2018-11-01 14:58:52 +03:00
Nikolay Krasko
6198641cb7 Fix test after adding line with force ranking directive 2018-11-01 12:24:03 +03:00
Nikolay Krasko
6f719a9460 Use binary expression as parent for better spacing (KT-27717)
When BINARY_EXPRESSION is used as parent, spacing rules for it are applied.
There're no rules for OPERATION_REFERENCE on the other side.

 #KT-27717 Fixed
2018-11-01 12:24:02 +03:00
Nikolay Krasko
2684974a33 Single indent for multi-declarations for official codestyle (KT-27847)
#KT-27847 Fixed
2018-11-01 12:24:01 +03:00
Nikolay Krasko
a8fc9d6b6f Show lambda return hints only once in one-liner ifs (KT-27802)
#KT-27802 Fixed
2018-11-01 12:24:00 +03:00
Natalia Selezneva
6ae95b747d Fix KotlinScriptDefinitionProvider compilation for 181 branch
Use FileTypeRegistry.getFileTypeByFileName instead of isFileOfType
2018-11-01 12:09:27 +03:00
Toshiaki Kameyama
e8e51d1db4 Safe cast with return: fix false negative on lambda last statement #KT-27906 Fixed 2018-11-01 10:59:18 +03:00
Ilya Gorbunov
e49789f819 Build java9 modular artifacts under 'modular' classifier
Provide additional modular artifacts as a workaround for KT-21266

Update module-info declarations:
  - add new packages
  - add exports and opens for internal PlatformImplementations
  - remove exports of kotlin.coroutines.experimental.*

#KT-27919 Fixed
2018-11-01 02:27:49 +03:00
Alexey Tsvetkov
f139ec72cd Convert kotlin-gradle-plugin-integration-tests build script: step 2 2018-11-01 00:59:07 +03:00
Alexey Tsvetkov
45ac6ba251 Convert kotlin-gradle-plugin-integration-tests build script: step 1 2018-11-01 00:59:07 +03:00
Alexey Tsvetkov
bc65e6e66a Convert kotlin-gradle-plugin-model build script: step 2 2018-11-01 00:59:07 +03:00
Alexey Tsvetkov
9c7bd610c5 Convert kotlin-gradle-plugin-model build script: step 1 2018-11-01 00:59:07 +03:00
Alexey Tsvetkov
e0e3d90774 Convert kotlin-gradle-plugin-api build script: step 2 2018-11-01 00:59:07 +03:00
Alexey Tsvetkov
0ab326e4ba Convert kotlin-gradle-plugin-api build script: step 1 2018-11-01 00:59:07 +03:00
Alexey Tsvetkov
5a3a2df272 Convert kotlin-gradle-plugin build script: step 2 2018-11-01 00:59:07 +03:00
Alexey Tsvetkov
911f54ed0b Convert kotlin-gradle-plugin build script: step 1 2018-11-01 00:59:07 +03:00
Alexander Udalov
be66591a4f Minor, fix test data for PublishedApi on inline class constructor
PublishedApi is not available at runtime because it has BINARY
retention. Probably this test should check some other RUNTIME-retained
annotation
2018-10-31 17:25:12 +01:00
Alexander Udalov
911420d823 Minor, move InlineOnly-related utilities to frontend 2018-10-31 17:21:06 +01:00
Alexander Udalov
c5275f178a Do not use getMethod/getConstructor in reflection
Use only getDeclaredMethod/getDeclaredConstructor instead. The reason is
that getMethod/getConstructor only finds public-API (public or protected
on JVM) declarations, and to determine if a declaration is public-API in
the class file we used isPublicInBytecode, which was trying to load
annotations on the declaration to see if it was InlineOnly, and that
required lots of time-consuming actions and worsened the stack trace (as
can be seen e.g. in KT-27878). In fact, the implementation of
Class.getMethod is not supposed to do anything complicated except
loading annotations from each superclass and superinterface of the given
class. Doing it in our codebase simplifies implementation and probably
improves performance
2018-10-31 17:21:06 +01:00
Alexander Udalov
2f72f68e1a Fix loading class literal value void.class in reflection
#KT-27878 Fixed
2018-10-31 17:21:05 +01:00
Alexander Udalov
902d414d39 Fix loading of class literal constant values in reflection
This is an addition to c1ab08c8ce where KT-26582 was fixed. The test
testClassLiteralArguments in JvmRuntimeDescriptorLoaderTestGenerated
failed before this change but went unnoticed because it wasn't run on CI
(see the previous commit)
2018-10-31 17:21:05 +01:00
Alexander Udalov
7d0d2fcdb9 Add descriptors.runtime tests to compilerTest 2018-10-31 17:21:05 +01:00
Alexander Udalov
38aad20231 Update konan.proto to be consistent with kotlin-native repo
See https://github.com/JetBrains/kotlin-native/pull/2278
2018-10-31 17:20:13 +01:00
Mikhail Glukhikh
9bc1dbb5bc Fix testCleanup 2018-10-31 19:00:29 +03:00
Mikhail Glukhikh
318d6e7111 Introduce inspection for unused main parameter #KT-26999 Fixed 2018-10-31 19:00:29 +03:00
Mikhail Glukhikh
ad44118605 Delay UNUSED_PARAMETER on main parameter until 1.4 (part of KT-26999) 2018-10-31 19:00:29 +03:00
Mikhail Glukhikh
388aecb249 Extract new MPP tests from Gradle config tests, forbid them for 173
This removes four failing tests from 173 / AS31
2018-10-31 19:00:28 +03:00
Shagen Ogandzhanian
d78115757f Update antlr dependency from 4.5.3 to 4.7.1 switch to gradle in idl2k
This is a squashed and rebased commit of https://github.com/JetBrains/kotlin/pull/1945

- add idl2k to default gradle build lifecycle
- removemaven build completely
- invert maven's `idl2k.deploy.skip` to `idl2k.deply` in gradle
(false by default)
- antlr upgrade from 4.5.3 to 4.7.1 - I'd have to slightly modify WebIDL.g4 definition though -
and updated copyright accordingly - my updates were based on
https://raw.githubusercontent.com/antlr/grammars-v4/master/webidl/WebIDL.g4
- I've checked all generated output to make sure it is identical to
what we hade before dependency update.
- Package idl2k according to our souce code guidelines
2018-10-31 16:23:00 +01:00
Ilya Gorbunov
c3237f416f Minor: fix doc formatting that caused summary differ in JVM and Native 2018-10-31 17:16:50 +03:00
Ilya Gorbunov
18f9b9a022 Minor: fix sample references in MatchResult 2018-10-31 17:14:49 +03:00
Ilya Gorbunov
a341110304 Remove Build-Jdk manifest property
To get rid of an additional cause of potential artifact indeterminacy.

#KT-26102 Fixed
2018-10-31 16:41:31 +03:00
Natalia Selezneva
ffc7d302fb Check that file is valid during reading/writing file attribute 2018-10-31 16:13:42 +03:00
Natalia Selezneva
715a5699de Do not use stubs looking for script definition
Fix EA-128960
2018-10-31 16:13:42 +03:00
Natalia Selezneva
6af9929992 Do not try to find script definition for decompiled kotlin files 2018-10-31 16:13:41 +03:00
Dmitry Savvinov
f9f54e5a4b Minor: publish AbstractIrGeneratorTestCase.createExpectedFile 2018-10-31 14:52:04 +03:00
Dmitry Savvinov
00036ba498 [BE IR] Skip comments for determining startOffset of declaration 2018-10-31 14:52:03 +03:00
Dmitriy Dolovov
633f665b7f Add icon for Kotlin/Native
Issue #KT-27150 Fixed
2018-10-31 17:35:54 +07:00
Mikhael Bogdanov
2f2093add3 Temporary switch 183 branch to SNAPSHOT dependency, update asm version to 7.0 2018-10-31 11:15:50 +01:00
Natalia Selezneva
c6882c1ebd Fix testdata in j2k 2018-10-31 13:08:48 +03:00
Natalia Selezneva
2d628d84f6 Add missing import in bunch file 2018-10-31 13:08:48 +03:00
Mikhail Glukhikh
1936c14e84 Remove MPP wizard "Shared" from 181, together with relevant failed test 2018-10-31 11:57:22 +03:00
Toshiaki Kameyama
1df15612d6 Unnecessary parentheses in function call with lambda: fix false positive #KT-26669 Fixed 2018-10-31 11:45:48 +03:00
Natalia Selezneva
2d0ecf8f50 Update testdata: println is moved to ioH.kt 2018-10-31 11:02:14 +03:00
Natalia Selezneva
a79785727e Update testdata: coroutines are not experimental since 1.3.0 2018-10-31 11:01:14 +03:00
Natalia Selezneva
cc689af635 Set projectJdk in MultiFileTestCase, because many of configuration files contains inheritedJdk dependency
Fix MultiModuleRenameTest, MultiModuleSafeDeleteTest, MultiModuleChangeSignatureTest
2018-10-31 11:01:14 +03:00
Natalia Selezneva
0fa908a1b5 Configurator tests: update testdata
LATEST_STABLE version is used in language version settings if there is no facet configured
2018-10-31 11:01:13 +03:00
Natalia Selezneva
43fa2d59fc Configurator: repositories are inserted in one line 2018-10-31 11:01:13 +03:00
Natalia Selezneva
cbd54e7867 Fix configuration tests with latest runtime 2018-10-31 11:01:12 +03:00
Natalia Selezneva
f364717da2 J2K: convert annotations properly 2018-10-31 11:01:12 +03:00
Natalia Selezneva
ed1452c136 Fix j2k testdata for constructors 2018-10-31 11:01:11 +03:00
Alexander Udalov
5bc2178040 Report warning instead of error on incorrect -Xuse-experimental/-Xexperimental
#KT-27430 Fixed
 #KT-27709 Fixed
2018-10-30 19:58:03 +01:00
Mikhail Glukhikh
43895f43d4 Drop empty GradleMultiplatformWizardTest to avoid empty test suite 2018-10-30 20:23:27 +03:00
Mikhael Bogdanov
bedaa1a503 Use proper type constructor in IrIllegalArgumentException
'v.anew(Type.geType(...))' worked accidentally because
  1. By default, ASM 6 creates METHOD Type for 'Type.geType(...)' invocation
  2. It didn't fail because this type was used only in 'anew' invocation that
      calls 'internalName' only
  3. ASM 7 changes default behavior to throw Exception
2018-10-30 16:30:26 +01:00
Mikhael Bogdanov
98fa26c2d8 Use proper type constructor in eval4j
ASM 7 changes default behavior for 'getTypeInternal' (was 'getType') method.
 Now it's throwing exception instead of create 'METHOD' Type.
 Old behavior was equals to 'Type.getMethodType("<invalid>")'

 #KT-27833 Fixed
2018-10-30 16:30:03 +01:00
Sergey Igushkin
f995afd50d Fix runtime elements configuration resolved for compile classpath
The existing disambiguation rule for the Usage attribute lead to
runtime variants being resolved even for compile-scoped input
configurations, because Gradle runs disambiguation rules even if the
consumer value is present in the candidates list.

For example, an `app` project's `jvmCompileClasspath` configuration
would get its `project('lib')` dependency resolved to the
`jvmLibRuntimeElements` instead of `jvmLibApiElements`.

Fix this by:
1) running the part of the disambiguation rule only with Gradle 4.1+, so
  as to use the consumer value for proper disambiguation;
2) choosing the JAVA_API usage when the consumer is JAVA_API or
  KOTLIN_API, and choosing one of the JAVA_RUNTIME usages if the
  consumer is either KOTLIN_RUNTIME, one of the JAVA_RUNTIME usages, or
  does not specify its usage.

Issue #KT-27849 Fixed
2018-10-30 17:29:54 +03:00
Mikhael Bogdanov
43e79035e9 Revert "Fix backend for working with asm-7.0 beta (KT-27540, KT-27774)"
Original commit that cause this change was removed in asm 7.0 release
2018-10-30 11:00:23 +01:00
Dmitriy Dolovov
e5a3feada4 Disable ProjectRootModificationTrackerFixer in IDEA 183+
Issue #KT-27579 Fixed
2018-10-30 11:13:26 +07:00
Alexey Tsvetkov
49d5c8ae37 Run model tests with Gradle 4.0+ 2018-10-29 21:48:01 +03:00
Alexey Tsvetkov
00f60553dc Try 0 and 1 starting lines in Kapt location mapping tests 2018-10-29 21:48:01 +03:00
Alexey Tsvetkov
22064fd005 Choose Gradle version for Gradle model tests as for other tests 2018-10-29 21:48:01 +03:00
Denis Zharkov
f2a937ed97 Add changelog notes for 1.3 RCs and release 2018-10-29 19:12:38 +03:00
Vyacheslav Gerasimov
4eeb4a0ffd Build: Use cache-redirector for Android Studio 2018-10-29 18:53:19 +03:00
Alexey Tsvetkov
c4268a4238 Update Android Gradle plugin version in tests 2018-10-29 16:09:57 +03:00
Ilya Matveev
a03707cf87 Update Kotlin/Native: 1.0.1 2018-10-29 18:45:51 +07:00
Ilya Matveev
e0a83b6159 Use KOTLIN_API usage in cinterop dependencies.
Issue #KT-27803 fixed.
2018-10-29 18:45:51 +07:00
Alexander Udalov
d28c6559b8 Fix support of directories as sources in build files (-Xbuild-file)
#KT-27775 Fixed
2018-10-29 11:36:29 +01:00
Nikolay Krasko
0a2d1b409b Cleanup LookupCancelWatcher.kt 2018-10-27 18:57:21 +03:00
Nikolay Krasko
48c0fb2ba9 Remove deprecated AbstractProjectComponent 2018-10-27 18:57:20 +03:00
Sergey Rostov
cce125b982 JPS: Don't catch BuildDataCorruptedException as internal error.
BuildDataCorruptedException should be thrown up to `IncProjectBuilder`
to be handled by TeamCity.

#KT-27037 Fixed
2018-10-27 16:08:38 +03:00
Sergey Rostov
0b8d94a6b1 JPS: Fix initialization order for case when all kotlin rebuild.
#KT-27792 Fixed
2018-10-27 16:08:16 +03:00
Mikhail Glukhikh
700bcb5984 Unused symbol: fix false positives on inline class constructors
#KT-27434 Fixed
2018-10-27 12:13:52 +03:00
Mikhail Glukhikh
506f7aaa68 Replace toString with string template: fix grammar 2018-10-27 12:13:50 +03:00
Mikhail Glukhikh
6e10235208 Make "Add name(s) to call arguments" available for generic arguments
#KT-15550 Fixed
2018-10-27 12:13:42 +03:00
peter
e93a90bc09 fix some cases of "Cls delegate shouldn't be loaded for not too complex ultra-light classes" 2018-10-26 20:41:56 +02:00
Alexander Udalov
cfffd21fa9 Fix KtLightAnnotationsValues.kt for 173
See 17076cd05e
2018-10-26 20:17:52 +02:00
Mikhail Glukhikh
cb92009862 Fix maven build + ~50 compiler tests broken by UNUSED_PARAMETER in main 2018-10-26 19:51:20 +03:00
peter
c54eb7db97 Merge remote-tracking branch 'origin/master' 2018-10-26 18:44:12 +02:00
peter
cd1560e0b4 provide correct context for method return type
to fix generics in

class A<E> {
   fun foo(): E = null!!
}

public class B {
   public static void main(String[] args) {
       A<String> a = new A<>();
       a.foo().length(); // Unresolved length, because it thinks that `a.foo()` returns E
   }
}
2018-10-26 18:42:41 +02:00
Vyacheslav Gerasimov
87af14849d as34: Restore compatibility with 183 platform in AS 3.4 2018-10-26 18:25:22 +03:00
Vyacheslav Gerasimov
99924c3df5 as34: Update idea-version 2018-10-26 18:25:21 +03:00
Vyacheslav Gerasimov
c6ecc6c21c as34: Update versions.gradle.kts 2018-10-26 18:25:21 +03:00
Vyacheslav Gerasimov
4076923a26 as34: Apply changes from AS 3.3 2018-10-26 18:25:20 +03:00
Vyacheslav Gerasimov
25e6916469 Derive as34 bunch from 183 2018-10-26 18:24:33 +03:00
Nikolay Krasko
7009b261d6 Don't rank local classes (KT-27712)
Allow enable ranking even for single source file in tests

 #KT-27712
2018-10-26 18:02:36 +03:00
Nikolay Krasko
214785d9b7 Do not ruin breakpoints when there's failure in ranking (KT-27712) 2018-10-26 18:02:36 +03:00
Nikolay Krasko
8d7829be31 Allow to assert rank value in ranking test
Update test data for lambdas.kt because of same rank check bug fixed.
2018-10-26 18:02:36 +03:00
Nikolay Krasko
122fba20da Do not wait for not generated classes in LowLevelDebuggerTestBase 2018-10-26 18:02:35 +03:00
Nikolay Krasko
651d76f4ef Allow disable strict mode in ranking tests 2018-10-26 18:02:35 +03:00
Andrey Uskov
1c7cab61c9 Add platform AS34 2018-10-26 17:58:11 +03:00
Ilya Gorbunov
c833272392 stdlib-gen, minor: rename property 2018-10-26 16:27:43 +03:00
Ilya Gorbunov
138ab13364 Remove experimental coroutines usages from stdlib generator 2018-10-26 16:27:42 +03:00
Mikhail Glukhikh
e39953c4a0 Check also drop-box content in multi-module line marker tests
Related to KT-26957
2018-10-26 16:21:49 +03:00
Alexander Udalov
f4c77ec66f Minor, rework groovyTraitsWithFields integration test
Declaring Groovy and Kotlin classes in the same project is not necessary
for this test, split them to two projects instead to avoid the hack with
modifying task dependencies manually
2018-10-26 14:40:13 +02:00
Nicolay Mitropolsky
274fcd6237 183: PsiElementChecker: the 55-th method textRangeInParent was added in 183 2018-10-26 15:09:19 +03:00
Nicolay Mitropolsky
23d2269aac 183: Update IDEA version to 183.3975.18 2018-10-26 12:13:22 +03:00
Pavel Punegov
4d5b00d3e3 Ignore test in native: uses Array.fill 2018-10-26 11:33:14 +03:00
Mikhael Bogdanov
09d0d2c71c Keep android tests in libs/test folder
To avoid 'com.android.dex.DexException: Too many classes in --main-dex-list, main dex capacity exceeded
2018-10-26 09:51:14 +02:00
Alexander Udalov
9df02b2366 Support Groovy $Trait$FieldHelper classes in new class file reader
Preface: for Groovy traits with fields, the Groovy compiler generates
synthetic "$Trait$FieldHelper" classes which posed several problems to
our class file reader, caused by the fact that the contents of the
InnerClasses attribute broke some assumptions about how names on the JVM
are formed and used.

For a trait named `A`, the Groovy compiler will additionally generate a
synthetic class file `A$Trait$FieldHelper` with the following in the
InnerClasses attribute:

InnerClasses:
     public static #15= #2 of #14; //FieldHelper=class A$Trait$FieldHelper of class A

i.e. the simple name of the class is `FieldHelper`, the name of its
outer class is `A`, but the full internal name is `A$Trait$FieldHelper`,
which is surprising considering that the names are usually obtained by
separating the outer and inner names via the dollar sign.

Another detail is that in some usages of this synthetic class, the
InnerClasses attribute was missing at all. For example, if an empty
class `B` extends `A`, then there's no InnerClasses attribute in `B`'s
class file, which is surprising because we might decode the same name
differently depending on the class file we encounter it in.

In this change, we attempt to treat these synthetic classes as top-level
by refusing to read "invalid" InnerClasses attribute values (they are
not technically invalid because they still conform to JVMS), fixing the
problem of "unresolved supertypes" error which occurred when these
classes were used as supertypes in a class file in a dependency.

1) In ClassifierResolutionContext.mapInternalNameToClassId, do not use
   the ad-hoc logic (copy-pasted from intellij-core) to determine class
   id heuristically from the internal name. For $Trait$FieldHelper
   classes this logic attempted to replace all dollar signs with dots,
   which was semantically incorrect: dollars there were used as
   synthetic characters, not as a separator between outer and inner
   classes.
2) In isNotTopLevelClass (Other.kt), only consider "valid" InnerClasses
   attribute values, where the full name of the class is obtained by
   separating the outer name and the inner name with a dollar character.
   This way, we'll be able to treat class files with invalid attribute
   values as top-level and avoid breaking any other assumptions in the
   class file loader.
3) In BinaryJavaClass.visitInnerClass, record all valid InnerClasses
   attribute values present in the class file, not just those related to
   the class in question itself. This is needed now because previously,
   the removed heuristics (see p.1) transformed mentioned inner class
   names to class ids correctly >99% of the time. Now that the
   heuristics are gone, we'll use the information present in the class
   file to map names correctly and predictably. According to JVMS, this
   attribute should contain information about all inner classes
   mentioned in the class file, and this is true at least for class
   files produced by javac.

 #KT-18592 Fixed
2018-10-25 22:15:22 +02:00
Yan Zhulanow
cd88209cf4 Fix Android Extension imports resolution after project reopening (KT-27793) 2018-10-25 23:10:41 +03:00
peter
beba8f215e fix registry bean registration for ultra-light classes 2018-10-25 19:54:35 +02:00
Mikhael Bogdanov
0edd2d326b Add LocalVariablesSorter to MethodRemaper in RemappingClassBuilder to keep old behavior
#KT-27774 In Progress
2018-10-25 19:53:27 +02:00
Mikhael Bogdanov
0468a354e0 Get rid of deprecated asm remapping api
#KT-27774 In Progress
2018-10-25 19:53:20 +02:00
Toshiaki Kameyama
ad8c58d176 Lift return out refactoring: extract function for problem report 2018-10-25 19:51:36 +03:00
Toshiaki Kameyama
3e6007e3d3 Lift return out: report also on 'return' keywords #KT-27173 Fixed 2018-10-25 19:51:36 +03:00
Toshiaki Kameyama
f771ed5dd8 Reformat & cleanup: LiftReturnOrAssignmentInspection 2018-10-25 19:51:35 +03:00
peter
ebc998d710 add ultra-light classes/members that work without backend in simple cases 2018-10-25 18:22:33 +02:00
Mikhail Glukhikh
387efc3791 Highlight unused parameters in main function in 1.3 (KT-26999) 2018-10-25 19:11:45 +03:00
Mikhail Glukhikh
17da136420 KotlinPsiCheckerAndHighlightingUpdater: convert to Kotlin 2018-10-25 19:11:43 +03:00
Mikhail Glukhikh
b73bcbb06d KotlinPsiCheckerAndHighlightingUpdater: .java -> .kt 2018-10-25 19:11:42 +03:00
Mikhail Glukhikh
f3555daa60 Report UNUSED_PARAMETER on main parameter in 1.3+ #KT-26999 Fixed 2018-10-25 19:10:39 +03:00
Mikhail Glukhikh
b9161c5293 Gradle configurator: handle kotlin options correctly with new-mpp plugin
#KT-27052 Fixed
2018-10-25 18:13:08 +03:00
Mikhail Glukhikh
d050629589 Show expect / actual for parameters & enum entries in drop-box
#KT-26957 Fixed
2018-10-25 18:11:47 +03:00
Mikhail Glukhikh
bb19d4c598 Do not create expect / actual markers for parameters & enum entries
Part of KT-26957
2018-10-25 18:11:45 +03:00
Alexander Udalov
17076cd05e Support class literal values in light annotations correctly
Map Kotlin built-in classes (e.g. Throwable) to corresponding Java
classes, do not map Unit to void, support arrays of primitives and
arrays of wrapper types
2018-10-25 16:27:23 +02:00
Alexander Udalov
266a8dae3f Fix KClassValue behavior for reified type parameter literals
#KT-27799 Open
2018-10-25 16:27:23 +02:00
Alexander Udalov
c1ab08c8ce Refactor KClassValue to store ClassLiteralValue internally
Only invariant array projections and non-null element types will be
supported soon (see KT-26568), so it makes no sense to store the
complete type in KClassValue. What we need is only the ClassId of the
class, and the number of times it's wrapped into kotlin/Array, which is
exactly what ClassLiteralValue represents.

This change helps in decoupling annotation values from
descriptors/types. The only constant value that depends on descriptors
is now AnnotationValue.

 #KT-26582 Fixed
2018-10-25 16:27:23 +02:00
Alexander Udalov
bad30a4b99 Add module to ExperimentalMarkerDeclarationAnnotationChecker
Will be used in a subsequent commit
2018-10-25 16:27:22 +02:00
Alexander Udalov
2ab33026fb Move ClassLiteralId to 'descriptors', rename to ClassLiteralValue 2018-10-25 16:27:22 +02:00
Alexander Udalov
19c79b906f Minor, add utility to get class name from StringTable via ClassId 2018-10-25 16:27:22 +02:00
Alexander Udalov
9183d7ca27 Add ModuleDescriptor to AnnotationCodegen 2018-10-25 16:27:22 +02:00
Roman Artemev
ffdfec4815 [JS IR BE] Minor refactoring 2018-10-25 15:49:33 +03:00
Roman Artemev
080e1ad5b5 [JS IR BE]
* Fix type parameters for callable references
 * Visit IrCallableReference tree as well
2018-10-25 15:49:22 +03:00
Roman Artemev
fb499def59 Update tests 2018-10-25 15:49:21 +03:00
Roman Artemev
04bf93c1bc [JS IR BE] Refact CallableReferenceLowering
* fix cross-module references
 * make it incremental
2018-10-25 15:49:20 +03:00
Roman Artemev
43d14ed954 [JS IR BE] Put closure function declaration in container (factory function) 2018-10-25 15:49:20 +03:00
Roman Artemev
9515de0b7e [JS IR BE] Fix name clash between top-level fields 2018-10-25 15:48:42 +03:00
Roman Artemev
91ea377622 [JS IR BE] Fix translation for float literals 2018-10-25 15:48:42 +03:00
Roman Artemev
59b1743c37 Add tests 2018-10-25 15:48:42 +03:00
Roman Artemev
7cb202934c Update tests 2018-10-25 15:48:42 +03:00
Roman Artemev
276000a974 [JS IR BE] Fix exceptions
* set message property in the correct way
 * set proper name for each Throwable successor
2018-10-25 15:48:42 +03:00
Roman Artemev
6a05b1eee5 [JS IR BE] Add noWhenBranchMatchedException
* refact exception helpers
2018-10-25 15:48:42 +03:00
Roman Artemev
3bea3eca2b [JS IR BE] Support external enum classes
* add lowering pass
 * fix EQEQ operator
2018-10-25 15:48:42 +03:00
romanart
eed22b0485 [JS IR BE] Add isTopLevel property to IrFunction 2018-10-25 15:48:42 +03:00
Roman Artemev
fced46ffaf [JS IR BE] Fix block decomposer 2018-10-25 15:48:42 +03:00
Mikhael Bogdanov
612ca87aa3 Support coroutines in Android box tests 2018-10-25 13:34:29 +02:00
Ilya Chernikov
ae0b2405bc Add ide script settings for sources and accepted location 2018-10-25 13:09:34 +02:00
Ilya Chernikov
492abd08bc Fix bridge resolver behaviour on static dependencies 2018-10-25 13:09:32 +02:00
Ilya Chernikov
0e66c64a17 Implement new minimal extension point for providing (new) script definitions to idea
#KT-27817 fixed
2018-10-25 13:09:01 +02:00
Mikhael Bogdanov
afc78be58e Explicitly specify test dist dependencies 2018-10-25 11:55:22 +02:00
Alexander Podkhalyuzin
812d3d9ce6 Fixed testdata to have the same package/file structure, otherwise it
will not work with Java 9.
2018-10-25 11:16:37 +03:00
Mikhael Bogdanov
35fc629305 Move custom JDK tests into separate module 2018-10-25 09:15:03 +02:00
Mikhael Bogdanov
2f2d056aff Add stdlib and reflect to Android test dependencies 2018-10-25 09:15:02 +02:00
Mikhael Bogdanov
1b2145af22 Fix test data 2018-10-25 09:12:26 +02:00
Mikhael Bogdanov
e5ef5d096e Fix test data 2018-10-25 09:10:40 +02:00
Yan Zhulanow
7626cf6611 Minor: Update test data for kapt stub converter 2018-10-24 23:44:31 +03:00
Yan Zhulanow
ae66482715 Add missing versions.platform for the new bunches 2018-10-24 23:38:35 +03:00
Yan Zhulanow
9dd6efeb46 Fix sporadic false-positive "Receiver parameter is never used" for local functions (KT-26481) 2018-10-24 20:12:42 +03:00
Yan Zhulanow
f19c0c3fb9 Minor: Fix inspection warnings in 'kotlin-annotation-processing' 2018-10-24 20:12:41 +03:00
Yan Zhulanow
17c02a77c7 Minor: Fix inspection warnings in 'kotlin-annotation-processing-base' 2018-10-24 20:12:40 +03:00
Yan Zhulanow
2cb2141e07 Kapt: Do not treat initially empty configurations specially (KT-27404) 2018-10-24 20:12:39 +03:00
Yan Zhulanow
6e6a036f98 Kapt: Improve check for the current JDK version (KT-27188) 2018-10-24 20:12:38 +03:00
Yan Zhulanow
1f6dbc74da Kapt: Restore constant identifiers for field annotations (KT-27334)
The old behavior broke after the refactoring of annotations with use-site targets.
2018-10-24 20:12:37 +03:00
Yan Zhulanow
0ae5d1c08f Kapt: Log annotation processor initialization time 2018-10-24 20:12:36 +03:00
Yan Zhulanow
6d017f07ad Kapt: Support androidx.annotation.RecentlyNullable annotations (KT-26725) 2018-10-24 20:12:35 +03:00
Yan Zhulanow
ac1dd59472 Kapt: Fix anonymous type transformer, do not use ClassDescriptor.defaultType as a replacement (KT-27119) 2018-10-24 20:12:34 +03:00
Yan Zhulanow
39863edd0e Kapt: Use correct type mapping mode while mapping super types (KT-27126) 2018-10-24 20:12:32 +03:00
Yan Zhulanow
f6bf35c1f5 Kapt: Fix error type correction for super class constructor calls 2018-10-24 20:12:31 +03:00
Yan Zhulanow
ba53ba37b0 Replace bunch copies for some of build.gradle.kts files with a DSL 2018-10-24 20:12:30 +03:00
Yan Zhulanow
81cfc3e39f Kapt: Support symlinked Java source files (KT-26817) 2018-10-24 20:12:29 +03:00
Yan Zhulanow
65a1dd9350 Minor: Add a package to JavaKaptContextTest, make it a TestCase 2018-10-24 20:12:28 +03:00
Yan Zhulanow
f36447aab8 Remove usage of deprecated ConcurrentWeakFactoryMap in debugger (KT-25667) 2018-10-24 20:12:27 +03:00
Yan Zhulanow
e3f6d183fa Check for dumb mode before evaluation (KT-24959) 2018-10-24 20:12:26 +03:00
Yan Zhulanow
b8c756a4e8 Debugger: Remove false-positive assertion (KT-24343) 2018-10-24 20:12:25 +03:00
Yan Zhulanow
713dc589e0 Debugger: Allow to evaluate private properties from companion objects (KT-26795) 2018-10-24 20:12:24 +03:00
Yan Zhulanow
fee0cfcecb Debugger: Add a stepping test for inline classes (KT-26798) 2018-10-24 20:12:23 +03:00
Alexander Udalov
1ee1d15b91 Support annotations on property accessors in JS/common metadata
#KT-14529 Fixed
2018-10-24 18:17:12 +02:00
Alexander Udalov
d1e1e274d9 Render property accessor annotations in .txt test data
If property accessor rendering is disabled in a test, render annotations
on accessors as use-site-targeted, as was done with
`@setparam:`-annotations. Otherwise they were lost
2018-10-24 18:17:12 +02:00
Mikhael Bogdanov
e326b8755f Fix method inlining problems in 191 branch related to asm upgrade to 7.0
'visitAnnotableParameterCount' is propagating copying node state to
    destination one that corrupts its state
2018-10-24 17:07:10 +02:00
Alexey Tsvetkov
bf39e1d146 Make google maven repo take precedence over jcenter in Gradle tests
'com.android.tools.build:aapt2-proto:0.3.1' stopped resolving from jcenter
2018-10-24 15:54:04 +03:00
Alexander Udalov
9394caf9cf Use access to backing field on overridden property with private setter
#KT-27772 Fixed
2018-10-24 12:53:50 +02:00
Nikolay Krasko
8e1bff0e37 Additional diagnostic for internal state during jvm codegen 2018-10-24 13:04:49 +03:00
Nikolay Krasko
5fdb0df3fa Fix backend for working with asm-7.0 beta (KT-27540, KT-27774)
Reset labels infos before moving instructions, otherwise list of
instructions is corrupted.

For more information:

https://gitlab.ow2.org/asm/asm/issues/317858
dc8acb4845 (5e3df072b61d74b2fd71d97a1d99188ccc46c1da_235_233)

 #KT-27540 Fixed
2018-10-24 13:04:48 +03:00
Nikolay Krasko
3b5dfba73a 191: Add com.intellij.util.ui.UIUtilities to proguard exception 2018-10-24 13:04:45 +03:00
Nikolay Krasko
77be4a9e85 Remove warnings in createByPattern.kt 2018-10-24 13:04:43 +03:00
Andrey Uskov
4024d0c484 Make JDK 9 mandatory back
#KT-26413 Fixed
2018-10-24 12:31:13 +03:00
Dmitry Savvinov
339c55505a Refactor logic of reporting errors in contracts
Rename 'doCheckContract' into 'parseContractAndReportErrors',
emphasizing that it works with definitely call to 'contract' from
stdlib.
In particular, it means that it should either return non-null
value or report some errors.

Note that this commit doesn't change behavior of this code (modulo cases
when something in 'parseContract' throws exception), but just refactors
the code to be more clear and easy to reason about.
2018-10-24 12:03:04 +03:00
Dmitry Savvinov
3dd4e9f04f Minor: use try-finally for setting LazyContractProvider
It conveys meaning of the code more celearly (because that's what we
want to do here: set LazyContractProvider no matter how code finished),
and also defends from several corner-cases (like, make sure that we
properly set LazyContractProvider even if doCheckContract has throw an
exception)
2018-10-24 12:03:04 +03:00
Mikhail Zarechenskiy
bae3ff5211 Don't try parsing contract-like function not from kotlin package
Returning `null` from `doCheckContract` functions means that we
have failed to parse contract function and should report an error, but
if the called function isn't true contract, we shouldn't evaluate that code
at all.

 #KT-27758 Fixed
2018-10-24 12:03:04 +03:00
Mikhael Bogdanov
d82ca9ccd0 Rearrange repositories in android build script 2018-10-24 09:45:39 +02:00
Ilya Gorbunov
c8caed5b6f Duplicate MutableList.add docs in AbstractMutableList.add
Because the documentation inheritance doesn't work as desired here.
2018-10-23 22:21:25 +03:00
Ilya Gorbunov
efa7bf0c37 Unify kotlin.test docs 2018-10-23 22:21:25 +03:00
Piotr Krzeminski
3c46bb9d03 kotlin-test: Add documentation for value returned by assertFailsWith
A follow-up after https://youtrack.jetbrains.com/issue/KT-27418

Co-authored-by: Ilya Gorbunov <ilya.gorbunov@jetbrains.com>
2018-10-23 22:21:25 +03:00
Mikhail Levchenko
16918fa25e Remove confusing samples from SequenceBuilder docs
Problem:
SequenceBuilder is experimental and deprecated in 1.3 in favor of
SequenceScope. Usage of experimental package is discouraged in 1.3.
The documentation for SequenceBuilder refers to SequnceScope sample code,
which might be confusing.

Solution:
Remove samples for SequenceBuilder completely to discourage its usage,
but provide a note about it having deprecated in favor of SequenceScope.
Provide links to modern version of outdated SequenceBuilder.
2018-10-23 22:21:25 +03:00
Andrey Uskov
af5281e7c7 Fixed import in IDEA if required environment variables are not set.
#KT-26413 Fixed
2018-10-23 20:52:15 +03:00
Mikhael Bogdanov
d77175b7e4 Minor. Reformat 2018-10-23 16:27:53 +02:00
Mikhael Bogdanov
0288a1bd2d Restructure android test module, update dependencies 2018-10-23 16:27:52 +02:00
Mikhael Bogdanov
78fe9d8eee Move 'compileKotlinAgainstKotlin' java 8 tests to common 2018-10-23 16:27:51 +02:00
Mikhael Bogdanov
c6b4bae81f Move 'bytecodeText' java 8 tests to common 2018-10-23 16:27:50 +02:00
Mikhael Bogdanov
4284c19a16 Move 'writeFlags' java 8 tests to common 2018-10-23 16:27:50 +02:00
Yan Zhulanow
37c38b6e43 Add missing bunch for testResourceBundle (fixes flaky debugger tests)
See also e1f746f23c.
2018-10-23 17:12:12 +03:00
Sergey Igushkin
5ee6a6037d (minor) Move the unused source sets check to the taskGraph.whenReady
This is a workaround for Android compilations being configured in
an afterEvaluate callback.

Issue #KT-26963 Fixed
2018-10-23 16:15:05 +03:00
Denis Zharkov
834de23f39 Do not set version to buildNumber
They might be different in case of releases:
1.3.0 != 1.3.0-release-N
2018-10-23 15:39:01 +03:00
Denis Zharkov
cbbc0eae8c Use https when publishing to sonatype
Otherwise, NoHttpResponseException may happen sporadically
2018-10-23 15:39:01 +03:00
Ilya Matveev
ca152fed12 Update Kotlin/Native: 1.0.0 2018-10-23 18:30:50 +07:00
Mikhail Glukhikh
7a589d69da Fix 183 build 2018-10-23 14:16:19 +03:00
Alexander Podkhalyuzin
16d3bf7716 Fixed KotlinConfidenceTests 2018-10-23 13:57:42 +03:00
Nikita Katkov
d66619b1c2 BlockingMethodInNonBlockingContextInspection: resolve mode switched to partial & coroutine "released" status check 2018-10-23 13:18:32 +03:00
Toshiaki Kameyama
90529dfda4 "Remove redundant receiver" quick fix: Remove unused type parameter #KT-23512 2018-10-23 13:02:44 +03:00
Toshiaki Kameyama
0cd25353bc Lift assignment: do not report in cases where argument are of different types #KT-21520 Fixed 2018-10-23 12:48:03 +03:00
Mikhail Glukhikh
fcc6395b14 SetterBackingFieldAssignment: minor refactoring 2018-10-23 12:35:35 +03:00
Toshiaki Kameyama
29cc727c5a Add inspection for suspicious 'var' property #KT-23691 Fixed 2018-10-23 12:31:42 +03:00
Toshiaki Kameyama
3ede93df11 Introduce inspection: "Setter backing field should be assigned"
#KT-20273 Fixed
2018-10-23 11:22:40 +03:00
Mikhail Glukhikh
784d9f14f6 Rollback language / API version at the end of IDE tests
This should fix some flaky tests
2018-10-23 10:57:09 +03:00
Nikolay Krasko
0eb5934e09 Update channels list in update Kotlin dropdown (KT-25429)
#KT-25429 Fixed
2018-10-23 01:23:21 +03:00
Yan Zhulanow
5d2a3c097c Minor: Update kapt test (nullability annotation is gone in Enum constructors) 2018-10-22 23:06:05 +03:00
Alexey Sedunov
af5d4b3156 MPP: Fix adjustment of transitive project dependencies
#KT-27632 Fixed
2018-10-22 19:18:35 +03:00
Alexey Sedunov
fd4c07f0e6 MPP: Populate BuildScriptClasspathData if it's absent
This happens when Java support is not available in the IDE
(e.g. in CLion)
2018-10-22 19:18:34 +03:00
Alexey Sedunov
839d936918 MPP: Implement directory selection UI supporting non-JVM roots
#KT-27291 Fixed
 #KT-26696 Fixed
2018-10-22 19:18:32 +03:00
Alexey Sedunov
aa4e87fc4b Refactor: Introduce MoveSource class 2018-10-22 19:18:31 +03:00
Mikhael Bogdanov
2131a314b0 Add file content to parsing errors 2018-10-22 16:32:57 +02:00
Mikhael Bogdanov
9c3b367b93 Skip JVM_TARGET and SKIP_JDK6 tests on android 2018-10-22 16:32:56 +02:00
Mikhael Bogdanov
ce1d6e7217 Fix test in JDK independent way 2018-10-22 16:32:56 +02:00
Mikhael Bogdanov
a4206a543a Skip test on JDK 6 2018-10-22 16:32:55 +02:00
Mikhael Bogdanov
db25343f90 Run tests on different JDKs via different suites and custom test runner 2018-10-22 16:32:54 +02:00
Mikhael Bogdanov
55880ef013 Fix delegateFilter reinitialization
Otherwise IDEA marks all test as skipped
2018-10-22 16:32:54 +02:00
Mikhael Bogdanov
5b8acd69e3 Mute JVM IR tests 2018-10-22 16:32:53 +02:00
Mikhael Bogdanov
edc648813d Regenerate box tests 2018-10-22 16:32:52 +02:00
Mikhael Bogdanov
ac8e1a0124 Move JVM8 box test to common 2018-10-22 16:32:52 +02:00
Mikhael Bogdanov
b61608aba7 Add TARGET_BACKEND for JVM 8 tests 2018-10-22 16:32:51 +02:00
Mikhael Bogdanov
6ec7b8e0d3 Fix test server and proxy 2018-10-22 16:32:50 +02:00
Vyacheslav Gerasimov
38902149d2 Add bunch set for AS 3.4 2018-10-22 17:21:22 +03:00
Ilya Gorbunov
4a10d954fc Unify and improve Regex docs 2018-10-22 17:14:46 +03:00
Ilya Gorbunov
709a28060f Unify coroutine intrinsic docs 2018-10-22 17:14:46 +03:00
Ilya Gorbunov
63c5e18149 capitalize/decapitalize docs in stdlib/js 2018-10-22 17:14:45 +03:00
Ilya Gorbunov
a1c0c679ee Common String.toNumber: clarify thrown exception types 2018-10-22 17:14:45 +03:00
Ilya Gorbunov
1ed136a621 kotlin.system docs improvements
- Rewrite exitProcess docs in a more common way
- Add [block] parameter reference
2018-10-22 17:14:45 +03:00
Ilya Gorbunov
3aff7112e0 Minor: code formatting in Unit docs 2018-10-22 17:14:45 +03:00
Ilya Gorbunov
ac5eeb885f Unify AbstractMutableMap JS docs 2018-10-22 17:14:45 +03:00
Ilya Gorbunov
7fc6f06b70 Correct parameter reference in copyInto docs 2018-10-22 17:14:44 +03:00
Ilya Gorbunov
ebe9d59df7 Unify print/println/readLine docs 2018-10-22 17:14:44 +03:00
Ilya Gorbunov
406bd7c980 Minor: split math sources into regions 2018-10-22 17:14:44 +03:00
Alexander Podkhalyuzin
5c0d516044 Refactored plugin.xml
#KT-27698 Fixed
2018-10-22 16:26:08 +03:00
Ilya Chernikov
dd28d55c7d Implement proper JDK home passing logic for scripts, deprecating old one
KT-27497 fixed, as well as failing tests on TC
2018-10-22 09:48:49 +02:00
Ilya Matveev
9ccaef2f6b Specify K/N default libs directory more precisely (#1934) 2018-10-21 10:50:46 +07:00
Anton Bannykh
b83df18e22 [JS IR BE] make default argument lowering support per-file mode 2018-10-19 23:49:18 +03:00
Roman Artemev
4c30888d89 Fix test data 2018-10-19 19:38:00 +03:00
Nikolay Krasko
2c98153c6c Use withIgnoredConflicts to fix compilation in 191 2018-10-19 19:16:25 +03:00
Nikolay Krasko
e3d7edb6ce Not null name in RunProfile since 191 2018-10-19 19:16:24 +03:00
Nikolay Krasko
31b4db7f67 191: PersistentStateComponent and other declarations were moved to platform-api 2018-10-19 19:16:22 +03:00
Nikolay Krasko
17421ed14d 191: asm-all has 7.0-beta version in Intellij 191
Pass project to fetch extra parameters for asm-all work
2018-10-19 19:16:21 +03:00
Nikolay Krasko
e86b1f2761 Workaround for generalized configuration classes in 191 2018-10-19 19:16:19 +03:00
Nikolay Krasko
8d48f9d719 Make parameters in KotlinDefaultTemplatePropertiesProvider not-null
Otherwise there's an error in 191
2018-10-19 19:16:18 +03:00
Nikolay Krasko
b79762ec63 Fallback for nullable name in PsiClass 2018-10-19 19:16:17 +03:00
Nikolay Krasko
06478f5147 Unify usages of JavaRunConfigurationExtensionManager.getInstance() for 191 2018-10-19 19:16:15 +03:00
Nikolay Krasko
210b5a8ca2 element utility is removed in 191, use Element constructor instead 2018-10-19 19:16:14 +03:00
Nikolay Krasko
9299ea8f5d Introduce 191 bunch 2018-10-19 19:16:12 +03:00
Nikolay Krasko
d381b4d3eb J2K: rewrite JetRunConfiguration 2018-10-19 19:16:11 +03:00
Nikolay Krasko
6d71d024e2 J2K: Rename JetRunConfiguration 2018-10-19 19:16:10 +03:00
Mikhail Glukhikh
a5e508a083 Unused symbol: handle functions with inline class parameters correctly
#KT-27357 Fixed
2018-10-19 19:07:59 +03:00
Mikhail Glukhikh
0678a56ca4 Add workaround for tests to avoid problems with UnusedSymbolInspection
#KT-27664 Fixed

In particular, this should solve
"Could not initialized UnusedSymbolInspection" and
"Modifications during highlighting are not allowed"
2018-10-19 18:19:21 +03:00
Natalia Selezneva
9653fe2fcf Do not threat sources from buildSrc folder as library sources
#KT-27674 Fixed
2018-10-19 16:36:58 +03:00
Natalia Selezneva
6decd06b1b Provide dependency on buildSrc module for .gradle.kts files
#KT-23603 Fixed
#KT-14862 Fixed
#KT-24623 Fixed
#KT-25354 Fixed
2018-10-19 16:36:57 +03:00
Sergey Igushkin
285620cb28 (minor) Add missing mavenLocal() repo to a Gradle IT project 2018-10-19 16:23:01 +03:00
Roman Artemev
1338d6d66f Update tests 2018-10-19 14:07:20 +03:00
Roman Artemev
41ccea6807 [JS IR BE] Fix name clashes between static and top-level functions 2018-10-19 14:07:20 +03:00
Roman Artemev
c496d8ed50 Fix Char.toLowerCase/Char.toUpperCase extensions 2018-10-19 14:03:06 +03:00
romanart
0260dc813f Update tests 2018-10-19 14:03:06 +03:00
Roman Artemev
79f7cb11f0 [JS IR BE] Fix invoke on dynamic types 2018-10-19 14:03:06 +03:00
Toshiaki Kameyama
ecba862dc9 Expand selection for labeled return #KT-26987 Fixed 2018-10-19 12:24:47 +03:00
Roman Elizarov
790c5632ea Broken doc link to suspendCoroutineOrReturn fixed 2018-10-19 09:58:40 +03:00
Sergey Igushkin
bccca5cfa8 (minor) Fix testResolveMppLibDependencyToMetadata after stdlib was added 2018-10-18 20:10:13 +03:00
Sergey Igushkin
91b435b4bc Check the MPP model for unused Kotlin source sets, warn when found
Issue #KT-26963 Fixed
2018-10-18 20:10:13 +03:00
romanart
44d9ff6c71 Update tests 2018-10-18 19:00:43 +03:00
romanart
df5872281b [JS IR BE] Support instance check for Nothing type 2018-10-18 19:00:43 +03:00
Ilya Gorbunov
c72cf02e6c Add more missing SinceKotlin("1.3") annotations 2018-10-18 16:16:34 +03:00
Pavel Punegov
0bdbcbc662 Ignore the test that uses JVM functions and String constructor 2018-10-18 16:08:38 +03:00
Lukas Welte
70d0c1a0ae Mark Result, its extensions and runCatching as available since 1.3 2018-10-18 16:05:33 +03:00
Matthew Runo
374eec04d4 KT-27445: Add QuickFix for DEPRECATED_JAVA_ANNOTATION compiler warning 2018-10-18 15:56:15 +03:00
Mikhail Glukhikh
570c770d58 MPP web wizard: integrate Ktor inside #KT-27491 Fixed 2018-10-18 15:16:46 +03:00
Mikhail Glukhikh
c770a80ab9 MPP wizard tests: run Native tests using correct task name 2018-10-18 15:16:46 +03:00
Anton Bannykh
3a105debb3 [JS IR BE] fix default arguments lowering 2018-10-18 14:25:48 +03:00
Anton Bannykh
e9c932260c [JS IR BE] minor refactoring 2018-10-18 14:25:48 +03:00
Anton Bannykh
29ff4d6677 [JS IR BE]: Disable incremental compilation tests until IC is supported 2018-10-18 14:24:05 +03:00
Anton Bannykh
995ac7aac2 [JS IR BE]: make deleteProperty non-inline due to new inliner limitations 2018-10-18 14:24:05 +03:00
Dmitry Savvinov
e2bf43c54f Minor: update testdata in ClsStubBuilder test on contracts 2018-10-18 13:15:05 +03:00
Alexander Udalov
5fb1bbe3f3 Add bytecode listing test on private default setter
Also fix test data of the kotlinp test and remove the newly added test
case in the obsolete PropertyGenTest

 #KT-20344 Fixed
2018-10-18 12:13:22 +02:00
Fabian Mastenbroek
05f6ed40f1 Don't generate setters for trivial private property setters
This change will prevent the compiler for generating Java bytecode for
private property setters that are trivial.

Since Kotlin uses direct field access for private properties, it will result
in the private setter never been used and since it cannot be accessed by any
other class without reflection, the setter cannot be covered by code
coverage tools.

See https://youtrack.jetbrains.com/issue/KT-20344 for the related YouTrack
issue.
2018-10-18 12:05:46 +02:00
Alexander Udalov
b1e82c78da Minor, remove obsolete KtMockFileTypeManager.java.183
This is a continuation of 4f0c31ef
2018-10-18 11:58:30 +02:00
Dmitry Savvinov
7887bafc5b Minor: update testdata in completion test on contracts 2018-10-18 12:09:10 +03:00
Dmitry Petrov
763e72603a Mark implicit 'invoke' calls with origin INVOKE 2018-10-18 10:59:24 +03:00
Dmitry Petrov
ad9953724f Basic infrastructure for psi2ir tests with JS front-end 2018-10-18 10:59:24 +03:00
Mikhail Glukhikh
01091ba1aa Refactor getKotlinTypeWithPossibleSmartCastToFP and related parts 2018-10-18 10:27:19 +03:00
Georgy Bronnikov
bbac1d802f JVM_IR. Support annotation classes with JvmField fields 2018-10-17 21:15:28 +03:00
Georgy Bronnikov
605afbae90 Move fields and init blocks of companions to their owners 2018-10-17 21:15:28 +03:00
Georgy Bronnikov
827494abbe JVM_IR. Mostly remove descriptors from ConstAndJvmFieldPropertiesLowering 2018-10-17 21:15:28 +03:00
Alexander Udalov
6e2e6794aa Remove unnecessary copy of ReflectionTypes
ReflectionTypes was copied from org.jetbrains.kotlin.builtins to
kotlin-native in
https://github.com/JetBrains/kotlin-native/commit/776f4c4b7, and then
was incorrectly copied back in 27365dc4be. This class is in fact only
needed in kotlin-native, where it was moved and simplified in
https://github.com/JetBrains/kotlin-native/commit/c3e921d53
2018-10-17 18:39:50 +02:00
Alexander Udalov
e3a332c393 Configure Java module path when compiler is invoked in -Xbuild-file mode
#KT-27626 Fixed
2018-10-17 18:39:50 +02:00
Alexander Udalov
1a1b7938fb Fix deprecated API usage in RemappingClassBuilder
#KT-25058 Fixed
2018-10-17 18:39:50 +02:00
Alexander Udalov
f868964e25 Fix most unchecked/deprecation javac warnings in compiler modules 2018-10-17 18:39:49 +02:00
Alexander Udalov
4f0c31eff3 Remove unneeded copied mock test framework classes
These classes were copied when tests-common were compiled with JDK 6, to
prevent dependencies on classes compiled with JDK 8
2018-10-17 18:39:49 +02:00
Alexander Udalov
23c210e9f2 Use JvmWildcard on return type of getContributedVariables/getContributedFunctions 2018-10-17 18:39:49 +02:00
Alexander Udalov
9dc53c38f3 Remove deprecated CompilerJarLocator 2018-10-17 18:39:49 +02:00
Alexey Tsvetkov
a44d70e79d Reformat kotlin-gradle-plugin according to code style 2018-10-17 19:31:30 +03:00
romanart
47b8e54f84 Update test data 2018-10-17 18:33:52 +03:00
romanart
d75434ac71 [JS IR BE] Support tailreq in JS 2018-10-17 18:33:52 +03:00
Zalim Bashorov
8ac2582e24 Forward gradle properties with prefix "fd." to test runner as system property("-D") w/o this prefix 2018-10-17 18:29:41 +03:00
Zalim Bashorov
99a131d0ab KJS test infrastructure: cache reference to global object and it's original state instead of evaluate them for each run 2018-10-17 18:29:41 +03:00
Zalim Bashorov
180215f3f8 Don't unmute passed tests by default 2018-10-17 18:29:40 +03:00
Zalim Bashorov
1ef3906481 Minor: reformat and cleanup NashornJsTestChecker.kt 2018-10-17 18:29:40 +03:00
Ingo Kegel
d853fcb642 Do not configure module SDK after the Gradle import if it was set explicitly with the Gradle Idea plugin (fixes KT-27530)
If `kotlinOptions.jdkHome` is set, this will still override the setting from the Gradle Idea plugin.
2018-10-17 17:48:27 +03:00
Alexey Sedunov
06e0fde74f Inspections: Report "unresolved property" only if reference is soft
#KT-27619 Fixed
2018-10-17 17:43:00 +03:00
Alexey Sedunov
0bf9a795aa Minor: Drop "(experimental)" from coroutines label
#KT-25681 Fixed
2018-10-17 17:43:00 +03:00
Dmitry Petrov
b13d270d77 Test: reference to constructor with inline class parameters 2018-10-17 16:38:22 +03:00
Dmitry Petrov
0af2a0dc19 Tests: references to private/internal primary val of inline class 2018-10-17 16:38:22 +03:00
Dmitry Petrov
5032c106af Support 'call' for references to inline class constructors
#KT-26748
2018-10-17 16:38:22 +03:00
Dmitry Petrov
94e1701089 Support 'call' for references to inline class members
This includes overriding and non-overriding functions and properties.

 #KT-26748
2018-10-17 16:38:22 +03:00
Dmitry Petrov
5003388d38 Unbox bound receiver if inline class type expected 2018-10-17 16:38:22 +03:00
Dmitry Petrov
9c7c0c8952 Propagate KotlinType to callable reference receivers 2018-10-17 16:38:22 +03:00
Dmitry Petrov
3dc4d01adc Tests for callable references and inline classes 2018-10-17 16:38:22 +03:00
Dmitry Petrov
8fc6b91f66 Minor: reformat 2018-10-17 16:38:22 +03:00
Dmitry Petrov
9a31e04062 Minor: reformat 2018-10-17 16:38:22 +03:00
Mikhail Glukhikh
0fc2a07ee4 Fix typo in import 2018-10-17 16:36:50 +03:00
Mikhail Glukhikh
94d87bfb67 MPP wizard tests: enable Groovy extension, don't wait for daemon death 2018-10-17 16:33:49 +03:00
Mikhail Glukhikh
02e6fb348d MPP wizard tests: check no empty files are generated 2018-10-17 16:33:47 +03:00
Mikhail Glukhikh
853d90d906 MPP wizard tests: extract test functions into separate class 2018-10-17 16:33:21 +03:00
Mikhail Glukhikh
35d4b7dfd9 MPP wizard tests: temporary fix for "failed to delete" problem 2018-10-17 16:33:19 +03:00
Mikhail Glukhikh
63146b98bb MPP wizard tests: add tests run #KT-27492 Fixed 2018-10-17 16:33:18 +03:00
Mikhail Glukhikh
855e2707e3 MPP wizard test: add project import (KT-27492) 2018-10-17 16:33:17 +03:00
Mikhail Glukhikh
43c8c44441 Add MPP wizard general test (KT-27492) 2018-10-17 16:33:15 +03:00
Mikhail Glukhikh
8281416dfa Introduce explicit plugin versions for MPP builder testing 2018-10-17 16:33:09 +03:00
Mikhail Glukhikh
a16318624b MPP wizards: remove unused module parameter from createProjectSkeleton 2018-10-17 16:33:06 +03:00
Sergey Igushkin
a88bfb726d Fix uninitialized lateinit compilerPluginOptionsTask in non-MPP
When a non-MPP is imported into the IDE, the importer anyway tries to
build the MPP source sets model, so it tries to access the
`compilerPluginArguments` and `compilerPluginClasspath`, resulting in
an import error.

Issue #KT-27646 Fixed
2018-10-17 16:19:16 +03:00
Alexander Udalov
5d040c459b Regenerate tests 2018-10-17 14:05:31 +02:00
romanart
71f109387a Update tests 2018-10-17 14:10:37 +03:00
romanart
6a66663739 Update IR Runtime 2018-10-17 14:10:37 +03:00
romanart
eb2a33ebee [JS IR BE] Implement lowering to connect kotlin Throwable with JS Error 2018-10-17 14:10:37 +03:00
Roman Elizarov
1a86411139 Removed todo from Continuation.context
The design decision was the we would not provide its default impl
2018-10-17 11:59:26 +03:00
Mikhail Zarechenskiy
fe233de825 Report error for Result as an extension receiver with safe call
#KT-27620 Fixed
2018-10-16 19:03:05 +03:00
Dmitriy Dolovov
249bdb969c Fix: K/N interop libs are not read by IDEA in certain cases
Issue #KT-27579 Fixed
2018-10-16 21:32:08 +07:00
Mikhail Glukhikh
2dd8b526fb Live templates test: fix typo & cleanup 2018-10-16 17:17:22 +03:00
Mikhail Glukhikh
0f94c0901f Introduce live templates for main without arguments #KT-27461 Fixed 2018-10-16 17:17:21 +03:00
Pavel V. Talanov
1c761c7864 KotlinJUnitRunConfigurationProducer: do not manually override sdk
Should be correct if the module is correct
Manually setting sdk led to problem in case of android SDK
2018-10-16 15:27:59 +02:00
Pavel V. Talanov
3c3e7b617b KotlinMultiplatformRunLocationsProvider: fix tests in android modules
Android modules are considered to be 'production' but can contain tests
    and test roots

 #KT-27371 In progress
2018-10-16 15:27:58 +02:00
victor.petukhov
a2b7912db9 Add expect and actual modifiers to the grammar (KT-25477) 2018-10-16 16:18:32 +03:00
victor.petukhov
205bd3f829 Replace the invalid rule name element to expression in the collectionLiteral grammar rule 2018-10-16 16:16:18 +03:00
Sergey Igushkin
c25cdb4264 Fix resourcesDir that cannot be imported due to not being a File 2018-10-16 14:30:25 +03:00
Sergey Igushkin
e103bea211 Import compiler plugin options from new MPP into IDE
Issue #KT-27499 Fixed
2018-10-16 14:30:25 +03:00
Sergey Igushkin
7075509b1e Import experimental annotations from new MPP into IDE
Issue #KT-26840 Fixed
2018-10-16 14:30:25 +03:00
Sergey Igushkin
9f2e5cdc4d Propagate the subplugin options from the tasks to the source sets
If a source set is used in only one compilation, take the options from
its compile task.

If a source set is used by multiple compilations of a single target,
either choose the 'main' compilation or choose any (this will happen
for Android, and it looks OK for the first time). If there are multiple
compilations of different targets, use the metadata compilation.

Issue #KT-27499 In Progress
2018-10-16 14:30:24 +03:00
Sergey Igushkin
e573911e16 Fix the format used by Kotlin/Native tasks for compiler plugin args
The correct format is "-P arg1", not "-Parg1".
2018-10-16 14:30:24 +03:00
Sergey Igushkin
ee63a6b3af Don't apply the Android Extensions subplugin to non-Android JVM tasks
In a multiplatform project with both Android and non-Android JVM targets
the subplugin should only affect the tasks of the Android target
2018-10-16 14:30:24 +03:00
Sergey Igushkin
5db23f1a81 Support -Xuse-experimental in the new MPP languageSettings { ... } DSL
Add the corresponding Gradle plugin DSL, consistency checks, and logic
for propagating these settings to the compiler during build.

Issue #KT-26840 In Progress
2018-10-16 14:30:24 +03:00
Sergey Rostov
bde6d841c1 IC: move CacheVersionManager from build_common to jps plugin, tests 2018-10-16 13:33:24 +03:00
Sergey Rostov
0d1f7965d4 JPS, CacheAttributesManager: remove unused methods 2018-10-16 12:29:58 +03:00
Sergey Rostov
d91f6f8c43 IC: move CacheVersionManager from build_common to jps plugin 2018-10-16 12:29:58 +03:00
Sergey Rostov
940861c245 IC: remove CacheVersionManager usages from build_common.
They are kept up to date but was never used.
2018-10-16 12:29:58 +03:00
Sergey Rostov
5232f080d6 JPS: Fix updating cache format version for rebuilt targets by removing i/o optimization
Problem: previously, format-version.txt file was deleted while cleaning
target output on rebuild. Since directory was deleted, cache
attributesDiff stored in memory was not updated. This causes that on
saveExpectedStateIfNeeded does nothing.

The right way to fix it is move cache version format diff into
AbstractIncrementalCache, and override `clean()` method. But this is
hard to do for lookup storage, since used compilers set (jvm/js) will
known only after context init. This can be done by moving `expected`
attributes out of manager, but this is huge change for small benefit.

So, the optimal way for now is to write version for each build, even if
it is not changed.

#KT-27044 Fixed
2018-10-16 12:29:58 +03:00
Alexey Sedunov
cf31e4d58c MPP: Recover content root import accidentally removed earlier 2018-10-16 12:05:19 +03:00
Alexey Sedunov
fea397a2ad MPP: Support MPP-dependent Java modules in Android projects
#KT-27265 Fixed
2018-10-16 12:05:19 +03:00
Alexey Sedunov
dcdd42ba00 MPP: Add Android tests for new MPP 2018-10-16 12:05:19 +03:00
Alexey Sedunov
da06e49b19 MPP: Merge module dependencies if one of them has COMPILE scope 2018-10-16 12:05:18 +03:00
Alexey Sedunov
d36ee02499 Gradle: Retrieve AndroidModuleModel using IdeModifiableModelsProvider
Otherwise it may be null if module is just created by the import
2018-10-16 12:05:18 +03:00
Alexey Sedunov
3a0e539eee MPP: Add MPP source roots to dependent non-MPP module
#KT-27365 Fixed
2018-10-16 12:05:18 +03:00
Alexey Sedunov
558345b057 MPP: Assign TEST scope to dependencies of test source sets
#KT-26868 Fixed
2018-10-16 12:05:17 +03:00
Alexey Sedunov
523b662680 MPP: Update Kotlin version in tests to 1.3-RC3 2018-10-16 12:05:17 +03:00
Alexey Sedunov
abec171685 Native: Register '.klib' extension through FileTypeFactory 2018-10-16 12:05:17 +03:00
Alexey Sedunov
ca2367f2b5 MPP: Rewrite ImportedModule name instead of wrapping it
Otherwise this instance is not deserialized properly
breaking import on opening project in AS

 #KT-27485 Fixed
 #KT-27473 Fixed
2018-10-16 12:05:17 +03:00
Denis Zharkov
bda1ef8d57 Do not run bytecode optimization passes for in bodyless modes
FunctionsFromAnyGeneratorImpl has been changed because previously
it didn't satisfy annotation visitor contract but it wasn't important
for MethodNode
2018-10-16 11:16:53 +03:00
Denis Zharkov
26da0b9e7e Do not call default constructor of SourceInterpreter in subclasses
It became illegal since asm-6.x

See c72a86bd5f/asm-analysis/src/main/java/org/objectweb/asm/tree/analysis/SourceInterpreter.java (L56)

 #KT-27572 Fixed
2018-10-16 11:16:53 +03:00
Valentin Kipyatkov
c63eb18b3c Fixed nested class in companion object case 2018-10-16 08:41:43 +03:00
Valentin Kipyatkov
28e2683146 One more test 2018-10-16 08:41:42 +03:00
Valentin Kipyatkov
69f74b2a51 Fixed ShortenReferences for extension on companion object 2018-10-16 08:41:42 +03:00
Valentin Kipyatkov
d4e0f53583 Fixed ShortenReferences for the case of extension for object 2018-10-16 08:41:42 +03:00
Dmitriy Dolovov
840ee66fd0 MPP Wizards: Clearer notation in generated build.gradle files
- Follow the same style as used in public documentation: https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html
- Use standard methods to get link task name, don't evaluate it manually
2018-10-16 10:20:06 +07:00
Georgy Bronnikov
4942ed5e7a Clean up backend.common.ir.IrUtils.kt 2018-10-15 21:52:50 +03:00
Georgy Bronnikov
376eef05f5 JVM_IR. Accessor lowering 2018-10-15 21:52:50 +03:00
Georgy Bronnikov
a23aae590e JVM_IR. Avoid unbound symbols and declarations without parent 2018-10-15 21:52:50 +03:00
Toshiaki Kameyama
9b49c23668 Move lambda out: don't report in delegation #KT-27584 Fixed 2018-10-15 19:52:10 +03:00
Pavel Punegov
8ea8acc7f7 Set target backend to JVM for tests that have @JvmStatic annotations 2018-10-15 19:25:03 +03:00
Pavel Punegov
ed64d42d45 Regenerate JS tests 2018-10-15 19:25:02 +03:00
Pavel Punegov
eb6580acdd Return native ignore back.
K/N doesn't initialize companion objects if no methods were called from them
2018-10-15 19:25:02 +03:00
Pavel Punegov
d9a8a00069 Make tests that use jvm-annotations be targeted to jvm backend 2018-10-15 19:25:02 +03:00
Pavel V. Talanov
8be3e902a8 ResolutionFacadeWithDebugInfo: do not wrap index not ready exception
Fixes problems where `catch (IndexNotReadyException)` blocks
    in IDEA code would not work
2018-10-15 15:10:50 +02:00
Pavel Punegov
aab28e6cc7 Revert "Make coroutines test JVM-only"
This reverts commit 17b7bbce
2018-10-15 13:52:16 +03:00
Natalia Selezneva
648e8acbde Update testdata after the fix of KT-27095
(replace http with https configuring gradle project)
2018-10-15 12:28:43 +03:00
Dmitry Petrov
b6be72bb11 Add more tests for inline classes
#KT-27416
 #KT-27513
2018-10-15 12:21:14 +03:00
Dmitry Petrov
0fd68d29f4 Support @JvmStatic in inline class companion object
#KT-27107
2018-10-15 12:21:14 +03:00
Dmitry Petrov
5304754e88 Generate specialized 'toString' for inline classes when possible
#KT-25613
2018-10-15 12:21:14 +03:00
Dmitry Petrov
f68ce4b35b Support default parameter values for inline class constructors and funs
#KT-26908
 #KT-26554

Move default parameter value tests to separate directory
2018-10-15 12:21:14 +03:00
Dmitry Petrov
8ce1d09f8a Fix inline class coercion in default parameter values
#KT-27358
2018-10-15 12:21:14 +03:00
Natalia Selezneva
c2315f065a Add test for script definitions settings 2018-10-15 11:32:49 +03:00
Natalia Selezneva
71e72ec6c2 Add button to open script settings from Multiple script definition notification 2018-10-15 11:32:49 +03:00
Natalia Selezneva
6596a6ba75 Allow to switch off script definitions
^KT-24465 Fixed
2018-10-15 11:32:48 +03:00
Natalia Selezneva
7826f44180 Save ScriptDefinitions order into kotlinScripting.xml
^KT-24465 In Progress
2018-10-15 11:32:48 +03:00
Natalia Selezneva
77e687df92 Change base class for ErrorGradleScriptDefinition (migrate to new API) 2018-10-15 11:32:48 +03:00
Natalia Selezneva
3f20453ccf Do not create multiple ErrorGradleScriptDefinitions 2018-10-15 11:32:48 +03:00
Natalia Selezneva
9ab4d727e9 Provide UI for changing the order of script definitions applicability
^KT-24465 In Progress
2018-10-15 11:32:47 +03:00
Natalia Selezneva
2df8adc50b Move option for auto-reloading script dependencies to 'Kotlin Scripting' page 2018-10-15 11:32:47 +03:00
Natalia Selezneva
54f3982709 Add 'Kotlin Scripting' configuration tab
^KT-24465 In Progress
2018-10-15 11:32:47 +03:00
Natalia Selezneva
02c1ae62c3 Show notification if there are more than one script definition applicable for one script file (KT-24466)
^KT-24466 Fixed
2018-10-15 11:32:47 +03:00
Dmitry Savvinov
99e1d4ab45 Check for the presence of dispatch receiver too in isEqualsDescriptor()
Otherwise, top-level function with the name 'equals' and suitable
signature will be (erroneously) treated as true 'equals' invocation,
leading to further exception (see EA-126602)
2018-10-15 10:54:39 +03:00
Natalia Selezneva
28e43b0487 Indexes should be updated if there are new dependencies for script file
KT-26271 Fixed
2018-10-15 09:43:49 +03:00
Natalia Selezneva
c4aab8340b Do not store script definition in psiFile
This may cause problems when definitions are reordered or switched off
KT-27375 Fixed
2018-10-15 09:43:49 +03:00
Svyatoslav Kuzmich
02277d0293 [JS IR BE] ExpectDeclarationsRemoving lowering
* Copy lowering from konan to common
* Keep actual default parameters when both actual and expect default parameters are present
* Run lowering before inline in JS IR BE to fix
  box/multiplatform/defaultArguments/inlineFunctionWithDefaultLambda.kt
2018-10-15 00:03:46 +03:00
Svyatoslav Kuzmich
4c38d55f21 [JS IR BE] Unmute tests 2018-10-15 00:03:45 +03:00
Svyatoslav Kuzmich
5a057f8ca6 [JS IR BE] Support 'is Number' and 'is Comparable<>' 2018-10-14 23:53:03 +03:00
Svyatoslav Kuzmich
783f27c554 [JS IR BE] Support Number.to(Byte|Short|Int|Float|Double|Long) 2018-10-14 23:53:03 +03:00
Svyatoslav Kuzmich
bad9534abd [JS IR BE] Support integer operation overflow 2018-10-14 23:53:02 +03:00
Zalim Bashorov
8013a56286 [JS IR BE] process empty loops correctly in BlockDecomposerLowering 2018-10-13 01:51:59 +03:00
Zalim Bashorov
6d592ae66b Unmute tests 2018-10-13 01:51:59 +03:00
Zalim Bashorov
dfc3bda3b4 Minor: remove forgotten "TODO" 2018-10-13 01:51:58 +03:00
Nikolay Krasko
ea9d4037e6 Minor: cleanup KotlinLightCodeInsightFixtureTestCase.kt 2018-10-12 18:50:06 +03:00
Nikolay Krasko
d8fda8b153 Tests for navigation to stdlib multiplatform sources (KT-26004)
#KT-26004 Fixed
2018-10-12 18:50:05 +03:00
Nikolay Krasko
e3d930a6a1 Build maven-like stdlib sources artifacts during dist
This is needed to emulate gradle and maven like projects in plugin tests.
2018-10-12 18:50:04 +03:00
Nikolay Krasko
ac2bc22f54 Use information from stub for contracts presence 2018-10-12 18:21:39 +03:00
Nikolay Krasko
d3ec145f13 Fixes for ReplaceArraysCopyOfWithCopyOfInspection
- Reduce applicability range
- Don't fix reporting level, otherwise it won't be possible to change
  it in settings
- Using isCalling utility
2018-10-12 18:21:38 +03:00
kenji tomita
e6de8e9cd3 Inspection to convert Arrays.copyOf(a, size) to a.copyOf(size) 2018-10-12 18:21:36 +03:00
Nikolay Krasko
fc4f7303d3 Disable highlighting for decompiled Kotlin files (KT-27284)
#KT-27284 Fixed
2018-10-12 18:21:35 +03:00
victor.petukhov
b86211b434 Add spec tests for integer literals 2018-10-12 17:31:24 +03:00
Natalia Selezneva
4f04d4503a Highlight files in diff view (KT-17892)
KT-17892 Fixed
2018-10-12 15:27:46 +03:00
Natalia Selezneva
db0021718f Set since-build for Idea 182 and AS 3.3 to 182.4323.46 2018-10-12 15:27:46 +03:00
Natalia Selezneva
605396f9e2 Update idea to 2018.2.3 (182.4323.46) 2018-10-12 15:27:46 +03:00
Natalia Selezneva
6bddf36725 Update as33 branch to AS3.3 canary 12 2018-10-12 15:27:46 +03:00
Natalia Selezneva
3744a00f77 Run Kotlin Scratch in the background cancelable task (KT-25032)
KT-25032 Fixed
2018-10-12 15:27:46 +03:00
Natalia Selezneva
00e0f430ac Add shortcut and menu item for Run Scratch Action (KT-24180)
KT-24180 Fixed
2018-10-12 15:27:45 +03:00
Natalia Selezneva
af2235fd1d Fix compatibility with anko plugin 2018-10-12 15:27:45 +03:00
Natalia Selezneva
c73885142a Do not access stubs in dumb mode finding script definition 2018-10-12 15:27:45 +03:00
Natalia Selezneva
daa6e9b562 Minor: reformat and rearrange code 2018-10-12 15:27:45 +03:00
Ilmir Usmanov
a5bcd3495e Simplify tail-call optimisation check
Check, that all suspension points are immediately followed by ARETURN
and do not check that all these ARETURNs are immediately preceded by
suspension points.
 #KT-27190 Fixed
2018-10-12 15:10:12 +03:00
Vyacheslav Gerasimov
d11fbac511 Build: Use cache-redirector.jetbrains.com to prevent connection timeouts 2018-10-12 14:57:37 +03:00
Yan Zhulanow
a8aab3fbe5 as33: Remove declaration of the KotlinAndroidGradleOrderEnumerationHandler extension from as33 (KT-26975)
'idea-android' module is not put into the plugin made for Android Studio 3.3 as it has its own copy of 'idea-android'.
2018-10-12 14:50:53 +03:00
Ilmir Usmanov
e21159c28f Report suspension point in monitor error on crossinline lambdas
#KT-27258: Fixed
2018-10-12 14:21:42 +03:00
Zalim Bashorov
3f0bd20235 Add an ability to run/debug ir tests inside node.js (even from IDEA) 2018-10-12 13:57:03 +03:00
Mikhail Zarechenskiy
b7d7d1eb01 Fix inline class type coercion in == with generic call
#KT-27393 Fixed
2018-10-12 12:50:49 +03:00
Mikhail Zarechenskiy
0201694f84 Propagate KotlinType into create method for coroutines
#KT-27526 Fixed
2018-10-12 12:50:47 +03:00
Mikhail Zarechenskiy
a8abd8cceb Fix boxing/unboxing for generic functions on index expressions
Unsubstituted type should be used for coercion to box value of
 inline class type if it's needed. For the substituted value it's not
 known if it was a generic parameter or not.

 #KT-27502 Fixed
2018-10-12 11:58:56 +03:00
Nikolay Krasko
882a12d916 Exit if it's impossible to create file during copy/past (KT-26210)
#KT-26210 Fixed
2018-10-12 11:48:49 +03:00
Toshiaki Kameyama
749fd5dd80 "Convert property to function" intention: don't suggest if property has @JvmField annotation #KT-27157 Fixed 2018-10-11 21:01:27 +03:00
Toshiaki Kameyama
487b1e96be "Introduce backing property" intention: don't suggest if property has @JvmField annotation #KT-27156 Fixed 2018-10-11 21:00:44 +03:00
Toshiaki Kameyama
ca335880eb "Convert property initializer to getter" intention: don't suggest if property has @JvmField annotation #KT-27139 Fixed 2018-10-11 20:59:33 +03:00
Toshiaki Kameyama
3866c85a34 Add accessor intention: don't suggest if property has @JvmField annotation #KT-27139 Fixed 2018-10-11 20:59:33 +03:00
Ilya Gorbunov
27dc160aef Rename Random companion object to Default
#KT-27508
2018-10-11 19:06:12 +03:00
Sergey Igushkin
81b4031a35 Remove internal Gradle API usage for stale output cleanup
BuildOutputCleanupRegistry tracks the all of the outputs that belong to
the Gradle build, so when Gradle runs in an unknown state (e.g. without
any history), it can detect stale outputs in the output directories and
delete them.

Since this is an internal API, its usage is removed. Instead, another
way to tell Gradle that a set of directories belongs to the build is to
add them to the `delete` task targets.
2018-10-11 19:01:53 +03:00
Sergey Igushkin
a0f4d5a637 Get rid of FileCollectionInternal usage that breaks with Gradle 5.0+
Remove the implementation of the `FileCollectionInternal` interface in
`KotlinCompilationOutput`. This interface may change unexpectedly (and
does between Gradle 4.10 and 5.0) so we need to get rid of its
implementation.

On the other hand, we can't just implement `FileCollection` instead
because Gradle internally assumes that all `FileCollection` instances
are also `FileCollectionInternal`. So the way to fix this is to remove
`SourceSetOutput` from superinterfaces of `KotlinCompilationOutput`
altogether.

Instead, to work with `SourceSetOutput` and `KotlinCompilationOutput`
in a uniform way, provide a wrapper for `SourceSetOutput`:
`KotlinWithJavaCompilationOutput` that is basically a proxy
class.
2018-10-11 19:01:52 +03:00
Alexey Sedunov
174fd41564 Rename: Restore project scope (fixing failing tests)
It fixes search of usages for some cases where element's useScope()
is not enough (like parameter references in named arguments)
2018-10-11 17:56:27 +03:00
Alexey Sedunov
84d9f8250c Configuration: Ensure facet UI is initialized in apply() call
#KT-27187 Fixed
2018-10-11 17:56:27 +03:00
Alexey Sedunov
3fcf6e7719 Change Signature: Clear callback after the call
Retaining the callback leads to the leak of obsolete resolve data
2018-10-11 17:56:27 +03:00
Alexey Sedunov
c3af3cc482 Configuration: Do not use read action during conpiler settings loading
It may lead to deadlock (see KT-27298)

 #KT-27298 Fixed
2018-10-11 17:56:27 +03:00
Alexey Sedunov
26d77183df Misc: Update repository URLs in importer test data 2018-10-11 17:56:27 +03:00
Alexey Sedunov
7553fd2766 Misc: Disable some tests for recent Gradle versions
Old-style MPP doesn't work there due to ExternalProject not being built
2018-10-11 17:56:26 +03:00
Toshiaki Kameyama
061aa63a73 "Make private" intention: fix some false positive cases 2018-10-11 17:20:46 +03:00
Mikhail Glukhikh
7488056249 Use 'canBeInternal' in ChangeVisibilityFix (related to KT-27138) 2018-10-11 17:20:30 +03:00
Toshiaki Kameyama
c65e246e02 Make private: don't suggest if property has @JvmField annotation
#KT-27138 Fixed
2018-10-11 17:20:13 +03:00
Mikhail Glukhikh
248e09ff2c Refactoring: ConstantConditionIfInspection
Transform collectFixesAndRegisterProblem to just collectFixes
2018-10-11 17:19:55 +03:00
Toshiaki Kameyama
5c83c247d7 "Simplify comparison": remove if when possible after applying quickfix
#KT-25995 Fixed
2018-10-11 17:19:10 +03:00
Mikhail Glukhikh
688fc386b6 Refactoring: introduce resolve to property descriptor 2018-10-11 17:14:17 +03:00
Mikhail Glukhikh
b08f966428 Use kotlin-stdlib instead of kotlin-stdlib-jdk8 in MPP mobile wizard
#KT-27356 Fixed
2018-10-11 17:12:31 +03:00
Mikhail Glukhikh
42888572cb MPP wizards: generate different file names to avoid KT-21186
#KT-27456 Fixed
2018-10-11 17:11:44 +03:00
Anton Bannykh
8852ef9e75 [JS IR BE] fix multimodule 2018-10-11 16:02:21 +03:00
Zalim Bashorov
9041d717a2 [JS IR BE] add IrType.asString that return stable string representation to use it for stringified signatures
`IrType.render` was used before, but it's written for debugging purpose and generates unstable string representation.
2018-10-11 14:54:55 +03:00
Ilmir Usmanov
c4d0b5493a Fix NPE in suspension point in monitor call checker
#KT-27484 Fixed
2018-10-11 14:38:34 +03:00
Denis Zharkov
36c73eedbf Minor. Move DslMarkerOnFunctionTypeReceiver entry closer to 1.4 features 2018-10-11 10:23:02 +03:00
Denis Zharkov
75dc8ce1c3 Fix exception in light classes when type alias in MultifileClass
#KT-27355 Fixed
2018-10-11 10:22:09 +03:00
Toshiaki Kameyama
dc750cdbb3 Call chain into sequence: add 'unzip' to conversion targets #KT-27486 Fixed 2018-10-11 09:18:30 +03:00
Toshiaki Kameyama
3f252b15e1 Call chain into sequence: add 'flatten' to conversion targets #KT-26969 Fixed 2018-10-11 09:17:23 +03:00
Nikolay Krasko
bd27460694 Prevent IDEA attach debugger to serialize task
Workaround for IDEA-200192

IDEA patches JavaExec tasks and adds
agentlib:jdwp= jvm parameter when running under debug.

Replace parameters after IDEA has finished patching parameters.
2018-10-10 20:58:00 +03:00
Svyatoslav Kuzmich
7074909230 [JS IR BE] Support enumValues<T>() and enumValueOf<T>(name) 2018-10-10 19:35:17 +03:00
Svyatoslav Kuzmich
bdc3daf972 [JS IR BE] Support Enum::values 2018-10-10 19:35:17 +03:00
Svyatoslav Kuzmich
0210ec3114 [JS BE] Fix KT-26787: handle JsSwitch in LabeledBlockToDoWhileTransformation 2018-10-10 19:35:16 +03:00
Pavel Punegov
f543170998 Increase tolerance for Float asin test 2018-10-10 19:05:44 +03:00
Sergey Bogolepov
2f1f32bbf4 Replace random val in companion object with top level val 2018-10-10 19:04:55 +03:00
Pavel Punegov
17b7bbce8c Make coroutines test JVM-only 2018-10-10 19:04:31 +03:00
Pavel Punegov
3dd16da315 Fix vararg test for native that assigns named argument.
Ignore test that uses nested class in enum in native
2018-10-10 19:03:56 +03:00
Pavel Punegov
dd1c9fa9f0 Native: Ignore tests that use reflection not implemented in native 2018-10-10 19:01:35 +03:00
Pavel Punegov
82b59c5044 Native: Ignore tests that use jvm or full reflect 2018-10-10 19:00:50 +03:00
Svyatoslav Kuzmich
89f7ced0d4 [JS IR BE] Unmute tests 2018-10-10 17:27:37 +03:00
Svyatoslav Kuzmich
e73ff16b35 [JS IR BE] Refactor: split IntrinsicifyCallsLowering into multiple classes 2018-10-10 17:27:37 +03:00
Svyatoslav Kuzmich
749556f565 [JS IR BE] Support Long coercion 2018-10-10 17:27:37 +03:00
Svyatoslav Kuzmich
c7bde6a5e6 [JS IR BE] Fix runtime compareTo(Number, Long) 2018-10-10 17:27:36 +03:00
Anton Bannykh
44d56cb278 JS: fix val with backing field initialization in secondary constructors
This change reverts the AssignmentTranslator logic to a previous state
of "if we assign to a val, tranlate to backing field". Previously a
check whether or not we are inside of a constructor was added. The
check didn't detect secondary constructors, hence initializing of
val's with backing field started to work incorrectly.

The check itself was added in an attempt to prevent augmented assignment
operators to reference the backing field. The check seems to have been
wrong, because an augmented assignment could happen inside a construcotr.
A more correct fix was added later. It seems that it is safe now to
revert the logic back and rely on the frontend to only allow assignment
to a val property during initilization.
2018-10-10 17:25:55 +03:00
Mikhail Glukhikh
6be65e7d1a Replace equals with == involving FP types: handle possible smart casts
This fixes two relevant tests with smart casts
#KT-25933 Fixed
2018-10-10 15:02:47 +03:00
Mikhail Glukhikh
04cadf3f58 Reformat ReplaceCallWithBinaryOperator 2018-10-10 15:02:45 +03:00
kenji tomita
1aa9d5673b Do not highlight replacement of equals involving floating-point types
Two tests with smart casts do not work yet
Part of KT-25933
2018-10-10 15:02:43 +03:00
Anton Bannykh
8c6337f3f6 [JS IR BE]: support dynamic_var["foo"] = "bar"
Used EQ origin to detect. Added a test to check dynamic_var = "bar" case
is not affected
2018-10-10 13:43:22 +03:00
Anton Bannykh
7afb81a7df JVM_IR: fix ranges' test generator 2018-10-10 13:13:36 +03:00
Ilya Chernikov
7fbfad814e Fix default host configuration property - make it not shared:
Shared instance is incorrect here and causes clashes when many
definitions are loaded in the same process.
Also make the diagnostics in case of clashes more verbose.
2018-10-10 10:53:57 +02:00
John Eismeier
ac69fa14d5 Is the Interface with out the f a type? 2018-10-10 09:44:10 +03:00
Ilmir Usmanov
9af7316845 Add call checker to report error more granulary if possible
This, however, works only for calls of 'synchronized' only. Thus, it
does not support inline functions of any kind.
2018-10-09 22:55:51 +03:00
Ilmir Usmanov
281f09f077 Rework check of suspension point inside critical section
There is a trade-off between robustness of check and accuracy of the
diagnostic: the previous version, which works on generation, was too
fragile and lead to false-positives. Now we check on state machine
generation. However, since we do not have PSI for call, we can only
report diagnostic on whole suspend function or suspend lambda.
Additionally, the state machine is generated on crossinline suspend
lambdas regeneration and thus we do not have the PSI for the lambda as
well!

 #KT-27130 Fixed
 #KT-27258 Open
2018-10-09 22:55:48 +03:00
Ilmir Usmanov
1b04945625 Revert: Forbid suspension points in critical sections 2018-10-09 22:55:43 +03:00
Vyacheslav Gerasimov
37a88fda78 Build: Remove shadow jar task from custom-deps/intellij-sdk project 2018-10-09 20:48:27 +03:00
Vyacheslav Gerasimov
78d4abf954 Build: set version for build-scan plugin to 1.15 since 1.16 fails with NPE 2018-10-09 20:27:15 +03:00
Sergey Igushkin
294bd8c7fa Fix resolution of Java Usage artifacts for configurations with no usage
When Gradle resolves a dependency on a publication with no metadata
(or with metadata disabled), it represents it as two variants, one with
Usage `java-api`, the other with `java-runtime`. It turns out that the
`java-api` one does not contain transitive dependencies with Maven scope
`runtime`.

This commit makes the Kotlin Gradle plugin disambiguation rules behave
the same way as those defined in the JavaBasePlugin: when no Usage is
requested, prefer the runtime usages as they are more complete.
2018-10-09 19:17:36 +03:00
Sergey Igushkin
748dc203e5 Fix unresolved library with 'java-api' and 'java-runtime' usages 2018-10-09 19:17:36 +03:00
romanart
d77a0f109b Update tests 2018-10-09 15:33:04 +03:00
romanart
5af114da07 Add unit into compilation 2018-10-09 15:33:03 +03:00
romanart
9b40981368 [JS IR BE] Unit Materialization lowering
Fix unit-related things across backend
2018-10-09 15:32:52 +03:00
Toshiaki Kameyama
57ae60e9dc "Add else branch" on when quickfix: don't add braces #KT-5088 Fixed 2018-10-09 12:28:08 +03:00
Toshiaki Kameyama
f22133be7e Call chain into sequence refactoring: introduce & use isIterable
Related to KT-26650
2018-10-09 12:22:19 +03:00
Toshiaki Kameyama
416d33fc92 Refactoring: extract KtCallExpression.isCall(FqName) function 2018-10-09 12:22:18 +03:00
Toshiaki Kameyama
9a725b99b2 Call chain into sequence: fix false negative on Iterable
#KT-26650 Fixed
2018-10-09 12:22:17 +03:00
Mikhail Glukhikh
2e5ee242c7 Minor refactoring: implicitVisibility 2018-10-09 11:50:21 +03:00
Toshiaki Kameyama
3be5f2b843 "Redundant visibility": Fix false positive for overridden setter
#KT-26051 Fixed
2018-10-09 11:48:00 +03:00
Toshiaki Kameyama
1c8e75eb34 if then to elvis: propose transformation to 'let' #KT-26653 Fixed 2018-10-09 11:41:06 +03:00
Toshiaki Kameyama
539c55c5b2 Call chain into sequence: fix false negative on implicit receiver
Part of KT-26650
2018-10-09 11:33:55 +03:00
Mikhail Glukhikh
0285cae2fd Minor: introduce 'lazyTerminations' in Call chain --> Sequence
Related to KT-27104
2018-10-09 11:32:25 +03:00
Toshiaki Kameyama
8fc5fefc7f Call chain --> Sequence: don't report if first call is 'groupingBy'
#KT-27104 Fixed
2018-10-09 11:26:50 +03:00
Mikhail Glukhikh
b500239bd1 Call chain -> sequence: minor style fix 2018-10-09 11:09:58 +03:00
Toshiaki Kameyama
3c75dd7b5a Fix inspection message 2018-10-09 11:09:43 +03:00
Toshiaki Kameyama
920c200693 Call chain --> Sequence: introduce "call chain length" parameter
#KT-26571 Fixed
2018-10-09 11:09:28 +03:00
Mikhail Glukhikh
a43be4cbe8 Fix testNotPossible (no more conversion to secondary constructor) 2018-10-09 11:08:37 +03:00
victor.petukhov
c01362a943 Fix path separators for Windows in spec test validator 2018-10-09 10:00:07 +03:00
victor.petukhov
4ee0a666cb Temporary mute test with FrontEndException (KT-26386) 2018-10-09 09:59:56 +03:00
victor.petukhov
f61980732b Mute tests with unexpected behaviour 2018-10-09 09:59:46 +03:00
victor.petukhov
e90cf4b955 Actualize test with return expression in contract description (implies) 2018-10-09 09:59:35 +03:00
victor.petukhov
4a372458d6 Include part of the spec tests to the compiler dist tests 2018-10-09 09:59:20 +03:00
Ilya Matveev
85ba5f11d6 Add configuration methods for kotlinOptions in K/N tasks
Issue #KT-26758 fixed.
2018-10-08 17:44:32 +03:00
Ilya Matveev
ee5bc95da5 Fix up-to-date checks for framework compilation 2018-10-08 17:44:32 +03:00
Ilya Matveev
73138073f1 Take K/N version into account in UP-TO-DATE checks for cinterop tasks 2018-10-08 17:44:32 +03:00
Alex Saveau
524ae9df7d Fix bugs causing early task evaluation (#1812)
* Fix bugs causing early task evaluation

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix another call forcing tasks evaluation  Add a test for lazy tasks
2018-10-08 14:07:22 +03:00
James Wald
b7d0d20739 Fix typo in expression precedence table 2018-10-08 14:00:51 +03:00
Nikolay Krasko
1aab3c890c Minor: fix typo 2018-10-08 13:40:29 +03:00
Alexey Belkov
f3bb952148 Remove useless code to determine default visibility 2018-10-08 13:40:28 +03:00
Nikolay Krasko
daf6036bc0 Update Android Studio 3.3 dependency to 3.3.0.10 2018-10-08 13:40:27 +03:00
Nikolay Krasko
76a3f23df0 Test for stubs of extension/non-extension properties with same name (KT-27274)
An issue was probably fixed in 98232265d7

 #KT-27274 Fixed
2018-10-08 13:40:25 +03:00
Toshiaki Kameyama
b0c3461eab Add quickfix for ASSIGN_OPERATOR_AMBIGUITY on mutable collection '+=', '-='
KT-26236 Fixed
2018-10-05 15:58:39 +03:00
Toshiaki Kameyama
725cb88f41 Add quick-fix to "Unlabeled return inside lambda" inspection #KT-27007 Fixed 2018-10-05 10:01:31 +02:00
Vyacheslav Gerasimov
d7b885159e Revert Workaround IndexOuOfBoundsException on configuration with gradle 4.7 2018-10-04 18:28:16 +03:00
Toshiaki Kameyama
f4a637a72e "Convert object literal to lambda" inspection: report at INFORMATION level if object literal has 'return' #KT-27116 Fixed 2018-10-04 13:13:52 +02:00
Toshiaki Kameyama
23734bae3e Add quickfix for DECLARATION_CANT_BE_INLINED #KT-9983 Fixed 2018-10-04 13:11:36 +02:00
Toshiaki Kameyama
c44d3a8d68 Show lambda parameter info #KT-13118 Fixed 2018-10-03 19:08:56 +03:00
victor.petukhov
30fc76a602 Remove redundant directives to contracts use 2018-10-03 13:49:32 +03:00
victor.petukhov
4819223b74 Add generated codegen box tests for Boolean literals as identifiers 2018-10-03 13:49:31 +03:00
victor.petukhov
1bc0c4092c Add codegen box test templates for identifiers 2018-10-03 13:49:30 +03:00
victor.petukhov
dd91727a78 Add generated PSI tests for Boolean literals as identifiers 2018-10-03 13:49:22 +03:00
victor.petukhov
ed73513d48 Add PSI test templates for identifiers 2018-10-03 13:49:20 +03:00
victor.petukhov
4bfa90dc25 Refactor files in the 'spec' package 2018-10-03 13:49:11 +03:00
victor.petukhov
45c5a168a3 Implement feature interaction tests generator based on templates 2018-10-03 13:48:22 +03:00
victor.petukhov
6f95e4ae3b Add codegen box spec tests support 2018-10-03 13:29:25 +03:00
victor.petukhov
8538866778 Add few tests for contracts
- Contracts in getter/setter (unexpected behaviour)
- Check smartcasts when non-null assertion for a contract function is used
- Check work of contracts when type parameter of the callsInPlace is specify explicitly
- Check smartcasts working if type checking for contract function is used
2018-10-03 13:29:13 +03:00
victor.petukhov
ecb3f10e47 Add 'mute' concept: move tests with unexpected behaviour to the corresponding folder 2018-10-03 13:26:37 +03:00
victor.petukhov
84dc28374c Add multilevel sections support and corresponding renaming 2018-10-03 13:26:29 +03:00
Ilya Gorbunov
2c313e12e5 Rewrite builtin serialization task as JavaExec
Add standard clean, assemble, build tasks by applying base plugin.
Clean outputs in dist/builtins on clean.
2018-10-03 11:51:30 +03:00
Dmitry Petrov
b55b0c1ff1 Support local property delegation to inline class values
Also, add extra test on property delegation.
2018-10-03 11:09:48 +03:00
Dmitry Petrov
6fa436911a Support interface delegation to inline class values (KT-27318) 2018-10-03 11:09:47 +03:00
Dmitry Petrov
5480bf69e8 Support property delegation to inline class values (KT-27070) 2018-10-03 11:09:46 +03:00
Dmitry Petrov
70e60ea9bc Fix inline class coercion in string template with StringBuilder.append
Inline class values with array as a carrier type were not boxed.

 #KT-27113
2018-10-03 11:09:41 +03:00
kenji tomita
6532916dd2 Change necessary labels in "Call on collection type may be reduced"
#KT-24492 Fixed
2018-10-03 08:00:40 +02:00
Toshiaki Kameyama
5e7d974767 "Make open": Fix false positive for data class inheritance #KT-27354 Fixed 2018-10-03 08:53:03 +03:00
Yan Zhulanow
6d73aa29e0 Pill: Understand dependencies with the 'apiElements' configuration name as module dependencies 2018-10-02 20:03:01 +03:00
Dmitry Petrov
813e4c966a Update testData for constant initializers in IR 2018-10-02 17:08:55 +03:00
Dmitry Petrov
189b05f8a4 Update testData for public API: companion field visibility in 1.3 2018-10-02 16:20:09 +03:00
Nikolay Krasko
02fbb03d6a Show migration when changes are in kts files or inside buildSrc dir (KT-27329)
#KT-27329 Fixed
2018-10-02 16:05:18 +03:00
Nikolay Krasko
d756d93af1 Better coroutines versions update (KT-27351)
- It was decided to update coroutines to 1.0.0 not to 0.30.0 for 1.3
- Always update to 0.27.0-eap13 coroutines for versions before 0.27.0

 #KT-27351 Fixed
2018-10-02 15:54:10 +03:00
Dmitry Petrov
8891733074 Generate const val initializers as IrConst expressions 2018-10-02 13:46:37 +03:00
Mikhail Glukhikh
75b27f890a Fix tests in mobile shared library wizard #KT-27335 Fixed 2018-10-02 13:08:45 +03:00
Mikhael Bogdanov
4fb434c0de Move out jvm-specific part from ir-common
#KT-27005 Fixed
2018-10-02 11:12:21 +02:00
victor.petukhov
023e4e3a0e Actualize tests after KT-27260 fix 2018-10-02 11:49:10 +03:00
Alexey Sedunov
b5d3520db9 MPP: Add MPP sources roots to dependent Android module
#KT-27331 Fixed
2018-10-02 11:18:09 +03:00
Dmitry Savvinov
62edf29cbf Use DataFlowValue instead of Descriptor for equality of ESDataFlowValue
Equality of those values is crucial for intersecting data-flow info
coming from expressions like: 'this.x != null || other.x != null'.

Using 'ValueDescriptor' for equality is obviously wrong, because then 'this.x'
and 'other.x' will be treated as equal, leading to unsound smartcasts.

This commit adds proper overload of 'equals' to 'ESDataFlowValue' that
will compare them based on underlying 'DataFlowValue' (which already
distinguish those values)

^KT-27260 Fixed
2018-10-02 11:05:06 +03:00
Dmitry Savvinov
dd682bd37d Add test on data-flow
Idea is to intersect similar smartcasts on similar properties coming
from *different* instances (something like
'this.x == null && other.x == null' ).

It checks that we distinguish subjects of such smartcasts properly.

Currently behavior is undesired, see KT-27260
2018-10-02 11:05:06 +03:00
Mikhail Zarechenskiy
e74469fdfc Use mutable lists before deserialization of project structure
The problem is that we perform xml deserialization using intellij
 mechanism which tries to clear target object if it isn't unmodifiable
 (see CollectionBinding.isMutableCollection). This check fails for
 kotlin.EmptyList (emptyList()) which then cause exception

 #KT-27321 Fixed
2018-10-01 19:43:03 +03:00
Ilya Chernikov
da9c486a70 Fix gradle support for non-kts scripts for inter-project dependencies 2018-10-01 18:34:15 +02:00
Ilya Chernikov
c50e880173 Implement more precise diagnostic when a standard script template is missing
adapt quickfix accordingly
#KT-26505 fixed
2018-10-01 18:34:15 +02:00
Ilya Gorbunov
b1c4590537 Override docs of MutableList.add/addAll methods
#KT-25632
2018-10-01 18:09:09 +03:00
Ilya Gorbunov
d6beddaac5 Document the requirement for 'minus(elements)' to have stable hashCode
#KT-24536
2018-10-01 18:09:09 +03:00
Ilya Gorbunov
27beadad18 Summary for new packages: kotlin.coroutines, kotlin.contracts, kotlin.random 2018-10-01 18:03:28 +03:00
Ilya Gorbunov
08822ff14b Document that lines and lineSequence do not preserve line separators 2018-10-01 18:03:23 +03:00
Ilya Gorbunov
21b71f3bb1 Clarify the purpose of the message parameter of assertFailsWith
#KT-22869 Fixed
2018-10-01 18:03:23 +03:00
Ilya Gorbunov
9f9033870c Add a note about non-atomic behavior of MutableMap.getOrPut
#KT-13821
2018-10-01 18:03:23 +03:00
Ilya Gorbunov
bb9e9ac1ee Seeded random docs: add a note about repeatability not being preserved
We're not ready to give a guarantee that the seeded generator
implementation will never change in future versions.
2018-10-01 18:03:23 +03:00
Ilmir Usmanov
896913907b Update bootstap 2018-10-01 17:30:06 +03:00
Alexander Udalov
712c9cbfe6 Minor, mute legacyModOperator.kt for JVM_IR 2018-10-01 16:17:14 +02:00
Alexander Udalov
04ba1cff05 Minor, unmute bothInExpectAndActual.kt for JS_IR 2018-10-01 16:17:14 +02:00
Alexander Udalov
6a6a28f8cd Fix ComponentContainerTest 2018-10-01 16:17:14 +02:00
Vyacheslav Gerasimov
f871e9dc79 Update gradle version to 4.10.2 2018-10-01 16:38:58 +03:00
Vyacheslav Gerasimov
f9cefdaa44 Add to kotlin-plugin.jar js.translator module referenced by serialization 2018-10-01 16:27:23 +03:00
Vyacheslav Gerasimov
28c84d0e00 183: Make 183 plugin compatible with upcoming Idea 191 2018-10-01 15:35:50 +03:00
Mikhail Glukhikh
6dbb51d7a7 MPP wizards: remove AS bunches (anyway they aren't accessible for AS) 2018-10-01 15:07:44 +03:00
Alexey Sedunov
a24e58f5a0 Configuration: Update repository URLs to use HTTPS instead of HTTP
#KT-27095 Fixed
2018-10-01 14:46:52 +03:00
Alexey Sedunov
03b289b899 Configuration: Do not save default values of sourceMapEmbedSources 2018-10-01 14:46:52 +03:00
Alexey Sedunov
0765cb9c62 Minor: Fix model access 2018-10-01 14:46:52 +03:00
Alexander Udalov
55c8b35eee Remove unneeded default imports in stdlib and tests 2018-10-01 13:39:02 +02:00
Mikhail Glukhikh
199ae3bac8 Forbid all MPP wizards in IDEA 173, but leave them in AS 3.1
Related to KT-27267
2018-10-01 14:36:52 +03:00
Mikhail Glukhikh
4c85616ee3 Forbid all MPP native-related wizards in IDEA 181, but leave in AS 3.2
Related to KT-27267
2018-10-01 14:36:51 +03:00
Alexander Udalov
009f18f1f4 Split AnalysisFlag values to AnalysisFlags and JvmAnalysisFlags
Declare AnalysisFlags in module 'frontend', and JvmAnalysisFlags in
module 'frontend.java', to avoid leaking Java-related logic to common
compiler code
2018-10-01 13:31:00 +02:00
Alexey Sedunov
c59779f5b9 MPP: Retain KotlinSourceSetInfo for Android in data nodes
User data is not serialized which leads to broken import on reopening

 #KT-27213 Fixed
2018-10-01 13:55:35 +03:00
Alexey Sedunov
c183c5b36a MPP: Add dependencies for all source sets for a given Android variant 2018-10-01 13:55:31 +03:00
Alexey Sedunov
63500216f0 MPP: Fix recognition of test source sets in Android projects
#KT-27212 Fixed
2018-10-01 13:55:26 +03:00
Alexey Sedunov
5b8208c751 MPP: Fix import failure in the case unresolved dependency is found
Instead report unresolved dependencies in Gradle build results

 #KT-27029 Fixed
2018-10-01 13:55:22 +03:00
Alexey Sedunov
99f63f2ebd Configuration: Use model provider to access facets
Otherwise newly created Android project may get invalid SDK
until the reimport is performed

 #KT-27193 Fixed
2018-10-01 13:55:16 +03:00
Mikhail Glukhikh
eb528c3d65 MPP mobile wizard: generate also Xcode (r) project for iOS
#KT-27178 Fixed
2018-10-01 13:46:37 +03:00
Dmitriy Dolovov
21952960f6 [K/N] Allow common source sets in projects created with wizard
Issue #KT-27232 Fixed
2018-10-01 16:36:32 +07:00
Georgy Bronnikov
ade640eadb JVM_IR. Support compile time constants 2018-10-01 12:25:55 +03:00
Denis Zharkov
623c6803d6 Fix regression on smart casts in when on a sealed class
See the comment in PatternMatchingTypingVisitor

 #KT-27221 Fixed
2018-10-01 09:59:28 +03:00
Dmitry Petrov
729da29e49 Update command-line options help for '-Xnormalize-constructor-calls'
Default value depends on language version.
2018-10-01 09:42:13 +03:00
Ilya Matveev
d2740db88f Update Kotlin/Native: 0.9.3 2018-09-30 11:27:13 +03:00
Ilya Matveev
7a5c05b72d Filter java.endorsed.dirs property in K/N runner 2018-09-30 11:27:13 +03:00
Nikolay Krasko
b09ec3cbb3 Shortcut quick fix for migrating all coroutines in the project (KT-27164)
#KT-27164 Fixed
2018-09-29 16:27:45 +03:00
Nikolay Krasko
282407c4a7 Minor: register problems through holder function 2018-09-29 16:27:43 +03:00
Nikolay Krasko
0efb4cc5f6 Refactoring: extract fun in ObsoleteExperimentalCoroutinesInspection.kt 2018-09-29 16:27:42 +03:00
Sergey Igushkin
58a8411575 Fix KNPE due to publications processing order in Gradle 4.7
A KNPE happened because Gradle 4.7 (but not 4.8+) requested a
publication's dependencies before all other publications were created.

Issue #KT-27231 Fixed
2018-09-28 21:57:09 +03:00
Svyatoslav Kuzmich
334c776b92 [JS IR BE] Fix @DoNotIntrinsify processing. Reuse it for compareTo 2018-09-28 20:27:01 +03:00
Ilya Gorbunov
12a31637d1 Improve groupingBy samples 2018-09-28 19:59:30 +03:00
Ilya Gorbunov
3a40e3f041 Move groupingByEachCount together with the new Grouping samples 2018-09-28 19:51:07 +03:00
Itsuki Aoyagi
039d41679e Add samples for groupingBy operations 2018-09-28 19:51:07 +03:00
Toshiaki Kameyama
d89947bd5a "Convert put to assignment": don't report on 'super' #KT-27146 Fixed 2018-09-28 19:43:05 +03:00
Leonid Startsev
b611facd71 Check if serialization plugin presents in the facet compiler classpath before applying extensions logic
#KT-27166 Fixed
2018-09-28 18:31:03 +03:00
Alexander Udalov
088cd4b5e3 Stop parsing argument in argfile when quote ends
There are two visible effects of this change:
1) If an empty argument is passed in quotes, it will be parsed as an
   empty string and handled by the compiler, which will report an error
   later. The specific error is not very important because it's an edge
   case anyway; at the moment, "source file or directory not found:" is
   reported which is no better than the "invalid flag:" error reported
   by javac in the similar case
2) It's no longer possible to split an argument into several parts and
   quote them separately, such as:

       "-langu"ag"e-"ver'sio'n 1.2

   No test added for this change in behavior since it's an even edgier
   case. Note that javac also prohibits this.

 #KT-27226 Fixed
2018-09-28 16:02:40 +02:00
Alexander Udalov
16dd6ebe61 Handle whitespaces in argfiles correctly
#KT-27218 Fixed
2018-09-28 16:02:40 +02:00
Mikhail Glukhikh
ab05f17d1d Fix ifThenToSafeAccess inspection test 2018-09-28 15:11:40 +03:00
Pavel Punegov
fedb9ad035 Merge branch 'ignore-defaultArgs-mpp' 2018-09-28 14:27:12 +03:00
Pavel Punegov
7c2c4e68ce Ignore 2 tests in Native: default arguments got from expect declarations there 2018-09-28 14:22:27 +03:00
Ilya Matveev
5140e674b4 Use compileClasspath configuration for native standard libraries 2018-09-28 14:15:11 +03:00
Ilya Matveev
5c4adc1100 Don't add dependency on a klib task for binary tasks 2018-09-28 14:15:11 +03:00
Dmitry Petrov
7b7cf39388 Fix inline classes coercion in 'if' expression
#KT-27132
2018-09-28 10:46:42 +03:00
Dmitry Petrov
ab90b2b901 Fix nullability propagation in inline class type mapping
#KT-27096

See https://jetbrains.slack.com/archives/C06E082M6/p1537949572000100
2018-09-28 10:46:42 +03:00
Dmitry Petrov
0b23ddb947 Add test for KT-27140 2018-09-28 10:46:42 +03:00
Nikolay Krasko
1901331ee5 Remove NotificationAction.createSimple to fix compilation in 173 2018-09-28 10:37:43 +03:00
Ilmir Usmanov
e7bed58ebe Fix bootstrap 2018-09-27 21:59:38 +03:00
Ilmir Usmanov
6e0391f9ec Use release coroutines in script-runtime 2018-09-27 21:59:35 +03:00
Dmitry Petrov
0191e3d1cf Migrate to release coroutines 2018-09-27 21:59:31 +03:00
Yan Zhulanow
bbc73ec0e5 MPP: Fix JPS tests
Move back the application check as only the class presence check is not sufficient.
2018-09-27 21:31:30 +03:00
Mikhail Glukhikh
ca4547c40a Add Maven Publish to MPP library wizards (in progress) #KT-27201 Fixed 2018-09-27 20:16:05 +03:00
Mikhail Glukhikh
e7100838d0 Introduce MPP wizard for mobile (Android / iOS) libraries
#KT-27200 Fixed
2018-09-27 19:43:04 +03:00
Nikolay Krasko
41bd29c3e9 Replace migration dialog with sticky popup (KT-27163)
#KT-27163 Fixed
2018-09-27 18:48:54 +03:00
Pavel V. Talanov
ce9028e367 Prefer data from facet settings when computing module js output root
#KT-26872 Fixed
2018-09-27 17:21:09 +02:00
Sergey Igushkin
2441df820b Support Kotlin/JS DCE in new MPP
Issue #KT-27196 Fixed
2018-09-27 17:54:38 +03:00
Ilya Chernikov
499146db0e Fix pill problem with main-kts-test, reenabling pill for main-kts modules 2018-09-27 16:27:55 +02:00
Ilya Chernikov
0303fc036c Fix gradle support for non-kts scripts when daemon is used 2018-09-27 16:27:17 +02:00
Dmitriy Dolovov
bfa6d57e34 [K/N] Improvements in new application wizard in IDEA
Issue #KT-27210 Fixed
2018-09-27 18:37:46 +07:00
Ilya Chernikov
7b7f87a3b7 Move ivy resolver to the main-kts to avoid classloading issues...
e.g. when main-kts is loaded in IDEA
#KT-26828 fixed
2018-09-27 12:56:19 +02:00
Dmitry Savvinov
6065095e24 Fix too aggressive data-flow clearing of loop-assigned vars
This is effectively a revert of
447c127036, which was an (incorrect) fix
for KT-22379.

The bug was that we've cleared data-flow info for assigned variables
*after* knowledge that loop condition if 'false' was applied (we can
claim that if loop has no jump-outs). Therefore, we broke smartcasts in
the innocent code like that:

  var x: Int? = null
  while (x == null) {
      x = readPotentiallyNullableInt()
  }
  // x should be non-null here

Commit reverts that "fix" for 1.3.0 and postpones deprecation until 1.4

KT-22379 Open
KT-27084 Fixed
2018-09-27 12:09:22 +03:00
Dmitry Savvinov
99454aa78d Add test on smartcast from while-assigned var
Currently behavior is undesired, it will be fixed in the next commit
(see KT-27084)
2018-09-27 12:09:21 +03:00
Nikolay Krasko
056c61090d Ignore non-kotlin modules during building migration information (KT-27100)
Otherwise maximum settings might be always obtained from project compiler
settings and thus stay unchanged during migration process.

 #KT-27100 Fixed
2018-09-27 11:59:49 +03:00
Pavel V. Talanov
2d52865415 Default to plain 'Run' icon when calculating icons for common code
#KT-26942 Fixed
2018-09-27 10:51:43 +02:00
Alexey Sedunov
8d3e997a82 Configuration: Do not configure SDK for Android modules
This is already done by the Android plugin itself

 #KT-27193 Fixed
2018-09-27 10:46:44 +02:00
Alexander Udalov
9f6575c57f Add file name to exception on invalid module-info.class in dependencies
This will help users in working around KT-23025
2018-09-27 10:16:15 +02:00
Dmitry Petrov
7624dbbb20 Fix subject variable handling in specialized enum codegen
#KT-27161
2018-09-27 10:48:35 +03:00
Mikhail Glukhikh
258999fa9e Always use Gradle wrapper 4.7 in MPP projects #KT-27177 Fixed 2018-09-27 10:45:00 +03:00
Dmitry Petrov
0dd04c3424 Postpone companion object field visibility
Have to reconsider this issue because of interface companion objects.
2018-09-27 10:35:23 +03:00
Dmitry Petrov
792ff3c39e Generate private interface companion object as package-private synthetic 2018-09-27 10:35:23 +03:00
Dmitry Petrov
7949ac1080 Use common instance receiver generation logic for 'this' expression
Otherwise it would skip private companion object accessor generation.
2018-09-27 10:35:23 +03:00
Denis Zharkov
c4337f753e Restore binary compatibility for IDE plugins
Caused by 341f7c348a
2018-09-27 10:16:20 +03:00
Ilya Gorbunov
0c81e30d46 Make a more correct implementation of unsigned arrays copyInto
Return the destination array instead of the destination storage array
wrapped in a new unsigned array. The difference should be
indistinguishable, however in JS, where inline classes are not inlined yet,
it had resulted in an extra wrapper.
2018-09-26 22:57:14 +03:00
ymnder
1a20b1f357 Add sample for 'repeat' function
Co-authored-by: Ilya Gorbunov <ilya.gorbunov@jetbrains.com>
2018-09-26 22:39:56 +03:00
shiraji
0c97d99d77 KT-20357 Add sample code for Regex.find
Co-authored-by: Ilya Gorbunov <ilya.gorbunov@jetbrains.com>
2018-09-26 22:24:53 +03:00
takattata
f06ea6fddd KT-20357 Add sample code for Char extensions 2018-09-26 21:58:50 +03:00
Takayuki Matsubara
d26c0f777b KT-20357 Add samples for Map.containsValue
Co-authored-by: Ilya Gorbunov <ilya.gorbunov@jetbrains.com>
2018-09-26 21:03:57 +03:00
Keita Watanabe
12ec4fdce0 KT-20357 Add sample for mutableSet function 2018-09-26 20:44:40 +03:00
Ilya Gorbunov
df6ccbca49 KT-20357 Add samples for elementAtOrElse
Move samples to Elements nested class.
2018-09-26 20:44:40 +03:00
Takayuki Matsubara
7d5efe7f51 KT-20357 Add samples for elementAtOrNull 2018-09-26 20:44:40 +03:00
Takayuki Matsubara
ad9b700ec4 KT-20357 Add samples for elementAt 2018-09-26 20:44:40 +03:00
Leonid Startsev
40b3514a47 Include serialization config in IDE for IDEA 183, AS 3.2 and 3.3 2018-09-26 19:47:07 +03:00
Alexander Udalov
5713298108 Fix FQ name usage of experimental marker in UseExperimental
#KT-26366 Fixed
2018-09-26 18:36:01 +02:00
Vyacheslav Gerasimov
cb398ea6b1 Fix compilation of kotlin-gradle-plugin broken after migration to gradle 4.10 2018-09-26 18:56:35 +03:00
Ilya Gorbunov
7b66a4d295 Remove links to contract samples as these samples are not supported by Dokka 2018-09-26 18:15:52 +03:00
Ilya Gorbunov
b2b23ac282 Improve contract API documentation 2018-09-26 18:15:52 +03:00
Ilya Gorbunov
f2a51f96a5 Improve documentation of experimental annotations 2018-09-26 18:15:52 +03:00
Ilya Gorbunov
04f1f6086b Fix doc build script after removing taks distJar from stdlib project 2018-09-26 18:15:52 +03:00
Mikhael Bogdanov
29568d2f48 Add test configuration for JDK_11 2018-09-26 17:05:55 +02:00
Mikhail Zarechenskiy
d0ed76ebc8 183: Fix exception about unmapped lambda argument from IDE inspection
Intention: obtain lambda argument for some parent call,
 then get that call (for the lambda argument) and map
 the argument to the parameter.

 Before the fix, we were getting call for inner element,
 not for the lambda argument and as a result, there were exceptions.

 #KT-26873 Fixed
2018-09-26 18:03:34 +03:00
Alexey Sedunov
c1b3e72ae8 Gradle: Inherit project SDK when no explicit one is specified
#KT-27145 Fixed
2018-09-26 16:59:46 +03:00
Vyacheslav Gerasimov
60758b86ee as33: Delete unnecessary bunch for itellij-sdk build.gradle.kts 2018-09-26 16:19:09 +03:00
Vyacheslav Gerasimov
666b660f79 Restore noDefaultJar() in kotlin-compiler project 2018-09-26 16:19:09 +03:00
Vyacheslav Gerasimov
1f0e9f24c5 Fix noDefaultJar helper for gradle 4.10
artifacts don't implement ArchivePublishArtifact in gradle 4.10
2018-09-26 16:19:09 +03:00
Vyacheslav Gerasimov
1109b795da Build: upgrade gradle to 4.10 2018-09-26 16:19:09 +03:00
Vyacheslav Gerasimov
8338a0dd85 Build: upgrade gradle to 4.9 2018-09-26 16:19:09 +03:00
Vyacheslav Gerasimov
10810aa90f Build: upgrade gradle to 4.8, fix ivy artifacts publication
Fix kotlin gradle plugin compilation against gradle 4.8 api
Internal ivy artifacts api has been changed, there is no longer DefaultIvyArtifact
2018-09-26 16:19:09 +03:00
Sergey Igushkin
44f87e4951 Revert "(minor) Transform KotlinPlatformType attribute to String, rename entries"
This reverts commit 3f24f8bd
2018-09-26 15:58:14 +03:00
Sergey Igushkin
8d054ba346 Revert "Build source sets hierarchy in Android projects"
This reverts commit 269410d7

The change causes errors in AS 3.2 import.
2018-09-26 15:58:14 +03:00
Ilya Matveev
3f452b2af2 Fix native test working directory 2018-09-26 15:49:47 +03:00
Ilya Matveev
6741a550d9 Add implementation dependencies into publication for native 2018-09-26 15:49:47 +03:00
Ilya Matveev
ac24bb0433 Update Kotlin/Native: 0.9.2 2018-09-26 15:49:47 +03:00
Ilya Matveev
da1fcb008b Fix -Xcommon-sources in native args 2018-09-26 15:49:47 +03:00
Mikhail Glukhikh
a97f2bb992 Introduce MPP wizard for mobile (Android / iOS) applications
This mobile wizard already contains skeleton
Finally #KT-25952 Fixed
Also #KT-26786 Fixed
2018-09-26 15:41:24 +03:00
Pavel V. Talanov
a258908fbb Create ModuleInfos for newmpp modules with missing roots accurately
#KT-27010 Fixed
 #KT-27133 Fixed
2018-09-26 13:46:45 +02:00
Pavel V. Talanov
cc1be5f559 Introduce SourceType and use KotlinFacetSettings.isTestModule
Refactor dealing with production/test roots
Remove ad-hoc code in KotlinMultiplatformRunLocationsProvider
2018-09-26 13:46:45 +02:00
Nikolay Krasko
1be491504a Fix formatting for when with subjects (KT-27027)
#KT-27027 Fixed
2018-09-26 13:35:36 +03:00
Nikolay Krasko
0833f23d02 Make ReplaceWith work for objects (KT-16211, KT-14929)
#KT-16211 Fixed
2018-09-26 13:35:35 +03:00
Nikolay Krasko
18c181641f Return updated element after reference shortening
Fresh new expression obtained after qualified expression binding is
invalidated after shortening.
2018-09-26 13:35:34 +03:00
Sergey Igushkin
c4283de9cb Mark deprecated Gradle configurations with the Kotlin platform attribute
The traditional Gradle/Java model assumes several configurations, which
are now deprecated, which are both `canBeConsumed = true` and
`canBeResolved = true`.

* compile, testCompile, etc.
* runtime, testRuntime, etc.
* default

These configurations need to somehow resolve correctly to an appropriate
platform-specific artifact when they contain an MPP library or project
dependency.

However, simply marking them with the Kotlin platform type attribute
would put these configurations under considerations during Gradle
variant aware depdendency resolution of project dependencies, which
in order would lead to ambiguity (e.g. `compile` vs `runtime` vs
`testCompile` vs ... vs `apiElements`).

To deprioritize these configurations during dependency resolution, we
mark them with a special attribute with a unique value in each project.
Given that the values are different in different projects, Gradle will
not choose a configuration marked by this attribute.

But we still need 'project(path: '...', configuration: '...')`
dependencies to work, and so, instead of rejecting those different
values of the attribute, we say that all values are compatible, but
when an ambiguity arises, choose the configurations not marked by this
attribute, so effectively eliminating them from resolution.

Issue #KT-27111 Fixed
2018-09-26 13:02:32 +03:00
Sergey Igushkin
3f24f8bd8d (minor) Transform KotlinPlatformType attribute to String, rename entries
* To avoid unexpected effects from the Gradle instantiation mechanisms
  for attribute values, use a safer String attribute type for the
  KotlinPlatformType attribute

* Rename its entries to keep enum entries naming consistent
2018-09-26 13:02:32 +03:00
Sergey Igushkin
65e3559c09 Fix resources processing configuration
* Add resources processing to the K/N compilations

* Use a proper resources output path (composed from target + compilation
  rather than just compilation name)

* Fix incorrect reassignment of the resources directory
2018-09-26 13:02:32 +03:00
Sergey Igushkin
fef61eca51 Add tests for variant-aware dependency resolution between projects 2018-09-26 13:02:32 +03:00
Sergey Igushkin
81ae54c05b Show warnings for disabled targets on current host
Issue #KT-26647 Fixed
2018-09-26 13:02:32 +03:00
Sergey Igushkin
4f650bb056 Add an experimental feature warnings on MPP usage & metadata publishing
Issue #KT-25200 Fixed
2018-09-26 13:02:31 +03:00
Sergey Igushkin
54988932a3 Ensure that kapt configurations are not exposed for consumption 2018-09-26 13:02:31 +03:00
Sergey Igushkin
7c05f77cb7 Add tools for testing dependencies resolution by resolving all configs 2018-09-26 13:02:31 +03:00
Sergey Igushkin
c3dd24e9b2 Rewrite project dependencies when publishing a multimodule MPP
When a new MPP is published without Gradle metadata, the project
dependencies should be replaced with specific module dependencies,
e.g. `sample-lib` with `sample-lib-jvm`, because a consumer won't be
able to resolve `sample-lib` in a variant-aware way.
2018-09-26 13:02:31 +03:00
Sergey Igushkin
05301e37d8 Fallback for publishing with no Gradle metadata
The following parts of the publications are affected:

* root publication
  * with Gradle metadata, it is published and references the
    other publications using the `available-at` mechanism
  * without metadata opt-in, it is not published

* Kotlin metadata variant
  * with Gradle metadata, it is added as an additional variant to the
    platform-specific publications to allow the IDE to discover it
  * without metadata opt-in, it is added as a dependency to the platform-
    specific modules (like in old MPP)
2018-09-26 13:02:31 +03:00
Sergey Igushkin
b388f7fde0 Introduce Kotlin variants with metadata variant and metadata dependency
These two will be needed when we publish a platform-specific part of a
MPP library in order to help the consumers of that single module
(rather than the whole MPP library) find the Kotlin metadata.

`KotlinVariantWithMetadataVariant` will be used for publishing with
Gradle metadata enabled, `KotlinVariantWithMetadataDependency` for
publishing without Gradle metadata, instead adding the Kotlin metadata
as a dependency, just like we did in old MPP.
2018-09-26 13:02:31 +03:00
Sergey Igushkin
1abcfc76df Add Kotlin-specific Usage attribute values
When a non-Kotlin (JVM) project resolves an MPP library dependency,
it expects only one variant per Java Usage value ('java-api',
'java-runtime-jars'). If there's more than one, it will report
ambiguity and fail.

So we need to avoid creating non-JVM variants with Java Usage values
to ensure that non-Kotlin consumers can resolve the dependencies on
an MPP library with a single JVM target (if there's more than one
JVM target, there will still be ambiguity, but that's quite what one
would expect and what can be solved with custom attributes).

Instead, we define two Kotlin-specific Usage values, 'kotlin-api' and
'kotlin-runtime', so that:

* input configurations with these Usage values can consume plain Java
  artifacts, for compatibility with plain old Kotlin modules

* if a consumer does not request a Kotlin usage and receives the two,
  let it use the runtime one as it is more complete

We then use the two Usage values on those Kotlin input and output
configurations which are not JVM-related, and leave the Java Usages
for the JVM targets.
2018-09-26 13:02:31 +03:00
Sergey Igushkin
76b51b1058 Allow the common platform type consumers to consume platform artifacts
When a Kotlin metadata input configuration tries to resolve a module
with no Kotlin metadata (such as: plain old Maven module, a non-MPP
Kotlin project with a single platform), it should be able to resolve
successfully.

Given that the input metadata configurations extend from source set
dependencies configurations, where platform-specific dependencies may
occur, allowing the metadata configuration to resolve such dependencies
into platform artifacts seems to achieve successful dependency
resolution.

Issue #KT-26834 Fixed
2018-09-26 13:02:31 +03:00
Sergey Igushkin
269410d7aa Build source sets hierarchy in Android projects
Instead of simply adding all Kotlin source sets participating in an
Android compilation, as was appropriate until we introduced the
dependsOn relation, we should now build a proper source sets hierarchy.
2018-09-26 13:02:30 +03:00
Ilya Chernikov
43a4b84b44 Make script resolving annotations repeatable, fix multiple repos usage
Also avoid "unknown resolver central" errors on ivy resolving
#KT-27050 fixed
2018-09-26 11:49:45 +02:00
Mikhail Zarechenskiy
0d103e7f0c Allow using extensions with trivial-constraints in builder-inference
#KT-27079 Fixed
2018-09-26 11:52:23 +03:00
Mikhail Zarechenskiy
0da1b9b80f Revert "Migration change: temporarily specify type explicitly"
This reverts commit bc6e091004.

 This commit was needed to avoid bootstraping, now we can revert it
2018-09-26 11:51:57 +03:00
Mikhail Zarechenskiy
7c1d374ed5 Fix diagnostic tests about coroutine-inference 2018-09-26 11:51:55 +03:00
Alexander Podkhalyuzin
3142627269 Removed extra spaces in new MPP project template
#KT-26952  Fixed
2018-09-26 10:21:10 +03:00
Toshiaki Kameyama
c1013cc198 "Convert to secondary constructor": Fix false positive with delegation #KT-27061 Fixed 2018-09-26 09:31:12 +03:00
Yuki Miida
af1fc5b668 Add sample for orEmpty method 2018-09-26 05:54:40 +03:00
Mikhail Glukhikh
64b23812c0 Move CliArgumentStringBuilder: cli -> idea-jvm 2018-09-25 19:14:12 +03:00
Mikhail Glukhikh
1f4d91da1c Has actual marker: distinguish Android and JVM modules #KT-25055 Fixed 2018-09-25 19:11:30 +03:00
Dmitry Petrov
fd57a43665 Update testData for ClassFileToSourceStubConverterTestGenerated 2018-09-25 17:25:02 +03:00
Simon Ogorodnik
189fe95d8a Fix type-aliases by expansion search loop
Compare type-aliases by it's fqNames instead of identity, as
multiple runs of resolveToDescriptorIfAny produces different descriptors
for one declaration
2018-09-25 16:40:03 +03:00
Nikolay Krasko
1ff12d00e4 Allow return value hint for lambda expressions (KT-26689)
#KT-26689 Fixed
2018-09-25 15:52:22 +03:00
Nikolay Krasko
07e305e5f4 Update dictionary: +infos, -kompiler 2018-09-25 15:52:21 +03:00
Nikolay Krasko
80c3e59dd5 Minor: cleanup testUtils.kt 2018-09-25 15:52:19 +03:00
Nikolay Krasko
e1f746f23c Resolve "key is not found in bundle" exception from tests in AS
Android Studio idea.jar is taken from clion projects and has
IdeSpecificFeatures.xml and ProductivityFeaturesRegistry.xml files that
mention function that have to be found in ProductivityFeaturesRegistry.

Unfortunately, correspondent CLion bundle is not registered in tests, and
this causes a lot of tests fail.
2018-09-25 15:52:18 +03:00
Ilya Chernikov
127451e1d9 Add kotlin-main-kts.jar to the dist 2018-09-25 14:13:28 +02:00
Alexey Sedunov
22c77ffbb2 MPP: Do not populate content roots in the absence of ExternalProject
#KT-26900 Fixed
2018-09-25 15:05:46 +03:00
Alexey Sedunov
4f01a438c4 MPP: Add all android-targeted compilation source roots to the module 2018-09-25 15:05:43 +03:00
Alexey Sedunov
3a973973ce MPP: Create android source roots automatically when requested
#KT-26764 Fixed
2018-09-25 14:54:27 +03:00
Alexey Sedunov
391e4c2ad1 Configuration: Fix JVM target detection in the absence of Kotlin facet
#KT-27021 Fixed
2018-09-25 14:54:26 +03:00
Alexey Sedunov
bd3adbd457 MPP: Reset JDK for JVM modules
#KT-26937 Fixed
2018-09-25 14:54:26 +03:00
Alexey Sedunov
6d4f927f7e Configuraion: Defer initialization of facets UI
#KT-25410 Fixed
2018-09-25 14:54:25 +03:00
Dmitriy Dolovov
5e33860652 [K/N] Stand-alone Native Application wizard in IDEA
Issue #KT-27076 Fixed
2018-09-25 17:24:59 +07:00
Dmitriy Dolovov
8e455f5a14 Merge pull request #1893 from JetBrains/rr/ddol/KT-27072
[K/N] Friendly displaying of Kotlin/Native default libraries in IDEA
2018-09-25 16:03:28 +07:00
Toshiaki Kameyama
7d89205618 Add "Remove inline modifier" quick fix for NOTHING_TO_INLINE #KT-5187 Fixed 2018-09-25 11:48:20 +03:00
Toshiaki Kameyama
65f23f3c4e Fix false positive in class literal #KT-16338 Fixed 2018-09-25 11:27:27 +03:00
Toshiaki Kameyama
6cd13341ee Add inspection for unlabeled return inside lambda #KT-26511 Fixed 2018-09-25 11:24:56 +03:00
Dmitry Petrov
ba32ed7404 Test: @JvmField in inline class companion 2018-09-25 11:15:29 +03:00
Dmitry Petrov
bffe9e45e8 Add accessor tests: inline class <-> companion
KT-26858 was fixed somewhere in the middle.

 #KT26858
2018-09-25 11:15:29 +03:00
Dmitry Petrov
850d72f13f Fix accessor generation for inline class members
TODO 'generateMethodCallTo' is a bloody mess that deserves rewriting.
2018-09-25 11:15:29 +03:00
Dmitry Petrov
edc8cf3ed0 Use proper type for context 'this'
Bug in 'generateThisOrOuterFromContext', it worked while instance of a
class was always an object.

 #KT-27078
2018-09-25 11:15:29 +03:00
Dmitry Petrov
c1bb3479df More tests on casts on receiver of inline class type 2018-09-25 11:15:29 +03:00
Dmitry Petrov
88cc900dc7 Add test for private inline class method call from inline lambda 2018-09-25 11:15:29 +03:00
Dmitry Petrov
2e6d53a43f Fix extension receiver coercion for inline classes
#KT-27031
2018-09-25 11:15:29 +03:00
Dmitry Petrov
20d7210239 Fix outer class mapping for closures in inline class
#KT-27030
 #KT-27033
2018-09-25 11:15:29 +03:00
Dmitry Petrov
26602c8443 Minor: move tests 2018-09-25 11:15:29 +03:00
Dmitry Petrov
f9a419f940 Fix companion method access from inline class
#KT-27025
2018-09-25 11:15:29 +03:00
Dmitry Petrov
1869ed09bc Fix companion field access from inline class
#KT-26858
2018-09-25 11:15:29 +03:00
Toshiaki Kameyama
3e4d8eba76 Add braces: Remove new line between '}' and 'else' #KT-26839 Fixed 2018-09-25 11:08:49 +03:00
Alexey Tsvetkov
de261df6f5 Use separate configuration for resolving native compiler plugin artifacts
Kotlin/JVM and Kotlin/JS use shaded compiler, but
Kotlin/Native uses non-shaded one.
Serialization plugin was configured to use either shaded or non-shaded
plugin version, because we used one configuration for resolving
compiler plugins.
This change introduces 'kotlinNativeCompilerPluginClasspath' configuration
for resolving Kotlin/Native compiler plugins.
2018-09-25 11:08:39 +03:00
Toshiaki Kameyama
affa881421 "Redundant SAM constructor": Fix highlighting range #KT-27034 Fixed 2018-09-25 11:06:45 +03:00
Dmitriy Dolovov
405bd91597 [K/N] User friendly displaying of Kotlin/Native default libraries in IDEA
Issue #KT-27072 Fixed
2018-09-25 11:50:39 +07:00
Georgy Bronnikov
487f500f85 Revert "JVM_IR. Support compile time constants"
This reverts commit 055215c54f.
2018-09-25 05:24:48 +03:00
Georgy Bronnikov
055215c54f JVM_IR. Support compile time constants 2018-09-25 01:38:51 +03:00
Pavel V. Talanov
985934a40a Prefer kotlin JUnit config to any pattern based config
Specifically that means that Kotlin JUnit configurations will be created
    for JUnit classes and methods instead of AS pattern configurations
2018-09-24 18:29:04 +02:00
Pavel V. Talanov
71d640f3f8 Improve kotlin jvm run config producers for 181 and as32 branches
Drop KotlinJUnitRunConfigurationProducer, KotlinRunConfigurationProducer
    bunch files
Extract differences in behaviour to 'jvmMppUtils.kt'
Improve 'isConfigurationFromContext' checks for 181 and as32
    (this prevents duplicate configurations being created)
KotlinRunConfigurationProducer chooses corresponding jvm module
    for common code

 #KT-26886 Fixed
2018-09-24 18:08:06 +02:00
Pavel V. Talanov
f34f306d90 IdeaModuleInfos: consider newMpp modules to always have relevant roots
Make sure implementing(ed)Descriptors always return a relevant module
    regardless of whether the module has physical directories configured
2018-09-24 18:08:06 +02:00
Vyacheslav Gerasimov
7eb8123d26 Add changelog for 1.2.71 2018-09-24 18:37:39 +03:00
Nikolay Krasko
dda1673096 Don't choose navigation target only by index (KT-26004)
There might be situation when platform code has a declaration with
another signature and the same fqname, but navigating to common
declaration is expected.

 #KT-26004 Fixed
2018-09-24 18:26:34 +03:00
Svyatoslav Kuzmich
b79dcbe8e6 [JS IR BE] Refactor equals and compareTo lowering 2018-09-24 18:21:57 +03:00
Yan Zhulanow
005955326f Pill: Exclude kotlin-main-kts module from JPS 2018-09-24 17:54:24 +03:00
Yan Zhulanow
ff0b051a64 MPP: Rewrite work-around for JPS in a more safe way 2018-09-24 17:54:24 +03:00
Yan Zhulanow
bc27cabb1a Call 'GradleProjectImportHandler's in MPP Gradle importer (KT-27006) 2018-09-24 17:54:23 +03:00
Nikolay Krasko
bbd15db308 Remove old buildIterator import (KT-26679) 2018-09-24 15:57:06 +03:00
Mikhail Zarechenskiy
6a860dd042 Fix blackbox codegen tests that use coroutine inference
Note that previously we implicitly ignored JS_IR backend when directive
 COMMON_COROUTINES_TEST was enabled, see kotlin/generators/util/coroutines.kt#L57
2018-09-24 12:10:56 +03:00
Ilya Gorbunov
974837654e Remove workaround for complex default value in Array.copyInto
#KT-22818
2018-09-22 18:24:00 +03:00
Ilya Gorbunov
a5f1ed9a5d Advance bootstrap to 1.3.20-dev-384 2018-09-22 18:23:52 +03:00
Alexey Tsvetkov
cd2ff41ef5 Validate Gradle task properties on test run
By default `validateTaskProperties` is added only to `check` task's
dependencies, so doesn't run on our CI.
We can run `check` instead of `test` on CI, but since developers are
not used to it, I believe it's better to make `test` tasks depend on
`validateTaskProperties`
2018-09-22 00:10:45 +03:00
Natalia Selezneva
a078526c4d Scratch tests: check that highlighting is enabled for scratch 2018-09-21 22:58:14 +03:00
Natalia Selezneva
8f8c431524 Fix Optimize import for scripts not under source roots
KT-17231 Fixed
KT-21981 Fixed
2018-09-21 22:58:14 +03:00
Natalia Selezneva
eb597fbf22 Fix unused import inspection for scripts not under source roots (including build.gradle.kts and scratches)
KT-20040 Fixed
2018-09-21 22:58:14 +03:00
Natalia Selezneva
43027d0581 Check scriptDefinition expected location for scripts when use ProjectRootUtil.isInContent 2018-09-21 22:58:14 +03:00
Natalia Selezneva
074aa47dc0 Use ProjectRootUtil.isInContent instead of checking script expected location manually 2018-09-21 22:58:14 +03:00
Natalia Selezneva
d3ee14c5d2 Check scriptDefinition expected location for scripts when use ProjectRootUtil.isInContent 2018-09-21 22:58:06 +03:00
Ivan Gavrilovic
2d425d4e0a Fix null checks in the flow 2018-09-21 20:23:44 +03:00
Ivan Gavrilovic
bb53a1c3d2 Use new API from AGP to get JavaCompile task
New API for getting the JavaCompile task has been
added to AGP, and the old one is deprecated. It is
now returning TaskProvider<JavaCompile>, which allows
API users to avoid configuring tasks unnecessarily.

This commit does not change anything functionally, it
is only to avoid the warning message, as reporter in
https://issuetracker.google.com/116198439.
2018-09-21 20:23:44 +03:00
Ilya Gorbunov
358e64fdb0 Remove dead code for builtins uninvalidation in tests 2018-09-21 18:35:02 +03:00
Ilya Gorbunov
4423ef9087 Minor: remove unused template for Map.random() 2018-09-21 18:28:44 +03:00
Anton Bannykh
8e347f9f39 [JS IR BE] lateinit support
* Functions with IrExpressionBody are lowered to IrBlockBody
* Implemented throwUninitializedPropertyAccessException function
2018-09-21 18:20:11 +03:00
Anton Bannykh
beaf6df8c5 [JS IR BE] support CharSequence and String methods 2018-09-21 18:16:03 +03:00
Alexander Udalov
3e90d367f2 Do not report experimental usage errors in import statements
#KT-25545 Fixed
2018-09-21 17:35:50 +03:00
Alexander Udalov
9d27771f86 Fix instance parameter type of inherited declaration in reflection
Both for callables obtained via reflection API (KClass.members etc) and
for callables obtained via ::-references, the instance parameter is now
the class which was used to construct the type at the left-hand side of
the reference, NOT the class where the callable is originally declared
as is known at compile-time. The reason is to reduce the difference in
behavior of KCallable.call vs FunctionN.invoke: the latter always
required the subclass instance for a fake override, and it's reasonable
that the former would require it as well.

Note that in Java reflection, behavior could differ in a similar case.
For a simple fake override, Class.getMethod would return the method
declared in the base class and that method will accept instances of the
base class in invoke. However, it's difficult to rely on this behavior
because if there's a bridge for a fake override in the derived class
(e.g. when overridden members have different signatures), the returned
Method object is accepting the derived class as the receiver. This just
confirms the fact that Java reflection operates on a different level of
abstraction, namely JVM methods in .class files, which is not applicable
to our use cases directly. Another reason not to replicate Java
reflection's behavior is the uncertainty as to which member is returned
in case there are several in the hierarchy for a given fake override:
see the "otherwise one of the methods is chosen arbitrarily" note in
javadoc on Class.getMethod.

 #KT-24170 Fixed
2018-09-21 17:32:43 +03:00
Alexander Udalov
3ca81b95c2 Use non-allowed actual defaults in backends to workaround compiler exception
It's difficult to fix KT-22818 until the IR comes along, so we're
providing a workaround where one can disable the
ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS error and provide default values
in the actual function, to avoid exception from the backend.

 #KT-22818
2018-09-21 17:30:05 +03:00
Ilya Chernikov
18b53f331a Fix proguarding of the main-kts 2018-09-21 15:12:53 +02:00
Simon Ogorodnik
68dfe9bf14 Fix missing NativeLibraryType
#KT-27009 fixed
2018-09-21 15:32:56 +03:00
Simon Ogorodnik
3aee3dfdd9 Remove JPS KotlinNativeConfigurator 2018-09-21 15:32:55 +03:00
Simon Ogorodnik
9a79254f7e Make possible to have no libraryDescription for 'Configure Kotlin' 2018-09-21 15:32:54 +03:00
Simon Ogorodnik
faf09a2aac Add KotlinNativeGradleConfigurator to avoid 'Configure Kotlin' for K/N 2018-09-21 15:32:53 +03:00
Simon Ogorodnik
cff648a505 Don't show 'Configure Kotlin' panel when module already configured 2018-09-21 15:32:53 +03:00
Roman Artemev
a807397f65 [JS_IR] Add inlineBox tests 2018-09-21 14:02:53 +03:00
Alexander Podkhalyuzin
aa56c50218 Fixed update copyright action with no package and imports
#KT-23864 Fixed
2018-09-21 12:56:11 +03:00
Dmitry Petrov
d03237bebc Generate backing fields and initializers for external constants 2018-09-21 09:50:21 +03:00
Dmitry Petrov
ec8bdff5c7 Working infrastructure for external dependencies testing
(not really, but at least something)
2018-09-21 09:50:21 +03:00
Dmitry Petrov
6022fb4ec3 Fix default impl for suspend fun
We have an extra parameter in the mapped signature, and don't care about
Kotlin types there (so far). Might be a better idea to obtain the actual
descriptor for a suspend function (with extra parameter), and pass
arguments accordingly.
2018-09-21 09:48:11 +03:00
Dmitry Petrov
0f898dc6dc Fix default interface generic extension fun call with inline class type
When we've determined that we are going to invoke an erased inline class
method ('static foo-impl(this, ...)' in inline class), keep track of it
so that the remaining type mapping logic proceeds correctly.

 #KT-26998 Fixed Target versions 1.3.20
2018-09-21 09:48:11 +03:00
Dmitry Petrov
95010de32e Minor: renaming 2018-09-21 09:48:11 +03:00
Dmitry Petrov
8d2b1950e6 Fix Kotlin default interface methods calls for inline classes
When mapping callable method signature for erased inline class methods,
use original function descriptor instead of super declaration
(otherwise it would map to a default interface method with mismatching
signature).

When generating delegates to Kotlin default interface methods, keep
track of the original Kotlin types for delegating method arguments and
interface method arguments.

'original' for value parameters of fake overrides points to the
overridden function value parameters instead of the value parameter of
the unsubstituted function. This causes inconsistent type mapping for
inline classes implementing generic interfaces with default methods.

 #KT-25295 Fixed Target versions 1.3.20
 #KT-26931 Fixed Target versions 1.3.20
2018-09-21 09:48:11 +03:00
Dmitry Petrov
8536ef5b43 Minor: reformat 2018-09-21 09:48:11 +03:00
Dmitry Petrov
947ea88d5e Refactor: pull up and extract method 2018-09-21 09:48:11 +03:00
Dmitry Petrov
d9593c7a34 Add tests for inline class variables captured in closure 2018-09-21 09:48:11 +03:00
aleksZubakov
7e49005bab Add LazyTopDownAnalyzer in LazyResolve container 2018-09-20 22:24:07 +03:00
Ilya Gorbunov
0ca59b3a40 Use modern API of Kotlin 1.3 in JS canvas examples 2018-09-20 22:08:56 +03:00
Roman Artemev
24e7bafa7d Port test from K/N 2018-09-20 19:59:12 +03:00
Ilya Matveev
a6f2af03e7 Pass absolute library paths to native compiler 2018-09-20 19:10:27 +03:00
Mikhail Zarechenskiy
09cd038e4b Fix test about version requirement
We began to write version requirement on declarations with `Result` and
 now (after bootstrap) we are getting error in this test because of that
 version requirement.

 see 908be10bf4
2018-09-20 17:58:56 +03:00
Mikhail Zarechenskiy
a4f5cced47 Support coroutine inference under version <= 1.2
Follow-up #KT-26958
2018-09-20 17:42:24 +03:00
Mikhail Glukhikh
de36d919aa Fix testJvmStaticUsagesRuntime from PSI checker, messages updated to 1.3 2018-09-20 17:28:07 +03:00
Mikhail Glukhikh
83faba6424 MPP wizard: add skeleton for shared JVM/JS/iOS project
Part of KT-26786
2018-09-20 16:21:43 +03:00
Mikhail Glukhikh
47baaf10c6 MPP wizard: add skeleton for JVM/JS project
Part of KT-26786
2018-09-20 16:21:26 +03:00
Mikhail Glukhikh
625ff00f62 Fix testEnableCoroutinesFacet from update configuration group 2018-09-20 16:19:10 +03:00
Mikhail Glukhikh
6850d7be0c Enable feature: add test for JPS case 2018-09-20 16:19:03 +03:00
Mikhail Glukhikh
c5a81c4e8b Extract shouldConfigureInProject to AbstractChangeFeatureSupportLevelFix 2018-09-20 16:18:06 +03:00
Mikhail Glukhikh
7030a485be Enable / disable feature: update Gradle build script bunch for 173 2018-09-20 16:18:05 +03:00
Mikhail Glukhikh
f6b805a973 Add enable / disable feature in JPS
#KT-26775 Fixed
#KT-26774 Fixed
2018-09-20 15:56:37 +03:00
Mikhail Glukhikh
8a7ff4cd24 Add enable / disable feature in Maven project
Part of KT-26775
2018-09-20 15:56:32 +03:00
Mikhail Glukhikh
106db57975 Add enable / disable feature in Gradle (Kotlin DSL) project
Part of KT-26775
2018-09-20 15:56:31 +03:00
Mikhail Glukhikh
43e4616fdf Add enable / disable feature in Gradle (Groovy) project, forTests option
Part of KT-26775
2018-09-20 15:56:29 +03:00
Mikhail Glukhikh
b194be7665 Introduce skeleton for ChangeGeneralLanguageFeatureSupportFix
Part of KT-26775 and KT-26774
2018-09-20 15:56:27 +03:00
Mikhail Glukhikh
fd3dfe0710 Extract AbstractChangeFeature...Fix from ChangeCoroutineSupportFix
Part of KT-26775 implementation
2018-09-20 15:56:26 +03:00
Mikhail Glukhikh
125a136663 Delete unnecessary bunches for KotlinMavenConfigurator
One private fun (instead of public) is the only difference here
2018-09-20 15:56:25 +03:00
Mikhail Glukhikh
a0ae4dd387 Fix Maven enable coroutines test (language version) 2018-09-20 15:56:23 +03:00
Ilya Chernikov
a6c7f4294c Annotate DiscoverScriptExtensionsTask properly
KT-26978 fixed
2018-09-20 09:44:58 +02:00
Yan Zhulanow
1008adaf02 Do not discover script extensions for Kapt stub generation tasks (KT-26974) 2018-09-19 22:50:31 +03:00
Ilmir Usmanov
7b1c564b87 Replace ALOAD 0 with fake continuation if suspension point is default
method

 #KT-25922 Fixed
 #KT-26608 Fixed
 #KT-26658 Fixed
2018-09-19 22:14:29 +03:00
Pavel V. Talanov
85bdb8b787 Do not show run gutters for native
#KT-26851 Fixed
2018-09-19 19:25:24 +02:00
Anton Bannykh
06ecca4144 [JS IR BE] unsigned literal support 2018-09-19 17:45:07 +03:00
Nikolay Krasko
9f16e4f709 Report jre deprecated warning when version is set implicitly (KT-26933)
#KT-26933 Fixed
2018-09-19 17:31:10 +03:00
Toshiaki Kameyama
3f2c73b4a9 if-then to safe access: fix for qualified 'this' condition #KT-26662 Fixed 2018-09-19 16:16:15 +03:00
Toshiaki Kameyama
b5f73ebd0f if-then to safe access: report even if condition in parentheses #KT-26662 Fixed 2018-09-19 16:16:15 +03:00
kenji tomita
6d9fb4f382 Fix #KT-26902 Bad quickfix name for "Call on non-null type may be reduced" 2018-09-19 15:56:26 +03:00
Stanislav Erokhin
4ca0c60066 Temporary specify type explicitly for sequence method in debugger tests. 2018-09-19 15:46:24 +03:00
Stanislav Erokhin
95633b6027 Advance bootstrap to 1.3.20-dev-258 2018-09-19 15:46:22 +03:00
Anton Bannykh
6736987239 JS: fix unsigned literal inlining 2018-09-19 15:04:36 +03:00
Dmitry Petrov
7ff72e9d90 Fix inline class recursion through type parameters
Note that inline class such as
  inline class Id<T>(val x: T)
is prohibited in 1.3.0.
2018-09-19 14:51:50 +03:00
Anton Bannykh
66b5dd92d9 JS: fix line number data 2018-09-19 13:57:43 +03:00
Mikhael Bogdanov
1face1c334 Don't generate annotations on synthetic accessor parameters 2018-09-19 12:14:09 +02:00
Mikhael Bogdanov
38652372ce Generate private constructors for Enums
#KT-2680 Fixed
  #KT-16867 Fixed
2018-09-19 12:14:08 +02:00
Mikhael Bogdanov
c753a98d02 Use section constants to generate smap data 2018-09-19 12:14:07 +02:00
Mikhael Bogdanov
a789fd92fe Properly parse smap information
#KT-23369 Fixed
2018-09-19 12:14:07 +02:00
Ilya Gorbunov
86ba5ebf29 Mix kotlin-annotations-jvm with kotlin-reflect into proguard
So it can strip these annotations from the resulting jar.

#KT-26929 Fixed
2018-09-19 12:40:47 +03:00
Nikolay Krasko
64d2cdf0c2 Migrate for moved and renamed buildSequence/buildIterator (KT-26679)
#KT-26679 Fixed
2018-09-19 12:38:35 +03:00
Nikolay Krasko
082801efb4 Refactoring: move each problem to a separate class 2018-09-19 12:38:33 +03:00
Mikhail Zarechenskiy
86141be61f Add inference annotations to the dumped declarations 2018-09-18 23:28:54 +03:00
Alexander Udalov
8c01cd48a5 Report warning instead of error on usages of Experimental/UseExperimental
#KT-26936 Fixed
2018-09-18 22:50:26 +03:00
Ilya Gorbunov
1d7ee22bdc Simplify comparisons for small unsigned types that can fit in Int
UByte and UShort can be extended to Int exactly and then compared as ints
2018-09-18 22:25:36 +03:00
Ilya Gorbunov
af29dced98 Make overridden compareTo in unsigned types inline only 2018-09-18 22:25:36 +03:00
Ilya Gorbunov
9e0708e85a Make most of unsigned operations inline only 2018-09-18 22:25:36 +03:00
Ilya Gorbunov
d793221a7b Extract unsigned type related extensions to separate classes
- Rename class with unsigned number to string conversions to UStringsKt
- Extract Random unsigned extensions to URandomKt
2018-09-18 22:25:36 +03:00
Ilya Matveev
b469afdfcb Use argument file to run Kotlin/Native compiler 2018-09-18 21:39:44 +03:00
Ilya Matveev
7d6adbd088 Serialize native compiler args 2018-09-18 21:39:44 +03:00
Ilmir Usmanov
5dea245a37 Fix linenumbers written to debug metadata
#KT-26848 Fixed
2018-09-18 20:06:25 +03:00
Ilya Chernikov
c0f4933356 Make ivy resolver quiet 2018-09-18 18:39:30 +02:00
Mikhail Zarechenskiy
d7f2eeb6e8 Add BuildInference annotation onto stdlib coroutine builders 2018-09-18 18:55:26 +03:00
Mikhail Zarechenskiy
bc6e091004 Migration change: temporarily specify type explicitly
Because of introduction of `BuilderInference` annotation.
 Change it back after bootstrap
2018-09-18 18:55:26 +03:00
Mikhail Zarechenskiy
a293aded5d Introduce builder-like inference with an explicit opt-in for it
- Add marker for the experimental type inference features
 - Add annotation that will control builder-like inference
 - Require that annotation on corresponding parameters and extensions
 - Allow to use builder inference without suspendability

 Changes in tests and refactorings (rename mainly) are going to be
 introduced in further commits
2018-09-18 18:55:25 +03:00
Mikhail Zarechenskiy
5e9b31ca2c Minor: invert logic of function 2018-09-18 18:55:25 +03:00
Vyacheslav Gerasimov
5229ed0217 Add compatibility artifact with Mutable and ReadOnly annotations into dist
#KT-26916 Fixed
2018-09-18 18:52:32 +03:00
Denis Zharkov
ed7dd6fccb Minor. Move serialization annotation fq-names to IDE light-classes
They are a kind of a hack applied in light-classes and it'd be nice
to prevent them being used in irrelevant contexts

kotlin-serialization-compiler module should not depend on idea,
thus we can't use annotations directly there.

So, we copy-paste them and add a test on names consistency
2018-09-18 18:37:11 +03:00
Nikolay Krasko
b31de355db Fix compilation error in MavenMigrateTest.kt 2018-09-18 18:12:58 +03:00
Simon Ogorodnik
818171108e [K/N] Hack to enable exporting interop libraries 2018-09-18 17:54:57 +03:00
Dmitriy Dolovov
ab07377200 [K/N] Fix: Obsolete text stubs after updating K/N library
Issue #KT-26736 Fixed
2018-09-18 17:43:20 +03:00
Dmitriy Dolovov
db418123d4 [K/N] Proper invalidation of metadata cache in IDEA by VFS events 2018-09-18 17:43:19 +03:00
Simon Ogorodnik
35a0b42796 Support forward declarations for Native via hack-ing into built-ins 2018-09-18 17:43:15 +03:00
Simon Ogorodnik
69f5cf7095 Create Native specific LibraryInfo
This LibraryInfo contains KonanLibrary and provides correct
capabilities to ModuleDescriptor
2018-09-18 17:41:39 +03:00
Simon Ogorodnik
a2cdb14610 Add function to get typed capability from ModuleInfo 2018-09-18 17:33:10 +03:00
Simon Ogorodnik
d90cda65a1 Add factory function to create platform specific LibraryInfo's 2018-09-18 17:33:09 +03:00
Simon Ogorodnik
0cc3625dc1 Do not throw exception on not-found serialized class from knm 2018-09-18 17:33:08 +03:00
Simon Ogorodnik
ca742b1552 Support free-form .knm package part names 2018-09-18 17:33:07 +03:00
Simon Ogorodnik
7166c011bf Support for split-packages in Kotlin Native
See JetBrains/kotlin-native#2034
2018-09-18 17:33:06 +03:00
Ilya Matveev
a2c5c515de Support OptionalExpectation in native 2018-09-18 15:55:49 +03:00
Anton Bannykh
7d5a304cf6 [JS IR BE] support Char.rangeTo() 2018-09-18 15:43:55 +03:00
Roman Artemev
89bec8ec59 Update tests 2018-09-18 15:30:17 +03:00
Roman Artemev
084071e2e5 [JS IR BE] Fix callable reference lowering
* more precisely handle implicit receiver arguments
2018-09-18 14:59:21 +03:00
Ilmir Usmanov
14818a4fc1 Minor. Remove tests with suspend delegates 2018-09-18 14:56:11 +03:00
Ilmir Usmanov
c4038729ea Minor. Split tests with buildSequence into LV 1.2 and LV 1.3 versions 2018-09-18 14:56:08 +03:00
Nikolay Krasko
50deac7a26 Update test data in migration tests 2018-09-18 14:38:26 +03:00
Nikolay Krasko
6ef6fe4a47 Don't show migration dialog if no actual migrations are available (KT-26889)
#KT-26889 Fixed
2018-09-18 14:38:26 +03:00
Nikolay Krasko
11b948f004 Postpone migration till indexes are ready (KT-26428)
#KT-26428 Fixed
2018-09-18 14:38:26 +03:00
Anton Bannykh
0660e4d616 [JS IR BE] support multimodule tests 2018-09-18 14:36:20 +03:00
Anton Bannykh
2e709a81fa [JS IR BE] Arrays, varargs 2018-09-18 14:36:20 +03:00
Mikhail Glukhikh
e24f68c357 Remove erroneous suspend delegate tests (not supported in 1.3) 2018-09-18 12:00:12 +03:00
Mikhail Glukhikh
65ee837bfe Fix testAddArrayOfTypeForJavaAnnotation (named arguments in 1.3) 2018-09-18 11:50:48 +03:00
Mikhail Glukhikh
140c5d7689 Fix AddAnnotationTarget.testWithJava from multi-file quick fix 2018-09-18 11:50:47 +03:00
Mikhail Glukhikh
b7da2ad675 RedundantSamConstructor: remove reformatting in inspection visitor
This fixes testNestedInterface
2018-09-18 11:50:45 +03:00
Mikhail Glukhikh
6cb1ba9d41 Switch off ResultIsResultInspection as no more necessary for 1.3 2018-09-18 11:50:44 +03:00
Mikhail Glukhikh
94789c50b9 Do not suggest adding 'name =' before single vararg argument
This fixes two named argument intention tests
2018-09-18 11:50:43 +03:00
Mikhail Glukhikh
9694882db6 Fix testEnumClass (implementAsConstructorParameter) 2018-09-18 11:50:42 +03:00
Mikhail Glukhikh
b6c4bd270c Switch testCoroutineContext to release coroutines thus fixing it 2018-09-18 11:50:41 +03:00
Mikhail Glukhikh
2e2b15853e Suppress RESULT_CLASS_IN_RETURN_TYPE in ResultIsResultInspection tests
This fixes four relevant inspection tests
2018-09-18 11:50:40 +03:00
Mikhail Glukhikh
54e7fe6c52 Add language version 1.2 to mod-related inspection test thus fixing it
This does not work in 1.3 because mod is no more supported
2018-09-18 11:50:39 +03:00
Mikhail Glukhikh
2473362373 ArrayInDataClass test: replace Arrays functions with Kotlin ones
This fixes relevant inspection test
2018-09-18 11:50:38 +03:00
Mikhail Glukhikh
4a3af36909 Remove SHOULD_FAIL_WITH from testQuotesName thus fixing it 2018-09-18 11:50:37 +03:00
Mikhail Glukhikh
3014c3b33b Add new error from 1.3 into testIncorrectArgs thus fixing it 2018-09-18 11:50:36 +03:00
Mikhail Glukhikh
362ee126d1 Add language version 1.2 to quick-fix tests for companion in interface
In 1.3, companion members in interface can be annotated with JvmField,
so fix replacing JvmField with const is no more actual.
This fixes testCompanionInInterface.
2018-09-18 11:50:35 +03:00
Mikhail Glukhikh
81406a2bac Change .hashCode() to .bar() for some nullability fixes tests
Hash code can be no more used because in 1.3 we have nullable extension.
This fixes two wrap with safe let call tests and
one surround with null check test.
2018-09-18 11:50:34 +03:00
Mikhail Glukhikh
0f8b46b7d7 Add language version 1.2 to quick-fix tests for add explicit import
This fixes tests for KT-21515
2018-09-18 11:50:33 +03:00
Mikhail Glukhikh
39d28f1c92 AddAnnotationTargetTest: replace retention annotation if needed
This fixes testExpression3 from this test group
2018-09-18 11:50:32 +03:00
Mikhail Glukhikh
2bba4f5aa8 Fix two obsoleteCoroutines tests 2018-09-18 11:50:30 +03:00
Ilya Chernikov
7dd168d4ef [minor] remove dumping of the proguard config to the wrong file 2018-09-18 08:36:47 +02:00
Ilmir Usmanov
3bb405bee4 Minor. Move SUSPENSION_POINT_INSIDE_MONITOR to ErrorsJvm 2018-09-17 20:22:49 +03:00
Yan Zhulanow
139c582ce2 Minor: Fix missing 'ifEmpty()' 2018-09-17 20:08:28 +03:00
Yan Zhulanow
8db5fd4b9b Add missing empty bunches for AS 3.3 2018-09-17 20:08:27 +03:00
Yan Zhulanow
373ddcf55d Fix compatibility with JPS-standalone (KT-26777) 2018-09-17 20:08:27 +03:00
Yan Zhulanow
d5f203a978 Add a missing write action to KotlinNativeApplicationComponent 2018-09-17 20:08:27 +03:00
Yan Zhulanow
b38e9b6b05 Make all intellij-core dependencies non-transitive 2018-09-17 20:08:27 +03:00
Yan Zhulanow
39f5418c01 Update Android Studio 3.2 version 2018-09-17 20:08:27 +03:00
Ilmir Usmanov
35056543a2 Fix LVT entries of 'this' and parameters in coroutine code
#KT-24510 Fixed
2018-09-17 20:03:51 +03:00
Ilmir Usmanov
2dd5b8fa70 Forbid suspension points in critical sections
#KT-26480: Fixed
2018-09-17 19:29:51 +03:00
Denis Zharkov
a4b2e5964a Do not build dummy light classes for serialization-related classes
Otherwise, whether LazyLightClassMemberMatchingError happens
or other type of errors because serialization plugin expects
full resolution in the correct module

Currently, only @Serializable annotation leads to exceptions,
but just in case we consider both of them as potentially problematic

 #KT-26895 Fixed
2018-09-17 19:09:40 +03:00
Leonid Startsev
fe9ce45e1d Add initialization of constantValueGenerator for correct work
Exception was thrown from serialization plugin after compiler
refactoring
2018-09-17 19:07:10 +03:00
Ilya Gorbunov
cb47b0cde1 Fix sourcemap of stdlib/js to include new source sets 2018-09-17 17:58:28 +03:00
Ilya Gorbunov
f4af656e20 Remove entire stdlib opt-in for unsigned types to control precisely where they are exposed 2018-09-17 17:58:27 +03:00
Dmitry Petrov
97999a6415 Update testData for public API tests
Internal constructors for UIntProgression and ULongProgression are now
correctly detected as non-public API (because of proper metadata).
2018-09-17 17:28:52 +03:00
Mikhail Zarechenskiy
ea69d26bac Don't throw exception on error types in light classes mode
#KT-26829 Fixed
 #KT-26827 Fixed
2018-09-17 16:21:07 +03:00
Mikhail Zarechenskiy
fa9a3868b7 Make generation of assertions for platform types aware of kotlin types
#KT-26859 Fixed
2018-09-17 16:21:06 +03:00
Mikhail Zarechenskiy
03ea8603ce Do not try building light classes for inline classes in dumb mode
Generation of inline classes is quite complicated: we mangle methods,
 add stubs and synthesized methods. So, for simplicity, to avoid
 logic duplication in dummy resolve and in the backend, currently we
 will use only the latter for light classes generation

 #KT-26843 Fixed
2018-09-17 16:21:04 +03:00
Mikhail Zarechenskiy
7d2bc5c0f6 Properly load top-level constant initializers from multifile classes
Before Kotlin 1.3-M2 we didn't write `has_field` flag for constants
 inside multifile classes. Now we write and rely on this when
 trying to load constant initializers, which is totally fine for
 binaries that were compiled with the 1.3-M2 or newer version.
 Unfortunately, constant initializers will not be loaded for old binaries.

 One way is to avoid relying on this flag, but then we'll get other
 problems (e.g. 3345dc81fd).

 Therefore, for binaries that were compiled with at least 1.3-M2 version,
 we'll rely on the flag, otherwise, we won't.
2018-09-17 16:21:02 +03:00
Mikhail Zarechenskiy
8e66dadb47 Add regression test for KT-26806
#KT-26806
2018-09-17 16:21:01 +03:00
Roman Artemev
e242a8b08b Unmute tests 2018-09-17 15:29:19 +03:00
Roman Artemev
affc827998 [JS IR BE] Support 1.3 coroutines in backend 2018-09-17 15:29:18 +03:00
Roman Artemev
c0ef1311ba [JS IR BE] Fix runtime for Release coroutines 2018-09-17 15:29:16 +03:00
Roman Artemev
c4ddf2e9ae Enable release coroutine tests in JS IR 2018-09-17 14:52:44 +03:00
Roman Artemev
323602eb5f Skip expect declaration 2018-09-17 14:52:44 +03:00
Roman Artemev
a8b44c9e18 [JS IR BE] Fix Ir Copier
* use symbol table to allocate classifier for IrType
2018-09-17 14:52:44 +03:00
Roman Artemev
6bb77ba51d [JS IR BE] Get rid of parameters in doResume method. Make its signature similar for both 1.2 and 1.3 coroutines 2018-09-17 14:52:44 +03:00
Pavel V. Talanov
e66f3fa59e Remove as33 bunches specific to mpp run configs
It is now compatible with 182 branch
2018-09-17 13:51:17 +02:00
Pavel V. Talanov
20b86d85c3 as33 branch 'since-build' is 182.4129.33 2018-09-17 13:51:15 +02:00
Pavel V. Talanov
9cbc87ce57 Update as33 branch to AS3.3 canary 10 release 2018-09-17 13:51:14 +02:00
Ilya Matveev
e1e02b072b Use Kotlin/Native 0.9.1 (#1872) 2018-09-17 14:30:14 +03:00
Ilya Matveev
82baf6cbb1 Don't add cinterop libraries in compilation output (#1871) 2018-09-17 14:29:10 +03:00
Denis Zharkov
956f8ad5e9 Support deserialized contracts in common code
#KT-26687 Fixed
2018-09-17 12:48:42 +03:00
Alexander Podkhalyuzin
ed8aad6149 Override completion right after override modifier
#KT-25312 Fixed
2018-09-17 12:23:59 +03:00
Nikolay Krasko
073f4f51fd Clean accidentally committed temporary code 2018-09-17 11:28:22 +03:00
Ilya Matveev
ea1abb0680 Provide a DSL for publication settings (#1869)
* Provide a DSL for publication settings
* Rename DSL method publication -> mavenPublication
* Fix gradle task input/output validation

 #KT-26771 fixed.
2018-09-17 11:04:55 +03:00
Ilya Gorbunov
1b889c976a Use new sequence builders in tests
Coroutine tests will fail when LV=1.2 because there're no such builders
in kotlin.coroutines.experimental.

#KT-26678
2018-09-16 23:30:36 +03:00
Ilya Gorbunov
7a7fa56d74 [JS IR BE] New sequence builder mocks for building stdlib
#KT-26678
2018-09-16 23:30:36 +03:00
Ilya Gorbunov
aac96c476a Rename sequence and iterator builder functions and their scope class
This introduces new functions instead of the existing sequence builders:
- `sequence` instead of `buildSequence`
- `iterator` instead of `buildIterator`
- `SequenceScope` instead of `SequenceBuilder`

The old functions were deprecated with error and made inline-only, and `SequenceBuilder` has been
made a deprecated typealias to `SequenceScope`.

Move sequence builders to `SequencesKt` facade class.

Replace sequence builder usages in stdlib and samples.

#KT-26678
2018-09-16 23:30:35 +03:00
Ilya Gorbunov
9c812c6e2b Use new coroutines in samples 2018-09-16 23:30:32 +03:00
Roman Elizarov
4d3d376db8 InlineOnly Result.getOrNull method 2018-09-16 23:27:46 +03:00
Roman Elizarov
feb7239189 Removed SuccessOrFailure.
Left deprecated/error typealias to Result for 1.3-Mx users.
2018-09-16 23:27:45 +03:00
Roman Elizarov
1f675c8a74 Fixed unused exceptionOrNull result in map/mapCatching
(replaced with isSuccess check)
2018-09-16 23:27:45 +03:00
Ilya Chernikov
73907106e9 Fix script util tests after moving context utils to scripting-jvm 2018-09-16 22:24:59 +02:00
Nikolay Krasko
94e6f986e7 Mover to AS 3.2 RC 3 2018-09-16 15:52:35 +03:00
Nikolay Krasko
782aa94513 Bad indentation after annotation in incomplete declaration (KT-22322)
Same behavior is for any modifier in incomplete declaration.

 #KT-22322 Fixed
2018-09-16 15:52:34 +03:00
Nikolay Krasko
94531f992d Do not show incompatible error for *-rc13 coroutines (KT-26810)
#KT-26810 Fixed
2018-09-16 15:52:32 +03:00
Ilya Chernikov
d760299dc1 Implement context classpath extraction using particular class,...
Use it in the main-kts.
Also improve diagnoistics related to the definition loading.

#KT-26828 fixed (after this commit - finally, see also another related commit)
2018-09-15 15:44:53 +02:00
Ilya Chernikov
d9760f00f6 Move context classpath utils from script-util to scripting-jvm
since it is the right place to have it in the new structure.
Solves the problem that script-util classes not found then script
definition with context classpath is loaded by the scripting compiler
plugin, since script-util is not packed into embeddable plugin.
The old context utils are deprecated and in fact wrap the new utils.
#KT-26828 fixed (in fact - partially, see another related commit)
2018-09-15 15:43:53 +02:00
Alexey Sedunov
7b3973db52 MPP: Enable Android-specific content root logic for Android Studio
#KT-26813 Fixed
2018-09-14 21:27:10 +03:00
Anton Bannykh
082c44cb5c JS: add a flag for more convenient investigation of failing IR tests 2018-09-14 20:34:34 +03:00
Mikhail Glukhikh
382379d785 MPP wizard: remove kotlin-stdlib-native & kotlin-test-native deps
Related to KT-25952
2018-09-14 18:58:50 +03:00
Pavel V. Talanov
d3540a01a7 Jest/Mocha run config producers: fix searching for test runner package
#KT-26793 Fixed
2018-09-14 17:36:29 +02:00
Pavel V. Talanov
cbe3c69457 Gradle method/class configurations: support only jvm modules
Fixes a problem where invalid run configuration could be created
    for common module when 'Gradle Test Runner' option is selected
2018-09-14 17:36:29 +02:00
Alexey Sedunov
619e2bc0db MPP: Allow 'implements' relation only within the same Gradle project
Also allow COMMON modules on the "implementer" side
2018-09-14 17:33:59 +03:00
Mikhael Bogdanov
9e6637dced Don't generate additional annotations on synthetic accessors 2018-09-14 16:23:57 +02:00
Mikhael Bogdanov
b7afb4a58e Generate enum entries classes with package private visibility
#KT-6574 Fixed
2018-09-14 16:23:57 +02:00
Raluca Sauciuc
de989c4050 Expand the fix from commit 6c274cecff to cover AndroidX
Android Studio users who migrated to AndroidX are running into the
databinding deadlock again: https://issuetracker.google.com/111788726
2018-09-14 17:09:16 +03:00
Dmitriy Dolovov
0059fcceb9 [K/N] Safe determining Kotlin/Native meta version 2018-09-14 17:08:08 +03:00
Dmitry Petrov
88fb76bffc Fix annotations loading for inline class constructors 2018-09-14 16:09:41 +03:00
Alexey Sedunov
d5b3dc8a2a MPP: Exclude non-COMMON modules from 'implemented' list 2018-09-14 15:56:04 +03:00
Ilya Gorbunov
6bfb5c59a3 Make ResultTest common
Use custom exception type to avoid platform differences in toString implementation.
2018-09-14 15:32:25 +03:00
Ilya Gorbunov
b1c2daf1fe Stdlib: fix name shadowing and names of overridden method parameters 2018-09-14 15:32:25 +03:00
Ilya Gorbunov
bf4be12239 Stdlib: review and suppress warnings 2018-09-14 15:32:25 +03:00
Ilya Gorbunov
6786b9ece2 Stdlib tests: cleanup warnings 2018-09-14 15:32:08 +03:00
Ilya Gorbunov
7e0a658de7 Change nextInt/Long with range parameters from members to extensions
We'd like to fix the implementation of these methods, so we could intrinsify them later
or perform other optimizations that are not possible when these methods are open.
2018-09-14 15:15:52 +03:00
Ilya Gorbunov
928fe19801 Rename Random.next* parameters: remaining renames
- Correct docs after parameter renaming
- Rename parameters in Random inheritors
- Rename local variables

#KT-26596
2018-09-14 15:15:52 +03:00
kenji tomita
ffb83bbdf0 Rename Random.next* parameters from "origin, bound" to "from, until"
Rename Random test methods

#KT-26596
2018-09-14 15:15:52 +03:00
Ilya Matveev
ccd4bc1bff Add a project property for Kotlin/Native version overriding 2018-09-14 14:58:03 +03:00
Ilya Matveev
80bec0898f Download native compiler in configuration stage 2018-09-14 14:58:03 +03:00
Alexey Sedunov
5a64067601 MPP: Update gradle plugin version in new MPP tests 2018-09-14 14:51:02 +03:00
Alexey Sedunov
14d8425e27 MPP: Fix import of dependencies on Android modules 2018-09-14 14:51:01 +03:00
Alexey Sedunov
1de0dbd67d MPP: Configure Kotlin facets for Android modules
#KT-26770 Fixed
2018-09-14 14:51:01 +03:00
Alexey Sedunov
9253f88220 MPP: Exclude COMMON modules from implementation list 2018-09-14 14:51:01 +03:00
Alexey Sedunov
4970e90412 MPP: Add commonMain as a part of inter-project dependency
#KT-26383 Fixed
2018-09-14 14:51:01 +03:00
Alexey Sedunov
469b11e0aa MPP: Drop duplicating library produced by file collection dependency
#KT-26675 Fixed
2018-09-14 14:51:01 +03:00
Alexey Sedunov
5ac64bcc1d MPP: Match project dependencies by target elements task 2018-09-14 14:51:00 +03:00
Alexey Sedunov
a417630c24 MPP: Force COMMON platform for commonMain/commonTest source sets
Follow-up for 172/AS3.1 bunches
2018-09-14 14:51:00 +03:00
Alexander Udalov
863c0051ce Do not report deprecation on readBytes with API version < 1.3
#KT-26667 Fixed
2018-09-14 14:43:24 +03:00
Alexander Udalov
044419eda5 Minor, refactor DeprecationResolver.getOwnDeprecations
Make local function a member, inline another utility function
2018-09-14 14:43:23 +03:00
Alexander Udalov
5dc563a9af Split deprecationUtil.kt to several files, move to subpackage
Also move interface Deprecation to subpackage "deprecation"
2018-09-14 14:43:23 +03:00
Nikolay Krasko
c268dcecd2 Better parsing for external library name (KT-26794)
- Migration notification fixed
- Make fix for replacing old coroutines libraries applicable

 #KT-26794
2018-09-14 10:52:57 +03:00
Sergey Rostov
5fc2267665 JPS, Tests: Encapsulate libraries root paths used in JPS tests 2018-09-14 10:34:30 +03:00
Sergey Rostov
f1b97bb9be JPS: code cleanup 2018-09-14 10:34:30 +03:00
Sergey Rostov
39c76c7b11 JPS: fix daemon RPC serialization
#KT-26809 Fixed
2018-09-14 10:34:30 +03:00
Georgy Bronnikov
e712007904 Restore a test 2018-09-14 09:41:39 +03:00
Georgy Bronnikov
433afcd669 JVM_IR. Mute failing tests 2018-09-14 03:12:23 +03:00
Ilya Chernikov
a03bfb3561 Implement support for non-kts scripts in gradle
#KT-26784 fixed
2018-09-13 20:47:21 +02:00
Sergey Rostov
9ae478e4fc JPS, Tests: migrate to master 2018-09-13 20:40:21 +03:00
Sergey Rostov
81cf3fbc28 JPS, minor: rename KotlinModuleBuildTarget.updateSourcesList to computeSourcesList 2018-09-13 20:30:35 +03:00
Sergey Rostov
9e6d6ad9da JPS, native: skip and report native modules as not supported
#KT-26648 Fixed
2018-09-13 20:30:35 +03:00
Dmitriy Dolovov
0c94aefb87 Move NativeIdePlatformKind to idea-jps-common
Issue #KT-26714 Fixed
2018-09-13 20:30:34 +03:00
Sergey Rostov
c8351c3da0 JPS, -Xcommon-sources: write tests 2018-09-13 20:30:34 +03:00
Sergey Rostov
313c27859a JPS tests: support _dependencies.txt and _steps.txt for better files sorting 2018-09-13 20:30:34 +03:00
Sergey Rostov
1b93f07a76 JPS tests: support custom mpp multi module tests, rearrange test data files for more consistency, configure js modules with facet (not with stdlib dependency which should be deprecated), temporary mute some complex mpp tests 2018-09-13 20:30:33 +03:00
Sergey Rostov
8cd3b46f05 JPS, -Xcommon-sources: don't iterate on all sources, use root info from DirtySourceFilesHolder. Cleanup code.
Also:
- Pass `-Xcommon-sources` argument to JS compiler.
- Calculate all sources list only when needed (after change it is not required to calculate common-sources)
- Remove `chunk: ModuleChunk` parameter from some `KotlinModuleBuildTarget` functions.
2018-09-13 20:30:33 +03:00
Sergey Rostov
359909dcff JPS MPP tests: Don't do anything for common modules, enable js ic, fix test data 2018-09-13 20:30:33 +03:00
Sergey Rostov
4975ef7db5 JPS tests: restore MPP tests runner, support new MPP model 2018-09-13 20:30:32 +03:00
Sergey Rostov
808e83a01e JPS tests: switch to new dependencies.txt parser
Order of modules changed because new parser preserve order, while previously modules are accidentally sorted by hashCode().
2018-09-13 20:30:32 +03:00
Sergey Rostov
0b5a6f61bb JPS tests: move MockJavaConstantSearch to separate file to got rid of AbstractIncrementalJpsTest.kt.173 bunch file 2018-09-13 20:30:32 +03:00
Sergey Rostov
b8c982bb72 JPS: support -Xcommon-sources for multiplatform projects
#KT-26489 Fixed
2018-09-13 20:30:31 +03:00
Vyacheslav Gerasimov
9e701f96de Add changelog for 1.2.70 2018-09-13 20:18:09 +03:00
NikitaKatkov
d2536f207c 183: CoroutineNonBlockingContextChecker for warning on blocking calls in coroutines (KT-15525) 2018-09-13 19:36:51 +03:00
Denis Zharkov
341f7c348a Fix memory leak in KotlinBuiltins related to unsigned types
Having a map from ModuleDescriptor leads to modules leakage
Especially, it's critical for DefaultBuiltins which is used in JS

ModuleDescriptor's instances were leaked there forever until the daemon dies
(up to 350M while compiling Kotlin project itself)
2018-09-13 18:49:42 +03:00
Georgy Bronnikov
f04733ef33 JVM_IR. support big arity 2018-09-13 18:44:47 +03:00
Mikhael Bogdanov
03f092fd39 Revert "Generate private constructors for Enums" cause of bootstrap problem
This reverts commit 81435c9
2018-09-13 17:07:56 +02:00
Mikhail Glukhikh
76d1d6ff12 Allow to move suspend lambda out of parentheses
#KT-26674 Fixed
#KT-26676 Fixed
2018-09-13 16:38:29 +03:00
Alexander Udalov
3a5de13dd4 Support inline classes in function signatures in call/callBy
#KT-25664 Fixed
 #KT-26748 Open
 #KT-26765 Open
2018-09-13 16:04:20 +03:00
Alexander Udalov
3e79bd2b0e Make CallerImpl with subclasses a sealed hierarchy 2018-09-13 15:54:20 +03:00
Alexander Udalov
8c8f0639f8 Remove unneeded CallerImpl implementations
Also fix a bug where nullability of the assigned value was not checked
in ClassCompanionFieldSetter because it wasn't a subclass of FieldSetter
where this check occurred
2018-09-13 15:54:20 +03:00
Alexander Udalov
356b02cb91 Extract Caller interface out of FunctionCaller, move to subpackage
Also rename FunctionCaller to CallerImpl and extract irrelevant
declarations out of it
2018-09-13 15:40:38 +03:00
Alexander Udalov
43dcbbcce1 Minor, use arrayOf to simplify code in FunctionCaller 2018-09-13 15:40:38 +03:00
Natalia Selezneva
4b138ae2b8 Do not use async script dependencies resolver in tests 2018-09-13 14:50:22 +03:00
Nikolay Krasko
8be1929634 Title and description unification for coroutines migration inspection (KT-26472) 2018-09-13 11:26:59 +03:00
Nikolay Krasko
9bfbe8a90a Enable Maven fix for coroutines in migration (KT-26472)
#KT-26472 Fixed
2018-09-13 11:26:57 +03:00
Nikolay Krasko
504c9c02d7 Remove detection of new projects from the list of modules 2018-09-13 11:26:55 +03:00
Nikolay Krasko
a58f7b5599 Remove unneeded bunch file 2018-09-13 11:26:53 +03:00
Mikhael Bogdanov
81435c98fa Generate private constructors for Enums
#KT-2680 Fixed
  #KT-16867 Fixed
2018-09-13 10:09:58 +02:00
Mikhail Glukhikh
941e5ae1b2 Introduce MPP wizard for shared (JVM / JS / iOS) libraries
This implements second part of KT-25952
2018-09-13 10:52:46 +03:00
Mikhail Glukhikh
84587eb0f9 Kotlin JVM/JS multiplatform builder: change description 2018-09-13 10:52:23 +03:00
Mikhail Glukhikh
03820245eb Change KonanPlatform platform name: Konan -> Native #KT-26691 Fixed 2018-09-13 09:09:47 +03:00
Mikhail Glukhikh
6c49c1eabd NativeIdePlatformKind: remove redundant 2018-09-13 09:09:46 +03:00
Mikhail Glukhikh
e7a6ce3626 NativeIdePlatformKind: remove unused 2018-09-13 09:09:44 +03:00
Mikhail Glukhikh
df0d91ef9e Style fix: KotlinNativeModuleConfigurator 2018-09-13 09:09:43 +03:00
Ilya Gorbunov
9353cfb526 contentDeepToString: use list instead of set for infinite recursion tracking
#KT-26388
2018-09-13 06:10:10 +03:00
Ilya Gorbunov
2d356b89b5 Specialize contentDeepEquals/HashCode/ToString for arrays of unsigned types
#KT-26388
2018-09-13 06:10:10 +03:00
Ilya Gorbunov
3cc606577c Add annotations-13.0 in classpath of those tests where the annotations from stdlib were used 2018-09-13 02:41:19 +03:00
Ilya Gorbunov
f340bc9f91 Do not use deprecated org.junit.Test in gradle js integration tests 2018-09-12 21:42:48 +03:00
Denis Zharkov
e213dc261e Fix bunch files for test RunConfigurationTest 2018-09-12 19:48:03 +03:00
Alexander Podkhalyuzin
85ba637796 Light classes should reuse language versions settings during generation
#KT-26732 Fixed
2018-09-12 16:02:07 +03:00
Vyacheslav Gerasimov
c768130f89 Remove gradle/ext-releases-local repo, native platform is now available on jcenter 2018-09-12 15:52:15 +03:00
Ilmir Usmanov
e9fc65c7ae Use our own primitive boxing methods in coroutines codegen
#KT-26490 Fixed
2018-09-12 15:36:17 +03:00
Ilmir Usmanov
273889d1a9 Add our own primitive boxing methods to stdlib
These methods are very thin wrappers around primitive wrapper classes
constructors.
They are used by coroutines code which returns primitives and this way
HotSpot is able to throw the allocations away completely.
 #KT-26591 Fixed
2018-09-12 15:36:11 +03:00
Dmitry Petrov
792c5f8b3f Generate metadata and annotations for hidden constructor
Reflection expects to see a callable method for a hidden constructor,
thus, it should be a synthetic accessor.
JVM method signature in metadata should point to the synthetic accessor.
Annotations for hidden constructor should be written on the synthetic
accessor.
2018-09-12 15:33:11 +03:00
Ilmir Usmanov
3e3ffd14a9 Exclude kotlin.coroutines.intrinsics and kotlin.coroutines.jvm.internal
from default imports.
2018-09-12 15:22:51 +03:00
Alexander Udalov
f63cf9d506 Use JvmName on kotlin.Metadata parameters to improve public API
#KT-26359 Fixed
2018-09-12 14:37:11 +03:00
Denis Zharkov
8365836753 Fix as33-bunch for KotlinRunConfigurationProducer.kt after 38be1f6947 2018-09-12 14:03:07 +03:00
Alexander Udalov
6b2a1497e2 Advance bootstrap to 1.3.0-dev-496 2018-09-12 13:34:23 +03:00
victor.petukhov
50d9dbbfc1 Fix inheritance in stdlib contracts code (KT-26409) 2018-09-12 12:34:15 +03:00
victor.petukhov
cba99a1e67 Move test to negatives after fix KT-26382 2018-09-12 12:32:57 +03:00
Denis Zharkov
9bc5b753aa Fix 181-bunch for KotlinRunConfigurationProducer.kt after 38be1f6947 2018-09-12 11:47:33 +03:00
Anton Bannykh
b389e29db5 JS: update DCE testdata 2018-09-12 09:49:25 +03:00
Anton Bannykh
ead9b31e03 JS: support [suspend] fun main([args: Array<String>]) (KT-26628, KT-26572 fixed) 2018-09-12 09:49:25 +03:00
Denis Zharkov
7e9704e50d Prohibit inheritance of Java members containing FunctionN types
#KT-25855 Fixed
2018-09-12 09:49:25 +03:00
Denis Zharkov
24a905293f Load Java declarations which reference FunctionN as Deprecated.Error
#KT-25855 Fixed
2018-09-12 09:49:25 +03:00
Denis Zharkov
bcf1b9c804 Minor. Reformat SignatureEnhancement 2018-09-12 09:49:25 +03:00
Denis Zharkov
7f4f07659c Minor. Move Deprecation and DeprecationLevel interfaces to core 2018-09-12 09:49:25 +03:00
Denis Zharkov
9cb8a35275 Minor. Pull user-data related things to CallableDescriptor
Currently, we assume user data for all non-FunctionDescriptor
declarations is empty
2018-09-12 09:49:25 +03:00
Denis Zharkov
c1cc722ac4 Turn off incorrect switch-optimization for when by enums
#KT-24708 Fixed
2018-09-12 09:49:25 +03:00
Denis Zharkov
fc3c4ad883 Support parameterless and suspend main functions in multifile classes
#KT-26574 Fixed
2018-09-12 09:49:25 +03:00
Denis Zharkov
b53194ef1a Minor. Drop unused method in FunctionCodegen 2018-09-12 09:49:25 +03:00
Denis Zharkov
aa74511378 Fix UnusedSymbolInspection for parameterless and suspend main functions
#KT-26574 Fixed
2018-09-12 09:49:25 +03:00
Denis Zharkov
1cc0c12f87 Add language feature for extended main convention
- suspend
- parameterless

 #KT-17679 Fixed
 #KT-26574 Fixed
2018-09-12 09:49:25 +03:00
Denis Zharkov
f79fbe778f Minor. Extract KtElement::isMainFunction in the IDE context 2018-09-12 09:49:25 +03:00
Denis Zharkov
38be1f6947 Minor. Parametrize MainFunctionDetector with LanguageVersionSettings 2018-09-12 09:49:25 +03:00
Denis Zharkov
bc722f9c5f Support main entry-point without arguments in JVM
#KT-26574 In Progress
2018-09-12 09:48:13 +03:00
Denis Zharkov
2c920b732c Support main entry-point without arguments in frontend
#KT-26574 In Progress
2018-09-12 09:48:13 +03:00
Denis Zharkov
3cf1c56794 Minor. Get rid of static public parts in MainFunctionDetector
In further commits, MainFunctionDetector::isMain will use
getFunctionDescriptor property
2018-09-12 09:48:13 +03:00
Denis Zharkov
c3f6ba3302 Support suspend fun main in JVM
#KT-17679 Fixed
2018-09-12 09:48:13 +03:00
Denis Zharkov
272ee252d8 Report warning on "suspend {}"-like calls based on variable
#KT-22892 Fixed
2018-09-12 09:48:13 +03:00
Denis Zharkov
b9f141d4aa Forbid suspend functions annotated with @kotlin.test.Test
#KT-26200 Fixed
2018-09-12 09:48:13 +03:00
Ilya Gorbunov
a18770fbbb Remove projectDist dependency helper usages
Use default configuration dependencies instead of projectDist ones.
2018-09-12 06:05:05 +03:00
Ilya Gorbunov
03340d770b Replace remaining distJar dependencies with default configuration dependencies 2018-09-12 06:05:05 +03:00
Pavel V. Talanov
ef915096a5 Common tests are discoverable via platform modules test classpath
Introduce KotlinGradleOrderEnumerationHandler
    and patch KotlinAndroidGradleOrderEnumerationHandler:
    - If 'Android Support' plugin is off KAndroidGradleOEH will not be available and KGOEH will be used
    - Make KAndroidGOEH implement a different EP so it replaces KGOEH when it is available
2018-09-12 04:13:32 +02:00
Pavel V. Talanov
4b0bc4a438 Try to distinguish between test/production compilations 2018-09-12 04:13:32 +02:00
Pavel V. Talanov
ee1ec22e4c Implement MultipleRunLocationsProvider EP
Provide run locations corresponding to platform modules when invoked from common code
2018-09-12 04:13:32 +02:00
Pavel V. Talanov
3da9d79fc2 KtFile.getClasses() returns empty array for non-jvm files 2018-09-12 04:13:32 +02:00
Pavel V. Talanov
3a2d25a422 Js run configuration producers: get module from ConfigurationContext
Delegate mpp concerns to MultipleRunLocationsProvider EP
Restore old behaviour via bunch files
2018-09-12 04:13:31 +02:00
Pavel V. Talanov
456bf9808d Configuration providers don't create configurations for common code
Remove special code that creates configurations
    and patches them for common modules
This should be done via MultipleRunLocationsProvider EP
2018-09-12 04:13:31 +02:00
Pavel V. Talanov
25882c5b46 Minor: add is(New)MPPModule utils 2018-09-12 04:13:31 +02:00
Pavel V. Talanov
472be61356 182 branch since-build is 182.4129.33
To allow use of the latest API
2018-09-12 04:13:31 +02:00
Ilya Gorbunov
c4e794b21f Add nullability annotations jar to debugger test application compile classpath 2018-09-12 00:58:55 +03:00
Ilya Gorbunov
41a8678b95 Remove mutability and nullability annotations from stdlib in kotlinc/lib
#KT-21784
2018-09-12 00:58:55 +03:00
Ilya Gorbunov
584410b14b Advance bootstrap to 1.3.0-dev-485 2018-09-12 00:55:14 +03:00
Alexander Udalov
e7807cc168 Skip prerelease check when building kotlin-stdlib-js-merger 2018-09-11 21:10:04 +03:00
Ilya Gorbunov
c1829782b7 Turn off compiler prerelease flag #KT-26643 2018-09-11 21:10:04 +03:00
Yan Zhulanow
59241a9c1f Minor: Remove unneeded import 2018-09-11 21:07:27 +03:00
Ilya Gorbunov
000e7493a1 Introduce common KCallable and K(Mutable)Property(ø,0,1,2) interfaces
#KT-25935
2018-09-11 19:21:15 +03:00
Ilya Gorbunov
7b46d22877 Introduce common KClass interface #KT-25935 2018-09-11 18:45:55 +03:00
23331 changed files with 742406 additions and 1021069 deletions

12
.bunch
View File

@@ -1,7 +1,7 @@
182
181
173_181
as31_173_181
as32_181
as33
191
192
183
182_183
as33_182_183
as34_183
as35

16
.gitignore vendored
View File

@@ -2,7 +2,7 @@
.idea/shelf
/android.tests.dependencies
/confluence/target
/dependencies
/dependencies/repo
/dist
/local
/gh-pages
@@ -15,10 +15,6 @@ workspace.xml
*.versionsBackup
/idea/testData/debugger/tinyApp/classes*
/jps-plugin/testData/kannotator
/ultimate/dependencies
/ultimate/ideaSDK
/ultimate/out
/ultimate/tmp
/js/js.translator/testData/out/
/js/js.translator/testData/out-min/
.gradle/
@@ -29,12 +25,20 @@ build/
!**/testData/**/*.iml
.idea/libraries/Gradle*.xml
.idea/libraries/Maven*.xml
.idea/artifacts
.idea/artifacts/PILL_*.xml
.idea/modules
.idea/runConfigurations/JPS_*.xml
.idea/runConfigurations/PILL_*.xml
.idea/libraries
.idea/modules.xml
.idea/gradle.xml
.idea/compiler.xml
.idea/inspectionProfiles/profiles_settings.xml
.idea/.name
.idea/artifacts/dist_auto_*
.idea/artifacts/ideaPlugin.xml
kotlin-ultimate/
node_modules/
.rpt2_cache/
libraries/tools/kotlin-test-nodejs-runner/lib/
local.properties

8
.idea/ant.xml generated
View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AntConfiguration">
<buildFile url="file://$PROJECT_DIR$/libraries/build-docs.xml">
<maximumHeapSize value="1024" />
</buildFile>
</component>
</project>

27
.idea/artifacts/dist.xml generated Normal file
View File

@@ -0,0 +1,27 @@
<component name="ArtifactManager">
<artifact build-on-make="true" name="dist">
<output-path>$PROJECT_DIR$/dist</output-path>
<root id="root">
<element id="directory" name="artifacts">
<element id="directory" name="ideaPlugin">
<element id="artifact" artifact-name="ideaPlugin" />
</element>
</element>
<element id="file-copy" path="$PROJECT_DIR$/build/build.txt" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-minimal-for-test/1.3.40-dev-2251/4145ea97e69951b7d0b9aa24c90a592bbcc72946/kotlin-stdlib-minimal-for-test-1.3.40-dev-2251.jar" output-file-name="kotlin-stdlib-minimal-for-test.jar" />
<element id="directory" name="common">
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.40-dev-2251/24bdcd80883f6a666d82154b6246dc140bec19a3/kotlin-stdlib-common-1.3.40-dev-2251.jar" output-file-name="kotlin-stdlib-common.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.40-dev-2251/4f0392a2211ee3d1512f1d01ae98fe2f86448ad2/kotlin-stdlib-common-1.3.40-dev-2251-sources.jar" output-file-name="kotlin-stdlib-common-sources.jar" />
</element>
<element id="directory" name="js">
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-js/1.3.40-dev-2251/65ace589f8f9359ac30790244b1c473297f722d1/kotlin-stdlib-js-1.3.40-dev-2251.jar" path-in-jar="/" />
</element>
<element id="directory" name="maven">
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.40-dev-2251/596156dc7a263af8008dc5fd1a6d649d2cfbbfc2/kotlin-stdlib-1.3.40-dev-2251-sources.jar" output-file-name="kotlin-stdlib-sources.jar" />
</element>
<element id="directory" name="kotlinc">
<element id="artifact" artifact-name="kotlinc" />
</element>
</root>
</artifact>
</component>

View File

@@ -0,0 +1,29 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlin-compiler-client-embeddable.jar">
<output-path>$PROJECT_DIR$/out/artifacts/kotlin_compiler_client_embeddable_jar</output-path>
<root id="archive" name="kotlin-compiler-client-embeddable.jar">
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/prepare/compiler-client-embeddable/build/tmp/shadowJar/MANIFEST.MF" />
</element>
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform/0.14/48341d68b4456bea76ca952b6d38b877881350f7/native-platform-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-amd64-libcpp/0.14/b45561900830d676e9e0040561e68abe86fbc10e/native-platform-freebsd-amd64-libcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-amd64-libstdcpp/0.14/bcc4e58ef4db56052fe9512d2d1265f11dc9242f/native-platform-freebsd-amd64-libstdcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-i386-libcpp/0.14/50b15724c82808c2b7fefd9b0b7c6dd977623f35/native-platform-freebsd-i386-libcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-i386-libstdcpp/0.14/d98be0a75890523a6a70dc93795101145828a5da/native-platform-freebsd-i386-libstdcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64/0.14/d0ac539a32015e91e309c20e493d220aae88811b/native-platform-linux-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64-ncurses5/0.14/6dece223855317a75c371fb72d826582893351c6/native-platform-linux-amd64-ncurses5-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64-ncurses6/0.14/8effac668ad781893fc33fd86f993c5de559d355/native-platform-linux-amd64-ncurses6-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386/0.14/6576c08a9a514a6ae5623e6f8da04502cac23bde/native-platform-linux-i386-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386-ncurses5/0.14/80ec77af683abeaa58ed11b9c2cad2d02837e55f/native-platform-linux-i386-ncurses5-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386-ncurses6/0.14/615dea7e75ca704bba1de9b671652283a9743894/native-platform-linux-i386-ncurses6-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-osx-amd64/0.14/5e5c113c32c0bac5cf2dcd3a59e4b021023d86a1/native-platform-osx-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-osx-i386/0.14/fd86b7eedbf5a0df003cf946f0b0c80c06c103ee/native-platform-osx-i386-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-windows-amd64/0.14/bdf519fab10700fadc9953526a07e8104fad1d07/native-platform-windows-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-windows-i386/0.14/65b00e123554f42ecd0da054a747033be5da608d/native-platform-windows-i386-0.14.jar" path-in-jar="/" />
<element id="module-output" name="kotlin.compiler.cli-common.main" />
<element id="module-output" name="kotlin.compiler.daemon-common.main" />
<element id="module-output" name="kotlin.kotlin-compiler-client-embeddable.main" />
<element id="module-output" name="kotlin.kotlin-daemon-client.main" />
</root>
</artifact>
</component>

74
.idea/artifacts/kotlin_compiler_jar.xml generated Normal file
View File

@@ -0,0 +1,74 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlin-compiler.jar">
<output-path>$PROJECT_DIR$/out/artifacts/kotlin_compiler_jar</output-path>
<root id="archive" name="kotlin-compiler.jar">
<element id="directory" name="META-INF">
<element id="directory" name="extensions">
<element id="file-copy" path="$PROJECT_DIR$/idea/resources/META-INF/extensions/compiler.xml" />
</element>
<element id="file-copy" path="$PROJECT_DIR$/prepare/compiler/build/tmp/packCompiler/MANIFEST.MF" />
</element>
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/builtins/1.3.40-dev-2251/27e044e9fe780181a3c27ba4c78496a4ede00ba8/builtins-1.3.40-dev-2251.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/repo/kotlin.build/ideaIC/191.6707.61/artifacts/lib/asm-all-7.0.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/repo/kotlin.build/ideaIC/191.6707.61/artifacts/lib/guava-25.1-jre.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/repo/kotlin.build/intellij-core/191.6707.61/artifacts/intellij-core.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.fusesource.jansi/jansi/1.16/b1aaf0028852164ab6b4057192ccd0ba7dedd3a5/jansi-1.16.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/repo/kotlin.build/intellij-core/191.6707.61/artifacts/java-compatibility-1.0.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/io.javaslang/javaslang/2.0.6/415b0d40db4890849270c2a5cb50050fc6ee7636/javaslang-2.0.6.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/io.javaslang/javaslang-match/2.0.6/d57a666939103b659813de52102d3ff0baa8ad5f/javaslang-match-2.0.6.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/javax.inject/javax.inject/1/6975da39a7040257bd51d21a231b76c915872d38/javax.inject-1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/repo/kotlin.build/ideaIC/191.6707.61/artifacts/lib/jdom.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jline/jline/3.3.1/d8a30137fe4ee2246b71b3915baac767d348c5bb/jline-3.3.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/repo/kotlin.build/ideaIC/191.6707.61/artifacts/lib/jna-platform.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/repo/kotlin.build/ideaIC/191.6707.61/artifacts/lib/jna.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/repo/kotlin.build/jps-standalone/191.6707.61/artifacts/jps-model.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/1.3.9/40719ea6961c0cb6afaeb6a921eaa1f6afd4cfdf/jsr305-1.3.9.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core/1.0.1/f33e8dab753f33d1bbb07cca664fd6f13d993d7e/kotlinx-coroutines-core-1.0.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/repo/kotlin.build/ideaIC/191.6707.61/artifacts/lib/log4j.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/repo/kotlin.build/ideaIC/191.6707.61/artifacts/lib/lz4-1.3.0.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/repo/kotlin.build/ideaIC/191.6707.61/artifacts/lib/oro-2.0.8.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/repo/kotlin.build/ideaIC/191.6707.61/artifacts/lib/picocontainer-1.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/protobuf-relocated/2.6.1/9a9536949348fae596f4878243dffd0ed351993d/protobuf-relocated-2.6.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/repo/kotlin.build/ideaIC/191.6707.61/artifacts/lib/streamex-0.6.7.jar" path-in-jar="/" />
<element id="module-output" name="kotlin.compiler.backend-common.main" />
<element id="module-output" name="kotlin.compiler.backend.js.main" />
<element id="module-output" name="kotlin.compiler.backend.jvm.main" />
<element id="module-output" name="kotlin.compiler.backend.main" />
<element id="module-output" name="kotlin.compiler.cli-common.main" />
<element id="module-output" name="kotlin.compiler.cli.main" />
<element id="module-output" name="kotlin.compiler.main" />
<element id="module-output" name="kotlin.compiler.container.main" />
<element id="module-output" name="kotlin.compiler.daemon-common.main" />
<element id="module-output" name="kotlin.compiler.daemon.main" />
<element id="module-output" name="kotlin.core.descriptors.jvm.main" />
<element id="module-output" name="kotlin.core.descriptors.main" />
<element id="module-output" name="kotlin.core.deserialization.main" />
<element id="module-output" name="kotlin.compiler.frontend.java.main" />
<element id="module-output" name="kotlin.compiler.frontend.main" />
<element id="module-output" name="kotlin.compiler.incremental-compilation-impl.main" />
<element id="module-output" name="kotlin.compiler.ir.backend.common.main" />
<element id="module-output" name="kotlin.compiler.ir.psi2ir.main" />
<element id="module-output" name="kotlin.compiler.ir.tree.main" />
<element id="module-output" name="kotlin.js.js.ast.main" />
<element id="module-output" name="kotlin.js.js.dce.main" />
<element id="module-output" name="kotlin.js.js.frontend.main" />
<element id="module-output" name="kotlin.js.js.parser.main" />
<element id="module-output" name="kotlin.js.js.serializer.main" />
<element id="module-output" name="kotlin.js.js.translator.main" />
<element id="module-output" name="kotlin.kotlin-build-common.main" />
<element id="module-output" name="kotlin.compiler.light-classes.main" />
<element id="module-output" name="kotlin.core.metadata.jvm.main" />
<element id="module-output" name="kotlin.core.metadata.main" />
<element id="module-output" name="kotlin.compiler.plugin-api.main" />
<element id="module-output" name="kotlin.compiler.psi.main" />
<element id="module-output" name="kotlin.compiler.resolution.main" />
<element id="module-output" name="kotlin.compiler.serialization.main" />
<element id="module-output" name="kotlin.core.util.runtime.main" />
<element id="module-output" name="kotlin.compiler.util.main" />
<element id="module-output" name="kotlin.compiler.frontend.common.main" />
<element id="module-output" name="kotlin.core.type-system.main" />
<element id="module-output" name="kotlin.compiler.ir.serialization.common.main" />
<element id="module-output" name="kotlin.compiler.ir.serialization.js.main" />
</root>
</artifact>
</component>

View File

@@ -0,0 +1,27 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlin-daemon-client.jar">
<output-path>$PROJECT_DIR$/out/artifacts/kotlin_daemon_client_jar</output-path>
<root id="archive" name="kotlin-daemon-client.jar">
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform/0.14/48341d68b4456bea76ca952b6d38b877881350f7/native-platform-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-amd64-libcpp/0.14/b45561900830d676e9e0040561e68abe86fbc10e/native-platform-freebsd-amd64-libcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-amd64-libstdcpp/0.14/bcc4e58ef4db56052fe9512d2d1265f11dc9242f/native-platform-freebsd-amd64-libstdcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-i386-libcpp/0.14/50b15724c82808c2b7fefd9b0b7c6dd977623f35/native-platform-freebsd-i386-libcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-i386-libstdcpp/0.14/d98be0a75890523a6a70dc93795101145828a5da/native-platform-freebsd-i386-libstdcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64/0.14/d0ac539a32015e91e309c20e493d220aae88811b/native-platform-linux-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64-ncurses5/0.14/6dece223855317a75c371fb72d826582893351c6/native-platform-linux-amd64-ncurses5-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64-ncurses6/0.14/8effac668ad781893fc33fd86f993c5de559d355/native-platform-linux-amd64-ncurses6-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386/0.14/6576c08a9a514a6ae5623e6f8da04502cac23bde/native-platform-linux-i386-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386-ncurses5/0.14/80ec77af683abeaa58ed11b9c2cad2d02837e55f/native-platform-linux-i386-ncurses5-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386-ncurses6/0.14/615dea7e75ca704bba1de9b671652283a9743894/native-platform-linux-i386-ncurses6-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-osx-amd64/0.14/5e5c113c32c0bac5cf2dcd3a59e4b021023d86a1/native-platform-osx-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-osx-i386/0.14/fd86b7eedbf5a0df003cf946f0b0c80c06c103ee/native-platform-osx-i386-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-windows-amd64/0.14/bdf519fab10700fadc9953526a07e8104fad1d07/native-platform-windows-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-windows-i386/0.14/65b00e123554f42ecd0da054a747033be5da608d/native-platform-windows-i386-0.14.jar" path-in-jar="/" />
<element id="module-output" name="kotlin.compiler.daemon-common.main" />
<element id="module-output" name="kotlin.kotlin-daemon-client.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/compiler/daemon/daemon-client/build/tmp/shadowJar/MANIFEST.MF" />
</element>
</root>
</artifact>
</component>

View File

@@ -0,0 +1,12 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlin-imports-dumper-compiler-plugin.jar">
<output-path>$PROJECT_DIR$/out/artifacts/kotlin_imports_dumper_compiler_plugin_jar</output-path>
<root id="archive" name="kotlin-imports-dumper-compiler-plugin.jar">
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/imports-dumper/build/tmp/jar/MANIFEST.MF" />
</element>
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-serialization-runtime/0.4.2/e343c68c9fa77a190225484c1e03b1485fbb5f1f/kotlinx-serialization-runtime-0.4.2.jar" path-in-jar="/" />
<element id="module-output" name="kotlin.kotlin-imports-dumper-compiler-plugin.main" />
</root>
</artifact>
</component>

View File

@@ -0,0 +1,39 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlin-jps-plugin.jar">
<output-path>$PROJECT_DIR$/out/artifacts/kotlin_jps_plugin_jar</output-path>
<root id="archive" name="kotlin-jps-plugin.jar">
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/prepare/jps-plugin/build/tmp/jar/MANIFEST.MF" />
</element>
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform/0.14/48341d68b4456bea76ca952b6d38b877881350f7/native-platform-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-amd64-libcpp/0.14/b45561900830d676e9e0040561e68abe86fbc10e/native-platform-freebsd-amd64-libcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-amd64-libstdcpp/0.14/bcc4e58ef4db56052fe9512d2d1265f11dc9242f/native-platform-freebsd-amd64-libstdcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-i386-libcpp/0.14/50b15724c82808c2b7fefd9b0b7c6dd977623f35/native-platform-freebsd-i386-libcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-i386-libstdcpp/0.14/d98be0a75890523a6a70dc93795101145828a5da/native-platform-freebsd-i386-libstdcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64/0.14/d0ac539a32015e91e309c20e493d220aae88811b/native-platform-linux-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64-ncurses5/0.14/6dece223855317a75c371fb72d826582893351c6/native-platform-linux-amd64-ncurses5-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64-ncurses6/0.14/8effac668ad781893fc33fd86f993c5de559d355/native-platform-linux-amd64-ncurses6-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386/0.14/6576c08a9a514a6ae5623e6f8da04502cac23bde/native-platform-linux-i386-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386-ncurses5/0.14/80ec77af683abeaa58ed11b9c2cad2d02837e55f/native-platform-linux-i386-ncurses5-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386-ncurses6/0.14/615dea7e75ca704bba1de9b671652283a9743894/native-platform-linux-i386-ncurses6-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-osx-amd64/0.14/5e5c113c32c0bac5cf2dcd3a59e4b021023d86a1/native-platform-osx-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-osx-i386/0.14/fd86b7eedbf5a0df003cf946f0b0c80c06c103ee/native-platform-osx-i386-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-windows-amd64/0.14/bdf519fab10700fadc9953526a07e8104fad1d07/native-platform-windows-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-windows-i386/0.14/65b00e123554f42ecd0da054a747033be5da608d/native-platform-windows-i386-0.14.jar" path-in-jar="/" />
<element id="module-output" name="kotlin.compiler.cli-common.main" />
<element id="module-output" name="kotlin.compiler.daemon-common.main" />
<element id="module-output" name="kotlin.core.descriptors.jvm.main" />
<element id="module-output" name="kotlin.core.descriptors.main" />
<element id="module-output" name="kotlin.idea.idea-jps-common.main" />
<element id="module-output" name="kotlin.jps-plugin.main" />
<element id="module-output" name="kotlin.kotlin-build-common.main" />
<element id="module-output" name="kotlin.kotlin-compiler-runner.main" />
<element id="module-output" name="kotlin.kotlin-daemon-client.main" />
<element id="module-output" name="kotlin.kotlin-preloader.main" />
<element id="module-output" name="kotlin.core.util.runtime.main" />
<element id="module-output" name="kotlin.compiler.util.main" />
<element id="module-output" name="kotlin.core.type-system.main" />
<element id="file-copy" path="$PROJECT_DIR$/resources/kotlinManifest.properties" />
</root>
</artifact>
</component>

17
.idea/artifacts/kotlin_main_kts_jar.xml generated Normal file
View File

@@ -0,0 +1,17 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlin-main-kts.jar">
<output-path>$PROJECT_DIR$/out/artifacts/kotlin_main_kts_jar</output-path>
<root id="archive" name="kotlin-main-kts.jar">
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/kotlin-main-kts/build/tmp/packJar/MANIFEST.MF" />
</element>
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.ivy/ivy/2.4.0/5abe4c24bbe992a9ac07ca563d5bd3e8d569e9ed/ivy-2.4.0.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core/1.0.1/f33e8dab753f33d1bbb07cca664fd6f13d993d7e/kotlinx-coroutines-core-1.0.1.jar" path-in-jar="/" />
<element id="module-output" name="kotlin.kotlin-main-kts.main" />
<element id="module-output" name="kotlin.kotlin-script-runtime.main" />
<element id="module-output" name="kotlin.kotlin-script-util.main" />
<element id="module-output" name="kotlin.kotlin-scripting-common.main" />
<element id="module-output" name="kotlin.kotlin-scripting-jvm.main" />
</root>
</artifact>
</component>

22
.idea/artifacts/kotlin_reflect_jar.xml generated Normal file
View File

@@ -0,0 +1,22 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlin-reflect.jar">
<output-path>$PROJECT_DIR$/out/artifacts/kotlin_reflect_jar</output-path>
<root id="archive" name="kotlin-reflect.jar">
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/reflect/build/tmp/result/MANIFEST.MF" />
</element>
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/javax.inject/javax.inject/1/6975da39a7040257bd51d21a231b76c915872d38/javax.inject-1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/protobuf-lite/2.6.1/9af39e6d6cbd4404d06ae2ae63505b6247e6760b/protobuf-lite-2.6.1.jar" path-in-jar="/" />
<element id="module-output" name="kotlin.core.descriptors.jvm.main" />
<element id="module-output" name="kotlin.core.descriptors.runtime.main" />
<element id="module-output" name="kotlin.core.descriptors.main" />
<element id="module-output" name="kotlin.core.deserialization.main" />
<element id="module-output" name="kotlin.kotlin-reflect-api.main" />
<element id="module-output" name="kotlin.kotlin-reflect.main" />
<element id="module-output" name="kotlin.core.metadata.jvm.main" />
<element id="module-output" name="kotlin.core.metadata.main" />
<element id="module-output" name="kotlin.core.util.runtime.main" />
<element id="module-output" name="kotlin.core.type-system.main" />
</root>
</artifact>
</component>

255
.idea/artifacts/kotlinc.xml generated Normal file
View File

@@ -0,0 +1,255 @@
<component name="ArtifactManager">
<artifact name="kotlinc">
<output-path>$PROJECT_DIR$/out/artifacts/kotlinc</output-path>
<root id="root">
<element id="directory" name="bin">
<element id="dir-copy" path="$PROJECT_DIR$/compiler/cli/bin" />
</element>
<element id="directory" name="lib">
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar" />
<element id="file-copy" path="$PROJECT_DIR$/dependencies/repo/kotlin.build/ideaIC/191.6707.61/artifacts/lib/trove4j.jar" />
<element id="archive" name="allopen-compiler-plugin.jar">
<element id="module-output" name="kotlin.kotlin-allopen-compiler-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/allopen/allopen-cli/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="android-extensions-runtime.jar">
<element id="module-output" name="kotlin.kotlin-android-extensions-runtime.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/android-extensions/android-extensions-runtime/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-annotation-processing.jar">
<element id="module-output" name="kotlin.kotlin-annotation-processing.main" />
<element id="module-output" name="kotlin.kotlin-annotation-processing-runtime.main" />
<element id="module-output" name="kotlin.kotlin-annotation-processing-cli.main" />
<element id="module-output" name="kotlin.kotlin-annotation-processing-base.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/kapt3/kapt3-compiler/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-annotation-processing-cli.jar">
<element id="module-output" name="kotlin.kotlin-annotation-processing-cli.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/kapt3/kapt3-cli/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-annotation-processing-runtime.jar">
<element id="module-output" name="kotlin.kotlin-annotation-processing-runtime.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/kapt3/kapt3-runtime/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-annotations-android.jar">
<element id="module-output" name="kotlin.kotlin-annotations-android.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/kotlin-annotations-android/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-annotations-jvm.jar">
<element id="module-output" name="kotlin.kotlin-annotations-jvm.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/kotlin-annotations-jvm/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-annotations-jvm-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/libraries/tools/kotlin-annotations-jvm/src" />
<element id="directory" name="main">
<element id="directory" name="resources" />
<element id="directory" name="kotlin" />
<element id="directory" name="java" />
</element>
<element id="directory" name="test">
<element id="directory" name="resources" />
</element>
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/kotlin-annotations-jvm/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-ant.jar">
<element id="module-output" name="kotlin.kotlin-ant.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/ant/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="noarg-compiler-plugin.jar">
<element id="module-output" name="kotlin.kotlin-noarg-compiler-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/noarg/noarg-cli/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-preloader.jar">
<element id="module-output" name="kotlin.kotlin-preloader.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/compiler/preloader/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-reflect-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/core/descriptors/src" />
<element id="dir-copy" path="$PROJECT_DIR$/core/descriptors.jvm/src" />
<element id="dir-copy" path="$PROJECT_DIR$/core/descriptors.runtime/src" />
<element id="dir-copy" path="$PROJECT_DIR$/core/deserialization/src" />
<element id="dir-copy" path="$PROJECT_DIR$/core/util.runtime/src" />
<element id="dir-copy" path="$PROJECT_DIR$/core/reflection.jvm/src" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/reflect/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-runner.jar">
<element id="module-output" name="kotlin.kotlin-runner.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/compiler/cli/cli-runner/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="sam-with-receiver-compiler-plugin.jar">
<element id="module-output" name="kotlin.kotlin-sam-with-receiver-compiler-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/sam-with-receiver/sam-with-receiver-cli/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-script-runtime.jar">
<element id="module-output" name="kotlin.kotlin-script-runtime.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/script-runtime/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-script-runtime-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/core/script.runtime/src" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/script-runtime/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-scripting-common.jar">
<element id="module-output" name="kotlin.kotlin-scripting-common.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/scripting/common/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-scripting-compiler.jar">
<element id="module-output" name="kotlin.kotlin-scripting-compiler.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/scripting/scripting-compiler/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-scripting-compiler-impl.jar">
<element id="module-output" name="kotlin.kotlin-scripting-compiler-impl.main" />
</element>
<element id="archive" name="kotlin-scripting-jvm.jar">
<element id="module-output" name="kotlin.kotlin-scripting-jvm.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/scripting/jvm/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-source-sections-compiler-plugin.jar">
<element id="module-output" name="kotlin.kotlin-source-sections-compiler-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/source-sections/source-sections-compiler/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-js.jar">
<element id="module-output" name="kotlin.kotlin-test.kotlin-test-js.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/js/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-js-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/libraries/kotlin.test/js/src/main/kotlin" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/js/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-junit.jar">
<element id="module-output" name="kotlin.kotlin-test.kotlin-test-junit.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/junit/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-junit-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/libraries/kotlin.test/junit/src/main/kotlin" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/junit/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-junit5.jar">
<element id="module-output" name="kotlin.kotlin-test.kotlin-test-junit5.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/junit5/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-junit5-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/libraries/kotlin.test/junit5/src/main/kotlin" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/junit5/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test.jar">
<element id="module-output" name="kotlin.kotlin-test.kotlin-test-jvm.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/jvm/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/libraries/kotlin.test/jvm/src/main/kotlin" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/jvm/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-testng.jar">
<element id="module-output" name="kotlin.kotlin-test.kotlin-test-testng.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/testng/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-testng-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/libraries/kotlin.test/testng/src/main/kotlin" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/testng/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlinx-serialization-compiler-plugin.jar">
<element id="module-output" name="kotlin.kotlinx-serialization-compiler-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/kotlin-serialization/kotlin-serialization-compiler/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="mutability-annotations-compat.jar">
<element id="module-output" name="kotlin.libraries.tools.mutability-annotations-compat.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/mutability-annotations-compat/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="android-extensions-compiler.jar">
<element id="module-output" name="kotlin.plugins.android-extensions-compiler.main" />
<element id="module-output" name="kotlin.kotlin-android-extensions-runtime.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/android-extensions/android-extensions-compiler/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.3.40-dev-2251/50d0a0344d092ba91678896e1a6e9cb595191a73/kotlin-stdlib-jdk8-1.3.40-dev-2251.jar" output-file-name="kotlin-stdlib-jdk8.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.3.40-dev-2251/255166684fce605986508bff903c78c7da7ee9b2/kotlin-stdlib-jdk7-1.3.40-dev-2251.jar" output-file-name="kotlin-stdlib-jdk7.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.40-dev-2251/cfdbfe7770f01b00c01becb43b8211faada939db/kotlin-stdlib-1.3.40-dev-2251.jar" output-file-name="kotlin-stdlib.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.3.40-dev-2251/b318ccc4b22cc2fcf79e0c06af735e97d3dd4eb/kotlin-stdlib-jdk7-1.3.40-dev-2251-sources.jar" output-file-name="kotlin-stdlib-jdk7-sources.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.3.40-dev-2251/d0b0fea9f4efc6ee45f807914f050465e1ab746e/kotlin-stdlib-jdk8-1.3.40-dev-2251-sources.jar" output-file-name="kotlin-stdlib-jdk8-sources.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-js/1.3.40-dev-2251/bf54aaefb744930ef20db15ecd532abeca1730da/kotlin-stdlib-js-1.3.40-dev-2251-sources.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-js/1.3.40-dev-2251/65ace589f8f9359ac30790244b1c473297f722d1/kotlin-stdlib-js-1.3.40-dev-2251.jar" output-file-name="kotlin-stdlib-js.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.40-dev-2251/596156dc7a263af8008dc5fd1a6d649d2cfbbfc2/kotlin-stdlib-1.3.40-dev-2251-sources.jar" output-file-name="kotlin-stdlib-sources.jar" />
<element id="artifact" artifact-name="kotlin-compiler.jar" />
<element id="artifact" artifact-name="kotlin-reflect.jar" />
<element id="artifact" artifact-name="kotlin-daemon-client.jar" />
<element id="artifact" artifact-name="kotlin-main-kts.jar" />
<element id="artifact" artifact-name="kotlin-imports-dumper-compiler-plugin.jar" />
<element id="archive" name="jvm-abi-gen.jar">
<element id="module-output" name="kotlin.plugins.jvm-abi-gen.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/jvm-abi-gen/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
</element>
<element id="directory" name="license">
<element id="dir-copy" path="$PROJECT_DIR$/license" />
</element>
<element id="file-copy" path="$PROJECT_DIR$/bootstrap/build.txt" />
</root>
</artifact>
</component>

View File

@@ -1,7 +1,7 @@
<component name="CopyrightManager">
<copyright>
<option name="allowReplaceRegexp" value="JetBrains" />
<option name="notice" value="Copyright 2010-&amp;#36;today.year JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license &#10;that can be found in the license/LICENSE.txt file." />
<option name="notice" value="Copyright 2010-&amp;#36;today.year JetBrains s.r.o. and Kotlin Programming Language contributors.&#10;Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file." />
<option name="myName" value="apache" />
</copyright>
</component>

View File

@@ -3,6 +3,10 @@
<words>
<w>cidr</w>
<w>foldable</w>
<w>instrumentator</w>
<w>protobuf</w>
<w>redirector</w>
<w>remapper</w>
</words>
</dictionary>
</component>

7
.idea/dictionaries/NK.xml generated Normal file
View File

@@ -0,0 +1,7 @@
<component name="ProjectDictionaryState">
<dictionary name="NK">
<words>
<w>typealias</w>
</words>
</dictionary>
</component>

View File

@@ -7,9 +7,10 @@
<w>fqname</w>
<w>goto</w>
<w>gradle</w>
<w>infos</w>
<w>intrinsics</w>
<w>kdoc</w>
<w>kompiler</w>
<w>lateinit</w>
<w>memoize</w>
<w>memoized</w>
<w>multiline</w>
@@ -18,11 +19,13 @@
<w>preloader</w>
<w>preloading</w>
<w>preprocess</w>
<w>proximities</w>
<w>redeclarations</w>
<w>smap</w>
<w>subclassed</w>
<w>subgraph</w>
<w>substep</w>
<w>tailrec</w>
</words>
</dictionary>
</component>

View File

@@ -7,6 +7,7 @@
<w>experimentality</w>
<w>insn</w>
<w>liveness</w>
<w>parameterless</w>
</words>
</dictionary>
</component>
</component>

View File

@@ -3,11 +3,16 @@
<words>
<w>debuggee</w>
<w>deserializes</w>
<w>destructured</w>
<w>hacky</w>
<w>impls</w>
<w>kapt</w>
<w>parceler</w>
<w>repl</w>
<w>uast</w>
<w>unbox</w>
<w>unboxed</w>
<w>unmute</w>
</words>
</dictionary>
</component>

View File

@@ -21,7 +21,6 @@
</inspection_tool>
<inspection_tool class="BooleanMethodIsAlwaysInverted" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="BusyWait" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CStyleArrayDeclaration" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CastConflictsWithInstanceof" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CastToIncompatibleInterface" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="ChainedEquality" enabled="false" level="WARNING" enabled_by_default="true" />
@@ -76,6 +75,7 @@
<option name="m_ignoreLoopsWithoutConditions" value="false" />
</inspection_tool>
<inspection_tool class="ForLoopThatDoesntUseLoopVariable" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="GrPackage" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
<option name="myValues">
<value>
@@ -98,13 +98,22 @@
<inspection_tool class="IncompatibleAPI" enabled="true" level="ERROR" enabled_by_default="true">
<option name="problems">
<list>
<Problem reference="com.intellij.openapi.progress.ProgressManager#getProgressIndicator" reason="Not null starting from 181. Use getProgressIndicatorNullable instead." />
<Problem reference="com.intellij.testFramework.PlatformTestCase#createModuleAt" reason="Not static anymore in 181 after 7dacf096c47d2125e17031c71a037b63ab00ec53" />
<Problem reference="com.intellij.testFramework.PlatformTestCase#doCreateRealModuleIn" reason="Not static anymore in 181 after 7dacf096c47d2125e17031c71a037b63ab00ec53" />
<Problem reference="com.intellij.openapi.progress.ProgressManager#getProgressIndicator" reason="Nullable in 181. Temporary use progressIndicatorNullable instead." />
<Problem reference="com.intellij.util.JdomKt#element" reason="Removed in 191" />
<Problem reference="com.intellij.util.AstLoadingFilter" reason="Absent in 181. Almost all methods were renamed in 183. Use org.jetbrains.kotlin.util.AstLoadingFilter instead." />
<Problem reference="com.intellij.codeInspection.reference.RefFile#getPsiElement" reason="Absent in 182. Use psiFile extension instead." />
<Problem reference="com.intellij.execution.JavaRunConfigurationExtensionManager#getInstance" reason="Can't be used in Kotlin, because method was replaced with property after J2K in 183. Use JavaRunConfigurationExtensionManagerUtil instead." />
<Problem reference="org.jetbrains.java.decompiler.main.decompiler.BaseDecompiler#addSpace" reason="Method was replaced with outher methods in 182. Use addSpaceEx instead." />
<Problem reference="com.intellij.psi.codeStyle.CommonCodeStyleSettings#copyFrom" reason="Absent in 173. Use CompatibilityKt.copyFromEx instead." />
<Problem reference="com.intellij.psi.codeStyle.CommonCodeStyleSettingsManager#copy" reason="Removed since 181. Use CompatibilityKt.copyFromEx instead." />
<Problem reference="com.intellij.execution.configurations.RunConfigurationBase" reason="Generalized in 183. Use RunConfigurationBaseAny instead in signatures." />
<Problem reference="com.intellij.execution.configurations.LocatableConfigurationBase" reason="Generalized in 183. Use LocatableConfigurationBaseAny instead in signatures." />
<Problem reference="com.intellij.execution.configurations.ModuleBasedConfiguration" reason="Generalized in 183. Use ModuleBasedConfigurationElement instead." />
<Problem reference="com.intellij.psi.codeStyle.CodeStyleSettingsProvider" reason="Additional method is introduced in 183 instead of deprecated one. Use CodeStyleSettingsProviderCompat instead." />
<Problem reference="com.intellij.openapi.ui.popup.PopupChooserBuilder#PopupChooserBuilder(javax.swing.JList)" reason="Generified in 182. Use PopupChooserBuilderWrapper instead." />
<Problem reference="com.intellij.openapi.editor.event.EditorFactoryListener" reason="Default implementations were added in 183. Use EditorFactoryListenerWrapper for inheritance instead." />
<Problem reference="com.intellij.openapi.diagnostic.LoggerKt#debugOrInfoIfTestMode" reason="Absent in 182." />
<Problem reference="com.intellij.psi.search.PsiSearchHelper.SERVICE" reason="Deprecated since 182. Use psiSearchHelperInstance() instead." />
<Problem reference="org.jetbrains.kotlin.idea.reporter.ITNReporterCompat#submit" reason="parentComponent is nullable in AS" />
<Problem reference="com.intellij.diagnostic.ITNReporter#submit" reason="parentComponent is nullable in AS" />
<Problem reference="com.intellij.codeInspection.dataFlow.Nullness" reason="Deprecated since 182. Use org.jetbrains.kotlin.idea.util.compat.Nullability instead." />
</list>
</option>
</inspection_tool>
@@ -257,6 +266,10 @@
<option name="ignoreObjectMethods" value="true" />
<option name="ignoreAnonymousClassMethods" value="false" />
</inspection_tool>
<inspection_tool class="MissingRecentApi" enabled="true" level="ERROR" enabled_by_default="true">
<option name="sinceBuildString" value="182.0" />
<option name="untilBuildString" value="192.SNAPSHOT" />
</inspection_tool>
<inspection_tool class="MisspelledCompareTo" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="MisspelledEquals" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="MisspelledHashcode" enabled="true" level="WARNING" enabled_by_default="true" />
@@ -285,15 +298,8 @@
<inspection_tool class="PackageDirectoryMismatch" enabled="true" level="WARNING" enabled_by_default="false">
<scope name="all except testData" level="WARNING" enabled="true" />
</inspection_tool>
<inspection_tool class="ProblematicAPIUsage" enabled="true" level="ERROR" enabled_by_default="true">
<option name="problems">
<list>
<Problem reference="com.intellij.testFramework.PlatformTestCase#createModuleAt" reason="Not static anymore in 181 after 7dacf096c47d2125e17031c71a037b63ab00ec53" />
<Problem reference="com.intellij.testFramework.PlatformTestCase#doCreateRealModuleIn" reason="Not static anymore in 181 after 7dacf096c47d2125e17031c71a037b63ab00ec53" />
<Problem reference="com.intellij.openapi.progress.ProgressManager#getProgressIndicator" reason="Nullable in 181. Temporary use progressIndicatorNullable instead." />
<Problem reference="com.intellij.testFramework.fixtures.CodeInsightTestFixture#getProjectDisposable" reason="Method was introduced in 173 and absent in 172. Use getProjectDisposableEx instead. (95eaf81e0ea497f8c69263c11fd3202d28a7a1b2)" />
</list>
</option>
<inspection_tool class="PackageName" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="namePattern" value="[a-z_][a-z\d_]*(\.[a-z_][a-zA-Z\d_]*)*" />
</inspection_tool>
<inspection_tool class="ProtectedMemberInFinalClass" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PublicFieldAccessedInSynchronizedContext" enabled="true" level="WARNING" enabled_by_default="true" />
@@ -310,16 +316,11 @@
</inspection_tool>
<inspection_tool class="SSBasedInspection" enabled="true" level="WARNING" enabled_by_default="true">
<searchConfiguration name="SwingUtilities.invokeLater" text="SwingUtilities.invokeLater($runnable$)" recursive="false" caseInsensitive="false" type="JAVA">
<constraint name="Instance" regexp="SwingUtilities" minCount="0" target="true" within="" contains="" />
<constraint name="MethodCall" within="" contains="" />
<constraint name="Parameter" minCount="0" maxCount="2147483647" within="" contains="" />
<constraint name="__context__" within="" contains="" />
<constraint name="runnable" within="" contains="" />
</searchConfiguration>
<replaceConfiguration name="DirectCallOfDispose" text="$Instance$.dispose()" recursive="false" caseInsensitive="false" type="JAVA" reformatAccordingToStyle="true" shortenFQN="true" replacement="Disposer.dispose($Instance$)">
<constraint name="Instance" regexp="super" nameOfExprType="Disposable" withinHierarchy="true" exprTypeWithinHierarchy="true" minCount="0" negateName="true" within="" contains="" />
<constraint name="MethodCall" target="true" within="" contains="" />
<constraint name="Parameter" minCount="0" maxCount="2147483647" within="" contains="" />
<constraint name="__context__" within="" contains="" />
</replaceConfiguration>
<replaceConfiguration name="new Object[0]" text="new Object[0]" recursive="false" caseInsensitive="true" type="JAVA" reformatAccordingToStyle="true" shortenFQN="true" replacement="com.intellij.util.ArrayUtil.EMPTY_OBJECT_ARRAY" />
@@ -383,6 +384,7 @@
</inspection_tool>
<inspection_tool class="StringEquality" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="StringEqualsEmptyString" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="StringOperationCanBeSimplifiedMerged" />
<inspection_tool class="SwitchStatementWithConfusingDeclaration" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="SynchronizeOnThis" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="SystemOutErr" enabled="true" level="WARNING" enabled_by_default="true">

9
.idea/misc.xml generated
View File

@@ -6,8 +6,10 @@
</properties>
</component>
<component name="EntryPointsManager">
<list size="1">
<list size="3">
<item index="0" class="java.lang.String" itemvalue="javax.inject.Inject" />
<item index="1" class="java.lang.String" itemvalue="org.gradle.api.tasks.TaskAction" />
<item index="2" class="java.lang.String" itemvalue="org.gradle.api.tasks.options.Option" />
</list>
</component>
<component name="FacetAutodetectingManager">
@@ -45,6 +47,8 @@
</option>
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="org.jetbrains.annotations.Nullable" />
<option name="myDefaultNotNull" value="org.jetbrains.annotations.NotNull" />
<option name="myNullables">
<value>
<list size="9">
@@ -82,6 +86,9 @@
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="PsiViewerSettings">
<option name="splitDividerLocation" value="35" />
</component>
<component name="SuppressABINotification">
<option name="modulesWithSuppressedNotConfigured">
<set>

View File

@@ -0,0 +1,19 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="IDEA (Not Internal)" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="-Pidea.is.internal=false" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="runIde" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
</configuration>
</component>

View File

@@ -0,0 +1,13 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="run IR test in node.js" type="js.build_tools.npm">
<package-json value="$PROJECT_DIR$/js/js.translator/testData/package.json" />
<command value="run" />
<scripts>
<script value="runIrTestInNode" />
</scripts>
<arguments value="$FilePath$" />
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>

6
.idea/upsource.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UpsourceSharedProjectSettings">
<option name="upsourceUrl" value="https://upsource.jetbrains.com/" />
</component>
</project>

3
.idea/vcs.xml generated
View File

@@ -25,5 +25,4 @@
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
</project>

4
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,4 @@
## Code of Conduct
This project and the corresponding community is governed by the [JetBrains Open Source and Community Code of Conduct](https://confluence.jetbrains.com/display/ALL/JetBrains+Open+Source+and+Community+Code+of+Conduct). Please make sure you read it.

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
[![official project](http://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
[![official project](https://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
[![TeamCity (simple build status)](https://img.shields.io/teamcity/http/teamcity.jetbrains.com/s/Kotlin_dev_Compiler.svg)](https://teamcity.jetbrains.com/viewType.html?buildTypeId=Kotlin_dev_Compiler&branch_Kotlin_dev=%3Cdefault%3E&tab=buildTypeStatusDiv)
[![Maven Central](https://img.shields.io/maven-central/v/org.jetbrains.kotlin/kotlin-maven-plugin.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.jetbrains.kotlin%22)
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)
[![Maven Central](https://img.shields.io/maven-central/v/org.jetbrains.kotlin/kotlin-maven-plugin.svg)](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.jetbrains.kotlin%22)
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0)
# Kotlin Programming Language
@@ -9,13 +9,13 @@ Welcome to [Kotlin](https://kotlinlang.org/)! Some handy links:
* [Kotlin Site](https://kotlinlang.org/)
* [Getting Started Guide](https://kotlinlang.org/docs/tutorials/getting-started.html)
* [Try Kotlin](https://try.kotlinlang.org/)
* [Try Kotlin](https://play.kotlinlang.org/)
* [Kotlin Standard Library](https://kotlinlang.org/api/latest/jvm/stdlib/index.html)
* [Issue Tracker](https://youtrack.jetbrains.com/issues/KT)
* [Forum](https://discuss.kotlinlang.org/)
* [Kotlin Blog](https://blog.jetbrains.com/kotlin/)
* [Follow Kotlin on Twitter](https://twitter.com/kotlin)
* [Public Slack channel](http://slack.kotlinlang.org/)
* [Public Slack channel](https://slack.kotlinlang.org/)
* [TeamCity CI build](https://teamcity.jetbrains.com/project.html?tab=projectOverview&projectId=Kotlin)
## Editing Kotlin
@@ -41,7 +41,11 @@ For local development, if you're not working on bytecode generation or the stand
You also can use [Gradle properties](https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_properties_and_system_properties) to setup JDK_* variables.
> Note: The JDK 6 for MacOS is not available on Oracle's site. You can [download it here](https://support.apple.com/kb/DL1572).
> Note: The JDK 6 for MacOS is not available on Oracle's site. You can [download it here](https://support.apple.com/kb/DL1572).
On Windows you might need to add long paths setting to the repo:
git config core.longpaths true
## Building
@@ -83,7 +87,7 @@ Refer to [libraries/ReadMe.md](libraries/ReadMe.md) for details.
### Building for different versions of IntelliJ IDEA and Android Studio
Kotlin plugin is indented to work with several recent versions of IntelliJ IDEA and Android Studio. Each platform is allowed to have a different set of features and might provide a slightly different API. Instead of using several parallel Git branches, project stores everything in a single branch, but files may have counterparts with version extensions (\*.as32, \*.172, \*.181). The primary file is expected to be replaced with its counterpart when targeting non-default platform.
Kotlin plugin is intended to work with several recent versions of IntelliJ IDEA and Android Studio. Each platform is allowed to have a different set of features and might provide a slightly different API. Instead of using several parallel Git branches, project stores everything in a single branch, but files may have counterparts with version extensions (\*.as32, \*.172, \*.181). The primary file is expected to be replaced with its counterpart when targeting non-default platform.
More detailed description of this scheme can be found at https://github.com/JetBrains/bunches/blob/master/ReadMe.md.
@@ -100,14 +104,14 @@ bunch switch . 182
## <a name="working-in-idea"></a> Working with the project in IntelliJ IDEA
Working with the Kotlin project requires IntelliJ IDEA 2017.3. You can download IntelliJ IDEA 2017.3 [here](https://www.jetbrains.com/idea/download).
Working with the Kotlin project requires at least IntelliJ IDEA 2017.3. You can download IntelliJ IDEA 2017.3 [here](https://www.jetbrains.com/idea/download).
To import the project in Intellij choose project directory in Open project dialog. Then, after project opened, Select
After cloning the project, to import the project in Intellij choose the project directory in the Open project dialog. Then, after project opened, Select
`File` -> `New...` -> `Module from Existing Sources` in the menu, and select `build.gradle.kts` file in the project's root folder.
In the import dialog, select `use default gradle wrapper`.
To be able to run tests from IntelliJ easily, check `Delegate IDE build/run actions to Gradle` and choose `Gradle Test Runner` in the Gradle runner settings.
To be able to run tests from IntelliJ easily, check `Delegate IDE build/run actions to Gradle` and choose `Gradle Test Runner` in the Gradle runner settings after importing the project.
At this time, you can use the latest released 1.2.x version of the Kotlin plugin for working with the code. To make sure you have the latest version installed, use Tools | Kotlin | Configure Kotlin Plugin Updates and press "Check for updates now".
@@ -133,49 +137,4 @@ includeBuild('/path/to/kotlin') {
# Contributing
We love contributions! There's [lots to do on Kotlin](https://youtrack.jetbrains.com/issues/KT) and on the
[standard library](https://youtrack.jetbrains.com/issues/KT?q=%23Kotlin%20%23Unresolved%20and%20(links:%20KT-2554,%20KT-4089%20or%20%23Libraries)) so why not chat with us
about what you're interested in doing? Please join the #kontributors channel in [our Slack chat](http://slack.kotlinlang.org/)
and let us know about your plans.
If you want to find some issues to start off with, try [this query](https://youtrack.jetbrains.com/issues/KT?q=tag:%20%7BUp%20For%20Grabs%7D%20%23Unresolved) which should find all Kotlin issues that marked as "up-for-grabs".
Currently only committers can assign issues to themselves so just add a comment if you're starting work on it.
A nice gentle way to contribute would be to review the [standard library docs](https://kotlinlang.org/api/latest/jvm/stdlib/index.html)
and find classes or functions which are not documented very well and submit a patch.
In particular it'd be great if all functions included a nice example of how to use it such as for the
[`hashMapOf()`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/hash-map-of.html) function.
This is implemented using the [`@sample`](https://github.com/JetBrains/kotlin/blob/1.1.0/libraries/stdlib/src/kotlin/collections/Maps.kt#L91)
macro to include code from a test function. The benefits of this approach are twofold; First, the API's documentation is improved via beneficial examples that help new users and second, the code coverage is increased.
Some of the code in the standard library is created by generating code from templates. See the [README](libraries/stdlib/ReadMe.md) in the stdlib section for how to run the code generator. The existing templates can be used as examples for creating new ones.
Also the [JavaScript back-end](https://github.com/JetBrains/kotlin/blob/master/js/ReadMe.md) could really use your help. See the [JavaScript contribution section](https://github.com/JetBrains/kotlin/blob/master/js/ReadMe.md) for more details.
If you want to contribute a new language feature, it is important to discuss it through a [KEEP](https://github.com/Kotlin/KEEP) first and get an approval from the language designers. This way you'll make sure your work will be in line with the overall language evolution plan and no other design decisions or considerations will block its acceptance.
## Submitting patches
The best way to submit a patch is to [fork the project on GitHub](https://help.github.com/articles/fork-a-repo/) and then send us a
[pull request](https://help.github.com/articles/creating-a-pull-request/) via [GitHub](https://github.com).
If you create your own fork, it might help to enable rebase by default
when you pull by executing
``` bash
git config --global pull.rebase true
```
This will avoid your local repo having too many merge commits
which will help keep your pull request simple and easy to apply.
## Checklist
Before submitting the pull request, make sure that you can say "YES" to each point in this short checklist:
- You provided the link to the related issue(s) from YouTrack
- You made a reasonable amount of changes related only to the provided issues
- You can explain changes made in the pull request
- You ran the build locally and verified new functionality
- You ran related tests locally and they passed
- You do not have merge commits in the pull request
Please be sure to review Kotlin's [contributing guidelines](docs/contributing.md) to learn how to help the project.

View File

@@ -8,7 +8,7 @@ plugins {
dependencies {
compile(commonDep("org.apache.ant", "ant"))
compile(project(":kotlin-preloader"))
compile(projectDist(":kotlin-stdlib"))
compile(kotlinStdlib())
}
sourceSets {
@@ -17,8 +17,7 @@ sourceSets {
}
runtimeJar {
from("$projectDir/src") { include("**/*.xml") }
manifest.attributes.put("Class-Path", "kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar kotlin-preloader.jar")
manifest.attributes.put("Class-Path", "$compilerManifestClassPath kotlin-preloader.jar")
}
dist()

View File

@@ -129,7 +129,7 @@ class KotlinCompilerAdapter : Javac13() {
}
companion object {
private val KOTLIN_EXTENSIONS = Arrays.asList("kt", "kts")
private val KOTLIN_EXTENSIONS = listOf("kt", "kts")
private fun filterOutKotlinSources(files: Array<File>): Array<File> {
return files.filterNot {

View File

@@ -14,17 +14,17 @@ dependencies {
compileOnly(project(":js:js.serializer"))
compileOnly(project(":js:js.frontend"))
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
compileOnly(intellijDep()) { includeJars("annotations", "asm-all", "trove4j", "util") }
compileOnly(intellijDep()) { includeJars("asm-all", "trove4j", "util", rootProject = rootProject) }
compileOnly(project(":kotlin-reflect-api"))
testCompileOnly(project(":compiler:cli-common"))
testCompile(projectTests(":compiler:tests-common"))
testCompile(commonDep("junit:junit"))
testCompile(protobufFull())
testCompile(projectDist(":kotlin-stdlib"))
testCompile(kotlinStdlib())
testCompileOnly(intellijDep()) { includeJars("openapi") }
testRuntime(projectDist(":kotlin-reflect"))
testRuntime(project(":kotlin-reflect"))
}
sourceSets {
@@ -32,12 +32,12 @@ sourceSets {
"test" { projectDefault() }
}
publish()
runtimeJar()
sourcesJar()
javadocJar()
testsJar()
projectTest()
publish()
projectTest(parallel = true)

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build

View File

@@ -0,0 +1,9 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build
val DEFAULT_KOTLIN_SOURCE_FILES_EXTENSIONS = listOf("kt", "kts")

View File

@@ -16,7 +16,6 @@
package org.jetbrains.kotlin.compilerRunner;
import com.intellij.util.containers.ContainerUtil;
import kotlin.collections.CollectionsKt;
import kotlin.jvm.JvmClassMappingKt;
import kotlin.reflect.KClass;
@@ -25,6 +24,7 @@ import kotlin.reflect.KVisibility;
import kotlin.reflect.full.KClasses;
import kotlin.reflect.jvm.ReflectJvmMapping;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.cli.common.arguments.Argument;
import org.jetbrains.kotlin.cli.common.arguments.CommonToolArguments;
import org.jetbrains.kotlin.cli.common.arguments.InternalArgument;
@@ -60,7 +60,7 @@ public class ArgumentUtils {
@NotNull List<String> result
) throws IllegalAccessException, InstantiationException, InvocationTargetException {
for (KProperty1 property : KClasses.getMemberProperties(clazz)) {
Argument argument = ContainerUtil.findInstance(property.getAnnotations(), Argument.class);
Argument argument = findInstance(property.getAnnotations(), Argument.class);
if (argument == null) continue;
if (property.getVisibility() != KVisibility.PUBLIC) continue;
@@ -90,4 +90,14 @@ public class ArgumentUtils {
}
}
}
@Nullable
private static <T> T findInstance(Iterable<? super T> iterable, Class<T> clazz) {
for (Object item : iterable) {
if (clazz.isInstance(item)) {
return clazz.cast(item);
}
}
return null;
}
}

View File

@@ -16,15 +16,15 @@
package org.jetbrains.kotlin.compilerRunner;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public class OutputItemsCollectorImpl implements OutputItemsCollector {
private final List<SimpleOutputItem> outputs = ContainerUtil.newArrayList();
private final List<SimpleOutputItem> outputs = new ArrayList<>();
@Override
public void add(Collection<File> sourceFiles, File outputFile) {

View File

@@ -37,28 +37,34 @@ interface IncrementalCacheCommon {
fun getSourceFileIfClass(fqName: FqName): File?
fun markDirty(removedAndCompiledSources: Collection<File>)
fun clearCacheForRemovedClasses(changesCollector: ChangesCollector)
fun clearComplementaryFilesMapping(dirtyFiles: Collection<File>): Collection<File>
fun registerComplementaryFiles(expectActualTracker: ExpectActualTrackerImpl)
fun getComplementaryFilesRecursive(dirtyFiles: Collection<File>): Collection<File>
fun updateComplementaryFiles(dirtyFiles: Collection<File>, expectActualTracker: ExpectActualTrackerImpl)
fun dump(): String
}
/**
* Incremental cache common for JVM and JS for specifit ClassName type
*/
abstract class AbstractIncrementalCache<ClassName>(workingDir: File) : BasicMapsOwner(workingDir), IncrementalCacheCommon {
abstract class AbstractIncrementalCache<ClassName>(
workingDir: File,
protected val pathConverter: FileToPathConverter
) : BasicMapsOwner(workingDir), IncrementalCacheCommon {
companion object {
private val SUBTYPES = "subtypes"
private val SUPERTYPES = "supertypes"
private val CLASS_FQ_NAME_TO_SOURCE = "class-fq-name-to-source"
private val COMPLEMENTARY_FILES = "complementary-files"
@JvmStatic protected val SOURCE_TO_CLASSES = "source-to-classes"
@JvmStatic protected val DIRTY_OUTPUT_CLASSES = "dirty-output-classes"
@JvmStatic
protected val SOURCE_TO_CLASSES = "source-to-classes"
@JvmStatic
protected val DIRTY_OUTPUT_CLASSES = "dirty-output-classes"
}
private val dependents = arrayListOf<AbstractIncrementalCache<ClassName>>()
fun addDependentCache(cache: AbstractIncrementalCache<ClassName>) {
dependents.add(cache)
}
override val thisWithDependentCaches: Iterable<AbstractIncrementalCache<ClassName>> by lazy {
val result = arrayListOf(this)
result.addAll(dependents)
@@ -67,26 +73,25 @@ abstract class AbstractIncrementalCache<ClassName>(workingDir: File) : BasicMaps
private val subtypesMap = registerMap(SubtypesMap(SUBTYPES.storageFile))
private val supertypesMap = registerMap(SupertypesMap(SUPERTYPES.storageFile))
protected val classFqNameToSourceMap = registerMap(ClassFqNameToSourceMap(CLASS_FQ_NAME_TO_SOURCE.storageFile))
protected val classFqNameToSourceMap = registerMap(ClassFqNameToSourceMap(CLASS_FQ_NAME_TO_SOURCE.storageFile, pathConverter))
internal abstract val sourceToClassesMap: AbstractSourceToOutputMap<ClassName>
internal abstract val dirtyOutputClassesMap: AbstractDirtyClassesMap<ClassName>
/**
* A file X is a complementary to a file Y if they contain corresponding expect/actual declarations.
* Complementary files should be compiled together during IC so the compiler does not complain
* about missing parts.
* TODO: provide a better solution (maintain an index of expect/actual declarations akin to IncrementalPackagePartProvider)
*/
private val complementaryFilesMap = registerMap(FilesMap(COMPLEMENTARY_FILES.storageFile))
private val complementaryFilesMap = registerMap(ComplementarySourceFilesMap(COMPLEMENTARY_FILES.storageFile, pathConverter))
override fun classesFqNamesBySources(files: Iterable<File>): Collection<FqName> =
files.flatMapTo(HashSet()) { sourceToClassesMap.getFqNames(it) }
override fun getSubtypesOf(className: FqName): Sequence<FqName> =
subtypesMap[className].asSequence()
subtypesMap[className].asSequence()
override fun getSourceFileIfClass(fqName: FqName): File? =
classFqNameToSourceMap[fqName]
classFqNameToSourceMap[fqName]
override fun markDirty(removedAndCompiledSources: Collection<File>) {
for (sourceFile in removedAndCompiledSources) {
@@ -102,8 +107,8 @@ abstract class AbstractIncrementalCache<ClassName>(workingDir: File) : BasicMaps
protected fun addToClassStorage(proto: ProtoBuf.Class, nameResolver: NameResolver, srcFile: File) {
val supertypes = proto.supertypes(TypeTable(proto.typeTable))
val parents = supertypes.map { nameResolver.getClassId(it.className).asSingleFqName() }
.filter { it.asString() != "kotlin.Any" }
.toSet()
.filter { it.asString() != "kotlin.Any" }
.toSet()
val child = nameResolver.getClassId(proto.fqName).asSingleFqName()
parents.forEach { subtypesMap.add(it, child) }
@@ -150,13 +155,17 @@ abstract class AbstractIncrementalCache<ClassName>(workingDir: File) : BasicMaps
removedFqNames.forEach { classFqNameToSourceMap.remove(it) }
}
protected class ClassFqNameToSourceMap(storageFile: File) : BasicStringMap<String>(storageFile, EnumeratorStringDescriptor(), PathStringDescriptor) {
protected class ClassFqNameToSourceMap(
storageFile: File,
private val pathConverter: FileToPathConverter
) :
BasicStringMap<String>(storageFile, EnumeratorStringDescriptor(), PathStringDescriptor) {
operator fun set(fqName: FqName, sourceFile: File) {
storage[fqName.asString()] = sourceFile.canonicalPath
storage[fqName.asString()] = pathConverter.toPath(sourceFile)
}
operator fun get(fqName: FqName): File? =
storage[fqName.asString()]?.let(::File)
storage[fqName.asString()]?.let(pathConverter::toFile)
fun remove(fqName: FqName) {
storage.remove(fqName.asString())
@@ -165,18 +174,24 @@ abstract class AbstractIncrementalCache<ClassName>(workingDir: File) : BasicMaps
override fun dumpValue(value: String) = value
}
override fun clearComplementaryFilesMapping(dirtyFiles: Collection<File>): Collection<File> {
override fun getComplementaryFilesRecursive(dirtyFiles: Collection<File>): Collection<File> {
val complementaryFiles = HashSet<File>()
val filesQueue = ArrayDeque(dirtyFiles)
while (filesQueue.isNotEmpty()) {
val file = filesQueue.pollFirst()
complementaryFilesMap.remove(file).filterTo(filesQueue) { complementaryFiles.add(it) }
complementaryFilesMap[file].forEach {
if (complementaryFiles.add(it)) filesQueue.add(it)
}
}
complementaryFiles.removeAll(dirtyFiles)
return complementaryFiles
}
override fun registerComplementaryFiles(expectActualTracker: ExpectActualTrackerImpl) {
override fun updateComplementaryFiles(dirtyFiles: Collection<File>, expectActualTracker: ExpectActualTrackerImpl) {
dirtyFiles.forEach {
complementaryFilesMap.remove(it)
}
val actualToExpect = hashMapOf<File, MutableSet<File>>()
for ((expect, actuals) in expectActualTracker.expectToActualMap) {
for (actual in actuals) {

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.incremental

View File

@@ -1,17 +1,6 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.incremental
@@ -21,14 +10,10 @@ import java.io.File
interface ICReporter {
fun report(message: () -> String)
fun reportVerbose(message: () -> String)
// used in Gradle plugin
@Suppress("unused")
fun reportCompileIteration(sourceFiles: Collection<File>, exitCode: ExitCode) {}
fun pathsAsString(files: Iterable<File>): String =
files.joinToString { it.canonicalPath }
fun pathsAsString(vararg files: File): String =
pathsAsString(files.toList())
}
fun reportCompileIteration(incremental: Boolean, sourceFiles: Collection<File>, exitCode: ExitCode)
fun reportMarkDirtyClass(affectedFiles: Iterable<File>, classFqName: String)
fun reportMarkDirtyMember(affectedFiles: Iterable<File>, scope: String, name: String)
fun reportMarkDirty(affectedFiles: Iterable<File>, reason: String)
}

View File

@@ -0,0 +1,36 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.incremental
import java.io.File
abstract class ICReporterBase(private val pathsBase: File? = null) : ICReporter {
override fun reportMarkDirtyClass(affectedFiles: Iterable<File>, classFqName: String) {
reportMarkDirty(affectedFiles, "dirty class $classFqName")
}
override fun reportMarkDirtyMember(affectedFiles: Iterable<File>, scope: String, name: String) {
reportMarkDirty(affectedFiles, "dirty member $scope#$name")
}
override fun reportMarkDirty(affectedFiles: Iterable<File>, reason: String) {
affectedFiles.forEach { file ->
reportVerbose { "${pathsAsString(file)} is marked dirty: $reason" }
}
}
protected fun relativizeIfPossible(files: Iterable<File>): List<File> =
files.map { it.relativeOrCanonical() }
protected fun pathsAsString(files: Iterable<File>): String =
relativizeIfPossible(files).map { it.path }.sorted().joinToString()
protected fun pathsAsString(vararg files: File): String =
pathsAsString(files.toList())
protected fun File.relativeOrCanonical(): File =
pathsBase?.let { relativeToOrNull(it) } ?: canonicalFile
}

View File

@@ -19,10 +19,7 @@ package org.jetbrains.kotlin.incremental
import com.intellij.util.io.DataExternalizer
import org.jetbrains.kotlin.incremental.js.IncrementalResultsConsumerImpl
import org.jetbrains.kotlin.incremental.js.TranslationResultValue
import org.jetbrains.kotlin.incremental.storage.BasicStringMap
import org.jetbrains.kotlin.incremental.storage.DirtyClassesFqNameMap
import org.jetbrains.kotlin.incremental.storage.SourceToFqNameMap
import org.jetbrains.kotlin.incremental.storage.StringToLongMapExternalizer
import org.jetbrains.kotlin.incremental.storage.*
import org.jetbrains.kotlin.metadata.ProtoBuf
import org.jetbrains.kotlin.metadata.deserialization.NameResolverImpl
import org.jetbrains.kotlin.metadata.deserialization.getExtensionOrNull
@@ -30,27 +27,34 @@ import org.jetbrains.kotlin.metadata.js.JsProtoBuf
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.name.parentOrNull
import org.jetbrains.kotlin.serialization.deserialization.getClassId
import org.jetbrains.kotlin.serialization.js.JsSerializerProtocol
import java.io.DataInput
import java.io.DataOutput
import java.io.File
open class IncrementalJsCache(cachesDir: File) : AbstractIncrementalCache<FqName>(cachesDir) {
open class IncrementalJsCache(
cachesDir: File,
pathConverter: FileToPathConverter
) : AbstractIncrementalCache<FqName>(cachesDir, pathConverter) {
companion object {
private val TRANSLATION_RESULT_MAP = "translation-result"
private val INLINE_FUNCTIONS = "inline-functions"
private val HEADER_FILE_NAME = "header.meta"
private const val TRANSLATION_RESULT_MAP = "translation-result"
private const val INLINE_FUNCTIONS = "inline-functions"
private const val HEADER_FILE_NAME = "header.meta"
private const val PACKAGE_META_FILE = "packages-meta"
fun hasHeaderFile(cachesDir: File) = File(cachesDir, HEADER_FILE_NAME).exists()
}
override val sourceToClassesMap = registerMap(SourceToFqNameMap(SOURCE_TO_CLASSES.storageFile))
override val sourceToClassesMap = registerMap(SourceToFqNameMap(SOURCE_TO_CLASSES.storageFile, pathConverter))
override val dirtyOutputClassesMap = registerMap(DirtyClassesFqNameMap(DIRTY_OUTPUT_CLASSES.storageFile))
private val translationResults = registerMap(TranslationResultMap(TRANSLATION_RESULT_MAP.storageFile))
private val inlineFunctions = registerMap(InlineFunctionsMap(INLINE_FUNCTIONS.storageFile))
private val translationResults = registerMap(TranslationResultMap(TRANSLATION_RESULT_MAP.storageFile, pathConverter))
private val inlineFunctions = registerMap(InlineFunctionsMap(INLINE_FUNCTIONS.storageFile, pathConverter))
private val packageMetadata = registerMap(PackageMetadataMap(PACKAGE_META_FILE.storageFile))
private val dirtySources = hashSetOf<File>()
private val dirtyPackages = hashSetOf<String>()
private val headerFile: File
get() = File(cachesDir, HEADER_FILE_NAME)
@@ -63,6 +67,11 @@ open class IncrementalJsCache(cachesDir: File) : AbstractIncrementalCache<FqName
}
override fun markDirty(removedAndCompiledSources: Collection<File>) {
removedAndCompiledSources.forEach { sourceFile ->
sourceToClassesMap[sourceFile].forEach {
dirtyPackages += it.parentOrNull()?.asString() ?: ""
}
}
super.markDirty(removedAndCompiledSources)
dirtySources.addAll(removedAndCompiledSources)
}
@@ -72,7 +81,7 @@ open class IncrementalJsCache(cachesDir: File) : AbstractIncrementalCache<FqName
for ((srcFile, data) in translatedFiles) {
dirtySources.remove(srcFile)
val (binaryMetadata, binaryAst) = data
val (binaryMetadata, binaryAst, inlineData) = data
val oldProtoMap = translationResults[srcFile]?.metadata?.let { getProtoData(srcFile, it) } ?: emptyMap()
val newProtoMap = getProtoData(srcFile, binaryMetadata)
@@ -89,12 +98,17 @@ open class IncrementalJsCache(cachesDir: File) : AbstractIncrementalCache<FqName
changesCollector.collectProtoChanges(oldProtoMap[classId], newProtoMap[classId])
}
translationResults.put(srcFile, binaryMetadata, binaryAst)
translationResults.put(srcFile, binaryMetadata, binaryAst, inlineData)
}
for ((srcFile, inlineDeclarations) in incrementalResults.inlineFunctions) {
inlineFunctions.process(srcFile, inlineDeclarations, changesCollector)
}
for ((packageName, metadata) in incrementalResults.packageMetadata) {
packageMetadata.put(packageName, metadata)
dirtyPackages.remove(packageName)
}
}
private fun registerOutputForFile(srcFile: File, name: FqName) {
@@ -108,19 +122,31 @@ open class IncrementalJsCache(cachesDir: File) : AbstractIncrementalCache<FqName
inlineFunctions.remove(it)
}
removeAllFromClassStorage(dirtyOutputClassesMap.getDirtyOutputClasses(), changesCollector)
dirtyPackages.forEach {
packageMetadata.remove(it)
}
dirtySources.clear()
dirtyOutputClassesMap.clean()
dirtyPackages.clear()
}
fun nonDirtyPackageParts(): Map<File, TranslationResultValue> =
hashMapOf<File, TranslationResultValue>().apply {
for (path in translationResults.keys()) {
val file = File(path)
if (file !in dirtySources) {
put(file, translationResults[path]!!)
}
hashMapOf<File, TranslationResultValue>().apply {
for (file in translationResults.keys()) {
if (file !in dirtySources) {
put(file, translationResults[file]!!)
}
}
}
fun packageMetadata(): Map<String, ByteArray> = hashMapOf<String, ByteArray>().apply {
for (fqNameString in packageMetadata.keys()) {
if (fqNameString !in dirtyPackages) {
put(fqNameString, packageMetadata[fqNameString]!!)
}
}
}
}
private object TranslationResultValueExternalizer : DataExternalizer<TranslationResultValue> {
@@ -130,6 +156,9 @@ private object TranslationResultValueExternalizer : DataExternalizer<Translation
output.writeInt(value.binaryAst.size)
output.write(value.binaryAst)
output.writeInt(value.inlineData.size)
output.write(value.inlineData)
}
override fun read(input: DataInput): TranslationResultValue {
@@ -141,39 +170,46 @@ private object TranslationResultValueExternalizer : DataExternalizer<Translation
val binaryAst = ByteArray(binaryAstSize)
input.readFully(binaryAst)
return TranslationResultValue(metadata = metadata, binaryAst = binaryAst)
val inlineDataSize = input.readInt()
val inlineData = ByteArray(inlineDataSize)
input.readFully(inlineData)
return TranslationResultValue(metadata = metadata, binaryAst = binaryAst, inlineData = inlineData)
}
}
private class TranslationResultMap(storageFile: File) : BasicStringMap<TranslationResultValue>(storageFile, TranslationResultValueExternalizer) {
private class TranslationResultMap(
storageFile: File,
private val pathConverter: FileToPathConverter
) :
BasicStringMap<TranslationResultValue>(storageFile, TranslationResultValueExternalizer) {
override fun dumpValue(value: TranslationResultValue): String =
"Metadata: ${value.metadata.md5()}, Binary AST: ${value.binaryAst.md5()}"
"Metadata: ${value.metadata.md5()}, Binary AST: ${value.binaryAst.md5()}, InlineData: ${value.inlineData.md5()}"
fun put(file: File, newMetadata: ByteArray, newBinaryAst: ByteArray) {
storage[file.canonicalPath] = TranslationResultValue(metadata = newMetadata, binaryAst = newBinaryAst)
fun put(sourceFile: File, newMetadata: ByteArray, newBinaryAst: ByteArray, newInlineData: ByteArray) {
storage[pathConverter.toPath(sourceFile)] =
TranslationResultValue(metadata = newMetadata, binaryAst = newBinaryAst, inlineData = newInlineData)
}
operator fun get(file: File): TranslationResultValue? =
storage[file.canonicalPath]
operator fun get(sourceFile: File): TranslationResultValue? =
storage[pathConverter.toPath(sourceFile)]
operator fun get(key: String): TranslationResultValue? =
storage[key]
fun keys(): Collection<File> =
storage.keys.map { pathConverter.toFile(it) }
fun keys(): Collection<String> =
storage.keys
fun remove(file: File, changesCollector: ChangesCollector) {
val protoBytes = storage[file.canonicalPath]!!.metadata
val protoMap = getProtoData(file, protoBytes)
fun remove(sourceFile: File, changesCollector: ChangesCollector) {
val path = pathConverter.toPath(sourceFile)
val protoBytes = storage[path]!!.metadata
val protoMap = getProtoData(sourceFile, protoBytes)
for ((_, protoData) in protoMap) {
changesCollector.collectProtoChanges(oldData = protoData, newData = null)
}
storage.remove(file.canonicalPath)
storage.remove(path)
}
}
fun getProtoData(sourceFile: File, metadata: ByteArray): Map<ClassId, ProtoData> {
fun getProtoData(sourceFile: File, metadata: ByteArray): Map<ClassId, ProtoData> {
val classes = hashMapOf<ClassId, ProtoData>()
val proto = ProtoBuf.PackageFragment.parseFrom(metadata, JsSerializerProtocol.extensionRegistry)
val nameResolver = NameResolverImpl(proto.strings, proto.qualifiedNames)
@@ -192,15 +228,17 @@ fun getProtoData(sourceFile: File, metadata: ByteArray): Map<ClassId, ProtoData>
return classes
}
private class InlineFunctionsMap(storageFile: File) : BasicStringMap<Map<String, Long>>(storageFile, StringToLongMapExternalizer) {
private class InlineFunctionsMap(
storageFile: File,
private val pathConverter: FileToPathConverter
) : BasicStringMap<Map<String, Long>>(storageFile, StringToLongMapExternalizer) {
fun process(srcFile: File, newMap: Map<String, Long>, changesCollector: ChangesCollector) {
val key = srcFile.canonicalPath
val key = pathConverter.toPath(srcFile)
val oldMap = storage[key] ?: emptyMap()
if (newMap.isNotEmpty()) {
storage[key] = newMap
}
else {
} else {
storage.remove(key)
}
@@ -212,9 +250,40 @@ private class InlineFunctionsMap(storageFile: File) : BasicStringMap<Map<String,
}
fun remove(sourceFile: File) {
storage.remove(sourceFile.canonicalPath)
storage.remove(pathConverter.toPath(sourceFile))
}
override fun dumpValue(value: Map<String, Long>): String =
value.dumpMap { java.lang.Long.toHexString(it) }
value.dumpMap { java.lang.Long.toHexString(it) }
}
private object ByteArrayExternalizer : DataExternalizer<ByteArray> {
override fun save(output: DataOutput, value: ByteArray) {
output.writeInt(value.size)
output.write(value)
}
override fun read(input: DataInput): ByteArray {
val size = input.readInt()
val array = ByteArray(size)
input.readFully(array)
return array
}
}
private class PackageMetadataMap(storageFile: File) : BasicStringMap<ByteArray>(storageFile, ByteArrayExternalizer) {
fun put(packageName: String, newMetadata: ByteArray) {
storage[packageName] = newMetadata
}
fun remove(packageName: String) {
storage.remove(packageName)
}
fun keys() = storage.keys
operator fun get(packageName: String) = storage[packageName]
override fun dumpValue(value: ByteArray): String = "Package metadata: ${value.md5()}"
}

View File

@@ -23,10 +23,7 @@ import com.intellij.util.io.EnumeratorStringDescriptor
import gnu.trove.THashSet
import org.jetbrains.annotations.TestOnly
import org.jetbrains.kotlin.build.GeneratedJvmClass
import org.jetbrains.kotlin.config.IncrementalCompilation
import org.jetbrains.kotlin.incremental.storage.*
import org.jetbrains.kotlin.incremental.storage.version.clean
import org.jetbrains.kotlin.incremental.storage.version.localCacheVersionManager
import org.jetbrains.kotlin.inline.inlineFunctionsJvmNames
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader
import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCache
@@ -46,8 +43,12 @@ val KOTLIN_CACHE_DIRECTORY_NAME = "kotlin"
open class IncrementalJvmCache(
private val targetDataRoot: File,
targetOutputDir: File?
) : AbstractIncrementalCache<JvmClassName>(File(targetDataRoot, KOTLIN_CACHE_DIRECTORY_NAME)), IncrementalCache {
targetOutputDir: File?,
pathConverter: FileToPathConverter
) : AbstractIncrementalCache<JvmClassName>(
workingDir = File(targetDataRoot, KOTLIN_CACHE_DIRECTORY_NAME),
pathConverter = pathConverter
), IncrementalCache {
companion object {
private val PROTO_MAP = "proto"
private val CONSTANTS_MAP = "constants"
@@ -61,7 +62,7 @@ open class IncrementalJvmCache(
private val MODULE_MAPPING_FILE_NAME = "." + ModuleMapping.MAPPING_FILE_EXT
}
override val sourceToClassesMap = registerMap(SourceToJvmNameMap(SOURCE_TO_CLASSES.storageFile))
override val sourceToClassesMap = registerMap(SourceToJvmNameMap(SOURCE_TO_CLASSES.storageFile, pathConverter))
override val dirtyOutputClassesMap = registerMap(DirtyClassesJvmNameMap(DIRTY_OUTPUT_CLASSES.storageFile))
private val protoMap = registerMap(ProtoMap(PROTO_MAP.storageFile))
@@ -71,7 +72,8 @@ open class IncrementalJvmCache(
private val partToMultifileFacade = registerMap(MultifileClassPartMap(MULTIFILE_CLASS_PARTS.storageFile))
private val inlineFunctionsMap = registerMap(InlineFunctionsMap(INLINE_FUNCTIONS.storageFile))
// todo: try to use internal names only?
private val internalNameToSource = registerMap(InternalNameToSourcesMap(INTERNAL_NAME_TO_SOURCE.storageFile))
private val internalNameToSource = registerMap(InternalNameToSourcesMap(INTERNAL_NAME_TO_SOURCE.storageFile, pathConverter))
// gradle only
private val javaSourcesProtoMap = registerMap(JavaSourcesProtoMap(JAVA_SOURCES_PROTO_MAP.storageFile))
private val outputDir by lazy(LazyThreadSafetyMode.NONE) { requireNotNull(targetOutputDir) { "Target is expected to have output directory" } }
@@ -264,11 +266,6 @@ open class IncrementalJvmCache(
return protoMap[JvmClassName.byInternalName(MODULE_MAPPING_FILE_NAME)]?.bytes
}
override fun clean() {
super.clean()
localCacheVersionManager(targetDataRoot, IncrementalCompilation.isEnabledForJvm()).clean()
}
private inner class ProtoMap(storageFile: File) : BasicStringMap<ProtoMapValue>(storageFile, ProtoMapValueExternalizer) {
fun process(kotlinClass: LocalFileKotlinClass, changesCollector: ChangesCollector) {
@@ -358,7 +355,7 @@ open class IncrementalJvmCache(
private fun getConstantsMap(bytes: ByteArray): Map<String, Any> {
val result = HashMap<String, Any>()
ClassReader(bytes).accept(object : ClassVisitor(Opcodes.ASM5) {
ClassReader(bytes).accept(object : ClassVisitor(Opcodes.API_VERSION) {
override fun visitField(access: Int, name: String, desc: String, signature: String?, value: Any?): FieldVisitor? {
val staticFinal = Opcodes.ACC_STATIC or Opcodes.ACC_FINAL or Opcodes.ACC_PRIVATE
if (value != null && access and staticFinal == Opcodes.ACC_STATIC or Opcodes.ACC_FINAL) {
@@ -448,14 +445,16 @@ open class IncrementalJvmCache(
override fun dumpValue(value: String): String = value
}
inner class InternalNameToSourcesMap(storageFile: File) :
BasicStringMap<Collection<String>>(storageFile, EnumeratorStringDescriptor(), PathCollectionExternalizer) {
operator fun set(internalName: String, sourceFiles: Iterable<File>) {
storage[internalName] = sourceFiles.map { it.canonicalPath }
inner class InternalNameToSourcesMap(
storageFile: File,
private val pathConverter: FileToPathConverter
) : BasicStringMap<Collection<String>>(storageFile, EnumeratorStringDescriptor(), PathCollectionExternalizer) {
operator fun set(internalName: String, sourceFiles: Collection<File>) {
storage[internalName] = pathConverter.toPaths(sourceFiles)
}
operator fun get(internalName: String): Collection<File> =
(storage[internalName] ?: emptyList()).map(::File)
pathConverter.toFiles(storage[internalName] ?: emptyList())
fun remove(internalName: String) {
storage.remove(internalName)
@@ -478,7 +477,7 @@ open class IncrementalJvmCache(
val result = HashMap<String, Long>()
ClassReader(bytes).accept(object : ClassVisitor(Opcodes.ASM5) {
ClassReader(bytes).accept(object : ClassVisitor(Opcodes.API_VERSION) {
override fun visitMethod(
access: Int,
name: String,
@@ -486,9 +485,9 @@ open class IncrementalJvmCache(
signature: String?,
exceptions: Array<out String>?
): MethodVisitor? {
val dummyClassWriter = ClassWriter(Opcodes.ASM5)
val dummyClassWriter = ClassWriter(Opcodes.API_VERSION)
return object : MethodVisitor(Opcodes.ASM5, dummyClassWriter.visitMethod(0, name, desc, null, exceptions)) {
return object : MethodVisitor(Opcodes.API_VERSION, dummyClassWriter.visitMethod(0, name, desc, null, exceptions)) {
override fun visitEnd() {
val jvmName = name + desc
if (jvmName !in inlineFunctions) return

View File

@@ -35,25 +35,30 @@ class JavaClassesSerializerExtension : KotlinSerializerExtensionBase(BuiltInSeri
get() = JvmMetadataVersion.INVALID_VERSION
override fun serializeClass(
descriptor: ClassDescriptor,
proto: ProtoBuf.Class.Builder,
versionRequirementTable: MutableVersionRequirementTable
descriptor: ClassDescriptor,
proto: ProtoBuf.Class.Builder,
versionRequirementTable: MutableVersionRequirementTable,
childSerializer: DescriptorSerializer
) {
super.serializeClass(descriptor, proto, versionRequirementTable)
super.serializeClass(descriptor, proto, versionRequirementTable, childSerializer)
if (descriptor.visibility == JavaVisibilities.PACKAGE_VISIBILITY) {
proto.setExtension(JavaClassProtoBuf.isPackagePrivateClass, true)
}
}
override fun serializeConstructor(descriptor: ConstructorDescriptor, proto: ProtoBuf.Constructor.Builder) {
super.serializeConstructor(descriptor, proto)
override fun serializeConstructor(descriptor: ConstructorDescriptor,
proto: ProtoBuf.Constructor.Builder,
childSerializer: DescriptorSerializer) {
super.serializeConstructor(descriptor, proto, childSerializer)
if (descriptor.visibility == JavaVisibilities.PACKAGE_VISIBILITY) {
proto.setExtension(JavaClassProtoBuf.isPackagePrivateConstructor, true)
}
}
override fun serializeFunction(descriptor: FunctionDescriptor, proto: ProtoBuf.Function.Builder) {
super.serializeFunction(descriptor, proto)
override fun serializeFunction(descriptor: FunctionDescriptor,
proto: ProtoBuf.Function.Builder,
childSerializer: DescriptorSerializer) {
super.serializeFunction(descriptor, proto, childSerializer)
if (descriptor.visibility == JavaVisibilities.PACKAGE_VISIBILITY) {
proto.setExtension(JavaClassProtoBuf.isPackagePrivateMethod, true)
}
@@ -64,11 +69,12 @@ class JavaClassesSerializerExtension : KotlinSerializerExtensionBase(BuiltInSeri
}
override fun serializeProperty(
descriptor: PropertyDescriptor,
proto: ProtoBuf.Property.Builder,
versionRequirementTable: MutableVersionRequirementTable
descriptor: PropertyDescriptor,
proto: ProtoBuf.Property.Builder,
versionRequirementTable: MutableVersionRequirementTable?,
childSerializer: DescriptorSerializer
) {
super.serializeProperty(descriptor, proto, versionRequirementTable)
super.serializeProperty(descriptor, proto, versionRequirementTable, childSerializer)
if (descriptor.visibility == JavaVisibilities.PACKAGE_VISIBILITY) {
proto.setExtension(JavaClassProtoBuf.isPackagePrivateField, true)
}

View File

@@ -30,15 +30,18 @@ import java.io.IOException
import java.util.*
open class LookupStorage(targetDataDir: File) : BasicMapsOwner(targetDataDir) {
open class LookupStorage(
targetDataDir: File,
pathConverter: FileToPathConverter
) : BasicMapsOwner(targetDataDir) {
companion object {
private val DELETED_TO_SIZE_TRESHOLD = 0.5
private val MINIMUM_GARBAGE_COLLECTIBLE_SIZE = 10000
}
private val countersFile = "counters".storageFile
private val idToFile = registerMap(IdToFileMap("id-to-file".storageFile))
private val fileToId = registerMap(FileToIdMap("file-to-id".storageFile))
private val idToFile = registerMap(IdToFileMap("id-to-file".storageFile, pathConverter))
private val fileToId = registerMap(FileToIdMap("file-to-id".storageFile, pathConverter))
private val lookupMap = registerMap(LookupMap("lookups".storageFile))
@Volatile
@@ -152,7 +155,7 @@ open class LookupStorage(targetDataDir: File) : BasicMapsOwner(targetDataDir) {
size = 0
deletedCount = 0
for ((file, oldId) in oldFileToId.entries) {
for ((file, oldId) in oldFileToId.entries.sortedBy { it.key.path }) {
val newId = addFileIfNeeded(file)
oldIdToNewId[oldId] = newId
}
@@ -174,11 +177,19 @@ open class LookupStorage(targetDataDir: File) : BasicMapsOwner(targetDataDir) {
flush(false)
}
@TestOnly fun dump(lookupSymbols: Set<LookupSymbol>, basePath: File? = null): String {
@TestOnly
fun dump(lookupSymbols: Set<LookupSymbol>): String {
flush(false)
val sb = StringBuilder()
val p = Printer(sb)
p.println("====== File to id map")
p.println(fileToId.dump())
p.println("====== Id to file map")
p.println(idToFile.dump())
val lookupsStrings = lookupSymbols.groupBy { LookupSymbolKey(it.name, it.scope) }
for (lookup in lookupMap.keys.sorted()) {
@@ -186,12 +197,11 @@ open class LookupStorage(targetDataDir: File) : BasicMapsOwner(targetDataDir) {
val key = if (lookup in lookupsStrings) {
lookupsStrings[lookup]!!.map { "${it.scope}#${it.name}" }.sorted().joinToString(", ")
}
else {
} else {
lookup.toString()
}
val value = fileIds.map { idToFile[it]?.let { if (basePath == null) it.absolutePath else it.toRelativeString(basePath) } ?: it.toString() }.sorted().joinToString(", ")
val value = fileIds.map { it.toString() }.sorted().joinToString(", ")
p.println("$key -> $value")
}

View File

@@ -522,6 +522,24 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
}
}
if (old.getExtensionCount(JsProtoBuf.propertyGetterAnnotation) != new.getExtensionCount(JsProtoBuf.propertyGetterAnnotation)) {
return false
}
else {
for(i in 0..old.getExtensionCount(JsProtoBuf.propertyGetterAnnotation) - 1) {
if (!checkEquals(old.getExtension(JsProtoBuf.propertyGetterAnnotation, i), new.getExtension(JsProtoBuf.propertyGetterAnnotation, i))) return false
}
}
if (old.getExtensionCount(JsProtoBuf.propertySetterAnnotation) != new.getExtensionCount(JsProtoBuf.propertySetterAnnotation)) {
return false
}
else {
for(i in 0..old.getExtensionCount(JsProtoBuf.propertySetterAnnotation) - 1) {
if (!checkEquals(old.getExtension(JsProtoBuf.propertySetterAnnotation, i), new.getExtension(JsProtoBuf.propertySetterAnnotation, i))) return false
}
}
if (old.hasExtension(JsProtoBuf.compileTimeValue) != new.hasExtension(JsProtoBuf.compileTimeValue)) return false
if (old.hasExtension(JsProtoBuf.compileTimeValue)) {
if (!checkEquals(old.getExtension(JsProtoBuf.compileTimeValue), new.getExtension(JsProtoBuf.compileTimeValue))) return false
@@ -551,6 +569,24 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
}
}
if (old.getExtensionCount(BuiltInsProtoBuf.propertyGetterAnnotation) != new.getExtensionCount(BuiltInsProtoBuf.propertyGetterAnnotation)) {
return false
}
else {
for(i in 0..old.getExtensionCount(BuiltInsProtoBuf.propertyGetterAnnotation) - 1) {
if (!checkEquals(old.getExtension(BuiltInsProtoBuf.propertyGetterAnnotation, i), new.getExtension(BuiltInsProtoBuf.propertyGetterAnnotation, i))) return false
}
}
if (old.getExtensionCount(BuiltInsProtoBuf.propertySetterAnnotation) != new.getExtensionCount(BuiltInsProtoBuf.propertySetterAnnotation)) {
return false
}
else {
for(i in 0..old.getExtensionCount(BuiltInsProtoBuf.propertySetterAnnotation) - 1) {
if (!checkEquals(old.getExtension(BuiltInsProtoBuf.propertySetterAnnotation, i), new.getExtension(BuiltInsProtoBuf.propertySetterAnnotation, i))) return false
}
}
if (old.hasExtension(BuiltInsProtoBuf.compileTimeValue) != new.hasExtension(BuiltInsProtoBuf.compileTimeValue)) return false
if (old.hasExtension(BuiltInsProtoBuf.compileTimeValue)) {
if (!checkEquals(old.getExtension(BuiltInsProtoBuf.compileTimeValue), new.getExtension(BuiltInsProtoBuf.compileTimeValue))) return false
@@ -1779,6 +1815,14 @@ fun ProtoBuf.Property.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int)
hashCode = 31 * hashCode + getExtension(JsProtoBuf.propertyAnnotation, i).hashCode(stringIndexes, fqNameIndexes)
}
for(i in 0..getExtensionCount(JsProtoBuf.propertyGetterAnnotation) - 1) {
hashCode = 31 * hashCode + getExtension(JsProtoBuf.propertyGetterAnnotation, i).hashCode(stringIndexes, fqNameIndexes)
}
for(i in 0..getExtensionCount(JsProtoBuf.propertySetterAnnotation) - 1) {
hashCode = 31 * hashCode + getExtension(JsProtoBuf.propertySetterAnnotation, i).hashCode(stringIndexes, fqNameIndexes)
}
if (hasExtension(JsProtoBuf.compileTimeValue)) {
hashCode = 31 * hashCode + getExtension(JsProtoBuf.compileTimeValue).hashCode(stringIndexes, fqNameIndexes)
}
@@ -1799,6 +1843,14 @@ fun ProtoBuf.Property.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int)
hashCode = 31 * hashCode + getExtension(BuiltInsProtoBuf.propertyAnnotation, i).hashCode(stringIndexes, fqNameIndexes)
}
for(i in 0..getExtensionCount(BuiltInsProtoBuf.propertyGetterAnnotation) - 1) {
hashCode = 31 * hashCode + getExtension(BuiltInsProtoBuf.propertyGetterAnnotation, i).hashCode(stringIndexes, fqNameIndexes)
}
for(i in 0..getExtensionCount(BuiltInsProtoBuf.propertySetterAnnotation) - 1) {
hashCode = 31 * hashCode + getExtension(BuiltInsProtoBuf.propertySetterAnnotation, i).hashCode(stringIndexes, fqNameIndexes)
}
if (hasExtension(BuiltInsProtoBuf.compileTimeValue)) {
hashCode = 31 * hashCode + getExtension(BuiltInsProtoBuf.compileTimeValue).hashCode(stringIndexes, fqNameIndexes)
}

View File

@@ -16,8 +16,6 @@
package org.jetbrains.kotlin.incremental
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.text.StringUtil
import org.jetbrains.kotlin.build.GeneratedFile
import org.jetbrains.kotlin.build.GeneratedJvmClass
import org.jetbrains.kotlin.build.JvmSourceRoot
@@ -31,8 +29,10 @@ import org.jetbrains.kotlin.modules.TargetId
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.progress.CompilationCanceledStatus
import org.jetbrains.kotlin.synthetic.SAM_LOOKUP_NAME
import org.jetbrains.kotlin.utils.addToStdlib.flattenTo
import java.io.File
import java.util.*
import kotlin.collections.HashSet
const val DELETE_MODULE_FILE_PROPERTY = "kotlin.delete.module.file.after.build"
@@ -65,11 +65,23 @@ fun makeModuleFile(
friendDirs
)
val scriptFile = File.createTempFile("kjps", StringUtil.sanitizeJavaIdentifier(name) + ".script.xml")
FileUtil.writeToFile(scriptFile, builder.asText().toString())
val scriptFile = File.createTempFile("kjps", sanitizeJavaIdentifier(name) + ".script.xml")
scriptFile.writeText(builder.asText().toString())
return scriptFile
}
private fun sanitizeJavaIdentifier(string: String) =
buildString {
for (char in string) {
if (char.isJavaIdentifierPart()) {
if (length == 0 && !char.isJavaIdentifierStart()) {
append('_')
}
append(char)
}
}
}
fun makeCompileServices(
incrementalCaches: Map<TargetId, IncrementalCache>,
lookupTracker: LookupTracker,
@@ -130,7 +142,7 @@ fun ChangesCollector.getDirtyData(
val dirtyClassesFqNames = HashSet<FqName>()
for (change in changes()) {
reporter.report { "Process $change" }
reporter.reportVerbose { "Process $change" }
if (change is ChangeInfo.SignatureChanged) {
val fqNames = if (!change.areSubclassesAffected) listOf(change.fqName) else withSubtypes(change.fqName, caches)
@@ -143,8 +155,7 @@ fun ChangesCollector.getDirtyData(
val name = classFqName.shortName().identifier
dirtyLookupSymbols.add(LookupSymbol(name, scope))
}
}
else if (change is ChangeInfo.MembersChanged) {
} else if (change is ChangeInfo.MembersChanged) {
val fqNames = withSubtypes(change.fqName, caches)
// need to recompile subtypes because changed member might break override
dirtyClassesFqNames.addAll(fqNames)
@@ -161,16 +172,16 @@ fun ChangesCollector.getDirtyData(
}
fun mapLookupSymbolsToFiles(
lookupStorage: LookupStorage,
lookupSymbols: Iterable<LookupSymbol>,
reporter: ICReporter,
excludes: Set<File> = emptySet()
lookupStorage: LookupStorage,
lookupSymbols: Iterable<LookupSymbol>,
reporter: ICReporter,
excludes: Set<File> = emptySet()
): Set<File> {
val dirtyFiles = HashSet<File>()
for (lookup in lookupSymbols) {
val affectedFiles = lookupStorage.get(lookup).map(::File).filter { it !in excludes }
reporter.report { "${lookup.scope}#${lookup.name} caused recompilation of: ${reporter.pathsAsString(affectedFiles)}" }
reporter.reportMarkDirtyMember(affectedFiles, scope = lookup.scope, name = lookup.name)
dirtyFiles.addAll(affectedFiles)
}
@@ -183,19 +194,22 @@ fun mapClassesFqNamesToFiles(
reporter: ICReporter,
excludes: Set<File> = emptySet()
): Set<File> {
val dirtyFiles = HashSet<File>()
val fqNameToAffectedFiles = HashMap<FqName, MutableSet<File>>()
for (cache in caches) {
for (dirtyClassFqName in classesFqNames) {
val srcFile = cache.getSourceFileIfClass(dirtyClassFqName)
for (classFqName in classesFqNames) {
val srcFile = cache.getSourceFileIfClass(classFqName)
if (srcFile == null || srcFile in excludes || srcFile.isJavaFile()) continue
reporter.report { ("Class $dirtyClassFqName caused recompilation of: ${reporter.pathsAsString(srcFile)}") }
dirtyFiles.add(srcFile)
fqNameToAffectedFiles.getOrPut(classFqName) { HashSet() }.add(srcFile)
}
}
return dirtyFiles
for ((classFqName, affectedFiles) in fqNameToAffectedFiles) {
reporter.reportMarkDirtyClass(affectedFiles, classFqName.asString())
}
return fqNameToAffectedFiles.values.flattenTo(HashSet())
}
fun withSubtypes(

View File

@@ -21,11 +21,8 @@ import java.io.File
fun File.isJavaFile() =
extension.equals("java", ignoreCase = true)
fun File.isKotlinFile(): Boolean =
extension.let {
"kt".equals(it, ignoreCase = true) ||
"kts".equals(it, ignoreCase = true)
}
fun File.isKotlinFile(sourceFilesExtensions: List<String>): Boolean =
!isJavaFile() && sourceFilesExtensions.any { it.equals(extension, ignoreCase = true) }
fun File.isClassFile(): Boolean =
extension.equals("class", ignoreCase = true)

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.incremental.js
@@ -18,4 +18,7 @@ class IncrementalDataProviderFromCache(private val cache: IncrementalJsCache) :
override val metadataVersion: IntArray
get() = JsMetadataVersion.INSTANCE.toArray() // TODO: store and load correct metadata version
override val packageMetadata: Map<String, ByteArray>
get() = cache.packageMetadata()
}

View File

@@ -0,0 +1,30 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.incremental.storage
import org.jetbrains.kotlin.incremental.dumpCollection
import java.io.File
class ComplementarySourceFilesMap(
storageFile: File,
private val pathConverter: FileToPathConverter
) : BasicStringMap<Collection<String>>(storageFile, PathStringDescriptor, StringCollectionExternalizer) {
operator fun set(sourceFile: File, complementaryFiles: Collection<File>) {
storage[pathConverter.toPath(sourceFile)] = pathConverter.toPaths(complementaryFiles)
}
operator fun get(sourceFile: File): Collection<File> {
val paths = storage[pathConverter.toPath(sourceFile)].orEmpty()
return pathConverter.toFiles(paths)
}
override fun dumpValue(value: Collection<String>) =
value.dumpCollection()
fun remove(file: File): Collection<File> =
get(file).also { storage.remove(pathConverter.toPath(file)) }
}

View File

@@ -18,26 +18,27 @@ package org.jetbrains.kotlin.incremental.storage
import java.io.File
internal class FileToIdMap(file: File) : BasicMap<File, Int>(file, FileKeyDescriptor, IntExternalizer) {
override fun dumpKey(key: File): String = key.toString()
internal class FileToIdMap(
file: File,
private val pathConverter: FileToPathConverter
) : BasicStringMap<Int>(file, IntExternalizer) {
override fun dumpValue(value: Int): String = value.toString()
operator fun get(file: File): Int? = storage[file]
operator fun get(file: File): Int? = storage[pathConverter.toPath(file)]
operator fun set(file: File, id: Int) {
storage[file] = id
storage[pathConverter.toPath(file)] = id
}
fun remove(file: File) {
storage.remove(file)
storage.remove(pathConverter.toPath(file))
}
fun toMap(): Map<File, Int> {
val result = HashMap<File, Int>()
for (key in storage.keys) {
val value = storage[key] ?: continue
result[key] = value
result[pathConverter.toFile(key)] = value
}
return result
}

View File

@@ -0,0 +1,25 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.incremental.storage
import java.io.File
interface FileToPathConverter {
fun toPath(file: File): String
fun toFile(path: String): File
}
fun FileToPathConverter.toPaths(files: Collection<File>): List<String> =
files.map { toPath(it) }
fun FileToPathConverter.toFiles(paths: Collection<String>): List<File> =
paths.map { toFile(it) }
object FileToCanonicalPathConverter : FileToPathConverter {
override fun toPath(file: File): String = file.canonicalPath
override fun toFile(path: String): File = File(path)
}

View File

@@ -1,26 +0,0 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.incremental.storage
import org.jetbrains.kotlin.incremental.dumpCollection
import java.io.File
class FilesMap(storageFile: File)
: BasicStringMap<Collection<String>>(storageFile, PathStringDescriptor, StringCollectionExternalizer) {
operator fun set(sourceFile: File, outputFiles: Collection<File>) {
storage[sourceFile.absolutePath] = outputFiles.map { it.absolutePath }
}
operator fun get(sourceFile: File): Collection<File> =
storage[sourceFile.absolutePath].orEmpty().map(::File)
override fun dumpValue(value: Collection<String>) =
value.dumpCollection()
fun remove(file: File): Collection<File> =
get(file).also { storage.remove(file.absolutePath) }
}

View File

@@ -16,20 +16,24 @@
package org.jetbrains.kotlin.incremental.storage
import com.intellij.util.io.EnumeratorStringDescriptor
import com.intellij.util.io.ExternalIntegerKeyDescriptor
import java.io.File
internal class IdToFileMap(file: File) : BasicMap<Int, File>(file, ExternalIntegerKeyDescriptor(), FileKeyDescriptor) {
internal class IdToFileMap(
file: File,
private val pathConverter: FileToPathConverter
) : BasicMap<Int, String>(file, ExternalIntegerKeyDescriptor(), EnumeratorStringDescriptor.INSTANCE) {
override fun dumpKey(key: Int): String = key.toString()
override fun dumpValue(value: File): String = value.toString()
override fun dumpValue(value: String): String = value
operator fun get(id: Int): File? = storage[id]
operator fun get(id: Int): File? = storage[id]?.let { pathConverter.toFile(it) }
operator fun contains(id: Int): Boolean = id in storage
operator fun set(id: Int, file: File) {
storage[id] = file
storage[id] = pathConverter.toPath(file)
}
fun remove(id: Int) {

View File

@@ -21,32 +21,40 @@ import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
import java.io.File
internal class SourceToJvmNameMap(storageFile: File) : AbstractSourceToOutputMap<JvmClassName>(JvmClassNameTransformer, storageFile)
internal class SourceToFqNameMap(storageFile: File) : AbstractSourceToOutputMap<FqName>(FqNameTransformer, storageFile)
internal class SourceToJvmNameMap(
storageFile: File,
pathConverter: FileToPathConverter
) : AbstractSourceToOutputMap<JvmClassName>(JvmClassNameTransformer, storageFile, pathConverter)
internal class SourceToFqNameMap(
storageFile: File,
pathConverter: FileToPathConverter
) : AbstractSourceToOutputMap<FqName>(FqNameTransformer, storageFile, pathConverter)
internal abstract class AbstractSourceToOutputMap<Name>(
private val nameTransformer: NameTransformer<Name>,
storageFile: File
private val nameTransformer: NameTransformer<Name>,
storageFile: File,
private val pathConverter: FileToPathConverter
) : BasicStringMap<Collection<String>>(storageFile, PathStringDescriptor, StringCollectionExternalizer) {
fun clearOutputsForSource(sourceFile: File) {
remove(sourceFile.absolutePath)
remove(pathConverter.toPath(sourceFile))
}
fun add(sourceFile: File, className: Name) {
storage.append(sourceFile.absolutePath, nameTransformer.asString(className))
storage.append(pathConverter.toPath(sourceFile), nameTransformer.asString(className))
}
fun contains(sourceFile: File): Boolean =
sourceFile.absolutePath in storage
pathConverter.toPath(sourceFile) in storage
operator fun get(sourceFile: File): Collection<Name> =
storage[sourceFile.absolutePath].orEmpty().map(nameTransformer::asName)
storage[pathConverter.toPath(sourceFile)].orEmpty().map(nameTransformer::asName)
fun getFqNames(sourceFile: File): Collection<FqName> =
storage[sourceFile.absolutePath].orEmpty().map(nameTransformer::asFqName)
storage[pathConverter.toPath(sourceFile)].orEmpty().map(nameTransformer::asFqName)
override fun dumpValue(value: Collection<String>) =
value.dumpCollection()
value.dumpCollection()
private fun remove(path: String) {
storage.remove(path)

View File

@@ -177,20 +177,6 @@ object PathStringDescriptor : EnumeratorStringDescriptor() {
override fun isEqual(val1: String, val2: String?) = FileUtil.pathsEqual(val1, val2)
}
object FileKeyDescriptor : KeyDescriptor<File> {
override fun read(input: DataInput): File = File(input.readUTF())
override fun save(output: DataOutput, value: File) {
output.writeUTF(value.canonicalPath)
}
override fun getHashCode(value: File?): Int =
FileUtil.FILE_HASHING_STRATEGY.computeHashCode(value)
override fun isEqual(val1: File?, val2: File?): Boolean =
FileUtil.FILE_HASHING_STRATEGY.equals(val1, val2)
}
open class CollectionExternalizer<T>(
private val elementExternalizer: DataExternalizer<T>,
private val newCollection: () -> MutableCollection<T>

View File

@@ -1,79 +0,0 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.incremental.storage.version
/**
* Manages cache attributes values.
*
* Attribute values can be loaded by calling [loadActual].
* Based on loaded actual and fixed [expected] values [CacheAttributesDiff] can be constructed which can calculate [CacheStatus].
* Build system may perform required actions based on that (i.e. rebuild something, clearing caches, etc...).
*
* [CacheAttributesDiff] can be used to cache current attribute values and then can be used as facade for cache version operations.
*/
interface CacheAttributesManager<Attrs : Any> {
/**
* Cache attribute values expected by the current version of build system and compiler.
* `null` means that cache is not required (incremental compilation is disabled).
*/
val expected: Attrs?
/**
* Load actual cache attribute values.
* `null` means that cache is not yet created.
*
* This is internal operation that should be implemented by particular implementation of CacheAttributesManager.
* Consider using `loadDiff().actual` for getting actual values.
*/
fun loadActual(): Attrs?
/**
* Write [values] as cache attributes for next build execution.
*
* This is internal operation that should be implemented by particular implementation of CacheAttributesManager.
* Consider using `loadDiff().saveExpectedIfNeeded()` for saving attributes values for next build.
*/
fun writeActualVersion(values: Attrs?)
/**
* Check if cache with [actual] attributes values can be used when [expected] attributes are required.
*/
fun isCompatible(actual: Attrs, expected: Attrs): Boolean = actual == expected
}
fun <Attrs : Any> CacheAttributesManager<Attrs>.loadDiff(
actual: Attrs? = this.loadActual(),
expected: Attrs? = this.expected
) = CacheAttributesDiff(this, actual, expected)
fun <Attrs : Any> CacheAttributesManager<Attrs>.loadAndCheckStatus() =
loadDiff().status
/**
* This method is kept only for compatibility.
* Save [expected] cache attributes values if it is enabled and not equals to [actual].
*/
@Deprecated(
message = "Consider using `this.loadDiff().saveExpectedIfNeeded()` and cache `loadDiff()` result.",
replaceWith = ReplaceWith("loadDiff().saveExpectedIfNeeded()")
)
fun <Attrs : Any> CacheAttributesManager<Attrs>.saveIfNeeded(
actual: Attrs? = this.loadActual(),
expected: Attrs = this.expected
?: error("To save disabled cache status [delete] should be called (this behavior is kept for compatibility)")
) = loadDiff(actual, expected).saveExpectedIfNeeded()
/**
* This method is kept only for compatibility.
* Delete actual cache attributes values if it existed.
*/
@Deprecated(
message = "Consider using `this.loadDiff().saveExpectedIfNeeded()` and cache `loadDiff()` result.",
replaceWith = ReplaceWith("writeActualVersion(null)")
)
fun CacheAttributesManager<*>.clean() {
writeActualVersion(null)
}

View File

@@ -1,31 +0,0 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.incremental.storage.version
/**
* Status that is used by system to perform required actions (i.e. rebuild something, clearing caches, etc...).
*/
enum class CacheStatus {
/**
* Cache is valid and ready to use.
*/
VALID,
/**
* Cache is not exists or have outdated versions and/or other attributes.
*/
INVALID,
/**
* Cache is exists, but not required anymore.
*/
SHOULD_BE_CLEARED,
/**
* Cache is not exists and not required.
*/
CLEARED
}

View File

@@ -1,60 +0,0 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.incremental.storage.version
import org.jetbrains.annotations.TestOnly
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmBytecodeBinaryVersion
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmMetadataVersion
import java.io.File
import java.io.IOException
/**
* Manages files with actual version [loadActual] and provides expected version [expected].
* Based on that actual and expected versions [CacheStatus] can be calculated.
* This can be done by constructing [CacheAttributesDiff] and calling [CacheAttributesDiff.status].
* Based on that status system may perform required actions (i.e. rebuild something, clearing caches, etc...).
*/
class CacheVersionManager(
private val versionFile: File,
expectedOwnVersion: Int?
) : CacheAttributesManager<CacheVersion> {
override val expected: CacheVersion? =
if (expectedOwnVersion == null) null
else {
val metadata = JvmMetadataVersion.INSTANCE
val bytecode = JvmBytecodeBinaryVersion.INSTANCE
CacheVersion(
expectedOwnVersion * 1000000 +
bytecode.major * 10000 + bytecode.minor * 100 +
metadata.major * 1000 + metadata.minor
)
}
override fun loadActual(): CacheVersion? =
if (!versionFile.exists()) null
else try {
CacheVersion(versionFile.readText().toInt())
} catch (e: NumberFormatException) {
null
} catch (e: IOException) {
null
}
override fun writeActualVersion(values: CacheVersion?) {
if (values == null) versionFile.delete()
else {
versionFile.parentFile.mkdirs()
versionFile.writeText(values.version.toString())
}
}
@get:TestOnly
val versionFileForTesting: File
get() = versionFile
}
data class CacheVersion(val version: Int)

View File

@@ -1,17 +0,0 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.incremental.storage.version
import java.io.File
private val NORMAL_VERSION = 9
private val NORMAL_VERSION_FILE_NAME = "format-version.txt"
fun localCacheVersionManager(dataRoot: File, isCachesEnabled: Boolean) =
CacheVersionManager(
File(dataRoot, NORMAL_VERSION_FILE_NAME),
if (isCachesEnabled) NORMAL_VERSION else null
)

View File

@@ -1,20 +0,0 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.incremental.storage.version
import java.io.File
private val DATA_CONTAINER_VERSION_FILE_NAME = "data-container-format-version.txt"
private val DATA_CONTAINER_VERSION = 3
fun lookupsCacheVersionManager(dataRoot: File, isEnabled: Boolean) =
CacheVersionManager(
File(dataRoot, DATA_CONTAINER_VERSION_FILE_NAME),
if (isEnabled) DATA_CONTAINER_VERSION else null
)
fun readLookupsCacheStatus(dataRoot: File, isEnabled: Boolean): CacheStatus =
lookupsCacheVersionManager(dataRoot, isEnabled).loadAndCheckStatus()

View File

@@ -16,8 +16,6 @@
package org.jetbrains.kotlin.modules
import com.intellij.openapi.util.io.FileUtil.toSystemIndependentName
import com.intellij.openapi.util.text.StringUtil.escapeXml
import org.jetbrains.kotlin.build.JvmSourceRoot
import org.jetbrains.kotlin.cli.common.modules.ModuleXmlParser.*
import org.jetbrains.kotlin.config.IncrementalCompilation
@@ -137,6 +135,13 @@ class KotlinModuleXmlBuilder {
}
private fun getEscapedPath(sourceFile: File): String {
return escapeXml(toSystemIndependentName(sourceFile.path))
return escapeXml(sourceFile.invariantSeparatorsPath)
}
private companion object {
private val xmlEscapeReplacement = mapOf("<" to "&lt;", ">" to "&gt;", "&" to "&amp;", "'" to "&#39;", "\"" to "&quot;")
private val xmlEscapeRegex = Regex(xmlEscapeReplacement.keys.joinToString("|", "(?:", ")") { Regex.escape(it) })
private fun escapeXml(string: String) = string.replace(xmlEscapeRegex) { xmlEscapeReplacement.getValue(it.value) }
}
}

View File

@@ -205,7 +205,7 @@ private fun kjsmToString(kjsmFile: File): String {
}
private fun sourceMapFileToString(sourceMapFile: File, generatedJsFile: File): String {
val sourceMapParseResult = SourceMapParser.parse(StringReader(sourceMapFile.readText()))
val sourceMapParseResult = SourceMapParser.parse(sourceMapFile.readText())
return when (sourceMapParseResult) {
is SourceMapSuccess -> {
val bytesOut = ByteArrayOutputStream()

View File

@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.incremental.testingUtils
import com.intellij.openapi.util.io.FileUtil
import java.io.File
import java.util.*
import kotlin.math.max
private val COMMANDS = listOf("new", "touch", "delete")
private val COMMANDS_AS_REGEX_PART = COMMANDS.joinToString("|")
@@ -67,12 +68,18 @@ fun getModificationsToPerform(
val underscore = fileName.indexOf("_")
if (underscore != -1) {
val module = fileName.substring(0, underscore)
var moduleName = fileName.substring(0, underscore)
var moduleFileName = fileName.substring(underscore + 1)
if (moduleName.all { it.isDigit() }) {
val (moduleName1, moduleFileName1) = moduleFileName.split("_")
moduleName = moduleName1
moduleFileName = moduleFileName1
}
assert(moduleNames != null) { "File name has module prefix, but multi-module environment is absent" }
assert(module in moduleNames!!) { "Module not found for file with prefix: $fileName" }
assert(moduleName in moduleNames!!) { "Module not found for file with prefix: $fileName" }
return Pair(module, fileName.substring(underscore + 1))
return Pair(moduleName, moduleFileName)
}
assert(moduleNames == null) { "Test is multi-module, but file has no module prefix: $fileName" }
@@ -160,7 +167,7 @@ class TouchFile(path: String, private val touchPolicy: TouchPolicy) : Modificati
TouchPolicy.TIMESTAMP -> {
val oldLastModified = file.lastModified()
//Mac OS and some versions of Linux truncate timestamp to nearest second
file.setLastModified(Math.max(System.currentTimeMillis(), oldLastModified + 1000))
file.setLastModified(max(System.currentTimeMillis(), oldLastModified + 1000))
}
TouchPolicy.CHECKSUM -> {
file.appendText(" ")

View File

@@ -2643,7 +2643,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
boolean hasArrayDimensionCount();
@@ -2657,7 +2659,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
int getArrayDimensionCount();
@@ -3220,7 +3224,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public boolean hasArrayDimensionCount() {
@@ -3236,7 +3242,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public int getArrayDimensionCount() {
@@ -4365,7 +4373,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public boolean hasArrayDimensionCount() {
@@ -4381,7 +4391,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public int getArrayDimensionCount() {
@@ -4397,7 +4409,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public Builder setArrayDimensionCount(int value) {
@@ -4416,7 +4430,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public Builder clearArrayDimensionCount() {

View File

@@ -12,6 +12,8 @@ public final class DebugBuiltInsProtoBuf {
registry.add(org.jetbrains.kotlin.metadata.builtins.DebugBuiltInsProtoBuf.constructorAnnotation);
registry.add(org.jetbrains.kotlin.metadata.builtins.DebugBuiltInsProtoBuf.functionAnnotation);
registry.add(org.jetbrains.kotlin.metadata.builtins.DebugBuiltInsProtoBuf.propertyAnnotation);
registry.add(org.jetbrains.kotlin.metadata.builtins.DebugBuiltInsProtoBuf.propertyGetterAnnotation);
registry.add(org.jetbrains.kotlin.metadata.builtins.DebugBuiltInsProtoBuf.propertySetterAnnotation);
registry.add(org.jetbrains.kotlin.metadata.builtins.DebugBuiltInsProtoBuf.compileTimeValue);
registry.add(org.jetbrains.kotlin.metadata.builtins.DebugBuiltInsProtoBuf.enumEntryAnnotation);
registry.add(org.jetbrains.kotlin.metadata.builtins.DebugBuiltInsProtoBuf.parameterAnnotation);
@@ -73,6 +75,28 @@ public final class DebugBuiltInsProtoBuf {
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int PROPERTY_GETTER_ANNOTATION_FIELD_NUMBER = 152;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Property,
java.util.List<org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation>> propertyGetterAnnotation = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int PROPERTY_SETTER_ANNOTATION_FIELD_NUMBER = 153;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Property,
java.util.List<org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation>> propertySetterAnnotation = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int COMPILE_TIME_VALUE_FIELD_NUMBER = 151;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
@@ -153,22 +177,28 @@ public final class DebugBuiltInsProtoBuf {
"notation:p\n\023property_annotation\022\'.org.je" +
"tbrains.kotlin.metadata.Property\030\226\001 \003(\0132" +
").org.jetbrains.kotlin.metadata.Annotati" +
"on:~\n\022compile_time_value\022\'.org.jetbrains" +
".kotlin.metadata.Property\030\227\001 \001(\01328.org.j" +
"etbrains.kotlin.metadata.Annotation.Argu" +
"ment.Value:s\n\025enum_entry_annotation\022(.or",
"g.jetbrains.kotlin.metadata.EnumEntry\030\226\001" +
" \003(\0132).org.jetbrains.kotlin.metadata.Ann" +
"otation:w\n\024parameter_annotation\022-.org.je" +
"tbrains.kotlin.metadata.ValueParameter\030\226" +
"\001 \003(\0132).org.jetbrains.kotlin.metadata.An" +
"notation:h\n\017type_annotation\022#.org.jetbra" +
"ins.kotlin.metadata.Type\030\226\001 \003(\0132).org.je" +
"tbrains.kotlin.metadata.Annotation:{\n\031ty" +
"pe_parameter_annotation\022,.org.jetbrains." +
"kotlin.metadata.TypeParameter\030\226\001 \003(\0132).o",
"rg.jetbrains.kotlin.metadata.AnnotationB" +
"\027B\025DebugBuiltInsProtoBuf"
"on:w\n\032property_getter_annotation\022\'.org.j" +
"etbrains.kotlin.metadata.Property\030\230\001 \003(\013" +
"2).org.jetbrains.kotlin.metadata.Annotat" +
"ion:w\n\032property_setter_annotation\022\'.org.",
"jetbrains.kotlin.metadata.Property\030\231\001 \003(" +
"\0132).org.jetbrains.kotlin.metadata.Annota" +
"tion:~\n\022compile_time_value\022\'.org.jetbrai" +
"ns.kotlin.metadata.Property\030\227\001 \001(\01328.org" +
".jetbrains.kotlin.metadata.Annotation.Ar" +
"gument.Value:s\n\025enum_entry_annotation\022(." +
"org.jetbrains.kotlin.metadata.EnumEntry\030" +
"\226\001 \003(\0132).org.jetbrains.kotlin.metadata.A" +
"nnotation:w\n\024parameter_annotation\022-.org." +
"jetbrains.kotlin.metadata.ValueParameter",
"\030\226\001 \003(\0132).org.jetbrains.kotlin.metadata." +
"Annotation:h\n\017type_annotation\022#.org.jetb" +
"rains.kotlin.metadata.Type\030\226\001 \003(\0132).org." +
"jetbrains.kotlin.metadata.Annotation:{\n\031" +
"type_parameter_annotation\022,.org.jetbrain" +
"s.kotlin.metadata.TypeParameter\030\226\001 \003(\0132)" +
".org.jetbrains.kotlin.metadata.Annotatio" +
"nB\027B\025DebugBuiltInsProtoBuf"
};
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
@@ -188,11 +218,13 @@ public final class DebugBuiltInsProtoBuf {
constructorAnnotation.internalInit(descriptor.getExtensions().get(2));
functionAnnotation.internalInit(descriptor.getExtensions().get(3));
propertyAnnotation.internalInit(descriptor.getExtensions().get(4));
compileTimeValue.internalInit(descriptor.getExtensions().get(5));
enumEntryAnnotation.internalInit(descriptor.getExtensions().get(6));
parameterAnnotation.internalInit(descriptor.getExtensions().get(7));
typeAnnotation.internalInit(descriptor.getExtensions().get(8));
typeParameterAnnotation.internalInit(descriptor.getExtensions().get(9));
propertyGetterAnnotation.internalInit(descriptor.getExtensions().get(5));
propertySetterAnnotation.internalInit(descriptor.getExtensions().get(6));
compileTimeValue.internalInit(descriptor.getExtensions().get(7));
enumEntryAnnotation.internalInit(descriptor.getExtensions().get(8));
parameterAnnotation.internalInit(descriptor.getExtensions().get(9));
typeAnnotation.internalInit(descriptor.getExtensions().get(10));
typeParameterAnnotation.internalInit(descriptor.getExtensions().get(11));
org.jetbrains.kotlin.metadata.DebugProtoBuf.getDescriptor();
}

View File

@@ -14,6 +14,8 @@ public final class DebugJsProtoBuf {
registry.add(org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf.functionAnnotation);
registry.add(org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf.functionContainingFileId);
registry.add(org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf.propertyAnnotation);
registry.add(org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf.propertyGetterAnnotation);
registry.add(org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf.propertySetterAnnotation);
registry.add(org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf.compileTimeValue);
registry.add(org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf.propertyContainingFileId);
registry.add(org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf.enumEntryAnnotation);
@@ -4752,6 +4754,28 @@ public final class DebugJsProtoBuf {
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int PROPERTY_GETTER_ANNOTATION_FIELD_NUMBER = 132;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Property,
java.util.List<org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation>> propertyGetterAnnotation = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int PROPERTY_SETTER_ANNOTATION_FIELD_NUMBER = 133;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Property,
java.util.List<org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation>> propertySetterAnnotation = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int COMPILE_TIME_VALUE_FIELD_NUMBER = 131;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
@@ -4900,27 +4924,33 @@ public final class DebugJsProtoBuf {
"ion\030\207\001 \001(\005:p\n\023property_annotation\022\'.org." +
"jetbrains.kotlin.metadata.Property\030\202\001 \003(" +
"\0132).org.jetbrains.kotlin.metadata.Annota" +
"tion:~\n\022compile_time_value\022\'.org.jetbrai" +
"ns.kotlin.metadata.Property\030\203\001 \001(\01328.org" +
".jetbrains.kotlin.metadata.Annotation.Ar",
"gument.Value:M\n\033property_containing_file" +
"_id\022\'.org.jetbrains.kotlin.metadata.Prop" +
"erty\030\207\001 \001(\005:s\n\025enum_entry_annotation\022(.o" +
"rg.jetbrains.kotlin.metadata.EnumEntry\030\202" +
"\001 \003(\0132).org.jetbrains.kotlin.metadata.An" +
"notation:w\n\024parameter_annotation\022-.org.j" +
"etbrains.kotlin.metadata.ValueParameter\030" +
"\202\001 \003(\0132).org.jetbrains.kotlin.metadata.A" +
"nnotation:h\n\017type_annotation\022#.org.jetbr" +
"ains.kotlin.metadata.Type\030\202\001 \003(\0132).org.j",
"etbrains.kotlin.metadata.Annotation:{\n\031t" +
"ype_parameter_annotation\022,.org.jetbrains" +
".kotlin.metadata.TypeParameter\030\202\001 \003(\0132)." +
"org.jetbrains.kotlin.metadata.Annotation" +
":x\n\026package_fragment_files\022..org.jetbrai" +
"ns.kotlin.metadata.PackageFragment\030\202\001 \001(" +
"\0132\'.org.jetbrains.kotlin.metadata.js.Fil" +
"esB\021B\017DebugJsProtoBuf"
"tion:w\n\032property_getter_annotation\022\'.org" +
".jetbrains.kotlin.metadata.Property\030\204\001 \003" +
"(\0132).org.jetbrains.kotlin.metadata.Annot",
"ation:w\n\032property_setter_annotation\022\'.or" +
"g.jetbrains.kotlin.metadata.Property\030\205\001 " +
"\003(\0132).org.jetbrains.kotlin.metadata.Anno" +
"tation:~\n\022compile_time_value\022\'.org.jetbr" +
"ains.kotlin.metadata.Property\030\203\001 \001(\01328.o" +
"rg.jetbrains.kotlin.metadata.Annotation." +
"Argument.Value:M\n\033property_containing_fi" +
"le_id\022\'.org.jetbrains.kotlin.metadata.Pr" +
"operty\030\207\001 \001(\005:s\n\025enum_entry_annotation\022(" +
".org.jetbrains.kotlin.metadata.EnumEntry",
"\030\202\001 \003(\0132).org.jetbrains.kotlin.metadata." +
"Annotation:w\n\024parameter_annotation\022-.org" +
".jetbrains.kotlin.metadata.ValueParamete" +
"r\030\202\001 \003(\0132).org.jetbrains.kotlin.metadata" +
".Annotation:h\n\017type_annotation\022#.org.jet" +
"brains.kotlin.metadata.Type\030\202\001 \003(\0132).org" +
".jetbrains.kotlin.metadata.Annotation:{\n" +
"\031type_parameter_annotation\022,.org.jetbrai" +
"ns.kotlin.metadata.TypeParameter\030\202\001 \003(\0132" +
").org.jetbrains.kotlin.metadata.Annotati",
"on:x\n\026package_fragment_files\022..org.jetbr" +
"ains.kotlin.metadata.PackageFragment\030\202\001 " +
"\001(\0132\'.org.jetbrains.kotlin.metadata.js.F" +
"ilesB\021B\017DebugJsProtoBuf"
};
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
@@ -4972,13 +5002,15 @@ public final class DebugJsProtoBuf {
functionAnnotation.internalInit(descriptor.getExtensions().get(4));
functionContainingFileId.internalInit(descriptor.getExtensions().get(5));
propertyAnnotation.internalInit(descriptor.getExtensions().get(6));
compileTimeValue.internalInit(descriptor.getExtensions().get(7));
propertyContainingFileId.internalInit(descriptor.getExtensions().get(8));
enumEntryAnnotation.internalInit(descriptor.getExtensions().get(9));
parameterAnnotation.internalInit(descriptor.getExtensions().get(10));
typeAnnotation.internalInit(descriptor.getExtensions().get(11));
typeParameterAnnotation.internalInit(descriptor.getExtensions().get(12));
packageFragmentFiles.internalInit(descriptor.getExtensions().get(13));
propertyGetterAnnotation.internalInit(descriptor.getExtensions().get(7));
propertySetterAnnotation.internalInit(descriptor.getExtensions().get(8));
compileTimeValue.internalInit(descriptor.getExtensions().get(9));
propertyContainingFileId.internalInit(descriptor.getExtensions().get(10));
enumEntryAnnotation.internalInit(descriptor.getExtensions().get(11));
parameterAnnotation.internalInit(descriptor.getExtensions().get(12));
typeAnnotation.internalInit(descriptor.getExtensions().get(13));
typeParameterAnnotation.internalInit(descriptor.getExtensions().get(14));
packageFragmentFiles.internalInit(descriptor.getExtensions().get(15));
org.jetbrains.kotlin.metadata.DebugProtoBuf.getDescriptor();
}

View File

@@ -13,12 +13,16 @@ public final class DebugKonanProtoBuf {
registry.add(org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.inlineConstructorIrBody);
registry.add(org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.functionAnnotation);
registry.add(org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.inlineIrBody);
registry.add(org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.functionFile);
registry.add(org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.propertyAnnotation);
registry.add(org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.propertyGetterAnnotation);
registry.add(org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.propertySetterAnnotation);
registry.add(org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.hasBackingField);
registry.add(org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.usedAsVariable);
registry.add(org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.compileTimeValue);
registry.add(org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.inlineGetterIrBody);
registry.add(org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.inlineSetterIrBody);
registry.add(org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.propertyFile);
registry.add(org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.enumEntryAnnotation);
registry.add(org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.enumEntryOrdinal);
registry.add(org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.parameterAnnotation);
@@ -3058,6 +3062,25 @@ public final class DebugKonanProtoBuf {
*/
org.jetbrains.kotlin.protobuf.ByteString
getEmptyPackageBytes(int index);
/**
* <code>repeated string file = 4;</code>
*/
org.jetbrains.kotlin.protobuf.ProtocolStringList
getFileList();
/**
* <code>repeated string file = 4;</code>
*/
int getFileCount();
/**
* <code>repeated string file = 4;</code>
*/
java.lang.String getFile(int index);
/**
* <code>repeated string file = 4;</code>
*/
org.jetbrains.kotlin.protobuf.ByteString
getFileBytes(int index);
}
/**
* Protobuf type {@code org.jetbrains.kotlin.metadata.konan.LinkDataLibrary}
@@ -3135,6 +3158,15 @@ public final class DebugKonanProtoBuf {
emptyPackage_.add(bs);
break;
}
case 34: {
org.jetbrains.kotlin.protobuf.ByteString bs = input.readBytes();
if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
file_ = new org.jetbrains.kotlin.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00000008;
}
file_.add(bs);
break;
}
}
}
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
@@ -3149,6 +3181,9 @@ public final class DebugKonanProtoBuf {
if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
emptyPackage_ = emptyPackage_.getUnmodifiableView();
}
if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
file_ = file_.getUnmodifiableView();
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
@@ -3281,10 +3316,40 @@ public final class DebugKonanProtoBuf {
return emptyPackage_.getByteString(index);
}
public static final int FILE_FIELD_NUMBER = 4;
private org.jetbrains.kotlin.protobuf.LazyStringList file_;
/**
* <code>repeated string file = 4;</code>
*/
public org.jetbrains.kotlin.protobuf.ProtocolStringList
getFileList() {
return file_;
}
/**
* <code>repeated string file = 4;</code>
*/
public int getFileCount() {
return file_.size();
}
/**
* <code>repeated string file = 4;</code>
*/
public java.lang.String getFile(int index) {
return file_.get(index);
}
/**
* <code>repeated string file = 4;</code>
*/
public org.jetbrains.kotlin.protobuf.ByteString
getFileBytes(int index) {
return file_.getByteString(index);
}
private void initFields() {
moduleName_ = "";
packageFragmentName_ = org.jetbrains.kotlin.protobuf.LazyStringArrayList.EMPTY;
emptyPackage_ = org.jetbrains.kotlin.protobuf.LazyStringArrayList.EMPTY;
file_ = org.jetbrains.kotlin.protobuf.LazyStringArrayList.EMPTY;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
@@ -3312,6 +3377,9 @@ public final class DebugKonanProtoBuf {
for (int i = 0; i < emptyPackage_.size(); i++) {
output.writeBytes(3, emptyPackage_.getByteString(i));
}
for (int i = 0; i < file_.size(); i++) {
output.writeBytes(4, file_.getByteString(i));
}
getUnknownFields().writeTo(output);
}
@@ -3343,6 +3411,15 @@ public final class DebugKonanProtoBuf {
size += dataSize;
size += 1 * getEmptyPackageList().size();
}
{
int dataSize = 0;
for (int i = 0; i < file_.size(); i++) {
dataSize += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeBytesSizeNoTag(file_.getByteString(i));
}
size += dataSize;
size += 1 * getFileList().size();
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
@@ -3466,6 +3543,8 @@ public final class DebugKonanProtoBuf {
bitField0_ = (bitField0_ & ~0x00000002);
emptyPackage_ = org.jetbrains.kotlin.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000004);
file_ = org.jetbrains.kotlin.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000008);
return this;
}
@@ -3508,6 +3587,11 @@ public final class DebugKonanProtoBuf {
bitField0_ = (bitField0_ & ~0x00000004);
}
result.emptyPackage_ = emptyPackage_;
if (((bitField0_ & 0x00000008) == 0x00000008)) {
file_ = file_.getUnmodifiableView();
bitField0_ = (bitField0_ & ~0x00000008);
}
result.file_ = file_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
@@ -3549,6 +3633,16 @@ public final class DebugKonanProtoBuf {
}
onChanged();
}
if (!other.file_.isEmpty()) {
if (file_.isEmpty()) {
file_ = other.file_;
bitField0_ = (bitField0_ & ~0x00000008);
} else {
ensureFileIsMutable();
file_.addAll(other.file_);
}
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
@@ -3842,6 +3936,99 @@ public final class DebugKonanProtoBuf {
return this;
}
private org.jetbrains.kotlin.protobuf.LazyStringList file_ = org.jetbrains.kotlin.protobuf.LazyStringArrayList.EMPTY;
private void ensureFileIsMutable() {
if (!((bitField0_ & 0x00000008) == 0x00000008)) {
file_ = new org.jetbrains.kotlin.protobuf.LazyStringArrayList(file_);
bitField0_ |= 0x00000008;
}
}
/**
* <code>repeated string file = 4;</code>
*/
public org.jetbrains.kotlin.protobuf.ProtocolStringList
getFileList() {
return file_.getUnmodifiableView();
}
/**
* <code>repeated string file = 4;</code>
*/
public int getFileCount() {
return file_.size();
}
/**
* <code>repeated string file = 4;</code>
*/
public java.lang.String getFile(int index) {
return file_.get(index);
}
/**
* <code>repeated string file = 4;</code>
*/
public org.jetbrains.kotlin.protobuf.ByteString
getFileBytes(int index) {
return file_.getByteString(index);
}
/**
* <code>repeated string file = 4;</code>
*/
public Builder setFile(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureFileIsMutable();
file_.set(index, value);
onChanged();
return this;
}
/**
* <code>repeated string file = 4;</code>
*/
public Builder addFile(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureFileIsMutable();
file_.add(value);
onChanged();
return this;
}
/**
* <code>repeated string file = 4;</code>
*/
public Builder addAllFile(
java.lang.Iterable<java.lang.String> values) {
ensureFileIsMutable();
org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll(
values, file_);
onChanged();
return this;
}
/**
* <code>repeated string file = 4;</code>
*/
public Builder clearFile() {
file_ = org.jetbrains.kotlin.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000008);
onChanged();
return this;
}
/**
* <code>repeated string file = 4;</code>
*/
public Builder addFileBytes(
org.jetbrains.kotlin.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
ensureFileIsMutable();
file_.add(value);
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.konan.LinkDataLibrary)
}
@@ -3919,6 +4106,17 @@ public final class DebugKonanProtoBuf {
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.InlineIrBody.class,
org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.InlineIrBody.getDefaultInstance());
public static final int FUNCTION_FILE_FIELD_NUMBER = 172;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Function { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Function,
java.lang.Integer> functionFile = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
java.lang.Integer.class,
null);
public static final int PROPERTY_ANNOTATION_FIELD_NUMBER = 170;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
@@ -3930,6 +4128,28 @@ public final class DebugKonanProtoBuf {
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int PROPERTY_GETTER_ANNOTATION_FIELD_NUMBER = 177;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Property,
java.util.List<org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation>> propertyGetterAnnotation = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int PROPERTY_SETTER_ANNOTATION_FIELD_NUMBER = 178;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Property,
java.util.List<org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation>> propertySetterAnnotation = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int HAS_BACKING_FIELD_FIELD_NUMBER = 171;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
@@ -3985,6 +4205,17 @@ public final class DebugKonanProtoBuf {
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.InlineIrBody.class,
org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.InlineIrBody.getDefaultInstance());
public static final int PROPERTY_FILE_FIELD_NUMBER = 176;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Property,
java.lang.Integer> propertyFile = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
java.lang.Integer.class,
null);
public static final int ENUM_ENTRY_ANNOTATION_FIELD_NUMBER = 170;
/**
* <code>extend .org.jetbrains.kotlin.metadata.EnumEntry { ... }</code>
@@ -4098,57 +4329,67 @@ public final class DebugKonanProtoBuf {
"\0132*.org.jetbrains.kotlin.metadata.String" +
"Table\"\\\n\017LinkDataClasses\022\022\n\nclass_name\030\001" +
" \003(\005\0225\n\007classes\030\002 \003(\0132$.org.jetbrains.ko" +
"tlin.metadata.Class\"\\\n\017LinkDataLibrary\022\023" +
"tlin.metadata.Class\"j\n\017LinkDataLibrary\022\023" +
"\n\013module_name\030\001 \002(\t\022\035\n\025package_fragment_" +
"name\030\002 \003(\t\022\025\n\rempty_package\030\003 \003(\t:@\n\017pac" +
"kage_fq_name\022&.org.jetbrains.kotlin.meta" +
"data.Package\030\253\001 \001(\005:j\n\020class_annotation\022" +
"$.org.jetbrains.kotlin.metadata.Class\030\252\001",
" \003(\0132).org.jetbrains.kotlin.metadata.Ann" +
"otation:v\n\026constructor_annotation\022*.org." +
"jetbrains.kotlin.metadata.Constructor\030\252\001" +
" \003(\0132).org.jetbrains.kotlin.metadata.Ann" +
"otation:\202\001\n\032inline_constructor_ir_body\022*" +
".org.jetbrains.kotlin.metadata.Construct" +
"or\030\253\001 \001(\01321.org.jetbrains.kotlin.metadat" +
"a.konan.InlineIrBody:p\n\023function_annotat" +
"ion\022\'.org.jetbrains.kotlin.metadata.Func" +
"tion\030\252\001 \003(\0132).org.jetbrains.kotlin.metad",
"ata.Annotation:s\n\016inline_ir_body\022\'.org.j" +
"etbrains.kotlin.metadata.Function\030\253\001 \001(\013" +
"21.org.jetbrains.kotlin.metadata.konan.I" +
"nlineIrBody:p\n\023property_annotation\022\'.org" +
".jetbrains.kotlin.metadata.Property\030\252\001 \003" +
"name\030\002 \003(\t\022\025\n\rempty_package\030\003 \003(\t\022\014\n\004fil" +
"e\030\004 \003(\t:@\n\017package_fq_name\022&.org.jetbrai" +
"ns.kotlin.metadata.Package\030\253\001 \001(\005:j\n\020cla" +
"ss_annotation\022$.org.jetbrains.kotlin.met",
"adata.Class\030\252\001 \003(\0132).org.jetbrains.kotli" +
"n.metadata.Annotation:v\n\026constructor_ann" +
"otation\022*.org.jetbrains.kotlin.metadata." +
"Constructor\030\252\001 \003(\0132).org.jetbrains.kotli" +
"n.metadata.Annotation:\202\001\n\032inline_constru" +
"ctor_ir_body\022*.org.jetbrains.kotlin.meta" +
"data.Constructor\030\253\001 \001(\01321.org.jetbrains." +
"kotlin.metadata.konan.InlineIrBody:p\n\023fu" +
"nction_annotation\022\'.org.jetbrains.kotlin" +
".metadata.Function\030\252\001 \003(\0132).org.jetbrain",
"s.kotlin.metadata.Annotation:s\n\016inline_i" +
"r_body\022\'.org.jetbrains.kotlin.metadata.F" +
"unction\030\253\001 \001(\01321.org.jetbrains.kotlin.me" +
"tadata.konan.InlineIrBody:?\n\rfunction_fi" +
"le\022\'.org.jetbrains.kotlin.metadata.Funct" +
"ion\030\254\001 \001(\005:p\n\023property_annotation\022\'.org." +
"jetbrains.kotlin.metadata.Property\030\252\001 \003(" +
"\0132).org.jetbrains.kotlin.metadata.Annota" +
"tion:w\n\032property_getter_annotation\022\'.org" +
".jetbrains.kotlin.metadata.Property\030\261\001 \003",
"(\0132).org.jetbrains.kotlin.metadata.Annot" +
"ation:C\n\021has_backing_field\022\'.org.jetbrai" +
"ns.kotlin.metadata.Property\030\253\001 \001(\010:B\n\020us" +
"ed_as_variable\022\'.org.jetbrains.kotlin.me" +
"tadata.Property\030\254\001 \001(\010:~\n\022compile_time_v",
"alue\022\'.org.jetbrains.kotlin.metadata.Pro" +
"perty\030\255\001 \001(\01328.org.jetbrains.kotlin.meta" +
"data.Annotation.Argument.Value:z\n\025inline" +
"_getter_ir_body\022\'.org.jetbrains.kotlin.m" +
"etadata.Property\030\256\001 \001(\01321.org.jetbrains." +
"kotlin.metadata.konan.InlineIrBody:z\n\025in" +
"line_setter_ir_body\022\'.org.jetbrains.kotl" +
"in.metadata.Property\030\257\001 \001(\01321.org.jetbra" +
"ins.kotlin.metadata.konan.InlineIrBody:s" +
"\n\025enum_entry_annotation\022(.org.jetbrains.",
"kotlin.metadata.EnumEntry\030\252\001 \003(\0132).org.j" +
"etbrains.kotlin.metadata.Annotation:E\n\022e" +
"num_entry_ordinal\022(.org.jetbrains.kotlin" +
".metadata.EnumEntry\030\253\001 \001(\005:w\n\024parameter_" +
"annotation\022-.org.jetbrains.kotlin.metada" +
"ta.ValueParameter\030\252\001 \003(\0132).org.jetbrains" +
".kotlin.metadata.Annotation:h\n\017type_anno" +
"tation\022#.org.jetbrains.kotlin.metadata.T" +
"ype\030\252\001 \003(\0132).org.jetbrains.kotlin.metada" +
"ta.Annotation:7\n\ttype_text\022#.org.jetbrai",
"ns.kotlin.metadata.Type\030\254\001 \001(\t:{\n\031type_p" +
"arameter_annotation\022,.org.jetbrains.kotl" +
"in.metadata.TypeParameter\030\252\001 \003(\0132).org.j" +
"etbrains.kotlin.metadata.AnnotationB\024B\022D" +
"ebugKonanProtoBuf"
"ation:w\n\032property_setter_annotation\022\'.or" +
"g.jetbrains.kotlin.metadata.Property\030\262\001 " +
"\003(\0132).org.jetbrains.kotlin.metadata.Anno" +
"tation:C\n\021has_backing_field\022\'.org.jetbra" +
"ins.kotlin.metadata.Property\030\253\001 \001(\010:B\n\020u" +
"sed_as_variable\022\'.org.jetbrains.kotlin.m" +
"etadata.Property\030\254\001 \001(\010:~\n\022compile_time_" +
"value\022\'.org.jetbrains.kotlin.metadata.Pr" +
"operty\030\255\001 \001(\01328.org.jetbrains.kotlin.met",
"adata.Annotation.Argument.Value:z\n\025inlin" +
"e_getter_ir_body\022\'.org.jetbrains.kotlin." +
"metadata.Property\030\256\001 \001(\01321.org.jetbrains" +
".kotlin.metadata.konan.InlineIrBody:z\n\025i" +
"nline_setter_ir_body\022\'.org.jetbrains.kot" +
"lin.metadata.Property\030\257\001 \001(\01321.org.jetbr" +
"ains.kotlin.metadata.konan.InlineIrBody:" +
"?\n\rproperty_file\022\'.org.jetbrains.kotlin." +
"metadata.Property\030\260\001 \001(\005:s\n\025enum_entry_a" +
"nnotation\022(.org.jetbrains.kotlin.metadat",
"a.EnumEntry\030\252\001 \003(\0132).org.jetbrains.kotli" +
"n.metadata.Annotation:E\n\022enum_entry_ordi" +
"nal\022(.org.jetbrains.kotlin.metadata.Enum" +
"Entry\030\253\001 \001(\005:w\n\024parameter_annotation\022-.o" +
"rg.jetbrains.kotlin.metadata.ValueParame" +
"ter\030\252\001 \003(\0132).org.jetbrains.kotlin.metada" +
"ta.Annotation:h\n\017type_annotation\022#.org.j" +
"etbrains.kotlin.metadata.Type\030\252\001 \003(\0132).o" +
"rg.jetbrains.kotlin.metadata.Annotation:" +
"7\n\ttype_text\022#.org.jetbrains.kotlin.meta",
"data.Type\030\254\001 \001(\t:{\n\031type_parameter_annot" +
"ation\022,.org.jetbrains.kotlin.metadata.Ty" +
"peParameter\030\252\001 \003(\0132).org.jetbrains.kotli" +
"n.metadata.AnnotationB\024B\022DebugKonanProto" +
"Buf"
};
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
@@ -4186,25 +4427,29 @@ public final class DebugKonanProtoBuf {
internal_static_org_jetbrains_kotlin_metadata_konan_LinkDataLibrary_fieldAccessorTable = new
org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_org_jetbrains_kotlin_metadata_konan_LinkDataLibrary_descriptor,
new java.lang.String[] { "ModuleName", "PackageFragmentName", "EmptyPackage", });
new java.lang.String[] { "ModuleName", "PackageFragmentName", "EmptyPackage", "File", });
packageFqName.internalInit(descriptor.getExtensions().get(0));
classAnnotation.internalInit(descriptor.getExtensions().get(1));
constructorAnnotation.internalInit(descriptor.getExtensions().get(2));
inlineConstructorIrBody.internalInit(descriptor.getExtensions().get(3));
functionAnnotation.internalInit(descriptor.getExtensions().get(4));
inlineIrBody.internalInit(descriptor.getExtensions().get(5));
propertyAnnotation.internalInit(descriptor.getExtensions().get(6));
hasBackingField.internalInit(descriptor.getExtensions().get(7));
usedAsVariable.internalInit(descriptor.getExtensions().get(8));
compileTimeValue.internalInit(descriptor.getExtensions().get(9));
inlineGetterIrBody.internalInit(descriptor.getExtensions().get(10));
inlineSetterIrBody.internalInit(descriptor.getExtensions().get(11));
enumEntryAnnotation.internalInit(descriptor.getExtensions().get(12));
enumEntryOrdinal.internalInit(descriptor.getExtensions().get(13));
parameterAnnotation.internalInit(descriptor.getExtensions().get(14));
typeAnnotation.internalInit(descriptor.getExtensions().get(15));
typeText.internalInit(descriptor.getExtensions().get(16));
typeParameterAnnotation.internalInit(descriptor.getExtensions().get(17));
functionFile.internalInit(descriptor.getExtensions().get(6));
propertyAnnotation.internalInit(descriptor.getExtensions().get(7));
propertyGetterAnnotation.internalInit(descriptor.getExtensions().get(8));
propertySetterAnnotation.internalInit(descriptor.getExtensions().get(9));
hasBackingField.internalInit(descriptor.getExtensions().get(10));
usedAsVariable.internalInit(descriptor.getExtensions().get(11));
compileTimeValue.internalInit(descriptor.getExtensions().get(12));
inlineGetterIrBody.internalInit(descriptor.getExtensions().get(13));
inlineSetterIrBody.internalInit(descriptor.getExtensions().get(14));
propertyFile.internalInit(descriptor.getExtensions().get(15));
enumEntryAnnotation.internalInit(descriptor.getExtensions().get(16));
enumEntryOrdinal.internalInit(descriptor.getExtensions().get(17));
parameterAnnotation.internalInit(descriptor.getExtensions().get(18));
typeAnnotation.internalInit(descriptor.getExtensions().get(19));
typeText.internalInit(descriptor.getExtensions().get(20));
typeParameterAnnotation.internalInit(descriptor.getExtensions().get(21));
org.jetbrains.kotlin.metadata.DebugProtoBuf.getDescriptor();
}

View File

@@ -1,24 +1,21 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.Project
import java.util.*
import java.io.File
import org.gradle.api.tasks.bundling.Jar
import org.gradle.plugins.ide.idea.model.IdeaModel
import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile
import proguard.gradle.ProGuardTask
import org.gradle.kotlin.dsl.*
buildscript {
extra["defaultSnapshotVersion"] = "1.3-SNAPSHOT"
kotlinBootstrapFrom(BootstrapOption.TeamCity("1.3.0-dev-322", onlySuccessBootstrap = false))
// when updating please also update JPS artifacts configuration: https://jetbrains.quip.com/zzGUAYSJ6gv3/JPS-Build-update-bootstrap
kotlinBootstrapFrom(BootstrapOption.TeamCity("1.3.40-dev-2251", onlySuccessBootstrap = false))
repositories {
repositories.withRedirector(project) {
bootstrapKotlinRepo?.let(::maven)
maven("https://plugins.gradle.org/m2")
}
}
// a workaround for kotlin compiler classpath in kotlin project: sometimes gradle substitutes
// kotlin-stdlib external dependency with local project :kotlin-stdlib in kotlinCompilerClasspath configuration.
@@ -30,7 +27,13 @@ buildscript {
classpath("com.gradle.publish:plugin-publish-plugin:0.9.7")
classpath(kotlin("gradle-plugin", bootstrapKotlinVersion))
classpath("net.sf.proguard:proguard-gradle:5.3.3")
classpath("net.sf.proguard:proguard-gradle:6.0.3")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:0.9.17")
// a workaround to add another one buildSrc with Cidr-specific tools to Gradle classpath
if (findProperty("cidrPluginsEnabled")?.toString()?.toBoolean() == true) {
classpath("org.jetbrains.kotlin.ultimate:buildSrc:1.0")
}
}
}
@@ -38,6 +41,7 @@ plugins {
`build-scan`
idea
id("jps-compatible")
id("org.jetbrains.gradle.plugin.idea-ext")
}
pill {
@@ -74,11 +78,7 @@ allprojects {
extra["kotlin_root"] = rootDir
val cidrKotlinPlugin by configurations.creating
dependencies {
cidrKotlinPlugin(project(":prepare:cidr-plugin", "runtimeJar"))
}
val jpsBootstrap by configurations.creating
val commonBuildDir = File(rootDir, "build")
val distDir by extra("$rootDir/dist")
@@ -87,9 +87,9 @@ val distLibDir = "$distKotlinHomeDir/lib"
val commonLocalDataDir = "$rootDir/local"
val ideaSandboxDir = "$commonLocalDataDir/ideaSandbox"
val ideaUltimateSandboxDir = "$commonLocalDataDir/ideaUltimateSandbox"
val ideaPluginDir = "$distDir/artifacts/ideaPlugin/Kotlin"
val ideaUltimatePluginDir = "$distDir/artifacts/ideaUltimatePlugin/Kotlin"
val cidrPluginDir = "$distDir/artifacts/cidrPlugin/Kotlin"
val artifactsDir = "$distDir/artifacts"
val ideaPluginDir = "$artifactsDir/ideaPlugin/Kotlin"
val ideaUltimatePluginDir = "$artifactsDir/ideaUltimatePlugin/Kotlin"
// TODO: use "by extra()" syntax where possible
extra["distLibDir"] = project.file(distLibDir)
@@ -99,21 +99,44 @@ extra["ideaSandboxDir"] = project.file(ideaSandboxDir)
extra["ideaUltimateSandboxDir"] = project.file(ideaUltimateSandboxDir)
extra["ideaPluginDir"] = project.file(ideaPluginDir)
extra["ideaUltimatePluginDir"] = project.file(ideaUltimatePluginDir)
extra["cidrPluginDir"] = project.file(cidrPluginDir)
extra["isSonatypeRelease"] = false
// Work-around necessary to avoid setting null javaHome. Will be removed after support of lazy task configuration
val jdkNotFoundConst = "JDK NOT FOUND"
extra["JDK_16"] = jdkPath("1.6")
extra["JDK_17"] = jdkPath("1.7")
extra["JDK_18"] = jdkPath("1.8")
extra["JDK_9"] = jdkPath("9")
extra["JDK_10"] = jdkPathIfFound("10")
extra["JDK_10"] = jdkPath("10")
extra["JDK_11"] = jdkPath("11")
rootProject.apply {
from(rootProject.file("versions.gradle.kts"))
from(rootProject.file("report.gradle.kts"))
gradle.taskGraph.beforeTask() {
checkJDK()
}
extra["versions.protobuf-java"] = "2.6.1"
var jdkChecked: Boolean = false
fun checkJDK() {
if (jdkChecked) {
return
}
var unpresentJdks = JdkMajorVersion.values().filter { it.isMandatory() }.map { it -> it.name }.filter { it == null || extra[it] == jdkNotFoundConst }.toList()
if (!unpresentJdks.isEmpty()) {
throw GradleException("Please set environment variable${if (unpresentJdks.size > 1) "s" else ""}: ${unpresentJdks.joinToString()} to point to corresponding JDK installation.")
}
jdkChecked = true
}
rootProject.apply {
from(rootProject.file("gradle/versions.gradle.kts"))
from(rootProject.file("gradle/report.gradle.kts"))
from(rootProject.file("gradle/javaInstrumentation.gradle.kts"))
from(rootProject.file("gradle/jps.gradle.kts"))
}
IdeVersionConfigurator.setCurrentIde(this)
extra["versions.protobuf"] = "2.6.1"
extra["versions.javax.inject"] = "1"
extra["versions.jsr305"] = "1.3.9"
extra["versions.jansi"] = "1.16"
@@ -122,8 +145,8 @@ extra["versions.junit"] = "4.12"
extra["versions.javaslang"] = "2.0.6"
extra["versions.ant"] = "1.8.2"
extra["versions.android"] = "2.3.1"
extra["versions.kotlinx-coroutines-core"] = "0.20"
extra["versions.kotlinx-coroutines-jdk8"] = "0.20"
extra["versions.kotlinx-coroutines-core"] = "1.1.1"
extra["versions.kotlinx-coroutines-jdk8"] = "1.1.1"
extra["versions.json"] = "20160807"
extra["versions.native-platform"] = "0.14"
extra["versions.ant-launcher"] = "1.8.0"
@@ -131,6 +154,12 @@ extra["versions.robolectric"] = "3.1"
extra["versions.org.springframework"] = "4.2.0.RELEASE"
extra["versions.jflex"] = "1.7.0"
extra["versions.markdown"] = "0.1.25"
extra["versions.trove4j"] = "1.0.20181211"
extra["versions.kotlin-native-shared"] = "1.0-dev-89"
if (!project.hasProperty("versions.kotlin-native")) {
extra["versions.kotlin-native"] = "1.3-eap-10415"
}
val isTeamcityBuild = project.hasProperty("teamcity") || System.getenv("TEAMCITY_VERSION") != null
val intellijUltimateEnabled = project.getBooleanProperty("intellijUltimateEnabled") ?: isTeamcityBuild
@@ -143,8 +172,7 @@ extra["intellijUltimateEnabled"] = intellijUltimateEnabled
extra["intellijSeparateSdks"] = intellijSeparateSdks
extra["IntellijCoreDependencies"] =
listOf("annotations",
"asm-all",
listOf(if (Platform[191].orHigher()) "asm-all-7.0.1" else "asm-all",
"guava",
"jdom",
"jna",
@@ -162,15 +190,18 @@ extra["compilerModules"] = arrayOf(
":compiler:serialization",
":compiler:psi",
":compiler:frontend",
":compiler:frontend.common",
":compiler:frontend.java",
":compiler:frontend.script",
":compiler:cli-common",
":compiler:daemon-common",
":compiler:daemon",
":compiler:ir.tree",
":compiler:ir.psi2ir",
":compiler:ir.backend.common",
":compiler:backend.jvm",
":compiler:backend.js",
":compiler:ir.serialization.common",
":compiler:ir.serialization.js",
":compiler:backend-common",
":compiler:backend",
":compiler:plugin-api",
@@ -190,15 +221,22 @@ extra["compilerModules"] = arrayOf(
":core:descriptors",
":core:descriptors.jvm",
":core:deserialization",
":core:util.runtime"
":core:util.runtime",
":core:type-system",
":compiler:fir:cones",
":compiler:fir:resolve",
":compiler:fir:tree",
":compiler:fir:psi2fir",
":compiler:fir:fir2ir"
)
val coreLibProjects = listOf(
val coreLibProjects = listOfNotNull(
":kotlin-stdlib",
":kotlin-stdlib-common",
":kotlin-stdlib-js",
":kotlin-stdlib-jre7",
":kotlin-stdlib-jre8",
// Local builds are disabled at the request of the lib team
// TODO: Enable when tests are fixed
":kotlin-stdlib-js-ir".takeIf { isTeamcityBuild },
":kotlin-stdlib-jdk7",
":kotlin-stdlib-jdk8",
":kotlin-test:kotlin-test-common",
@@ -244,13 +282,20 @@ fun Task.listConfigurationContents(configName: String) {
}
val defaultJvmTarget = "1.8"
val defaultJavaHome = jdkPath(defaultJvmTarget!!)
val defaultJavaHome = jdkPath(defaultJvmTarget)
val ignoreTestFailures by extra(project.findProperty("ignoreTestFailures")?.toString()?.toBoolean() ?: project.hasProperty("teamcity"))
allprojects {
configurations.maybeCreate("embedded")
jvmTarget = defaultJvmTarget
javaHome = defaultJavaHome
if (defaultJavaHome != null) {
javaHome = defaultJavaHome
} else {
logger.error("Could not find default java home. Please set environment variable JDK_${defaultJavaHome} to point to JDK ${defaultJavaHome} installation.")
}
// There are problems with common build dir:
// - some tests (in particular js and binary-compatibility-validator depend on the fixed (default) location
@@ -261,20 +306,23 @@ allprojects {
val mirrorRepo: String? = findProperty("maven.repository.mirror")?.toString()
repositories {
intellijSdkRepo(project)
androidDxJarRepo(project)
kotlinBuildLocalRepo(project)
mirrorRepo?.let(::maven)
bootstrapKotlinRepo?.let(::maven)
jcenter()
}
maven(protobufRepo)
maven(intellijRepo)
maven(bootstrapKotlinRepo!!.replace("artifacts/content/maven/", "artifacts/content/internal/repo"))
maven(kotlinNativeRepo)
}
configureJvmProject(javaHome!!, jvmTarget!!)
val commonCompilerArgs = listOfNotNull(
"-Xallow-kotlin-package",
"-Xread-deserialized-contracts",
"-Xprogressive".takeIf { hasProperty("test.progressive.mode") }, // TODO: change to "-progressive" after bootstrap
"-XXLanguage:-ReleaseCoroutines"
"-Xjvm-default=compatibility",
"-Xprogressive".takeIf { hasProperty("test.progressive.mode") } // TODO: change to "-progressive" after bootstrap
)
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
@@ -299,10 +347,6 @@ allprojects {
enabled = false
}
task<Jar>("javadocJar") {
classifier = "javadoc"
}
tasks.withType<Jar> {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
@@ -314,10 +358,10 @@ allprojects {
task("listDistJar") { listConfigurationContents("distJar") }
afterEvaluate {
logger.info("configuring project $name to compile to the target jvm version $jvmTarget using jdk: $javaHome")
if (javaHome != defaultJavaHome || jvmTarget != defaultJvmTarget) {
logger.info("configuring project $name to compile to the target jvm version $jvmTarget using jdk: $javaHome")
configureJvmProject(javaHome!!, jvmTarget!!)
}
} // else we will actually fail during the first task execution. We could not fail before configuration is done due to impact on import in IDE
fun File.toProjectRootRelativePathOrSelf() = (relativeToOrNull(rootDir)?.takeUnless { it.startsWith("..") } ?: this).path
@@ -337,6 +381,11 @@ allprojects {
dependencies.add(it.name, files(bootstrapCompilerClasspath))
}
}
if (cacheRedirectorEnabled()) {
logger.info("Redirecting repositories for $displayName")
repositories.redirect()
}
}
}
@@ -378,27 +427,30 @@ val copyCompilerToIdeaPlugin by task<Copy> {
val ideaPlugin by task<Task> {
dependsOn(copyCompilerToIdeaPlugin)
val childIdeaPluginTasks = getTasksByName("ideaPlugin", true) - this@task
dependsOn(childIdeaPluginTasks)
dependsOn(":prepare:idea-plugin:ideaPlugin")
}
tasks {
"clean" {
create("clean") {
doLast {
delete("$buildDir/repo")
delete(distDir)
}
}
"cleanupArtifacts" {
create("cleanupArtifacts") {
doLast {
delete(ideaPluginDir)
delete(ideaUltimatePluginDir)
delete(cidrPluginDir)
delete(artifactsDir)
}
}
"coreLibsTest" {
listOf("clean", "assemble", "install", "dist").forEach { taskName ->
create("coreLibs${taskName.capitalize()}") {
coreLibProjects.forEach { projectName -> dependsOn("$projectName:$taskName") }
}
}
create("coreLibsTest") {
(coreLibProjects + listOf(
":kotlin-stdlib:samples",
":kotlin-test:kotlin-test-js:kotlin-test-js-it",
@@ -409,101 +461,118 @@ tasks {
}
}
"gradlePluginTest" {
create("gradlePluginTest") {
gradlePluginProjects.forEach {
dependsOn(it + ":check")
}
}
"gradlePluginIntegrationTest" {
create("gradlePluginIntegrationTest") {
dependsOn(":kotlin-gradle-plugin-integration-tests:check")
}
"jvmCompilerTest" {
create("jvmCompilerTest") {
dependsOn("dist")
dependsOn(":compiler:test",
":compiler:container:test",
":compiler:tests-java8:test")
":compiler:tests-java8:test",
":compiler:tests-spec:remoteRunTests")
dependsOn(":plugins:jvm-abi-gen:test")
}
"jsCompilerTest" {
create("jsCompilerTest") {
dependsOn(":js:js.tests:test")
dependsOn(":js:js.tests:runMocha")
}
"scriptingTest" {
dependsOn("dist")
dependsOn(":kotlin-script-util:test")
create("firCompilerTest") {
dependsOn(":compiler:fir:psi2fir:test")
dependsOn(":compiler:fir:resolve:test")
dependsOn(":compiler:fir:fir2ir:test")
}
"compilerTest" {
create("scriptingTest") {
dependsOn("dist")
dependsOn(":kotlin-script-util:test")
dependsOn(":kotlin-scripting-compiler:test")
dependsOn(":kotlin-scripting-jvm-host-test:test")
dependsOn(":kotlin-scripting-jsr223-test:test")
dependsOn(":kotlin-scripting-jvm-host-test:embeddableTest")
dependsOn(":kotlin-scripting-jsr223-test:embeddableTest")
dependsOn(":kotlin-main-kts-test:test")
}
create("compilerTest") {
dependsOn("jvmCompilerTest")
dependsOn("jsCompilerTest")
dependsOn("firCompilerTest")
dependsOn("scriptingTest")
dependsOn(":kotlin-build-common:test")
dependsOn(":compiler:incremental-compilation-impl:test")
dependsOn(":core:descriptors.runtime:test")
}
"toolsTest" {
create("toolsTest") {
dependsOn(":tools:kotlinp:test")
}
"examplesTest" {
create("examplesTest") {
dependsOn("dist")
(project(":examples").subprojects + project(":kotlin-gradle-subplugin-example")).forEach { p ->
dependsOn("${p.path}:check")
}
}
"distTest" {
create("distTest") {
dependsOn("compilerTest")
dependsOn("toolsTest")
dependsOn("gradlePluginTest")
dependsOn("examplesTest")
}
"specTest" {
create("specTest") {
dependsOn("dist")
dependsOn(":compiler:tests-spec:test")
}
"androidCodegenTest" {
create("androidCodegenTest") {
dependsOn(":compiler:android-tests:test")
}
"jps-tests" {
create("jps-tests") {
dependsOn("dist")
dependsOn(":jps-plugin:test")
}
"idea-plugin-main-tests" {
create("idea-plugin-main-tests") {
dependsOn("dist")
dependsOn(":idea:test")
}
"idea-plugin-additional-tests" {
create("idea-plugin-additional-tests") {
dependsOn("dist")
dependsOn(":idea:idea-gradle:test",
":idea:idea-gradle-native:test",
":idea:idea-maven:test",
":j2k:test",
":eval4j:test")
":idea:eval4j:test")
}
"idea-plugin-tests" {
create("idea-plugin-tests") {
dependsOn("dist")
dependsOn("idea-plugin-main-tests",
"idea-plugin-additional-tests")
}
"android-ide-tests" {
create("android-ide-tests") {
dependsOn("dist")
dependsOn(":plugins:android-extensions-ide:test",
":idea:idea-android:test",
":kotlin-annotation-processing:test")
}
"plugins-tests" {
create("plugins-tests") {
dependsOn("dist")
dependsOn(":kotlin-annotation-processing:test",
":kotlin-source-sections-compiler-plugin:test",
@@ -511,11 +580,12 @@ tasks {
":kotlin-noarg-compiler-plugin:test",
":kotlin-sam-with-receiver-compiler-plugin:test",
":plugins:uast-kotlin:test",
":kotlin-annotation-processing-gradle:test")
":kotlin-annotation-processing-gradle:test",
":kotlinx-serialization-ide-plugin:test")
}
"ideaPluginTest" {
create("ideaPluginTest") {
dependsOn(
"idea-plugin-tests",
"jps-tests",
@@ -526,12 +596,15 @@ tasks {
}
"test" {
create("test") {
doLast {
throw GradleException("Don't use directly, use aggregate tasks *-check instead")
}
}
"check" { dependsOn("test") }
create("check") {
dependsOn("test")
}
}
fun CopySpec.setExecutablePermissions() {
@@ -590,43 +663,6 @@ val zipPlugin by task<Zip> {
}
}
val cidrPlugin by task<Copy> {
dependsOn(ideaPlugin)
into(cidrPluginDir)
from(ideaPluginDir) {
exclude("lib/kotlin-plugin.jar")
exclude("lib/android-lint.jar")
exclude("lib/android-ide.jar")
exclude("lib/android-output-parser-ide.jar")
exclude("lib/android-extensions-ide.jar")
exclude("lib/android-extensions-compiler.jar")
exclude("lib/kapt3-idea.jar")
exclude("lib/jps-ide.jar")
exclude("lib/jps/**")
exclude("kotlinc/**")
exclude("lib/maven-ide.jar")
}
from(cidrKotlinPlugin) { into("lib") }
}
val zipCidrPlugin by task<Zip> {
val destPath = project.findProperty("pluginZipPath") as String?
?: "$distDir/artifacts/kotlin-plugin-$kotlinVersion-CIDR.zip"
val destFile = File(destPath)
destinationDir = destFile.parentFile
archiveName = destFile.name
from(cidrPlugin)
into("Kotlin")
setExecutablePermissions()
doLast {
logger.lifecycle("Plugin artifacts packed to $archivePath")
}
}
configure<IdeaModel> {
module {
excludeDirs = files(
@@ -639,14 +675,12 @@ configure<IdeaModel> {
}
}
fun jdkPathIfFound(version: String): String? {
fun jdkPath(version: String): String {
val jdkName = "JDK_${version.replace(".", "")}"
val jdkMajorVersion = JdkMajorVersion.valueOf(jdkName)
return configuredJdks.find { it.majorVersion == jdkMajorVersion }?.homeDir?.canonicalPath
return configuredJdks.find { it.majorVersion == jdkMajorVersion }?.homeDir?.canonicalPath?:jdkNotFoundConst
}
fun jdkPath(version: String): String = jdkPathIfFound(version)
?: throw GradleException ("Please set environment variable JDK_${version.replace(".", "")} to point to JDK $version installation")
fun Project.configureJvmProject(javaHome: String, javaVersion: String) {
tasks.withType<JavaCompile> {
@@ -661,6 +695,7 @@ fun Project.configureJvmProject(javaHome: String, javaVersion: String) {
tasks.withType<KotlinCompile> {
kotlinOptions.jdkHome = javaHome
kotlinOptions.jvmTarget = javaVersion
kotlinOptions.freeCompilerArgs += "-Xjvm-default=compatibility"
}
tasks.withType<Test> {

View File

@@ -1,11 +1,17 @@
buildscript {
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
val buildSrcKotlinVersion: String by extra(findProperty("buildSrc.kotlin.version")?.toString() ?: embeddedKotlinVersion)
val buildSrcKotlinRepo: String? by extra(findProperty("buildSrc.kotlin.repo") as String?)
extra["versions.shadow"] = "2.0.2"
extra["versions.shadow"] = "4.0.3"
extra["versions.native-platform"] = "0.14"
repositories {
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com")
}
buildSrcKotlinRepo?.let {
maven(url = it)
}
@@ -17,6 +23,8 @@ buildscript {
}
}
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
logger.info("buildSrcKotlinVersion: " + extra["buildSrcKotlinVersion"])
logger.info("buildSrc kotlin compiler version: " + org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION)
logger.info("buildSrc stdlib version: " + KotlinVersion.CURRENT)
@@ -32,12 +40,12 @@ plugins {
}
gradlePlugin {
(plugins) {
"pill-configurable" {
plugins {
register("pill-configurable") {
id = "pill-configurable"
implementationClass = "org.jetbrains.kotlin.pill.PillConfigurablePlugin"
}
"jps-compatible" {
register("jps-compatible") {
id = "jps-compatible"
implementationClass = "org.jetbrains.kotlin.pill.JpsCompatiblePlugin"
}
@@ -51,14 +59,13 @@ fun Project.getBooleanProperty(name: String): Boolean? = this.findProperty(name)
}
rootProject.apply {
from(rootProject.file("../versions.gradle.kts"))
from(rootProject.file("../gradle/versions.gradle.kts"))
}
val isTeamcityBuild = project.hasProperty("teamcity") || System.getenv("TEAMCITY_VERSION") != null
val intellijUltimateEnabled by extra(project.getBooleanProperty("intellijUltimateEnabled") ?: isTeamcityBuild)
val intellijSeparateSdks by extra(project.getBooleanProperty("intellijSeparateSdks") ?: false)
extra["intellijRepo"] = "https://www.jetbrains.com/intellij-repository"
val verifyDependencyOutput by extra( getBooleanProperty("kotlin.build.dependency.output.verification") ?: isTeamcityBuild)
extra["intellijReleaseType"] = if (extra["versions.intellijSdk"]?.toString()?.endsWith("SNAPSHOT") == true)
"snapshots"
@@ -67,26 +74,34 @@ else
extra["versions.androidDxSources"] = "5.0.0_r2"
extra["customDepsOrg"] = "kotlin.build.custom.deps"
extra["customDepsOrg"] = "kotlin.build"
repositories {
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com")
maven("https://cache-redirector.jetbrains.com/jetbrains.bintray.com/intellij-third-party-dependencies/")
}
extra["buildSrcKotlinRepo"]?.let {
maven(url = it)
}
maven(url = "https://repo.gradle.org/gradle/ext-releases-local") // for native-platform
jcenter()
maven("https://jetbrains.bintray.com/intellij-third-party-dependencies/")
maven("https://plugins.gradle.org/m2/")
}
dependencies {
compile(kotlin("stdlib", embeddedKotlinVersion))
compile("net.rubygrapefruit:native-platform:${property("versions.native-platform")}")
compile("net.rubygrapefruit:native-platform-windows-amd64:${property("versions.native-platform")}")
compile("net.rubygrapefruit:native-platform-windows-i386:${property("versions.native-platform")}")
compile("com.jakewharton.dex:dex-method-list:3.0.0")
// TODO: adding the dep to the plugin breaks the build unexpectedly, resolve and uncomment
// compile("org.jetbrains.kotlin:kotlin-gradle-plugin:${rootProject.extra["bootstrap_kotlin_version"]}")
// Shadow plugin is used in many projects of the main build. Once it's no longer used in buildSrc, please move this dependency to the root project
compile("com.github.jengelman.gradle.plugins:shadow:${property("versions.shadow")}")
compile("org.ow2.asm:asm-all:6.0_BETA")
compile("org.jetbrains.intellij.deps:asm-all:7.0.1")
compile("gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:0.4.2")
}
samWithReceiver {
@@ -96,4 +111,4 @@ samWithReceiver {
fun Project.`samWithReceiver`(configure: org.jetbrains.kotlin.samWithReceiver.gradle.SamWithReceiverExtension.() -> Unit): Unit =
extensions.configure("samWithReceiver", configure)
tasks["build"].dependsOn(":prepare-deps:android-dx:build", ":prepare-deps:intellij-sdk:build")
tasks["build"].dependsOn(":prepare-deps:build")

View File

@@ -1,7 +1,6 @@
org.gradle.daemon=true
org.gradle.parallel=false
org.gradle.configureondemand=false
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m -Dfile.encoding=UTF-8
cacheRedirectorEnabled=true
#buildSrc.kotlin.repo=https://jcenter.bintray.com
#buildSrc.kotlin.version=1.1.50

View File

@@ -1,9 +0,0 @@
org.gradle.daemon=true
org.gradle.parallel=false
org.gradle.configureondemand=false
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m
#buildSrc.kotlin.repo=https://jcenter.bintray.com
#buildSrc.kotlin.version=1.1.50
intellijUltimateEnabled=false

View File

@@ -1,9 +0,0 @@
org.gradle.daemon=true
org.gradle.parallel=false
org.gradle.configureondemand=false
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m
#buildSrc.kotlin.repo=https://jcenter.bintray.com
#buildSrc.kotlin.version=1.1.50
intellijUltimateEnabled=false

View File

@@ -1,7 +1,6 @@
org.gradle.daemon=true
org.gradle.parallel=false
org.gradle.configureondemand=false
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m -Dfile.encoding=UTF-8
cacheRedirectorEnabled=true
#buildSrc.kotlin.repo=https://jcenter.bintray.com
#buildSrc.kotlin.version=1.1.50

View File

@@ -0,0 +1,8 @@
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m -Dfile.encoding=UTF-8
cacheRedirectorEnabled=true
#buildSrc.kotlin.repo=https://jcenter.bintray.com
#buildSrc.kotlin.version=1.1.50
intellijUltimateEnabled=false

View File

@@ -0,0 +1,8 @@
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m -Dfile.encoding=UTF-8
cacheRedirectorEnabled=true
#buildSrc.kotlin.repo=https://jcenter.bintray.com
#buildSrc.kotlin.version=1.1.50
intellijUltimateEnabled=false

View File

@@ -1,109 +0,0 @@
import org.gradle.api.publish.ivy.internal.artifact.DefaultIvyArtifact
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyConfiguration
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyPublicationIdentity
import org.gradle.api.publish.ivy.internal.publisher.IvyDescriptorFileGenerator
import java.io.File
import org.gradle.internal.os.OperatingSystem
import org.gradle.jvm.tasks.Jar
val toolsOs by lazy {
when {
OperatingSystem.current().isWindows -> "windows"
OperatingSystem.current().isMacOsX -> "macosx"
OperatingSystem.current().isLinux -> "linux"
else -> {
logger.error("Unknown operating system for android tools: ${OperatingSystem.current().name}")
""
}
}
}
val buildToolsVersion = rootProject.extra["versions.androidBuildTools"] as String
val dxSourcesVersion = rootProject.extra["versions.androidDxSources"] as String
repositories {
ivy {
artifactPattern("https://dl-ssl.google.com/android/repository/[artifact]_[revision](-[classifier]).[ext]")
artifactPattern("https://android.googlesource.com/platform/dalvik/+archive/android-$dxSourcesVersion/[artifact].[ext]")
metadataSources {
artifact()
}
}
}
val customDepsRepoDir = File(buildDir, "repo")
val customDepsOrg: String by rootProject.extra
val dxModuleName = "android-dx"
val dxRevision = buildToolsVersion
val dxRepoModuleDir = File(customDepsRepoDir, "$customDepsOrg/$dxModuleName/$dxRevision")
val buildToolsZip by configurations.creating
val dxSourcesTar by configurations.creating
dependencies {
buildToolsZip("google:build-tools:$buildToolsVersion:$toolsOs@zip")
dxSourcesTar("google:dx:0@tar.gz")
}
val unzipDxJar by tasks.creating {
dependsOn(buildToolsZip)
inputs.files(buildToolsZip)
outputs.files(File(dxRepoModuleDir, "dx.jar"))
doFirst {
project.copy {
from(zipTree(buildToolsZip.singleFile).files)
include("**/dx.jar")
into(dxRepoModuleDir)
}
}
}
val dxSourcesTargetDir = File(buildDir, "dx_src")
val untarDxSources by tasks.creating {
dependsOn(dxSourcesTar)
inputs.files(dxSourcesTar)
outputs.dir(dxSourcesTargetDir)
doFirst {
project.copy {
from(tarTree(dxSourcesTar.singleFile))
include("src/**")
includeEmptyDirs = false
into(dxSourcesTargetDir)
}
}
}
val prepareDxSourcesJar by tasks.creating(Jar::class) {
dependsOn(untarDxSources)
from("$dxSourcesTargetDir/src")
destinationDir = dxRepoModuleDir
baseName = "dx"
classifier = "sources"
}
val prepareIvyXml by tasks.creating {
dependsOn(unzipDxJar, prepareDxSourcesJar)
inputs.files(unzipDxJar, prepareDxSourcesJar)
val ivyFile = File(dxRepoModuleDir, "$dxModuleName.ivy.xml")
outputs.file(ivyFile)
doLast {
with(IvyDescriptorFileGenerator(DefaultIvyPublicationIdentity(customDepsOrg, dxModuleName, dxRevision))) {
addConfiguration(DefaultIvyConfiguration("default"))
addConfiguration(DefaultIvyConfiguration("sources"))
addArtifact(DefaultIvyArtifact(File(dxRepoModuleDir, "dx.jar"), "dx", "jar", "jar", null).also { it.conf = "default" })
addArtifact(DefaultIvyArtifact(File(dxRepoModuleDir, "dx-sources.jar"), "dx", "jar", "sources", "sources").also { it.conf = "sources" })
writeTo(ivyFile)
}
}
}
val build by tasks.creating {
dependsOn(unzipDxJar, prepareDxSourcesJar, prepareIvyXml)
}
val clean by tasks.creating(Delete::class) {
delete(dxRepoModuleDir)
delete(buildDir)
}

View File

@@ -0,0 +1,440 @@
@file:Suppress("PropertyName")
import org.gradle.api.publish.ivy.internal.artifact.FileBasedIvyArtifact
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyConfiguration
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyPublicationIdentity
import org.gradle.api.publish.ivy.internal.publisher.IvyDescriptorFileGenerator
import org.gradle.internal.os.OperatingSystem
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
val verifyDependencyOutput: Boolean by rootProject.extra
val intellijUltimateEnabled: Boolean by rootProject.extra
val intellijReleaseType: String by rootProject.extra
val intellijVersion = rootProject.extra["versions.intellijSdk"] as String
val asmVersion = rootProject.findProperty("versions.jar.asm-all") as String?
val androidStudioRelease = rootProject.findProperty("versions.androidStudioRelease") as String?
val androidStudioBuild = rootProject.findProperty("versions.androidStudioBuild") as String?
val intellijSeparateSdks: Boolean by rootProject.extra
val installIntellijCommunity = !intellijUltimateEnabled || intellijSeparateSdks
val installIntellijUltimate = intellijUltimateEnabled
val androidBuildToolsVersion = rootProject.extra["versions.androidBuildTools"] as String
val androidDxSourcesVersion = rootProject.extra["versions.androidDxSources"] as String
val intellijVersionDelimiterIndex = intellijVersion.indexOfAny(charArrayOf('.', '-'))
if (intellijVersionDelimiterIndex == -1) {
error("Invalid IDEA version $intellijVersion")
}
val platformBaseVersion = intellijVersion.substring(0, intellijVersionDelimiterIndex)
logger.info("verifyDependencyOutput: $verifyDependencyOutput")
logger.info("intellijUltimateEnabled: $intellijUltimateEnabled")
logger.info("intellijVersion: $intellijVersion")
logger.info("androidStudioRelease: $androidStudioRelease")
logger.info("androidStudioBuild: $androidStudioBuild")
logger.info("intellijSeparateSdks: $intellijSeparateSdks")
logger.info("installIntellijCommunity: $installIntellijCommunity")
logger.info("installIntellijUltimate: $installIntellijUltimate")
val androidStudioOs by lazy {
when {
OperatingSystem.current().isWindows -> "windows"
OperatingSystem.current().isMacOsX -> "mac"
OperatingSystem.current().isLinux -> "linux"
else -> {
logger.error("Unknown operating system for android tools: ${OperatingSystem.current().name}")
""
}
}
}
val androidToolsOs by lazy {
when {
OperatingSystem.current().isWindows -> "windows"
OperatingSystem.current().isMacOsX -> "macosx"
OperatingSystem.current().isLinux -> "linux"
else -> {
logger.error("Unknown operating system for android tools: ${OperatingSystem.current().name}")
""
}
}
}
repositories {
if (androidStudioRelease != null) {
ivy {
if (cacheRedirectorEnabled) {
artifactPattern("https://cache-redirector.jetbrains.com/dl.google.com/dl/android/studio/ide-zips/$androidStudioRelease/[artifact]-[revision]-$androidStudioOs.[ext]")
}
artifactPattern("https://dl.google.com/dl/android/studio/ide-zips/$androidStudioRelease/[artifact]-[revision]-$androidStudioOs.[ext]")
metadataSources {
artifact()
}
}
}
ivy {
artifactPattern("https://dl.google.com/android/repository/[artifact]_[revision](-[classifier]).[ext]")
artifactPattern("https://android.googlesource.com/platform/dalvik/+archive/android-$androidDxSourcesVersion/[artifact].[ext]")
metadataSources {
artifact()
}
}
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository/$intellijReleaseType")
maven("https://cache-redirector.jetbrains.com/plugins.jetbrains.com/maven")
maven("https://cache-redirector.jetbrains.com/jetbrains.bintray.com/intellij-third-party-dependencies/")
}
maven("https://www.jetbrains.com/intellij-repository/$intellijReleaseType")
maven("https://plugins.jetbrains.com/maven")
maven("https://jetbrains.bintray.com/intellij-third-party-dependencies/")
}
val intellij by configurations.creating
val intellijUltimate by configurations.creating
val androidStudio by configurations.creating
val sources by configurations.creating
val jpsStandalone by configurations.creating
val intellijCore by configurations.creating
val nodeJSPlugin by configurations.creating
val androidBuildTools by configurations.creating
val androidDxSources by configurations.creating
/**
* Special repository for annotations.jar required for idea runtime only.
*
* See IntellijDependenciesKt.intellijRuntimeAnnotations for more details.
*/
val intellijRuntimeAnnotations = "intellij-runtime-annotations"
val customDepsRepoDir = rootProject.rootDir.parentFile.resolve("dependencies/repo")
val customDepsOrg: String by rootProject.extra
val customDepsRevision = intellijVersion
val repoDir = File(customDepsRepoDir, customDepsOrg)
val androidDxModuleName = "android-dx"
val androidDxRevision = androidBuildToolsVersion
val androidDxRepoModuleDir = File(repoDir, "$androidDxModuleName/$androidDxRevision")
dependencies {
if (androidStudioRelease != null) {
val extension = if (androidStudioOs == "linux" && androidStudioRelease.startsWith("3.5"))
"tar.gz"
else
"zip"
androidStudio("google:android-studio-ide:$androidStudioBuild@$extension")
} else {
if (installIntellijCommunity) {
intellij("com.jetbrains.intellij.idea:ideaIC:$intellijVersion")
}
if (installIntellijUltimate) {
intellijUltimate("com.jetbrains.intellij.idea:ideaIU:$intellijVersion")
}
}
if (asmVersion != null) {
sources("org.jetbrains.intellij.deps:asm-all:$asmVersion:sources@jar")
}
sources("com.jetbrains.intellij.idea:ideaIC:$intellijVersion:sources@jar")
jpsStandalone("com.jetbrains.intellij.idea:jps-standalone:$intellijVersion")
intellijCore("com.jetbrains.intellij.idea:intellij-core:$intellijVersion")
if (intellijUltimateEnabled) {
nodeJSPlugin("com.jetbrains.plugins:NodeJS:${rootProject.extra["versions.idea.NodeJS"]}@zip")
}
androidBuildTools("google:build-tools:$androidBuildToolsVersion:$androidToolsOs@zip")
androidDxSources("google:dx:0@tar.gz")
}
val dxSourcesTargetDir = File(buildDir, "dx_src")
val untarDxSources by tasks.creating {
dependsOn(androidDxSources)
inputs.files(androidDxSources)
outputs.dir(dxSourcesTargetDir)
doFirst {
project.copy {
from(tarTree(androidDxSources.singleFile))
include("src/**")
includeEmptyDirs = false
into(dxSourcesTargetDir)
}
}
}
val prepareDxSourcesJar by tasks.creating(Jar::class) {
dependsOn(untarDxSources)
from("$dxSourcesTargetDir/src")
destinationDir = File(repoDir, sources.name)
baseName = androidDxModuleName
classifier = "sources"
version = androidBuildToolsVersion
}
val unzipDxJar by tasks.creating {
dependsOn(androidBuildTools)
inputs.files(androidBuildTools)
outputs.files(File(androidDxRepoModuleDir, "dx.jar"))
doFirst {
project.copy {
from(zipTree(androidBuildTools.singleFile).files)
include("**/dx.jar")
into(androidDxRepoModuleDir)
}
}
}
val buildIvyRepoForAndroidDx by tasks.creating {
dependsOn(unzipDxJar, prepareDxSourcesJar)
inputs.files(unzipDxJar, prepareDxSourcesJar)
outputs.file(File(androidDxRepoModuleDir, "$androidDxModuleName.ivy.xml"))
doLast {
writeIvyXml(
customDepsOrg,
androidDxModuleName,
androidBuildToolsVersion,
androidDxModuleName,
androidDxRepoModuleDir,
androidDxRepoModuleDir,
androidDxRepoModuleDir,
prepareDxSourcesJar.outputs.files.singleFile
)
}
}
val makeIntellijCore = buildIvyRepositoryTask(intellijCore, customDepsOrg, customDepsRepoDir)
val makeIntellijAnnotations by tasks.creating(Copy::class.java) {
dependsOn(makeIntellijCore)
from(repoDir.resolve("intellij-core/$intellijVersion/artifacts/annotations.jar"))
val targetDir = File(repoDir, "$intellijRuntimeAnnotations/$intellijVersion")
into(targetDir)
val ivyFile = File(targetDir, "$intellijRuntimeAnnotations.ivy.xml")
outputs.files(ivyFile)
doLast {
writeIvyXml(
customDepsOrg,
intellijRuntimeAnnotations,
intellijVersion,
intellijRuntimeAnnotations,
targetDir,
targetDir,
targetDir,
allowAnnotations = true
)
}
}
val mergeSources by tasks.creating(Jar::class.java) {
dependsOn(sources)
from(provider { sources.map(::zipTree) })
destinationDir = File(repoDir, sources.name)
baseName = "intellij"
classifier = "sources"
version = intellijVersion
}
val sourcesFile = mergeSources.outputs.files.singleFile
val makeIde = if (androidStudioBuild != null) {
buildIvyRepositoryTask(
androidStudio,
customDepsOrg,
customDepsRepoDir,
if (androidStudioOs == "mac")
::skipContentsDirectory
else
::skipToplevelDirectory
)
} else {
val task = if (installIntellijUltimate) {
buildIvyRepositoryTask(intellijUltimate, customDepsOrg, customDepsRepoDir, null, sourcesFile)
} else {
buildIvyRepositoryTask(intellij, customDepsOrg, customDepsRepoDir, null, sourcesFile)
}
task.configure {
dependsOn(mergeSources)
}
task
}
val build by tasks.creating {
dependsOn(
makeIntellijCore,
makeIde,
buildIvyRepositoryTask(jpsStandalone, customDepsOrg, customDepsRepoDir, null, sourcesFile),
makeIntellijAnnotations,
buildIvyRepoForAndroidDx
)
if (installIntellijUltimate) {
dependsOn(
buildIvyRepositoryTask(nodeJSPlugin, customDepsOrg, customDepsRepoDir, ::skipToplevelDirectory, sourcesFile)
)
}
}
// Task to delete legacy repo locations
tasks.create("cleanLegacy", Delete::class.java) {
delete("$projectDir/android-dx")
delete("$projectDir/intellij-sdk")
}
tasks.create("clean", Delete::class.java) {
delete(customDepsRepoDir)
}
fun buildIvyRepositoryTask(
configuration: Configuration,
organization: String,
repoDirectory: File,
pathRemap: ((String) -> String)? = null,
sources: File? = null
) = tasks.register("buildIvyRepositoryFor${configuration.name.capitalize()}") {
fun ResolvedArtifact.moduleDirectory(): File =
File(repoDirectory, "$organization/${moduleVersion.id.name}/${moduleVersion.id.version}")
dependsOn(configuration)
inputs.files(configuration)
if (verifyDependencyOutput) {
outputs.dir(provider {
configuration.resolvedConfiguration.resolvedArtifacts.single().moduleDirectory()
})
} else {
outputs.upToDateWhen {
configuration.resolvedConfiguration.resolvedArtifacts.single()
.moduleDirectory()
.exists()
}
}
doFirst {
configuration.resolvedConfiguration.resolvedArtifacts.single().run {
val moduleDirectory = moduleDirectory()
val artifactsDirectory = File(moduleDirectory(), "artifacts")
logger.info("Unpacking ${file.name} into ${artifactsDirectory.absolutePath}")
copy {
val fileTree = when (extension) {
"tar.gz" -> tarTree(file)
"zip" -> zipTree(file)
else -> error("Unsupported artifact extension: $extension")
}
from(fileTree.matching {
exclude("**/plugins/Kotlin/**")
})
into(artifactsDirectory)
if (pathRemap != null) {
eachFile {
path = pathRemap(path)
}
}
includeEmptyDirs = false
}
writeIvyXml(
organization,
moduleVersion.id.name,
moduleVersion.id.version,
moduleVersion.id.name,
File(artifactsDirectory, "lib"),
File(artifactsDirectory, "lib"),
File(moduleDirectory, "ivy"),
*listOfNotNull(sources).toTypedArray()
)
val pluginsDirectory = File(artifactsDirectory, "plugins")
if (pluginsDirectory.exists()) {
file(File(artifactsDirectory, "plugins"))
.listFiles { file: File -> file.isDirectory }
.forEach {
writeIvyXml(
organization,
it.name,
moduleVersion.id.version,
it.name,
File(it, "lib"),
File(it, "lib"),
File(moduleDirectory, "ivy"),
*listOfNotNull(sources).toTypedArray()
)
}
}
}
}
}
fun writeIvyXml(
organization: String,
moduleName: String,
version: String,
fileName: String,
baseDir: File,
artifactDir: File,
targetDir: File,
vararg sourcesJar: File,
allowAnnotations: Boolean = false
) {
fun shouldIncludeIntellijJar(jar: File) =
jar.isFile
&& jar.extension == "jar"
&& !jar.name.startsWith("kotlin-")
&& (allowAnnotations || jar.name != "annotations.jar") // see comments for [intellijAnnotations] above
with(IvyDescriptorFileGenerator(DefaultIvyPublicationIdentity(organization, moduleName, version))) {
addConfiguration(DefaultIvyConfiguration("default"))
addConfiguration(DefaultIvyConfiguration("sources"))
artifactDir.listFiles()?.forEach { jarFile ->
if (shouldIncludeIntellijJar(jarFile)) {
val relativeName = jarFile.toRelativeString(baseDir).removeSuffix(".jar")
addArtifact(
FileBasedIvyArtifact(
jarFile,
DefaultIvyPublicationIdentity(organization, relativeName, version)
).also {
it.conf = "default"
}
)
}
}
sourcesJar.forEach {
val sourcesArtifactName = it.name.substringBeforeLast("-").substringBeforeLast("-")
addArtifact(
FileBasedIvyArtifact(
it,
DefaultIvyPublicationIdentity(organization, sourcesArtifactName, version)
).also { artifact ->
artifact.conf = "sources"
artifact.classifier = "sources"
}
)
}
writeTo(File(targetDir, "$fileName.ivy.xml"))
}
}
fun skipToplevelDirectory(path: String) = path.substringAfter('/')
fun skipContentsDirectory(path: String) = path.substringAfter("Contents/")

View File

@@ -1,267 +0,0 @@
@file:Suppress("PropertyName")
import org.gradle.api.publish.ivy.internal.artifact.DefaultIvyArtifact
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyConfiguration
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyPublicationIdentity
import org.gradle.api.publish.ivy.internal.publisher.IvyDescriptorFileGenerator
import java.io.File
import org.gradle.internal.os.OperatingSystem
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
buildscript {
repositories {
jcenter()
}
dependencies {
classpath("com.github.jengelman.gradle.plugins:shadow:${property("versions.shadow")}")
}
}
val intellijUltimateEnabled: Boolean by rootProject.extra
val intellijRepo: String by rootProject.extra
val intellijReleaseType: String by rootProject.extra
val intellijVersion = rootProject.extra["versions.intellijSdk"] as String
val androidStudioRelease = rootProject.findProperty("versions.androidStudioRelease") as String?
val androidStudioBuild = rootProject.findProperty("versions.androidStudioBuild") as String?
val intellijSeparateSdks: Boolean by rootProject.extra
val installIntellijCommunity = !intellijUltimateEnabled || intellijSeparateSdks
val installIntellijUltimate = intellijUltimateEnabled
val intellijVersionDelimiterIndex = intellijVersion.indexOfAny(charArrayOf('.', '-'))
if (intellijVersionDelimiterIndex == -1) {
error("Invalid IDEA version $intellijVersion")
}
val platformBaseVersion = intellijVersion.substring(0, intellijVersionDelimiterIndex)
logger.info("intellijUltimateEnabled: $intellijUltimateEnabled")
logger.info("intellijVersion: $intellijVersion")
logger.info("androidStudioRelease: $androidStudioRelease")
logger.info("androidStudioBuild: $androidStudioBuild")
logger.info("intellijSeparateSdks: $intellijSeparateSdks")
logger.info("installIntellijCommunity: $installIntellijCommunity")
logger.info("installIntellijUltimate: $installIntellijUltimate")
val studioOs by lazy {
when {
OperatingSystem.current().isWindows -> "windows"
OperatingSystem.current().isMacOsX -> "mac"
OperatingSystem.current().isLinux -> "linux"
else -> {
logger.error("Unknown operating system for android tools: ${OperatingSystem.current().name}")
""
}
}
}
repositories {
if (androidStudioRelease != null) {
ivy {
artifactPattern("https://dl.google.com/dl/android/studio/ide-zips/$androidStudioRelease/[artifact]-[revision]-$studioOs.zip")
metadataSources {
artifact()
}
}
}
maven { setUrl("$intellijRepo/$intellijReleaseType") }
maven { setUrl("https://plugins.jetbrains.com/maven") }
}
val intellij by configurations.creating
val intellijUltimate by configurations.creating
val sources by configurations.creating
val `jps-standalone` by configurations.creating
val `jps-build-test` by configurations.creating
val `intellij-core` by configurations.creating
val `plugins-NodeJS` by configurations.creating
val customDepsRepoDir = File(buildDir, "repo")
val customDepsOrg: String by rootProject.extra
val customDepsRevision = intellijVersion
val customDepsRepoModulesDir = File(customDepsRepoDir, "$customDepsOrg/$customDepsRevision")
val repoDir = customDepsRepoModulesDir
dependencies {
if (androidStudioRelease != null) {
intellij("google:android-studio-ide:$androidStudioBuild")
} else {
if (installIntellijCommunity) {
intellij("com.jetbrains.intellij.idea:ideaIC:$intellijVersion")
}
if (installIntellijUltimate) {
intellijUltimate("com.jetbrains.intellij.idea:ideaIU:$intellijVersion")
}
}
sources("com.jetbrains.intellij.idea:ideaIC:$intellijVersion:sources@jar")
`jps-standalone`("com.jetbrains.intellij.idea:jps-standalone:$intellijVersion")
`jps-build-test`("com.jetbrains.intellij.idea:jps-build-test:$intellijVersion")
`intellij-core`("com.jetbrains.intellij.idea:intellij-core:$intellijVersion")
if (intellijUltimateEnabled) {
`plugins-NodeJS`("com.jetbrains.plugins:NodeJS:${rootProject.extra["versions.idea.NodeJS"]}@zip")
}
}
fun Task.configureExtractFromConfigurationTask(sourceConfig: Configuration,
pathRemap: (String) -> String = { it },
extractor: (Configuration) -> Any) {
dependsOn(sourceConfig)
inputs.files(sourceConfig)
val targetDir = File(repoDir, sourceConfig.name)
outputs.dirs(targetDir)
doFirst {
project.copy {
from(extractor(sourceConfig))
into(targetDir)
eachFile {
path = pathRemap(path)
}
}
}
}
fun removePathPrefix(path: String): String {
if (androidStudioRelease == null) return path
val slashes = if (studioOs == "mac") 2 else 1
var result = path
repeat(slashes) {
result = result.substringAfter('/')
}
return result
}
val unzipIntellijSdk by tasks.creating {
configureExtractFromConfigurationTask(intellij, pathRemap = { removePathPrefix(it) }) {
zipTree(it.singleFile).matching {
exclude("**/plugins/Kotlin/**")
}
}
}
val unzipIntellijUltimateSdk by tasks.creating {
configureExtractFromConfigurationTask(intellijUltimate) {
zipTree(it.singleFile).matching {
exclude("plugins/Kotlin/**")
}
}
}
val unzipIntellijCore by tasks.creating { configureExtractFromConfigurationTask(`intellij-core`) { zipTree(it.singleFile) } }
val unzipJpsStandalone by tasks.creating { configureExtractFromConfigurationTask(`jps-standalone`) { zipTree(it.singleFile) } }
val copyIntellijSdkSources by tasks.creating(ShadowJar::class.java) {
from(sources)
baseName = "ideaIC"
version = intellijVersion
classifier = "sources"
destinationDir = File(repoDir, sources.name)
}
val copyJpsBuildTest by tasks.creating { configureExtractFromConfigurationTask(`jps-build-test`) { it.singleFile } }
val unzipNodeJSPlugin by tasks.creating { configureExtractFromConfigurationTask(`plugins-NodeJS`) { zipTree(it.singleFile) } }
fun writeIvyXml(moduleName: String, fileName: String, jarFiles: FileCollection, baseDir: File, sourcesJar: File?) {
with(IvyDescriptorFileGenerator(DefaultIvyPublicationIdentity(customDepsOrg, moduleName, intellijVersion))) {
addConfiguration(DefaultIvyConfiguration("default"))
addConfiguration(DefaultIvyConfiguration("sources"))
jarFiles.asFileTree.files.forEach {
if (it.isFile && it.extension == "jar") {
val relativeName = it.toRelativeString(baseDir).removeSuffix(".jar")
addArtifact(DefaultIvyArtifact(it, relativeName, "jar", "jar", null).also { it.conf = "default" })
}
}
if (sourcesJar != null) {
val sourcesArtifactName = sourcesJar.name.removeSuffix(".jar").substringBefore("-")
addArtifact(DefaultIvyArtifact(sourcesJar, sourcesArtifactName, "jar", "sources", "sources").also { it.conf = "sources" })
}
writeTo(File(customDepsRepoModulesDir, "$fileName.ivy.xml"))
}
}
val prepareIvyXmls by tasks.creating {
dependsOn(unzipIntellijCore, unzipJpsStandalone, copyIntellijSdkSources, copyJpsBuildTest)
val intellijSdkDir = File(repoDir, intellij.name)
val intellijUltimateSdkDir = File(repoDir, intellijUltimate.name)
if (installIntellijCommunity) {
dependsOn(unzipIntellijSdk)
inputs.dir(intellijSdkDir)
outputs.file(File(repoDir, "${intellij.name}.ivy.xml"))
}
if (installIntellijUltimate) {
dependsOn(unzipIntellijUltimateSdk)
inputs.dir(intellijUltimateSdkDir)
outputs.file(File(repoDir, "${intellijUltimate.name}.ivy.xml"))
}
val flatDeps = listOf(`intellij-core`, `jps-standalone`, `jps-build-test`)
flatDeps.forEach {
inputs.dir(File(repoDir, it.name))
outputs.file(File(repoDir, "${it.name}.ivy.xml"))
}
inputs.dir(File(repoDir, sources.name))
if (intellijUltimateEnabled) {
dependsOn(unzipNodeJSPlugin)
inputs.dir(File(repoDir, `plugins-NodeJS`.name))
outputs.file(File(repoDir, "${`plugins-NodeJS`.name}.ivy.xml"))
}
doFirst {
val sourcesFile = if (sources.isEmpty) null else File(repoDir, "${sources.name}/${sources.singleFile.name}")
if (installIntellijCommunity) {
val libDir = File(intellijSdkDir, "lib")
writeIvyXml(intellij.name,
intellij.name,
fileTree(libDir).filter {
it.parentFile == libDir && !it.name.startsWith("kotlin-")
},
libDir,
sourcesFile)
File(intellijSdkDir, "plugins").listFiles { it: File -> it.isDirectory }.forEach {
writeIvyXml(it.name, "intellij.plugin.${it.name}", files("$it/lib/"), File(it, "lib"), sourcesFile)
}
}
if (installIntellijUltimate) {
val libDir = File(intellijUltimateSdkDir, "lib")
writeIvyXml(intellij.name, // important! the module name should be "intellij"
intellijUltimate.name,
fileTree(libDir).filter {
it.parentFile == libDir && !it.name.startsWith("kotlin-")
},
libDir,
sourcesFile)
File(intellijUltimateSdkDir, "plugins").listFiles { it: File -> it.isDirectory }.forEach {
writeIvyXml(it.name, "intellijUltimate.plugin.${it.name}", files("$it/lib/"), File(it, "lib"), sourcesFile)
}
}
flatDeps.forEach {
writeIvyXml(it.name, it.name, files("$repoDir/${it.name}"), File(repoDir, it.name), sourcesFile)
}
if (intellijUltimateEnabled) {
val nodeJsBaseDir = "${`plugins-NodeJS`.name}/NodeJS/lib"
writeIvyXml("NodeJS", `plugins-NodeJS`.name, files("$repoDir/$nodeJsBaseDir"), File(repoDir, nodeJsBaseDir), sourcesFile)
}
}
}
val build by tasks.creating {
dependsOn(prepareIvyXmls)
}
val clean by tasks.creating(Delete::class) {
delete(customDepsRepoModulesDir)
delete(buildDir)
}

View File

@@ -1,267 +0,0 @@
@file:Suppress("PropertyName")
import org.gradle.api.publish.ivy.internal.artifact.DefaultIvyArtifact
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyConfiguration
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyPublicationIdentity
import org.gradle.api.publish.ivy.internal.publisher.IvyDescriptorFileGenerator
import java.io.File
import org.gradle.internal.os.OperatingSystem
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
buildscript {
repositories {
jcenter()
}
dependencies {
classpath("com.github.jengelman.gradle.plugins:shadow:${property("versions.shadow")}")
}
}
val intellijUltimateEnabled: Boolean by rootProject.extra
val intellijRepo: String by rootProject.extra
val intellijReleaseType: String by rootProject.extra
val intellijVersion = rootProject.extra["versions.intellijSdk"] as String
val androidStudioRelease = rootProject.findProperty("versions.androidStudioRelease") as String?
val androidStudioBuild = rootProject.findProperty("versions.androidStudioBuild") as String?
val intellijSeparateSdks: Boolean by rootProject.extra
val installIntellijCommunity = !intellijUltimateEnabled || intellijSeparateSdks
val installIntellijUltimate = intellijUltimateEnabled
val intellijVersionDelimiterIndex = intellijVersion.indexOfAny(charArrayOf('.', '-'))
if (intellijVersionDelimiterIndex == -1) {
error("Invalid IDEA version $intellijVersion")
}
val platformBaseVersion = intellijVersion.substring(0, intellijVersionDelimiterIndex)
logger.info("intellijUltimateEnabled: $intellijUltimateEnabled")
logger.info("intellijVersion: $intellijVersion")
logger.info("androidStudioRelease: $androidStudioRelease")
logger.info("androidStudioBuild: $androidStudioBuild")
logger.info("intellijSeparateSdks: $intellijSeparateSdks")
logger.info("installIntellijCommunity: $installIntellijCommunity")
logger.info("installIntellijUltimate: $installIntellijUltimate")
val studioOs by lazy {
when {
OperatingSystem.current().isWindows -> "windows"
OperatingSystem.current().isMacOsX -> "mac"
OperatingSystem.current().isLinux -> "linux"
else -> {
logger.error("Unknown operating system for android tools: ${OperatingSystem.current().name}")
""
}
}
}
repositories {
if (androidStudioRelease != null) {
ivy {
artifactPattern("https://dl.google.com/dl/android/studio/ide-zips/$androidStudioRelease/[artifact]-[revision]-$studioOs.zip")
metadataSources {
artifact()
}
}
}
maven { setUrl("$intellijRepo/$intellijReleaseType") }
maven { setUrl("https://plugins.jetbrains.com/maven") }
}
val intellij by configurations.creating
val intellijUltimate by configurations.creating
val sources by configurations.creating
val `jps-standalone` by configurations.creating
val `jps-build-test` by configurations.creating
val `intellij-core` by configurations.creating
val `plugins-NodeJS` by configurations.creating
val customDepsRepoDir = File(buildDir, "repo")
val customDepsOrg: String by rootProject.extra
val customDepsRevision = intellijVersion
val customDepsRepoModulesDir = File(customDepsRepoDir, "$customDepsOrg/$customDepsRevision")
val repoDir = customDepsRepoModulesDir
dependencies {
if (androidStudioRelease != null) {
intellij("google:android-studio-ide:$androidStudioBuild")
} else {
if (installIntellijCommunity) {
intellij("com.jetbrains.intellij.idea:ideaIC:$intellijVersion")
}
if (installIntellijUltimate) {
intellijUltimate("com.jetbrains.intellij.idea:ideaIU:$intellijVersion")
}
}
sources("com.jetbrains.intellij.idea:ideaIC:$intellijVersion:sources@jar")
`jps-standalone`("com.jetbrains.intellij.idea:jps-standalone:$intellijVersion")
`jps-build-test`("com.jetbrains.intellij.idea:jps-build-test:$intellijVersion")
`intellij-core`("com.jetbrains.intellij.idea:intellij-core:$intellijVersion")
if (intellijUltimateEnabled) {
`plugins-NodeJS`("com.jetbrains.plugins:NodeJS:${rootProject.extra["versions.idea.NodeJS"]}@zip")
}
}
fun Task.configureExtractFromConfigurationTask(sourceConfig: Configuration,
pathRemap: (String) -> String = { it },
extractor: (Configuration) -> Any) {
dependsOn(sourceConfig)
inputs.files(sourceConfig)
val targetDir = File(repoDir, sourceConfig.name)
outputs.dirs(targetDir)
doFirst {
project.copy {
from(extractor(sourceConfig))
into(targetDir)
eachFile {
path = pathRemap(path)
}
}
}
}
fun removePathPrefix(path: String): String {
if (androidStudioRelease == null) return path
val slashes = if (studioOs == "mac") 2 else 1
var result = path
repeat(slashes) {
result = result.substringAfter('/')
}
return result
}
val unzipIntellijSdk by tasks.creating {
configureExtractFromConfigurationTask(intellij, pathRemap = { removePathPrefix(it) }) {
zipTree(it.singleFile).matching {
exclude("**/plugins/Kotlin/**")
}
}
}
val unzipIntellijUltimateSdk by tasks.creating {
configureExtractFromConfigurationTask(intellijUltimate) {
zipTree(it.singleFile).matching {
exclude("plugins/Kotlin/**")
}
}
}
val unzipIntellijCore by tasks.creating { configureExtractFromConfigurationTask(`intellij-core`) { zipTree(it.singleFile) } }
val unzipJpsStandalone by tasks.creating { configureExtractFromConfigurationTask(`jps-standalone`) { zipTree(it.singleFile) } }
val copyIntellijSdkSources by tasks.creating(ShadowJar::class.java) {
from(sources)
baseName = "ideaIC"
version = intellijVersion
classifier = "sources"
destinationDir = File(repoDir, sources.name)
}
val copyJpsBuildTest by tasks.creating { configureExtractFromConfigurationTask(`jps-build-test`) { it.singleFile } }
val unzipNodeJSPlugin by tasks.creating { configureExtractFromConfigurationTask(`plugins-NodeJS`) { zipTree(it.singleFile) } }
fun writeIvyXml(moduleName: String, fileName: String, jarFiles: FileCollection, baseDir: File, sourcesJar: File?) {
with(IvyDescriptorFileGenerator(DefaultIvyPublicationIdentity(customDepsOrg, moduleName, intellijVersion))) {
addConfiguration(DefaultIvyConfiguration("default"))
addConfiguration(DefaultIvyConfiguration("sources"))
jarFiles.asFileTree.files.forEach {
if (it.isFile && it.extension == "jar") {
val relativeName = it.toRelativeString(baseDir).removeSuffix(".jar")
addArtifact(DefaultIvyArtifact(it, relativeName, "jar", "jar", null).also { it.conf = "default" })
}
}
if (sourcesJar != null) {
val sourcesArtifactName = sourcesJar.name.removeSuffix(".jar").substringBefore("-")
addArtifact(DefaultIvyArtifact(sourcesJar, sourcesArtifactName, "jar", "sources", "sources").also { it.conf = "sources" })
}
writeTo(File(customDepsRepoModulesDir, "$fileName.ivy.xml"))
}
}
val prepareIvyXmls by tasks.creating {
dependsOn(unzipIntellijCore, unzipJpsStandalone, copyIntellijSdkSources, copyJpsBuildTest)
val intellijSdkDir = File(repoDir, intellij.name)
val intellijUltimateSdkDir = File(repoDir, intellijUltimate.name)
if (installIntellijCommunity) {
dependsOn(unzipIntellijSdk)
inputs.dir(intellijSdkDir)
outputs.file(File(repoDir, "${intellij.name}.ivy.xml"))
}
if (installIntellijUltimate) {
dependsOn(unzipIntellijUltimateSdk)
inputs.dir(intellijUltimateSdkDir)
outputs.file(File(repoDir, "${intellijUltimate.name}.ivy.xml"))
}
val flatDeps = listOf(`intellij-core`, `jps-standalone`, `jps-build-test`)
flatDeps.forEach {
inputs.dir(File(repoDir, it.name))
outputs.file(File(repoDir, "${it.name}.ivy.xml"))
}
inputs.dir(File(repoDir, sources.name))
if (intellijUltimateEnabled) {
dependsOn(unzipNodeJSPlugin)
inputs.dir(File(repoDir, `plugins-NodeJS`.name))
outputs.file(File(repoDir, "${`plugins-NodeJS`.name}.ivy.xml"))
}
doFirst {
val sourcesFile = if (sources.isEmpty) null else File(repoDir, "${sources.name}/${sources.singleFile.name}")
if (installIntellijCommunity) {
val libDir = File(intellijSdkDir, "lib")
writeIvyXml(intellij.name,
intellij.name,
fileTree(libDir).filter {
it.parentFile == libDir && !it.name.startsWith("kotlin-")
},
libDir,
sourcesFile)
File(intellijSdkDir, "plugins").listFiles { it: File -> it.isDirectory }.forEach {
writeIvyXml(it.name, "intellij.plugin.${it.name}", files("$it/lib/"), File(it, "lib"), sourcesFile)
}
}
if (installIntellijUltimate) {
val libDir = File(intellijUltimateSdkDir, "lib")
writeIvyXml(intellij.name, // important! the module name should be "intellij"
intellijUltimate.name,
fileTree(libDir).filter {
it.parentFile == libDir && !it.name.startsWith("kotlin-")
},
libDir,
sourcesFile)
File(intellijUltimateSdkDir, "plugins").listFiles { it: File -> it.isDirectory }.forEach {
writeIvyXml(it.name, "intellijUltimate.plugin.${it.name}", files("$it/lib/"), File(it, "lib"), sourcesFile)
}
}
flatDeps.forEach {
writeIvyXml(it.name, it.name, files("$repoDir/${it.name}"), File(repoDir, it.name), sourcesFile)
}
if (intellijUltimateEnabled) {
val nodeJsBaseDir = "${`plugins-NodeJS`.name}/NodeJS/lib"
writeIvyXml("NodeJS", `plugins-NodeJS`.name, files("$repoDir/$nodeJsBaseDir"), File(repoDir, nodeJsBaseDir), sourcesFile)
}
}
}
val build by tasks.creating {
dependsOn(prepareIvyXmls)
}
val clean by tasks.creating(Delete::class) {
delete(customDepsRepoModulesDir)
delete(buildDir)
}

View File

@@ -1,3 +1,14 @@
include "prepare-deps:android-dx",
"prepare-deps:intellij-sdk"
pluginManagement {
repositories {
if (cacheRedirectorEnabled == 'true') {
maven {
url "https://cache-redirector.jetbrains.com/plugins.gradle.org/m2"
}
}
gradlePluginPortal()
}
}
include "prepare-deps"

View File

@@ -1,15 +0,0 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
import org.gradle.api.Project
import org.gradle.api.artifacts.dsl.RepositoryHandler
import org.gradle.api.artifacts.repositories.IvyArtifactRepository
import org.gradle.kotlin.dsl.extra
import java.io.File
fun RepositoryHandler.androidDxJarRepo(project: Project): IvyArtifactRepository = ivy {
val baseDir = File("${project.rootDir}/buildSrc/prepare-deps/android-dx/build/repo")
ivyPattern("${baseDir.canonicalPath}/[organisation]/[module]/[revision]/[module].ivy.xml")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[module]/[revision]/[artifact](-[classifier]).jar")
}
fun Project.androidDxJar() = "kotlin.build.custom.deps:android-dx:${rootProject.extra["versions.androidBuildTools"]}"

View File

@@ -0,0 +1,97 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
import org.gradle.api.Project
interface CompatibilityPredicate {
fun matches(ide: Ide): Boolean
operator fun invoke(): Boolean = matches(IdeVersionConfigurator.currentIde)
operator fun invoke(block: () -> Unit): Unit {
if (matches(IdeVersionConfigurator.currentIde)) {
block()
}
}
}
val CompatibilityPredicate.not: CompatibilityPredicate get() = object : CompatibilityPredicate {
override fun matches(ide: Ide) = !this@not.matches(ide)
}
fun CompatibilityPredicate.or(other: CompatibilityPredicate): CompatibilityPredicate = object : CompatibilityPredicate {
override fun matches(ide: Ide) = this@or.matches(ide) || other.matches(ide)
}
enum class Platform : CompatibilityPredicate {
P181, P182, P183, P191;
val version: Int = name.drop(1).toInt()
override fun matches(ide: Ide) = ide.platform == this
companion object {
operator fun get(version: Int): Platform {
return Platform.values().firstOrNull { it.version == version }
?: error("Can't find platform $version")
}
}
}
enum class Ide(val platform: Platform) : CompatibilityPredicate {
IJ181(Platform.P181),
IJ182(Platform.P182),
IJ183(Platform.P183),
IJ191(Platform.P191),
AS32(Platform.P181),
AS33(Platform.P182),
AS34(Platform.P183),
AS35(Platform.P183);
val kind = Kind.values().first { it.shortName == name.take(2) }
val version = name.dropWhile { !it.isDigit() }.toInt()
override fun matches(ide: Ide) = ide == this
enum class Kind(val shortName: String) {
AndroidStudio("AS"), IntelliJ("IJ")
}
companion object {
val IJ: CompatibilityPredicate = IdeKindPredicate(Kind.IntelliJ)
val AS: CompatibilityPredicate = IdeKindPredicate(Kind.AndroidStudio)
}
}
val Platform.orHigher get() = object : CompatibilityPredicate {
override fun matches(ide: Ide) = ide.platform.version >= version
}
val Platform.orLower get() = object : CompatibilityPredicate {
override fun matches(ide: Ide) = ide.platform.version <= version
}
val Ide.orHigher get() = object : CompatibilityPredicate {
override fun matches(ide: Ide) = ide.kind == kind && ide.version >= version
}
val Ide.orLower get() = object : CompatibilityPredicate {
override fun matches(ide: Ide) = ide.kind == kind && ide.version <= version
}
object IdeVersionConfigurator {
lateinit var currentIde: Ide
fun setCurrentIde(project: Project) {
val platformVersion = project.rootProject.extensions.extraProperties["versions.platform"].toString()
val ideName = if (platformVersion.startsWith("AS")) platformVersion else "IJ$platformVersion"
currentIde = Ide.valueOf(ideName)
}
}
private class IdeKindPredicate(val kind: Ide.Kind) : CompatibilityPredicate {
override fun matches(ide: Ide) = ide.kind == kind
}

View File

@@ -0,0 +1,98 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
import org.gradle.api.Project
interface CompatibilityPredicate {
fun matches(ide: Ide): Boolean
operator fun invoke(): Boolean = matches(IdeVersionConfigurator.currentIde)
operator fun invoke(block: () -> Unit): Unit {
if (matches(IdeVersionConfigurator.currentIde)) {
block()
}
}
}
val CompatibilityPredicate.not: CompatibilityPredicate get() = object : CompatibilityPredicate {
override fun matches(ide: Ide) = !this@not.matches(ide)
}
fun CompatibilityPredicate.or(other: CompatibilityPredicate): CompatibilityPredicate = object : CompatibilityPredicate {
override fun matches(ide: Ide) = this@or.matches(ide) || other.matches(ide)
}
enum class Platform : CompatibilityPredicate {
P181, P182, P183, P191, P192;
val version: Int = name.drop(1).toInt()
override fun matches(ide: Ide) = ide.platform == this
companion object {
operator fun get(version: Int): Platform {
return Platform.values().firstOrNull { it.version == version }
?: error("Can't find platform $version")
}
}
}
enum class Ide(val platform: Platform) : CompatibilityPredicate {
IJ181(Platform.P181),
IJ182(Platform.P182),
IJ183(Platform.P183),
IJ191(Platform.P191),
IJ192(Platform.P192),
AS32(Platform.P181),
AS33(Platform.P182),
AS34(Platform.P183),
AS35(Platform.P183);
val kind = Kind.values().first { it.shortName == name.take(2) }
val version = name.dropWhile { !it.isDigit() }.toInt()
override fun matches(ide: Ide) = ide == this
enum class Kind(val shortName: String) {
AndroidStudio("AS"), IntelliJ("IJ")
}
companion object {
val IJ: CompatibilityPredicate = IdeKindPredicate(Kind.IntelliJ)
val AS: CompatibilityPredicate = IdeKindPredicate(Kind.AndroidStudio)
}
}
val Platform.orHigher get() = object : CompatibilityPredicate {
override fun matches(ide: Ide) = ide.platform.version >= version
}
val Platform.orLower get() = object : CompatibilityPredicate {
override fun matches(ide: Ide) = ide.platform.version <= version
}
val Ide.orHigher get() = object : CompatibilityPredicate {
override fun matches(ide: Ide) = ide.kind == kind && ide.version >= version
}
val Ide.orLower get() = object : CompatibilityPredicate {
override fun matches(ide: Ide) = ide.kind == kind && ide.version <= version
}
object IdeVersionConfigurator {
lateinit var currentIde: Ide
fun setCurrentIde(project: Project) {
val platformVersion = project.rootProject.extensions.extraProperties["versions.platform"].toString()
val ideName = if (platformVersion.startsWith("AS")) platformVersion else "IJ$platformVersion"
currentIde = Ide.valueOf(ideName)
}
}
private class IdeKindPredicate(val kind: Ide.Kind) : CompatibilityPredicate {
override fun matches(ide: Ide) = ide.kind == kind
}

View File

@@ -0,0 +1,19 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
import org.gradle.api.tasks.JavaExec
/**
* Workaround for IDEA-200192:
* IDEA makes all JavaExec tasks not up-to-date and attaches debugger making our breakpoints trigger during irrelevant task execution
*/
open class NoDebugJavaExec : JavaExec() {
private fun String.isDebuggerArgument(): Boolean =
startsWith("-agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=")
override fun setJvmArgs(arguments: MutableList<String>?) {
super.setJvmArgs(arguments?.filterNot { it.isDebuggerArgument() })
}
}

View File

@@ -4,17 +4,22 @@ import org.gradle.jvm.tasks.Jar
import org.gradle.kotlin.dsl.task
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
fun Project.smartJavaExec(configure: JavaExec.() -> Unit) = task<JavaExec> javaExec@{
fun Project.smartJavaExec(configure: JavaExec.() -> Unit) = task<JavaExec> {
configure()
passClasspathInJar()
}
// Moves the classpath into a jar metadata, to shorten the command line length and to avoid hitting the limit on Windows
fun JavaExec.passClasspathInJar() {
val jarTask = project.task("${name}WriteClassPath", Jar::class) {
val classpath = classpath
val main = main
dependsOn(classpath)
inputs.files(classpath)
inputs.property("main", main)
doFirst {
val classPathString = classpath.joinToString(" ") { project.file(it).toURI().toString() }
@@ -27,21 +32,16 @@ fun Project.smartJavaExec(configure: JavaExec.() -> Unit) = task<JavaExec> javaE
)
}
}
archiveName = "$main.${this@javaExec.name}.classpath.container.$extension"
archiveName = "$main.${this@passClasspathInJar.name}.classpath.container.$extension"
destinationDir = temporaryDir
}
dependsOn(jarTask)
doFirst {
main = "-jar"
classpath = project.files()
val copyArgs = args.orEmpty().toList()
args(jarTask.outputs.files.singleFile)
args(copyArgs)
args = listOf(jarTask.outputs.files.singleFile.path) + args.orEmpty()
}
}

View File

@@ -1,40 +1,23 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
import org.gradle.api.*
import org.gradle.api.artifacts.*
import org.gradle.api.tasks.*
import org.gradle.kotlin.dsl.*
import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.UnknownDomainObjectException
import org.gradle.api.artifacts.ConfigurablePublishArtifact
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.ConfigurationContainer
import org.gradle.api.file.DuplicatesStrategy
import org.gradle.api.file.FileCollection
import org.gradle.api.internal.artifacts.publish.ArchivePublishArtifact
import org.gradle.api.plugins.BasePluginConvention
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.AbstractCopyTask
import org.gradle.api.tasks.Copy
import org.gradle.api.tasks.Upload
import org.gradle.api.tasks.javadoc.Javadoc
import org.gradle.jvm.tasks.Jar
import org.gradle.kotlin.dsl.*
import java.io.File
// can be used now only for the non-published projects, due to conflicts in the "archives" config
// TODO: fix the problem above
fun Project.classesDirsArtifact(): FileCollection {
task("uploadArchives") {
// hides rule-based task with the same name, which appears to be broken in this project
}
val classesDirsCfg = configurations.getOrCreate("classes-dirs")
val classesDirs = mainSourceSet.output.classesDirs
val classesTask = tasks["classes"]
afterEvaluate {
classesDirs.files.forEach {
addArtifact(classesDirsCfg, classesTask, it)
}
}
return classesDirs
}
private const val MAGIC_DO_NOT_CHANGE_TEST_JAR_TASK_NAME = "testJar"
@@ -52,20 +35,31 @@ fun Project.testsJar(body: Jar.() -> Unit = {}): Jar {
}
}
var Project.artifactsRemovedDiagnosticFlag: Boolean
get() = extra.has("artifactsRemovedDiagnosticFlag") && extra["artifactsRemovedDiagnosticFlag"] == true
set(value) {
extra["artifactsRemovedDiagnosticFlag"] = value
}
fun Project.removeArtifacts(configuration: Configuration, task: Task) {
configuration.artifacts.removeAll { artifact ->
artifact.file in task.outputs.files
}
artifactsRemovedDiagnosticFlag = true
}
fun Project.noDefaultJar() {
tasks.findByName("jar")?.let { defaultJarTask ->
defaultJarTask.enabled = false
defaultJarTask.actions = emptyList()
configurations.forEach { cfg ->
cfg.artifacts.removeAll {
(it as? ArchivePublishArtifact)?.archiveTask?.let { it == defaultJarTask } ?: false
}
removeArtifacts(cfg, defaultJarTask)
}
}
}
fun<T> Project.runtimeJarArtifactBy(task: Task, artifactRef: T, body: ConfigurablePublishArtifact.() -> Unit = {}) {
fun Project.runtimeJarArtifactBy(task: Task, artifactRef: Any, body: ConfigurablePublishArtifact.() -> Unit = {}) {
addArtifact("archives", task, artifactRef, body)
addArtifact("runtimeJar", task, artifactRef, body)
configurations.findByName("runtime")?.let {
@@ -73,52 +67,57 @@ fun<T> Project.runtimeJarArtifactBy(task: Task, artifactRef: T, body: Configurab
}
}
fun<T: Jar> Project.runtimeJar(task: T, body: T.() -> Unit = {}): T {
fun <T : Jar> Project.runtimeJar(task: T, body: T.() -> Unit = {}): T {
extra["runtimeJarTask"] = task
tasks.findByName("jar")?.let { defaultJarTask ->
configurations.getOrCreate("archives").artifacts.removeAll { (it as? ArchivePublishArtifact)?.archiveTask?.let { it == defaultJarTask } ?: false }
removeArtifacts(configurations.getOrCreate("archives"), defaultJarTask)
}
return task.apply {
configurations.findByName("embedded")?.let { embedded ->
dependsOn(embedded)
from {
embedded.map(::zipTree)
}
}
setupPublicJar(project.the<BasePluginConvention>().archivesBaseName)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
body()
project.runtimeJarArtifactBy(this, this)
}
}
fun Project.runtimeJar(taskName: String = "jar", body: Jar.() -> Unit = {}): Jar = runtimeJar(getOrCreateTask(taskName, body))
fun Project.runtimeJar(body: Jar.() -> Unit = {}): Jar = runtimeJar(getOrCreateTask("jar", body), { })
fun Project.sourcesJar(sourceSet: String? = "main", body: Jar.() -> Unit = {}): Jar =
getOrCreateTask("sourcesJar") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
classifier = "sources"
try {
if (sourceSet != null) {
project.pluginManager.withPlugin("java-base") {
from(project.javaPluginConvention().sourceSets[sourceSet].allSource)
}
getOrCreateTask("sourcesJar") {
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
classifier = "sources"
try {
if (sourceSet != null) {
project.pluginManager.withPlugin("java-base") {
from(project.javaPluginConvention().sourceSets[sourceSet].allSource)
}
} catch (e: UnknownDomainObjectException) {
// skip default sources location
}
body()
project.addArtifact("archives", this, this)
} catch (e: UnknownDomainObjectException) {
// skip default sources location
}
body()
project.addArtifact("archives", this, this)
}
fun Project.javadocJar(body: Jar.() -> Unit = {}): Jar =
getOrCreateTask("javadocJar") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
classifier = "javadoc"
tasks.findByName("javadoc")?.let{ it as Javadoc }?.takeIf { it.enabled }?.let {
dependsOn(it)
from(it.destinationDir)
}
body()
project.addArtifact("archives", this, this)
}
fun Project.javadocJar(body: Jar.() -> Unit = {}): Jar = getOrCreateTask("javadocJar") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
classifier = "javadoc"
tasks.findByName("javadoc")?.let { it as Javadoc }?.takeIf { it.enabled }?.let {
dependsOn(it)
from(it.destinationDir)
}
body()
project.addArtifact("archives", this, this)
}
fun Project.standardPublicJars(): Unit {
fun Project.standardPublicJars() {
runtimeJar()
sourcesJar()
javadocJar()
@@ -127,6 +126,10 @@ fun Project.standardPublicJars(): Unit {
fun Project.publish(body: Upload.() -> Unit = {}): Upload {
apply<plugins.PublishedKotlinModule>()
if (artifactsRemovedDiagnosticFlag) {
error("`publish()` should be called before removing artifacts typically done in `noDefaultJar()` or `runtimeJar()` call")
}
afterEvaluate {
if (configurations.findByName("classes-dirs") != null)
throw GradleException("classesDirsArtifact() is incompatible with publish(), see sources comments for details")
@@ -137,31 +140,12 @@ fun Project.publish(body: Upload.() -> Unit = {}): Upload {
}
}
fun Project.ideaPlugin(subdir: String = "lib", body: AbstractCopyTask.() -> Unit): Copy {
val thisProject = this
val pluginTask = task<Copy>("ideaPlugin") {
body()
into(File(rootProject.extra["ideaPluginDir"].toString(), subdir).path)
rename("-${java.util.regex.Pattern.quote(thisProject.version.toString())}", "")
}
task("idea-plugin") {
dependsOn(pluginTask)
}
return pluginTask
}
fun Project.ideaPlugin(subdir: String = "lib"): Copy = ideaPlugin(subdir) {
runtimeJarTaskIfExists()?.let {
from(it)
}
}
fun Project.dist(targetDir: File? = null,
targetName: String? = null,
fromTask: Task? = null,
body: AbstractCopyTask.() -> Unit = {}): AbstractCopyTask {
fun Project.dist(
targetDir: File? = null,
targetName: String? = null,
fromTask: Task? = null,
body: AbstractCopyTask.() -> Unit = {}
): AbstractCopyTask {
val distJarCfg = configurations.getOrCreate("distJar")
val distLibDir: File by rootProject.extra
val distJarName = targetName ?: (the<BasePluginConvention>().archivesBaseName + ".jar")
@@ -191,26 +175,24 @@ fun ConfigurationContainer.getOrCreate(name: String): Configuration = findByName
fun Jar.setupPublicJar(baseName: String, classifier: String = "") {
val buildNumber = project.rootProject.extra["buildNumber"] as String
this.baseName = baseName
this.version = buildNumber
this.classifier = classifier
manifest.attributes.apply {
put("Implementation-Vendor", "JetBrains")
put("Implementation-Title", baseName)
put("Implementation-Version", buildNumber)
put("Build-Jdk", System.getProperty("java.version"))
}
}
fun<T> Project.addArtifact(configuration: Configuration, task: Task, artifactRef: T, body: ConfigurablePublishArtifact.() -> Unit = {}) {
fun Project.addArtifact(configuration: Configuration, task: Task, artifactRef: Any, body: ConfigurablePublishArtifact.() -> Unit = {}) {
artifacts.add(configuration.name, artifactRef) {
builtBy(task)
body()
}
}
fun<T> Project.addArtifact(configurationName: String, task: Task, artifactRef: T, body: ConfigurablePublishArtifact.() -> Unit = {}) =
addArtifact(configurations.getOrCreate(configurationName), task, artifactRef, body)
fun Project.addArtifact(configurationName: String, task: Task, artifactRef: Any, body: ConfigurablePublishArtifact.() -> Unit = {}) =
addArtifact(configurations.getOrCreate(configurationName), task, artifactRef, body)
fun Project.cleanArtifacts() {
configurations["archives"].artifacts.let { artifacts ->

View File

@@ -0,0 +1,91 @@
import org.gradle.api.Project
import org.gradle.api.initialization.Settings
import org.gradle.api.internal.DynamicObjectAware
import java.io.File
import java.util.*
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
interface PropertiesProvider {
val rootProjectDir: File
fun getProperty(key: String): Any?
}
class KotlinBuildProperties(
private val propertiesProvider: PropertiesProvider
) {
private val localProperties: Properties = Properties()
init {
val localPropertiesFile = propertiesProvider.rootProjectDir.resolve("local.properties")
if (localPropertiesFile.isFile) {
localPropertiesFile.reader().use(localProperties::load)
}
}
private operator fun get(key: String): Any? = localProperties.getProperty(key) ?: propertiesProvider.getProperty(key)
private fun getBoolean(key: String): Boolean = this[key]?.toString() == "true"
val isJpsBuildEnabled: Boolean = getBoolean("jpsBuild")
val isInIdeaSync: Boolean = run {
// "idea.sync.active" was introduced in 2019.1
System.getProperty("idea.sync.active")?.toBoolean() == true || let {
// before 2019.1 there is "idea.active" that was true only on sync,
// but since 2019.1 "idea.active" present in task execution too.
// So let's check Idea version
val majorIdeaVersion = System.getProperty("idea.version")
?.split(".")
?.getOrNull(0)
val isBeforeIdea2019 = majorIdeaVersion == null || majorIdeaVersion.toInt() < 2019
isBeforeIdea2019 && System.getProperty("idea.active")?.toBoolean() == true
}
}
val isInJpsBuildIdeaSync: Boolean
get() = isJpsBuildEnabled && isInIdeaSync
val includeJava9: Boolean
get() = !isInJpsBuildIdeaSync
val useBootstrapStdlib: Boolean
get() = isInJpsBuildIdeaSync
}
private const val extensionName = "kotlinBuildFlags"
class ProjectProperties(val project: Project): PropertiesProvider {
override val rootProjectDir: File
get() = project.projectDir
override fun getProperty(key: String): Any? = project.findProperty(key)
}
val Project.kotlinBuildProperties: KotlinBuildProperties
get() = rootProject.extensions.findByName(extensionName) as KotlinBuildProperties?
?: KotlinBuildProperties(ProjectProperties(rootProject)).also {
rootProject.extensions.add(extensionName, it)
}
class SettingsProperties(val settings: Settings): PropertiesProvider {
override val rootProjectDir: File
get() = settings.rootDir
override fun getProperty(key: String): Any? {
val obj = (settings as DynamicObjectAware).asDynamicObject
return if (obj.hasProperty(key)) obj.getProperty(key) else null
}
}
fun getKotlinBuildPropertiesForSettings(settings: Any) = (settings as Settings).kotlinBuildProperties
val Settings.kotlinBuildProperties: KotlinBuildProperties
get() = extensions.findByName(extensionName) as KotlinBuildProperties?
?: KotlinBuildProperties(SettingsProperties(this)).also {
extensions.add(extensionName, it)
}

View File

@@ -0,0 +1,39 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
import org.gradle.api.Action
import org.gradle.api.artifacts.Dependency
import org.gradle.api.artifacts.ExternalModuleDependency
import org.gradle.api.artifacts.ModuleDependency
import org.gradle.api.artifacts.dsl.DependencyHandler
import org.gradle.kotlin.dsl.accessors.runtime.addDependencyTo
import org.gradle.kotlin.dsl.accessors.runtime.addExternalModuleDependencyTo
import org.gradle.kotlin.dsl.add
fun DependencyHandler.embedded(dependencyNotation: Any): Dependency? =
add("embedded", dependencyNotation)
fun DependencyHandler.embedded(
dependencyNotation: String,
dependencyConfiguration: Action<ExternalModuleDependency>
): ExternalModuleDependency =
addDependencyTo(this, "embedded", dependencyNotation, dependencyConfiguration)
fun DependencyHandler.embedded(
group: String,
name: String,
version: String? = null,
configuration: String? = null,
classifier: String? = null,
ext: String? = null,
dependencyConfiguration: Action<ExternalModuleDependency>? = null
): ExternalModuleDependency = addExternalModuleDependencyTo(
this, "embedded", group, name, version, configuration, classifier, ext, dependencyConfiguration
)
fun <T : ModuleDependency> DependencyHandler.embedded(
dependency: T,
dependencyConfiguration: T.() -> Unit
): T = add("embedded", dependency, dependencyConfiguration)

View File

@@ -0,0 +1,65 @@
/*
* Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package tasks
import groovy.util.Node
import groovy.util.XmlParser
import org.gradle.api.DefaultTask
import org.gradle.api.Project
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.OutputFile
import org.gradle.api.tasks.TaskAction
import java.io.File
import java.util.*
open class WriteCopyrightToFile : DefaultTask() {
@InputFile
var path = project.file("${project.rootDir}/.idea/copyright/apache.xml")
@OutputFile
var outputFile: File? = null
@Input
var commented: Boolean = true
@TaskAction
fun write() {
if (commented) {
outputFile!!.writeText(project.readCopyrightCommented())
} else {
outputFile!!.writeText(project.readCopyright())
}
}
fun Project.readCopyright(): String {
val file = rootDir.resolve(".idea/copyright/apache.xml")
assert(file.exists()) {
"File $file with copyright not found"
}
val xmlParser = XmlParser()
val node = xmlParser.parse(file)
assert(node.attribute("name") == "CopyrightManager") {
"Format changed occasionally?"
}
val copyrightBlock = node.children().filterIsInstance<Node>().single()
val noticeNode = copyrightBlock.children().filterIsInstance<Node>().single { it.attribute("name") == "notice" }
return noticeNode.attribute("value").toString().replace("&#36;today.year", GregorianCalendar()[Calendar.YEAR].toString())
}
fun Project.readCopyrightCommented(): String {
return "/*\n" + readCopyright().prependIndent(" * ") + "\n */"
}
}

View File

@@ -1,16 +1,21 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
@file:Suppress("unused")
// usages in build scripts are not tracked properly
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.api.artifacts.ProjectDependency
import org.gradle.api.artifacts.dsl.DependencyHandler
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.tasks.AbstractCopyTask
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.kotlin.dsl.extra
import org.gradle.kotlin.dsl.project
import java.io.File
val Project.isSnapshotIntellij get() = rootProject.extra["versions.intellijSdk"].toString().endsWith("SNAPSHOT")
val Project.intellijRepo get() = "https://www.jetbrains.com/intellij-repository/" + if (isSnapshotIntellij) "snapshots" else "releases"
fun Project.commonDep(coord: String): String {
val parts = coord.split(':')
@@ -28,13 +33,18 @@ fun Project.commonDep(group: String, artifact: String, vararg suffixesAndClassif
}
fun Project.commonVer(group: String, artifact: String) =
when {
rootProject.extra.has("versions.$artifact") -> rootProject.extra["versions.$artifact"]
rootProject.extra.has("versions.$group") -> rootProject.extra["versions.$group"]
else -> throw GradleException("Neither versions.$artifact nor versions.$group is defined in the root project's extra")
}
when {
rootProject.extra.has("versions.$artifact") -> rootProject.extra["versions.$artifact"]
rootProject.extra.has("versions.$group") -> rootProject.extra["versions.$group"]
else -> throw GradleException("Neither versions.$artifact nor versions.$group is defined in the root project's extra")
}
fun Project.preloadedDeps(vararg artifactBaseNames: String, baseDir: File = File(rootDir, "dependencies"), subdir: String? = null, optional: Boolean = false): ConfigurableFileCollection {
fun Project.preloadedDeps(
vararg artifactBaseNames: String,
baseDir: File = File(rootDir, "dependencies"),
subdir: String? = null,
optional: Boolean = false
): ConfigurableFileCollection {
val dir = if (subdir != null) File(baseDir, subdir) else baseDir
if (!dir.exists() || !dir.isDirectory) {
if (optional) return files()
@@ -42,9 +52,17 @@ fun Project.preloadedDeps(vararg artifactBaseNames: String, baseDir: File = File
}
val matchingFiles = dir.listFiles { file -> artifactBaseNames.any { file.matchMaybeVersionedArtifact(it) } }
if (matchingFiles == null || matchingFiles.size < artifactBaseNames.size) {
throw GradleException("Not all matching artifacts '${artifactBaseNames.joinToString()}' found in the '$dir' " +
"(missing: ${artifactBaseNames.filterNot { request -> matchingFiles.any { it.matchMaybeVersionedArtifact(request) } }.joinToString()};" +
" found: ${matchingFiles?.joinToString { it.name }})")
throw GradleException(
"Not all matching artifacts '${artifactBaseNames.joinToString()}' found in the '$dir' " +
"(missing: ${artifactBaseNames.filterNot { request ->
matchingFiles.any {
it.matchMaybeVersionedArtifact(
request
)
}
}.joinToString()};" +
" found: ${matchingFiles?.joinToString { it.name }})"
)
}
return files(*matchingFiles.map { it.canonicalPath }.toTypedArray())
}
@@ -57,21 +75,35 @@ fun Project.ideaUltimatePreloadedDeps(vararg artifactBaseNames: String, subdir:
fun Project.kotlinDep(artifactBaseName: String, version: String): String = "org.jetbrains.kotlin:kotlin-$artifactBaseName:$version"
@Deprecated("Depend on the default configuration instead", ReplaceWith("project(name)"))
fun DependencyHandler.projectDist(name: String): ProjectDependency = project(name)
fun Project.kotlinStdlib(suffix: String? = null): Any {
return if (kotlinBuildProperties.useBootstrapStdlib)
kotlinDep(listOfNotNull("stdlib", suffix).joinToString("-"), bootstrapKotlinVersion)
else
dependencies.project(listOfNotNull(":kotlin-stdlib", suffix).joinToString("-"))
}
fun Project.kotlinBuiltins(): Any =
if (kotlinBuildProperties.useBootstrapStdlib) "org.jetbrains.kotlin:builtins:$bootstrapKotlinVersion"
else dependencies.project(":core:builtins")
fun DependencyHandler.projectTests(name: String): ProjectDependency = project(name, configuration = "tests-jar")
fun DependencyHandler.projectRuntimeJar(name: String): ProjectDependency = project(name, configuration = "runtimeJar")
fun DependencyHandler.projectArchives(name: String): ProjectDependency = project(name, configuration = "archives")
fun DependencyHandler.projectClasses(name: String): ProjectDependency = project(name, configuration = "classes-dirs")
val protobufLiteProject = ":custom-dependencies:protobuf-lite"
val protobufRelocatedProject = ":custom-dependencies:protobuf-relocated"
fun DependencyHandler.protobufLite(): ProjectDependency =
project(protobufLiteProject, configuration = "default").apply { isTransitive = false }
val protobufLiteTask = "$protobufLiteProject:prepare"
val Project.protobufVersion: String get() = findProperty("versions.protobuf") as String
fun DependencyHandler.protobufFull(): ProjectDependency =
project(protobufRelocatedProject, configuration = "default").apply { isTransitive = false }
val Project.protobufRepo: String
get() =
"https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_Protobuf),status:SUCCESS,pinned:true,tag:$protobufVersion/artifacts/content/internal/repo/"
fun Project.protobufLite(): String = "org.jetbrains.kotlin:protobuf-lite:$protobufVersion"
fun Project.protobufFull(): String = "org.jetbrains.kotlin:protobuf-relocated:$protobufVersion"
val Project.kotlinNativeRepo: String
get() = "https://jetbrains.bintray.com/kotlin-native-dependencies"
val Project.kotlinNativeVersion: String get() = property("versions.kotlin-native") as String
val Project.kotlinNativeSharedVersion: String get() = property("versions.kotlin-native-shared") as String
fun File.matchMaybeVersionedArtifact(baseName: String) = name.matches(baseName.toMaybeVersionedJarRegex())
@@ -93,8 +125,6 @@ private fun String.toMaybeVersionedJarRegex(): Regex {
return Regex(if (hasJarExtension) escaped else "$escaped(-\\d.*)?\\.jar") // TODO: consider more precise version part of the regex
}
fun Project.firstFromJavaHomeThatExists(vararg paths: String, jdkHome: File = File(this.property("JDK_18") as String)): File? =
paths.map { File(jdkHome, it) }.firstOrNull { it.exists() }.also {
if (it == null)
@@ -104,23 +134,9 @@ fun Project.firstFromJavaHomeThatExists(vararg paths: String, jdkHome: File = Fi
fun Project.toolsJar(jdkHome: File = File(this.property("JDK_18") as String)): File? =
firstFromJavaHomeThatExists("lib/tools.jar", jdkHome = jdkHome)
object EmbeddedComponents {
val CONFIGURATION_NAME = "embeddedComponents"
}
val compilerManifestClassPath
get() = "annotations-13.0.jar kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar trove4j.jar"
fun AbstractCopyTask.fromEmbeddedComponents() {
val embeddedComponents = project.configurations.getByName(EmbeddedComponents.CONFIGURATION_NAME)
if (this is ShadowJar) {
from(embeddedComponents)
} else {
dependsOn(embeddedComponents)
from {
embeddedComponents.map { file ->
if (file.isDirectory)
project.files(file)
else
project.zipTree(file)
}
}
}
}
object EmbeddedComponents {
val CONFIGURATION_NAME = "embedded"
}

View File

@@ -18,7 +18,6 @@ val packagesToRelocate =
"org.jdom",
"org.picocontainer",
"org.jline",
"gnu",
"org.fusesource",
"kotlinx.coroutines")
@@ -65,7 +64,7 @@ private fun Project.compilerShadowJar(taskName: String, body: ShadowJar.() -> Un
return task<ShadowJar>(taskName) {
destinationDir = File(buildDir, "libs")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
from(compilerJar)
body()
}
@@ -97,7 +96,7 @@ fun Project.embeddableCompilerDummyForDependenciesRewriting(taskName: String = "
return task<ShadowJar>(taskName) {
destinationDir = File(buildDir, "libs")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
from(compilerDummyJar)
configureEmbeddableCompilerRelocation(withJavaxInject = false)
body()
@@ -119,7 +118,7 @@ fun Project.rewriteDepsToShadedJar(originalJarTask: Jar, shadowJarTask: Jar, bod
// which leads to the content of that JAR being excluded as well:
exclude { it.file == compilerDummyJarFile }
classifier = null
classifier = ""
body()
}
}

View File

@@ -0,0 +1,136 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package idea
import groovy.lang.Closure
import org.gradle.api.Action
import org.gradle.api.Transformer
import org.gradle.api.file.ContentFilterable
import org.gradle.api.file.DuplicatesStrategy
import org.gradle.api.file.FileCopyDetails
import org.gradle.api.file.RelativePath
import java.io.File
import java.io.FilterReader
import java.io.InputStream
import java.io.OutputStream
class DistCopyDetailsMock(val context: DistModelBuildContext, srcName: String) : FileCopyDetails {
private var relativePath = RelativePath(true, srcName)
lateinit var lastAction: Action<in FileCopyDetails>
class E : Exception() {
// skip stack trace filling
override fun fillInStackTrace(): Throwable = this
}
fun logUnsupported(methodName: String): Nothing {
context.logUnsupported("COPY ACTION FileCopyDetails mock: $methodName", lastAction)
throw E()
}
override fun setDuplicatesStrategy(strategy: DuplicatesStrategy) {
logUnsupported("setDuplicatesStrategy")
}
override fun getSourcePath(): String {
logUnsupported("getSourcePath")
}
override fun getName(): String {
logUnsupported("getName")
}
override fun getSize(): Long {
logUnsupported("getSize")
}
override fun getRelativePath(): RelativePath = relativePath
override fun getRelativeSourcePath(): RelativePath {
logUnsupported("getRelativeSourcePath")
}
override fun expand(properties: MutableMap<String, *>): ContentFilterable {
logUnsupported("expand")
}
override fun getMode(): Int {
logUnsupported("getMode")
}
override fun getSourceName(): String {
logUnsupported("getSourceName")
}
override fun filter(properties: MutableMap<String, *>, filterType: Class<out FilterReader>): ContentFilterable {
logUnsupported("filter")
}
override fun filter(filterType: Class<out FilterReader>): ContentFilterable {
logUnsupported("filter")
}
override fun filter(closure: Closure<*>): ContentFilterable {
logUnsupported("filter")
}
override fun filter(transformer: Transformer<String, String>): ContentFilterable {
logUnsupported("filter")
}
override fun getFile(): File {
logUnsupported("getFile")
}
override fun setMode(mode: Int) {
logUnsupported("setMode")
}
override fun copyTo(output: OutputStream) {
logUnsupported("copyTo")
}
override fun copyTo(target: File): Boolean {
logUnsupported("copyTo")
}
override fun open(): InputStream {
logUnsupported("open")
}
override fun setRelativePath(path: RelativePath) {
relativePath = path
}
override fun getPath(): String {
logUnsupported("getPath")
}
override fun isDirectory(): Boolean {
logUnsupported("isDirectory")
}
override fun getDuplicatesStrategy(): DuplicatesStrategy {
logUnsupported("getDuplicatesStrategy")
}
override fun setName(name: String) {
logUnsupported("setName")
}
override fun getLastModified(): Long {
logUnsupported("getLastModified")
}
override fun setPath(path: String) {
logUnsupported("setPath")
}
override fun exclude() {
logUnsupported("exclude")
}
}

View File

@@ -0,0 +1,96 @@
package org.jetbrains.kotlin.buildUtils.idea
import org.gradle.api.Action
import org.gradle.api.file.FileCopyDetails
import java.io.File
import java.io.PrintWriter
class DistVFile(
val parent: DistVFile?,
val name: String,
val file: File = File(parent!!.file, name)
) {
val child = mutableMapOf<String, DistVFile>()
val contents = mutableSetOf<DistContentElement>()
override fun toString(): String = name
val hasContents: Boolean = file.exists() || contents.isNotEmpty()
fun relativePath(path: String): DistVFile {
val pathComponents = path.split(File.separatorChar)
return pathComponents.fold(this) { parent: DistVFile, childName: String ->
try {
parent.getOrCreateChild(childName)
} catch (t: Throwable) {
throw Exception("Error while processing path `$path`, components: `$pathComponents`, element: `$childName`", t)
}
}
}
fun getOrCreateChild(name: String): DistVFile = child.getOrPut(name) {
DistVFile(this, name)
}
fun addContents(contents: DistContentElement) {
this.contents.add(contents)
}
fun removeAll(matcher: (String) -> Boolean) {
child.keys.filter(matcher).forEach {
child.remove(it)
}
}
fun printTree(p: PrintWriter, depth: String = "") {
p.println("$depth${file.path} ${if (file.exists()) "EXISTED" else ""}:")
contents.forEach {
p.println("$depth $it")
}
child.values.forEach {
it.printTree(p, "$depth ")
}
}
}
sealed class DistContentElement()
class DistCopy(
target: DistVFile,
val src: DistVFile,
val customTargetName: String? = null,
val copyActions: Collection<Action<in FileCopyDetails>> = listOf()
) : DistContentElement() {
init {
target.addContents(this)
}
override fun toString(): String =
"COPY OF ${src.file}" +
if (customTargetName != null) " -> $customTargetName" else ""
}
class DistModuleOutput(parent: DistVFile, val projectId: String) : DistContentElement() {
init {
parent.addContents(this)
}
override fun toString(): String = "COMPILE OUTPUT $projectId"
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as DistModuleOutput
if (projectId != other.projectId) return false
return true
}
override fun hashCode(): Int {
return projectId.hashCode()
}
}

View File

@@ -0,0 +1,76 @@
package idea
import org.gradle.api.Action
import org.gradle.api.file.FileCopyDetails
import org.jetbrains.kotlin.buildUtils.idea.DistVFile
import org.jetbrains.kotlin.buildUtils.idea.logger
/**
* Used for logging and nesting properties
*/
class DistModelBuildContext(
val parent: DistModelBuildContext?,
val kind: String,
val title: String,
val report: Appendable? = parent?.report,
val shade: Boolean = parent?.shade ?: false
) {
val logEnabled = false
val allCopyActions = mutableSetOf<Action<in FileCopyDetails>>()
var destination: DistVFile? = parent?.destination // todo: don't nest destination between tasks visiting
val logPrefix: String = if (parent != null) "${parent.logPrefix}-" else ""
init {
report?.appendln(toString())
if (parent != null) {
allCopyActions.addAll(parent.allCopyActions)
}
}
fun log(kind: String, title: String = "", print: Boolean = false) {
if (logEnabled) {
report?.appendln("$logPrefix- $kind $title")
if (print) {
logger.error("$kind $title, while visiting:")
var p = this
while (p.parent != null) {
logger.error(" - ${p.kind} ${p.title}")
p = p.parent!!
}
}
}
}
fun logUnsupported(kind: String, obj: Any? = null) {
val objInfo = if (obj != null) {
val javaClass = obj.javaClass
val superclass = javaClass.superclass as Class<*>
"$obj [$javaClass extends $superclass implements ${javaClass.interfaces.map { it.canonicalName }}]"
} else ""
log("UNSUPPORTED $kind", objInfo, true)
}
override fun toString() = "$logPrefix $kind $title"
inline fun child(
kind: String,
title: String = "",
shade: Boolean = false,
body: (DistModelBuildContext) -> Unit = {}
): DistModelBuildContext {
val result = DistModelBuildContext(this, kind, title, shade = shade)
body(result)
return result
}
fun addCopyActions(allCopyActions: Collection<Action<in FileCopyDetails>>) {
allCopyActions.forEach {
log("COPY ACTION", "$it")
}
this.allCopyActions.addAll(allCopyActions)
}
}

View File

@@ -0,0 +1,317 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.buildUtils.idea
import IntelliJInstrumentCodeTask
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import idea.DistCopyDetailsMock
import idea.DistModelBuildContext
import org.codehaus.groovy.runtime.GStringImpl
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.artifacts.Configuration
import org.gradle.api.file.FileCollection
import org.gradle.api.file.FileVisitDetails
import org.gradle.api.file.FileVisitor
import org.gradle.api.file.SourceDirectorySet
import org.gradle.api.internal.file.*
import org.gradle.api.internal.file.archive.ZipFileTree
import org.gradle.api.internal.file.collections.*
import org.gradle.api.internal.file.copy.CopySpecInternal
import org.gradle.api.internal.file.copy.DefaultCopySpec
import org.gradle.api.internal.file.copy.DestinationRootCopySpec
import org.gradle.api.internal.file.copy.SingleParentCopySpec
import org.gradle.api.tasks.AbstractCopyTask
import org.gradle.api.tasks.Copy
import org.gradle.api.tasks.SourceSetOutput
import org.gradle.api.tasks.Sync
import org.gradle.api.tasks.bundling.AbstractArchiveTask
import org.gradle.api.tasks.compile.AbstractCompile
import org.gradle.api.tasks.util.PatternSet
import org.gradle.internal.file.PathToFileResolver
import org.gradle.jvm.tasks.Jar
import java.io.File
import java.io.PrintWriter
import java.util.concurrent.Callable
open class DistModelBuilder(val rootProject: Project, pw: PrintWriter) {
val rootCtx = DistModelBuildContext(null, "ROOT", "dist", pw)
val visited = mutableMapOf<Task, DistModelBuildContext>()
val vfsRoot = DistVFile(null, "<root>", File(""))
val refs = mutableSetOf<DistVFile>()
fun visitInstrumentTask(it: IntelliJInstrumentCodeTask): DistModelBuildContext = visited.getOrPut(it) {
val ctx = rootCtx.child("INSTRUMENT", it.path)
ctx.setDest(it.output!!.path)
processSourcePath(it.originalClassesDirs, ctx)
val dest = ctx.destination
if (dest != null) {
DistModuleOutput(dest, it.project.path)
}
ctx
}
fun visitCompileTask(it: AbstractCompile): DistModelBuildContext = visited.getOrPut(it) {
val ctx = rootCtx.child("COMPILE", it.path)
ctx.setDest(it.destinationDir.path)
val dest = ctx.destination
if (dest != null) DistModuleOutput(dest, it.project.path)
else ctx.logUnsupported("Cannot add contents: destination is unknown", it)
ctx
}
fun visitCopyTask(
copy: AbstractCopyTask,
shade: Boolean = false
): DistModelBuildContext = visited.getOrPut(copy) {
val context = rootCtx.child("COPY", copy.path, shade)
val rootSpec = copy.rootSpec
when (copy) {
is Copy -> copy.destinationDir?.also { context.setDest(it.path) }
is Sync -> copy.destinationDir?.also { context.setDest(it.path) }
is AbstractArchiveTask -> copy.archivePath?.also { context.setDest(it.path) }
}
when (copy) {
is ShadowJar -> copy.configurations.forEach {
processSourcePath(it, context)
}
}
processCopySpec(rootSpec, context)
context
}
fun processCopySpec(spec: CopySpecInternal, ctx: DistModelBuildContext) {
spec.children.forEach {
when (it) {
is DestinationRootCopySpec -> ctx.child("DESTINATION ROOT COPY SPEC") { newCtx ->
newCtx.setDest(getRelativePath(it.destinationDir.path))
processCopySpec(it, newCtx)
}
is DefaultCopySpec -> ctx.child("DEFAULT COPY SPEC") { newCtx ->
if (ctx.destination != null) {
val buildRootResolver = it.buildRootResolver()
ctx.addCopyActions(buildRootResolver.allCopyActions)
newCtx.setDest(buildRootResolver.destPath.getFile(ctx.destination!!.file).path)
processCopySpec(it, newCtx)
it.includes
newCtx.child("SINGE PARENT COPY SPEC") { child ->
it.sourcePaths.forEach {
processSourcePath(it, child)
}
}
}
}
is SingleParentCopySpec -> ctx.child("OTHER SINGE PARENT COPY SPEC") { child ->
it.sourcePaths.forEach {
processSourcePath(it, child)
}
}
is CopySpecInternal -> processCopySpec(it, ctx)
else -> ctx.logUnsupported("CopySpec", spec)
}
}
}
fun processSourcePath(sourcePath: Any?, ctx: DistModelBuildContext) {
when {
sourcePath == null -> Unit
sourcePath is Jar -> ctx.child("JAR") { child ->
child.addCopyOf(sourcePath.archivePath.path)
}
sourcePath is SourceSetOutput -> ctx.child("COMPILE") { child ->
sourcePath.classesDirs.files.forEach {
child.addCopyOf(it.path)
}
}
sourcePath is Configuration -> {
ctx.child("CONFIGURATION") { child ->
sourcePath.resolve().forEach {
child.addCopyOf(it.path)
}
}
}
sourcePath is SourceDirectorySet -> {
ctx.child("SOURCES") { child ->
sourcePath.srcDirs.forEach {
child.addCopyOf(it.path)
}
}
}
sourcePath is MinimalFileSet -> ctx.child("MINIMAL FILE SET (${sourcePath.javaClass.simpleName})") { child ->
sourcePath.files.forEach {
processSourcePath(it, child)
}
}
sourcePath is MinimalFileTree -> ctx.child("MINIMAL FILE TREE (${sourcePath.javaClass.simpleName})") { child ->
sourcePath.visit(object : FileVisitor {
override fun visitDir(dirDetails: FileVisitDetails) {
processSourcePath(dirDetails.file, child)
}
override fun visitFile(fileDetails: FileVisitDetails) {
processSourcePath(fileDetails.file, child)
}
})
}
sourcePath is FileTreeAdapter && sourcePath.tree is GeneratedSingletonFileTree -> ctx.child("FILE TREE ADAPTER OF MAP FILE TREE (${sourcePath.javaClass.simpleName})") { child ->
sourcePath.visitContents(object : FileCollectionResolveContext {
override fun add(element: Any): FileCollectionResolveContext {
processSourcePath(element, child)
return this
}
override fun newContext(): ResolvableFileCollectionResolveContext {
error("not supported")
}
override fun push(fileResolver: PathToFileResolver): FileCollectionResolveContext {
return this
}
})
}
sourcePath is CompositeFileCollection -> ctx.child("COMPOSITE FILE COLLECTION") { child ->
sourcePath.visitLeafCollections(object : FileCollectionLeafVisitor {
override fun visitFileTree(file: File, patternSet: PatternSet) {
child.child("FILE TREE") {
it.addCopyOf(file.path)
}
}
override fun visitGenericFileTree(fileTree: FileTreeInternal) {
child.child("TREE") {
processSourcePath(fileTree, it)
}
}
override fun visitCollection(fileCollection: FileCollectionInternal) {
processSourcePath(fileCollection, child)
}
})
}
sourcePath is FileTreeAdapter && sourcePath.tree is ZipFileTree -> ctx.child("ZIP FILE TREE ADAPTER") { child ->
val tree = sourcePath.tree
val field = tree.javaClass.declaredFields.find { it.name == "zipFile" }!!
field.isAccessible = true
val zipFile = field.get(tree) as File
child.addCopyOf(zipFile.path)
}
sourcePath is FileTreeInternal -> ctx.child("FILE TREE INTERNAL") { child ->
// todo: preserve or warn about filtering
sourcePath.visitTreeOrBackingFile(object : FileVisitor {
override fun visitFile(fileDetails: FileVisitDetails) {
child.addCopyOf(fileDetails.file.path)
}
override fun visitDir(dirDetails: FileVisitDetails) {
child.addCopyOf(dirDetails.file.path)
}
})
}
sourcePath is FileCollection -> ctx.child("OTHER FILE COLLECTION (${sourcePath.javaClass})") { child ->
try {
sourcePath.files.forEach {
child.addCopyOf(it.path)
}
} catch (t: Throwable) {
child.logUnsupported("FILE COLLECTION (${t.message})", sourcePath)
}
}
sourcePath is String || sourcePath is GStringImpl -> ctx.child("STRING") { child ->
child.addCopyOf(sourcePath.toString())
}
sourcePath is Callable<*> -> ctx.child("CALLABLE") { child ->
processSourcePath(sourcePath.call(), child)
}
sourcePath is Collection<*> -> ctx.child("COLLECTION") { child ->
sourcePath.forEach {
processSourcePath(it, child)
}
}
sourcePath is Copy -> ctx.child("COPY OUTPUT") { child ->
val src = visitCopyTask(sourcePath).destination
if (src != null) child.addCopyOf(src)
// else it is added to `it`, because destination is inhereted by context
}
sourcePath is File -> ctx.child("FILE ${sourcePath.path}") { child ->
child.addCopyOf(sourcePath.path)
}
else -> ctx.logUnsupported("SOURCE PATH", sourcePath)
}
}
inline fun DistModelBuildContext.addCopyOf(
src: String,
body: (src: DistVFile, target: DistVFile) -> Unit = { _, _ -> Unit }
) {
addCopyOf(requirePath(src), body)
}
fun DistModelBuildContext.transformName(srcName: String): String? {
val detailsMock = DistCopyDetailsMock(this, srcName)
allCopyActions.forEach {
detailsMock.lastAction = it
try {
it.execute(detailsMock)
} catch (t: DistCopyDetailsMock.E) {
// skip
}
}
val name1 = detailsMock.relativePath.lastName
return if (name1.endsWith(".jar")) transformJarName(name1) else name1
}
// todo: investigate why allCopyActions not working
open fun transformJarName(name: String): String = name
inline fun DistModelBuildContext.addCopyOf(
src: DistVFile,
body: (src: DistVFile, target: DistVFile) -> Unit = { _, _ -> Unit }
) {
val destination = destination
if (destination != null) {
body(src, destination)
val customTargetName = transformName(src.name)
DistCopy(destination, src, customTargetName)
log("+DistCopy", "${getRelativePath(src.file.path)} -> ${getRelativePath(destination.file.path)}/$customTargetName")
} else logUnsupported("Cannot add copy of `$src`: destination is unknown")
}
fun DistModelBuildContext.setDest(path: String) {
destination = vfsRoot.relativePath(path)
log("INTO", getRelativePath(path))
}
fun checkRefs() {
refs.forEach {
if (!it.hasContents && it.contents.isEmpty() && it.file.path.contains("${File.pathSeparator}build${File.pathSeparator}")) {
logger.error("UNRESOLVED ${it.file}")
it.contents.forEach {
logger.error("+ ${it}")
}
}
}
}
fun getRelativePath(path: String) = path.replace(rootProject.projectDir.path, "$")
fun requirePath(targetPath: String): DistVFile {
val target = vfsRoot.relativePath(targetPath)
if (!File(targetPath).exists()) refs.add(target)
return target
}
}

View File

@@ -0,0 +1,67 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.buildUtils.idea
class DistModelFlattener() {
val stack = mutableSetOf<DistVFile>()
val common = mutableSetOf<DistVFile>()
fun DistVFile.flatten(): DistVFile {
val new = DistVFile(parent, name, file)
copyFlattenedContentsTo(new)
return new
}
private fun DistVFile.copyFlattenedContentsTo(new: DistVFile, inJar: Boolean = false) {
if (!stack.add(this)) {
return
}
try {
contents.forEach {
if (!shouldSkip(new, it)) {
when (it) {
is DistCopy -> {
val srcName = it.customTargetName ?: it.src.name
if (it.src.file.exists()) {
DistCopy(new, it.src, srcName)
}
if (!inJar && srcName.endsWith(".jar")) {
val newChild = new.getOrCreateChild(srcName)
it.src.copyFlattenedContentsTo(newChild, inJar = true)
} else {
it.src.copyFlattenedContentsTo(new, inJar)
}
}
is DistModuleOutput -> DistModuleOutput(new, it.projectId)
}
}
}
child.values.forEach { oldChild ->
if (inJar) {
val newChild =
if (oldChild.name.endsWith(".jar")) new
else new.getOrCreateChild(oldChild.name)
oldChild.copyFlattenedContentsTo(newChild, inJar = true)
} else {
val newChild = new.getOrCreateChild(oldChild.name)
oldChild.copyFlattenedContentsTo(newChild)
}
}
} finally {
stack.remove(this)
}
}
private fun shouldSkip(
new: DistVFile,
content: DistContentElement
) =
new.name == "kotlin-jps-plugin.jar" && content is DistCopy && content.customTargetName == "kotlin-compiler-runner.jar"
}

Some files were not shown because too many files have changed in this diff Show More