Compare commits

..

7573 Commits

Author SHA1 Message Date
nikita.movshin
c5a276ccaf Update Kotlin/Native version 2019-07-03 19:08:42 +03:00
nikita.movshin
1ad91cdf91 Add changelog for 1.3.41 2019-07-02 22:10:12 +03:00
nikita.movshin
791f49d71a Update Kotlin/Native version for testing 2019-07-02 17:01:45 +03:00
Alexey Tsvetkov
270219dfc5 Fix filling Main-Class attribute in manifest file of output jar
Before 5b7cee6221 JVM CLI compiler
was calling `KotlinToJVMBytecodeCompiler.compileBunchOfSources`.
`compileBunchOfSources` detected possible main classes,
and filled the Main-Class attribute in output jar
if if there was only one candidate.

After the change JVM CLI began calling
`KotlinToJVMBytecodeCompiler.compileModules`, which was not searching for a main class.

This change adds searching for main classes to `compileModules`.
We search for a main class only when one module is compiled,
and an output is written a jar file (so the change only affects JVM CLI compilation).

    #KT-32272 Fixed
2019-07-01 15:08:41 +03:00
Leonid Startsev
ffc409673c Export deserialization constructor from JS module
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/443
2019-07-01 14:51:32 +03:00
Mikhail Zarechenskiy
fa9edf0846 [NI] Fix exception on incomplete try/catch block
There was an inconsistency on creating PSI call and corresponding
 descriptor. See variable `catchBlocks` from visitor, it's created
 only if PSI elements are not null, but for descriptor parameters
 there wasn't such check

 #KT-32134 Fixed
 #EA-139748 Fixed
2019-07-01 14:05:32 +03:00
Mikhail Zarechenskiy
98204815f9 [NI] Fix OnlyInputTypes annotation support for top-level captured types
#KT-32157 Fixed
 #KT-32116 Fixed
 #KT-32235 Fixed
 #KT-32218 Fixed
2019-07-01 14:05:30 +03:00
Mikhail Zarechenskiy
bf6b58ddb4 [NI] Move ability to convert standalone SAM-argument under the feature
If new inference is enabled only for IDE analysis, then this feature
 will be disabled to reduce difference between new and old inference,
 but if new inference is enabled in the compiler, then this feature
 will be enabled too to preserve behavior of new inference for
 compilation

 #KT-32175 Fixed
 #KT-32143 Fixed
 #KT-32123 Fixed
 #KT-32230 Fixed
2019-07-01 14:05:24 +03:00
Sergey Rostov
ba192c3601 Gradle, JS: don't project.getTasksByName inside task realization callback
Or project evaluation would be called

#KT-32072 Fixed

(cherry picked from commit bb0f467f63)
2019-06-30 19:56:28 +03:00
Anton Bannykh
5605a7099c JS: fix reified T::class for primitive T (e.g. Int) (KT-32215 fixed)
(cherry picked from commit fadeac083f)
2019-06-28 16:57:02 +03:00
Alexander Gorshenev
240a91c4d0 Bind WrappedVariableDescriptorWithAccessors in IR deserializer
Fix for KT-32170
2019-06-28 14:37:08 +03:00
victor.petukhov
4769a3baa1 Exclude functional types for the warning reporting about implicitly inferred a type parameter to Nothing 2019-06-28 11:27:11 +03:00
Ilya Matveev
f0dcd1f36a Gradle: Add a shortcut DSL method for linuxArm64 target
Issue #KT-32034 Fixed
2019-06-27 15:20:33 +07:00
Mikhail Zarechenskiy
7836bbd1b6 [NI] Record DFI for callable reference arguments
#KT-31941 Fixed
2019-06-26 14:09:31 +03:00
Mikhail Zarechenskiy
00c1d8d20a [NI] Fix composite substitution for stubbed type in builder-inference
#KT-32038 Fixed
2019-06-26 14:09:19 +03:00
Mikhail Zarechenskiy
5db85fdb27 [NI] Coerce to Unit expression in last block with explicit Unit
#KT-32037 Fixed
2019-06-26 14:09:05 +03:00
Mikhail Zarechenskiy
bd4e0b340c [NI] Fix exception for type check callable reference against error type
#KT-32029 Fixed
 #EA-145311 Fixed
2019-06-26 14:08:38 +03:00
Mikhail Zarechenskiy
99ad60fea7 [NI] Support callable references on qualified types with generics
#KT-32154 Fixed
2019-06-26 14:08:12 +03:00
Mikhail Zarechenskiy
6894d8ae2c [NI] Capture receiver of invoke-based call
#KT-32133 Fixed
2019-06-26 14:06:34 +03:00
Mikhail Zarechenskiy
bfc2eb4499 [NI] Fix exception: don't try to compute type depth on null type
#KT-32184 Fixed
2019-06-26 14:06:20 +03:00
Mikhail Zarechenskiy
38336adb40 [NI] Fix exception: callable reference is used with an unresolved LHS
#KT-32187 Fixed
2019-06-26 14:06:05 +03:00
Mikhail Zarechenskiy
4a24e83b4b [NI] Skip fake call for descriptor from object in builder-inference
This call have interesting rules for resolution, see
 `KtQualifiedExpression.elementChain` function and it's usages:
 resolution results for such call can be omitted and be replaced with
 some other information, while diagnostics will be reported from
 builder-inference.

 To mitigate this problem, we'll just skip this call from builder-inference
 as such calls can't have type parameters anyway

 #KT-32094 Fixed
2019-06-26 14:05:53 +03:00
Mikhail Zarechenskiy
337d09ce10 [NI] Added test for KT-32094 2019-06-26 14:05:43 +03:00
Mikhail Zarechenskiy
3777d5dbad [NI] Don't avoid Nothing-like constraints if Nothing was in initial type
#KT-32081 Fixed
 #KT-32951 Fixed
2019-06-26 14:05:02 +03:00
Ilya Chernikov
fabf681d27 Implement main-kts test with command-line compiler 2019-06-25 21:51:18 +02:00
Ilya Chernikov
aed26a5594 Fix custom script definition cashing and script validity check:
- reorder initialization logic, so that script definitions are
  requested only after plugins loading
- clear definitions cache after adding explicit definitions or sources

#KT-32206 fixed
#KT-32169 fixed

Note: any of these modification fix the problem alone, but the second
may prevent other similar problems, while the first fixes actual logic
of the script validity checks as well.
2019-06-25 21:51:18 +02:00
Ilya Chernikov
8267760dc8 Implement command-line REPL smoke test 2019-06-25 21:51:17 +02:00
Ilya Chernikov
b982121b31 Fix jline proguarding in the compiler: fixes cli REPL
#KT-32085 fixed
2019-06-25 21:51:17 +02:00
nikita.movshin
7bfd974e59 Update changelog for 1.3.40 2019-06-19 15:40:27 +03:00
Elena Lepilkina
3ee38f18ef Release version of Kotlin/Native for release of Kotlin 2019-06-18 13:19:29 +03:00
Sergey Igushkin
d693620cda Update Gradle module metadata warnings: don't warn when it's enabled
Also add a suggestion to enable the module metadata publishing in
Gradle 5.3+ projects that consume Gradle module metadata by default but
don't produce it unless explicitly enabled.

Issue #KT-31023 Fixed
2019-06-17 19:10:49 +03:00
Mikhail Zarechenskiy
1b5d28114c Remove "experimental" suffix from IDE settings for NI 2019-06-17 17:13:35 +03:00
Ilya Gorbunov
c193992241 Docs: mark all experimental annotations as MustBeDocumented
So that they are shown in the docs of annotated experimental API

(cherry picked from commit a1979677d0)
2019-06-17 04:29:11 +03:00
Ilya Gorbunov
4763c601d9 Docs: suppress docs for newly introduced hidden API
(cherry picked from commit a55563f5ec)
2019-06-17 04:29:10 +03:00
LepilkinaElena
3b3950a541 Update Kotlin/Native version 2019-06-16 13:18:44 +03:00
Nikolay Krasko
6d1c0368b0 Explicitly call virtual method to be compatible with 192 branch 2019-06-15 16:32:16 +03:00
Roman Artemev
c4000a04fb [IR] Support IrLocalDelegatedPropertyReference in klib
(cherry picked from commit 6d2ad63db3)
2019-06-15 00:14:16 +03:00
Alexander Gorshenev
6ad7310df4 Added a test for members of EnumEntry in a library. 2019-06-14 18:56:07 +03:00
Alexander Gorshenev
591ff72d0d Don't serialize descriptor references for EnumEntry members 2019-06-14 18:56:03 +03:00
Kevin Peek
019ce0e430 Add links to Scope Functions docs (PR #2407)
Add links to Scope Functions docs on kotlinlang.org to 'with', 'run', 'let', 'apply', and 'also' extension function docs

(cherry picked from commit 4c91ba90bb)
2019-06-14 17:53:57 +03:00
Andrey Uskov
35ca653558 Fix compatibility with IDEA after unlinking external api from java
#KT-31952 Fixed
2019-06-13 17:40:01 +03:00
Mikhail Zarechenskiy
158514537e [NI] Propagate non-null info on supertypes for capturing from bounds
#KT-31941 Fixed
2019-06-13 14:55:03 +03:00
Sergey Rostov
7a82f522a8 Gradle, tests runner, output stream handler: don't treat flush as new line
#KT-31931 Fixed
2019-06-12 17:00:47 +03:00
nikita.movshin
d989545bdb Update changelog for 1.3.40 eap 3 2019-06-11 20:55:10 +03:00
Sergey Rostov
e74748ed44 Gradle, tests runner: don't use separate thread to parse process output
Or --scan will fail (see KT-31891 for more details).
To do it in same thread we should parse output on output stream calls.
TCServiceMessageOutputStreamHandler will do that.

Also, all new lines now preserved, so TCServiceMessagesClient should
ignore new lines after messages. New ignoreLineEndingAfterMessage setting
will do that.

#KT-31891 Fixed

(cherry picked from commit d0e3ab1beb)
2019-06-11 16:30:00 +03:00
Elena Lepilkina
14c1d20f13 New version of Kotlin/Native EAP 2019-06-10 13:52:46 +03:00
Sergey Rostov
7b8d14718a IDE, wizards, .kts, Kotlin/JS for Node.js: fix DSL
#KT-31895 Fixed

(cherry picked from commit e37c86b85f)
2019-06-10 11:19:10 +03:00
Sergey Rostov
9425c52fa2 IDE, wizards, kotlin jvm server / js client: fix jvmJar configuration
There should be `from(new File(jsBrowserWebpack.entry.name, jsBrowserWebpack.outputPath))`
instead of `from(jsBrowserWebpack.outputPath)in jvmJar task configuration`.

`jsBrowserWebpack.outputPath` may be (and will) inside the same dir as
jvmJar. So jvmJar build hangs.
2019-06-09 14:31:13 +03:00
ilgonmic
b4c68307cb KT-31645 Fix yarn downloading on Windows
(cherry picked from commit 16200181cc)
2019-06-09 10:10:00 +03:00
Sergey Rostov
1bcd7cc522 IDE, wizards: update Kotlin/JS support in jvm server / js client
Configure js browser sub target to use new test and application runners.
Rework js linking and packaging:
- get rid of required.js
- use builtin jsBrowserWebpack task, embed js bundle into jvm jar, remove gradle boilerplate
- ktor server: serve js bundle resource, remove boilerplate

#KT-31695 Fixed
#KT-31099 Fixed
2019-06-08 20:59:28 +03:00
Sergey Rostov
1cc977dc77 IDE, wizards: update Kotlin/JS support in mpp lib wizard
Configure js sub targets to use new test and application runners.

#KT-31695
#KT-31099
2019-06-08 20:59:27 +03:00
Sergey Rostov
7fb8f4aa49 IDE, wizards: update Gradle Kotlin/JS support
Split Kotlin/JS configuration for browser and nodejs.
Add corresponding Kotlin/JS sub targets DSL calling.
2019-06-08 20:59:27 +03:00
Sergey Rostov
01049af2c3 Gradle, JS, webpack: add dependency to compile classpath 2019-06-08 20:59:27 +03:00
Sergey Rostov
e35765e742 Gradle, JS, run: don't add dependency from project run task
As js webpack-dev-server will not finish
2019-06-08 20:59:26 +03:00
Sergey Rostov
3beb4071f9 Gradle, js: rename objects to avoid clashing with moowork nodejs plugin
#KT-31834 Fixed
2019-06-08 20:59:26 +03:00
Sergey Rostov
006ab77c43 Gradle, js, karma: useConfigDirectory DSL
#KT-31686 Fixed
2019-06-08 20:59:26 +03:00
Sergey Rostov
c0f92e99d2 Gradle, js, karma: don't run karma if no browsers configured
#KT-31662 Fixed
2019-06-08 20:59:26 +03:00
Sergey Rostov
6dcadb9352 Gradle, js, karma: use ^4.0.0-rc.6 to use webpack 3, require webpack
#KT-31564 Fixed
2019-06-08 20:59:26 +03:00
Sergey Rostov
ccfe1f1814 Gradle, js, npm simple linker: fix creating junction on windows 2019-06-08 20:59:26 +03:00
Sergey Rostov
b200fc9f32 Gradle, js, tests: use compilation runtime classpath as input
#KT-31814 Fixed
2019-06-08 20:59:25 +03:00
Sergey Rostov
a8ac0fa08e Gradle, js, npm: fix resolving transitive npm dependencies using yarn.lock
- already visited transitive npm dependencies should be stored in parent dependencies
- child NpmDependency should search resolved project data in parent NpmDependencies
2019-06-08 20:56:56 +03:00
Sergey Rostov
4d38007083 Gradle, js, npm: fix idea gradle sync for multiproject builds
npm resolver ProjectData stored per project (not in root project)
2019-06-08 20:56:55 +03:00
Sergey Rostov
6f570ab807 Gradle, js, npm: fix reading package.json files
#KT-31788 Fixed
2019-06-08 20:56:54 +03:00
Sergey Rostov
2e03335851 Gradle, js, npm: fix npm aggregated configuration attributes
#KT-31788 Fixed
2019-06-08 20:56:54 +03:00
Sergey Rostov
cc14ceff18 Gradle: provide descriptions for JS tasks
#KT-31560 Fixed
2019-06-08 20:56:53 +03:00
Sergey Rostov
0c3fe83572 Gradle, NPM, windows: creating symlink without administrator privilege
#KT-31694 Fixed
2019-06-08 20:56:53 +03:00
Sergey Rostov
cc5d7da488 Gradle, js, npm: resolve and warn about clashes in packages_imported
#KT-31697 Fixed
2019-06-08 20:56:52 +03:00
Sergey Rostov
4102feabba Gradle, npm: implement semver comparision 2019-06-08 20:56:51 +03:00
Sergey Rostov
fb604b2eb9 Gradle, npm: extract semver utils to separate file 2019-06-08 20:56:51 +03:00
Sergey Rostov
dcd23be673 Gradle, npm, imported packages: import multiple version to different dirs 2019-06-08 20:56:50 +03:00
Sergey Rostov
4f7ae070e6 Gradle, ProcessedFilesCache: delete everything on version change 2019-06-08 20:56:50 +03:00
Sergey Rostov
6ec4e9d083 Gradle, ProcessedFilesCache: report target values clash 2019-06-08 20:56:49 +03:00
Sergey Rostov
13e04590ca Gradle, JS, NpmResolver: save imported packages cache state before calling npm 2019-06-08 20:56:48 +03:00
Sergey Rostov
d494639837 Gradle, js, NPM: select one version between tools and all of compile configurations
#KT-31696 Fixed
2019-06-08 20:56:48 +03:00
Sergey Rostov
d5344bd926 Gradle, minor: remove unused import 2019-06-08 20:56:47 +03:00
Ilya Chernikov
f37568ae1d Fix script compiler options processing 2019-06-07 22:34:37 +02:00
Mikhail Zarechenskiy
3e788049d3 [NI] Introduce flag to change constraint system for overload resolution
This commit doesn't change behaviour of any inference algorithm, it
 introduces opportunity to switch constraint system that is used for
 overload resolution and fix problematic cases by changing one enum
 entry.

 Due to fundamental changes, there are cases where a new inference
 algorithm reports overload resolution ambiguity errors (#KT-31670,
 #KT-31758), which is correct from its point of view. However, this is
 a breaking change and to really make it, we should be very confident
 and have enough motivation for it, therefore, we don't change behavior
 now in order to collect more examples (if there are any). And if we
 find a lot of erroneous examples, we'll be able to change the behavior
 quite simply
2019-06-07 22:36:21 +03:00
Mikhail Zarechenskiy
f9edee22af [NI] Move creation of constraint system under callbacks
This will be needed in the next commit to have access to constraint
 system that is used for old inference
2019-06-07 22:36:19 +03:00
Alexey Tsvetkov
25a14f0476 Add experimental support for bytecode instrumentation with JPS
#KT-13563 Fixed
2019-06-07 21:09:45 +03:00
Mikhail Zarechenskiy
184f01e9ea [NI] Consider explicitly specified type argument as an input type
#KT-31860 Fixed
2019-06-07 17:20:36 +03:00
Mikhail Zarechenskiy
79798cb78d Revert "[NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI"
This reverts commit 8285c9984d.
2019-06-07 17:20:36 +03:00
Mikhail Zarechenskiy
f73daac07d Fix exception on attempt to map inner non-fixed type variable
#KT-31842 Fixed
2019-06-07 17:20:35 +03:00
Alexander Podkhalyuzin
5eff6d412c Do not expect that KDoc reference contains importable fqName
#KT-31768 Fixed

(cherry picked from commit ea86ebf995)
2019-06-07 17:15:06 +03:00
Andrey Uskov
f8b1c67422 Fix memory leak on project reimport
#KT-31843 Fixed

(cherry picked from commit 5efd55f530)
2019-06-07 16:59:46 +03:00
Andrey Uskov
c07482f932 Fix disabling delegated build in gradle projects for IDEA 192 2019-06-07 16:58:41 +03:00
Alexander Udalov
0fed75de04 Minor, add kdoc for typeOf
(cherry picked from commit fec9ee6408)
2019-06-07 13:24:46 +02:00
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
Ilya Gorbunov
62ffacab09 Raise deprecation level for jsClass functions
Suppress error in tests

#KT-21703
2018-09-11 18:15:04 +03:00
Ilya Gorbunov
35f42c7d35 Raise deprecation level for kotlin.Synchronized and Volatile, remove replacements
They are js-only but not supposed to be used in Kotlin/JS code, so their
usages should be just removed.

#KT-21703
2018-09-11 18:15:03 +03:00
Ilya Gorbunov
010b36be1f Raise deprecation level for kotlin.js.Math functions
#KT-21703
2018-09-11 18:15:03 +03:00
Ilya Gorbunov
fbd2322ffa Add replacement information for deprecated JQuery members
#KT-21703
2018-09-11 18:15:03 +03:00
Ilya Gorbunov
c3f654a71c Stdlib/JS: drop deprecated CharSequence.size
#KT-21703
2018-09-11 18:15:03 +03:00
Ilya Gorbunov
f1c3d8b860 Raise deprecation level for kotlin.test collection assertions
#KT-21703
2018-09-11 18:15:03 +03:00
Ilya Gorbunov
ad76edd7b7 Raise deprecation level for org.junit.Test in stdlib for common and JS
#KT-21703
2018-09-11 18:15:03 +03:00
Ilya Gorbunov
1a8b258d86 Raise deprecation level for map delegation accessor according to #KT-18789
#KT-21703
2018-09-11 18:15:03 +03:00
victor.petukhov
8f209fa667 Add documentation to contracts stdlib code 2018-09-11 18:03:38 +03:00
victor.petukhov
63698380e1 Add contract samples for stdlib 2018-09-11 18:03:09 +03:00
Ilmir Usmanov
8ec49adcf0 Minor. Ignore test 2018-09-11 17:50:46 +03:00
Leonid Startsev
fa990174ef Rename kotlinx-serialization => kotlin-serialization
Discussed with @elizarov and @ilya-g
2018-09-11 17:31:38 +03:00
Sergey Igushkin
099ad8de1e Don't set Kotlin platform attribute for the default configuration
Also, fix empty configurations created for targets that have no runtime
outputs (metadata ones, especially), which could get chosen by Gradle
during dependency variant-aware resolution of a `project(...)`
dependency.

See also: d13ca38

With the attribute set, an input configuration that does not require the
Gradle's USAGE attribute but requires Kotlin platform metadata, will
fail to resolve because the attributes set on the consumable
output configurations are not subsets of each other, as follows:

> Cannot choose between the following variants of project :lib:
  - metadataApiElements
  - metadataDefault
  - metadataRuntimeElements
  All of them match the consumer attributes:
    - Variant 'metadataApiElements':
      - Found org.gradle.usage 'java-api' but wasn't required.
      - Required org.jetbrains.kotlin.platform.type 'common' and found
        compatible value 'common'.
    - Variant 'metadataDefault':
      - Required org.jetbrains.kotlin.platform.type 'common' and found
        compatible value 'common'.
    - Variant 'metadataRuntimeElements':
      - Found org.gradle.usage 'java-runtime-jars' but wasn't required.
      - Required org.jetbrains.kotlin.platform.type 'common' and found
        compatible value 'common'.

Issue #KT-26383 Fixed
2018-09-11 17:22:36 +03:00
Mikhail Zarechenskiy
908be10bf4 Write version requirement on inline classes and relevant declarations
#KT-26720 Fixed
2018-09-11 17:13:44 +03:00
Ilya Gorbunov
1eda3805ec Introduce overloads to check for T? element contained in iterable range in a constant time
#KT-18483
2018-09-11 17:06:42 +03:00
Yan Zhulanow
64e85e8a0c Support new $this_<label> field naming convention in debugger 2018-09-11 16:41:21 +03:00
Yan Zhulanow
50858b6fa3 Kapt, minor: Add a test for inline classes (KT-25800) 2018-09-11 16:41:21 +03:00
Yan Zhulanow
2219f0956e Minor: Change the output for KT-19628 tests to the temporary directory path 2018-09-11 16:41:20 +03:00
Yan Zhulanow
d16b55033e Introduce new naming convention for captured receiver backing fields
'receiver$0' -> '$this_<label>'
2018-09-11 16:41:20 +03:00
Yan Zhulanow
11d4a6bf5c Refactoring: Rename closure methods in CalculatedClosure, add a method for getting receiver labels 2018-09-11 16:40:44 +03:00
Yan Zhulanow
6f7741b6bb Minor: Move AbstractParcelBytecodeListingTest to compiler tests, change its format a bit 2018-09-11 16:40:43 +03:00
Yan Zhulanow
c6b5e8c40f Minor: Extract code for checking Dalvik identifiers to frontend 2018-09-11 16:40:43 +03:00
Yan Zhulanow
5fed77d87a MPP: Add missing platform kind extensions to AS 3.3 bunch file 2018-09-11 16:40:43 +03:00
Yan Zhulanow
72637268c6 Minor, tests: Move EXPECTED_ERROR directives to the file end (to preserve stable line numbers) 2018-09-11 16:40:42 +03:00
Yan Zhulanow
c517b85de1 Kapt: Support also erroneous super interface names 2018-09-11 16:40:42 +03:00
Martin Petrov
dfff00d55f KT-26540: Support generated superclasses in KAPT
https://youtrack.jetbrains.net/issue/KT-26540

Included an integration test that relies on a generated superclass.
2018-09-11 16:40:42 +03:00
Sergey Igushkin
f147b8d2b2 Change classes task naming and create additional task for IDE runner
Issue #KT-26641 Fixed
2018-09-11 16:24:59 +03:00
Ilya Matveev
29048ce5ae Add generated interop libraries in compile dependency configuration (#1864) 2018-09-11 16:07:33 +03:00
Ilya Chernikov
712e23f8b0 Document scripting common API, drop unused bits 2018-09-11 14:56:53 +02:00
Ilya Chernikov
a02d5b4b21 Rename script annotation params according to configuration keys...
rename evaluation params consistently too
2018-09-11 14:56:51 +02:00
Mikhail Glukhikh
136428c7b4 If-then to safe access/elvis: fix mistake in shouldBeTransformed
This should fix two inspection tests (implicit receiver case)
Before this commit, check of 'this' on null was accidentally
not highlighted by if-then to safe access or elvis. Now it is.
2018-09-11 15:34:58 +03:00
Anton Bannykh
65f98a285a JS: fix test by using release coroutines 2018-09-11 15:29:48 +03:00
Alexey Sedunov
6b3184e634 MPP: Fix test data after disabling import of 'metadata' compilations 2018-09-11 15:01:23 +03:00
Leonid Startsev
585d584857 Minor: get rid of some compiler warnings in kotlin-serialization-compiler-plugin 2018-09-11 14:36:10 +03:00
Roman Artemev
d0ce5d5a4d Fix test data 2018-09-11 14:29:47 +03:00
Roman Artemev
cc995bf1d5 Remove workaround for COROUTINE_SUSPENDED property 2018-09-11 14:29:47 +03:00
Roman Artemev
3dbc5ddb05 [KT-25003] Fix accessing property COROUTINE_SUSPENDED from stdlib coroutine 2018-09-11 14:29:47 +03:00
shiraji
fd3fe52eb4 Fix the problem with code completion of type extension method
KT-23834 Fixed
2018-09-11 14:24:45 +03:00
Svyatoslav Kuzmich
9ff8c93529 [JS BE] Fix KT-26706: incorrect Long value in string templates 2018-09-11 14:13:00 +03:00
Leonid Startsev
7011e9422d Rename kotlinx-gradle-serialization-plugin => kotlinx-serialization 2018-09-11 13:22:17 +03:00
Leonid Startsev
23fd0a6ec9 Split IDE part from kotlinx-serialization-compiler-plugin 2018-09-11 13:22:16 +03:00
Dmitriy Dolovov
9ca0643b1a K/N: Added comments regarding synthetic forward declarations module 2018-09-11 12:48:31 +03:00
Dmitriy Dolovov
fbd220fc05 K/N: Actualize KonanBuiltIns 2018-09-11 12:48:31 +03:00
Dmitriy Dolovov
324ec7aff8 Detect K/N library kind if library is a ZIP file (native-specific part)
Issue #KT-26730 Fixed
2018-09-11 12:48:31 +03:00
Dmitriy Dolovov
0d0929922a Detect K/N library kind if library is a ZIP file (common part)
Issue #KT-26730
2018-09-11 12:48:31 +03:00
Dmitriy Dolovov
8a79255176 K/N: Drop unused class 2018-09-11 12:48:31 +03:00
Mikhail Zarechenskiy
66a00f442c Add tests for obsolete issues
#KT-12008 Obsolete
 #KT-11881 Obsolete
 #KT-10822 Obsolete
2018-09-11 12:34:09 +03:00
Dmitry Petrov
58442899b8 Postpone NoConstantValueAttributeForNonConstVals till 1.4
Requires special inspection for migrating Java code.
2018-09-11 11:27:33 +03:00
Mikhail Zarechenskiy
106ecadd62 Allow using kotlin.Result as a return type in stdlib 2018-09-11 10:39:27 +03:00
Mikhail Zarechenskiy
7b70c1a2d9 Allow kotlin.Result only for declarations that are effectively fields 2018-09-11 10:39:25 +03:00
Mikhail Zarechenskiy
e6f936e689 Update test data about mod from builtIns
After 7595cb23ab
2018-09-11 10:39:24 +03:00
Mikhail Zarechenskiy
ccfcea85ec Minor: get MAX_VALUE directly from unsigned types 2018-09-11 10:39:22 +03:00
Mikhail Zarechenskiy
2a04df531a Fix exception: don't try to map value of error type
#EA-127029 Fixed
2018-09-11 10:39:20 +03:00
Mikhail Zarechenskiy
862aa8d1aa Fix exception: don't try to get value of error constant
#EA-126623 Fixed
2018-09-11 10:39:19 +03:00
Mikhail Zarechenskiy
e5ee142208 Prohibit @JvmField on properties of inline class types
#KT-26454 Fixed
2018-09-11 10:39:17 +03:00
Mikhail Zarechenskiy
55ef96e5c9 Prohibit @JvmName on functions that are assumed to be mangled
#KT-26454 In Progress
2018-09-11 10:39:16 +03:00
Mikhail Zarechenskiy
5f50977974 Refactoring: extract mangling utils that related to resolve out 2018-09-11 10:39:14 +03:00
Mikhail Zarechenskiy
26ca411423 Minor: use common constant for kotlin.Result 2018-09-11 10:39:13 +03:00
Mikhail Zarechenskiy
169599abcc Add flag to allow using kotlin.Result as a return type
#KT-26659 Fixed
2018-09-11 10:39:11 +03:00
Mikhail Zarechenskiy
864e21dd1b Prohibit expressions of Result type as left operands of ?./!!/?:
#KT-26659 In Progress
2018-09-11 10:24:50 +03:00
Mikhail Zarechenskiy
b1cd49dd7b Prohibit using kotlin.Result as a return type in most cases
#KT-26659 In Progress
2018-09-11 10:24:48 +03:00
Ilya Gorbunov
48add96e79 Deprecate mixed Int/FP contains operator for ranges
#KT-22423
2018-09-11 05:40:15 +03:00
Ilya Gorbunov
68c5c0f639 Introduce ConcurrentModificationException typealias in stdlib/jvm
This is required to provide the corresponding expect exception in stdlib/common.
Raise deprecation level for constructors declared in common but unsupported in JVM.

#KT-26598
2018-09-11 04:59:56 +03:00
Ilya Gorbunov
afb62ffc0c Update testData for incremental compilation tests
- enumMemberChanged, flagsAndMemberInSameClassChanged: added top level function results in a file class being generated
- companionObjectNameChanged: one more file is marked as dirty after the changes in build 1.2.70-dev-1439
2018-09-11 04:19:49 +03:00
Ilya Matveev
3269c0e51b Support cinterop in the native part of kotlin-multiplatform 2018-09-10 20:43:00 +03:00
Ilya Matveev
f7949a2131 Use 'teamcity.version' property to detect CI in K/N tests 2018-09-10 20:40:59 +03:00
Ilya Matveev
0ac701d8bf Provide getters for names of native link tasks 2018-09-10 20:40:59 +03:00
Ilya Matveev
f1de88ebbc Use teamcity test logger if the project has a corresponding property 2018-09-10 20:40:59 +03:00
Ilya Matveev
cbb1b9fae5 Provide a basic DSL for liking task accessing 2018-09-10 20:40:59 +03:00
Ilya Matveev
f5eecdd547 Support custom entry points for native binaries 2018-09-10 20:40:59 +03:00
Ilya Matveev
76074f9543 Support language settings from source sets for native 2018-09-10 20:40:59 +03:00
Ilya Matveev
14e4f219da Support compiler plugins in native part of the mpp plugin 2018-09-10 20:40:59 +03:00
Ilya Matveev
41367b0285 Create test tasks for all native hosts + tests
#KT-26547 fixed
2018-09-10 20:40:59 +03:00
Ilya Matveev
03e1e8d19d Support friend modules in native mpp 2018-09-10 20:40:59 +03:00
Ilya Matveev
595a7700df Use FQ names for Kotlin/Native project properties 2018-09-10 20:40:59 +03:00
Nikolay Krasko
462000ae19 Fix code style applier (KT-23400)
- Stop removing defined schemes and clone settings before modification
- Clone code styles before modification
- Don't bother users that already have needed code style with settings change
2018-09-10 19:07:36 +03:00
Dmitriy Dolovov
194d94071a K/N: Create target-neutral K/N libraries 2018-09-10 17:54:08 +03:00
Dmitriy Dolovov
314173af60 Disable specific EPs for K/N plugin for CLion/AppCode #KT-26717 2018-09-10 17:54:07 +03:00
Dmitriy Dolovov
71be94b3e4 K/N: Cache library metadata in IDEA plugin 2018-09-10 17:54:06 +03:00
Simon Ogorodnik
1df91ff7ec Refactor NativeAnalyzerFacade to reuse existing library dependency model
Fix memory blowing up in quadratic native stdlib dependencies
Reuse ModuleInfo & LibraryInfo for Native properly
2018-09-10 17:54:06 +03:00
Nikolay Krasko
69aa6d399e Forgotten utility for getting Kotlin code style defaults 2018-09-10 17:49:39 +03:00
Dmitry Petrov
e3fa785678 Minor: drop irrelevant test case
Hiding constructors with inline class type parameters
is tested by bytecodeListing tests
2018-09-10 17:45:05 +03:00
Dmitry Petrov
eb940ec58d Fix inline class tests
Use original descriptor when determining if a synthetic accessor should
be used for a possibly hidden ("mangled") constructor call.
2018-09-10 17:33:34 +03:00
Alexey Sedunov
6206f1e419 MPP: Implement isTestModule flag (as required by JPS) 2018-09-10 17:27:41 +03:00
Alexey Sedunov
befb6d19d1 MPP: Use all transitively reachable modules as compilation source sets
#KT-26254 Fixed
2018-09-10 17:27:41 +03:00
Alexey Sedunov
ff105cb059 MPP: Force COMMON platform for commonMain/commonTest source sets
Also set isTestModule flag for them according to source set name alone

 #KT-26356 Fixed
2018-09-10 17:27:40 +03:00
Alexey Sedunov
ad4a3c0b7c MPP: Do not import compilations with 'metadata' target
#KT-26634 Fixed
2018-09-10 17:27:40 +03:00
Alexey Sedunov
358b7ca1d1 MPP: Import library dependencies of transitive dependee source sets
#KT-26369 Fixed
2018-09-10 17:27:40 +03:00
Alexey Sedunov
dbd18ca27b MPP: Do not show -Xmultiplatform flag in facet settings
#KT-26484 Fixed
2018-09-10 17:27:40 +03:00
Svyatoslav Scherbina
5c6193ddf3 Use proper origin for fake override fields in IR 2018-09-10 17:00:58 +03:00
Svyatoslav Scherbina
dc71e5b934 Prevent external IR field stub from being bound twice 2018-09-10 17:00:57 +03:00
Denis Zharkov
3d72831966 Mark idea-native module as 'jps-compatible' 2018-09-10 16:59:29 +03:00
Alexander Podkhalyuzin
0a5e782901 Removed @author tag 2018-09-10 14:51:01 +03:00
Mikhail Glukhikh
0169719a87 Add native dependencies to uast-kotlin module tests 2018-09-10 14:33:36 +03:00
Alexander Podkhalyuzin
baa0f2dc1b Override completion in expect class should behave differently
Caret placement is at the end of new fun/property

#KT-25313 Fixed
2018-09-10 14:23:48 +03:00
Anton Bannykh
d571d0ad51 JS: prohibit using experimental coroutines from 1.3 2018-09-10 14:18:44 +03:00
Alexander Udalov
c4be039cd1 Support argfiles in CLI with "@argfile"
#KT-24613 Fixed
2018-09-10 14:12:32 +03:00
Alexander Udalov
e996513044 Support single quotation marks in argfiles
#KT-26122 Fixed
2018-09-10 14:12:31 +03:00
Alexander Udalov
9311ea5d25 Support progressive mode via "-progressive"
#KT-25862 Fixed
2018-09-10 14:12:31 +03:00
Alexander Udalov
7474f1dc56 Minor, refactor KotlinMetadataVersionIndexBase.createBinaryVersion
Make it a protected method instead of a property passed in the
constructor
2018-09-10 14:12:18 +03:00
Alexander Udalov
1d5d6b5b72 Support strict metadata version semantics
Preface: Kotlin 1.3 will be able to read metadata of .class files
produced by Kotlin 1.4 (see KT-25972). Also, to simplify implementation
and to improve diagnostic messages, we're going to advance JVM metadata
version to 1.4.0 in Kotlin 1.4, and would like to keep it in sync with
the compiler version thereafter. This presents a problem: in an unlikely
event that before releasing 1.4, we find out that the metadata-reading
implementation in 1.3 was incorrect, we'd like to be able to fix the bug
in that implementation and _forbid_ 1.3 from reading metadata of 1.4.
But prior to this commit the only way to do this was to advance the
metadata version, in this case to 1.5, and that breaks the
metadata/compiler version equivalence we'd like to keep.

The solution is to add another boolean flag to the class file, called
"strict metadata version semantics", which signifies that if this class
file has metadata version 1.X, then it can only be read by the compilers
of versions 1.X and greater. This flag effectively disables the smooth
migration scenario proposed in KT-25972 (as does increasing metadata
version by 2), and will be used only in hopeless situations as in the
case described above.
2018-09-10 14:12:18 +03:00
Alexander Udalov
8c942752e8 Write flags to .kotlin_module files since metadata version 1.4
This value will be used for flags like pre-release (KT-21256) and other
similar info
2018-09-10 14:12:17 +03:00
Dmitry Petrov
b8eb804774 KT-26531 is fixed in NewInference mode 2018-09-10 14:10:05 +03:00
Alexander Podkhalyuzin
8e9945bc9e Fixed deprecated IDEA API
#KT-24907 Fixed
2018-09-10 13:28:11 +03:00
Alexander Podkhalyuzin
720587abf3 Added DynamicallyLoaded annotation to AndroidDexWrapper
#KT-25449 Fixed
2018-09-10 13:26:12 +03:00
Nikolay Krasko
f679b3f6dd Import Kotlin code style from Maven properties (KT-23400) 2018-09-10 13:03:41 +03:00
Nikolay Krasko
1820028086 Refactoring: extract method for applying codestyle from string (KT-23400) 2018-09-10 13:03:41 +03:00
Nikolay Krasko
a5e8508e5a Write official code style to maven archetypes (KT-23400) 2018-09-10 13:03:41 +03:00
Ilya Chernikov
ba702a7eec [minor] remove redundant null check 2018-09-10 11:21:29 +02:00
Ilya Chernikov
01dd665441 Simple test for non-kts script compilation 2018-09-10 11:21:27 +02:00
Ilya Chernikov
3f2552af60 Export filename extension from KotlinScriptDefinition, register...
extensions after loading definitions
2018-09-10 11:21:26 +02:00
Dmitriy Dolovov
5183eba70b Fix K/N module compilation in MPP project imported from Gradle #KT-26688 2018-09-10 11:17:42 +03:00
Dmitry Petrov
4c7972a9e8 Fix KT-25853 IDEA hangs when Kotlin bytecode tool window open...
KotlinTypeMapper.findFirstDelegatingSuperCall can loop forever if the
code is invalid. Bail out.
2018-09-10 10:58:33 +03:00
Dmitry Petrov
bbbca9fbbf Minor: mute inline classes tests in JVM_IR 2018-09-10 10:42:18 +03:00
Ilya Gorbunov
903976d9af Replace hashCode usages in tests where it was supposed to fail on nullable receiver
Related to #KT-25039
2018-09-10 06:41:49 +03:00
Ilya Gorbunov
48fd8a63ee Introduce Any?.hashCode() extension #KT-25039 2018-09-10 06:41:49 +03:00
Mikhail Zarechenskiy
3431123cab Fixes for tests about mod
#KT-25217
2018-09-10 06:31:55 +03:00
Mikhail Zarechenskiy
dee3617dd8 Refine deprecation diagnostics for mod depending on api version
#KT-25217 Fixed
 #KT-26654 Open
2018-09-09 23:55:38 +03:00
Mikhail Zarechenskiy
7595cb23ab Raise deprecation level for mod operators to ERROR in stdlib
#KT-25217 In Progress
2018-09-09 23:55:36 +03:00
Roman Elizarov
b12e0aab2f Remove contract from Result.xxxCatching functions
Fixes KT-26523
2018-09-09 11:36:47 +03:00
Roman Elizarov
2406bf0536 Restore SuccessOrFailure.kt to bootstrap (to be removed later) 2018-09-09 11:34:49 +03:00
Roman Elizarov
e2713501ce Rename SuccessOrFailure to Result and hide Failure from ABI
* The members of Result are isSuccess, isFailure, exceptionOrNull, getOrNull
* The rest of API is implemented via inline-only extensions
* There are two internal functions to hide detailed mechanics of an internal
  Result.Failure class: createFailure and throwOnFailure
* Result.toString is explicit: either Success(v) or Failure(x)

See KT-26538
2018-09-09 11:34:31 +03:00
Zalim Bashorov
69ee88871f Don't print stack trace for ignored tests by default 2018-09-08 13:37:30 +03:00
Zalim Bashorov
bd6f3fd9b2 Minor: remove the no longer used variable in BasicIrBoxTest.kt 2018-09-08 13:37:30 +03:00
Zalim Bashorov
ae801c4b45 [JS IR BE] (quick fix) define coroutine related *H.kt files earlier to fix overriding actual implementations by empty expected versions 2018-09-08 13:37:30 +03:00
Mikhail Glukhikh
78131d2e65 Add native dependencies to idea-gradle module tests 2018-09-08 12:16:27 +03:00
Mikhail Glukhikh
bf23dac7ff Add native dependencies to idea-maven module tests 2018-09-08 12:16:27 +03:00
Mikhail Glukhikh
9887db1f9b Add native dependencies to ultimate module tests 2018-09-08 12:16:26 +03:00
Mikhail Glukhikh
1fd4be580a Add native dependencies to idea-android module tests 2018-09-08 12:16:26 +03:00
Mikhail Glukhikh
f909761974 Add native dependencies to android-extensions-idea module tests 2018-09-08 12:16:26 +03:00
Mikhail Glukhikh
c2da0bf797 Add native dependencies to J2K module tests 2018-09-08 12:16:26 +03:00
Mikhail Glukhikh
f514424324 Revert non-convention KotlinNativeCompile task in import 173 / AS31
'Property' is not supported for these IDEA / AS versions
2018-09-08 12:16:25 +03:00
Simon Ogorodnik
6e93bccad4 Fix test dependencies of idea module after introducing native 2018-09-08 12:16:25 +03:00
Dmitriy Dolovov
22e6948d7d K/N: add fake compiler arguments (only to be used in IDEA plugin) 2018-09-08 12:16:25 +03:00
Dmitriy Dolovov
f663c0ea87 Rename "Konan" -> "KotlinNative" in class and function names (part 3) 2018-09-08 12:16:25 +03:00
Dmitriy Dolovov
cb7009ace8 K/N: Rename "kotlin-native-serializer" to "kotlin-native-library-reader" 2018-09-08 12:16:24 +03:00
Dmitriy Dolovov
6701dbb220 K/N: Clean-up unused K/N stuff 2018-09-08 12:16:24 +03:00
Dmitriy Dolovov
88638ef655 K/N: Clean-up logic for import of K/N projects from Gradle 2018-09-08 12:16:23 +03:00
Dmitriy Dolovov
dd203830a8 K/N: Refactor KotlinNativePluginSearchPathResolver
Get rid of dependency on KonanPaths project component
2018-09-08 12:16:23 +03:00
Dmitriy Dolovov
b157e9d5a1 Rename "Konan" -> "KotlinNative" in class and function names (part 2) 2018-09-08 12:16:23 +03:00
Dmitriy Dolovov
07a1d683ed MPP: Better detection of KLIB library kind 2018-09-08 12:16:23 +03:00
Dmitriy Dolovov
9b92d38917 K/N: Move classes and functions we don't want to expose
These classes we don't want to expose to Gradle DSL users
from "kotlin-native-utils" to "kotlin-native-serializer" module.
Reason: "kotlin-gradle-plugin-api" depends on "kotlin-native-utils",
while "kotlin-native-serializer" is used only inside of IDEA plugin.
2018-09-08 12:16:22 +03:00
Mikhail Glukhikh
a4daf9f1ff More precise libraryMap in createResolvedModuleDescriptors 2018-09-08 12:16:22 +03:00
Dmitriy Dolovov
2ff538fc87 K/N: Correct creation of module descriptors for K/N module 2018-09-08 12:16:22 +03:00
Dmitriy Dolovov
fbeff9245e More correct detection of Kotlin/Native stdlib by open IDEA projects 2018-09-08 12:16:21 +03:00
Alexander Gorshenev
e8f238d53c Make sure zip filesystems are closed on exit 2018-09-08 12:16:21 +03:00
Dmitriy Dolovov
46a697db82 Rename "Konan" -> "KotlinNative" in class and function names 2018-09-08 12:16:21 +03:00
Dmitriy Dolovov
337100edc3 Rename "konan" modules to "kotlin-native" modules 2018-09-08 12:16:20 +03:00
Dmitriy Dolovov
4cedbe5f39 Disable mandatory adding of KLIBs into the root IDEA module 2018-09-08 12:16:20 +03:00
Ilya Matveev
299e508204 Add libraries provided by the K/N compiler in dependencies 2018-09-08 12:16:20 +03:00
Simon Ogorodnik
c4a33e0a2f [CHECKME] Support non-convention KotlinNativeCompile task in IDEA import 2018-09-08 12:16:19 +03:00
Dmitriy Dolovov
04fca2ac0d [IDEA plugin for K/N] Source code reorganization
Move Gradle part of plugin from 'idea-gradle/native' to
'idea-gradle-native' module
2018-09-08 12:16:19 +03:00
Dmitriy Dolovov
f6c61fbe30 Remove useless TODOs 2018-09-08 12:16:19 +03:00
Dmitriy Dolovov
beb12b693f MPP: Keep original capabilities in descriptors created for all KLIBs 2018-09-08 12:16:19 +03:00
Dmitriy Dolovov
7623169130 MPP: implement IdePlatformKind, its resolution and tooling for K/N 2018-09-08 12:16:18 +03:00
Svyatoslav Scherbina
b86afb0bab Enable implicit integer coercion for Kotlin/Native interop libraries 2018-09-08 12:16:18 +03:00
Dmitriy Dolovov
2161451482 [K/N lib] Implement multiple fixes:
- source code simplifications
- more correct work with paths
- builtIns module requires dependency on itself
2018-09-08 12:16:17 +03:00
Dmitriy Dolovov
3c5c21256f [K/N lib] fix in POM dependencies for konan-serializer module 2018-09-08 12:16:17 +03:00
Ilya Matveev
d49ff1aa2c [K/N lib] Add timeout for native dependency extraction 2018-09-08 12:16:17 +03:00
Dmitriy Dolovov
db29d12c60 [K/N lib] merge metadata & serializer, publish the result to Maven 2018-09-08 12:16:17 +03:00
Dmitriy Dolovov
eda29a48a4 [K/N lib] IDEA plugin for K/N + missed items in konan-serializer module 2018-09-08 12:16:16 +03:00
Dmitriy Dolovov
51bb408c56 [K/N lib] add Kotlin/Native deserializer and library reader 2018-09-08 12:16:16 +03:00
Dmitriy Dolovov
fade311b92 [K/N lib] add Kotlin/Native metadata 2018-09-08 12:16:15 +03:00
Vyacheslav Gerasimov
114b5288b0 Set until-build for Idea 182 plugin to 182.* 2018-09-08 12:06:30 +03:00
Ilya Gorbunov
53334664c7 Advance bootstrap to 1.3.0-dev-322 2018-09-07 21:28:12 +03:00
Leonid Startsev
9aba3b6c72 Add forgotten kotlinx-maven-serialization 2018-09-07 21:17:08 +03:00
Leonid Startsev
dea69e4469 Integrate serialization plugin into big Kotlin plugin
Split import handlers into multiple files
Add empty Maven handler for Android Studio

Add testRuntime dependency on kx-serialization-plugin for all modules which require compiler
plugins in test classpath
2018-09-07 21:17:07 +03:00
Leonid Startsev
087f60389a Migrating to 1.3 preview API 2018-09-07 21:17:06 +03:00
Leonid Startsev
359a37c9c3 Fix after rebase 2018-09-07 21:17:05 +03:00
Leonid Startsev
090f7e67eb Separate module for unshaded version 2018-09-07 21:17:04 +03:00
Leonid Startsev
6770cccd61 [IR-plugin] New symbol tables 2018-09-07 21:17:04 +03:00
Leonid Startsev
566e5ce603 Updates for new API 2018-09-07 21:17:03 +03:00
Leonid Startsev
2e50e4e816 Extract naming conventions 2018-09-07 21:17:02 +03:00
Leonid Startsev
8cd5966c4a IR-plugin
[IR-plugin] Synthetic property declaration in $serializer

[IR-plugin] Saving most of simple cases

[IP-plugin] Some refactoring and start of work on load func

[IP-plugin] Loading simple case without validation

[IP-plugin] Rebase to IR types and Native-enabled

[IP-plugin] Generating .serializer() accessor in companion

[IP-plugin] Basic synthetic deserializing constructor, fixed some todos

[IR-plugin] Remove reference to SerialDescriptor.init() since K/N now has freeze-aware lazy
2018-09-07 21:17:01 +03:00
Leonid Startsev
edcac21723 Names from new runtime 2018-09-07 21:17:00 +03:00
Leonid Startsev
223733558c Use new approach to resolve compiler plugin classpaths in gradle 2018-09-07 21:16:59 +03:00
Leonid Startsev
9ad3922c7d Fix 1.2.50 compatibility
Updated version to 0.5.1

Fix resolving serializers for classes from other modules
(Kotlin/kotlinx.serialization/153)

Respect @SerialName on classes

Add support for @SerialInfo on class-level
2018-09-07 21:16:58 +03:00
Leonid Startsev
26ac6bd887 While creating descriptors, add type arguments not from serializable class definition
but from actual KSerializer implementation.
This provides better support for user-defined or external generic serializers

Fix order of resolving serializers: user-overriden should go before polymorphic and default

Don't generate additional constructor if @SerialInfo has no properties

Workaround for recursive resolve
on @Serializable(with) and @Serializer(for) pair annotations

Don't trigger the whole resolve if we need just to check that there is
an argument on the annotation; check PSI instead.

Also, return back check on serializable annotation constructor arguments
2018-09-07 21:16:57 +03:00
Leonid Startsev
572e8873ca Respect @Serializable(with) on properties on JS too.
Don't generate constructor for passing generic serializers if user already defined proper one.
2018-09-07 21:16:56 +03:00
Paul de Vrieze
365a183d01 Fix for Kotlin/kotlinx.serialization/136
Create a version that actually passes a type parameter in write$Self.
This version should take the correct type parameters from the class
rather than adding a function type parameter shared with all
serializers.
2018-09-07 21:16:56 +03:00
Leonid Startsev
114fb5790a Fix for Kotlin/kotlinx.serialization/118
Fix for Kotlin/kotlinx.serialization/123: resolve annotation parameters in-place
Fix for Kotlin/kotlinx.serialization/125
Now polymorphic serializer required by all modalities expect final
2018-09-07 21:16:55 +03:00
Leonid Startsev
97694e65aa Update version to 0.4
Optimize references in generated code. Also fixes Kotlin/kotlinx.serialization/issues/65

Fix (again) broken char boxing

Rebased on 1.2.40 and fixed broken compatibility

Fix https://github.com/Kotlin/kotlinx.serialization/issues/107 and code reformatting

(cherry picked from commit d4c307d)

Add correct type parameter information to synthetic declarations

Needed by kapt due to https://github.com/Kotlin/kotlinx.serialization/issues/76

Make correct call to sealed class constructor

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/112

Bump version

1.2.50-eap-1 compatible
2018-09-07 21:16:54 +03:00
Leonid Startsev
5e19e89dda Enhanced support for custom serializers definition
kotlin.Triple serializer

Resolving serializers for mutable collection interfaces on JS

Remove idea-related source files form maven compilation

Serialization url in plugin.xml

Removed note about JPS incompatibility

Don't use serial names in produced JS code (https://github.com/Kotlin/kotlinx.serialization/issues/43)

Generator for calling `update` functions

Fix synthetic serialinfo implementations for 2-slots vars (double and long) (https://github.com/Kotlin/kotlinx.serialization/issues/60)

Prohibit usage of nullable serializers for non-null fields (https://github.com/Kotlin/kotlinx.serialization/issues/59)

Fix incorrect `this` referencing after update to 1.2.20 compiler
2018-09-07 21:16:53 +03:00
Leonid Startsev
8c4daef969 Maven and Gradle project import handlers 2018-09-07 21:16:52 +03:00
Leonid Startsev
0f7a356af8 Extension points for synthetic function contributions
Pass real type arguments serializers to runtime lib
2018-09-07 21:16:51 +03:00
Leonid Startsev
703d715334 JPS plugin
Breaking changes in compiler plugin:

* Remove java.Serializable supertype
* Move serializer impl from companion to special inner class
* Add generic serializer fields in $serializer and serializer getter
in companion

kotlin.Pair serializer

Generating getter also for non-generic serializers

Generic serializers in JS
2018-09-07 21:16:51 +03:00
Leonid Startsev
f42767fcc2 Serialization plugin GSK build
Fixed issue when serialDesc property getter was generated, but backing field not.

Respect @Serializable(with=...) on property

Calling 3-arg readElementValue for support of custom contexts

Ability to nest context-based serializer

Migration to 1.2-Beta2

Use polymorphicSerializer prior to default

Don't use polymorphic serializers for all java classes

Docs and maven project update

Remove plugin runtime dependency on stdlib
2018-09-07 21:16:50 +03:00
Leonid Startsev
8a250b07df Default case in "load" switch-case throws exception instead of silent read ending.
Improved error descriptions, fixed issue with transient properties
without backing field (Kotlin/kotlinx.serialization#2)

Don't add serialClassDesc property if user already defined one
(Kotlin/kotlinx.serialization#10)

Bump version to 0.1.1

Fix issue with mixing serial name with real property name (Kotlin/kotlinx.serialization#13)
2018-09-07 21:16:49 +03:00
Leonid Startsev
02d0322029 Plugins renaming: kotlinx-<buildSystem>-serialization-plugin 2018-09-07 21:16:48 +03:00
Leonid Startsev
3eb10823d4 Maven serialization plugin 2018-09-07 21:16:47 +03:00
Leonid Startsev
8cacaecf90 Changed serialization gradle plugin build to gradle
Env variable for idea SDK on TeamCity
Fix kotlin_root dir relative path

Updated broken API after rebase to 1.1.50

Bintray upload setup
2018-09-07 21:16:46 +03:00
Leonid Startsev
ef11fb5857 Js synthetic generation plugin.
Fix for JS frontend resolving

Generating serialClassDesc property and save method (w/o virtual calls).

JS Serialization: Load function and synthetic constructor

User-defined serial annotations support

Reference array serialization in JS

Reference array serializer now requires KClass instance as first constructor argument

Finding enum serializer in common module for support in JS
2018-09-07 21:16:46 +03:00
Leonid Startsev
841693643a KotlinX serialization plugin applied onto latest master
IntelliJ project, ant task and maven goal for serialization plugin
Serialization IDEA plugin
2018-09-07 21:16:45 +03:00
Simon Ogorodnik
6b5dcf6ae7 Add extension point to recognize library kind 2018-09-07 20:55:30 +03:00
Dmitriy Dolovov
08a66b61c2 Create built-ins via ProjectContext instead of GlobalContext 2018-09-07 20:55:30 +03:00
Dmitriy Dolovov
d8937936a9 MPP: recognize source sets from Gradle project model (refactoring) 2018-09-07 20:55:30 +03:00
Mikhail Glukhikh
5e3fd189a4 MPP: make platformByCompilerArguments a bit safer 2018-09-07 20:55:30 +03:00
Dmitriy Dolovov
5633d86cb2 MPP: extend IdePlatformKind EP & determine it by CommonCompilerArguments 2018-09-07 20:55:29 +03:00
Mikhail Glukhikh
2e29a581f2 KotlinFacetEditorGeneralTab refactor: use chosenPlatform when possible 2018-09-07 20:55:29 +03:00
Dmitriy Dolovov
622c9bedad MPP: fix bug with displaying empty Kotlin targets in facet settings 2018-09-07 20:55:29 +03:00
Nikolay Krasko
b4163f953f Add gradle.properties file with new codestyle for new Gradle projects (KT-23400) 2018-09-07 20:15:05 +03:00
Nikolay Krasko
3831ff1d05 Apply Kotlin official code style for projects created from wizards (KT-23400)
- Kotlin templates
- New Java projects with Kotlin support
- Gradle projects with Kotlin support
- Gradle projects with Kotlin DSL
2018-09-07 20:15:05 +03:00
Nikolay Krasko
921af44cb9 Import code style if gradle.properties has kotlin.code.style option (KT-23400) 2018-09-07 20:15:04 +03:00
Nikolay Krasko
f94ff3dc26 Implement transition project code style to predefined code style (KT-23400) 2018-09-07 20:15:04 +03:00
Ilya Chernikov
fa98b0afac Implement main-kts project and test 2018-09-07 18:47:18 +02:00
Ilya Chernikov
79bad24941 Simple ivy resolver with test 2018-09-07 18:47:18 +02:00
Ilya Chernikov
d7f45253d5 Improve noDefaultJar behaviour:
- drop appropriate artifact from all configurations
- clean actions - in addition to task disabling
2018-09-07 18:47:18 +02:00
Zalim Bashorov
24dc8b33cd [JS IR BE] fix compilation of stdlib by IR BE after move coroutine related sources in stdlib 2018-09-07 19:22:35 +03:00
Mikhail Glukhikh
99a2add0e8 SimplifyCallChainFix: build new argument list more accurately
Related to KT-23691
2018-09-07 17:26:23 +03:00
Toshiaki Kameyama
1d2e18e263 SimplifyCallChainFix: Keep comments in place #KT-22552 Fixed 2018-09-07 17:26:15 +03:00
Mikhail Glukhikh
9bc874f647 replacedBaseClauseWithLet: rename & convert parameter to receiver 2018-09-07 17:24:47 +03:00
Mikhail Glukhikh
9ab8f3d7b5 Refactor clauseReplaceableBySafeCall (if-then to safe access) 2018-09-07 17:24:25 +03:00
Mikhail Glukhikh
485e098ced Handle implicit receivers more accurately in if-then to safe access
#KT-26599 Fixed
2018-09-07 17:24:19 +03:00
Mikhail Glukhikh
ccb17caf7b Code cleanup: x as? Type ?: return -> if (x !is Type) return 2018-09-07 16:32:19 +03:00
Mikhail Glukhikh
ad4da3d761 Code cleanup: convert flatMap { it } into flatten() 2018-09-07 16:32:18 +03:00
Mikhail Glukhikh
dead2516c2 Redundant override inspection: don't report for ambiguous derivation
#KT-24405 Fixed
#KT-25883 Fixed
2018-09-07 16:32:11 +03:00
Mikhail Glukhikh
607392a2ab Cleanup code: KotlinRedundantOverrideInspection 2018-09-07 16:32:08 +03:00
Alexander Podkhalyuzin
6cee310c54 Fixed 181 branch 2018-09-07 16:08:51 +03:00
Dmitry Petrov
006c0aa740 Hide constructors accepting inline class parameters 2018-09-07 15:57:59 +03:00
Mikhail Glukhikh
8a5dbe1c6b Move property to constructor: minor refactoring
Related to KT-26015
2018-09-07 14:56:19 +03:00
Toshiaki Kameyama
de6fdc5733 Move to constructor: choose property use-site target more precisely
#KT-26015 Fixed
2018-09-07 14:56:17 +03:00
Mikhail Glukhikh
29390dab42 Create actual: use analyzeWithContent to resolve annotations correctly
So #KT-26626 Fixed
2018-09-07 14:56:16 +03:00
Mikhail Glukhikh
26469b3365 Get rid of IndexNotReadyException in CreateActualFix
Related to KT-19586
2018-09-07 14:56:14 +03:00
Mikhail Glukhikh
74c5d8ed09 Create actual: do not generate default parameter values in constructor
So #KT-26517 Fixed
2018-09-07 14:56:13 +03:00
Mikhail Glukhikh
ef4053d5c3 Invalidate module source roots in create actual to fix exceptions
Related to KT-19586
2018-09-07 14:56:12 +03:00
Mikhail Glukhikh
fe9f655c26 Configure module source roots in create actual fix, if it's necessary
#KT-19586 Fixed
2018-09-07 14:56:11 +03:00
Alexander Podkhalyuzin
873463d24b Fixed deprecated IDEA API
#KT-24931 Fixed
2018-09-07 14:33:22 +03:00
Nikolay Krasko
1f1953cc38 Minor: use common trimIndent() in type hints tests 2018-09-07 12:29:06 +03:00
Nikolay Krasko
307586e435 Don't show types for enum entries with enum name is present in initializer (KT-26057)
#KT-26057 Fixed
2018-09-07 12:29:06 +03:00
Alexander Udalov
ab3f8db743 Consider property accessor non-default if it has annotations
Otherwise we're not trying to load annotations on the parameter of the
property setter in MemberDeserializer.loadProperty.

Note that after this commit, we could now also assume that if
getter/setter is default, it has no annotations, and thus use
Annotations.EMPTY for default getter/setter in loadProperty. However,
this would cause reflection to work incorrectly on classes compiled by
an older Kotlin compiler, so we'll still try to load annotations on
default accessors for an indefinite time.

 #KT-25499 Fixed
2018-09-07 11:49:42 +03:00
Alexander Udalov
06ce0cb0f0 Fix deserialization of default property accessor flags
In MemberDeserializer.loadProperty, we incorrectly passed 0 to
getAnnotations when loading annotations on property accessors in case
the protobuf field getter_flags/setter_flags was not present. The
correct behavior, as described in metadata.proto, was to pass a special
"default accessor flags" value, constructed from the main property
flags. Otherwise in case there were annotations both on the property and
on the accessor (as in PropertyAndAccessor.kt) and the accessor was
otherwise default, we would assume that it had no annotations and would
not load them in compiler and reflection

 #KT-25499 In Progress
2018-09-07 11:49:41 +03:00
Alexander Udalov
a432704c4f Fix typo in MemberDeserializer.loadProperty when loading inline setters
This could lead to inline setters of properties which have default
getters not being inlined
2018-09-07 11:29:16 +03:00
Dmitry Petrov
65ad93ebe4 Don't generate getter for private or internal inline class primary vals 2018-09-07 10:27:31 +03:00
Dmitry Petrov
8158dd0c83 Update testData for writeSignature tests 2018-09-07 10:25:59 +03:00
Dmitry Petrov
cafaa3e13c Mangle inline class members
<IMPL_SUFFIX> for method is a method signature hash,
if method value parameter types contain inline class types,
otherwise 'impl'.

Constructor methods are named as 'constructor-<IMPL_SUFFIX>'.

Synthesized 'box' and 'unbox' methods are named as
'<METHOD_NAME>-<IMPL_SUFFIX>'.

Erased implementations of overriding and non-overriding methods
are named as '<METHOD_NAME>-<IMPL_SUFFIX>'.

Fully specialized implementation of 'equals' will have a special suffix.
2018-09-07 10:25:53 +03:00
Dmitry Petrov
aec173ac5c Minor: fix tests after rebase 2018-09-07 09:32:11 +03:00
Dmitry Petrov
427295525a Minor: mute test in JVM_IR 2018-09-07 09:31:33 +03:00
Dmitry Petrov
caa49f85ad Minor: drop ERASED_INLINE_CLASS_SUFFIX 2018-09-07 09:31:33 +03:00
Dmitry Petrov
43b4190f7c Test: visibility of inline class members
Also merge in testInlineClassWrapperPrimaryConstructorIsSynthetic
and testInlineClassConstructors.
2018-09-07 09:31:33 +03:00
Dmitry Petrov
d8a6db8774 Mark synthesized box/unbox methods in inline classes as ACC_SYNTHETIC 2018-09-07 09:31:26 +03:00
Dmitry Petrov
c86ee90bec Minor: move "is box/unbox method" to InlineClassDescriptorResolver 2018-09-07 09:31:26 +03:00
Dmitry Petrov
d24b0fd3b2 Test: 'constructor' methods visibility 2018-09-07 09:31:26 +03:00
Dmitry Petrov
0bd1c4d1b7 Make inline class wrapper constructor private 2018-09-07 09:31:26 +03:00
Dmitry Petrov
c094b3a5a2 Drop erased class for inline class 2018-09-07 09:31:26 +03:00
Dmitry Petrov
4c7430e990 Test: inline class in binary dependencies 2018-09-07 09:29:55 +03:00
Dmitry Petrov
ae0d980b54 Minor: mute some inline classes tests in JS_IR 2018-09-07 09:29:55 +03:00
Ilya Gorbunov
d0923e7a32 Update EXPECTED_REACHABLE_NODES in JS tests 2018-09-07 01:28:38 +03:00
Ilya Gorbunov
700e6fc5e3 Extract carrier value from continuation result
Otherwise incorrect type gets into continuation: SuccessOrFailure<T> instead of T.
2018-09-07 01:28:32 +03:00
Ilmir Usmanov
94096bba26 Ignore version requirements of kotlin.suspend completely 2018-09-07 01:03:53 +03:00
Ilya Gorbunov
2821c357a1 Switch coroutine tests to release coroutines 2018-09-07 01:03:53 +03:00
Ilya Gorbunov
df9f77909b Make experimental COROUTINE_SUSPENDED refer to corresponding release one
Partially reverts commit 20c7a97.
Apply workaround for KT-25003 once again for the new COROUTINE_SUSPENDED
2018-09-07 01:03:53 +03:00
Ilya Gorbunov
e22ca022d4 Switch sourcesets of experimental and release coroutines
- Move experimental coroutines out of the main source root.
- Include experimental coroutines into the coroutines source set.
- Include release coroutines into the main source set.
2018-09-07 01:03:53 +03:00
Alexander Udalov
0fa2d29779 Fix test data in annotationsOnUseSiteTargets.kt
After the initial commit fc87043cb3 has been authored, master has
advanced to 1.3 where this diagnostic had slightly changed
2018-09-07 00:14:33 +03:00
Ilya Gorbunov
82d35cfa26 Change signed to unsigned widening conversions to sign-extending
e.g. `Byte.toUInt()` now returns `UInt.MAX_VALUE` for Byte value of -1 instead of 0xFFu.

#KT-26594 Fixed
2018-09-06 21:25:42 +03:00
Ilya Gorbunov
4344005fb5 Deprecate synchronized function in common stdlib #KT-26595 2018-09-06 21:15:31 +03:00
Ilmir Usmanov
cb57444e14 Forbid numbered KSuspendFunction interfaces usage as supertypes
#KT-24853 Fixed
2018-09-06 20:26:16 +03:00
Ilmir Usmanov
6f591369d8 Forbid provideDelegate, setValue and getValue suspend operators
#KT-24866 Fixed
2018-09-06 20:25:17 +03:00
Ilya Chernikov
34569071b3 [minor] rename function 2018-09-06 19:17:45 +02:00
Ilya Chernikov
ba2e08c014 Make property collection serializable (with runtime check) 2018-09-06 19:17:45 +02:00
Ilya Chernikov
ae107339fd Implement compiled script caching with tests 2018-09-06 19:17:45 +02:00
Ilya Chernikov
836ea28fe7 Renaming remaining former "environment"-related identifiers 2018-09-06 19:17:44 +02:00
Ilya Chernikov
7860220e76 Add simple jvm scripting host test 2018-09-06 19:17:44 +02:00
Ilya Chernikov
6c60e38260 Add compatibility with templates from script-runtime...
and add script-runtime to the compilation classpath by default
2018-09-06 19:17:44 +02:00
Ilya Chernikov
6716c512d3 [minor] Rename too long named functions 2018-09-06 19:17:43 +02:00
Ilya Chernikov
a52b57eecf Drop currently unused REPL part of the API 2018-09-06 19:17:43 +02:00
Ilya Chernikov
67ba8b5361 Rename ScriptSource to SourceCode, extract location to another i-face...
other related refactorings. The goal - make interface terminologically
more suitable for usage in REPL.
2018-09-06 19:17:43 +02:00
Ilya Chernikov
1e85a26b62 Fix evaluation part of the scripting API - mostly renaming 2018-09-06 19:17:43 +02:00
Ilya Chernikov
539e0f4961 [minor] switch to project dependencies in scripting projects 2018-09-06 19:17:43 +02:00
Ilya Chernikov
8674cd7a6b Fix scripting tests 2018-09-06 19:17:43 +02:00
Ilya Chernikov
d6590d4fa3 Scripting examples refactoring 2018-09-06 19:17:43 +02:00
Ilya Chernikov
f159a686df Fix compiled script caching interface 2018-09-06 19:17:42 +02:00
Ilya Gorbunov
0eb5bf21e9 Fix maven plugin smoke test
- Do not use default encoding to avoid warnings in logs
- Update 'Downloading'/'Downloaded' filters to new maven version
2018-09-06 20:07:54 +03:00
Alexander Udalov
41f8819158 Deprecate Annotations.getUseSiteTargetedAnnotations 2018-09-06 19:13:17 +03:00
Alexander Udalov
7658ddafd8 Make AnnotationsImpl internal, introduce Annotations.create 2018-09-06 19:13:17 +03:00
Alexander Udalov
eef11c669a Extract TargetedAnnotations out of AnnotationsImpl
Minimize AnnotationsImpl to leave it usable in simple scenarios where
there's no use-site targeted annotations, and use TargetedAnnotations in
the only place in the frontend (AnnotationResolverImpl) where use-sites
were needed.

Also, delete kdoc on Annotations.isEmpty to prevent readers from putting
too much thought into how it works. With the exception of a few places
in the frontend where use-site targeted annotations are still accessed
via the Annotations object, it's now an implementation detail and users
(such as backends, IDE) should not care about them at all, and instead
should just deal with the correct element when processing annotations
2018-09-06 19:13:16 +03:00
Alexander Udalov
c0b025b23d Provide default implementation for Annotations.getUseSiteTargetedAnnotations
After this commit, it's overridden only in AnnotationsImpl and
CompositeAnnotations.

Note that although FilteredAnnotations did have a non-trivial
implementation, that class was only used in circumstances where
annotations with use-site targets could not be of any use, so it's safe
to return empty list there now. One could argue that the new semantics
makes more sense: filter "standard" annotations, but don't touch those
with use-site targets because they are not applied to this element
directly, thus should likely not be affected by the filtering
2018-09-06 19:13:16 +03:00
Alexander Udalov
f9b9b6908a Remove use-site targeted annotations from LazyAnnotations
LazyAnnotations are only used for classes and files, and in the latter
case it will now contain file annotations as normal annotations, without
the target "file:"
2018-09-06 19:13:15 +03:00
Alexander Udalov
98232265d7 Simplify deserialization of annotations on backing/delegate fields
Instead of returning the list of targeted annotations in
loadCallableAnnotations, add two separate methods to load annotations on
the backing field and on the delegate field of the property
2018-09-06 19:13:15 +03:00
Alexander Udalov
ca3cff9a93 Do not write hasAnnotations flag for properties with source-only annotations
This does not break or fix any behavior except the fact that
deserialization will now not try loading annotations on a property which
had no binary- or runtime-retained annotations in the sources
2018-09-06 19:13:14 +03:00
Alexander Udalov
87c0d56618 Drop Annotations.getAllAnnotations 2018-09-06 19:13:14 +03:00
Alexander Udalov
83fbabd628 Drop Annotations.Companion.find/getUseSiteTargetedAnnotation(s) 2018-09-06 19:13:13 +03:00
Alexander Udalov
7271995ff0 Drop Annotations.findAnyAnnotation, DescriptorUtils.getAnnotationByFqName 2018-09-06 19:13:13 +03:00
Alexander Udalov
9d1baaeb56 Simplify backing field generation logic in PropertyCodegen
Inline several methods, remove extra parameters, fix warnings
2018-09-06 19:13:12 +03:00
Alexander Udalov
753191e668 Simplify codegen of annotations, get rid of use-site targets 2018-09-06 19:13:12 +03:00
Alexander Udalov
fc87043cb3 Merge use-site targeted annotations into corresponding Annotations
Add PropertyDescriptor.backingField/delegateField to store annotations
on the field directly in an otherwise almost empty descriptor instance,
instead of storing them with use-sites in the corresponding property
descriptor. Instead of AnnotationWithTarget, create AnnotationDescriptor
instances in AnnotationSplitter. Change DescriptorRenderer to render
annotations on "related" declarations when needed, with the explicit
use-site target if applicable.

Most changes in diagnostic test data are related to the fact that
annotations which are known to have an incompatible use-site to the
declaration they're applied at (such as `@param:`-annotation on a
function), are now not loaded at all. It's fine because the code is
erroneous, so it doesn't really matter how do we load annotations with
invalid targets (some of this logic is also changed freely in subsequent
commits). Some changes are also explained by the fact that for example
an annotation on the property which is only applicable to FIELD is now
rendered with an explicit use-site target `@field:`, regardless of
whether it did have that use-site target syntactically or not.

Basically, after this change there's no point in calling
Annotations.getUseSiteTargetedAnnotations/getAllAnnotations anymore
because it's easier and more intuitive to just use Annotations of the
corresponding descriptor -- the backing / delegate field (introduced in
this commit) or the extension receiver / setter parameter (related
behavior was fixed in previous commits). Usages of
use-site-target-related methods will be refactored out in subsequent
commits
2018-09-06 19:13:11 +03:00
Alexander Udalov
8c21e86ded Don't add unapplicable targeted annotations to the container
For example, previously on an (incorrect) code like

    @setparam:Ann
    val x = 42

We added Ann to x's annotations. Not doing this seems more correct and
simplifies implementation a bit.

Test data is NOT changed in this commit because effective changes
somewhat depend on the changes in the subsequent commits. Affected tests
are at compiler/testData/diagnostics/tests/annotations/withUseSiteTarget
2018-09-06 19:13:10 +03:00
Alexander Udalov
0e5544a491 Use AnnotationSplitter for annotations on extension receiver
Instead of using `@receiver:`-targeted annotations on the receiver type,
use normal annotations of the ReceiverParameterDescriptor instance
everywhere
2018-09-06 19:13:10 +03:00
Alexander Udalov
823a24e0a3 Use AnnotationSplitter for annotations on setter parameter
Make it possible to specify annotations of the setter parameter when
constructing the default setter via DescriptorFactory; pass the split
annotations in DescriptorResolver.resolvePropertySetterDescriptor

 #KT-25500 Fixed
2018-09-06 19:13:09 +03:00
Anton Bannykh
779d9aafe7 JS: fix module aliasing for inline imports (KT-26466 fixed)
Consider an import from an inline function invocation. If it is
being called from another inline function, it should be defined
in a special way (e.g. `$$importsForInline$$.foo`) so that
the compiler knows where to load transitive dependencies from.
What's more, the declaration itself should be inside the inline
function wrapper.

Otherwise it should be defined in a regular way (e.g.
`$module$bar.foo` among other top-level imports).

By default the imports are loaded in the first form, and
transformed into the second one when needed. To check
whether this transformation the following predicate is
used: `inlineFunctionDepth == 0`.

At the moment the mentioned variable is increased upon
visiting an inline function declaration (`defineInlineFunction`),
and upon visiting an unknown (not visited before) inline function invocation.

It seems that instead the variable should be increased when processing
an existing inline function wrapper. At that point a new place to
put import definitions (`statementContextForInline`) is set.

Due to way JS code is generated (lambda's come before their call sites)
this issue seems to have been masked. Primary class constructors are a special
case - they come before any other declaration within. Hence a lambda
invocation inside a constructor leads to incorrect import definition.
2018-09-06 19:08:45 +03:00
Mikhael Bogdanov
da93ff1a30 Properly cast right-hand side value for inline property setter
#KT-22649 Fixed
2018-09-06 18:04:45 +02:00
Ilya Matveev
5cb8108eec Add builtBy for Kotlin/Native platform libs dependency 2018-09-06 22:59:27 +07:00
Sergey Igushkin
699cff27a7 If a target has no main compilation, don't create a sources JAR
Currently, Android libraries are not published as a part of an MPP
library, and building no sources JAR for them is OK.

Issue #KT-26390
2018-09-06 22:59:27 +07:00
Ilya Matveev
779030da1b Don't use Kotlin/Native home path in up-to-date checks 2018-09-06 22:59:27 +07:00
Ilya Matveev
7b51cfa804 Workaround duplicated libraries for native in IDE 2018-09-06 22:59:27 +07:00
Ilya Matveev
48d8f5eb39 Add libraries provided by the K/N compiler in dependencies 2018-09-06 22:59:27 +07:00
Ilya Matveev
e433778268 Switch to Kotlin/Native 0.9 2018-09-06 22:59:27 +07:00
Sergey Igushkin
7ff53deea5 Generate and publish *-sources.jar for each target 2018-09-06 22:59:27 +07:00
Sergey Igushkin
36a81acb5d Fixes for new MPP publishing
* Generate the JARs with the same names as they are published.
  Put the target name in the JAR name's appendix instead of classifier.

* Configure Maven publications eagerly to allow their editing by user.

* Take KotlinVariant's coordinates from the MavenPublication.
  If the user changes Maven coordinates of the publication, this ensures
  the parent component to have the updated information.
2018-09-06 22:59:27 +07:00
Ilya Matveev
440f6996d2 Fix wasm binary output paths 2018-09-06 22:59:27 +07:00
Ilya Matveev
36e8f84797 Add test for static/shared library building 2018-09-06 22:59:27 +07:00
Ilya Matveev
bef898509d Allow using strings to set native output kinds 2018-09-06 22:59:27 +07:00
Ilya Matveev
cfe7858229 Support static and shared libraries for native in kotlin-mpp 2018-09-06 22:59:27 +07:00
Ilya Matveev
0a685d57c2 Add macos in targets for new MPP integration tests 2018-09-06 22:59:27 +07:00
Sergey Igushkin
577bae763c Add tests for Kotlin/Native in new MPP
* Add K/N variants to the general MPP tests
* Also check the separated publishing
2018-09-06 22:59:27 +07:00
Sergey Igushkin
67bd659390 Fallback to publishing with coordinates inferred from publication
In Gradle < 4.7, there's no `ComponentWithCoordinates` interface, and we
need to make sure that none of our classes implementing this interface
are loaded with older Gradle versions.

Instead of that interface, we can rely on Gradle's metadata generation
heuristic that takes Maven coordinates for the variants from the
corresponding publications.
2018-09-06 22:59:27 +07:00
Ilya Matveev
091e680196 Fix validation warning for Kotlin/Native compilation task 2018-09-06 22:59:27 +07:00
Ilya Matveev
ed7da870cf Rename test tasks for native targets 2018-09-06 22:59:27 +07:00
Ilya Matveev
c23296a0d8 Publish different targets as different software components 2018-09-06 22:59:27 +07:00
Nikolay Krasko
91308508bd Inject with suffix and prefix arguments in annotations (KT-26584)
#KT-26584 Fixed
2018-09-06 17:39:54 +03:00
Mikhail Zarechenskiy
690762d46c Inline classes ABI: rename equals--impl to equals-impl0 2018-09-06 17:01:01 +03:00
Yan Zhulanow
280a3e3d26 Android Extensions: Support platform modules (KT-26169) 2018-09-06 14:42:23 +03:00
Yan Zhulanow
ca4b99b1a0 Maven: Do not consider 'kapt' and 'test-kapt' executions as non-JVM (KT-26211) 2018-09-06 14:42:22 +03:00
Yan Zhulanow
2ec1a89fa1 Use IdePlatform instead of IdePlatformKind in 'Kotlin Facet' project structure tab 2018-09-06 14:42:21 +03:00
Yan Zhulanow
a434cb00c6 Do not retain proxy-based components for compiler plugin settings in project model (again) (KT-24444)
The previous approach didn't work because Gradle wraps the copy() result, and the leakage didn't go away.
2018-09-06 14:42:20 +03:00
Yan Zhulanow
f55a52b86e MPP: Fix compatibility issue with Android Studio 3.3 Canary 7
'TargetPlatformKind' is still used in AS 3.3 so we can't remove it entirely yet.
2018-09-06 14:42:19 +03:00
Alexander Udalov
f90303315d Support array class literals in annotation serializer/deserializer
Note that this change brings an incompatibility: `Array<Foo>::class`
will be seen as `Foo::class` by the old deserializer. We consider this
OK because the compiler never had any logic that relied on reading class
literal arguments correctly (otherwise it wouldn't have worked because
it could only see `Array<*>::class` before this commit), and the support
of annotations on types in JVM reflection is only available in the
upcoming 1.3 release (KT-16795)

 #KT-22069 Fixed
2018-09-06 14:40:06 +03:00
Mikhael Bogdanov
f3f93ed6cc Get rid of 'BRIDGE' flag on $default functions
#KT-24415 Fixed
2018-09-06 13:34:00 +02:00
Alexey Sedunov
b441c76313 Generate equals/hashCode(): Support content equality from stdlib
#KT-22361 Fixed
2018-09-06 14:28:53 +03:00
Alexey Sedunov
5fcc6cfa0b Change Signature: Retain necessary backquotes in the dialog
#KT-17124 Fixed
2018-09-06 14:28:52 +03:00
Alexey Sedunov
26c02cd8bb Move Left/Right: Support type constraints
#KT-26525 Fixed
2018-09-06 14:28:52 +03:00
Alexey Sedunov
a20857beb9 Misc: Do not look for *_main/*_test modules in import test (AS3.2) 2018-09-06 14:28:52 +03:00
Mikhail Zarechenskiy
3dd5a267b8 Refine scope of signed to unsigned conversions
Depend on a module of function declaration, not function call
2018-09-06 14:06:03 +03:00
Nicolay Mitropolsky
e80a01a3fd 183: IDEA 183 version set to 183.2153.8 2018-09-06 12:49:00 +03:00
Sergey Igushkin
0ee19cf28f Support -Xcommon-sources in new MPP
In new MPP, add source sets taking part in more than one compilation to
the tasks' `commonSourceSet` in order to pass them as -Xcommon-sources

Issue #KT-26515 Fixed
2018-09-06 12:41:02 +03:00
Sergey Igushkin
5e6148c970 Refactor & fix: add allKotlinSourceSets and use it where appropriate
* Some of the usages of `kotlinSourceSets` should instead get all the
  source set from the source set hierarchies, i.e. including the ones
  transitively-participating in the compilation
2018-09-06 12:40:32 +03:00
Sergey Igushkin
96901c5487 Move KotlinSourceSet back to org.jetbrains.kotlin.gradle.plugin.*
After all MPP related changes, the `KotlinSourceSet` interface turns out
compatible with the old `KotlinSourceSet`, and, since there are external
usages of `KotlinSourceSet`, it is reasonable to expose the new
interface under the old FQ-name to fix those external usages.

Issue #KT-26498 Fixed
2018-09-06 12:35:59 +03:00
Sergey Igushkin
57c4886bd4 Don't create source sets and test compilation for the metadata target
Issue #KT-26253 In progress
2018-09-06 12:35:58 +03:00
Mikhail Zarechenskiy
5173a84dc7 Enable signed to unsigned coercion for modules with special capability
Mainly this is needed for Kotlin/Native part
2018-09-06 12:29:30 +03:00
Mikhail Glukhikh
55ff519aa8 Fix KtModifierListOwner.addAnnotation (case without modifier list)
Now add annotation to primary constructor should work correctly,
and may be some other related cases too.

Related to KT-25548
2018-09-06 11:10:05 +03:00
Mikhail Glukhikh
5f2c7d3c84 Do not report OPTIONAL_DECLARATION_USAGE_... in IDE for platform modules
#KT-26585 Fixed
Also fixes MultiPlatformHighlightingTestGenerated.testMultifileFacade
2018-09-06 11:07:21 +03:00
Nikolay Krasko
ca1e0a4b88 Do not fetch Kotlin stubs for versioned files from multi-release jars (KT-26439)
An incomplete list of inner class files might be stored in versioned
directory and that ruins Kotlin stub building.

Another reason for excluding such files, that they are duplicated
in different declarations lists such as `Navigate -> Class...` action.

 #KT-26439 Fixed
2018-09-06 10:48:18 +03:00
Mikhail Zarechenskiy
bc7f13b838 Temporarily allow equals & hashCode for SoF to compile bootstrap
equals & hashCode should be removed completely soon anyway
2018-09-06 10:39:34 +03:00
Mikhail Zarechenskiy
83975bd6ac Generate stub for specialized equals inside inline class 2018-09-06 10:39:33 +03:00
Mikhail Zarechenskiy
b4674a172e Reserve secondary constructors with bodies inside inline classes
#KT-26575 Fixed
2018-09-06 10:22:01 +03:00
Mikhail Zarechenskiy
002a66fec1 Reserve box/unbox/equals/hashCode methods inside inline classes
#KT-26573 Fixed
2018-09-06 10:20:03 +03:00
Ilya Gorbunov
7f8863bfd0 Update public API after inline class generation schema was changed 2018-09-06 03:56:01 +03:00
Ilya Gorbunov
43eeccbcb8 Advance bootstrap to 1.3.0-dev-169 2018-09-06 03:55:02 +03:00
Vyacheslav Gerasimov
e29151a1f0 Apply java plugin to kotlin-compiler project to fool idea import
java plugin makes idea import dependencies on this project as source (with empty sources however), this prevents reindexing of kotlin-compiler.jar after build on every change in compiler modules
2018-09-05 22:58:31 +03:00
Vyacheslav Gerasimov
b868450e9a Make dependencies on :kotlin-compiler project testRuntimeOnly everywhere 2018-09-05 22:58:31 +03:00
Ilmir Usmanov
53a1526412 Add version to DebugMetadata
#KT-26580 Fixed
2018-09-05 22:51:55 +03:00
victor.petukhov
e082fe19ea Actualize contracts diagnostic spec tests after 051ad0f79e 2018-09-05 18:04:58 +03:00
Mikhail Glukhikh
ad27d9aae7 Package utils: implement getNonGeneratedKotlinSourceRoots
This is needed to prevent creation of actual elements
in generated sources. Checked manually.

#KT-24129 Fixed
2018-09-05 17:21:23 +03:00
Mikhail Glukhikh
caee77cdae Kotlinize findOrCreateDirectoryForPackage in create actual fix
Before this commit, without existing directory
we tried to create it only inside Java source roots,
which is incorrect for JS and other non-JVM modules.
Source roots themselves still aren't created if they don't exist.

This fixes KT-19586 partially
2018-09-05 17:21:10 +03:00
Yan Zhulanow
3276e348cc Fix kapt tests (Kotlin version updated to 1.3) 2018-09-05 17:15:04 +03:00
Yan Zhulanow
17849473d6 Fix bunch compilation for AS 3.1/3.2 2018-09-05 17:15:04 +03:00
Dmitry Savvinov
051ad0f79e Fix unsound smartcast due to returns(null) in safecall
^KT-26382 Fixed
2018-09-05 16:27:48 +03:00
Dmitry Savvinov
18338f4ea3 Add test on safecall of function with returns(null) contract
Currently with non-desired testdata, fix incoming in the next commit.
2018-09-05 16:27:47 +03:00
Mikhail Glukhikh
1530a8bf53 Downgrade "Call chain -> sequence" to information level
Made to hide problem KT-26571
2018-09-05 14:55:23 +03:00
Roman Elizarov
eac1f5f8c8 Bootstrap change to rename SuccessOrFailure to Result 2018-09-05 14:29:36 +03:00
victor.petukhov
af732d16d6 Actualize contracts diagnostic spec tests 2018-09-05 14:08:50 +03:00
Mikhail Glukhikh
bae92f3a33 Sealed class: handle the case with actual type alias #KT-26141 Fixed
Before this commit, class super-type could be sealed only in the case
it's the class we are inside or in the same file with.
However, it's quite possible for the expect sealed class
to be implemented by typealias.
So in this commit we allow class super-type to be sealed
if it's typealias expansion we are inside.
2018-09-05 13:25:49 +03:00
Mikhail Glukhikh
56d89266d4 Add tests for KT-26141 (yet without changes) 2018-09-05 13:10:03 +03:00
Mikhail Glukhikh
68e3821ae2 Code cleanup: packageUtils.kt 2018-09-05 13:05:08 +03:00
Mikhail Glukhikh
53e7778078 Add modifiers on the same line even after annotation #KT-26492 Fixed 2018-09-05 13:05:08 +03:00
Mikhail Glukhikh
4dd95e5640 Introduce OptionalExpectationInspection
It works at INFORMATION level only and is intended to form quick-fixes
to add relevant actual declarations.

#KT-25533 Fixed
2018-09-05 13:05:07 +03:00
Mikhail Glukhikh
ba84c6adf3 Request focus while navigating to expected declaration #KT-18490 Fixed 2018-09-05 13:05:07 +03:00
Mikhail Glukhikh
df125702c1 Test for KT-25040 (just to stabilize behaviour) 2018-09-05 13:05:07 +03:00
Mikhail Glukhikh
69def648c9 Remove deprecated MP extensions from Gradle menu #KT-22491 Fixed
Related to KT-26414
2018-09-05 13:05:06 +03:00
Mikhail Glukhikh
62e1121e7f Remove deprecated MP project builder from Gradle menu #KT-26414 Fixed 2018-09-05 13:05:06 +03:00
Dmitry Petrov
db13ab59a6 Test: SuccessOrFailure calls don't generate erased class references 2018-09-05 12:20:57 +03:00
Dmitry Petrov
203fd6a5d6 Make inline class wrapper constructor synthetic 2018-09-05 12:20:57 +03:00
Dmitry Petrov
85826d304e Don't generate secondary constructors for inline class wrapper 2018-09-05 12:20:57 +03:00
Dmitry Petrov
65881dda97 Fix tests after rebase 2018-09-05 12:20:57 +03:00
Dmitry Petrov
1bf8cfca8b Test: property accessors are called by inline class 2018-09-05 12:20:57 +03:00
Dmitry Petrov
a2900282fd Call factory method for primary constructors of inner classes
We might want to add 'init' blocks later, so now, for the sake of
binary compatibility with 1.3-RC binaries, we have to generate these
'constructor' calls.

Note that in some tests inline class boxing is no longer redundant,
because resulting value is passed to 'constructor' as an argument.
2018-09-05 12:20:57 +03:00
Dmitry Petrov
b1016936b2 'box'/'unbox' methods are called by inline class 2018-09-05 12:20:57 +03:00
Dmitry Petrov
580b782585 Simplify code, make $Erased class package private 2018-09-05 12:20:57 +03:00
Dmitry Petrov
687b492bf9 Test: inline class secondary constructors are called by inline class 2018-09-05 12:20:57 +03:00
Dmitry Petrov
05daa21657 Fix inline class secondary constructor call generation
Don't generate NEW+DUP for inline class constructor calls.
2018-09-05 12:20:57 +03:00
Dmitry Petrov
80a67477db Generate method calls for inline classes through IC, not IC$Erased
IC extends IC$Erased, so it should be fine.
2018-09-05 12:20:57 +03:00
Dmitry Petrov
3080b65f7d Inline (wrapper) class IC extends erased inline class IC$Erased 2018-09-05 12:20:57 +03:00
Sergey Bogolepov
a46b28718e Add allScopes property to IrElementVisitorVoidWithContext 2018-09-05 09:56:48 +03:00
Svyatoslav Scherbina
66b259350a Support implicit integer coercion enabling for the entire module 2018-09-05 09:56:47 +03:00
Nicolay Mitropolsky
d0575127be fix for StoredExceptionsThrowToggleAction nullability changed in 183 2018-09-05 09:42:59 +03:00
Roman Elizarov
0401b4e0bb Coroutine context shall perform structural equality comparison on keys
Fixes KT-26398
2018-09-05 01:29:19 +03:00
Ilmir Usmanov
cfc10ec061 Simplify debug metadata: instead of array of same values, store single element
This change is valid, since we want StackTraceElement to be as close
as possible to StackTraceElement of non-coroutine code.
Particularly, if the line is inside inlined function, its className,
functionName and sourceFile are inline site's ones, but lineNumber
is large, which is the way of representing inline function's line
numbers. The rest is handled by the plugin, which allows the user to choose
between inline function body and inline site.
2018-09-04 22:20:08 +03:00
Svyatoslav Kuzmich
ad58fdd158 [JS IR BE] Unmute tests after adding stdlib 2018-09-04 20:19:04 +03:00
Svyatoslav Kuzmich
197a5969e2 [JS IR BE] Fix stdlib files list for 1.3 2018-09-04 20:19:04 +03:00
Svyatoslav Kuzmich
c3b9a5108e [JS IR BE] Add more stdlib files to runtime
Keep old sources list for coroutine tests
2018-09-04 20:19:04 +03:00
Svyatoslav Kuzmich
97717afec4 [JS IR BE] Choose actual declaration of COROUTINE_SUSPEND_NAME 2018-09-04 20:19:04 +03:00
Svyatoslav Kuzmich
5192783669 [JS IR BE] Workaround empty blocks in state machine builder 2018-09-04 20:19:03 +03:00
Svyatoslav Kuzmich
e0237a4480 [JS IR BE] Check for unbound symbols in type operator lowering 2018-09-04 20:19:03 +03:00
Svyatoslav Kuzmich
437a68daca [JS IR BE] Check number of value arguments in toString 2018-09-04 20:19:03 +03:00
Svyatoslav Kuzmich
a3afd101fa [JS IR BE] Delete expected enum classes 2018-09-04 20:19:03 +03:00
Svyatoslav Kuzmich
dde1e9335e [JS IR BE] Don't copy type parameters in secondary ctor lowering 2018-09-04 20:19:03 +03:00
Svyatoslav Kuzmich
a01b6de2d8 [JS IR BE] Add missing exceptions 2018-09-04 20:19:03 +03:00
Alexey Sedunov
9d5bd29e8b Misc: Render MemberInfo as 'abstract' only if it's present in source
#KT-26533 Fixed
2018-09-04 19:49:14 +03:00
Toshiaki Kameyama
be30761ec4 "Convert to 'also'" intention: Fix for call expression has this receiver #KT-26009 Fixed 2018-09-04 19:29:44 +03:00
Toshiaki Kameyama
e1dd85429f Extract function: make default visibility private #KT-25454 Fixed 2018-09-04 19:28:25 +03:00
Toshiaki Kameyama
dc57887a4d Create function quick fix: fix visibility from inline method #KT-25228 Fixed 2018-09-04 19:01:22 +03:00
Toshiaki Kameyama
e2945b1d12 Add quickfix for "Interface doesn't have constructors" #KT-17687 Fixed 2018-09-04 18:58:56 +03:00
Toshiaki Kameyama
b5ba475696 "Redundant lambda arrow" inspection: Also report arrow with single underscore parameter #KT-24728 Fixed 2018-09-04 18:29:46 +03:00
Toshiaki Kameyama
20535feb31 "Remove parameter" quick fix: Remove unused type parameter used as type projection #KT-23511 2018-09-04 18:29:13 +03:00
Ilya Gorbunov
3e38bbcb07 Update generator template to match manually edited _URanges.kt file 2018-09-04 17:39:51 +03:00
Ilya Gorbunov
64996618b3 Suppress signed literals used as unsigned values in stdlib tests 2018-09-04 17:39:51 +03:00
Alexander Podkhalyuzin
c36d0e5db5 Changed action group text
#KT-26501 Fixed
2018-09-04 16:47:54 +03:00
victor.petukhov
921fc263e1 Remove PSI spec tests generation 2018-09-04 15:54:04 +03:00
Yan Zhulanow
7398a8149d Do not use ApplicationExtensionDescriptor in JPS (KT-26542)
The 'ExtensionPointName' class that ApplicationExtensionDescriptor uses is missing in the JPS classpath.
Now we don't use it unless the IDEA Application is properly initialized.
2018-09-04 14:54:45 +03:00
Roman Artemev
0eba87b571 [JS IR BE] Mute temporary broken tests 2018-09-04 12:43:39 +03:00
Roman Artemev
6387cc45aa Update testIr.html 2018-09-04 12:43:39 +03:00
Roman Artemev
a46b1cf126 [JS IR BE] Remove workaround to run coroutine tests 2018-09-04 12:43:39 +03:00
Roman Artemev
54e98fc014 [JS IR BE] Make coroutine compile separately from stdlib
* use accessors instead of direct field access
2018-09-04 12:43:39 +03:00
Alexander Udalov
4f803d03cf Minor, fix test data 2018-08-31 19:54:08 +02:00
Mikhail Zarechenskiy
9a978d2c8f Fix test data after daadba0927 2018-08-31 18:17:34 +03:00
Mikhail Zarechenskiy
6c747dcdb2 Don't use constant conversion from signed to unsigned in stdlib
After daadba0927
2018-08-31 18:17:09 +03:00
victor.petukhov
110bc7412d Fix name of 'controlflow' folder with contract tests 2018-08-31 17:27:51 +03:00
Nicolay Mitropolsky
7068992937 183: gson for 183 updated to 2.8.5 2018-08-31 17:20:54 +03:00
Nicolay Mitropolsky
c13eac7507 183: AbstractHierarchyTest.doHierarchyTest signature update 2018-08-31 17:20:54 +03:00
Nicolay Mitropolsky
d415ca9cf6 fixed nullability for various listeners update in 183 2018-08-31 17:20:54 +03:00
victor.petukhov
d9473c0b6e Add parsing spec tests support 2018-08-31 17:16:19 +03:00
victor.petukhov
f322aba768 Add gradle task to generate json tests map 2018-08-31 17:16:10 +03:00
victor.petukhov
88d8bb84ac Add not linked spec tests support in printSpecTestStatistic gradle task 2018-08-31 17:16:00 +03:00
victor.petukhov
8d91e5998d Add spec tests for contracts 2018-08-31 17:15:51 +03:00
victor.petukhov
ecf8b88c4c Add 'not linked' kind of spec tests 2018-08-31 17:15:40 +03:00
Yan Zhulanow
841bb4f253 Minor: Update DataFlowValueRenderingTestGenerated 2018-08-31 18:56:57 +05:00
Natalia Selezneva
3979ad7a1d Use correct classpath for Ide Scripting Console files during highlighting
KT-25606
2018-08-31 15:55:59 +03:00
Georgy Bronnikov
2fccf6875f Mute tests involving Char.{MIN,MAX}_VALUE, analogously to other primitive types 2018-08-31 15:44:05 +03:00
Roman Artemev
8a871b3f0c Update tests 2018-08-31 15:34:18 +03:00
Mikhael Bogdanov
e6b8ade096 JVM_IR. Reference fields 2018-08-31 15:34:18 +03:00
Mikhael Bogdanov
92ce50b22c JVM_IR. Cache defaultImpls function declarations 2018-08-31 15:34:18 +03:00
Mikhael Bogdanov
5c0cdac69f JVM_IR. Support generic constructors after "Roll back constructor type parameters" 2018-08-31 15:34:18 +03:00
Roman Artemev
0b926af203 Add KotlinType in WrappedClassDescriptor & WrappedTypeParameterDescriptor 2018-08-31 15:34:18 +03:00
Roman Artemev
fec8065fd0 Fix code review
Minor fixes
Fix JVM IR BE
Fix NATIVE
2018-08-31 15:34:18 +03:00
romanart
afcdcf8217 Partially reimplement KotlinType based util using IrType 2018-08-31 15:34:18 +03:00
Roman Artemev
d1621b80cc Fake wrapped descriptors first working draft
get rid of descriptors in Bridge and Enum lowerings
Replace property accessors function type with IrSimpleFunction because they couldn't be constructors
get rid of descriptors in Callable reference lowering
refactored descriptor factory and inner class lowering
Add isReified property to IrTypeParameter declaration
keep getting rid of descriptors
Get rid of descriptors in Shared Variable Manager
LocalDeclarationLowering also uses no descriptors
Fix psi2ir
Fix nested classes names
Fix outer reference in inner classes
Fix name generator
get rid of descriptors in coroutines - something is working
Fix name generator
Fix unbound symbols in JVM BE
Rename DeclarationFactory members
2018-08-31 15:34:18 +03:00
Mikhail Zarechenskiy
daadba0927 Postpone conversions from signed constants to unsigned ones
#KT-26071 Fixed
2018-08-31 15:22:43 +03:00
Ilya Chernikov
d785b7e4c5 Extract urls from any classloader that has getUrls(): List<URL> method
via reflection, e.g. IDEA platform UrlClassloader. This fix allow
kotlin JSR223 host for IDEA to extract classpath from the environment
properly (with appropriate fix on IDEA side as well).
2018-08-31 15:18:56 +03:00
Ilya Chernikov
fd0eb6ee34 Implement support for class literals as annotation arguments...
on deserialization and reflection
2018-08-31 15:17:51 +03:00
Mikhail Glukhikh
68da28edb9 Fix some tests bound to changed annotation formatting 2018-08-31 15:03:25 +03:00
Toshiaki Kameyama
53c10238d6 Introduce inspection for safe cast + return #KT-26230 Fixed 2018-08-31 15:03:25 +03:00
Toshiaki Kameyama
2c71b3873e Introduce "flatMap { it } -> flatten" inspection #KT-25969 Fixed 2018-08-31 15:03:24 +03:00
Sergey Rostov
cdcc588a55 IC: Fix CacheVersionsManager IC flag set.
Previously flag was set before the IncrementalCompilation.isEnabledForJvm() system property was set.
This cases that the cache versions was not saved.
2018-08-31 14:55:35 +03:00
Alexander Udalov
5f18439442 Use correct module name when calling internal members from other module
This is needed to avoid using the same module name for test root as for
the main source root in the Gradle plugin, which is needed to fix
KT-18955
2018-08-31 13:42:57 +02:00
Nicolay Mitropolsky
d1667483a5 ModuleRootListener.rootsChanged parameter made non-null in 183 2018-08-31 13:20:00 +03:00
Sergey Rostov
437fc9d749 JPS: Refactor cache compatibility checking and build targets loading/dependency analysis.
CacheVersion class refactoring:

Responsibilities of class CacheVersion are splitted into:
	- interface CacheAttributesManager<Attrs>, that should:
	    - load actual cache attribute values from FS
	    - provide expected attribute values (that is required for current build)
	    - checks when the existed cache (with actual attributes) values is suitable for current build (expected atribute values)
	    - write new values to FS for next build
	- CacheAttributesDiff is created by calling CacheAttributesManager.loadDiff extension method. This is just pair of actual and expected cache attributes values, with reference to manager. Result of loadDiff can be saved.

CacheAttributesDiff are designed to be used as facade of attributes operations: CacheAttributesDiff.status are calculated based on actual and expected attribute values. Based on that status system may perform required actions (i.e. rebuild something, clearing caches, etc...).

Methods of CacheAttributesManager other then loadDiff should be used only through CacheAttributesDiff.
Build system should work in this order:
    - get implementation of CacheAttributesManager for particular compiler and cache
    - call loadDiff __once__ and save it result
    - perform actions based on `diff.status`
    - save new cache attribute values by calling `diff.saveExpectedIfNeeded()`

There are 2 implementation of CacheAttributesManager:
    - CacheVersionManager that simple checks cache version number.
    - CompositeLookupsCacheAttributesManager - manager for global lookups cache that may contain lookups for several compilers (jvm, js).

Gradle:

Usages of CacheVersion in gradle are kept as is. For compatibility this methods are added: CacheAttributesManager.saveIfNeeded, CacheAttributesManager.clean. This methods should not be used in new code.

JPS:

All JPS logic that was responsible for cache version checking completely rewritten.

To write proper implementation for version checking, this things also changed:
	- KotlinCompileContext introduced. This context lives between first calling build of kotlin target until build finish. As of now all kotlin targets are loaded on KotlinCompileContext initialization. This is required to collect kotlin target types used in this build (jvm/js). Also all build-wide logic are moved from KotlinBuilder to KotlinCompileContext. Chunk dependency calculation also moved to build start which improves performance for big projects #KT-26113
	- Kotlin bindings to JPS build targets also stored in KotlinCompileContext, and binding is fixed. Previously it is stored in local Context and reacreated for each chunk, now they stored in KotlinCompileContext which is binded by GlobalContextKey with this exception: source roots are calculated for each round, since temporary source roots with groovy stubs are created at build time and visible only in local compile context.
	- KotlinChunk introduced. All chunk-wide logic are moved from KotlinModuleBuildTarget (i.e compiler, language, cache version checking and dependent cache loading)
	- Fix legacy MPP common dependent modules

Cache version checking logic now works as following:
- At first chunk building all targets are loaded and used platforms are collected. Lookups cache manger is created based on this set. Actual cache attributes are loaded from FS. Based on CacheAttributesDiff.status this actions are performed: if cache is invalid all kotlin will be rebuilt. If cache is not required anymore it will be cleaned.
- Before build of each chunk local chunk cache attributes will be checked. If cache is invalid, chunk will be rebuilt. If cache is not required anymore it will be cleaned.

#KT-26113 Fixed
#KT-26072 Fixed
2018-08-31 11:13:18 +03:00
Denis Zharkov
3bdfd811e8 Add some new String methods in JDK 11 to built-ins mapping blacklist
These three methods are conflicting with existing extensions,
thus the behavior might be changed when switching to JDK 11

Probably, it's worth revisiting our strategy here,
e.g. by blacklisting all new methods in

 #KT-24974 Fixed
2018-08-31 10:33:09 +03:00
Dmitry Petrov
00aa6158c8 Fix IR tests for 1.3 2018-08-31 09:19:13 +03:00
Dmitry Petrov
4cf98fd3ce Fix IR generation for '!is' pattern 2018-08-31 09:12:44 +03:00
Ilya Gorbunov
623adbfe4a Do not use JVM-specific annotations in pure-JS generated sources 2018-08-31 04:17:42 +03:00
Ilya Gorbunov
056db883c3 Fix JS IR runtime compilation for tests after applying OptionalExpectation
Jvm-specific actuals were removed from stdlib/js runtime.
Recreate them in irRuntime so they can be resolved when compiling runtime for IR tests.
2018-08-31 04:17:42 +03:00
Ilya Gorbunov
36f154882c Provide JvmSynthetic annotation in stdlib-common as optional
#KT-24478
2018-08-31 04:17:42 +03:00
Ilya Gorbunov
0c89996e34 Introduce platform specific annotations as optional in common stdlib
#KT-24478
2018-08-31 04:17:42 +03:00
Ilya Gorbunov
ce7a863843 Move OptionalExpectation and related annotations to another source root 2018-08-31 04:17:42 +03:00
Ilya Gorbunov
2091601fe8 Advance bootstrap to 1.3.0-dev-25
Update public API of specialized unsigned iterators.
2018-08-31 04:17:42 +03:00
Yan Zhulanow
d00f5b335a MPP: Refactoring, extract IDE platform kinds, allow to add custom platforms 2018-08-31 05:14:15 +05:00
Ilya Gorbunov
cf1b2bedf4 Support bootstrapping from TeamCity releases builds
that have build.number different from the version of artifacts.
2018-08-31 00:42:40 +03:00
Ilya Gorbunov
29ce1297da Prepend changelog of 1.3-M1 and 1.3-M2 2018-08-30 23:11:15 +03:00
Anton Bannykh
e7f9727783 JS: fix tests related to 1.3 migration 2018-08-30 22:27:24 +03:00
Pavel V. Talanov
3a8499b10e Fix a bug where kotlin common classes were seen as missing dependencies
When kotlin referred to them through java signatures
Java resolver ignores expect classes

 #KT-24185 Fixed
2018-08-30 19:37:02 +02:00
Pavel V. Talanov
7087a1b3f5 MPP: test different jvm implementations for single common module
Add test infrastructure to support same platform implementations
2018-08-30 19:37:02 +02:00
Alexander Udalov
cb8951eeef Do not write pre-release binaries for stable LV
This is another cherry-pick of the commit 475a80b641 which was
accidentally reverted by 927706883e during the rebase on master
2018-08-30 17:57:07 +02:00
Alexander Udalov
47bde73ed5 Minor, fix testdata to use release coroutines 2018-08-30 17:34:32 +02:00
Mikhail Glukhikh
2849919094 Fix starImport quick-fix test 2018-08-30 18:30:50 +03:00
Mikhail Glukhikh
ea74b37b5b Insert new line between annotation and type alias or sec. constructor
#KT-26377 Fixed
2018-08-30 18:30:47 +03:00
Toshiaki Kameyama
bae754a266 Foldable if-then: do not highlight for is checks #KT-24978 Fixed 2018-08-30 18:30:45 +03:00
Alexander Udalov
ac14c5e74f Fix KType.javaType for suspend function return type
#KT-26293 Fixed
2018-08-30 16:47:48 +02:00
Toshiaki Kameyama
fba539debf "Nested lambda has shadowed implicit parameter": minor improvements 2018-08-30 17:37:36 +03:00
Toshiaki Kameyama
b7c4248524 "Nested lambda has shadowed implicit parameter": add quickfix to rename shadowing 'it' 2018-08-30 17:37:36 +03:00
Toshiaki Kameyama
97150cb0e2 "Nested lambda has shadowed implicit parameter": show warning on the shadowing 'it' reference 2018-08-30 17:37:36 +03:00
Toshiaki Kameyama
7fdbcda91d "Nested lambda has shadowed implicit parameter": downgraded to WEAK WARNING level 2018-08-30 17:37:36 +03:00
Toshiaki Kameyama
7800f42840 "Nested lambda has shadowed implicit parameter": Do not report if 'it' paramerter is not used #KT-26268 Fixed 2018-08-30 17:37:36 +03:00
Ilmir Usmanov
f3879af9f6 Implement suspend lambdas of big arity
Suspend functions and callable references to suspend lambdas are already
supported.
Support callSuspendBy of suspend function of big arity.
 #KT-24854: Fixed
2018-08-30 17:29:09 +03:00
Georgy Bronnikov
769344569d Mute tests that are new to 1.3-M2 2018-08-30 16:24:48 +03:00
Anton Bannykh
9af8fad43f JS: more coroutines 1.3 API related fixes 2018-08-30 16:24:45 +03:00
Anton Bannykh
8975a6e17e JS: adapt to 1.3 coroutines API
Also update a line number test
2018-08-30 16:24:43 +03:00
Ilmir Usmanov
2d04acba42 Update test data of compiler tests, except IR tests 2018-08-30 16:24:41 +03:00
Dmitry Savvinov
23c945b002 Remove specific language version in testMetadataField
- Why we bother? Because this test tries to read @Metadata via
reflection, and in 1.3 @Metadata has @Since("1.3") annotation. Thus,
with version fixed to 1.2, this test fails with UNRESOLVED_REFERENCE

- Why it is correct? Because initially this directive was used to enable
'LanguageFeature.JvmPackageName' (we didn't have infrastructure for
enabling particulare feature at that moment). So, now we could change it
to the '!LANGUAGE:+JvmPackageName', but it is actually redundant,
because master is already >= 1.2
2018-08-30 16:24:34 +03:00
Dmitry Savvinov
b064c48f83 Fix testdata after advancing LATEST_STABLE to 1.3
This commit contains minor changes in testdata, where test and behavior
change are not related
2018-08-30 16:24:31 +03:00
Dmitry Savvinov
4dfb99596b Fix testdata after introduction of inline-classes mangling 2018-08-30 16:24:29 +03:00
Dmitry Savvinov
f23528770b Extract usages of legacy 'mod' in a separate test 2018-08-30 16:24:27 +03:00
Alexander Udalov
053b54d216 Report error on .class files produced by Kotlin 1.3-M1
Advance incremental cache version to force rebuild after switching from
1.3-M1 to 1.3-M2

(cherry picked from commit ba111d58ae)
2018-08-30 16:23:33 +03:00
Dmitry Savvinov
2ecea06d3e Do not coerce inferred language levels when importing from facet
Rationaly is that facet importer knows better about which language
versions should be used, so we shouldn't interfere.

Otherwise, Gradle or Maven projects which have upgraded corresponding
plugin to 1.3 will be imported with 1.2 levels, which is undesirable
2018-08-30 16:23:30 +03:00
Sergey Igushkin
90ec151258 Bring back two methods used by old MPP K/N plugin
* First, it overrides `addCommonSourceSetToPlatformSourceSet` with an
  old signature that was drop during migration to 'KotlinSourceSet's

* Second, it uses an extension SourceSet.kotlin that got dropped during
  the aforementioned migration

Now, for the old MPP K/N plugin, `addCommonSourceSetToPlatformSourceSet`
is called twice, one time with the new signature and another with the
old one, which it overrides.
2018-08-30 16:22:00 +03:00
Mikhail Glukhikh
1e2334a911 Kotlin migration: fix data context calculation for 173 / AS31
Version for IDEA 182 does not work properly here (returns null),
so we have to use `DataManager.getDataContext(focusedComponent)` directly

#KT-26399 Fixed
2018-08-30 16:21:56 +03:00
Mikhail Glukhikh
2e4f46045e Kotlin migration: extract data context into a function, check it on null
The extraction itself is needed due to different behaviour of related
IDEA functions in different platforms.
Check on null is needed because `createFromAnAction` last argument
cannot be null, otherwise we will get an exception.

Partial fix of KT-26399
2018-08-30 16:21:53 +03:00
Roman Elizarov
319c16c885 CoroutineStackFrame: public API dump updated 2018-08-30 16:21:49 +03:00
Roman Elizarov
a9eb94d822 Introduce CoroutineStackFrame interface for coroutine stack reconstruction in debugger
Fixes KT-26339
2018-08-30 16:21:46 +03:00
Dmitry Savvinov
b23bf371cf Always pass languageVersion explicitly to JPS compiler
When 'languageVersion' isn't passed explicitly, compiler will choose
'LATEST_STABLE'.

This may lead to spurious migration of a project to the next major
version after plugin update (e.g. when user had project of major
version X and then installed plugin of version X+1 -- in such case,
meaning of "no language version" suddenly changes).

So, we set it to RELEASED_VERSION, which is exactly the version
that is safe to use as the fallback.
2018-08-30 16:21:43 +03:00
Alexander Podkhalyuzin
69a0fedd9f When version is not defined we need to fallback to released
There are few more such places. Better fix would be to avoid
situation, when we need to fallback. So in every project these
settings are defined. It means "Latest stable" setting is not good.

#KT-26364 Fixed
2018-08-30 16:21:40 +03:00
Ilya Gorbunov
009980944b Refine the exception type of EmptyRange.random()
Make it the same type as in case of an empty collection, so that
`emptyRange.random()` throws the same exception as `emptyRange.toList().random()`.

#KT-15539
2018-08-30 16:21:36 +03:00
Ilya Gorbunov
9c412ba436 Fix incorrect range transform in nextUInt/nextULong with range parameter
#KT-25570
2018-08-30 16:21:33 +03:00
Dmitry Petrov
583c66a2a7 Don't mangle synthesized 'box' function for inline classes 2018-08-30 16:21:30 +03:00
Ilya Gorbunov
ea2c33a532 Extension random() to select random element from a collection
Fixes #KT-15539
2018-08-30 16:21:27 +03:00
Ilya Gorbunov
b0bcd78e38 Optimize copying for typed arrays in JS 2018-08-30 16:21:24 +03:00
Ilya Gorbunov
ea37a65178 copyInto: copying elements between two arrays
#KT-25874 Fixed
2018-08-30 16:21:20 +03:00
Ilya Gorbunov
58e6f910bc Update public API after stopping SuccessOrFailure mangling in signatures 2018-08-30 16:21:17 +03:00
Stanislav Erokhin
31f9184874 Update bootstrap 2018-08-30 16:21:14 +03:00
Yan Zhulanow
5d936a4c7c Kapt: Ignore annotation-processing-gradle compiler plugin we got from Gradle (KT-24714)
Cause it's built for the shaded Kotlin compiler and won't work with JPS.

(cherry picked from commit d08a32c7cb)
2018-08-30 16:21:11 +03:00
Stanislav Erokhin
bcf2b39df2 Update bootstrap
Here we use build from custom branch intentionally and soon
we should bootstrap again.
2018-08-30 16:21:08 +03:00
Ilya Gorbunov
9c4a74ce5b Improve stability of nextBoolean test
Increase number of tosses (according to the Law of Large Numbers).
2018-08-30 16:21:05 +03:00
Ilya Gorbunov
d035c2690a Random extensions for unsigned: fixes after review
#KT-25570
2018-08-30 16:21:01 +03:00
Kerooker
f9dec5e794 Implement extension functions for Random: nextUInt, nextULong and nextUBytes
Given there's a Random API in the stdlib, that generates all random primitives, this commit adds the possibility to generate random unsigned integers.
It uses the same implementation from Random.nextInt, nextLong and nextBytes, but uses the appropriate conversions from a signed type to an unsigned type.

The use of the same API guarantees that the distribution is uniform, but this commit adds some unit test to enforce that necessity.

Fixes #KT-25570
2018-08-30 16:20:58 +03:00
Dmitry Petrov
db131df751 Don't mangle function names with 'kotlin.SuccessOrFailure' 2018-08-30 16:20:55 +03:00
Ilmir Usmanov
e8597d706d Implement debug-friendly Continuation.toString()
#KT-18986 Fixed
2018-08-30 16:20:52 +03:00
Dmitry Savvinov
4929f457ed Turn off BooleanElvisBoundSmartCasts in 1.3
See KT-26357
2018-08-30 16:20:49 +03:00
Ilya Gorbunov
3607ed85ab Update public API dump with mangled signatures 2018-08-30 16:20:45 +03:00
Ilya Gorbunov
e670318cf0 ifEmpty and isBlank extensions
- Introduce ifEmpty extension for Collections, Maps, Arrays, Sequences
- Introduce ifEmpty and isBlank for CharSequences

#KT-15695 Fixed
2018-08-30 16:20:42 +03:00
Alexey Tsvetkov
4f6d9e7b86 Update bootstrap 2018-08-30 16:20:39 +03:00
Dmitry Savvinov
2179ae496e Fix testdata after improvements in contract parsing diagnostics 2018-08-30 16:20:36 +03:00
Dmitry Savvinov
a6bb7d1e89 Support identity equals in contracts 2018-08-30 16:20:32 +03:00
Dmitry Savvinov
cf033fa78a Minor: extract common equals processing in a separate method 2018-08-30 16:20:29 +03:00
Dmitry Savvinov
70dc6ef0f7 Minor: detect 'returns()' more accurately
Before, we've assumed that if call has no expression arguments, then
it's a 'returns()' call.

Now we check that we've resolved to overload of 'returns' from
ContractsDsl with zero parameters.
2018-08-30 16:20:26 +03:00
Dmitry Savvinov
1300a475db Improve diagnostics for illegal constructions in contract-block
Like 'if', 'when', etc: they can have type of 'Effect', so we would try
to parse them and then fail silently.
2018-08-30 16:20:23 +03:00
Dmitry Savvinov
ca20c0b0bd Improve diagnostics for unrecognized InvocationKind in contracts 2018-08-30 16:20:19 +03:00
Dmitry Savvinov
e40f11ec52 Improve diagnostics for contract-calls when not lambda-literal passed 2018-08-30 16:20:16 +03:00
Dmitry Savvinov
90e37c6599 Improve diagnostics for illegal contract targets 2018-08-30 16:20:13 +03:00
Dmitry Savvinov
a9c388ecc7 Forbid referencing captured types and generics in contracts 2018-08-30 16:20:10 +03:00
Dmitry Savvinov
749fa049ca Refactor diagnostic reporting of effects parsing
- Introduce ContractParsingDiagnosticsCollector
It allows us to make sure that we return 'null'-contract iff there's
some error. Note that it differs from previous behavior in two major
points:
a) if contract was unparsed, but no error were reported for
some reason, then generic error will be reported (previously we were
swallowing incorrect contract silently)
b) if there were some errors during parsing, return only 'null'
(previously, we could return some contract. It was unusable due to
errors in code, but we want to be extra-safe here)

- Introduce ContractCallContext to not pass a bunch of random arguments
around

- Make message of Error.CONTRACT_NOT_ALLOWED more flexible
2018-08-30 16:20:07 +03:00
Dmitry Savvinov
a6783176ea Add tests on illegal usages of Contracts DSL
(currently with undesired behavior, it will be fixed in the next
commits)
2018-08-30 16:20:04 +03:00
Dmitry Savvinov
79476839c4 Minor: remove unneeded check from contract parsing
'parseContract' is called only from
'ContractParsingServices.checkContractAndRecordIfPresent', and here we
already have checked that this call is indeed a contract call.
2018-08-30 16:20:01 +03:00
Dmitry Savvinov
e29de37ac4 Fix JS IR BlackBox tests after contracts publishing
- Add necessary files to compilation
- Opt-in for experimentality

See changes at e2606b72bdbec2fea567d4127197707869eb801e
2018-08-30 16:19:58 +03:00
Dmitry Savvinov
ee8702d21e Load of testdata change due to contracts publishing
See changes in e2606b72bdbec2fea567d4127197707869eb801e
2018-08-30 16:19:55 +03:00
Dmitry Savvinov
accbd07b2e Publish ContractsDsl
- Mark @ContractsDsl as @Experimental
- Move Contracts DSL out from 'internal' package
- Change visibility of ContractsDsl from 'internal' to 'public'

^KT-25274 Fixed
^KT-25495 Fixed
2018-08-30 16:19:51 +03:00
Ilmir Usmanov
208c3a51ab Use short jvm names for the annotation parameters 2018-08-30 16:19:44 +03:00
Ilmir Usmanov
22f9a6ce08 Add coroutines debug metadata: compiler
#KT-25557 Fixed
 #KT-25559 Fixed
2018-08-30 16:19:41 +03:00
Ilmir Usmanov
c4287118d8 Add coroutines debug metadata: stdlib 2018-08-30 16:19:38 +03:00
Ilmir Usmanov
fe451dce31 Implement correct is check for SuspendFunction
Add test for suspend functions with language version 1.2.
Minor edit in SuspendFunction docs.
2018-08-30 16:17:46 +03:00
Dmitry Petrov
a205019156 Additional tests and fixes for function name mangling 2018-08-30 14:58:54 +03:00
Dmitry Petrov
99498eb7b8 Use 'name-hash' mangling scheme
'-' is allowed as a name character both in JVM and in Dalvik, but can't
be a part of a Java identifier.
2018-08-30 14:58:52 +03:00
Dmitry Petrov
a56d1d3ce8 Mangle function names with inline class parameters
Avoid name clashes in cases such as

  inline class Login(val login: String)
  inline class Password(val password: String)

  fun validate(login: Login) { ... }
  fun validate(password: Password) { ... }
2018-08-30 14:58:50 +03:00
Dmitry Petrov
ff9ba97d66 Minor: fix warnings and reformat 2018-08-30 14:58:47 +03:00
Alexey Sedunov
c7a5a7ebd5 Gradle: Use common language/api version (if any) of all modules for project
#KT-26290 Fixed
2018-08-30 14:58:45 +03:00
Denis Zharkov
c6eaaac877 Adjust coroutines test data to changing the default LV to 1.3 2018-08-30 14:58:43 +03:00
Denis Zharkov
f594cb22e8 Add "LANGUAGE_VERSION: 1.2" directive where it's necessary 2018-08-30 14:58:41 +03:00
Ilya Gorbunov
f5df53b7a7 Detect UInt/ULong parsing overflow after digit addition instead of before
#KT-26161
2018-08-30 14:58:39 +03:00
Ilya Gorbunov
d99f97ad96 Support '+' in front of parsed unsigned string values
#KT-26161
2018-08-30 14:58:37 +03:00
Ilya Gorbunov
2530a8e98c Provide unsigned string to number conversion in arbitrary base
#KT-26161
2018-08-30 14:58:35 +03:00
Ilya Gorbunov
c1d1a7108f Provide unsigned number to string conversion in arbitrary base
#KT-26161
2018-08-30 14:58:33 +03:00
Ilya Gorbunov
47162590eb Add a credit for Guava implementation of unsigned division and remainder 2018-08-30 14:58:30 +03:00
Ilya Gorbunov
abdd971d92 More contentHashCode tests for arrays 2018-08-30 14:58:28 +03:00
Ilya Gorbunov
4df665bc78 Generate extensions for unsigned arrays and provide tests for them
- contentEquals, contentToString, contentHashCode
- as[Signed]Array, as[Unsigned]Array
- to[Signed]Array, to[Unsigned]Array
- toTypedArray
- copyOf(), copyOf(newSize), copyOfRange(...)
2018-08-30 14:58:26 +03:00
Ilya Gorbunov
6360cc3cb5 Unsigned arrays: expose storage field as internal PublishedApi
To be able to write basic extensions that access storage array.
2018-08-30 14:58:24 +03:00
Ilya Gorbunov
6d33313d2e Regenerate range iteration tests 2018-08-30 14:58:22 +03:00
Ilya Gorbunov
3d2eb36486 Generate until, downTo, step, reversed functions for unsigned ranges/progressions 2018-08-30 14:58:20 +03:00
Ilya Gorbunov
add0894f54 Support unsigned types and array specializations in stdlib generator 2018-08-30 14:58:18 +03:00
Ilya Gorbunov
76ff4c9b2f Remove custom hashCode and equals from unsigned types
The generated ones are ok now (on JVM)
2018-08-30 14:58:16 +03:00
Ilya Gorbunov
f367322084 Introduce associateWith and associateWithTo functions
#KT-13814
2018-08-30 14:58:14 +03:00
Ilya Gorbunov
751e844258 Support having primary type parameter other than T in generated code
With some limitations: the primary parameter cannot have constraints for now.
2018-08-30 14:58:11 +03:00
Roman Elizarov
929064dfa7 Adjust SequenceBuilder to the new coroutines API
* Continuation.resumeWith(SuccessOrFailure)
* createCoroutineUnintercepted

(cherry picked from commit 8bbd78c)
2018-08-30 14:58:09 +03:00
Ilya Gorbunov
6400687f2a Restore experimental SequenceBuilder 2018-08-30 14:58:07 +03:00
Ilya Gorbunov
0ceceaaa6a Restore history of SequenceBuilder from experimental coroutines 2018-08-30 14:58:05 +03:00
Ilya Gorbunov
47996dbf47 Temporary remove SequenceBuilder 2018-08-30 14:58:03 +03:00
Ilya Gorbunov
38d8451d1c Remove unused and unnecessary classpath entries in compiler tests
Also remove obsolete additional path arguments for runIde task.
2018-08-30 14:58:01 +03:00
Ilya Gorbunov
237d870618 Change kotlin-runtime dependency to kotlin-stdlib in Kotlin runner and ant task 2018-08-30 14:57:59 +03:00
Ilya Gorbunov
e59141e32c Replace kotlin-stdlib-jreN usages in tests and samples 2018-08-30 14:57:56 +03:00
Ilya Gorbunov
16148a30c1 Remove or replace deprecated kotlin-runtime artifact usages 2018-08-30 14:57:54 +03:00
Ilya Gorbunov
c8becbd335 Stop distributing and publishing obsolete artifacts
Keep stdlib-jreN dist for tests only.

#KT-23799
2018-08-30 14:57:52 +03:00
Ilmir Usmanov
b7b5fd75b8 Minor. Fix tests 2018-08-30 14:57:50 +03:00
Ilmir Usmanov
e93683621a Implement callSuspend and callSuspendBy functions as KCallable's
extension methods.
Also make isSuspend a member of KCallable.
 #KT-21972: Fixed
2018-08-30 14:57:48 +03:00
Denis Zharkov
66315cee45 Fix coroutine-related test data 2018-08-30 14:57:46 +03:00
Denis Zharkov
c12bfe312a Make experimental/release COROUTINE_SUSPENDED reference the same instance
It's necessary when mixing experimental/release coroutines together

 #KT-25683 In Progress
2018-08-30 14:57:44 +03:00
Denis Zharkov
3a7f8dcf3a Allow calling some pieces of the experimental coroutine API
- Calling suspend functions is allowed
- Presence of suspend function type still makes declaration
unusable unless it belongs to a value parameter as a top-level type
containing less then three parameters

Still, warning should be emitted because they will become unsupported in 1.4

 #KT-25683 In Progress
2018-08-30 14:57:41 +03:00
Alexey Sedunov
5ac5a8d723 Configuration: Do not auto-advance "Latest Stable" to pre-release version
#KT-25611 Fixed
2018-08-30 14:57:39 +03:00
Alexey Sedunov
a490781213 Configuration: Drop coroutines for language >= 1.3
#KT-25681 Fixed
2018-08-30 14:57:37 +03:00
Alexander Udalov
9f4c8d5b81 Minor, fix test data
Language version 1.3 is no longer experimental
2018-08-30 14:57:35 +03:00
Alexander Udalov
927706883e Do not report pre-release errors if release LV is used in pre-release compiler
This commit effectively reverts
d386712903.

The reason is that when using a release language version, you can only
"see" the subset of a pre-release library which consists of released and
supported features, so reporting an error is not helpful there. Also, it
presents a problem currently when using kotlinc 1.3 (which is
pre-release) with language version 1.2 (stable) against the bundled
stdlib of version 1.3 (pre-release)

 #KT-21267 Declined
2018-08-30 14:57:33 +03:00
Alexander Udalov
02a9b03007 Report a warning or error if an old language version or API version is used
#KT-25823 Fixed
2018-08-30 14:57:31 +03:00
Anton Bannykh
db29eadba5 Advance bootstrap to 1.3-M2-eap-82 2018-08-30 14:57:29 +03:00
Anton Bannykh
a83baee67b review fixes + DCE data update + test (un)muting 2018-08-30 14:57:27 +03:00
Anton Bannykh
2663d9751a JS: support unsigned constants inside string templates 2018-08-30 14:57:24 +03:00
Anton Bannykh
6103df0b31 JS: support signed constant expressions as unsigned primitive arguments 2018-08-30 14:57:22 +03:00
Anton Bannykh
934e11aa60 JS: support unsigned primitive vararg's 2018-08-30 14:57:20 +03:00
Anton Bannykh
944c5b6044 JS: modify a test to work around Kotlin/JS Double.toString problems 2018-08-30 14:57:18 +03:00
Anton Bannykh
a11c4871ea JS: equals, hashCode, toString support in inline classes 2018-08-30 14:57:16 +03:00
Ilya Gorbunov
a8596a9cd6 Rename experimental coroutines expect sources
In order not to clash in sources jar with expect sources of release coroutines
2018-08-30 14:57:14 +03:00
Alexey Tsvetkov
49bddcd220 Use release coroutines in evaluate tests 2018-08-30 14:57:12 +03:00
Dmitry Savvinov
756e5ece84 Revert "Disable contracts in 1.3-M1"
This reverts commit e866a3bd0d.
2018-08-30 14:57:10 +03:00
Alexander Udalov
254d943e07 Fix some tests in compileKotlinAgainstCustomBinaries 2018-08-30 14:57:07 +03:00
Ilya Gorbunov
357c5be4fb Make sure index and count do not overflow for long sequences
Throw an exception immediately before an overflow becomes observable.
Place check to prevent negative index from indexOf, indexOfFirst.
Do not insert overflow checks for arrays, lists, maps and char sequences.

#KT-16097
2018-08-30 14:57:05 +03:00
Ilya Gorbunov
c44f62a3d4 Allow dropping and taking a lot of elements in very long sequences
For example allow dropping and taking Int.MAX_VALUE elements from
a sequence that is a result of another Int.MAX_VALUE dropping.
2018-08-30 14:57:03 +03:00
Ilya Gorbunov
eaa0902ea5 Add a class for long-running sequence/iterable tests
These tests will not run neither locally nor on CI unless the explicit
"kotlin.stdlib.test.long.sequences" parameter is specified.
2018-08-30 14:57:01 +03:00
Ilya Gorbunov
2df78fc81a Introduce common ArithmeticException
Make divisionByZero test still fail in JS after introducing ArithmeticException
2018-08-30 14:56:59 +03:00
Alexander Udalov
ceb909d261 Inherit KType from KAnnotatedElement, implement KType.annotations
#KT-16795 Fixed
2018-08-30 14:56:57 +03:00
Alexey Tsvetkov
e4bbe2d5e2 Fix coroutines default value checks in KotlinProjectIT 2018-08-30 14:56:55 +03:00
Ilya Gorbunov
a0b0994651 Make unsigned array constructor-like functions inline-only 2018-08-30 14:56:53 +03:00
Ilya Gorbunov
f9479d12f9 Add missing unsigned array constructors (from size)
#KT-25961 Fixed
2018-08-30 14:56:51 +03:00
Ilya Gorbunov
282cf73aff Update public API: inline classes codegen changes 2018-08-30 14:56:48 +03:00
Ilya Gorbunov
99de68507d Workaround for new MPP dependency configuration limitations 2018-08-30 14:56:46 +03:00
Ilya Gorbunov
6174ae7af6 Advance bootstrap to 1.3-M2-eap-35 2018-08-30 14:56:44 +03:00
Alexander Udalov
b55fc818d1 Support JvmName on annotation constructor parameters
#KT-25372 Fixed
2018-08-30 14:56:42 +03:00
Alexander Udalov
dc1f4c7d5b Generate get-targeted annotations on annotation constructor parameters
This change would also make NotNull annotations to be generated on
non-primitive annotation methods, but we skip this deliberately because
annotation methods never return null on JVM anyway

 #KT-25287 Fixed
2018-08-30 14:56:40 +03:00
Alexey Tsvetkov
9df949c039 Remove non default coroutines options from Gradle tests
They don't have any effect anyway
2018-08-30 14:56:38 +03:00
Alexey Tsvetkov
a3d78f769b Add Coroutines.DEFAULT to Gradle plugin
See CommonCompilerArguments changes
2018-08-30 14:56:36 +03:00
Ilya Gorbunov
c26b202907 Make StringBuilder.clear extension inline in JS
#KT-18910
2018-08-30 14:56:34 +03:00
Ilya Gorbunov
5412227380 Unify Regex.split behavior in JVM, JS regarding empty match delimiters
Rewrite split implementation for JVM

#KT-21049
2018-08-30 14:56:31 +03:00
Ilya Gorbunov
85af1f5d38 Improve argument validation in copyOfRange
Make copyOfRange implementation non-inline in order not to expose
copyOfRangeToIndexCheck implementation detail.

It will be possible to make the function non-inline itself later without
that JvmName trick, when apiVersion 1.2 support is discontinued.

#KT-19489
2018-08-30 14:56:29 +03:00
Ilya Gorbunov
58a3b64baf Add argument validation in copyOf(newSize) in JS
#KT-19489
2018-08-30 14:56:27 +03:00
Ilya Gorbunov
93540e476e stdlib-gen: tweak to build with 1.3 compiler, turn off ReleaseCoroutines 2018-08-30 14:56:25 +03:00
Ilya Gorbunov
17e04b2665 Deprecate readBytes with estimatedSize parameter, add overload without parameters
Add a test for readBytes.

#KT-19305 Fixed
2018-08-30 14:56:23 +03:00
Alexander Udalov
cbc92bc9a1 Add KClass.sealedSubclasses to get direct subclasses of sealed class
#KT-14657 Fixed
2018-08-30 14:56:21 +03:00
Ilya Gorbunov
1b1713a849 Simplify long constants in range iteration tests 2018-08-30 14:56:19 +03:00
Ilya Gorbunov
bb1ce52267 Add support for generating unsigned progression iteration codegen tests 2018-08-30 14:56:17 +03:00
Ilya Gorbunov
1dbaaf7f8a Begin test coverage for unsigned ranges and progressions 2018-08-30 14:56:15 +03:00
Ilya Gorbunov
f010231ff7 Change range iteration tests so they are runnable on all platforms
Remove JS and Native backend exclusions
2018-08-30 14:56:13 +03:00
Ilya Gorbunov
e18bebf12a Fix plain wrong unsigned rem implementation 2018-08-30 14:56:10 +03:00
Ilya Gorbunov
b412143fce Aggregate coroutines tests under 'check' task instead of 'test'
Otherwise --tests "pattern" gradle option has problem as it's applied
to both 'test' and `coroutinesTest` tasks and fails to match tests in one of them
2018-08-30 14:56:08 +03:00
Ilya Gorbunov
b68c27178d Do not use MIN_VALUE step in tests
#KT-17176
2018-08-30 14:56:06 +03:00
Ilya Gorbunov
7dc6c3d7ce Prohibit MIN_VALUE step for unsigned progressions 2018-08-30 14:56:04 +03:00
Ilya Gorbunov
4e574cb017 Improve exception message for invalid steps and document step requirements
#KT-17176
2018-08-30 14:56:02 +03:00
Pap Lőrinc
bdf623f711 Prohibit step size of min value, as it doesn't have a negated counterpart
#KT-17176
2018-08-30 14:56:00 +03:00
Vyacheslav Gerasimov
c6c3b05d02 as32: Update build range for AS 3.2 plugin to match RC1 and further releases 2018-08-30 14:55:58 +03:00
Alexander Udalov
877dfd8ff4 Fix generic signature of FunctionN type visible from Java 2018-08-30 14:55:56 +03:00
Vyacheslav Gerasimov
348ce6733d Update build range for AS 3.2 plugin to match next AS 3.2 releases 2018-08-30 14:55:54 +03:00
Vyacheslav Gerasimov
d5009e4fb4 as33c4: Remove registration of AndroidGradleOrderEnumerationHandler from gradle-java.xml 2018-08-30 14:55:52 +03:00
Ilmir Usmanov
cf1f194f8b Add warning on -Xcoroutines flag use
The only case when warning is not reported is -Xcoroutines=default.
But this is OK until the flag is removed completely.
2018-08-30 14:55:50 +03:00
Ilya Gorbunov
8f6d2b70a9 Add stdlib test for Boolean companion 2018-08-30 14:55:48 +03:00
Ilya Gorbunov
5f3a7f0147 Use Char.MIN_VALUE and MAX_VALUE in tests 2018-08-30 14:55:45 +03:00
Ilya Gorbunov
92e149fa40 Add tests for SIZE_BYTES and SIZE_BITS constants
#KT-8247 Fixed
2018-08-30 14:55:43 +03:00
Ilya Gorbunov
fa2f1311d7 Add tests for UInt, ULong
Opt-in to use unsigned types in tests
2018-08-30 14:55:41 +03:00
Ilya Gorbunov
fb62507e51 Switch bootstrap to 1.3 branch, build 1.3-M1-eap-77 2018-08-30 14:55:39 +03:00
Ilya Gorbunov
26b258af6a Unignore passing tests with unsigned literals in JS 2018-08-30 14:55:37 +03:00
Mikhail Zarechenskiy
d94b47bcd3 Support other kinds of translation for unsigned literals 2018-08-30 14:55:34 +03:00
Roman Artemev
d1df5f5783 Fix unsigned constants translation (Int to UInt) 2018-08-30 14:54:30 +03:00
Mikhail Zarechenskiy
61efbea9a8 Initial support of unsigned literals translation in JS 2018-08-30 14:54:27 +03:00
Ilya Gorbunov
1792a77a47 Generate hashCode and equals for unsigned types 2018-08-30 14:52:51 +03:00
Ilya Gorbunov
e2310343d4 Opt-in to use unsigned types in various internal utils 2018-08-30 14:52:49 +03:00
Ilya Gorbunov
db7f4bb402 Deprecate js Math.random and provide replacement with Random.nextDouble
#KT-23564 Fixed
2018-08-30 14:52:47 +03:00
Dmitry Savvinov
402f8880a9 Disable contracts in 1.3-M1
^KT-25538 Fixed
2018-08-30 14:52:45 +03:00
Ilya Gorbunov
e4d7efcf06 Update expected reachable node count in JS tests
Caused by new coroutine API an its js support
2018-08-30 14:52:43 +03:00
Ilya Gorbunov
516ea04d18 Update expected reachable node count in JS tests
Caused by introduction of new random API
2018-08-30 14:52:40 +03:00
Alexander Udalov
c369e67e9f Revert "Ignore tests on big function types until master is 1.3"
This reverts commit f03dc62173.
2018-08-30 14:52:38 +03:00
Alexander Udalov
082da82f3e Introduce kotlin.jvm.functions.FunctionN
#KT-13764
2018-08-30 14:52:36 +03:00
Alexander Udalov
51979b9ffa Convert FunctionBase to Kotlin, add type parameter to Lambda
This will make it possible to avoid raw types when inheriting from both
FunctionBase and Function<R>. This change adds a generic type parameter
to FunctionBase and Lambda which is not source-breaking under our policy
because both FunctionBase and Lambda are internal classes (located in
package kotlin.jvm.internal)
2018-08-30 14:52:33 +03:00
Alexander Udalov
e35ebff4e1 Move superinterface to the only subclass of FunctionBase 2018-08-30 14:51:17 +03:00
Ilya Gorbunov
07a0cb91d4 Introduce Char.MIN_VALUE and MAX_VALUE constants (KT-21763)
Add Char.MIN_VALUE and Char.MAX_VALUE implementations in primitive companion objects.
Update builtins test data and public API.

Co-authored-by: Oskar Drozda <themppsplx@gmail.com>
2018-08-30 14:51:14 +03:00
Ilya Gorbunov
5ee3cc59b3 Split summary from description in Char docs 2018-08-30 14:51:12 +03:00
Ilya Gorbunov
0c50014e7a Introduce SIZE_BYTES and SIZE_BITS constants for all integral types
#KT-8247 Fixed
2018-08-30 14:51:10 +03:00
Ilya Gorbunov
31d7aae98d Annotate companion object declaration with SinceKotlin
Move it to the end of the class declaration.
Update builtins testdata
2018-08-30 14:51:08 +03:00
Kerooker
be2ba61f13 Removed Boolean from ClassMapperLite to avoid compiler confusion 2018-08-30 14:51:06 +03:00
Kerooker
af5f78076c KT-7922 Added Boolean Companion Object 2018-08-30 14:51:04 +03:00
Ilya Gorbunov
cd0906a357 Improve isNullOrEmpty() extensions
- Annotate with SinceKotlin("1.3") and InlineOnly
- Add contract linking the receiver and the returned value
- Unify wording in docs
- Add sample for Map.isNullOrEmpty

#KT-23279
2018-08-30 14:51:02 +03:00
Mon_chi
d0788148e2 Add isNullOrEmpty() to Array, Collection, and Map. Fixes KT-23279 2018-08-30 14:51:00 +03:00
Jeff Wright
292f69936b Add Collections.isNullOrEmpty #KT-23279 2018-08-30 14:50:58 +03:00
Toshiaki Kameyama
6a140fb9ed "Useless call on collection type" inspection: Apply to 'kotlin.sequences.orEmpty' 2018-08-30 14:50:56 +03:00
Toshiaki Kameyama
c4b785de36 Add Sequence.orEmpty #KT-16552 Fixed 2018-08-30 14:50:54 +03:00
Ilya Gorbunov
2ce0bca34e Make bound check helpers top-level so they are compiled as static on JVM
Improve empty range exception text in nextInt/nextLong(range)
2018-08-30 14:50:52 +03:00
Ilya Gorbunov
35c927214d More efficient double generation in JS 2018-08-30 14:50:50 +03:00
Ilya Gorbunov
b96803248f Write random contract tests and fix implementations to pass them 2018-08-30 14:50:48 +03:00
Ilya Gorbunov
ed1f869354 Add xorwow random implementation test and fix implementation 2018-08-30 14:50:46 +03:00
Ilya Gorbunov
042a8ff6a2 Provide ThreadLocalRandom wrapper only on JDK8 as it is buggy in JDK7 2018-08-30 14:50:44 +03:00
Ilya Gorbunov
870f5e3448 Remove lazy initialization of default platform random 2018-08-30 14:50:42 +03:00
Ilya Gorbunov
fa33b1b5a9 Random docs and API refinement
KT-17261
2018-08-30 14:50:40 +03:00
Ilya Gorbunov
7e4528e217 Common shuffle/shuffled with the specified random source
KT-17261, KT-9010
2018-08-30 14:50:38 +03:00
Ilya Gorbunov
cc031e3a40 Provide common Random API
#KT-17261
2018-08-30 14:50:36 +03:00
Ilmir Usmanov
9df411481c Do not coerce function literals to suspend.
The design is to use `suspend fun` instead of coercion, just as suspend
lambdas.
However, this syntax is not supported in the parser. But this is not a
problem, since the coercion lead to internal compiler error.
As a workaround everybody uses suspend lambdas.
 #KT-24860: Fixed
2018-08-30 14:50:33 +03:00
Ilya Gorbunov
d57e1bb68b Migrate stepping and evaluation tests to the new coroutine API 2018-08-30 14:50:31 +03:00
Ilya Gorbunov
bbee18b84d Introduce StringBuilder.clear() extension
#KT-18910 Fixed
2018-08-30 14:50:29 +03:00
Ilya Gorbunov
c667340261 Allow pre-release compiler reading pre-release binaries in tests
Pre-release compiler should be able to read pre-release binaries in tests
even if a stable language version is used, otherwise no stdlib API can be read.
2018-08-30 14:50:27 +03:00
Alexander Udalov
f423403167 Make kotlin.Metadata public
Prohibit explicit usage of `@Metadata` to prevent possible
AnnotationFormatError at runtime

 #KT-23602 Fixed
2018-08-30 14:50:25 +03:00
Ilya Gorbunov
8102e512d3 For bootstrapping on 1.3-M1: compile parts that can be used in .gradle.kts scripts with 1.2 language version 2018-08-30 14:50:23 +03:00
Ilya Gorbunov
b160561795 Include new coroutines and unsigned classes into stdlib
Fix clashing module name in common coroutines sourceset
2018-08-30 14:50:21 +03:00
Ilya Gorbunov
4c6c0aa279 Update public API test due to ProperVisibilityForCompanionObjectInstanceField 2018-08-30 14:50:19 +03:00
Ilya Gorbunov
76e581fe4f Temporarily turn off ReleaseCoroutines feature 2018-08-30 14:50:16 +03:00
Ilya Gorbunov
d4a195c757 Advance maven project versions to 1.3-SNAPSHOT 2018-08-30 14:49:30 +03:00
Ilya Gorbunov
0f5f90cf52 Advance project version to 1.3-SNAPSHOT
Set LATEST_STABLE language version and current version of stdlib to 1.3, set IS_PRE_RELEASE
Remove "EXPERIMENTAL" from 1.3 version description in tests and gradle options
2018-08-30 14:49:27 +03:00
Natalia Selezneva
5b29528386 Scripting Console files shouldn't have scratch panel
KT-25818 Fixed
2018-08-30 12:35:54 +03:00
Natalia Selezneva
472e3a7178 Simpify message in commit dialog for java to kt renames
^KT-26073
2018-08-30 12:35:54 +03:00
Natalia Selezneva
2fe4f95d33 Gradle project configurator: fix inserting of non-kotlin library version in gradle.kts files 2018-08-30 12:35:53 +03:00
Natalia Selezneva
4671fa0136 Mute some multiplatform test for Gradle 4.9 2018-08-30 12:35:52 +03:00
Natalia Selezneva
81f4bd3846 Add tests for configuring kotlin with gradle 4.9 2018-08-30 12:35:52 +03:00
Sergey Rostov
81b519286f ScriptDependenciesLoader: Fix freeze on notifyRootsChanged
In 4f3f4dd, launch(EDT(project)) was replaced with TransactionGuard.submitTransaction to fix write in write-unsafe context.
Unfortunately submitTransaction will call action immediately if we are already on EDT. This causes IDE freeze.
By replacing submitTransaction with submitTransactionLater we are postponing work to the end of events queue (as it was before 4f3f4dd).
Also in isUnitTestMode we need to call action immediately as it was before 4f3f4dd.

#KT-25958 Fixed
2018-08-30 10:59:32 +03:00
Yan Zhulanow
ddb034715d Gradle importer: Join compiler plugin options as before the new MPP refactoring (KT-26424)
Android Studio has at least two kinds of importers: a generic one (that is run when the "Refresh Gradle model" tool button is pressed) and a fast one (is run on the build variant switch). Fast importer doesn't invoke our import handlers (AndroidExtensionsGradleImportHandler) that modify the compiler options stored in Kotlin facet in some way.

Until the recent MPP importer refactoring both old and new options were saved in the Kotlin facet; now only the new options persist. This is certainly better, though it breaks the existing behavior (as the options added by import handlers become lost).

The alternative approach is to re-design import handlers in a way they won't require the whole module/source set node (so we can invoke them every time), though it requires a way more changes.
2018-08-29 19:16:16 +05:00
kenji tomita
e5841441c9 Fix #KT-26353 'Make variable immutable' is a bad name for a quickfix that changes 'var' to 'val' 2018-08-29 16:27:46 +03:00
Alexander Udalov
e85dcfc3e3 Fix compatibility with Android plugin broken in 896cf61 2018-08-29 15:24:58 +02:00
Toshiaki Kameyama
3ea0222d43 "Add annotation target" quickfix: add SOURCE retention when target is EXPRESSION #KT-26306 Fixed 2018-08-29 16:18:04 +03:00
Denis Vnukov
ddf92ef187 Creating IrLineNumberTestGenerated, adding line numbers for few common expressions
This PR enables LineNumberTestGenerated test on IR backend. The testing of
hardcoded sequence of line numbers is replaced with mere checks for set-like
checks for expected line numbers.
2018-08-29 12:52:20 +02:00
Ilya Gorbunov
36936d252c Support multiple expectedBy dependencies when building -Xcommon-sources list
`addCommonSourceSetToPlatformSourceSet` may be called multiple times during
a platform project configuration.
2018-08-28 19:13:36 +03:00
Zalim Bashorov
b2d9254bfd Fix testdata 2018-08-28 16:30:15 +03:00
Vyacheslav Gerasimov
bf4ded3991 Add org.jetbrains.markdown to test runtime of idea project 2018-08-28 15:20:03 +03:00
Pavel Punegov
1ea9c2d4ba Replace min with coerceAtMost in test 2018-08-28 13:48:44 +03:00
Pavel Punegov
1c5ebacf0f Disable 1.3 version coroutines in Native and incorrect genericProperty test 2018-08-28 13:48:44 +03:00
Pavel Punegov
9eb78fc490 Disable tests that fail in NATIVE 2018-08-28 13:48:44 +03:00
Pavel Punegov
39a65a099a Disable IEEE754 tests with improper comparisons behaviour in Native 2018-08-28 13:48:44 +03:00
Pavel Punegov
1a7d366733 Disable JVM tests in native 2018-08-28 13:48:44 +03:00
Pavel Punegov
0c8f34a934 Disable JVM assertions in native 2018-08-28 13:48:44 +03:00
Pavel Punegov
e2efeb70f7 Zip stdlib tests 2018-08-28 13:48:43 +03:00
Pavel Punegov
2ff6047845 Update ignore tag for Native backend 2018-08-28 13:48:43 +03:00
Alexander Udalov
4219aff548 Refactor DescriptorRenderer's renderAccessors option
In some tests with txt (probably all except loadJava), property
accessors are not rendered at all, so a third option value (NONE) will
be useful to determine whether we need to render annotations on property
accessors as get/set/sparam-targeted annotations on the property
2018-08-27 23:37:06 +02:00
Alexander Udalov
896cf61443 Move JVM-specific annotation FQ names and utils to frontend.java 2018-08-27 23:37:06 +02:00
Alexander Udalov
ab441dcd96 Drop PropertyDescriptorImpl.setType that takes KotlinType
Only use the other setType that takes an instance of
ReceiverParameterDescriptor. This will make sure that call sites can
use correct receiver annotations
2018-08-27 23:37:05 +02:00
Alexander Udalov
34c033bcaf Take ReceiverParameterDescriptor in FunctionDescriptorImpl.initialize
Instead of just KotlinType. This will allow to pass annotations on the
receiver at call sites
2018-08-27 23:37:04 +02:00
Alexander Udalov
6fb39785ff Postpone force resolve of annotations on properties
Otherwise (after subsequent commits) we may end up calling
BindingContext.HAS_BACKING_FIELD too early and getting incorrect value,
which will influence which annotations the property and the field will
have, and since they're cached as soon as they're computed, they will
remain incorrect until the end of the program. Now we're calling force
resolve after bodies of property accessors are resolved, which is the
point where the backing field presence has been already determined for
certain.

This all still looks very fragile because we might try to get property's
annotations anywhere else before the accessors' bodies are analyzed, but
I have no idea at the moment how to improve this without refactoring the
whole subsystem
2018-08-27 23:36:25 +02:00
Alexander Udalov
8d44824875 Minor, use Annotations.EMPTY instead of empty AnnotationsImpl 2018-08-27 23:36:24 +02:00
Alexander Udalov
872f6e2cea Minor, make AnnotatedImpl not abstract 2018-08-27 23:36:24 +02:00
Alexander Udalov
50270293e3 Minor, improve assertion message in test 2018-08-27 23:36:24 +02:00
Vyacheslav Gerasimov
bc544d764a Refactor build repositories to reduce number of unnecessary request
Setup for all projects only local, jcenter and bootstrap repositories
2018-08-27 18:09:26 +03:00
Mikhael Bogdanov
ca5b19d0c6 Merge Java 8 write signature tests in common ones 2018-08-27 15:55:03 +02:00
Mikhael Bogdanov
7e7b556018 Minor. Reformat 2018-08-27 15:17:26 +02:00
Mikhael Bogdanov
7843d4e0d4 Minor. Code clean 2018-08-27 15:17:26 +02:00
Mikhael Bogdanov
efd93670f8 Migrate AbstractWriteSignatureTest.kt to CodegenTestCase stuff 2018-08-27 15:17:25 +02:00
Mikhail Zarechenskiy
3f79a752a5 Check for accessibility of unsigned types when using unsigned literals 2018-08-27 15:16:14 +03:00
Alexander Udalov
afd53c9870 Revert metadata version reading advancement for JS/Common
This commit reverts 59e2101a25 partially,
leaving only the implementation of KT-25972 for JVM. The reason is that
we can't fully commit to stabilizing JS (and .kotlin_metadata) binary
metadata formats so much as to postpone any changes done to it for a
whole release year time. It's likely that we will need to update JS
metadata format incompatibly pretty soon, and with the scheme where we
can read the "current + 1" version, it'd require advancing the metadata
version by 2, which would break the nice property that the metadata
version (since Kotlin 1.4) is equal to the version of the compiler that
produced it.

See KT-25972
2018-08-27 13:14:09 +02:00
Mikhail Zarechenskiy
4067d6b196 [NI] Fix overload resolution ambiguity for incorrect provideDelegate
#KT-25810
2018-08-27 13:49:19 +03:00
Toshiaki Kameyama
ae4ff45750 "Remove redundant let" inspection: do not report for long call chains #KT-26289 Fixed 2018-08-27 13:42:25 +03:00
Toshiaki Kameyama
c6db26ba91 "Replace 'if' with elvis operator": Don't suggest on nullable type check #KT-25886 Fixed 2018-08-27 13:33:46 +03:00
Toshiaki Kameyama
1a31ce769c Fix false negative in not reduceable binary expression #KT-26179 Fixed 2018-08-27 13:32:49 +03:00
Toshiaki Kameyama
8f80851b9a if then to elvis: support calling extension function in class #KT-26343 Fixed 2018-08-27 13:31:04 +03:00
Toshiaki Kameyama
b34f32d4f3 "Remove redundant backticks": Fix false positive for yield #KT-25968 Fixed 2018-08-27 13:10:57 +03:00
Toshiaki Kameyama
362e6863ac "Replace if with when": Do not remove block braces if block has single lambda expression #KT-26187 Fixed 2018-08-27 12:54:45 +03:00
kenji tomita
e59427edab Fix false positive for if-else 2018-08-27 12:53:35 +03:00
Toshiaki Kameyama
0099b7b3b1 "Remove explicit type specification" intention: Add type argument to initializer if need #KT-13343 Fixed 2018-08-27 12:35:32 +03:00
Alexander Podkhalyuzin
54922362e3 Added Kotlin svg icon to the distribution
#KT-26393 Fixed
2018-08-25 17:21:50 +03:00
Alexander Podkhalyuzin
c0e92ba350 Added resolve scope enlarger to module infos in Kotlin
From now it's possible to enlarge resolve scope for analysis in IDE,
the only difference is that it's based on module file.

#KT-26313 Fixed
2018-08-25 11:22:50 +03:00
Alexander Udalov
a9a8925409 Revert "Report error on .class files produced by Kotlin 1.3-M1"
This reverts commit ba111d58ae.

The reverted commit only makes sense after a bootstrap step after
advancing the metadata version, which has not yet happened in master,
but did happen in 1.3-M2, where this commit was supposed to end up
2018-08-24 22:38:59 +02:00
Vyacheslav Gerasimov
0dd410a5bb Make CommandAdapter.beforeCommandFinished override compatible with 183 platform 2018-08-24 22:19:28 +03:00
Juan Chen
1a562d477a Add sync after Kotlin configured in Android Studio projects. 2018-08-24 22:07:36 +03:00
Mikhael Bogdanov
f21dd9f801 Minor. Review fixes 2018-08-24 20:22:33 +02:00
Mikhael Bogdanov
367ab5470c Minor. Code clean 2018-08-24 20:22:32 +02:00
Mikhael Bogdanov
4687381179 Convert AbstractLineNumberTest.java to Kotlin 2018-08-24 20:17:25 +02:00
Mikhael Bogdanov
c28b9f75e3 Rename .java to .kt 2018-08-24 20:17:24 +02:00
Mikhael Bogdanov
de02e97f39 Print generated bytecode on AbstractCheckLocalVariablesTableTest fail 2018-08-24 20:17:23 +02:00
Mikhael Bogdanov
9a1b2daa12 Minor. Code clean 2018-08-24 20:17:21 +02:00
Mikhael Bogdanov
f06b6ed47e Convert AbstractCheckLocalVariablesTableTest.java to Kotlin 2018-08-24 20:17:20 +02:00
Mikhael Bogdanov
614fad016f Rename .java to .kt 2018-08-24 20:17:19 +02:00
Mikhael Bogdanov
232170b72a Migrate AbstractIrCheckLocalVariablesTableTest to CodegenTestCase stuff 2018-08-24 20:17:18 +02:00
Alexander Udalov
ba111d58ae Report error on .class files produced by Kotlin 1.3-M1
Advance incremental cache version to force rebuild after switching from
1.3-M1 to 1.3-M2
2018-08-24 18:49:55 +02:00
Cuihtlauac ALVARADO
813d7ff84a Remove useless parameter
It seems a candidate is added either when requiresExtensionReceiver is true and
receiver is not null or when requiresExtensionReceiver is false and receiver is null.
Consequently, f appears useless.
2018-08-24 18:48:03 +03:00
Cuihtlauac ALVARADO
eb7d77ebd9 Accept renaming and formating requests
* Rename "resolve" into "resolveCandidates"
* Use multi-line formatting for formal parameters
* Move ")" down one line at call sites
2018-08-24 18:48:03 +03:00
Cuihtlauac ALVARADO
bf08755969 Factor duplicated code.
Move SimpleScopeTowerProcessor from TowerResolver into ScopeTowerProcessors.

Lift code duplicated in functions:

  * ExplicitReceiverScopeTowerProcessor.simpleProcess()
  * QualifierScopeTowerProcessor.simpleProcess()
  * NoExplicitReceiverScopeTowerProcessor.simpleProcess()

into AbstractSimpleScopeTowerProcessor. Turn it into a function and call it
in the various context. Incidentally, now useless functions resolveAsMember()
and resolveAsExtension() are  removed.
2018-08-24 18:48:03 +03:00
Alexey Sedunov
7ae740dd91 MPP: Add tests for new MPP model import 2018-08-24 18:00:57 +03:00
Mikhail Glukhikh
ded652382b "Deferred result not used": report all Deferred results by default
#KT-26181 Fixed
2018-08-24 18:00:56 +03:00
Mikhail Glukhikh
564ea629d1 Add annotations to primary constructor together with 'constructor'
This fixes incorrect behaviour if primary constructor has no explicit
'constructor' keywork
#KT-25548 Fixed
2018-08-24 18:00:54 +03:00
Mikhail Glukhikh
c12f29ae30 Enhance inspection about SuccessOrFailure (related to KT-25621)
Increase performance by searching first SuccessOrFailure/runCatching/etc
in text of functions without return type.
Remove stdlib false positives, like success() & failure().
For catching extension, check also non-catching members.
Add "rename to *Catching" fix.
2018-08-24 18:00:46 +03:00
Mikhail Glukhikh
7a2d0a3bb2 Add inspection "Redundant runCatching {}" (related to KT-25621) 2018-08-24 18:00:44 +03:00
Mikhail Glukhikh
2084e94099 Add quick-fix "add .getOrThrow()" for SuccessOrFailure inspection
#KT-25621 Fixed
2018-08-24 18:00:42 +03:00
Mikhail Glukhikh
87d750aa1c Add inspection to detect functions with SuccessOrFailure return type
Partial implementation of KT-25621 (no quick-fixes yet)
2018-08-24 18:00:41 +03:00
Ivan Gavrilovic
48784fd95e Use new API for getting the raw Android resources
A new method has been added in the Android Gradle
plugin 3.3.0. This commit switches from ussing the
MergeResources task, and uses getAllRawAndroidResources
API instead.

Test: manually verified
2018-08-24 17:28:40 +03:00
Roman Artemev
5dcb02466a Update test data 2018-08-24 15:49:13 +03:00
Roman Artemev
2e5940e46d [JS IR BE] Fix object instance reference
* set it in primary constructor prior to constructor body
2018-08-24 15:49:13 +03:00
Roman Artemev
85a8af13cf [JS IR BE] Fix constructor parent 2018-08-24 15:49:13 +03:00
Georgy Bronnikov
30a2058f74 Fix JVM_IR backend crashes when compiling for Android
^KT-23963 Fixed
^KT-23968 FIxed
^KT-23972 Fixed
2018-08-24 15:46:44 +03:00
Roman Artemev
cc14442be1 Add tests for primitive companion object
Update test data
2018-08-24 14:58:42 +03:00
Roman Artemev
450ed63690 [JS IR BE] Implement primitive companion object 2018-08-24 14:58:42 +03:00
Dmitry Petrov
2a524920a5 Don't remap inline function args requiring inline class boxing/unboxing
Same as for primitives: inline lambda expects to see a boxed value,
so, even if an argument is a local variable, it can't be remapped,
because it contains unboxed representation.
2018-08-24 14:52:29 +03:00
Dmitry Petrov
6e2d05cd94 Fix argument original type order in InlineCodegen
Arguments are put on stack in the direct order, and then stored into
local variables for inlining in the reversed order:

    <arg0>
    <arg1>
    <arg2>
    store <param2>
    store <param1>
    store <param0>

Original value parameter types were taken in direct order, though.
2018-08-24 14:52:29 +03:00
Mikhael Bogdanov
25b32b8e1d Migrate AbstractLineNumberTest to CodegenTestCase stuff 2018-08-24 13:39:22 +02:00
Alexander Udalov
9c68f2be36 Advance metadata versions and JVM bytecode version
JVM versions are increased in order to differentiate pre-1.3-M2 .class
files where signatures mentioning inline classes were not mangled. Other
versions are increased in case something similar will need to be
detected
2018-08-24 13:01:53 +02:00
Georgy Bronnikov
50e8f7efc7 Track fake overrides for IrField 2018-08-24 13:41:52 +03:00
Yan Zhulanow
01d5e227f0 Pill: Fix resource roots importing 2018-08-24 15:29:55 +05:00
Yan Zhulanow
b7873edf30 Pill: Fix issue with clashing sdk-common.jar and sdk-common-26.1.2.jar
Move sdk-common.jar to the end of the classpath
2018-08-24 15:29:55 +05:00
Yan Zhulanow
267e239e52 Pill: Refactoring, introduce a generic predicate in DependencyMapper 2018-08-24 15:29:55 +05:00
Denis Zharkov
83a431fca3 Introduce redundant enum CoroutineSingletons in experimental.intrinsics 2018-08-24 10:55:12 +03:00
Yan Zhulanow
bda14fcbb2 Unresolved reference not reported on data class constructor @get annotation (KT-19628) 2018-08-24 04:28:16 +05:00
Yan Zhulanow
463f8dae6a Pill: Add '-ea' option to the default JUnit configuration if missing 2018-08-24 04:28:15 +05:00
Yan Zhulanow
b145c97b37 Kapt: Restore line mappings correctly for nested classes and its members 2018-08-24 04:28:13 +05:00
Yan Zhulanow
2328cecffe Minor: Add kotlinx-metadata and kotlinx-metadata-jvm to Pill 2018-08-24 04:28:12 +05:00
Yan Zhulanow
c83581e6b8 Kapt: Strict mode. Issue an error if the converter fails to process a class (#KT-25518, #KT-24272) 2018-08-24 04:28:11 +05:00
Yan Zhulanow
ef210d7122 Kapt: Do not write references to anonymous classes to stubs & metadata (#KT-25374) 2018-08-24 04:28:09 +05:00
Yan Zhulanow
43f5971863 Remove unneeded 'idea-full' dependency from compiler plugin test runtime classpath 2018-08-24 04:28:08 +05:00
Yan Zhulanow
834ece7d63 Debugger: Remove type checking in file ranking calculator
Type checking makes checking slower and less stable.
2018-08-24 04:28:07 +05:00
Yan Zhulanow
d0fd74982d Parcelize, Minor: Fix tests (writeToParcel/describeContents are not final anymore) 2018-08-24 04:28:06 +05:00
Yan Zhulanow
d08a32c7cb Kapt: Ignore annotation-processing-gradle compiler plugin we got from Gradle (KT-24714)
Cause it's built for the shaded Kotlin compiler and won't work with JPS.
2018-08-24 04:28:05 +05:00
Yan Zhulanow
8c05769745 Parcelize: Fix infinite recursive loop for zero-parameter Parcelable classes (KT-25839) 2018-08-24 04:26:36 +05:00
Alexander Udalov
475a80b641 Do not write pre-release binaries for stable LV
This commit reverts f6571effcc and
reimplements the desired logic in another way.

In particular, we'd like these two conditions to hold:
1) only the release compiler with stable language settings (meaning,
   language version is a released version of Kotlin and no experimental
   features are enabled) should report errors when _reading_ pre-release
   binaries.
2) the compiler should _write_ pre-release binaries only if language
   settings are not stable, independent of whether the compiler itself
   is release or not.

From these conditions it follows that we must use different logic to
determine how to behave when reading/writing pre-release binaries.
Namely, reading (in CompilerDeserializationConfiguration) now checks if
both the compiler is release and the language settings are stable, and
writing (in LanguageVersionSettings.isPreRelease) checks only that the
language settings are stable
2018-08-23 23:11:30 +02:00
Vyacheslav Gerasimov
053a4b714c Refactor :kotlin-compiler project to allow project(":kotlin-compiler") dependencies 2018-08-23 21:55:26 +03:00
Mikhail Glukhikh
023b1b1880 Shorten quick-fix text of "Redundant async" #KT-25712 Fixed 2018-08-23 18:35:01 +03:00
Mikhail Glukhikh
3dc2c07b23 Simplify description of "Deferred result not used" #KT-25711 Fixed 2018-08-23 18:35:00 +03:00
Mikhail Glukhikh
b41ef6a807 Do not report "unused symbol" on experimental annotations
#KT-25609 Fixed
2018-08-23 18:34:59 +03:00
Mikhail Glukhikh
4113a6fd6a Extend fixes of experimental errors to property & type alias
#KT-25525 Fixed
#KT-25526 Fixed
2018-08-23 18:34:57 +03:00
Alexander Udalov
f6571effcc Do not report pre-release errors if release LV is used in pre-release compiler
This commit effectively reverts
d386712903.

The reason is that when using a release language version, you can only
"see" the subset of a pre-release library which consists of released and
supported features, so reporting an error is not helpful there. Also, it
presents a problem currently when using kotlinc 1.3 (which is
pre-release) with language version 1.2 (stable) against the bundled
stdlib of version 1.3 (pre-release)

 #KT-21267 Declined
2018-08-23 16:50:48 +02:00
Anton Bannykh
4e496cf2b2 JS: don't throw AssertionError from RedundantCallElimination
Also mark JS `call` function to avoid removing a custom `call`
2018-08-23 14:44:40 +03:00
Roman Artemev
0895f72570 Fix testdata 2018-08-23 14:10:11 +03:00
Dmitry Petrov
34548a0667 Fix primitive override with inline class in Kotlin-Java inheritance 2018-08-23 13:07:07 +03:00
Ilya Chernikov
01eca8bac8 Clean up properties collection 2018-08-23 09:51:53 +03:00
Ilya Chernikov
c2e6c0ed49 Rename ScriptingEnvironment to ScriptingHostConfiguration 2018-08-23 09:51:53 +03:00
Ilya Chernikov
2fe5f78921 Rename ScriptEvaluationEnvironment into ScriptEvaluationConfiguration 2018-08-23 09:51:53 +03:00
Ilya Chernikov
bb22dadc1e Rearrange compilation related API 2018-08-23 09:51:53 +03:00
Ilya Chernikov
bd8f2a81e9 Rename ScriptDefinition to ScriptCompileConfiguration 2018-08-23 09:51:53 +03:00
Ilya Chernikov
98c0a3bdaa Optimize script base class loading 2018-08-23 09:51:53 +03:00
Ilya Chernikov
d2195fc080 Fix default script definition 2018-08-23 09:51:53 +03:00
Ilya Chernikov
02431e4562 Fix build with proguard by removing unneeded library dep 2018-08-23 09:51:53 +03:00
Ilya Chernikov
da2b60ffa6 Fix discovery tests after refactoring 2018-08-23 09:51:53 +03:00
Ilya Chernikov
acb0f6c6a9 Remove ScriptCompileConfiguration as separate entity, refactor pieces accordingly 2018-08-23 09:51:53 +03:00
Ilya Chernikov
bda8089004 Fix asm annotations loading after annotations refactoring 2018-08-23 09:51:53 +03:00
Ilya Chernikov
2bf458d970 Drop unused files from removed project 2018-08-23 09:51:53 +03:00
Ilya Chernikov
ab63d59a56 Refactor definition keys 2018-08-23 09:51:53 +03:00
Ilya Chernikov
dbee426647 [minor] use java reflection in some places instead of kotlin one 2018-08-23 09:51:53 +03:00
Ilya Chernikov
1ea66e56c2 Fix annotations calculation in the bridge resolver 2018-08-23 09:51:53 +03:00
Ilya Chernikov
04ffe7754e Refactoring properties collection after review 2018-08-23 09:51:53 +03:00
Ilya Chernikov
74f8a541c0 Grand refactoring of the scripting DSL + many minor usability refactorings around it 2018-08-23 09:51:53 +03:00
Ilya Chernikov
45eaca1290 Add diagnostics chaining 2018-08-23 09:51:53 +03:00
Ilya Chernikov
3fb3aa5ad1 Setup props once, fix initialization problem 2018-08-23 09:51:53 +03:00
Ilya Chernikov
c41717d03b Make definition a part of the basic hosts, simplify usages 2018-08-23 09:51:53 +03:00
Ilya Chernikov
70ec004aaa Sorting default jvm props and basic implementations 2018-08-23 09:51:53 +03:00
Ilya Chernikov
fe2a11142e Renaming, commenting sample 2018-08-23 09:51:53 +03:00
Ilya Chernikov
3629583942 Add overridable method "setup" for defining properties 2018-08-23 09:51:53 +03:00
Ilya Chernikov
1de37ca765 Make KotlinScript annotation accepting all params needed to define a script 2018-08-23 09:51:53 +03:00
Ilya Chernikov
dafbd59707 Add shorter aliases for properties 2018-08-23 09:51:53 +03:00
Ilya Chernikov
df870b47b8 Add helpers for jvm dependencies from context 2018-08-23 09:51:53 +03:00
Ilya Chernikov
100b908a94 Add properties builders to the dsl, implement a builder for refineConfiguration 2018-08-23 09:51:53 +03:00
Ilya Chernikov
e5e1b8d100 Improve generic DSL 2018-08-23 09:51:53 +03:00
Ilya Chernikov
7a621405ae Add generic properties builder dsl, convert maven example to it 2018-08-23 09:51:53 +03:00
Ilya Chernikov
d0ed86c11c Add REPL interfaces to scripting API 2018-08-23 09:51:53 +03:00
Ilya Chernikov
5ca4a21edf Convert evaluator interface to function 2018-08-23 09:51:53 +03:00
Ilya Chernikov
9b7eeebaaa Convert compiler interface to function 2018-08-23 09:51:53 +03:00
Ilya Chernikov
cf2162c445 Refactor properties 2018-08-23 09:51:53 +03:00
Ilya Chernikov
904917c194 Make script definition a property bag directly 2018-08-23 09:51:53 +03:00
Ilya Chernikov
8953bba47c Pass scripting (host) environment independently from properties/configuration 2018-08-23 09:51:53 +03:00
Ilya Chernikov
91e6c0b77c Remove evaluator from script definition, simplify interface 2018-08-23 09:51:53 +03:00
Ilya Chernikov
e61ba1fd70 Replace dedicated configurator with definition properties + refine fun 2018-08-23 09:51:53 +03:00
Ilya Chernikov
a54675abe7 Clean and fix new scripting API 2018-08-23 09:51:53 +03:00
Vyacheslav Gerasimov
f2a8e5c248 Log name of the class caused LinkageError in SyntheticResolveExtension
#EA-120641: Now it is unclear which extension caused AbstractMethodError
2018-08-22 18:10:50 +03:00
Ilmir Usmanov
483094cac8 Minor. Streamline SuspendFunction{N} interfaces creation 2018-08-22 16:21:33 +03:00
Ilmir Usmanov
0559cfb724 Move SuspendFunction{N} interfaces to kotlin.coroutines package
#KT-25824: Fixed
2018-08-22 16:21:30 +03:00
Ilmir Usmanov
4a7703ed66 Implement correct is check for SuspendFunction
Let callable references implement SuspendFunction
Do not generate CHECKCAST SuspendFunction when LV is 1.2

 #KT-25825: Fixed
2018-08-22 16:21:27 +03:00
Nicolay Mitropolsky
9eb612a605 CreateCallableFromUsageFix always calls openInEditor to force proper editor and focus 2018-08-22 15:03:01 +03:00
Nicolay Mitropolsky
18db40474a KotlinElementActionsFactory uses createAddMethodActions to create properties 2018-08-22 15:03:01 +03:00
Dmitry Petrov
533f87ac33 Use proper KotlinType for prefix increment/decrement
Otherwise inline class values (such as UByte) are boxed incorrectly,
see KT-26219.
2018-08-22 12:24:50 +03:00
Toshiaki Kameyama
f1dc09f839 Add postfix template for the spread operator #KT-26249 Fixed 2018-08-22 10:56:39 +03:00
Alexey Tsvetkov
32d910320f Annotate KotlinNativeCompile#outputFile 2018-08-21 23:49:42 +03:00
Sergey Igushkin
ef85fe7ab2 Always apply the java-base plugin from the new MPP plugin
This fixes misconfigured test tasks and the `Usage` attribute
compatibility rule missing that is added by `java-base`.

Issue #KT-26301 Fixed
2018-08-21 22:54:50 +03:00
Sergey Igushkin
2040cdde4b Add missing Gradle task input path sensitivity
Fix after the commit 0f003802f
2018-08-21 22:54:49 +03:00
Anton Bannykh
04b04f919d JS: fix complex nested cross-module inlining (KT-26117 fixed) 2018-08-21 20:42:02 +03:00
Denis Zharkov
16a27d593c Optimize memory-footprint for RemoteLookupTrackerClient
Observations:
- In case of !requiresPosition we don't need to track position
- Also, in the latter case we don't need scopeKind (implicit contract)
- There were a lot of LookupInfo instances having two references
(fileName/scopeFqName) pointing to the same strings.
Looks like in common case (reasonable amount of files/fqnames) it's more
sensible to group lookups in the two-level-tree (implemented with nested maps)

It's expected to decrease memory consumption up to 15M in case of compiling
`idea` module in Kotlin project
2018-08-21 18:18:43 +03:00
Alexander Udalov
e41e28271b Use kotlinx-metadata-jvm of version 0.0.4 in kotlin-reflect build script
To prevent various problems with non-shaded artifact (shading was added
in 0.0.3)
2018-08-21 17:12:02 +02:00
Alexander Udalov
59e2101a25 Support reading binary metadata of the next major release
Already existing tests testRequireKotlinInNestedClassesAgainst14{,Js}
now check that there's no error when loading a module/class with
metadata version 1.4.0

 #KT-25972 Fixed
2018-08-21 17:12:02 +02:00
Alexander Udalov
852760b3b0 Report error on incompatible .kotlin_module files in classpath
Also remove obsolete test wrongAbiVersionNoErrors

 #KT-25973 Fixed
 #KT-26266 Open
2018-08-21 17:12:02 +02:00
Alexander Udalov
4f11812668 Report error instead of throwing exception in JvmPackagePartProvider 2018-08-21 17:12:02 +02:00
Sergey Igushkin
a71c66a82f Fix the SourceSet.projectDefault() extension adding sources to resources
The `include` calls were effectively made on the `resources`
`SourceDirectorySet`, which meant including '**' from 'src' as well.

Since the 'SourceDirectorySet' API is quite limited and does not support
specifying includes/excludes separately, configure the
`ProcessResources` task instead.
2018-08-21 18:05:52 +03:00
Sergey Igushkin
674e464230 Fix Kotlin source directories not added into the Java source set srcDirs
Before the new MPP, Kotlin source directories were added to the Java
source set's `allJava` and `allSource` by all of the Kotlin plugins,
including common and JS ones. As it turned out, this was required by the
IntelliJ Gradle import.

* Make all `KotlinSourceSetProcessor`s (not just JVM) check whether a
  compilation has a Java source set and add the Kotlin source
  directories to `allSource` and `allJava`

* Also disable the unclear resource `exclude` for the Java source set
  that filters Kotlin source directories out of the resources

Issue #KT-26020 Fixed
Issue #KT-26267 Fixed
2018-08-21 18:05:52 +03:00
Vyacheslav Gerasimov
f4eee4c2e4 as33: Restore gradle-java.xml 2018-08-21 17:38:58 +03:00
Zalim Bashorov
503fcd5cd3 [JS FE] Minor: cleanup JsExternalChecker.kt 2018-08-21 17:09:34 +03:00
Zalim Bashorov
589085369e [JS FE] Unify how the compiler checks parameters and return types for external declarations 2018-08-21 17:09:33 +03:00
Zalim Bashorov
9d0b880f67 [JS FE] Prohibit inline classes as parameter type and return type of external declarations
#KT-26171 Fixed
2018-08-21 17:09:33 +03:00
Zalim Bashorov
839bce5236 [JS FE] Prohibit external inline classes
#KT-26138 Fixed
2018-08-21 17:09:33 +03:00
Roman Elizarov
4fe2730f4a SuccessOrFailure.getOrDefault 2018-08-21 17:07:20 +03:00
Alexander Udalov
b6bf1604ea Regenerate tests 2018-08-21 15:54:04 +02:00
Vyacheslav Gerasimov
4bfa2a3957 as33: Add missing GooglePluginUpdateVerifier 2018-08-21 16:36:22 +03:00
Vitaliy Bibaev
4830c9a13d Fix broken tests compilation for AS and IDEA 173 after Sequence Debugger merging (#1820)
* Add dependency on stream debugger for tests in IDEA 173

* Fix compilation error for tests with IDEA 173

* Fix compilation issues with Android studio and sequence debugger tests
2018-08-21 16:23:45 +03:00
Alexey Sedunov
788606445e MPP: Support configurations with metadata 2018-08-21 15:35:43 +03:00
Alexey Sedunov
acbe299126 MPP: Support language settings in new model import 2018-08-21 15:35:42 +03:00
Alexey Sedunov
c45608a46e MPP: Restore non-Android content roots dropped by AS3.1 2018-08-21 15:35:42 +03:00
Alexey Sedunov
a5de065d7c MPP: Support Android platform in new model import 2018-08-21 15:35:42 +03:00
Alexey Sedunov
b983c93930 MPP: Add ImportedModule for non-Android source set modules
The goal is to work around model disposal service
which discards module data without ImportedModule instance
2018-08-21 15:35:42 +03:00
Alexey Sedunov
80102fc2bc Test Support: Check availability of test plugins in Gradle run configs
#KT-26228 Fixed
2018-08-21 15:35:42 +03:00
Alexander Udalov
3442c7385f Fix compilation in KotlinTestUtils for IDEA 173 2018-08-21 14:05:07 +02:00
Alexander Udalov
97c0f1712a Fix compilation in KotlinTestUtils for AS 3.1 & 3.2 2018-08-21 14:03:28 +02:00
Ilmir Usmanov
932b76a3f3 Minor. Unmute test 2018-08-21 14:13:19 +03:00
Alexander Udalov
f069686a14 Minor, use resolveSibling in getAbsolutePaths 2018-08-21 12:49:11 +02:00
Alexander Udalov
e56374908e Disallow using optional annotations outside common module sources
#KT-25196 Fixed
2018-08-21 12:49:10 +02:00
Alexander Udalov
0f003802fe Introduce -Xcommon-sources and pass it correctly from build tool plugins
#KT-25196 In Progress
2018-08-21 12:49:10 +02:00
Denis Zharkov
d35e73d29b Get rid of COROUTINE_SUSPENDED replacement in SuspendFunction wrappers 2018-08-21 13:46:01 +03:00
Denis Zharkov
ca39cc47c9 Support calling experimental coroutines API in JVM
The support is very limited, though

 #KT-25683 Fixed
2018-08-21 13:46:01 +03:00
Denis Zharkov
20c7a97bcd Make experimental/release COROUTINE_SUSPENDED reference the same instance
It's necessary when mixing experimental/release coroutines together

 #KT-25683 In Progress
2018-08-21 13:44:02 +03:00
Denis Zharkov
db34555800 Use package property COROUTINE_SUSPENDED instead of enum entry
For sake of encapsulation: actual property content might be
different from the entry
2018-08-21 13:44:02 +03:00
Denis Zharkov
944b0d058a Allow calling some pieces of the experimental coroutine API
- Calling suspend functions is allowed
- Presence of suspend function type still makes declaration
unusable unless it belongs to a value parameter as a top-level type
containing less then three parameters

Still, warning should be emitted because they will become unsupported in 1.4

 #KT-25683 In Progress
2018-08-21 13:44:02 +03:00
Denis Zharkov
c94b72680a Minor. Extract InstructionAdapter::emitInlineMarker 2018-08-21 13:44:02 +03:00
Alexander Udalov
1c2a9e4b21 Map annotation target TYPE -> TYPE_USE if JVM target >= 1.8
And TYPE_PARAMETER -> TYPE_PARAMETER similarly

 #KT-23857 Fixed
2018-08-21 12:38:05 +02:00
Alexander Udalov
b7808ba24d Pass JvmTarget to KotlinTypeMapper
Also use KotlinTypeMapper.RELEASE_COROUTINES_DEFAULT instead of false in
FileRankingCalculator
2018-08-21 12:23:07 +02:00
Stanislav Erokhin
f3e0470dcd Allow generic type parameter to have mixed constraints for @InlineOnly functions
#KT-19323 Fixed
2018-08-21 12:17:25 +03:00
Dmitry Petrov
7d4dfc87b1 Use proper KotlinType in get/set methods for property reference 2018-08-21 08:43:12 +03:00
Dmitry Petrov
6cd91e43bb Minor: reformat 2018-08-21 08:43:12 +03:00
Alexey Tsvetkov
272f9b8a10 Recompile all subclasses of changed classes
Previously inter-project IC recompiled only direct subclasses
of changed classes

    #KT-25455 fixed
2018-08-21 04:32:32 +03:00
Alexey Tsvetkov
73f7c2ef3c Use file trees in InspectClassesForMultiModuleIC
#KT-26208
2018-08-21 04:32:32 +03:00
Alexey Tsvetkov
41a47ea50f Minor: remove redundant default argument 'weakTesting = false' 2018-08-21 04:32:31 +03:00
Alexey Tsvetkov
c9a62e078a Minor: remove GradleICReporter 2018-08-21 04:32:31 +03:00
Alexey Tsvetkov
30f3622b27 Implement inter-project JS IC with Gradle
#KT-25025 fixed
2018-08-21 04:32:31 +03:00
Alexey Tsvetkov
02af631e14 Minor: move tests for incremental compilation of Kotlin when Java changes 2018-08-21 03:53:57 +03:00
Alexey Tsvetkov
7ff7c71b96 Refactoring: extract function for getting classpath changes 2018-08-21 03:53:56 +03:00
Alexey Tsvetkov
aeaf1d6633 Refactoring: introduce DirtyFilesContainer for better code reuse in IC 2018-08-21 03:53:56 +03:00
Alexey Tsvetkov
638c1eadff Avoid rebuild when '--verbose' is used in Gradle
#KT-23472 fixed
2018-08-20 23:41:11 +03:00
Alexey Tsvetkov
d09629972a Use same system property to avoid deleting module file in JPS and Gradle 2018-08-20 23:41:11 +03:00
Ilmir Usmanov
d3dbcae7a4 Get rid of typed create and invoke wherever possible
in coroutine lambdas.
 #KT-26243 Fixed
2018-08-20 21:33:24 +03:00
Mikhail Glukhikh
3bdf38e6b2 Refactoring: HasExpectedMarker (use not-null declarations) 2018-08-20 18:42:31 +03:00
Mikhail Glukhikh
8ef2c479e4 Refactoring: HasActualMarker (use not-null declarations) 2018-08-20 18:42:17 +03:00
Mikhail Glukhikh
9b29651371 Has actual (new MPP): handle possible actual in "common" module
Before this commit, we assumed all actual declarations are
in platform modules, and each platform has no more than one actual.
In new MPP, actual declarations can be also in common code,
and each platform as well as common code can include
more than one actual declarations for given expected.

#KT-26217 Fixed
2018-08-20 18:41:32 +03:00
Mikhail Glukhikh
18d43a2fce MPP wizard [web]: do not add Java to JVM module by default
This removes controversial behaviour during Gradle import,
now strange 'main' / 'test' source sets aren't added
2018-08-20 18:41:29 +03:00
Mikhail Glukhikh
41507a4deb MPP wizard [web]: add kotlin-test as dependency to all source sets
#KT-26239 Fixed
2018-08-20 18:41:28 +03:00
Dmitry Petrov
b5f37d18b2 Fix inlining of functions with matching JVM signatures in same package
When two functions with matching JVM signatures in the same package
were inlined sequentially, inliner could take a wrong method body from
the cache due to MethodId clash. This manifested with inline classes,
but also was possible with some legal Kotlin overloads with matching
erasure.

Use internal name of the corresponding implementation owner class
instead of FQN of the containing declaration. Such MethodIds can't match
accidentally, because corresponding JVM method signatures would clash.
2018-08-20 14:12:34 +03:00
Mikhail Glukhikh
f9bba3ca86 Reformat & cleanup: kotlinSpacingRules 2018-08-20 13:21:28 +03:00
Mikhail Glukhikh
4fd8d3b480 Add formatting rule "new line between { and when entry" 2018-08-20 13:21:22 +03:00
Mikhail Glukhikh
ef094e78e3 Add when branches (minor): 'with import' -> 'with * import'
Change name of quick-fix to more descriptive one
2018-08-20 13:21:18 +03:00
Mikhail Glukhikh
b031e34f8d Add when branches: include auto-import
Before this commit, enum / sealed class to add was not imported so
user had to import them himself. Now everything is auto-imported.
Separate "add with import" is kept but * import is now in mind there.
#KT-22330 Fixed
#KT-22354 Fixed
EA-108090 Fixed
2018-08-20 13:21:17 +03:00
Mikhail Glukhikh
f3972bfdfe Ignore potential KNPE in "import all members" (see KT-22354) 2018-08-20 13:21:15 +03:00
Svyatoslav Kuzmich
7578dbf8f2 [JS BE] KT-22053 Fix constructor delegation of immediate subtype of Error 2018-08-20 12:08:30 +03:00
Dmitry Petrov
5045fa446a Prohibit recursive inline classes 2018-08-20 10:08:10 +03:00
Vitaliy.Bibaev
4f722dd32d Use heuristics for termination calls for java/streamex as well 2018-08-20 05:18:04 +03:00
Vitaliy.Bibaev
1f9004e1ae Minor: rename 'receiver' -> 'receiverValue' 2018-08-20 05:18:04 +03:00
Vitaliy.Bibaev
e1acd2e2c5 Use heuristics with call name to avoid redundant types resolve 2018-08-20 05:18:03 +03:00
Vitaliy.Bibaev
9b24600b0f Minor: rename KotlinTypes -> KotlinSequenceTypes 2018-08-20 05:18:03 +03:00
Vitaliy.Bibaev
0ba506c1ec Use partial resolve 2018-08-20 05:18:03 +03:00
Vitaliy.Bibaev
3bc7944e0c Remove commented code 2018-08-20 05:18:03 +03:00
Vitaliy.Bibaev
320cb18746 Remove dependency on stream-debugger plugin from 'idea' project 2018-08-20 05:18:03 +03:00
Vitaliy.Bibaev
5779eacb23 Use KotlinBuiltIns.FQ_NAMES for type names 2018-08-20 05:18:03 +03:00
Vitaliy.Bibaev
e158c9191c Mention sequence debugger for 181 and 183 IDEA 2018-08-20 05:18:03 +03:00
Vitaliy.Bibaev
db5e6e1ddc Minor: remove redundant field 2018-08-20 05:18:03 +03:00
Vitaliy.Bibaev
57ac7e0fb9 Remove @author JavaDoc from all my files 2018-08-20 05:18:02 +03:00
Vitaliy.Bibaev
55055ce3aa Remove redundant LibraryUtil.kt 2018-08-20 05:18:02 +03:00
Vitaliy.Bibaev
c1ebc2788d Minor fixes after inspecting code-style 2018-08-20 05:18:02 +03:00
Vitaliy.Bibaev
2d22267cf1 Apply project code style settings to sequence debugger code 2018-08-20 05:18:02 +03:00
Vitaliy.Bibaev
245a358ea8 Remove unused code 2018-08-20 05:18:02 +03:00
Vitaliy.Bibaev
1986309a07 Set up KotlinPsiChainBuilderTestCase for current environment 2018-08-20 05:18:02 +03:00
Vitaliy.Bibaev
c2c09e2ac3 Remove stream ex test to avoid undesirable dependency on streamex lib 2018-08-20 05:18:02 +03:00
Vitaliy.Bibaev
4eb06fb11c Use qualified names of test classes 2018-08-20 05:18:01 +03:00
Vitaliy.Bibaev
490f7bc3d7 Do not generate test cases for ignored tests 2018-08-20 05:18:01 +03:00
Vitaliy.Bibaev
568a664491 Move test classes into 'streams' package in the tiny app 2018-08-20 05:18:01 +03:00
Vitaliy.Bibaev
1a78058cf4 Remove unused OutputChecker 2018-08-20 05:18:01 +03:00
Vitaliy.Bibaev
6db36e7c62 Remove unused code 2018-08-20 05:18:01 +03:00
Vitaliy.Bibaev
d4795c0e5d Add generated tests for collections/java streams 2018-08-20 05:18:01 +03:00
Vitaliy.Bibaev
cf2c2ed802 Move sequence test data into 'debugger/tinyApp/src/streams/sequence' 2018-08-20 05:18:01 +03:00
Vitaliy.Bibaev
db6894f145 Add abstract test cases for collection\java streams tests 2018-08-20 05:18:00 +03:00
Vitaliy.Bibaev
75e5cfca82 Do not use deprecated API 2018-08-20 05:18:00 +03:00
Vitaliy.Bibaev
c4a1e32f3d Add 'stream-debugger' plugin as a test dependency 2018-08-20 05:18:00 +03:00
Vitaliy.Bibaev
44b736e846 Generate tests be test data for sequence traces 2018-08-20 05:18:00 +03:00
Vitaliy.Bibaev
c0c344210a Enable back dsl test 2018-08-20 05:18:00 +03:00
Vitaliy.Bibaev
895e78d180 Move test data to tinyApp directory 2018-08-20 05:18:00 +03:00
Vitaliy.Bibaev
ac4c42cc4b Add extensions to support sequences debugging 2018-08-20 05:17:59 +03:00
Vitaliy.Bibaev
aa34d84487 Move files to the correct packages 2018-08-20 05:17:59 +03:00
Vitaliy.Bibaev
f90b33424a Add java stream debugger as a dependency 2018-08-20 05:17:59 +03:00
Vitaliy.Bibaev
0fab9e5fa7 Move sequence debugger tests to idea/tests/debugger/sequence directory 2018-08-20 05:17:59 +03:00
Vitaliy.Bibaev
6dda5b0397 Move sequence debugger src to a debugger/sequence directory 2018-08-20 05:17:59 +03:00
Vitaliy.Bibaev
fbc2a5d9a7 EA-114349 Fix bug when trace collecting for large int values throws NPE 2018-08-20 05:17:59 +03:00
Vitaliy.Bibaev
7cd1baff9d Fix bug when chain is not detected if method expression is used 2018-08-20 05:17:59 +03:00
Vitaliy.Bibaev
da731b9bae Do not set redundant space in string representation of lambdas 2018-08-20 05:17:58 +03:00
Vitaliy.Bibaev
89abcb82e4 Support distinctBy intermediate call 2018-08-20 05:17:58 +03:00
Vitaliy.Bibaev
0cc5e924a7 Fix bug then Map.contains is not an expression 2018-08-20 05:17:58 +03:00
Vitaliy.Bibaev
bfced7dd1e Support filterIsInstance with generic parameter 2018-08-20 05:17:58 +03:00
Vitaliy.Bibaev
e9d8398573 Minor: update test data 2018-08-20 05:17:58 +03:00
Vitaliy.Bibaev
914a631322 Add tests & test data for all terminal operations 2018-08-20 05:17:58 +03:00
Vitaliy.Bibaev
bf82cd9b40 Fix test dsl/mapComputeIfAbsent 2018-08-20 05:17:58 +03:00
Vitaliy.Bibaev
bde34b45e7 Add 'asSequence' operation support 2018-08-20 05:17:57 +03:00
Vitaliy.Bibaev
64dec10bd5 Avoid redundant allocation on each collection chain transformation 2018-08-20 05:17:57 +03:00
Vitaliy.Bibaev
ac19f30ed3 Disable distinctBy operation support (will be fixed in the platform) 2018-08-20 05:17:57 +03:00
Vitaliy.Bibaev
8f807f441b Add two more tests for windowed operation support 2018-08-20 05:17:57 +03:00
Vitaliy.Bibaev
449fa8f3ec Support 'windowed' intermediate call 2018-08-20 05:17:57 +03:00
Vitaliy.Bibaev
cc549d3ae5 Support chunked operation 2018-08-20 05:17:57 +03:00
Vitaliy.Bibaev
85d83309ae Support mapNotNull intermediate operation 2018-08-20 05:17:57 +03:00
Vitaliy.Bibaev
eaee6697f2 Make zipWithNext work & add test 2018-08-20 05:17:56 +03:00
Vitaliy.Bibaev
d8bc73367f Add tests for misc operations 2018-08-20 05:17:56 +03:00
Vitaliy.Bibaev
53209eaeec Add tests for appending values to sequence operation 2018-08-20 05:17:56 +03:00
Vitaliy.Bibaev
d30a3b2495 Add tests for distinct operations 2018-08-20 05:17:56 +03:00
Vitaliy.Bibaev
113bb9ca46 Use computeIsAbsent instead of getOrPut in generated expression 2018-08-20 05:17:56 +03:00
Vitaliy.Bibaev
fd17d9959a Add tests for sorting operations 2018-08-20 05:17:56 +03:00
Vitaliy.Bibaev
3114691a02 Remove redundant copyright header in test data 2018-08-20 05:17:55 +03:00
Vitaliy.Bibaev
42aba80eb7 Add tests for flat-mapping operations 2018-08-20 05:17:55 +03:00
Vitaliy.Bibaev
a4e72067a9 Add tests outputs for mapping operation tests 2018-08-20 05:17:55 +03:00
Vitaliy.Bibaev
da5cbeb92b Drop mapNotNull operation support 2018-08-20 05:17:55 +03:00
Vitaliy.Bibaev
b31db50ba1 Add tests for mapping operations 2018-08-20 05:17:55 +03:00
Vitaliy.Bibaev
5383ec50d2 Add tests on filtering operations 2018-08-20 05:17:55 +03:00
Vitaliy.Bibaev
22c455a01e Add base test case for the sequence execution tests 2018-08-20 05:17:55 +03:00
Vitaliy.Bibaev
a1525ca022 Add support for some intermediate operations if possible 2018-08-20 05:17:55 +03:00
Vitaliy.Bibaev
c1cf159beb Minor: fix Sequence package name 2018-08-20 05:17:54 +03:00
Vitaliy.Bibaev
9d69b701c1 Add tests for type inference for items in the chain 2018-08-20 05:17:54 +03:00
Vitaliy.Bibaev
b7e99a75ad Use index by array name instead of elements name in KotlinTypes 2018-08-20 05:17:54 +03:00
Vitaliy.Bibaev
43614a1dfe Fix bug when generics are erased in trace expression 2018-08-20 05:17:54 +03:00
Vitaliy.Bibaev
5f9481b273 Implement SequenceTypeExtractor 2018-08-20 05:17:54 +03:00
Vitaliy.Bibaev
6b83e2f49f Move utility methods for primitive types into KotlinTypes 2018-08-20 05:17:54 +03:00
Vitaliy.Bibaev
b9ae33b068 Simplify CallTypeExtractor implementations 2018-08-20 05:17:53 +03:00
Vitaliy.Bibaev
f98d50265b Implement SequenceCallChecker 2018-08-20 05:17:53 +03:00
Vitaliy.Bibaev
98d698290e Move a workaround for collections into CollectionChainTransformer 2018-08-20 05:17:53 +03:00
Vitaliy.Bibaev
50d30f3d8b Use TerminatedChainBuilder for both java stream & sequences 2018-08-20 05:17:53 +03:00
Vitaliy.Bibaev
416b15e42b Minor: move KotlinJavaStreamChainBuilder to the 'impl' package 2018-08-20 05:17:53 +03:00
Vitaliy.Bibaev
7f57730c45 Move classes into packages java/sequence/collections where needed 2018-08-20 05:17:53 +03:00
Vitaliy.Bibaev
7d903b43a1 Add library support extension for kotlin sequence support 2018-08-20 05:17:53 +03:00
Vitaliy.Bibaev
c69e0c0d01 Update test data 2018-08-20 05:17:53 +03:00
Vitaliy.Bibaev
8a026fd9cd Ignore kotlin collections execution tests 2018-08-20 05:17:52 +03:00
Vitaliy.Bibaev
6cc797ad31 Update copyright header for new files 2018-08-20 05:17:52 +03:00
Vitaliy.Bibaev
6433592618 Minor: move file CallUtils.kt to the upper level 2018-08-20 05:17:52 +03:00
Vitaliy.Bibaev
14ef19418b Add tests on different types of chain source 2018-08-20 05:17:52 +03:00
Vitaliy.Bibaev
0d2c5c4d65 Minor: add todo 2018-08-20 05:17:52 +03:00
Vitaliy.Bibaev
7c417a59dc Fix bug when onEach extension call is not found for arrays 2018-08-20 05:17:52 +03:00
Vitaliy.Bibaev
aa7f1073e6 Add tests outputs for collection execution tests 2018-08-20 05:17:51 +03:00
Vitaliy.Bibaev
e3d651ec09 Add tests for filter operation 2018-08-20 05:17:51 +03:00
Vitaliy.Bibaev
adb36d53fe Fix bug when chain result type inferred incorrectly 2018-08-20 05:17:51 +03:00
Vitaliy.Bibaev
c5ede40262 Recognize CharSequence and Arrays as iterable too 2018-08-20 05:17:51 +03:00
Vitaliy.Bibaev
338e06ff21 Minor: fix bug in tests/test data 2018-08-20 05:17:51 +03:00
Vitaliy.Bibaev
91348e3b2a Fix typo in test data 2018-08-20 05:17:51 +03:00
Vitaliy.Bibaev
ddda26c3da Implement chain type extractor for kotlin collection chains 2018-08-20 05:17:51 +03:00
Vitaliy.Bibaev
3b6b6d5770 Fix typos in tests 2018-08-20 05:17:51 +03:00
Vitaliy.Bibaev
cd17f59e21 Implement elements type extractor for java streams 2018-08-20 05:17:50 +03:00
Vitaliy.Bibaev
5a02f37d1f Fix bug when string representation of flexible kt type was wrong 2018-08-20 05:17:50 +03:00
Vitaliy.Bibaev
8900411fb1 Add util function to extract type name without generic parameters 2018-08-20 05:17:50 +03:00
Vitaliy.Bibaev
b817fd111e Extract KotlinType -> String function to utils 2018-08-20 05:17:50 +03:00
Vitaliy.Bibaev
4969de404e Add additional classes and interfaces to infer types of chain items 2018-08-20 05:17:50 +03:00
Vitaliy.Bibaev
d14cc77003 Add tests for types in chains of collection transformation calls 2018-08-20 05:17:50 +03:00
Vitaliy.Bibaev
25024ff9a0 Add all primitive types to KotlinTypes.kt 2018-08-20 05:17:50 +03:00
Vitaliy.Bibaev
6b6ccc45f0 Add tests on types of items in java chain operations 2018-08-20 05:17:49 +03:00
Vitaliy.Bibaev
16768bd9e3 Add and use NULLABLE_ANY type into KotlinTypes.kt 2018-08-20 05:17:49 +03:00
Vitaliy.Bibaev
0d7e9d698e Minor: fix formatting in KotlinTypes.kt 2018-08-20 05:17:49 +03:00
Vitaliy.Bibaev
502cb1e456 Add test cases to check types of chain operations 2018-08-20 05:17:49 +03:00
Vitaliy.Bibaev
e61fbb16c5 Resolve types of arguments 2018-08-20 05:17:49 +03:00
Vitaliy.Bibaev
86ec8eab6e Support filter and filterNotOperations 2018-08-20 05:17:49 +03:00
Vitaliy.Bibaev
6be340f079 Use getValue method to receive value by key in map variable 2018-08-20 05:17:49 +03:00
Vitaliy.Bibaev
872cb225f0 Specify all types as nullable (temporary solution) 2018-08-20 05:17:49 +03:00
Vitaliy.Bibaev
be69362f7d Minor: refactoring 2018-08-20 05:17:48 +03:00
Vitaliy.Bibaev
4517d3a3d0 Support primitive boolean arrays 2018-08-20 05:17:48 +03:00
Vitaliy.Bibaev
3acb4285ea Minor: add missed paren 2018-08-20 05:17:48 +03:00
Vitaliy.Bibaev
523bdb0d54 Reserve unique time for mapped value in filter handler 2018-08-20 05:17:48 +03:00
Vitaliy.Bibaev
a88719ff08 Minor: rename BothSemanticCallWrapper -> BothSemanticHandlerWrapper 2018-08-20 05:17:48 +03:00
Vitaliy.Bibaev
246f79ab86 Implement handler for filter call for kotlin collections 2018-08-20 05:17:48 +03:00
Vitaliy.Bibaev
3b14ed9ae8 Refactoring: updated methods signatures 2018-08-20 05:17:48 +03:00
Vitaliy.Bibaev
8d9e348424 Implement proxy classes for collection handlers 2018-08-20 05:17:47 +03:00
Vitaliy.Bibaev
8fc64490ca Add abstractions to implement handlers for kotlin collections 2018-08-20 05:17:47 +03:00
Vitaliy.Bibaev
cd4577ea78 Add stubs for filter operations 2018-08-20 05:17:47 +03:00
Vitaliy.Bibaev
385a82567f Minor: fix formatting issues 2018-08-20 05:17:47 +03:00
Vitaliy.Bibaev
12fe36b77f Add ability to specify a custom way to create peek call 2018-08-20 05:17:47 +03:00
Vitaliy.Bibaev
5ab76d1eed Add tests for chain building for kotlin collections 2018-08-20 05:17:47 +03:00
Vitaliy.Bibaev
dd05a9b11b Add kotlin stdlib to psi tests 2018-08-20 05:17:47 +03:00
Vitaliy.Bibaev
5502d62471 Minor: rename LibraryManager -> LibraryUtil 2018-08-20 05:17:46 +03:00
Vitaliy.Bibaev
e15f3624cf Implement chain builder for kotlin collections 2018-08-20 05:17:46 +03:00
Vitaliy.Bibaev
ad1a91a6c8 Add extension for kotlin collections support 2018-08-20 05:17:46 +03:00
Vitaliy.Bibaev
871dc4253f Minor: fix code style in NegativeJavaStreamTest and group tests 2018-08-20 05:17:46 +03:00
Vitaliy.Bibaev
67d7f77f66 Minor: add checks in tests that no built chains 2018-08-20 05:17:46 +03:00
Vitaliy.Bibaev
70f4933d5b Add tests to check that chain is not build in some hard cases 2018-08-20 05:17:46 +03:00
Vitaliy.Bibaev
6ce6301613 Fix bug when chain was not found from nested lambda or anonymous 2018-08-20 05:17:46 +03:00
Vitaliy.Bibaev
bb90c5ad08 Add tests for java stream chain building 2018-08-20 05:17:46 +03:00
Vitaliy.Bibaev
ac956a46df Fix minor chain building bug in kotlin 2018-08-20 05:17:45 +03:00
Vitaliy.Bibaev
4573069a8d Add setUp & tearDown for kotlin tests 2018-08-20 05:17:45 +03:00
Vitaliy.Bibaev
055b0eed97 Fix wrong testdata 2018-08-20 05:17:45 +03:00
Vitaliy.Bibaev
bc7d30bd99 Fix bug when stream chain lose terminator call arguments 2018-08-20 05:17:45 +03:00
Vitaliy.Bibaev
4cb8cc3653 Fix bug when chain in the upper level is not found 2018-08-20 05:17:45 +03:00
Vitaliy.Bibaev
56a783b858 Fix bug when chain detection did not work 2018-08-20 05:17:45 +03:00
Vitaliy.Bibaev
295d340d7c Add standard stream chain builder tests 2018-08-20 05:17:45 +03:00
Vitaliy.Bibaev
b916fc6ca2 Add simplest execution tests for support of kotlin collection 2018-08-20 05:17:44 +03:00
Vitaliy.Bibaev
4552504315 Minor: rename base trace evaluation test case 2018-08-20 05:17:44 +03:00
Vitaliy.Bibaev
07cc21200a Do not add a blank line after copyright header 2018-08-20 05:17:44 +03:00
Vitaliy.Bibaev
9bc08da6c6 Update copyright headers in test sources 2018-08-20 05:17:44 +03:00
Vitaliy.Bibaev
a630390781 Update copyright header in source code files 2018-08-20 05:17:44 +03:00
Vitaliy.Bibaev
25b174b8f7 Minor: optimize imports 2018-08-20 05:17:44 +03:00
Vitaliy.Bibaev
2aef583aa7 Add support for tests with debugger 2018-08-20 05:17:44 +03:00
Vitaliy.Bibaev
b916f9e8e6 Support psi tests for streamex library 2018-08-20 05:17:43 +03:00
Vitaliy.Bibaev
8d9b021ef2 Support psi tests for standard stream api 2018-08-20 05:17:43 +03:00
Vitaliy.Bibaev
310bcc48a5 Add psi tests with the simplest test data 2018-08-20 05:17:43 +03:00
Vitaliy.Bibaev
5fe0f167ca Simplify checks that stream chain exists 2018-08-20 05:17:43 +03:00
Vitaliy.Bibaev
6d395dffbb Move stream call checks into separate class 2018-08-20 05:17:43 +03:00
Vitaliy.Bibaev
64f399235e Add tests for kotlin language support in the expressions dsl 2018-08-20 05:17:43 +03:00
Vitaliy.Bibaev
8185354116 Add streamex support 2018-08-20 05:17:43 +03:00
Vitaliy.Bibaev
3a2370a2d6 Minor: add a forgotten file 2018-08-20 05:17:43 +03:00
Vitaliy.Bibaev
ea3206bba4 Minor: fix compatible issue 2018-08-20 05:17:42 +03:00
Vitaliy.Bibaev
2c57853dbe Add an extension point to support standard library in kotlin 2018-08-20 05:17:42 +03:00
Vitaliy.Bibaev
957f9a7e14 Add source files 2018-08-20 05:17:42 +03:00
Nikolay Krasko
8f566132e4 Workaround for IndexNotReadyException from icon provider (EA-118965)
Provider is DumbAware and isn't expected to access indexes.
2018-08-19 17:44:42 +03:00
ilmat192
2251440f04 Basic native support in kotlin-multiplatform (#1811)
* Add dependency on KN shared in gradle-plugin

* Basic support for Kotlin/Native:
     * Target presets
     * Compilation into a klib
     * Compilation into native binraies: framework and executable
     * Basic dependencies between projects
     * No jars in native publications
     * Replace '-' with '_' in framework names
    * Escape quotes in native command lines on Windows
* Move targets from Kotlin/Native repo
* Download KN compiler using Gradle's mechanisms
* Support source set dependencies in native
2018-08-19 20:45:31 +07:00
Zalim Bashorov
8966e220f0 Update tests 2018-08-17 21:44:08 +03:00
Zalim Bashorov
c61d99fcff [JS IR BE] don't initialize instance storage for singletons explicitly, use default value (undefined) instead
It allows accessing to a singleton independent to the state of its storage.
2018-08-17 21:43:33 +03:00
Zalim Bashorov
0f6a77e700 [JS IR BE] take into account receiver's type when generate name for callables (including properties)
Also, add special markers for receiver type and generic types to avoid accidental clashes.
2018-08-17 20:31:06 +03:00
Mikhail Glukhikh
b9d6580b44 Introduce MPP wizard for web (JVM / JS) applications
This implements first part of KT-25952
2018-08-17 18:16:34 +03:00
Mikhail Glukhikh
b10554a8a0 Make old MPP wizard deprecated 2018-08-17 18:16:11 +03:00
Mikhail Glukhikh
57153cc2fc Make code in IntroduceIndexMatcher safer
EA-101119 Fixed
2018-08-17 18:16:10 +03:00
Mikhail Glukhikh
d67dea4619 Reformat & cleanup: CreateCallableFromCallActionFactory 2018-08-17 18:16:08 +03:00
Mikhail Glukhikh
9a9e703e80 Do not suggest "create abstract property" inside annotation 2018-08-17 18:16:07 +03:00
Mikhail Glukhikh
04675b4446 Do not suggest "create local variable" inside primary constructor
#KT-26158 Fixed
EA-99300 Fixed
2018-08-17 18:15:47 +03:00
Mikhail Glukhikh
34be9ccbbe Reformat: CreateLocalVariableActionFactory 2018-08-17 18:15:44 +03:00
Sergey Igushkin
b125f1e23e Revert "Fix source set resources filtering broken by refactoring"
This reverts commit 6af6834
2018-08-17 17:54:43 +03:00
Alexander Udalov
92e7fe347a Minor, provide more info when deserializing bad constant value 2018-08-17 16:31:54 +02:00
Ilmir Usmanov
2ecea55cb1 Ignore coroutines and assertion tests in android tests generator
for now.
2018-08-17 16:17:19 +03:00
Ilmir Usmanov
dcfdc781db Minor. Unmute test in JS BE 2018-08-17 16:14:28 +03:00
Anton Bannykh
8e5b2fe657 JS: create appropriate nameBinding's upon inlining
Otherwise JsName's don't get linked properly upon deserialization.
As a result a function/constructor doesn't get renamed at
call site during the name conflict resolution phase.
2018-08-17 15:27:00 +03:00
Alexey Tsvetkov
3b4a49eebf Add test for KT-26064 2018-08-17 15:27:00 +03:00
Sergey Igushkin
1a3dd67176 Enable metadata publishing for new MPP and consumption from source sets
* Add configurations for consuming source sets metadata (extending the
  source set's dependency configurations). These configurations will be
  used by the IDE to pick up the dependencies metadata.

* Remove the universal preset from the default presets, create a
  metadata target by default for compiling and publishing the metadata
  of `commonMain` (in the future, we will publish and consume the
  metadata of the other source sets as well).

* Make the classpath configurations of common modules consume the
  metadata and thus ensure compatibility of 1.2.x MPP with the new MPP
  model.
2018-08-17 15:12:44 +03:00
Vyacheslav Gerasimov
add323a486 as33: Remove incorrect gradle.xml.as33 2018-08-17 14:39:03 +03:00
Ilya Chernikov
2a4cef3ac2 Avoid "Failed to initialize native filesystem for Windows" warning from the platform on script compilation 2018-08-17 09:49:46 +02:00
Jonathan Lermitage
66bb744e3c Update Maven central repository url to latest version 2018-08-17 09:46:07 +02:00
Sergey Igushkin
6af6834966 (minor) Fix source set resources filtering broken by refactoring
Before the last change in this logic, the resources filtering used
the original Kotlin source directories, not those with Java filtered
out.

Make sure that the Java source directories that are added to the Kotlin
source set are excluded from the resources, and all the related
configuration works lazily, i.e. supports source sets modification
after configuration took place.
2018-08-17 03:22:30 +03:00
Sergey Igushkin
d1a5794d36 (minor) Move source set configuration creation
It was placed in the new MPP plugin and was therefore not used for
the 'KotlinSourceSet's with the old plugin. Move this logic to the
KotlinSourceSetFactory so that it is applied to all source sets
2018-08-17 03:18:32 +03:00
Pavel V. Talanov
42f39a3ea4 Use older utility to fix compilation for as31 and 173 branches 2018-08-16 16:33:49 +02:00
Ilya Chernikov
ac65aebb19 Direct mapping of script implicit receivers and env vars to parameters 2018-08-16 15:13:00 +02:00
Ilya Chernikov
e1ee31b4ce Use linked hashmap in properties dsl - preserving order 2018-08-16 15:13:00 +02:00
Alexander Udalov
ddb398645b Reformat modules 'metadata' and 'metadata.jvm', fix some inspections 2018-08-16 15:08:18 +02:00
Alexander Udalov
3345dc81fd Do not return field signature if there's none in the metadata
Otherwise this code behaves incorrectly on getter-only properties: it
returns a meaningless field signature whereas the property has no field.
It's hard to come up with an example of when this could matter in
compiler code, but it's very noticeable in kotlinx-metadata-jvm

 #KT-26188 Fixed
2018-08-16 15:05:19 +02:00
Alexander Udalov
3f32e1cce9 Do not serialize empty property signature to JVM metadata
This should have no effect on the correct code currently because all
properties have at least a getter, but may help in debugging problems
with serialized metadata for properties
2018-08-16 14:11:09 +02:00
Alexander Udalov
bba25042b6 Fix generation of metadata for const val field in multi-file class
Metadata for declarations in multi-file classes is always written to the
corresponding parts, but fields for public const vals are generated into
the facade class.

Before this change, we ran generateBackingField only to generate the
const val field in the facade (because isBackingFieldOwner is true only
for the facade). Besides generating the actual field,
generateBackingField also stores the mapping to the FIELD_FOR_PROPERTY
slice, which is used later in the serializer to serialize the correct
JVM signature of the field to the metadata. However, the mapping was
stored to the incorrect binding map! Namely, the map from the same
ClassBuilder that is used to generate the class, and that is the facade
class builder. But the metadata needs to be generated to the part class,
not the facade.

Surprisingly, there is a test at
reflection/multifileClasses/javaFieldForVarAndConstVal.kt that checks
that kotlin-reflect is able to load the field signature of a const val
in a multi-file class, which is the main use case of this information,
and it passed before this change. The reason the test passed is that
KPropertyImpl.javaField uses JvmProtoBufUtil.getJvmFieldSignature which
mistakenly treats the absence of the field signature in the proto as the
hint that it may be computed naively (just the property's name + naively
mapped type), whereas in fact the field signature was missing
completely. (The fact that absence of a message may mean two things is
certainly a shortcoming of the metadata format and should be revisited
in the future.) This never led to any problem in the real world because
it's easy to prove that the field signature of a const val can always be
computed naively.

After this change, we now run generateBackingField twice: for the
facade's class builder, and for the part's class builder. The actual
field is only generated in the former case. But the mapping computed in
the latter case is used correctly in JvmSerializerExtension to store the
field signature to metadata. Also refactor
generateSyntheticMethodIfNeeded in the similar way, to reduce the number
of `if`s.
2018-08-16 14:11:09 +02:00
Alexander Udalov
b9594988ea Do not read property getter/setter signature if it's empty
This has no effect on the correct code currently, but will help in
debugging when changing the serialized metadata for properties.

For example, if after some change an empty propertySignature extension
is written for Property (it's possible for PropertyDescriptor without
getter or setter and without backing field), we now won't try to read a
missing getter message when loading annotations on property getter. In
protobuf, reading a missing message will result not in an exception, but
in a "default" message being returned, which makes no sense in our case
because it would simply be read as a getter signature with both "name"
and "desc" equal to 0 (i.e. the first entry in the string table)
2018-08-16 14:11:09 +02:00
Dmitry Petrov
b6e3218ca2 Use mapping mode for inline class underlying type without wrapping 2018-08-16 15:03:50 +03:00
Dmitry Petrov
06ef8824b6 Minor: reformat 2018-08-16 15:03:50 +03:00
Pavel V. Talanov
5ad8405893 Tweak test data so MultiFileHighlighting does not fail
Actually this test has to be reviewed
Current failures are caused by change in platform API
2018-08-16 14:03:01 +02:00
Pavel V. Talanov
8e470c7c4c Fix test data
Order of members returned by platform changed
Fix test files so test result would not depends on this order
2018-08-16 14:03:01 +02:00
Pavel V. Talanov
b59f134f78 Fix completing members for receivers shadowed by DslMarker
#KT-20396 Fixed
2018-08-16 13:59:38 +02:00
Pavel V. Talanov
0c1d25d5ac Completion: when Unit is expected do not prioritize by return type
Decide on completion order by other factors
Previously would prefer callable that return Unit if Unit is the expected type
    leading to strange completion order

 #KT-25588 Fixed
2018-08-16 13:59:38 +02:00
Pavel V. Talanov
51681d57c8 Minor: toString() for CompoundWeight to improve test results readability 2018-08-16 13:59:38 +02:00
Pavel V. Talanov
b51c021f56 Dsl completion: assign high priority for dsl elements that are members 2018-08-16 13:59:37 +02:00
Pavel V. Talanov
af2a6a5096 Support dsl highlighting for object references 2018-08-16 13:59:37 +02:00
Pavel V. Talanov
f80b85c282 Minor, refactor TypeKindHighlightingVisitor 2018-08-16 13:59:37 +02:00
Pavel V. Talanov
3d91d4b865 Minor: expand dsl highlighting test cases to cover member functions 2018-08-16 13:59:37 +02:00
Pavel V. Talanov
e9a9f2a1aa Dsl highlighting: support highlighting properties
Fix properties not being highlighted
Fix test infrastructure to verify actual output of highlighting visitors
2018-08-16 13:59:37 +02:00
Pavel V. Talanov
c250f7fca4 Add debug information on any of ResolutionFacade API failures 2018-08-16 13:56:28 +02:00
Sergey Rostov
f09364e654 Kotlin facet UI, JS: Hide "Enable incremental compilation (experimental)".
This option is project-wide only, so it should be visible only in project settings.
#KT-26095 Fixed.
2018-08-16 10:51:36 +03:00
Ilya Gorbunov
ebc64da52a Update EXPECTED_REACHABLE_NODES after introducing top-level comparator
#KT-18067
2018-08-15 21:28:57 +03:00
Ilya Gorbunov
ed53983e1e Add support for CASE_INSENSITIVE_ORDER in JS and common
#KT-18067
2018-08-15 21:28:54 +03:00
Ilya Gorbunov
6866f5d19a Move test and cover more cases of string comparison
#KT-18067
2018-08-15 21:28:50 +03:00
Ilya Gorbunov
27dde5f730 String.compareTo: SinceKotlin in JS and common, restore default parameter value in JVM
Default parameter is required to generate docs with Dokka for now.

#KT-18067
2018-08-15 21:28:47 +03:00
Toshiaki Kameyama
f05a19aafb JS stdlib: implement String.compareTo with ignoreCase
#KT-18067 Fixed
2018-08-15 21:28:44 +03:00
Alexey Sedunov
d194893012 MPP: Add production module dependencies to the test one (new MPP import)
#KT-25985 In Progress
2018-08-15 18:21:53 +03:00
Alexey Sedunov
443f8b6f02 Minor: Fix test data 2018-08-15 18:21:53 +03:00
Svyatoslav Kuzmich
f5a80a30f7 Mute and unmute tests 2018-08-15 18:20:07 +03:00
Sergey Igushkin
d13ca38296 Relax some restrictions on Gradle dependency configurations in new MPP
* Set canBeConsumed = false only on those configurations that have this
  flag according to the Gradle Java plugins. This saves us from breaking
  existing build scripts but introduces ambiguity between consumable
  configurations (e.g. between `apiElements`, `compile`, `runtime`). See
  the solution in the next point.

* Don't set the Kotlin platform attribute on configurations that are
  not meant for consuming in other projects or resolving directly. This
  change hides these configurations from Gradle's variant aware
  dependency resolution and therefore prevents ambiguity

(cherry-picked from 81f2c48f)
2018-08-15 17:48:44 +03:00
Georgy Bronnikov
00da193167 Introduce IrDeclarationWithVisibility 2018-08-15 16:56:16 +03:00
Dmitry Petrov
8e95ecb821 Use underlying type when computing type mapping mode for inline classes 2018-08-15 15:37:46 +03:00
Dmitry Petrov
948e72f653 Inline classes can only implement interfaces 2018-08-15 15:32:50 +03:00
Ilmir Usmanov
1c098bf5cf Minor. Fix test 2018-08-15 14:23:33 +03:00
Ilmir Usmanov
b4189d9e85 Minor. Use more granular assertion levels in assertion tests 2018-08-15 14:23:30 +03:00
Mikhael Bogdanov
1a1bb53381 Update IR text test
Additional implicit coercions to unit was added
2018-08-15 14:18:15 +03:00
Ilmir Usmanov
300876348a Fix line numbers generation for coerced primitives
in coroutines
 #KT-25076: Fixed
2018-08-15 13:47:45 +03:00
Ilmir Usmanov
a470fd21ca Eliminate only first {ASTORE, ALOAD} in locals elimination
of ALOAD.
 #KT-25912: Fixed.
2018-08-15 13:45:24 +03:00
Svyatoslav Kuzmich
ff70b837ee [JS IR BE] Support local delegated properties 2018-08-15 13:35:14 +03:00
Svyatoslav Kuzmich
392ad521fd [JS IR BE] Reflection support 2018-08-15 13:35:14 +03:00
Mikhail Glukhikh
1471fe08d7 Minor rename in if-then utils 2018-08-15 12:36:01 +03:00
Mikhail Glukhikh
5b77def0e0 "if-then to safe access": treat transformation to 'let' as intention
Related to KT-7675
2018-08-15 12:36:01 +03:00
Toshiaki Kameyama
f5cfec4a91 "if-then to safe access" inspection: support call expression -> let
#KT-7675 Fixed
2018-08-15 12:36:01 +03:00
Toshiaki Kameyama
2dcbf6aa34 Introduce "Redundant return label" inspection #KT-25270 Fixed 2018-08-15 12:36:01 +03:00
Toshiaki Kameyama
b91f30ab15 Suspicious callable reference: no quick fix with invalid reference type
#KT-23467 Fixed
2018-08-15 12:36:00 +03:00
Leonid Startsev
0ac969a617 Attempt to make loading of compiler plugins from kotlin-platform-native Gradle plugin
Moved SubpluginEnviroment to separate file and made public some methods
KotlinNativeCompile task now extends AbstractCompile so it could be passed to SubpluginEnviroment.loadSubplugins
KotlinNativeBasePlugin now declares kotlinCompilerPluginClasspath configuration
2018-08-15 12:19:04 +03:00
Mikhael Bogdanov
494828f4cf Unmute jvm ir-tests 2018-08-15 10:26:28 +03:00
Mikhael Bogdanov
6d915bd68c Use original descriptors on implicit coercion to unit generation 2018-08-15 10:26:03 +03:00
victor.petukhov
e01e832acd Add gradle task to print spec tests statistic by spec sections 2018-08-14 17:34:38 +03:00
victor.petukhov
93874de89b Add 'specTest' gradle task to run spec tests 2018-08-14 17:34:27 +03:00
victor.petukhov
bed4c5f2f0 Add diagnostic spec tests for 'When expression' section 2018-08-14 17:34:15 +03:00
victor.petukhov
90f22d47b6 Fix incorrect severity for some diagnostics of DebugInfoDiagnosticFactory 2018-08-14 17:34:04 +03:00
victor.petukhov
0a58898817 Add diagnostic spec tests generator and validator, helper functions and classes 2018-08-14 17:33:54 +03:00
victor.petukhov
e989cf2bf4 Add tests-spec module with basic gradle configuration 2018-08-14 17:33:41 +03:00
Alexey Tsvetkov
b6575b0c57 Do not turn off IC in gradle.properties
It is turned off for teamcity in build.gradle.kts
2018-08-14 16:30:23 +03:00
Toshiaki Kameyama
08cfe1acfd "Convert lambda to reference": fix false positive for vararg function
#KT-16422 Fixed
2018-08-14 15:48:37 +03:00
Toshiaki Kameyama
28aa0763a9 "Convert to run / with": don't suggest on java static method call
#KT-25739 Fixed
2018-08-14 15:40:46 +03:00
Toshiaki Kameyama
0a5aa2b60c "Convert lambda to reference": fix case with extension 'this'
#KT-21999 Fixed
2018-08-14 15:39:26 +03:00
Toshiaki Kameyama
2bf3b435f2 Redundant semicolon: fix false positive between modifier and declaration
#KT-25579 Fixed
2018-08-14 15:32:26 +03:00
Toshiaki Kameyama
1898df3fb7 Introduce "Convert property getter to initializer" intention
#KT-13854 Fixed
2018-08-14 15:32:20 +03:00
Toshiaki Kameyama
6fbf6b0a93 "Let type implement interface": don't suggest same type #KT-25928 Fixed 2018-08-14 15:32:17 +03:00
Toshiaki Kameyama
2d2f1125a9 "Remove redundant let": fix destructuring declaration false positive
#KT-26042 Fixed
2018-08-14 15:32:10 +03:00
Toshiaki Kameyama
7e8521d9dc Remove redundant let in "Safe access to if-then" #KT-13515 Fixed 2018-08-14 14:11:15 +03:00
kenji tomita
443b1834bc Add "Replace assertBoolean() with assertEquals() inspection"
#KT-23445 Fixed
2018-08-14 14:11:14 +03:00
Nicolay Mitropolsky
e92d3998de KotlinLanguageInjectionSupport: remove calling replaceInjectionsWithUndo on removing of in-place injection 2018-08-14 13:10:38 +03:00
Nicolay Mitropolsky
cd047b9605 Uast: KotlinUAnnotation.uastAnchor uses nameReferenceElement as javaPsi
because `nameReferenceElement` is not-null in LightAnnotations, but `referenceNameElement` violates `javaPsi` contract
2018-08-14 13:08:38 +03:00
Vyacheslav Gerasimov
9a441b9c8d Make DocumentAdapter.documentChanged overrides compatible with 183 platform 2018-08-14 12:48:26 +03:00
Denis Zharkov
9f3a902ff3 Take into account refined applicability of dsl-marker in IDE
After the previous change, when being applied to a function type
with receiver it's assumed to work just as it's applied to receiver type

Thus, it's necessary to fix relevant IDE features relied on DSL markers

 #KT-23255 Fixed
2018-08-14 15:58:18 +07:00
Denis Zharkov
117abb04aa Fix applicability of dsl-marker on function type
When marker is applied to function type it should work
like it's applied to receiver type

 #KT-23255 Fixed
2018-08-14 15:58:18 +07:00
Denis Zharkov
99fe6de52a Avoid storing ContractProviderKey in user data of every function
Whenever the key is absent it means that for some reason
contract can't be defined there.

But we still want to check them properly, thus checkContractAndRecordIfPresent
should work even if contract is inapplicable here
(no ContractProviderKey in owner's user data)
2018-08-14 15:58:18 +07:00
Georgy Bronnikov
1f7776981d Introduce correspondingProperty to IrField 2018-08-14 10:36:56 +03:00
Dmitry Petrov
ebf8ec455d Box/unbox nullable inline class values with null check
When we have a nullable inline class value with non-null underlying
type, corresponding value in unboxed representation is nullable. E.g.:

  inline class Str(val value: String)

  fun test(s: Str?) = listOf(s)

Here 'test(s: Str?)' accepts nullable 'java.lang.String' as a parameter.

When boxing/unboxing nullable values of such inline classes, take care
of nulls.

 #KT-26052 Fixed Target versions 1.3-M2
2018-08-14 10:22:07 +03:00
Dmitry Petrov
56ad091534 Generate synthetic inline class methods in psi2ir 2018-08-14 10:00:21 +03:00
Dmitry Petrov
de11d9164d Add IrClass.irInline 2018-08-14 10:00:21 +03:00
Nicolay Mitropolsky
9db2b6ffba KtLightPsiJavaCodeReferenceElement reference getting made lazy (KT-26036, EA-125884)
Collecting references from contributors could be expensive and even recursive (EA-125884)
2018-08-13 19:26:07 +03:00
Nicolay Mitropolsky
2ba2d360c2 KtLightPsiJavaCodeReferenceElement delegate made nullable (KT-26036, EA-124029) 2018-08-13 19:26:06 +03:00
Mikhail Glukhikh
84c035c763 For each parameter not used: use same context scope everywhere 2018-08-13 19:03:38 +03:00
Mikhail Glukhikh
bc102bf0c6 MPP new model: temporarily solution for commonTest type identification
Now if source set is not included into any compilation target,
then it is counted as test source set iff "Test" is in name
So #KT-26076 Fixed
2018-08-13 19:03:36 +03:00
Mikhail Glukhikh
a7b51070a7 MPP: find modules for expect / actual: filter non-new MPP modules 2018-08-13 19:03:35 +03:00
Alexey Sedunov
36da80bdf5 MPP: Use only explicitly specified source set dependencies
#KT-25985 Fixed
2018-08-13 19:03:06 +03:00
Alexey Sedunov
543934762e MPP: Implement transitive import of dependencies between source sets 2018-08-13 19:03:05 +03:00
Alexey Sedunov
49b5695664 MPP: Use new MPP model to find modules for 'expect'/'actual'
#KT-25955 Fixed
2018-08-13 19:03:03 +03:00
Mikhail Glukhikh
88ac04001d For each parameter unused: minor optimization / simplification
Related to KT-22068
2018-08-13 19:03:02 +03:00
Mikhail Glukhikh
911f16845e For each parameter unused: add quick-fix "introduce anonymous parameter"
Related to KT-22068
2018-08-13 19:03:01 +03:00
Mikhail Glukhikh
af17a4e961 For each parameter unused: do not report with explicit parameter
In this case we are duplicating compiler warning.
Related to KT-22068
2018-08-13 19:03:00 +03:00
Mikhail Glukhikh
6048647812 For each parameter unused: support correctly it() case
Related to KT-22068
2018-08-13 19:02:58 +03:00
Mikhail Glukhikh
0757533558 "ForEach parameter unused": minor simplification
Related to KT-22068
2018-08-13 19:02:57 +03:00
Dennis Cornwell
f3b0378918 "ForEach parameter unused": don't report destructured parameters
Related to KT-22068
2018-08-13 19:02:56 +03:00
Mikhail Glukhikh
c0c00c8c4e Downgrade "forEach parameter unused" to WEAK WARNING
Related to KT-22068
2018-08-13 19:02:55 +03:00
Dennis Cornwell
e81eee4cc1 Introduce inspection for determining if a forEach parameter is unused
#KT-22068 Fixed
2018-08-13 19:02:53 +03:00
Mikhail Glukhikh
c3b2d1829f Apply "call chain -> sequence" to idea module 2018-08-13 19:02:51 +03:00
Nicolay Mitropolsky
7f49b78e5f 183: MavenImportingTestCase: no more runs for Maven2
because IDEA gets rid of maven2-tests
2018-08-13 16:24:08 +03:00
Alexey Tsvetkov
696b05eb6e Turn off JS IC for Kotlin build
See KT-26064
2018-08-13 16:17:22 +03:00
Mikhael Bogdanov
ff3278828e Minor. Code clean 2018-08-13 15:10:21 +03:00
Mikhael Bogdanov
cb31962b38 Generate old style lambda classes in jvm ir backend 2018-08-13 15:10:20 +03:00
Mikhael Bogdanov
08038d6de9 Convert object literals to classes inside JvmBackendContext 2018-08-13 15:10:18 +03:00
Vyacheslav Gerasimov
2e624f771b 183: Fix MavenImportingTestCase (MavenServerManager.setUseMaven2 signature has changed) 2018-08-13 13:42:29 +03:00
Vyacheslav Gerasimov
d8d0e117cd as33: Set intellijEnforceCommunitySdk in gradle.properties 2018-08-13 12:54:16 +03:00
Vyacheslav Gerasimov
53af68983f as33: Delete AbstractJavaToKotlinConverterForWebDemoTest.kt.as33 2018-08-13 12:52:53 +03:00
Alexander Udalov
ac0f5548aa Only check language version in MemberDeserializer.loadAsSuspend
This is still not 100% foolproof because one may place such a
requirement manually on a suspend function (with `@RequireKotlin`, for
example), which will trick the compiler into thinking that this is a new
suspend function, even if it was compiled with old coroutines. But it's
still better than only checking the version number
2018-08-13 11:02:36 +02:00
Alexander Udalov
c011bf61fe Support multiple version requirements on single element 2018-08-13 11:02:35 +02:00
Dmitry Petrov
b7df36643b Implement additional declaration checks for inline classes
- Implementation by delegation is prohibited
- Delegated properties are prohibited
2018-08-13 08:49:09 +03:00
Dmitry Petrov
0af33462ef Fix code generation for Array<C> element access where C is inline class 2018-08-13 08:49:04 +03:00
Denis Zharkov
8063db5f80 Fix RemoteException that happens in JPS with compiler daemon
Recently, the container for "lookups" has changed to THashSet
And it lead to exception:
java.io.InvalidClassException: gnu.trove.THashSet;
local class incompatible: stream classdesc
serialVersionUID = -8659895033752433145,
local class serialVersionUID = -1699000958968314003

The reasons for different versions of THashSet are unknown
(though likely related to a slightly different classpathes),
but the fix is rather straight-forward

 #KT-26011 Fixed
2018-08-13 10:15:09 +07:00
Vyacheslav Gerasimov
0d2b888bdd Make KotlinFormattingSettingsStatusAction compatible with 183 platform 2018-08-12 13:15:12 +03:00
Sergey Igushkin
456edf3bbd Fix NPE due to classpath delegate change 2018-08-11 23:16:04 +03:00
Sergey Igushkin
5815d6a70c Implement language settings API for Kotlin source sets 2018-08-11 23:16:03 +03:00
Sergey Igushkin
2c04e2b95c Fix: create a compilation's default source set for Android as well 2018-08-11 23:16:03 +03:00
Anton Bannykh
a2f44c3caf JS: Recreate Nashorn script engine occasionally
Otherwise execution slows down significantly.
2018-08-10 22:15:37 +03:00
Vyacheslav Gerasimov
90e0ab022a as33: Set correct intellij-core version for AS 3.3 2018-08-10 20:02:21 +03:00
Alexander Udalov
f663b8f554 Fix kotlin-maven-plugin compilation 2018-08-10 18:34:40 +02:00
Alexander Udalov
76214930da Update generic signatures in codegen test data
The implementation of toString for generic types in Java reflection has
been changed in 8u162 (https://bugs.openjdk.java.net/browse/JDK-8054213)
2018-08-10 18:20:05 +02:00
Nikolay Krasko
9071b5cfa8 Enable reformat for the whole file for the reformat inspection 2018-08-10 18:45:32 +03:00
Nikolay Krasko
563b2f13a3 Better notification logic and explicit code style apply (KT-23400) 2018-08-10 18:45:30 +03:00
Nikolay Krasko
2924bd80d9 Minor: move methods 2018-08-10 18:45:29 +03:00
Nikolay Krasko
5aacd181fa Restore old code style settings action (KT-23400)
Can't use `KotlinCodeStyleSettings` instead `KtCodeStyleSettings`,
because current `KotlinCodeStyleSettings` class is already used in third
party plugin.
2018-08-10 18:45:28 +03:00
Nikolay Krasko
6920e3bd08 Prototype version for code style notifications (KT-23400)
Show information about code style update, when it is actually updated.
2018-08-10 18:45:27 +03:00
Nikolay Krasko
d16b6f9874 Internal action for showing Kotlin code style status (KT-23400)
Need this to monitor different IDE actions results. Commit can be
dropped after transition to new code style settings is finished.
2018-08-10 18:45:26 +03:00
Nikolay Krasko
a1759fe2ab Load kotlin formatter settings with obsolete defaults for restore (KT-23400) 2018-08-10 18:45:24 +03:00
Nikolay Krasko
a22f4232c0 Add information about obsolete code style usage (KT-23400) 2018-08-10 18:45:23 +03:00
Nikolay Krasko
17b88a28a0 Utility for detection if new code style is set by default (KT-23400)
Need this because some code should work differently before and after
applying new Kotlin code style defaults.
2018-08-10 18:45:22 +03:00
Pavel V. Talanov
01f1917d2a Run/test line markers: aggregate results across implementing modules 2018-08-10 17:00:03 +02:00
Mikhail Zarechenskiy
0fff8ebf71 Fix SOE after enabling SAM conversions 2018-08-10 17:24:19 +03:00
Mikhail Zarechenskiy
b1985ee422 Enable SAM conversion for Kotlin functions by default in new inference
KT-25686
2018-08-10 17:24:18 +03:00
Nicolay Mitropolsky
31a5746724 183: implementation of JvmElementActionsFactory.createChangeParametersActions 2018-08-10 15:29:44 +03:00
Nicolay Mitropolsky
45b74e9fdb MockUpdateParameterInfoContext BUNCH comments added 2018-08-10 15:29:44 +03:00
Natalia Selezneva
97f1fc1f54 Rewrite MultiplatformProjectImportingTest to use testData directory 2018-08-10 15:26:12 +03:00
Natalia Selezneva
d20b58ce61 Rewrite GradleConfiguratorTest to use testData directory 2018-08-10 15:26:11 +03:00
Natalia Selezneva
f395f163f8 GradleImportingTestCase: add infrastructure to use files from testData folder 2018-08-10 15:26:10 +03:00
Natalia Selezneva
c17d7e63c8 Convert GradleImportingTestCase to Kotlin 2018-08-10 15:26:09 +03:00
Natalia Selezneva
cf56915f03 Rename .java to .kt 2018-08-10 15:26:09 +03:00
Natalia Selezneva
f104bdfe03 Do not log full file text when code fragment was created with error context of PsiFile 2018-08-10 15:26:08 +03:00
Natalia Selezneva
b7bdb43219 Fix leaked thread for AbstractScriptConfigurationTest 2018-08-10 15:26:07 +03:00
Denis Zharkov
b38a9ee386 Fix test data for postfix templates test
In this tests there are two variants:
- One extracts the lambda
- And another extracts the whole call

For some reason, the order of completion variants has been changed in 182
2018-08-10 18:40:44 +07:00
Dmitry Savvinov
20262b8700 Relax assertion in PsiContractPraserDispatcher.parseContract
See EA-124365 - KNPE: PsiContractParserDispatcher.parseContract

Reason of this is unknown, issue KT-26034 will be investigated
later.
2018-08-10 13:27:32 +03:00
Dmitry Savvinov
57bafcf9e9 Do not lose information about contracts if call uses default value
It is safe to treat DefaultValueArgument as UNKNOWN_COMPUTATION, because
default arguments can't break smartcasts.

Possibly, they can add new ones, but it can be supported later.

^KT-25278 Fixed
2018-08-10 13:19:32 +03:00
Nicolay Mitropolsky
cf62acc6d6 MockUpdateParameterInfoContext compilation fix for 183 2018-08-10 13:15:37 +03:00
Alexander Udalov
587ce56ad6 Use safer way of filtering out files from other modules
Comparing files by paths is too error-prone and it created a problem
here, where paths of File instances on Windows use "\" as a separator,
whereas VirtualFile paths always use "/", resulting in empty source
lists being compiled. This issue was introduced in 1582354077. Instead,
get the instance of the VirtualFile by path, and use its identity for
comparison
2018-08-10 11:33:52 +02:00
Sergey Rostov
59c41e111d K2JSCompilerArguments: sourceMapEmbedSources should be null by default.
When sourceMapEmbedSources are not null and source maps is disabled warning is reported, since it has effect only when source maps are enabled. Also this fixes some JPS JS with warnings count assertions.
2018-08-10 12:23:40 +03:00
Denis Zharkov
3e3841d17e Minor. Rename DelegatingDataFlowInfo -> DataFlowInfoImpl 2018-08-10 15:40:50 +07:00
Denis Zharkov
0eba48ae46 Adjust KotlinExpressionTypeProvider to new DataFlowInfo contracts
Now, trivial info is not being perstisted in the maps of DataFlowInfo

At the same time, we don't record trivial DataFlowInfo instances in binding context:
org.jetbrains.kotlin.resolve.bindingContextUtil.BindingContextUtilsKt#recordDataFlowInfo
Namely, it happens in case when expression is a callee expression of
"variable as function" calls (see
org.jetbrains.kotlin.idea.codeInsight.ExpressionTypeTestGenerated#testKt11601)

At the same time, there's a hack in `org.jetbrains.kotlin.resolve.calls.callUtil.CallUtilKt#getType`
that helps to obtain type itself for these callees from the resolved calls.

So, it will work anyway if we use `noTypeInfo` here, that is kind of
correct since there's no non-trivial info anyway
2018-08-10 15:40:50 +07:00
Denis Zharkov
375f3c0769 Fix type-intersection-related test data
The order of types enumeration has been changed recently:
previously it was collected at first from a child and then from
its parent, but now it's being collected in order of appearance
2018-08-10 15:40:50 +07:00
Denis Zharkov
d024d2e64c Adjust PreliminaryLoopVisitor to new contracts of DataFlowInfo
Previously, there was a contract that if it contains some
non-trivial type info it also has it in `completeNullabilityInfo`.

But after two previous changes it became false
2018-08-10 15:40:50 +07:00
Denis Zharkov
666ca77666 Fix incorrect optimization in ExpressionTypingServices
Previously, it's been working because was almost always
a different instance.

After, the latter change with avoidance of storing trivial
info there, newDataFlowInfo may accidentally become empty
as context.dataFlowInfo.
But we, obviously, should compare it with newContext.dataFlowInfo instead
2018-08-10 15:40:50 +07:00
Denis Zharkov
9297babc20 Avoid putting trivial information into DelegatingDataFlowInfo map 2018-08-10 15:40:50 +07:00
Denis Zharkov
d20e5ce673 Cache hashCode for DataFlowValue in another field
It's necessary because DataFlowValue instances are commonly
used as keys in maps

 #KT-24657 Fixed
2018-08-10 15:40:50 +07:00
Denis Zharkov
e5507108ed Get rid of affectReceiver parameter in DelegatingDataFlow::putNullabilityAndTypeInfo
The only non-default argument was inside "assign" method
And it can be replaced with simple map instantiation
2018-08-10 15:40:50 +07:00
Denis Zharkov
851d760ac1 Minor. Extract common parts from DelegatingDataFlow::equate/disequate 2018-08-10 15:40:50 +07:00
Denis Zharkov
bf1f94c185 Rewrite DelegatingDataFlowInfo using immutable collections from javaslang
It may be useful because data-flow info is mostly the same for
neighbouring expressions and changes between them should be minor.

Thus, it should help to avoid making copies of huge maps and reusing
them instead
2018-08-10 15:40:50 +07:00
Denis Zharkov
f61686fcbf Minor. Convert loop to 'mapTo' call 2018-08-10 15:40:50 +07:00
Denis Zharkov
5bfa409da6 Get rid of DelegatingDataFlowInfo::parent property
It's been used to bring immutability to DelegatingDataFlowInfo
But in case of statements sequence like:
x = 1
...
x = 1

it would lead to huge DelegatingDataFlowInfo where each of
getCollectedNullability call works for O(n) where n is amount
of assignments

The solution is to get rid of reference to parent and to update
relevant maps properly

In next commits immutable maps will be used instead of making copies each
time
2018-08-10 15:40:50 +07:00
Dmitry Petrov
4f6aa50417 Fix == for inline classes with boxes
TODO generalize code generating object vs primitive equality

 #KT-25914 Fixed
 #KT-25981 Fixed
 #KT-25983 Fixed
2018-08-10 10:34:57 +03:00
Alexander Udalov
cd12772bc5 Remove unneeded bunch files related to PsiJavaModule
PSI for modules and related classes are already available in AS3.1
2018-08-10 00:10:37 +02:00
Roman Artemev
6c8e30eb05 Fix test failures
* add metadata
 * unmute working tests
 * mute temporary broken ones
2018-08-09 20:55:50 +03:00
Dmitry Savvinov
447c127036 Fix unsound smartcast from loop condition on assigned vars
^KT-22379 Fixed
2018-08-09 19:56:23 +03:00
Mikhael Bogdanov
a7d706f693 Unmute jvm ir-tests 2018-08-09 16:30:32 +03:00
Mikhael Bogdanov
3c5a146c1f Support captured parameters in callable references 2018-08-09 16:30:28 +03:00
Zalim Bashorov
3c765e3625 [JS BE] Support val in when subject
#KT-25014 Fixed
2018-08-09 16:22:25 +03:00
Zalim Bashorov
289ff845c4 Minor: remove extra slash from a testdata file 2018-08-09 16:22:25 +03:00
Leonid Startsev
c9cb5a975c Support for multiple origins in irEquals builder
to preserve correct origin when it's called from irNotEquals
2018-08-09 16:16:10 +03:00
Leonid Startsev
28319a76df Access to ir and external symbol table 2018-08-09 16:16:10 +03:00
Leonid Startsev
87da6e2226 Add ir generation plugins to JS and JVM BE 2018-08-09 16:16:10 +03:00
Leonid Startsev
5d669ff671 Additional helpers in IR builders 2018-08-09 16:16:10 +03:00
Leonid Startsev
ba9b7547b0 Generate IR for synthetic nested classes directly in class generator 2018-08-09 16:16:09 +03:00
Leonid Startsev
c3f66cda65 Lowering extension point 2018-08-09 16:16:09 +03:00
Denis Vnukov
65c79ecfe9 Primitive support for LocalVariables for function parameters 2018-08-09 16:13:21 +03:00
Denis Vnukov
1a56af9bb0 Adding missing SourceFile attribute to classes generated with IR 2018-08-09 16:13:17 +03:00
Simon Ogorodnik
fca82c8e28 Cleanup dependencies of module :compiler:backend, :plugins:import-dumper 2018-08-09 16:04:31 +03:00
Toshiaki Kameyama
f2fec6b078 Fix messages #KT-25177 2018-08-09 15:24:20 +03:00
Toshiaki Kameyama
605736b6ba Introduce "redundant asDynamic" inspection #KT-25177 Fixed 2018-08-09 15:24:20 +03:00
Anton Bannykh
2c4e21ca36 JS box tests via Mocha: respect the ignoreTestFailures flag 2018-08-09 15:00:54 +03:00
Mikhael Bogdanov
bbc5fa4705 Perform InnerClassLowerings after CallableReferenceLowering 2018-08-09 14:22:51 +03:00
Mikhael Bogdanov
357359b1dd Unmute ir-tests after CR support 2018-08-09 14:22:50 +03:00
Mikhael Bogdanov
6b5b9fbde4 Temporary use special container mapping logic for IR backend 2018-08-09 14:22:47 +03:00
Mikhael Bogdanov
813e1ffa39 Initial support of function callable references 2018-08-09 14:22:46 +03:00
Mikhael Bogdanov
06b16a6459 Unmute ir-tests after prev commit 2018-08-09 14:22:46 +03:00
Mikhael Bogdanov
da34299064 Temporary set public constructor visibility for lowered local declarations
Allow to support callable reference in next commits
2018-08-09 14:22:45 +03:00
Alexey Sedunov
fdc15b053d Minor: Remove unnecessary checks in new test 2018-08-09 13:36:57 +03:00
Mikhail Glukhikh
87d81a75f3 Fix secondary constructor deletion in "sealed class -> object" 2018-08-09 13:33:03 +03:00
Mikhail Glukhikh
0fb8dd2f75 Handle constructor usage for actual class as usage of expect class
#KT-25498 Fixed
2018-08-09 13:00:47 +03:00
Mikhail Glukhikh
f4d048334f Fix test for "Remove abstract function body"
Formatting rules (probably) was slightly changed in 182 branch,
so I have to introduce bunch file for 181/173/AS here
2018-08-09 13:00:34 +03:00
Mikhail Glukhikh
87b5fca094 Fix test for "Suppress unused if annotated"
Quick-fix test was changed in 182 branch,
so I have to introduce bunch files for 181/173/AS here
2018-08-09 13:00:00 +03:00
Mikhail Glukhikh
db787c78d6 Implement members: don't add 'actual' modifier for fake overrides
#KT-25044 Fixed
2018-08-09 12:59:58 +03:00
Mikhail Glukhikh
ed5791ed9e Introduce "remove actual" fix for ACTUAL_WITHOUT_EXPECT
Related to KT-25044
2018-08-09 12:59:57 +03:00
Mikhail Glukhikh
a91442cd3b Enable "add () fix" for expect base class without constructors
Related to KT-24597
2018-08-09 12:59:55 +03:00
Mikhail Glukhikh
79abf90916 Introduce "add default constructor for expect class" fix
Related to KT-24597
2018-08-09 12:59:54 +03:00
Nikolay Krasko
3dd99ce4cb Register gradle extension to run GradleWrongPluginVersion inspection
Gradle plugin isn't fully registered in tests in 182.
2018-08-09 12:25:50 +03:00
Nikolay Krasko
71bdda0980 Do not use Kotlin in Java files in find usages tests 2018-08-09 12:25:50 +03:00
Nikolay Krasko
fce21d1082 Make GradleClassFinder optional in tests for known class finder
Since 182 Gradle plugin is not fully loaded in tests and GradleClassFinder
is absent in the list.
2018-08-09 12:25:50 +03:00
Alexey Sedunov
465e11c473 Minor: Add missing import for 173 bunch 2018-08-09 12:08:40 +03:00
Alexey Sedunov
1b15ce3ddc Move: Fix top-level declaration detection for scripts
#KT-25858 Fixed
2018-08-09 10:06:31 +03:00
Alexey Sedunov
1797a50fc9 Move: Fix "whole file" mode detection for scripts
#KT-25857 Fixed
2018-08-09 10:06:31 +03:00
Alexey Sedunov
40a5bf0355 Gradle: Support Gradle test runner for TestNG tests
#KT-22732 Fixed
2018-08-09 10:06:31 +03:00
Alexey Sedunov
73bdbbc697 Configuration: Do not show -Xfriend-paths in additional arguments
#KT-25945 Fixed
2018-08-09 10:06:31 +03:00
Alexey Sedunov
cd61633b5d Configuration: Support external storage for imported facets
#KT-25913 Fixed
2018-08-09 10:06:30 +03:00
Alexey Sedunov
abbac067b8 Configuration: Collapse empty nullable strings to null 2018-08-09 10:06:30 +03:00
Alexey Sedunov
db556d6551 Configuration: Clean library version before adding it as dependency
#KT-25633 Fixed
2018-08-09 10:06:30 +03:00
Alexey Sedunov
a8f8ecc012 Configuration: Invalidate caches when changing compiler options
#KT-25515 Fixed
2018-08-09 10:06:30 +03:00
Alexey Sedunov
a54f410a15 Configuration: Use specific language/API version only for new projects
#KT-25640 Fixed
2018-08-09 10:06:30 +03:00
Mikhail Zarechenskiy
70aa16f71a Fix hashCode & equals for IntegerValueTypeConstant 2018-08-09 09:49:21 +03:00
Mikhail Zarechenskiy
1a511166cc Discriminate unsigned types in overload resolution
#KT-24717 Fixed
 Relates to #KT-25996 and #KT-25997
2018-08-09 09:49:17 +03:00
Mikhail Zarechenskiy
be38263fc7 Introduce conversions from signed pure constants to unsigned ones
#KT-24717 In Progress
 #KT-25996 Open
 #KT-25997 Open
2018-08-09 09:47:48 +03:00
Ilya Gorbunov
7c996dc218 Improve padStart/padEnd samples 2018-08-09 04:38:22 +03:00
Gen
a90b72ffd8 KT-20357 Add samples for padStart() and padEnd() 2018-08-09 04:38:22 +03:00
Roman Artemev
36a99da820 Break/finally chain in suspend function test fix & workaround 2018-08-08 19:11:17 +03:00
Roman Artemev
efec82c0eb Update test data
* add new tests for coroutines
 * add copy of some tests without dependency on stdlib
2018-08-08 18:33:41 +03:00
Roman Artemev
c62e4b4fcf [JS IR BE] Support coroutines
* Move FinallyBlockLowering to common part
* Fix catching of dynamic exception
* Fix bridges for suspend functions
* Disable explicit cast to Unit
* Run lowering per module
* Update some test data
2018-08-08 18:33:39 +03:00
Vyacheslav Gerasimov
37fadb8ee5 as33: Remove incorrect gradle.xml.as33 2018-08-08 16:26:15 +03:00
Mikhail Zarechenskiy
d3280252f9 Prohibit inline data classes
`CONFLICTING_JVM_DECLARATIONS` diagnostics are reported because we're
 trying to generate functions from `Any` once for inline class and
 once for data class

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

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

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

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

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

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

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

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

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

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

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

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

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

Also "kotlinize" getKtFiles and rename to createKtFiles
2018-08-07 13:38:30 +02:00
Alexander Udalov
fe829add44 Minor, use TEMP_DIR/TESTDATA_DIR in CLI tests on xml build files
Otherwise the "outputDir" in these tests was treated as relative to the
project root, and starting from 63b4302cea, running these tests resulted
in the "whatever" directory being created in the project root
2018-08-07 13:38:30 +02:00
Alexander Udalov
19feacb96b Minor, expand TESTDATA_DIR with absolute path in CLI tests
To be able to use it correctly inside an xml build file where, if the
path is not absolute, it's treated as relative to the build file path
(which is TMP_DIR in several tests of the subsequent commit)
2018-08-07 13:38:30 +02:00
Alexander Udalov
f9ed8e7aaf Minor, make org.jetbrains.kotlin.fileClasses.LOG private
To prevent it from being suggested in auto-import
2018-08-07 13:38:30 +02:00
Alexander Udalov
5da8ce844a Minor, move ContentRoot and KotlinSourceRoot to module 'cli'
Also move CONTENT_ROOTS from JVMConfigurationKeys to
CLIConfigurationKeys since it's used on all platforms, not just JVM
2018-08-07 13:38:30 +02:00
Alexander Udalov
14b8f4b52b Minor, change package of outputUtils.kt 2018-08-07 13:38:30 +02:00
Alexander Udalov
2d875a9cb4 Reformat module 'cli', fix warnings/inspections 2018-08-07 13:38:29 +02:00
Nikolay Krasko
21a7561271 Fix small gap for install message 2018-08-07 14:08:09 +03:00
Nikolay Krasko
cb925375ed Not enough padding/white space for current version in update form (KT-25562)
#KT-25562 Fixed
2018-08-07 14:07:03 +03:00
Mikhael Bogdanov
5169cfba8f Use lazy symbol table in symbols 2018-08-07 12:42:05 +03:00
Nikolay Krasko
8e7d114850 Merge pull request #1795 from belovrv/patch-2
Delete the SlackIn badge
2018-08-07 12:28:00 +03:00
Nicolay Mitropolsky
bbf2af1004 IdeaExtensionPoints.IDEA_COMPATIBLE_BUILD_NUMBER = "182.3040"
Otherwise Kotlin plugin is not loaded in some tests (`org.jetbrains.uast.test.kotlin.KotlinDetachedUastTest` for instance)
2018-08-07 12:26:30 +03:00
belovrv
c17a9e10b5 Delete the SlackIn bage 2018-08-07 12:21:56 +03:00
Mikhail Zarechenskiy
1497c19dc9 Do not generate useless methods inside wrapper for inline class
Fix for test data (inlineFunctionInsideInlineClassesBox.kt) is needed
 to avoid check about "no inline functions".

 This check has two steps: first, names of inline functions from
 the metadata are loaded, then these names are checked that they are
 presented for physical methods in the classfile.

 Because now there are no physical methods in the classfile, we can't pass
 the second check, therefore this fix is needed.

 #KT-24872 Fixed
2018-08-07 12:15:46 +03:00
Yan Zhulanow
fcbcabd3a2 Pill: Generate iml files more consistently with IDEA 2018-08-07 11:55:24 +03:00
Yan Zhulanow
014b812a31 Pill: Remove -SNAPSHOT suffixes for artifact JAR file names 2018-08-07 11:55:24 +03:00
Yan Zhulanow
42d00c144b Pill: Fix compilation, forcibly move the annotations-13 dependency to the end of classpath 2018-08-07 11:55:24 +03:00
Yan Zhulanow
769a0d7701 Pill: Add extra stdlib jars as dist libraries 2018-08-07 11:55:23 +03:00
Yan Zhulanow
54470fe2b7 Pill: Remove source dependencies to 'tests-common'
'tests-common' module does only have a test source set so the dependency is redundant.
2018-08-07 11:55:23 +03:00
Mikhail Glukhikh
09766ae2ae Reformat: AddNameToArgumentFix 2018-08-07 11:30:31 +03:00
Mikhail Glukhikh
06d339639f Fix "Add name to argument" (disable reformatting in quick-fix text)
Four relevant quick-fix tests should be fixed after it
2018-08-07 11:30:31 +03:00
Mikhail Glukhikh
28484f31e7 Fix "Remove @ from annotation argument" (make consistent PSI)
Three relevant quick-fix tests should be fixed after it
2018-08-07 11:30:31 +03:00
Dmitry Savvinov
9ad2edbe85 Bump stubs versions after 5ab79a111d 2018-08-07 10:22:46 +03:00
Dmitry Savvinov
bd9254597d Fix testdata after switching idea version to 182
The source of testdata change is following commit from the
intellij-community repo:

d2bfe3d14bfa48af585f1faddc9a0c37dc05e724

It changes how Java-resolution resolves constructors:
- before, *any* PsiMethod without type reference was treated as
constructor
- now, PsiMethod without type reference is treated as constructor
only if their *names also match*

In particular, in this test, 'void () {}', surprisingly, doesn't have a
type reference ('void' is parsed as PsiErrorElement:Identifier
expected), its name is '<unnamed>', and its visibility is
'package-private' (!)

Therefore, previously we thought that 'Nameless' has package-private
constructor and were reporting INVISIBLE_MEMBER.
Now we don't see any constructor so we add default constructor, which has
public-visibility -> error is gone.

Note that this change affects behavior only when "red" code is already
present in the project (for "green" code, assumption "method without type
reference is a constructor" is indeed correct).
2018-08-07 10:18:25 +03:00
Dmitry Savvinov
a71f09022c Fix testdata after switching idea version to 182
The source of changes is commit the following commit in
intelllij-community repo:

b2b723fa449b16bb1da8102a5efdc219977fefe0 speedup java class resolve a bit

Eseentially, it makes Java resolve (which Kotlin reuses) accept first
matching candidate from explicit named import, instead of continuing
search.

Hence, behavior in cases where several conflicting imports are present,
has changed: before, reference to such names were unresolved, now it's
candidate from first import (see also test UsageMixed.java in the
intellij-community repo).

Therefore, previously we saw such types as undeclared and reported
MISSING_DEPENDENCY_CLASS on them (assuming they are not present in
classpath); now we see such types as properly resolved, so error is
gone.

Because behavior has changed only in case there already was "red" code,
it is not a BC and we can just accept changes.
2018-08-07 10:18:25 +03:00
Alexey Sedunov
ed5709afdb Misc: Fix compatibility issues with AS3.3C4 2018-08-06 21:39:17 +03:00
Vyacheslav Gerasimov
8231f5b259 Make handleElementRename overrides compatible with 183 platform 2018-08-06 20:24:46 +03:00
Mikhail Glukhikh
d7317c58e9 Move "Add test library to classpath" to irrelevant action list
This prevents inconsistencies like "Add JUnit 5.0" / "Add JUnit 5.2"
Should fix one relevant test
2018-08-06 19:04:12 +03:00
Mikhail Glukhikh
21be8d118d Fix "ReplaceInfixOrOperatorCallFix" (make consistent PSI)
One relevant quick-fix test should be fixed after it
2018-08-06 19:04:11 +03:00
Mikhail Glukhikh
247bb912ba Fix refactoring test (bunch file -> original file) 2018-08-06 19:04:09 +03:00
Mikhail Glukhikh
e15fc7da15 Fix two inspection tests (bunch file -> original file) 2018-08-06 19:04:07 +03:00
Mikhail Glukhikh
90245659ff Fix testOptionalParameterAndLambdaComplex (related to KT-24694) 2018-08-06 19:04:05 +03:00
Mikhail Glukhikh
07ff2bff33 Reformat & cleanup: psiModificationUtils, especially PsiElement.replaced 2018-08-06 19:04:04 +03:00
Mikhail Glukhikh
1d2438e04e Report SUPERTYPE_NOT_INITIALIZED even if no constructors in superclass
Before this commit, expect super-class without constructors did not
provoke SUPERTYPE_NOT_INITIALIZED. However, it should, but only
if sub-type is normal class (not an expect one).

So #KT-24597 Fixed
2018-08-06 19:02:24 +03:00
Vyacheslav Gerasimov
6db2037440 Make JavaToKotlinAction.convertFiles compatible with AS 3.3 2018-08-06 18:39:00 +03:00
Mikhail Zarechenskiy
1972387022 Fix test data after 6d4d244c28 2018-08-06 17:45:24 +03:00
Mikhail Zarechenskiy
659289b41a Report diagnostics about experimentality on unsigned literals
#KT-25580 Fixed
2018-08-06 17:45:22 +03:00
Mikhail Zarechenskiy
55e7def3c1 Fix coercion for stack value property in case of inline classes
#KT-25771 Fixed
2018-08-06 17:45:20 +03:00
Bloder
f89803fe8f Create samples for String.toLowerCase/toUpperCase
* Create toLowerCase method sample
* Create toUpperCase method sample
* Create toUpperCase sample reference in StringsJVM
* Create sample ref and doc of js impl toUpperCase
* Create sample ref and docs of js toLowerCase
* Add sample ref in toLowerCase expect fun
* Add sample ref in toUpperCase expect fun
2018-08-06 15:34:57 +03:00
Vyacheslav Gerasimov
e41f468bd8 Update compiler.pro for 183 platform 2018-08-06 15:08:03 +03:00
Vyacheslav Gerasimov
f712759a3e Make isReferenceTo parameter NotNull, annotated in 183 platform 2018-08-06 15:08:03 +03:00
Ilya Chernikov
a3d719785c Drop exception/stacktrace from logging warning if a script template is not found in the classpath
reducing clutter in logs and console
#KT-24754 fixed
2018-08-06 13:58:49 +02:00
Alexander Udalov
6f9441d3f4 Do not output empty non-root packages in tests with txt
Mostly to avoid listing every internal package in
kotlin-stdlib/kotlin-reflect, as in
acd5b62148/compiler/testData/diagnostics/testsWithUnsignedTypes/conversions/conversionOfSignedToUnsigned.txt (L144)
2018-08-06 13:43:32 +02:00
Alexander Udalov
ccb6410823 Rework and move the pull request checklist to a new section in ReadMe
Otherwise this text appears in numerous pull requests and contributors
do not understand what to do with it
2018-08-06 13:41:49 +02:00
Alexander Udalov
4c7bdf5437 Minor, fix typos in ReadMe 2018-08-06 13:41:49 +02:00
Mikhael Bogdanov
ddf6bdffcf Move jvm ir tests to jvm ones 2018-08-06 13:57:43 +03:00
Natalia Selezneva
0e8b93bf35 Use IDELanguageSettingsProvider getting languageVersionSettings and targetPlatform during analysis 2018-08-06 10:41:42 +02:00
Ilya Chernikov
f2395bac2f Use script compiler options to calculate target platform in IDE
#KT-25822 fixed
2018-08-06 10:41:41 +02:00
Vyacheslav Gerasimov
0cf6b26494 as32: Set since-build to 181.5281 (AS 3.2 Beta 5) 2018-08-06 11:15:50 +03:00
Mikhail Zarechenskiy
2ee483f92b Do not generate bodies for functions from Any for light classes
#KT-25894 Fixed
2018-08-06 10:57:53 +03:00
Mikhail Zarechenskiy
ddf6c37e0e Prohibit inline classes with special underlying types
#KT-25328 Fixed
 #KT-23819 Fixed
2018-08-06 10:56:05 +03:00
Mikhail Zarechenskiy
6d4d244c28 Generate function from Any for inline classes same as for data classes
#KT-24873 Fixed
 #KT-25293 Fixed
 #KT-25299 Fixed
2018-08-06 10:56:01 +03:00
Mikhail Zarechenskiy
043ce1cb27 Support secondary constructors for inline classes
#KT-25614 Fixed
 #KT-25246 Fixed

 KT-25599 Will be fixed after recompilation of unsigned classes
2018-08-06 10:55:57 +03:00
Mikhail Zarechenskiy
064eb24d51 Refactoring: extract methods about constructor codegen out
#KT-25614 In Progress
2018-08-06 10:22:21 +03:00
Mikhail Zarechenskiy
e28c2ed549 Refactoring: extract codegen methods about functions from Any out 2018-08-06 10:22:17 +03:00
Mikhail Zarechenskiy
c253b39acf Refactoring: extract generator for functions from Any 2018-08-06 10:19:46 +03:00
Mikhail Zarechenskiy
6244846107 Add functions from Any to the member scopes of inline classes 2018-08-06 10:19:43 +03:00
Mikhail Zarechenskiy
fdf538007c Refactoring: extract logic about methods from Any for scopes out 2018-08-06 10:19:39 +03:00
Andrey Breslav
6e3497771d Some notes on contributing language features
This is to provide some guidance for PRs like: https://github.com/JetBrains/kotlin/pull/1769
2018-08-06 06:32:40 +03:00
Vyacheslav Gerasimov
e4bf20a267 183: Set since-build to 183.1 2018-08-03 21:29:19 +03:00
Vyacheslav Gerasimov
ebb90f8260 183: Build against 183-SNAPSHOT 2018-08-03 21:29:19 +03:00
Vyacheslav Gerasimov
4996d81ea1 Add 183 rule to .bunch 2018-08-03 21:29:19 +03:00
Vyacheslav Gerasimov
5666e1ea93 Update versions.gradle.kts for 183 2018-08-03 21:29:19 +03:00
Vyacheslav Gerasimov
c7a00971fe Fix source compatibility with 183 platform 2018-08-03 21:29:18 +03:00
Vyacheslav Gerasimov
57963d2e03 Remove asm-shaded sources downloading code since it is not published anymore 2018-08-03 21:29:18 +03:00
Nikolay Krasko
5ba877c144 Add empty test data files to make new test framework in 182 happy 2018-08-03 21:06:05 +03:00
Alexander Udalov
fe2251bfca Run classifier usage checkers on function types 2018-08-03 18:03:52 +02:00
Nikolay Krasko
759ffafb0a Render flexible types with enhancement as enhanced in IDE (KT-25622)
Main targets for the fix is completion, parameters info, inlay hints and
override/implement.

Other IDE functions might be affected.

 #KT-24911 Fixed
 #KT-25616 Fixed
 #KT-25622 Fixed
2018-08-03 16:00:09 +03:00
Nikolay Krasko
653d1d00de Option for rendering types with enhancement 2018-08-03 16:00:07 +03:00
Nikolay Krasko
ceeeffd814 Extend list of annotations ignored in parameter info (KT-24911, KT-25622)
#KT-24911 Fixed
2018-08-03 16:00:04 +03:00
Nikolay Krasko
10b2229a27 Skip main file while configuring extra files in parameter info test 2018-08-03 16:00:03 +03:00
Nikolay Krasko
ce9e7261a7 Allow kotlin extra files in parameter info tests 2018-08-03 16:00:02 +03:00
Natalia Selezneva
6672fd7bbf Fix tests for highlighting in scripts with custom script definition 2018-08-03 15:25:35 +03:00
Natalia Selezneva
41dc059da9 Register custom file extension for scripts loaded from script template 2018-08-03 15:25:35 +03:00
Natalia Selezneva
be2d4964fd Fix testData, add script-runtime 2018-08-03 15:25:35 +03:00
Natalia Selezneva
f71269009a Refactoring: use KtScript.scriptDefinition instead of KotlinScriptDefinitionProvider.findScriptDefinition if possible 2018-08-03 15:25:35 +03:00
Natalia Selezneva
736361e345 Provide a default scriptDefinition for script 2018-08-03 15:25:35 +03:00
Natalia Selezneva
c802428326 Do not check script definitions in parser 2018-08-03 15:25:35 +03:00
Alexey Sedunov
3ce4a14583 Misc: Workaround for failing tests due to unknown ".gradle" extension 2018-08-03 14:48:56 +03:00
Toshiaki Kameyama
1ac6f18a47 "Convert put to assignment": Fix false positive inside elvis expression
So #KT-22072 Fixed
2018-08-03 13:21:50 +03:00
Toshiaki Kameyama
1b1e503716 Add quick-fix for default parameter value removal #KT-25146 Fixed 2018-08-03 13:17:49 +03:00
Toshiaki Kameyama
a059d50c8f "Call chain may be simplified": fix false positive on Java Map
So #KT-25089 Fixed
2018-08-03 13:15:53 +03:00
Ilya Gorbunov
c9a784ebb0 Deprecate projectDist and make it a temporary alias for default configuration 2018-08-03 09:37:38 +03:00
Ilya Gorbunov
2a598e0ac4 Replace ReadOnly/Mutable usages in the compiler
Replace ones from org.jetbrains.kotlin package with new annotations from kotlin.annotations.jvm.
No need to copy them to compile kotlin-reflect anymore.
Then simplify reflect project more: no sources — no need to pack its direct output.
2018-08-03 09:37:38 +03:00
Dmitry Petrov
1bfb75a51b Generate intrinsic-based numeric comparison only for FP types 2018-08-03 09:34:59 +03:00
Vyacheslav Gerasimov
cce9505e31 Fix AbstractSpringClassAnnotatorTest compilation 2018-08-02 23:15:29 +03:00
Vyacheslav Gerasimov
5c177a86fe Use snapshot repository if platform version ends with SNAPSHOT 2018-08-02 23:15:28 +03:00
Simon Ogorodnik
07cc3bd63a KT-25733: Fix regression after optimization
#KT-25733 fixed
2018-08-02 22:41:48 +03:00
Nikolay Krasko
be3f0628ef Fix file structure tests in 182 2018-08-02 21:30:05 +03:00
Vyacheslav Gerasimov
8ccfdc70ac as33: Add private bintray repo to build against custom AS 3.3 build 2018-08-02 20:53:17 +03:00
Vyacheslav Gerasimov
8fc0c1d7b0 as33: Add AS 3.3 bunchset built with AS 3.3 C4 2018-08-02 20:53:17 +03:00
Vyacheslav Gerasimov
94bbb3831a Add as33 rule to .bunch file 2018-08-02 20:53:17 +03:00
Alexander Udalov
0355746304 Implement OpenAddressLinearProbingHashTable.entries for debug when needed
Otherwise it's very difficult to view the contents of BindingContext in
debugger views
2018-08-02 18:36:22 +02:00
Vyacheslav Gerasimov
53b1a8bd37 Remove hacks introduced for 172 platform compatibility 2018-08-02 19:32:18 +03:00
Vyacheslav Gerasimov
a2bf417d75 Remove 172 bunchset 2018-08-02 19:32:18 +03:00
Ilmir Usmanov
0c867b4804 Disable callable references to suspend functions in 1.2
#KT-25604: Fixed
2018-08-02 18:55:49 +03:00
Vyacheslav Gerasimov
ec276a07cb Add keep rule to compiler.pro for org.jdom.output.XMLOutputter
Without this class PluginManagerCore.loadDescriptorFromJar fails
2018-08-02 18:17:08 +03:00
Vyacheslav Gerasimov
0103c0d2fd Switch to 182 platform 2018-08-02 18:17:06 +03:00
Mikhael Bogdanov
a8b9393e79 Fix test data 2018-08-02 15:51:16 +02:00
Svyatoslav Scherbina
e923c65704 backend.common: improve support for unsigned types 2018-08-02 16:29:39 +03:00
Svyatoslav Scherbina
1aac1c2d69 Prepare default arguments IR lowering for inline classes support
Allow `nullConst` to be customized by backend
2018-08-02 16:29:38 +03:00
Natalia Selezneva
d57099088e Fix unusedReceiverParameter test 2018-08-02 15:12:56 +03:00
Nikolay Krasko
79ad0ea2ef Test for Gradle and Maven migration (KT-23401) 2018-08-02 14:44:42 +03:00
Nikolay Krasko
7aadf95f66 Don't show migration dialog if there're no project files changed (KT-23401) 2018-08-02 14:44:41 +03:00
Nikolay Krasko
f0794dbc0a Ability to disable migration detection (KT-23401)
-- to disable
2018-08-02 14:44:40 +03:00
Nikolay Krasko
bffbcc595c Add inspections to migration (KT-23401) 2018-08-02 14:44:40 +03:00
Nikolay Krasko
30ec73f322 Add migration action and marker fix interface (KT-23401) 2018-08-02 14:44:40 +03:00
Nikolay Krasko
feb456b0e1 Migration dialog (KT-23401) 2018-08-02 14:44:39 +03:00
Nikolay Krasko
4574fd94c6 Monitor maven projects synchronization (KT-23401)
-- Maven migrator
2018-08-02 14:44:39 +03:00
Nikolay Krasko
b4c88651f6 Migration detector for external systems (KT-23401) 2018-08-02 14:44:39 +03:00
Nikolay Krasko
02796783d3 Minor: update maven external system id 2018-08-02 14:44:39 +03:00
Nikolay Krasko
f9845bab54 Workaround for the case when some classes are unloaded during ranking (KT-25774)
It's important that ranking preserve order of files found
in findFilesByNameInPackage()

It's only a workaround because it's expected for debugger to have
classes unloaded and some valid variants might get bad rank and
rejected because of that.

 #KT-25774 Fixed
2018-08-02 14:38:28 +03:00
Nikolay Krasko
da6bcc9d46 Do not check locations inside synthetic and bridge methods
No valid psi declarations can be found for such locations leading to
negative rank.
2018-08-02 14:38:27 +03:00
Nikolay Krasko
c2dc66fe1b Minor: reformat DebuggerUtils.kt 2018-08-02 14:38:26 +03:00
Nikolay Krasko
449069b1b7 Attach preceding line comments to property accessors (KT-25417)
#KT-25417 Fixed
2018-08-02 14:38:25 +03:00
Mikhael Bogdanov
e3462a2999 Remove IrOnlyBoxCodegenTestGenerated test 2018-08-02 13:19:28 +02:00
Mikhael Bogdanov
6c41f078a6 Mute jvm ir box tests 2018-08-02 13:19:28 +02:00
Mikhael Bogdanov
34a12cb87c Mute 'boxAgainstJava' tests 2018-08-02 13:19:27 +02:00
Mikhael Bogdanov
7a98f5c5f7 Add 'boxAgainstJava' tests to ir test suite 2018-08-02 13:19:26 +02:00
Mikhael Bogdanov
261a00eec7 Remove IrCompileKotlinAgainstInlineKotlinTestGenerated tests 2018-08-02 13:19:26 +02:00
Mikhael Bogdanov
6c65507f29 Mute inline tests 2018-08-02 13:19:25 +02:00
Mikhael Bogdanov
9ccb25789b Unmute jvm-ir inline tests 2018-08-02 13:19:24 +02:00
Svyatoslav Kuzmich
826c524a9b [JS IE BE] Lower string equality method/operators 2018-08-02 13:42:50 +03:00
Alexander Udalov
aa1321287c Add ChangeLog for 1.2.60 2018-08-02 12:14:58 +02:00
Mikhael Bogdanov
0ddbe12e62 Use common assertion in ir-tests and proper arithmetic flag 2018-08-02 10:38:06 +02:00
Mikhael Bogdanov
cb53e86183 Move ir box test under "box/ir" 2018-08-02 09:52:48 +02:00
Natalia Selezneva
24579c27a2 Extract common part in inspections that checks usage of descriptor in some call 2018-08-02 09:23:27 +03:00
Toshiaki Kameyama
4c34ced1fa Introduct "Redundant 'with' call" inspection #KT-6633 Fixed 2018-08-02 09:23:27 +03:00
Artem Zinnatullin
58becffb1f Add documentation for @JvmSynthetic 2018-08-02 08:53:47 +03:00
Sergey Rostov
4f3f4dd025 ScriptDependenciesLoader: Fix calling notifyRootsChanged in write-unsafe context (EA-123239) 2018-08-02 08:38:17 +03:00
Alexander Udalov
0c8b231fde Add tests on coercion to Unit for callable references
#KT-11723
2018-08-01 16:26:07 +02:00
Alexander Udalov
9babd90999 Support default arguments and varargs for callable references
#KT-8834
 #KT-19869
 #KT-25514
2018-08-01 16:26:06 +02:00
Ilya Chernikov
f71909ee73 Fix classpath calculation for scripts, e.g. in JSR-223 setting
#KT-25814 fixed
2018-08-01 13:09:05 +02:00
Nikolay Krasko
a406f1b361 Revert registering ClsCustomNavigationPolicy EP in 182 (KT-24891)
Registration can't be removed because there's still a usage in ClsFileImpl:

Caused by: java.lang.IllegalArgumentException: Missing extension point: com.intellij.psi.clsCustomNavigationPolicy in area null
    at com.intellij.openapi.extensions.impl.ExtensionsAreaImpl.getExtensionPoint(ExtensionsAreaImpl.java:335)
    at com.intellij.openapi.extensions.impl.ExtensionsAreaImpl.getExtensionPoint(ExtensionsAreaImpl.java:26)
    at com.intellij.openapi.extensions.Extensions.getExtensions(Extensions.java:104)
    at com.intellij.openapi.extensions.Extensions.getExtensions(Extensions.java:98)
    at com.intellij.openapi.extensions.Extensions.getExtensions(Extensions.java:93)
    at com.intellij.psi.impl.compiled.ClsFileImpl.getNavigationElement(ClsFileImpl.java:312)
2018-08-01 14:02:59 +03:00
Mikhael Bogdanov
2b3162732b Fix lazy parent calculation for property accessor 2018-08-01 12:29:31 +02:00
Mikhael Bogdanov
bf60835975 Delete unused properties 2018-08-01 12:29:30 +02:00
Mikhael Bogdanov
b27177b7ee Get rid of 'referenceAllTypeExternalClassifiers' 2018-08-01 12:29:30 +02:00
Mikhael Bogdanov
b22352a60d Get rid of 'externalPackageFragments' and 'dependencyModules' in IrModuleFragment 2018-08-01 12:29:29 +02:00
Mikhael Bogdanov
0df6fddd0a Extract utils from ReferenceSymbolTable 2018-08-01 12:29:28 +02:00
Mikhael Bogdanov
8a0c585c09 Move lazy var to separate file 2018-08-01 12:29:28 +02:00
Mikhael Bogdanov
bee0803ac9 Generate ExternalPackageFragment lazily 2018-08-01 12:29:27 +02:00
Mikhael Bogdanov
1bf3f4bda7 Extract ReferenceSymbolTable, support lazy type parameters 2018-08-01 12:29:27 +02:00
Mikhael Bogdanov
6623799671 Clean 2018-08-01 12:29:26 +02:00
Mikhael Bogdanov
952bc6da63 Set parent for non-lazy declarations 2018-08-01 12:29:25 +02:00
Mikhael Bogdanov
c19d45a2fc Initial lazy ir implementation 2018-08-01 12:29:25 +02:00
Mikhael Bogdanov
2884d728fd Mute/unmute jvm_ir tests 2018-08-01 12:29:24 +02:00
Mikhael Bogdanov
74aa8f054e Fix type parameters count in synthetic accessor lowering 2018-08-01 12:27:08 +02:00
Dmitry Petrov
60d93aee87 Drop IrProperty.typeParameters 2018-08-01 12:06:41 +03:00
Roman Artemev
c9b7db646c Temporary mute test with issue between coroutines and crossinline 2018-08-01 10:56:08 +03:00
Roman Artemev
dac1fac957 Unmute working test 2018-08-01 10:55:21 +03:00
Vyacheslav Gerasimov
2ec7c4fd0d Update platform versions for 181, 182, as32, as33 plugins 2018-07-31 19:27:23 +03:00
Pavel V. Talanov
e1a27929ac Do not throw on using kotlin resolve via light classes in dumb mode
Fix an exception when kotlin resolve was invoked when searching
    for tests while indexing (probably many other cases)
Does not actually fix the behaviour, the test will not be found
    resulting in undesired behaviour
Full-blown infrastructure for resolving Kotlin in dumb mode is needed
    to fix the behaviour

 #KT-24979 Fixed
2018-07-31 14:47:21 +02:00
Dmitry Petrov
ea710ce607 IrField.isStatic: Update testData for new test 2018-07-31 14:04:04 +03:00
Dmitry Petrov
6dfcf15a39 IR: IrField.isStatic 2018-07-31 13:39:54 +03:00
Zalim Bashorov
8d97512179 [JS IR BE] Improve diagnostics in tests 2018-07-31 11:28:39 +03:00
Zalim Bashorov
2fb286e39c [JS IR BE] Update tests 2018-07-31 11:28:39 +03:00
Zalim Bashorov
0da14e4189 [JS IR BE] Support calls, property accesses and most of operators on expressions with dynamic type 2018-07-31 11:28:38 +03:00
Zalim Bashorov
4a7ecaa908 [JS IR BE] Add basic support for external declarations 2018-07-31 11:28:38 +03:00
Zalim Bashorov
3c0d0d2ab4 [JS IR BE] Move external declarations to a separate IrPackageFragment to not generate code for them 2018-07-31 11:28:38 +03:00
Zalim Bashorov
c66bb8c57d [JS IR BE] Remove no longer needed descriptor based utils 2018-07-31 11:28:38 +03:00
Zalim Bashorov
990ad8719d [JS IR BE] Run each lowering on all files instead of running all lowering on each file 2018-07-31 11:28:38 +03:00
Lucas Smaira
49292cd26c Move model interfaces code from Java to Kotlin 2018-07-30 19:08:04 +03:00
Lucas Smaira
52990c9eb1 Set JAVA and ANDROID_HOME when fetching Gradle models
In BaseGradleIT
2018-07-30 19:08:04 +03:00
Lucas Smaira
8cb03fcdec Fix model tests in Windows
By comparing files instead of paths, avoiding problems with separator
'/' or '\'.
2018-07-30 19:08:04 +03:00
Lucas Smaira
5e515590cb Restrict methos in Tasks.kt to internal 2018-07-30 19:08:04 +03:00
Lucas Smaira
3588547d8c Remove *ImplTest for Kotlin Gradle Models
Equality should already be guaranteed by Kotlin data classes.
2018-07-30 19:08:04 +03:00
Lucas Smaira
3c88f761a6 Introduce tooling model for Android extensions plugin
Introduce Gradle models for plugins 'kotlin-android-extensions'.
2018-07-30 19:08:04 +03:00
Lucas Smaira
5a423e8dcd Introduce tooling model for annotation based projects
Introduce Gradle models for plugins 'kotlin-allopen', 'kotlin-noarg' and
'kotlin-sam-with-receiver'. Corresponding model builders are registered
in each one of those plugin main classes.
2018-07-30 19:08:04 +03:00
Lucas Smaira
5671dbb929 Introduce tooling model for Kapt gradle projects
A Kapt model for Gradle projects including 'kotlin-kapt'plugin is
introduced. Its model builder KaptModelBuilder produces an
implementation of these models and can be queried through the Gradle
Tooling API when needed. Model builder is registered in
Kapt3GradleSubplugin.
2018-07-30 19:08:04 +03:00
Lucas Smaira
9def6f020f Introduce tooling model for Kotlin gradle projects
A KotlinProject model for Gradle projects including Kotlin (JVM, JS or
common) plugins is introduced. Its model builder KotlinModelBuilder
produces an implementation of these models and can be queried through
the Gradle Tooling API when needed. Model builder is registered in the
corresponding Kotlin Gradle plugins.

Model definition should be published as a separate artifact in public
repositories so it can be consumed when needed.
2018-07-30 19:08:04 +03:00
Ilmir Usmanov
4b03db771a Minor. Fix test. 2018-07-30 18:59:44 +03:00
Mikhail Zarechenskiy
acd5b62148 Introduce limited constant conversions for Kotlin/Native
#KT-25320 Fixed
2018-07-29 04:32:32 +03:00
Alexander Udalov
1a51132884 Add CLI tests on internal from other module (JVM, JS, common) 2018-07-27 18:51:42 +02:00
Alexander Udalov
4bd66d5aa8 Add compiler argument -Xfriend-paths for kotlinc-jvm
#KT-21910 Fixed
2018-07-27 18:51:42 +02:00
Dmitry Savvinov
8edbb10420 Fix typo introduced in f90b29c2e3 2018-07-27 18:55:52 +03:00
Dmitry Savvinov
f90b29c2e3 Support contracts in PartialBodyResolveFilter
Previously, PartialBodyResolveFilter didn't know about contracts and was
filtering out calls of such functions, leading to unstable completion in
cases like that:

fun test(x: Any?) {
    require(x is String)
    x.<caret>
}

However, PartialBodyResolveFilter works by pure PSI, while to determine
if function has a contract we have to resolve it.

To solve it, we do something very similar to what has been done with
Nothin-returning functions: introduce
KotlinProbablyContractedFunctionShortNameIndex, which collects all
function which *may* have a contract during indexing.

^KT-25275 Fixed
2018-07-27 16:59:24 +03:00
Dmitry Savvinov
5ab79a111d Introduce 'mayHaveContract'-flag in stubs
This is needed for further commit, which supports contracts-based
smartcasts in partial body resolve mode.

NB: Stubs can be built from 3 sources:
- source code (contract presence can be checked by PSI)
- binary data (contract presence can be checked by Kotlin Metadata)
- decompiled sources

The last case is a bit of a headache, because usually bodies are omitted
in decompiled sources. To workaround it, we have to inject stubbed
contract-call in the body.
2018-07-27 16:59:24 +03:00
Dmitry Savvinov
24245c2245 Support compiler test directives in PartialBodyResolve tests 2018-07-27 16:59:23 +03:00
Dmitry Savvinov
ca64346b55 Add compiler test directives to the list of valid directives 2018-07-27 16:59:23 +03:00
Dmitry Savvinov
2a57807c85 Minor: reformat and clean-up KotlinFixtureCompletionBaseTestCase 2018-07-27 16:59:23 +03:00
Dmitry Savvinov
099fc0ad51 Push compiler options from test directives into project-wide settings
This may be useful if we want to configure how we read binaries
2018-07-27 16:59:23 +03:00
Dmitry Savvinov
724b7bf363 Minor: rename and refactor contract-related PSI checks in ktPsiUtil 2018-07-27 16:59:23 +03:00
Dmitry Savvinov
b943140f3a Move purely PSI checks of contract presence to ktPsiUtil.kt 2018-07-27 16:59:23 +03:00
Alexey Sedunov
5275e19c76 Move: Do not consider type alias -> expect class change as a conflict
Given they have the same fqname

 #KT-23594 Fixed
2018-07-27 16:08:13 +03:00
Alexey Sedunov
1c30a12d95 Move: Account for implemented modules in internal access check
#KT-23590 Fixed
2018-07-27 16:08:13 +03:00
Alexey Sedunov
0406d61622 Rename: Update filenames within expect/actual set (when necessary)
#KT-23772 Fixed
2018-07-27 16:08:13 +03:00
Alexey Sedunov
d586a84f31 Configuration: Include test roots of dependent modules to the module scope
#KT-23914 Fixed
2018-07-27 16:08:13 +03:00
Alexey Sedunov
04500914f3 Misc: Update Kotlin Gradle script icons for IDEA 182
#KT-25356 Fixed
2018-07-27 16:08:12 +03:00
Dmitry Petrov
893e19e9f8 StrictJavaNullabilityAssertions is enabled since 1.3
https://youtrack.jetbrains.com/issue/KT-20830#focus=streamItem-27-2670071-0-0
2018-07-27 09:52:29 +03:00
Dmitry Petrov
566b5856ec Constructor call normalization mode depends on language version 2018-07-27 09:52:29 +03:00
Roman Artemev
14b1f0ef6a Fix issue #KT-24475
* count coroutine metadata references during RemoveUnusedImport pass in JsInliner
* add cases to test usage of stdlib symbols in inlined functions
2018-07-26 19:23:06 +03:00
Anton Bannykh
75c7045ea7 JS: fix bug in resolveTemporaryNames.kt 2018-07-26 18:23:20 +03:00
Alexander Udalov
3323fd5a11 Check "kotlin" package usage when compiling common code
#KT-25369 Fixed
2018-07-26 17:10:33 +02:00
Mikhail Glukhikh
ddd3a0a46e Implement liftToExpected correctly for primary constructor properties
Before this commit, we always tried to find expect property in this case.
However, there is at least one case when we should find parameter of
expect primary constructor instead (safe delete).
So #KT-25321 Fixed
2018-07-26 18:01:42 +03:00
Mikhail Glukhikh
437b6f2c2d Keep Expected functions state while searching for a regular function
So #KT-25492 Fixed
2018-07-26 18:01:34 +03:00
Mikhail Glukhikh
14d6560e67 Add modality/visibility/inline to all expect/actual declarations in QF
So #KT-25539 Fixed
2018-07-26 18:01:01 +03:00
Mikhail Glukhikh
54b63ea43a Reformat: AddModifierFix 2018-07-26 18:00:58 +03:00
Mikhail Glukhikh
48017a81ee Move isEquivalentTo() from KtClass to KtClassOrObject
This makes objects and companions with the same qualified name
compatible from find usages point of view
So #KT-25326 Fixed
So #KT-25438 Fixed
2018-07-26 18:00:26 +03:00
Mikhail Glukhikh
a7d189cd1c Branch 173: delete unnecessary duplicate of KtClassOrObject 2018-07-26 18:00:22 +03:00
Mikhail Glukhikh
46cc773953 Test refactoring: header/impl -> expect/actual in safe delete tests 2018-07-26 18:00:21 +03:00
Mikhail Glukhikh
26b57c6250 MPP navigation / search: handle expect objects correctly #KT-25317 Fixed 2018-07-26 18:00:18 +03:00
Ilmir Usmanov
82f64b9b14 Generate LVT entry for continuation
#KT-25688: Fixed
2018-07-26 16:12:54 +03:00
Roman Artemev
dec307799a Fix infinite loop in suspend function in case of return from finally [#KT-21961]
* add test
2018-07-25 23:04:57 +03:00
Ilya Gorbunov
a81c06049a Fix creatures web-demo example
Rewrite val reassignment in getter with lazy property
2018-07-25 20:25:36 +03:00
Ilya Gorbunov
293e5794f0 Allow to skip JS IR tests with gradle property kotlin.compiler.js.ir.tests.skip 2018-07-25 20:25:15 +03:00
Nikolay Krasko
c210d3d10a Minor: remove duplicated copyright comment 2018-07-25 19:52:26 +03:00
Nikolay Krasko
4ff6f23d18 Refactoring: move getResolvedVersionByModuleData utility function 2018-07-25 19:52:26 +03:00
Nikolay Krasko
2d1fc4b798 Fix incompatibility because of KotlinGradleModelFacade change (KT-25713)
AndroidGradleModelFacade was moved to android plugin in AS 3.3, so
now changes in KotlinGradleModelFacade should be binary compatible.

Current fix rewrite KotlinGradleModelFacade to Java because of default
methods.

Also current implementation abuses the fact that AndroidGradleModelFacade
don't use groupId parameter for getting library versions.

 #KT-25713 Fixed
2018-07-25 19:52:25 +03:00
Nikolay Krasko
fb6bb0c8b7 Need to check compatibility when checking plugin from custom repository (KT-25714)
There's no no range check is done on the server side for custom urls not
from IntelliJ plugins repository.

 #KT-25714 Fixed
2018-07-25 19:52:25 +03:00
Toshiaki Kameyama
4d1b8405cb "Suspicious ==/===": do not report when comparison with null is included
So #KT-24001 Fixed
2018-07-25 16:15:59 +03:00
Toshiaki Kameyama
d15e43f38a Reformat SuspiciousEqualsCombination 2018-07-25 16:15:20 +03:00
Ilmir Usmanov
dc3b230b55 Do not generate continuation's setLabel and getLabel methods in 1.3
Also, do not call them.
 #KT-25521: Fixed
2018-07-25 15:35:18 +03:00
Ilmir Usmanov
a10bd9f5a3 Refactoring. Move transformRuntimeFunctionTypeToSuspendFunction to TypeDeserializer 2018-07-25 15:35:13 +03:00
Ilmir Usmanov
533dd44668 Refactoring. Make DeserializedMemberDescriptor somewhat immutable 2018-07-25 15:35:09 +03:00
Natalia Selezneva
0750de73e1 Distinguish exceptions about unknown module info 2018-07-25 15:30:49 +03:00
Zalim Bashorov
9b1915799c [psi2ir] Skip synthetic descriptors created for calls on something with dynamic type when collecting unbound symbols
#KT-23382 Fixed
2018-07-25 14:51:08 +03:00
Zalim Bashorov
a6cd552a71 [JS IR BE] Implement Long.rangeTo and unmute tests 2018-07-25 14:51:08 +03:00
Sergey Rostov
adcabd2a5a Kotlin Scripting IDE performance: cache file attributes in memory.
This saves ~2 secs on file highlighting pass.
2018-07-25 14:42:35 +03:00
Roman Artemev
eb420a1e0f Fix [#KT-23921]
* make name collector in inliner process handle JsCatch
 * visit JsParameter during live analyser in coroutine transformer
2018-07-25 14:22:11 +03:00
Alexander Udalov
31c968123c Regenerate tests 2018-07-25 11:30:57 +02:00
Toshiaki Kameyama
9e83506c02 Introduce intention: trimMargin <--> trimIndent #KT-25056 Fixed 2018-07-25 12:30:00 +03:00
Dmitry Petrov
df6d4f358a KT-22274 report warning on labels that can't be referenced
Labels are meaningful only if they can be referenced by 'break',
'continue', or 'return' expressions.
2018-07-25 12:08:20 +03:00
Dmitry Petrov
6fb913a463 KT-22274 report error/warning on incorrect return target label 2018-07-25 12:08:20 +03:00
Roman Artemev
5241b37ad9 Fix fallthrough in suspendable switch [#KT-22694, #KT-23687]
* do not explicitly put break for each case
* add test for related cases
2018-07-24 20:19:35 +03:00
Roman Artemev
0c6256d003 Fix initialization order
* put inheritance code in the beginning
 * put top-level initializer after any declaration
2018-07-24 20:16:39 +03:00
Mikhail Zarechenskiy
cff066f702 Use consistent descriptors as keys
This commit fixes exception during IR generation with enabled new inferece,
 but the problem also can affect old inference.

 We were using originalTypeArguments (`resolvedCall.typeArguments`)
 that uses type parameters from *candidate* descriptor and were trying
 to get value by key from `resolvedCall.resultingDescriptor.original`,
 assuming that resolvedCall.resultingDescriptor.original equals to
 resolvedCall.candidateDescriptor, which can be wrong
2018-07-24 20:14:19 +03:00
Mikhail Zarechenskiy
f9b19c6286 [NI] Approximate types during type translation for IR 2018-07-24 20:14:17 +03:00
Mikhail Zarechenskiy
dddaa74dac Propagate language version settings into IR type translator 2018-07-24 20:06:35 +03:00
Nikolay Krasko
165218890f Fix max value components for KotlinVersion 2018-07-24 19:13:54 +03:00
Nikolay Krasko
fb2a42126d Minor: fix typo in suppression property name 2018-07-24 17:09:15 +03:00
Nikolay Krasko
1418d1f9e5 Refactoring: abandon custom MajorVersion class, use KotlinVersion 2018-07-24 17:09:15 +03:00
Nikolay Krasko
7b6df0a7cc Don't delete unresolved imports in cleanup inspection (KT-25678)
It looks like they were deleted because of the bug in search for deprecated
imports search.

 #KT-25678 Fixed
2018-07-24 17:09:14 +03:00
Alexander Udalov
20ddbc9698 Do not generate generic signature for SAM wrapper methods
#KT-23870 Fixed
2018-07-24 13:35:47 +02:00
Denis Zharkov
ac6874c221 Hide deprecated overload LanguageSettingsProvider::getLanguageVersionSettings
It's necessary only for binary compatibility
After recompilation it's expected to be resolved to an overload
with default parameter
2018-07-24 14:09:54 +03:00
Dmitry Petrov
9dc2ad664d Fix ConstantValue-related testData for lightClasses tests
TODO support custom language version settings for lightClasses tests
2018-07-24 10:52:16 +03:00
Dmitry Petrov
8f103dd8e5 Fix ConstantValue-related testData for loadJava tests 2018-07-24 10:52:16 +03:00
Mikhail Glukhikh
cc1d9e88d5 1.3 migration: make inspections working for non-experimental coroutines 2018-07-24 10:24:18 +03:00
Alexey Tsvetkov
76b9b579bc Minor: fix 172 patchset 2018-07-23 23:10:14 +03:00
Ilmir Usmanov
fa9653c3d2 Deserialize experimental coroutines as suspend functions/types
but deprecate them for now.
Promote stub version.
 #KT-25623: Fixed
2018-07-23 21:52:17 +03:00
Toshiaki Kameyama
88a5eb24d5 "Convert lambda to reference": fix case with companion object
So #KT-24385 Fixed
2018-07-23 18:21:38 +03:00
Toshiaki Kameyama
0ae2054af4 "Replace if with when": do not add empty else block #KT-18681 Fixed 2018-07-23 18:21:37 +03:00
Toshiaki Kameyama
3e207fd6b2 Move lambda out: don't apply to multiple/default functional parameters
So #KT-24694 Fixed
2018-07-23 18:21:37 +03:00
Toshiaki Kameyama
a9c91099a4 Correct "Redundant override" inspection message #KT-25608 Fixed 2018-07-23 18:21:37 +03:00
Anton Bannykh
0f087e354e JS IR: sort input files to make compilation stable 2018-07-23 18:20:05 +03:00
Dmitry Petrov
65fe1101fd Object references in object field initializers are 'GET_VAR this@Object' 2018-07-23 18:16:32 +03:00
Simon Ogorodnik
c3d20ae138 Fix quick-doc tests generation 2018-07-23 16:18:07 +03:00
Dmitry Petrov
d61a3c158e Fix ProjectImpl leak in PatternMatchingTypingVisitor 2018-07-23 16:05:47 +03:00
Alexey Tsvetkov
ff35d509e6 Add test for KT-25540 2018-07-23 15:43:17 +03:00
Alexey Tsvetkov
11977cc1c1 Add multi-module JS IC tests with JPS 2018-07-23 15:43:17 +03:00
Alexey Tsvetkov
3227300f18 Minor: rename setIsEnabled->setIsEnabledForJvm 2018-07-23 15:43:17 +03:00
Alexey Tsvetkov
8f002fdb43 JS IC: track lookups from libraries
Otherwise we don't track lookups from other modules

    #KT-25540 fixed
2018-07-23 15:43:17 +03:00
Alexey Tsvetkov
c8c0c773fb Report info message when JS IC is enabled in JPS 2018-07-23 15:43:17 +03:00
Alexey Tsvetkov
eef40a5940 Add setting to enable JS IC for JPS
#KT-25565 fixed
2018-07-23 15:43:17 +03:00
Alexey Tsvetkov
0b18380770 Use separate system properties to control IC for JVM and JS
Also this commit effectively disables JS IC by default

     #KT-25563 fixed
2018-07-23 15:43:16 +03:00
Svyatoslav Kuzmich
625983b28a [JS IR BE] Enum class lowering 2018-07-23 15:08:18 +03:00
Nikolay Krasko
668708170f Add intention for replacing experimental coroutines usages to cleanup (KT-25251)
#KT-25251 In Progress
2018-07-23 13:43:35 +03:00
Denis Zharkov
56a87ec98e Restore method broken in f72aa78eec
Otherwise plugin compatibility tests are failing
2018-07-23 10:36:31 +03:00
Denis Zharkov
01503a84d9 Partially revert 79e776e9d7 2018-07-23 10:36:31 +03:00
Yan Zhulanow
7803294546 PrePush hook (temporary): Do nothing on a download failure 2018-07-20 22:17:45 +03:00
Nikolay Krasko
8fc377b3b3 Do not spam for same compiler version during the session (KT-25546)
Otherwise it might be too distracting when auto-import feature is enabled.
2018-07-20 19:15:20 +03:00
Nikolay Krasko
94e5f25569 Guarantee max compiler version will be shown in popup (KT-25546) 2018-07-20 19:15:20 +03:00
Nikolay Krasko
4be5c395aa Show popup about too old bundled compiler in Gradle and Maven (KT-25546) 2018-07-20 19:15:19 +03:00
Nikolay Krasko
d27002827e Refactoring: move ModuleSourceRootMap.kt from idea-jvm to idea module 2018-07-20 19:15:19 +03:00
Nikolay Krasko
99e0b998cf Minor: show class of the problem file in error 2018-07-20 19:15:19 +03:00
Simon Ogorodnik
b58e35a3e5 173: Revert changes for IDEA < 181 2018-07-20 18:41:24 +03:00
Simon Ogorodnik
c2e27a3c46 KT-22815: Rename parameter to match semantics 2018-07-20 18:41:21 +03:00
Simon Ogorodnik
ad6eac6ec6 KT-22815: Cleanup findKDoc logic 2018-07-20 18:41:18 +03:00
Simon Ogorodnik
1bd02472a2 KT-22815: Fix documentation for primary constructor params/props 2018-07-20 18:41:14 +03:00
Simon Ogorodnik
c608395c7c KT-22815: Update testData 2018-07-20 18:41:11 +03:00
Simon Ogorodnik
9ec0ce6ec8 KT-22815: Show documentation for function value/type params 2018-07-20 18:41:08 +03:00
Simon Ogorodnik
e4d76382b8 KT-22815: Update testData for quick documentation 2018-07-20 18:41:04 +03:00
Simon Ogorodnik
0b9d4a93dd KT-22815: Use 'Params' instead of 'Parameters' to save h-space 2018-07-20 18:41:01 +03:00
Simon Ogorodnik
6e95ae7393 KT-22815: Put colon after section names 2018-07-20 18:40:56 +03:00
Simon Ogorodnik
b237298c20 KT-22815: Position deprecated section between definition and description 2018-07-20 18:40:49 +03:00
Simon Ogorodnik
1918836340 KT-22815: Use gray color for filename 2018-07-20 18:40:38 +03:00
Simon Ogorodnik
84b299d7dc KT-22815: Use bold for root identifier, and not for keywords 2018-07-20 18:40:30 +03:00
Simon Ogorodnik
33a6721270 KT-22815: Update quick-doc testData 2018-07-20 18:40:21 +03:00
Simon Ogorodnik
48d0493edb Fix enum special function quick navigation behaviour 2018-07-20 18:40:15 +03:00
Simon Ogorodnik
9a34e91dec KT-22815: Render annotations on separate lines 2018-07-20 18:40:10 +03:00
Simon Ogorodnik
831e7fdc06 KT-22815: Render definition file for top-level declarations
Do not show defined in for local declarations
2018-07-20 18:40:05 +03:00
Simon Ogorodnik
6255743148 KT-22815: Cleanup quick doc rendering 2018-07-20 18:40:00 +03:00
Simon Ogorodnik
1d0fc0e736 Copy template engine from ktor 2018-07-20 18:39:57 +03:00
Simon Ogorodnik
9283089397 Reformat 2018-07-20 18:39:54 +03:00
Simon Ogorodnik
bfa5afa564 KT-22815: Cut Java signatures off properly 2018-07-20 18:39:52 +03:00
Simon Ogorodnik
263ed47aac KT-22815: Render sections properly 2018-07-20 18:39:48 +03:00
Simon Ogorodnik
39e72f4041 Reformat 2018-07-20 18:39:45 +03:00
Simon Ogorodnik
99f0a0368a KT-22815: Wrap parameters and try new DocumentationMarkup 2018-07-20 18:39:42 +03:00
27678 changed files with 859635 additions and 1049734 deletions

15
.bunch
View File

@@ -1,8 +1,7 @@
181
173
172_173
as31_173
as32
182
as33_as32
as33c4_182
191
192
183
182_183
as33_182_183
as34_183
as35

View File

@@ -1,14 +0,0 @@
Many thanks for your contribution, we genuinely appreciate it.
Make sure that you can say "YES" to each point in this short checklist:
- You do not have merge commits in PR
- You made a few changes
- You provided the link to related issue from YouTrack
- You can describe changes made in PR
- You made changes related to only one issue
- You are ready to defend your changes on code review
- You didn't touch what you don't understand
- You ran the build locally, and verified new functionality
- You ran related tests locally, and it passed
Thank you for your contribution!

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>

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

@@ -0,0 +1,7 @@
<component name="ProjectDictionaryState">
<dictionary name="dmitriy.dolovov">
<words>
<w>konan</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>

3
.idea/encodings.xml generated
View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/libraries" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/examples/browser-example" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/examples/browser-example-with-library" charset="UTF-8" />
@@ -14,6 +14,7 @@
<file url="file://$PROJECT_DIR$/libraries/tools/kotlin-maven-plugin" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/kotlin-maven-plugin-test" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/kotlin-maven-sam-with-receiver" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/kotlin-maven-serialization" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/kotlin-osgi-bundle" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/maven-archetypes" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/maven-archetypes/kotlin-archetype-js" charset="UTF-8" />

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" />
@@ -55,9 +54,6 @@
<inspection_tool class="DoubleCheckedLocking" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoreOnVolatileVariables" value="true" />
</inspection_tool>
<inspection_tool class="DuplicateCondition" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoreSideEffectConditions" value="true" />
</inspection_tool>
<inspection_tool class="EmptyStatementBody" enabled="true" level="WARNING" enabled_by_default="true">
<option name="m_reportEmptyBlocks" value="false" />
</inspection_tool>
@@ -79,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>
@@ -101,22 +98,22 @@
<inspection_tool class="IncompatibleAPI" enabled="true" level="ERROR" enabled_by_default="true">
<option name="problems">
<list>
<Problem reference="org.jetbrains.plugins.gradle.util.GradleConstants#KOTLIN_DSL_SCRIPT_EXTENSION" reason="Absent in 172. Please inline." />
<Problem reference="com.intellij.psi.impl.compiled.ClsClassImpl#getQualifiedName" reason="Nullable in 173, platform in 172. Use qualifiedNameEx instead." />
<Problem reference="com.intellij.internal.statistic.utils.StatisticsUtilKt#getEnumUsage" reason="Absent in 172. Use org.jetbrains.kotlin.idea.util.compat.statistic.StatisticKt.getEnumUsage instead." />
<Problem reference="com.intellij.internal.statistic.utils.StatisticsUtilKt#getBooleanUsage" reason="Absent in 172 Use org.jetbrains.kotlin.idea.util.compat.statistic.StatisticKt.getBooleanUsage instead." />
<Problem reference="com.intellij.internal.statistic.AbstractProjectsUsagesCollector" reason="Absent in 172. Use org.jetbrains.kotlin.idea.util.compat.statistic.AbstractProjectsUsagesCollector instead." />
<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.testFramework.fixtures.CodeInsightTestFixture#getProjectDisposable" reason="Method was introduced in 173 and absent in 172. Use getProjectDisposableEx instead. (95eaf81e0ea497f8c69263c11fd3202d28a7a1b2)" />
<Problem reference="org.jetbrains.org.objectweb.asm.Opcodes#V9" reason="Absent in 172 branch. Use V1_9 while 172 is supported." />
<Problem reference="com.intellij.psi.codeStyle.CommonCodeStyleSettings#getSoftMargins" reason="Absent in 172." />
<Problem reference="com.intellij.util.xmlb.XmlSerializer#serializeInto(java.lang.Object, org.jdom.Element)" reason="Absent in 172." />
<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.util.PsiUtil#canBeOverridden" reason="Absent in 172. Use org.jetbrains.kotlin.idea.core.util.compat.psi.canBeOverridden() instead." />
<Problem reference="com.intellij.psi.util.PsiTreeUtilKt#parentOfType(com.intellij.psi.PsiElement)" reason="Absent in 172. Use org.jetbrains.kotlin.psi.psiUtil.getParentOfType 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>
@@ -269,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" />
@@ -297,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" />
@@ -322,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" />
@@ -395,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.

View File

@@ -1,129 +1,475 @@
# CHANGELOG
## 1.3-M1
### Language design
- [`KEEP-104`](https://github.com/Kotlin/KEEP/issues/104) Inline classes
- [`KEEP-135`](https://github.com/Kotlin/KEEP/issues/135) Unsigned integer types
- [`KEEP-95`](https://github.com/Kotlin/KEEP/issues/95) Experimental API annotations
- [`KT-13762`](https://youtrack.jetbrains.com/issue/KT-13762) Prohibit annotations with target 'EXPRESSION' and retention 'BINARY' or 'RUNTIME'
- [`KT-16681`](https://youtrack.jetbrains.com/issue/KT-16681) kotlin allows mutating the field of read-only property
- [`KT-21515`](https://youtrack.jetbrains.com/issue/KT-21515) Restrict visibility of classifiers, nested in companion objects
## 1.3.41
### Compiler
- [`KT-24848`](https://youtrack.jetbrains.com/issue/KT-24848) Refine loading Java overrides of Kotlin suspend functions
- [`KT-9580`](https://youtrack.jetbrains.com/issue/KT-9580) Report an error if 'setparam' target does not make sense for a parameter declaration
- [`KT-16310`](https://youtrack.jetbrains.com/issue/KT-16310) Nested classes inside enum entries capturing outer members
- [`KT-17981`](https://youtrack.jetbrains.com/issue/KT-17981) Type parameter for catch parameter possible when exception is nested in generic, but fails in runtime
- [`KT-21354`](https://youtrack.jetbrains.com/issue/KT-21354) Inconsistent behavior of 'for-in-range' loop if range is an array variable modified in loop body
- [`KT-25333`](https://youtrack.jetbrains.com/issue/KT-25333) Restrict visibility of Java static members from supertypes of companion object
- [`KT-25623`](https://youtrack.jetbrains.com/issue/KT-25623) Do not load experimental coroutines as non-suspend function with additional Continuation parameter
#### Backend. JVM
- [`KT-31981`](https://youtrack.jetbrains.com/issue/KT-31981) New type inference asks to use ?. on non-null local variable
- [`KT-32029`](https://youtrack.jetbrains.com/issue/KT-32029) Exception when callable reference is resolved against unresolved type
- [`KT-32037`](https://youtrack.jetbrains.com/issue/KT-32037) No coercion to Unit for last expression with lambda in code block
- [`KT-32038`](https://youtrack.jetbrains.com/issue/KT-32038) Unsubstituted stub type cause type mismatch later for builder inference
- [`KT-32051`](https://youtrack.jetbrains.com/issue/KT-32051) NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER on matching Nothing with generic type parameter
- [`KT-32081`](https://youtrack.jetbrains.com/issue/KT-32081) New type inference fails involving Either and Nothing
- [`KT-32089`](https://youtrack.jetbrains.com/issue/KT-32089) False positive IMPLICIT_NOTHING_AS_TYPE_PARAMETER with lambdas
- [`KT-32094`](https://youtrack.jetbrains.com/issue/KT-32094) NI: member from star import has higher resolution priority than member imported by FQN
- [`KT-32116`](https://youtrack.jetbrains.com/issue/KT-32116) Type inference for HashMap<*,*> fails but compiles
- [`KT-32123`](https://youtrack.jetbrains.com/issue/KT-32123) Wrong unused import for extension method
- [`KT-32133`](https://youtrack.jetbrains.com/issue/KT-32133) Regression in Kotlin 1.3.40 new inference engine
- [`KT-32134`](https://youtrack.jetbrains.com/issue/KT-32134) `java.lang.Throwable: Resolution error of this type shouldn't occur for resolve try as a call` for incomplete try-construction
- [`KT-32143`](https://youtrack.jetbrains.com/issue/KT-32143) 1.3.40 new inference: backward incompatibility in method calls with multiple SAM arguments
- [`KT-32154`](https://youtrack.jetbrains.com/issue/KT-32154) setOf(Map.Entry<*, *>::key) gives error on IDE
- [`KT-32157`](https://youtrack.jetbrains.com/issue/KT-32157) Issue with new type inference in unbounded generics
- [`KT-32175`](https://youtrack.jetbrains.com/issue/KT-32175) New Type Inference Algorithm, RxJava and IDE-Compiler Inconsistency
- [`KT-32184`](https://youtrack.jetbrains.com/issue/KT-32184) NI: Argument for @NotNull parameter 'type' of org/jetbrains/kotlin/types/CommonSupertypes.depth must not be null
- [`KT-32187`](https://youtrack.jetbrains.com/issue/KT-32187) Exception when using callable reference with an unresolved LHS
- [`KT-32218`](https://youtrack.jetbrains.com/issue/KT-32218) Cannot call get on a Map<out Any,Any> with new type system
- [`KT-32230`](https://youtrack.jetbrains.com/issue/KT-32230) New inference not working with RxJava combineLatest
- [`KT-32235`](https://youtrack.jetbrains.com/issue/KT-32235) New type inference failure with `in` check
- [`KT-6301`](https://youtrack.jetbrains.com/issue/KT-6301) Support JvmStatic annotation on interface companion object members
- [`KT-25508`](https://youtrack.jetbrains.com/issue/KT-25508) Inject probeCoroutineSuspended to coroutines body
- [`KT-18987`](https://youtrack.jetbrains.com/issue/KT-18987) Unroll recursion in CoroutineImpl.resume
- [`KT-11567`](https://youtrack.jetbrains.com/issue/KT-11567) Companion object INSTANCE field more visible than companion object class itself
- [`KT-13764`](https://youtrack.jetbrains.com/issue/KT-13764) Support lambdas and function references for arities bigger than 22
- [`KT-16615`](https://youtrack.jetbrains.com/issue/KT-16615) Do not generate ConstantValue attribute for non-const vals
- [`KT-25193`](https://youtrack.jetbrains.com/issue/KT-25193) Names of parameters from Java interface methods implemented by delegation are lost
- [`KT-25324`](https://youtrack.jetbrains.com/issue/KT-25324) VerifyError “Bad type on operand stack” on running code with call of array iterator for array of inline classes
- [`KT-25325`](https://youtrack.jetbrains.com/issue/KT-25325) CCE “Foo cannot be cast to java.lang.String” for iterating over the list of inline classes
- [`KT-25626`](https://youtrack.jetbrains.com/issue/KT-25626) Inline class values inside string literals don't use their own toString implementation
### JavaScript
#### Backend. JVM. Coroutines
- [`KT-32215`](https://youtrack.jetbrains.com/issue/KT-32215) Reified generic doesn't work with `ByteArray` on js
- [`KT-20219`](https://youtrack.jetbrains.com/issue/KT-20219) Inline suspend function can't be used as non-inline function
- [`KT-24863`](https://youtrack.jetbrains.com/issue/KT-24863) Support new Continuation API in JVM BE
- [`KT-24864`](https://youtrack.jetbrains.com/issue/KT-24864) Create new CoroutineImpl and other internal coroutines interfaces
### Tools. CLI
#### Backend. JVM. Inline
- [`KT-32272`](https://youtrack.jetbrains.com/issue/KT-32272) kotlinc - no main manifest attribute, in hello.jar
- [`KT-25511`](https://youtrack.jetbrains.com/issue/KT-25511) Inline classes fail with cross-inline functions
### Tools. REPL
#### Binary Metadata
- [`KT-32085`](https://youtrack.jetbrains.com/issue/KT-32085) Kotlinc REPL: "java.lang.NoClassDefFoundError: org/jline/reader/LineReaderBuilder"
- [`KT-24617`](https://youtrack.jetbrains.com/issue/KT-24617) Optional expected annotation is unresolved in a dependent platform module
- [`KT-25120`](https://youtrack.jetbrains.com/issue/KT-25120) RequireKotlin on nested class and its members is not loaded correctly
- [`KT-25273`](https://youtrack.jetbrains.com/issue/KT-25273) java.lang.UnsupportedOperationException from incremental JS compilation
- [`KT-25310`](https://youtrack.jetbrains.com/issue/KT-25310) Write isUnsigned flag into metadata for unsigned types
### Tools. Scripts
- [`KT-32169`](https://youtrack.jetbrains.com/issue/KT-32169) Kotlin 1.3.40 - Crash on running *.main.kts script: "NoSuchMethodError: kotlin.script.templates.standard.ScriptTemplateWithArgs.<init>"
- [`KT-32206`](https://youtrack.jetbrains.com/issue/KT-32206) Custom script definitions not loaded in the cli compiler
#### Frontend
## 1.3.40
- [`KT-15807`](https://youtrack.jetbrains.com/issue/KT-15807) @JvmField is not applicable to interface companion properties
- [`KT-16962`](https://youtrack.jetbrains.com/issue/KT-16962) Annotation classes cannot contain types or static fields because they cannot have a body
- [`KT-23153`](https://youtrack.jetbrains.com/issue/KT-23153) Compiler allows to set non constant value as annotation parameter
- [`KT-23362`](https://youtrack.jetbrains.com/issue/KT-23362) Move coroutines to package kolin.coroutines for 1.3
- [`KT-24861`](https://youtrack.jetbrains.com/issue/KT-24861) Fix loading kotlin.suspend compiled with LV=1.2 when release coroutines package is used
- [`KT-25241`](https://youtrack.jetbrains.com/issue/KT-25241) Kotlin compiler doesn't warn about usage of lambda/reference with more than 22 parameters
- [`KT-25600`](https://youtrack.jetbrains.com/issue/KT-25600) NSEE “Collection is empty” after trying to call default constructor of unsigned number class
#### Frontend. Data-flow analysis
- [`KT-22517`](https://youtrack.jetbrains.com/issue/KT-22517) Deprecate smartcasts for local delegated properties
#### Frontend. Declarations
- [`KT-19618`](https://youtrack.jetbrains.com/issue/KT-19618) Data class `copy()` call with optional parameters leads to broken code when the class implements an interface with `copy()`
- [`KT-23277`](https://youtrack.jetbrains.com/issue/KT-23277) Prohibit local annotation classes
- [`KT-24197`](https://youtrack.jetbrains.com/issue/KT-24197) Make 'mod' operator error in 1.3
#### Frontend. Lexer & Parser
- [`KT-24663`](https://youtrack.jetbrains.com/issue/KT-24663) Add 'UL' suffix to represent number literals of unsigned Long type
#### Frontend. Resolution and Inference
- [`KT-16908`](https://youtrack.jetbrains.com/issue/KT-16908) Support callable references to suspending functions
- [`KT-20588`](https://youtrack.jetbrains.com/issue/KT-20588) Report error on single element assignment to varargs in named form in annotations
- [`KT-20589`](https://youtrack.jetbrains.com/issue/KT-20589) Report error on single element assignment to varargs in named form in functions
- [`KT-24859`](https://youtrack.jetbrains.com/issue/KT-24859) Disallow calls of functions annotated with receiver annotated with @RestrictsSuspension in foreign suspension context
### IDE
- [`KT-25466`](https://youtrack.jetbrains.com/issue/KT-25466) Make coroutines resolve to be independent of language and API versions set in `Kotlin Compiler` settings
#### IDE. Inspections and Intentions
- [`KT-24243`](https://youtrack.jetbrains.com/issue/KT-24243) Support quick fix to enable usages of Experimental/UseExperimental
- [`KT-11154`](https://youtrack.jetbrains.com/issue/KT-11154) Spell checking inspection is not suppressable
- [`KT-25169`](https://youtrack.jetbrains.com/issue/KT-25169) Impossible to suppress UAST/JVM inspections
#### IDE. Libraries
- [`KT-25129`](https://youtrack.jetbrains.com/issue/KT-25129) Idea freezes when Kotlin plugin tries to determine if jar is js lib in jvm module
### Libraries
#### New Features
- [`KEEP-131`](https://github.com/Kotlin/KEEP/issues/131), [`KT-17261`](https://youtrack.jetbrains.com/issue/KT-17261) Add random number generator to stdlib and related collection extension functions
- [`KT-7922`](https://youtrack.jetbrains.com/issue/KT-7922) Companion object for Boolean
- [`KT-8247`](https://youtrack.jetbrains.com/issue/KT-8247) Byte size for primitives
- [`KT-16552`](https://youtrack.jetbrains.com/issue/KT-16552) Add Sequence.orEmpty()
- [`KT-18559`](https://youtrack.jetbrains.com/issue/KT-18559) Make SafeContinuation and context impl classes serializable
- [`KT-18910`](https://youtrack.jetbrains.com/issue/KT-18910) StringBuilder#setLength(0) in non-JVM Kotlin
- [`KT-21763`](https://youtrack.jetbrains.com/issue/KT-21763) Provide Char MIN_VALUE/MAX_VALUE constants
- [`KT-23279`](https://youtrack.jetbrains.com/issue/KT-23279) isNullOrEmpty() for collections, maps, and arrays
- [`KT-23602`](https://youtrack.jetbrains.com/issue/KT-23602) Make kotlin.Metadata public
### Android
#### Fixes
- [`KT-23564`](https://youtrack.jetbrains.com/issue/KT-23564) KotlinJS: Math is deprecated yet random is not a global function
- [`KT-24856`](https://youtrack.jetbrains.com/issue/KT-24856) Create compatibility wrappers for migration from 1.2 to 1.3 coroutines
- [`KT-24862`](https://youtrack.jetbrains.com/issue/KT-24862) Create new Continuation API for coroutines
- [`KT-12402`](https://youtrack.jetbrains.com/issue/KT-12402) Android DataBinding work correctly but the IDE show it as error
- [`KT-31432`](https://youtrack.jetbrains.com/issue/KT-31432) Remove obsolete code introduced in KT-12402
### Compiler
#### New Features
- [`KT-29915`](https://youtrack.jetbrains.com/issue/KT-29915) Implement `typeOf` on JVM
- [`KT-30467`](https://youtrack.jetbrains.com/issue/KT-30467) Provide a way to to save compiled script(s) as a jar
#### Performance Improvements
- [`KT-17755`](https://youtrack.jetbrains.com/issue/KT-17755) Optimize trimIndent and trimMargin on constant strings
- [`KT-30603`](https://youtrack.jetbrains.com/issue/KT-30603) Compiler performance issue: VariableLivenessKt.useVar performance
#### Fixes
- [`KT-19227`](https://youtrack.jetbrains.com/issue/KT-19227) Load built-ins from dependencies by default in the compiler, support erroneous "fallback" built-ins
- [`KT-23426`](https://youtrack.jetbrains.com/issue/KT-23426) Actual typealias to Java enum does not match expected enum because of modality
- [`KT-23854`](https://youtrack.jetbrains.com/issue/KT-23854) Inference for common type of two captured types
- [`KT-25105`](https://youtrack.jetbrains.com/issue/KT-25105) False-positive warning "Remove final upper bound" on generic override
- [`KT-25302`](https://youtrack.jetbrains.com/issue/KT-25302) New inference: "Type mismatch" between star projection and `Any?` type argument in specific case
- [`KT-25433`](https://youtrack.jetbrains.com/issue/KT-25433) Wrong order of fixing type variables for callable references
- [`KT-26386`](https://youtrack.jetbrains.com/issue/KT-26386) Front-end recursion problem while analyzing contract function with call expression of self in implies
- [`KT-26412`](https://youtrack.jetbrains.com/issue/KT-26412) Wrong LVT generated if decomposed parameter of suspend lambda is not the first parameter.
- [`KT-27097`](https://youtrack.jetbrains.com/issue/KT-27097) JvmMultifileClass + JvmName causes NoSuchMethodError on sealed class hierarchy for top-level members
- [`KT-28534`](https://youtrack.jetbrains.com/issue/KT-28534) Local variable entries are missing in LVT for suspend lambda parameters
- [`KT-28535`](https://youtrack.jetbrains.com/issue/KT-28535) Rename `result` to `$result` in coroutines' LVT
- [`KT-29184`](https://youtrack.jetbrains.com/issue/KT-29184) Implement inference for coroutines according to the @BuilderInference contract in NI
- [`KT-29772`](https://youtrack.jetbrains.com/issue/KT-29772) Contracts don't work if `contract` function is fully qualified (FQN)
- [`KT-29790`](https://youtrack.jetbrains.com/issue/KT-29790) Incorrect version requirement in metadata of anonymous class for suspend lambda
- [`KT-29948`](https://youtrack.jetbrains.com/issue/KT-29948) NI: incorrect DSLMarker behaviour with generic star projection
- [`KT-30021`](https://youtrack.jetbrains.com/issue/KT-30021) +NewInference on Kotlin Native :: java.lang.StackOverflowError
- [`KT-30242`](https://youtrack.jetbrains.com/issue/KT-30242) Statements are not coerced to Unit in last expressions of lambda
- [`KT-30243`](https://youtrack.jetbrains.com/issue/KT-30243) Include FIR modules into compiler
- [`KT-30250`](https://youtrack.jetbrains.com/issue/KT-30250) Rewrite at slice exception for callable reference argument inside delegated expression
- [`KT-30292`](https://youtrack.jetbrains.com/issue/KT-30292) Reference to function is unresolved when LHS is a star-projected type
- [`KT-30293`](https://youtrack.jetbrains.com/issue/KT-30293) Wrong intersection type for common supertype from String and integer type
- [`KT-30370`](https://youtrack.jetbrains.com/issue/KT-30370) Call is completed too early when there is "Nothing" constraint
- [`KT-30405`](https://youtrack.jetbrains.com/issue/KT-30405) Support expected type from cast in new inference
- [`KT-30406`](https://youtrack.jetbrains.com/issue/KT-30406) Fix testIfOrWhenSpecialCall test for new inference
- [`KT-30590`](https://youtrack.jetbrains.com/issue/KT-30590) Report diagnostic about not enough information for inference in NI
- [`KT-30620`](https://youtrack.jetbrains.com/issue/KT-30620) Exception from the compiler when coroutine-inference is involved even with the explicitly specified types
- [`KT-30656`](https://youtrack.jetbrains.com/issue/KT-30656) Exception is occurred when functions with implicit return-stub types are involved in builder-inference
- [`KT-30658`](https://youtrack.jetbrains.com/issue/KT-30658) Exception from the compiler when getting callable reference to a suspend function
- [`KT-30661`](https://youtrack.jetbrains.com/issue/KT-30661) Disable SAM conversions to Kotlin functions in new-inference by default
- [`KT-30676`](https://youtrack.jetbrains.com/issue/KT-30676) Overload resolution ambiguity when there is a callable reference argument and candidates with different functional return types
- [`KT-30694`](https://youtrack.jetbrains.com/issue/KT-30694) No debug metadata is generated for suspend lambdas which capture crossinline
- [`KT-30724`](https://youtrack.jetbrains.com/issue/KT-30724) False positive error about missing equals when one of the operands is incorrectly inferred to Nothing
- [`KT-30734`](https://youtrack.jetbrains.com/issue/KT-30734) No smartcast inside lambda literal in then/else "if" branch
- [`KT-30737`](https://youtrack.jetbrains.com/issue/KT-30737) Try analysing callable reference preemptively
- [`KT-30780`](https://youtrack.jetbrains.com/issue/KT-30780) Compiler crashes on 'private inline' function accessing private constant in 'inline class' (regression)
- [`KT-30808`](https://youtrack.jetbrains.com/issue/KT-30808) NI: False negative SPREAD_OF_NULLABLE with USELESS_ELVIS_RIGHT_IS_NULL
- [`KT-30816`](https://youtrack.jetbrains.com/issue/KT-30816) BasicJvmScriptEvaluator passes constructor parameters in incorrect order
- [`KT-30826`](https://youtrack.jetbrains.com/issue/KT-30826) There isn't report about unsafe call in the new inference (by invalidating smartcast), NPE
- [`KT-30843`](https://youtrack.jetbrains.com/issue/KT-30843) Duplicate JVM class name for expect/actual classes in JvmMultifileClass-annotated file
- [`KT-30853`](https://youtrack.jetbrains.com/issue/KT-30853) Compiler crashes with NewInference and Kotlinx.Coroutines Flow
- [`KT-30927`](https://youtrack.jetbrains.com/issue/KT-30927) Data flow info isn't used for 'this' which is returned from lambda using labeled return
- [`KT-31081`](https://youtrack.jetbrains.com/issue/KT-31081) Implement ArgumentMatch abstraction in new inference
- [`KT-31113`](https://youtrack.jetbrains.com/issue/KT-31113) Fix failing tests from SlicerTestGenerated
- [`KT-31199`](https://youtrack.jetbrains.com/issue/KT-31199) Unresolved callable references with typealias
- [`KT-31339`](https://youtrack.jetbrains.com/issue/KT-31339) Inliner does not remove redundant continuation classes, leading to CNFE in JMH bytecode processing
- [`KT-31346`](https://youtrack.jetbrains.com/issue/KT-31346) Fix diagnostic DSL_SCOPE_VIOLATION for new inference
- [`KT-31356`](https://youtrack.jetbrains.com/issue/KT-31356) False-positive error about violating dsl scope for new-inference
- [`KT-31360`](https://youtrack.jetbrains.com/issue/KT-31360) NI: inconsistently prohibits member usage without explicit receiver specification with star projection and DSL marker
- [`KT-18563`](https://youtrack.jetbrains.com/issue/KT-18563) Do not generate inline reified functions as private in bytecode
- [`KT-20849`](https://youtrack.jetbrains.com/issue/KT-20849) Inference results in Nothing type argument in case of passing 'out T' to 'in T1'
- [`KT-25290`](https://youtrack.jetbrains.com/issue/KT-25290) New inference: KNPE at ResolutionPartsKt.getExpectedTypeWithSAMConversion() on out projection of Java class
- [`KT-26418`](https://youtrack.jetbrains.com/issue/KT-26418) Back-end (JVM) Internal error when compiling decorated suspend inline functions
- [`KT-26925`](https://youtrack.jetbrains.com/issue/KT-26925) Decorated suspend inline function continuation resumes in wrong spot
- [`KT-28999`](https://youtrack.jetbrains.com/issue/KT-28999) Prohibit type parameters for anonymous objects
- [`KT-29307`](https://youtrack.jetbrains.com/issue/KT-29307) New inference: false negative CONSTANT_EXPECTED_TYPE_MISMATCH with a Map
- [`KT-29475`](https://youtrack.jetbrains.com/issue/KT-29475) IllegalArgumentException at getAbstractTypeFromDescriptor with deeply nested expression inside function named with a right parenthesis
- [`KT-29996`](https://youtrack.jetbrains.com/issue/KT-29996) Properly report errors on attempt to inline bytecode from class files compiled to 1.8 to one compiling to 1.6
- [`KT-30289`](https://youtrack.jetbrains.com/issue/KT-30289) Don't generate annotations on synthetic methods for methods with default values for parameters
- [`KT-30410`](https://youtrack.jetbrains.com/issue/KT-30410) [NI] Front-end recursion problem while analyzing contract function with call expression of self in implies
- [`KT-30411`](https://youtrack.jetbrains.com/issue/KT-30411) Fold recursive types to star-projected ones when inferring type variables
- [`KT-30706`](https://youtrack.jetbrains.com/issue/KT-30706) Passing noinline lambda as (cross)inline parameter result in wrong state-machine
- [`KT-30707`](https://youtrack.jetbrains.com/issue/KT-30707) Java interop of coroutines inside inline functions is broken
- [`KT-30983`](https://youtrack.jetbrains.com/issue/KT-30983) ClassCastException: DeserializedTypeAliasDescriptor cannot be cast to PackageViewDescriptor on star-import of expect enum class actualized with typealias
- [`KT-31242`](https://youtrack.jetbrains.com/issue/KT-31242) "Can't find enclosing method" proguard compilation exception with inline and crossinline
- [`KT-31347`](https://youtrack.jetbrains.com/issue/KT-31347) "IndexOutOfBoundsException: Insufficient maximum stack size" with crossinline and suspend
- [`KT-31354`](https://youtrack.jetbrains.com/issue/KT-31354) Suspend inline functions with crossinline parameters are inaccessible from java
- [`KT-31367`](https://youtrack.jetbrains.com/issue/KT-31367) IllegalStateException: Concrete fake override public open fun (...) defined in TheIssue[PropertyGetterDescriptorImpl@1a03c376] should have exactly one concrete super-declaration: []
- [`KT-31461`](https://youtrack.jetbrains.com/issue/KT-31461) NI: NONE_APPLICABLE instead of TYPE_MISMATCH when invoking convention plus operator
- [`KT-31503`](https://youtrack.jetbrains.com/issue/KT-31503) Type mismatch with recursive types and SAM conversions
- [`KT-31507`](https://youtrack.jetbrains.com/issue/KT-31507) Enable new type inference algorithm for IDE analysis
- [`KT-31514`](https://youtrack.jetbrains.com/issue/KT-31514) New inference generates multiple errors on generic inline expression with elvis operator
- [`KT-31520`](https://youtrack.jetbrains.com/issue/KT-31520) False positive "not enough information" for constraint with star projection and covariant type
- [`KT-31606`](https://youtrack.jetbrains.com/issue/KT-31606) Rewrite at slice on using callable reference with array access operator
- [`KT-31620`](https://youtrack.jetbrains.com/issue/KT-31620) False-positive "not enough information" for coroutine-inference when target method is assigned to a variable
- [`KT-31624`](https://youtrack.jetbrains.com/issue/KT-31624) Type from declared upper bound in Java is considered more specific than Nothing producing type mismatch later
- [`KT-31860`](https://youtrack.jetbrains.com/issue/KT-31860) Explicit type argument isn't considered as input type causing errors about "only input types"
- [`KT-31866`](https://youtrack.jetbrains.com/issue/KT-31866) Problems with using star-projections on LHS of callable reference
- [`KT-31868`](https://youtrack.jetbrains.com/issue/KT-31868) No type mismatch error when using NoInfer annotation
- [`KT-31941`](https://youtrack.jetbrains.com/issue/KT-31941) Good code red in IDE with smart cast on parameter of a generic type after null check
### IDE
#### New Features
- [`KT-11242`](https://youtrack.jetbrains.com/issue/KT-11242) Action to copy project diagnostic information to clipboard
- [`KT-24292`](https://youtrack.jetbrains.com/issue/KT-24292) Support external nullability annotations
- [`KT-30453`](https://youtrack.jetbrains.com/issue/KT-30453) Add plugin option (registry?) to enable new inference only in IDE
#### Performance Improvements
- [`KT-13841`](https://youtrack.jetbrains.com/issue/KT-13841) Classes and functions should be lazy-parseable
- [`KT-27106`](https://youtrack.jetbrains.com/issue/KT-27106) Performance issue with optimize imports
- [`KT-30442`](https://youtrack.jetbrains.com/issue/KT-30442) Several second lag on project open in KotlinNonJvmSourceRootConverterProvider
- [`KT-30644`](https://youtrack.jetbrains.com/issue/KT-30644) ConfigureKotlinInProjectUtilsKt freezes UI
#### Fixes
- [`KT-7380`](https://youtrack.jetbrains.com/issue/KT-7380) Imports insertion on paste does not work correctly when there were alias imports in the source file
- [`KT-10512`](https://youtrack.jetbrains.com/issue/KT-10512) Do not delete imports with unresolved parts when optimizing
- [`KT-13048`](https://youtrack.jetbrains.com/issue/KT-13048) "Strip trailing spaces on Save" should not strip trailing spaces inside multiline strings in Kotlin
- [`KT-17375`](https://youtrack.jetbrains.com/issue/KT-17375) Optimize Imports does not remove unused import alias
- [`KT-27385`](https://youtrack.jetbrains.com/issue/KT-27385) Uast: property references should resolve to getters/setters
- [`KT-28627`](https://youtrack.jetbrains.com/issue/KT-28627) Invalid detection of Kotlin jvmTarget inside Idea/gradle build
- [`KT-29267`](https://youtrack.jetbrains.com/issue/KT-29267) Enable ultra-light classes by default
- [`KT-29892`](https://youtrack.jetbrains.com/issue/KT-29892) A lot of threads are waiting in KotlinConfigurationCheckerComponent
- [`KT-30356`](https://youtrack.jetbrains.com/issue/KT-30356) Kotlin facet: all JVM 9+ target platforms are shown as "Target Platform = JVM 9" in Project Structure dialog
- [`KT-30514`](https://youtrack.jetbrains.com/issue/KT-30514) Auto-import with "Add unambiguous imports on the fly" imports enum members from another package
- [`KT-30583`](https://youtrack.jetbrains.com/issue/KT-30583) Kotlin light elements should be `isEquivalentTo` to it's origins
- [`KT-30688`](https://youtrack.jetbrains.com/issue/KT-30688) Memory leak in the PerModulePackageCacheService.onTooComplexChange method
- [`KT-30949`](https://youtrack.jetbrains.com/issue/KT-30949) Optimize Imports removes used import alias
- [`KT-30957`](https://youtrack.jetbrains.com/issue/KT-30957) Kotlin UAST: USimpleNameReferenceExpression in "imports" for class' member resolves incorrectly to class, not to the member
- [`KT-31090`](https://youtrack.jetbrains.com/issue/KT-31090) java.lang.NoSuchMethodError: org.jetbrains.kotlin.idea.UtilsKt.addModuleDependencyIfNeeded on import of a multiplatform project with Android target (191 IDEA + master)
- [`KT-31092`](https://youtrack.jetbrains.com/issue/KT-31092) Don't check all selected files in CheckComponentsUsageSearchAction.update()
- [`KT-31319`](https://youtrack.jetbrains.com/issue/KT-31319) False positive "Unused import" for `provideDelegate` extension
- [`KT-31332`](https://youtrack.jetbrains.com/issue/KT-31332) Kotlin AnnotatedElementsSearch does't support Kotlin `object`
- [`KT-31129`](https://youtrack.jetbrains.com/issue/KT-31129) Call only Kotlin-specific reference contributors for getting Kotlin references from PSI
- [`KT-31693`](https://youtrack.jetbrains.com/issue/KT-31693) Project with no Kotlin: JPS rebuild fails with NCDFE for GradleSettingsService at KotlinMPPGradleProjectTaskRunner.canRun()
- [`KT-31466`](https://youtrack.jetbrains.com/issue/KT-31466) SOE in Java highlighting when a Kotlin ultra-light method is invoked
- [`KT-31723`](https://youtrack.jetbrains.com/issue/KT-31723) Exception from UAST for attempt to infer types inside unresolved call
- [`KT-31842`](https://youtrack.jetbrains.com/issue/KT-31842) UOE: no descriptor for type constructor of TypeVariable(T)
- [`KT-31992`](https://youtrack.jetbrains.com/issue/KT-31992) Fix ColorsIcon.scale(float) compatibility issue between IU-192.5118.30 and 1.3.40-eap-105
### IDE. Completion
- [`KT-29038`](https://youtrack.jetbrains.com/issue/KT-29038) Autocomplete "suspend" into "suspend fun" at top level and class level (except in kts top level)
- [`KT-29398`](https://youtrack.jetbrains.com/issue/KT-29398) Add "arg" postfix template
- [`KT-30511`](https://youtrack.jetbrains.com/issue/KT-30511) Replace extra space after autocompleting data class with file name by parentheses
### IDE. Debugger
- [`KT-10636`](https://youtrack.jetbrains.com/issue/KT-10636) Debugger: can't evaluate call of function type parameter inside inline function
- [`KT-18247`](https://youtrack.jetbrains.com/issue/KT-18247) Debugger: class level watches fail to evaluate outside of class instance context
- [`KT-18263`](https://youtrack.jetbrains.com/issue/KT-18263) Settings / Debugger / Java Type Renderers: unqualified Kotlin class members in Java expressions are shown as errors
- [`KT-23586`](https://youtrack.jetbrains.com/issue/KT-23586) Non-trivial properties autocompletion in evaluation window
- [`KT-30216`](https://youtrack.jetbrains.com/issue/KT-30216) Evaluate expression: declarations annotated with Experimental (LEVEL.ERROR) fail due to compilation error
- [`KT-30610`](https://youtrack.jetbrains.com/issue/KT-30610) Debugger: Variables view shows second `this` instance for inline function even from the same class as caller function
- [`KT-30714`](https://youtrack.jetbrains.com/issue/KT-30714) Breakpoints are shown as invalid for classes that are not loaded yet
- [`KT-30934`](https://youtrack.jetbrains.com/issue/KT-30934) "InvocationException: Exception occurred in target VM" on debugger breakpoint hit (with kotlintest)
- [`KT-31266`](https://youtrack.jetbrains.com/issue/KT-31266) Kotlin debugger incompatibility with latest 192 nightly: KotlinClassWithDelegatedPropertyRenderer
- [`KT-31785`](https://youtrack.jetbrains.com/issue/KT-31785) Exception on attempt to evaluate local function
### IDE. Gradle
- [`KT-29854`](https://youtrack.jetbrains.com/issue/KT-29854) File collection dependency does not work with NMPP+JPS
- [`KT-30531`](https://youtrack.jetbrains.com/issue/KT-30531) Gradle: NodeJS downloading
- [`KT-30767`](https://youtrack.jetbrains.com/issue/KT-30767) Kotlin import uses too much memory when working with big projects
- [`KT-29564`](https://youtrack.jetbrains.com/issue/KT-29564) kotlin.parallel.tasks.in.project=true causes idea to create kotlin modules with target JVM 1.6
- [`KT-31014`](https://youtrack.jetbrains.com/issue/KT-31014) Gradle, JS: Webpack watch mode
- [`KT-31843`](https://youtrack.jetbrains.com/issue/KT-31843) Memory leak caused by KOTLIN_TARGET_DATA_NODE on project reimport
- [`KT-31952`](https://youtrack.jetbrains.com/issue/KT-31952) Fix compatibility issues with IDEA after fixing IDEA-187832
### IDE. Gradle. Script
- [`KT-30638`](https://youtrack.jetbrains.com/issue/KT-30638) "Highlighting in scripts is not available until all Script Dependencies are loaded" in Diff viewer
- [`KT-31124`](https://youtrack.jetbrains.com/issue/KT-31124) “compileKotlin - configuration not found: kotlinScriptDef, the plugin is probably applied by a mistake” after creating new project with IJ and Kotlin from master
- [`KT-30974`](https://youtrack.jetbrains.com/issue/KT-30974) Script dependencies resolution failed error while trying to use Kotlin for Gradle
### IDE. Hints
- [`KT-30057`](https://youtrack.jetbrains.com/issue/KT-30057) "View->Type info" shows "Type is unknown" for named argument syntax
### IDE. Inspections and Intentions
#### New Features
- [`KT-11629`](https://youtrack.jetbrains.com/issue/KT-11629) Inspection: creating Throwable without throwing it
- [`KT-12392`](https://youtrack.jetbrains.com/issue/KT-12392) Unused import with alias should be highlighted and removed with Optimize Imports
- [`KT-12721`](https://youtrack.jetbrains.com/issue/KT-12721) inspection should be made for converting Integer.toString(int) to int.toString()
- [`KT-13962`](https://youtrack.jetbrains.com/issue/KT-13962) Intention to replace Java collection constructor calls with function calls from stdlib (ArrayList() → arrayListOf())
- [`KT-15537`](https://youtrack.jetbrains.com/issue/KT-15537) Add inspection + intention to replace IntRange.start/endInclusive with first/last
- [`KT-21195`](https://youtrack.jetbrains.com/issue/KT-21195) ReplaceWith intention could save generic type arguments
- [`KT-25262`](https://youtrack.jetbrains.com/issue/KT-25262) Intention: Rename class to containing file name
- [`KT-25439`](https://youtrack.jetbrains.com/issue/KT-25439) Inspection "Map replaceable with EnumMap"
- [`KT-26269`](https://youtrack.jetbrains.com/issue/KT-26269) Inspection to replace associate with associateWith or associateBy
- [`KT-26629`](https://youtrack.jetbrains.com/issue/KT-26629) Inspection to replace `==` operator on Double.NaN with `equals` call
- [`KT-27411`](https://youtrack.jetbrains.com/issue/KT-27411) Inspection and Quickfix to replace System.exit() with exitProcess()
- [`KT-29344`](https://youtrack.jetbrains.com/issue/KT-29344) Convert property initializer to getter: suggest on property name
- [`KT-29666`](https://youtrack.jetbrains.com/issue/KT-29666) Quickfix for "DEPRECATED_JAVA_ANNOTATION": migrate arguments
- [`KT-29798`](https://youtrack.jetbrains.com/issue/KT-29798) Add 'Covariant equals' inspection
- [`KT-29799`](https://youtrack.jetbrains.com/issue/KT-29799) Inspection: class with non-null self-reference as a parameter in its primary constructor
- [`KT-30078`](https://youtrack.jetbrains.com/issue/KT-30078) Add "Add getter/setter" quick fix for uninitialized property
- [`KT-30381`](https://youtrack.jetbrains.com/issue/KT-30381) Inspection + quickfix to replace non-null assertion with return
- [`KT-30389`](https://youtrack.jetbrains.com/issue/KT-30389) Fix to convert argument to Int: suggest roundToInt()
- [`KT-30501`](https://youtrack.jetbrains.com/issue/KT-30501) Add inspection to replace filter { it is Foo } with filterIsInstance<Foo> and filter { it != null } with filterNotNull
- [`KT-30612`](https://youtrack.jetbrains.com/issue/KT-30612) Unused symbol inspection should detect enum entry
- [`KT-30663`](https://youtrack.jetbrains.com/issue/KT-30663) Fully qualified name is added on quick fix for original class name if import alias exists
- [`KT-30725`](https://youtrack.jetbrains.com/issue/KT-30725) Inspection which replaces `.sorted().first()` with `.min()`
#### Fixes
- [`KT-5412`](https://youtrack.jetbrains.com/issue/KT-5412) "Replace non-null assertion with `if` expression" should replace parent expression
- [`KT-13549`](https://youtrack.jetbrains.com/issue/KT-13549) "Package directive doesn't match file location" for root package
- [`KT-14040`](https://youtrack.jetbrains.com/issue/KT-14040) Secondary enum class constructor is marked as "unused" by IDE
- [`KT-18459`](https://youtrack.jetbrains.com/issue/KT-18459) Spring: "Autowiring for Bean Class (Kotlin)" inspection adds not working `@Named` annotation to property
- [`KT-21526`](https://youtrack.jetbrains.com/issue/KT-21526) used class is marked as "never used"
- [`KT-22896`](https://youtrack.jetbrains.com/issue/KT-22896) "Change function signature" quickfix on "x overrides nothing" doesn't rename type arguments
- [`KT-27089`](https://youtrack.jetbrains.com/issue/KT-27089) ReplaceWith quickfix doesn't take into account generic parameter
- [`KT-27821`](https://youtrack.jetbrains.com/issue/KT-27821) SimplifiableCallChain inspection quick fix removes comments for intermediate operations
- [`KT-28485`](https://youtrack.jetbrains.com/issue/KT-28485) Incorrect parameter name after running "Add parameter to function" intention when argument variable is upper case const
- [`KT-28619`](https://youtrack.jetbrains.com/issue/KT-28619) "Add braces to 'if' statement" moves end-of-line comment inside an `if` branch if statement inside `if` is block
- [`KT-29556`](https://youtrack.jetbrains.com/issue/KT-29556) "Remove redundant 'let' call" doesn't rename parameter with convention `invoke` call
- [`KT-29677`](https://youtrack.jetbrains.com/issue/KT-29677) "Specify type explicitly" intention produces invalid output for type escaped with backticks
- [`KT-29764`](https://youtrack.jetbrains.com/issue/KT-29764) "Convert property to function" intention doesn't warn about the property overloads at child class constructor
- [`KT-29812`](https://youtrack.jetbrains.com/issue/KT-29812) False positive for HasPlatformType with member extension on 'dynamic'
- [`KT-29869`](https://youtrack.jetbrains.com/issue/KT-29869) 'WhenWithOnlyElse': possibly useless inspection with false grey warning highlighting during editing the code
- [`KT-30038`](https://youtrack.jetbrains.com/issue/KT-30038) 'Remove redundant Unit" false positive when return type is nullable Unit
- [`KT-30082`](https://youtrack.jetbrains.com/issue/KT-30082) False positive "redundant `.let` call" for lambda functions stored in nullable references
- [`KT-30173`](https://youtrack.jetbrains.com/issue/KT-30173) "Nested lambda has shadowed implicit parameter" is suggested when both parameters are logically the same
- [`KT-30208`](https://youtrack.jetbrains.com/issue/KT-30208) Convert to anonymous object: lambda generic type argument is lost
- [`KT-30215`](https://youtrack.jetbrains.com/issue/KT-30215) No "surround with null" check is suggested for an assignment
- [`KT-30228`](https://youtrack.jetbrains.com/issue/KT-30228) 'Convert to also/apply/run/with' intention behaves differently depending on the position of infix function call
- [`KT-30457`](https://youtrack.jetbrains.com/issue/KT-30457) MoveVariableDeclarationIntoWhen: do not report gray warning on variable declarations taking multiple lines / containing preemptive returns
- [`KT-30481`](https://youtrack.jetbrains.com/issue/KT-30481) Do not report ImplicitNullableNothingType on a function/property that overrides a function/property of type 'Nothing?'
- [`KT-30527`](https://youtrack.jetbrains.com/issue/KT-30527) False positive "Type alias is never used" with import of enum member
- [`KT-30559`](https://youtrack.jetbrains.com/issue/KT-30559) Redundant Getter, Redundant Setter: reduce range to getter/setter header
- [`KT-30565`](https://youtrack.jetbrains.com/issue/KT-30565) False positive "Suspicious 'var' property" inspection with annotated default property getter
- [`KT-30579`](https://youtrack.jetbrains.com/issue/KT-30579) Kotlin-gradle groovy inspections should depend on Groovy plugin
- [`KT-30613`](https://youtrack.jetbrains.com/issue/KT-30613) "Convert to anonymous function" should not insert named argument when interoping with Java functions
- [`KT-30614`](https://youtrack.jetbrains.com/issue/KT-30614) String templates suggest removing curly braces for backtick escaped identifiers
- [`KT-30622`](https://youtrack.jetbrains.com/issue/KT-30622) Add names to call arguments starting from given argument
- [`KT-30637`](https://youtrack.jetbrains.com/issue/KT-30637) False positive "unused constructor" for local class
- [`KT-30669`](https://youtrack.jetbrains.com/issue/KT-30669) Import quick fix does not work for property/function with original name if import alias for them exist
- [`KT-30761`](https://youtrack.jetbrains.com/issue/KT-30761) Replace assert boolean with assert equality produces uncompilable code when compared arguments type are different
- [`KT-30769`](https://youtrack.jetbrains.com/issue/KT-30769) Override quickfix creates "sealed fun"
- [`KT-30833`](https://youtrack.jetbrains.com/issue/KT-30833) Exception after "Introduce Import Alias" if invoke in import
- [`KT-30876`](https://youtrack.jetbrains.com/issue/KT-30876) SimplifyNotNullAssert inspection changes semantics
- [`KT-30900`](https://youtrack.jetbrains.com/issue/KT-30900) Invert 'if' condition respects neither code formatting nor inline comments
- [`KT-30910`](https://youtrack.jetbrains.com/issue/KT-30910) "Use property access syntax" is not suitable as text for inspection problem text
- [`KT-30916`](https://youtrack.jetbrains.com/issue/KT-30916) Quickfix "Remove redundant qualifier name" can't work with user type with generic parameter
- [`KT-31103`](https://youtrack.jetbrains.com/issue/KT-31103) Don't invoke Gradle related inspections when Gradle plugin is disabled
- [`KT-31349`](https://youtrack.jetbrains.com/issue/KT-31349) Add name to argument should not be suggested for Java library classes
- [`KT-31404`](https://youtrack.jetbrains.com/issue/KT-31404) Redundant 'requireNotNull' or 'checkNotNull' inspection: don't remove first argument
- [`KT-25465`](https://youtrack.jetbrains.com/issue/KT-25465) "Redundant 'suspend' modifier" with suspend operator invoke
- [`KT-26337`](https://youtrack.jetbrains.com/issue/KT-26337) Exception (resource not found) in quick-fix tests in AS32
- [`KT-30879`](https://youtrack.jetbrains.com/issue/KT-30879) False positive "Redundant qualifier name"
- [`KT-31415`](https://youtrack.jetbrains.com/issue/KT-31415) UI hangs due to long computations for "Use property access syntax" intention with new inference
- [`KT-31441`](https://youtrack.jetbrains.com/issue/KT-31441) False positive "Remove explicit type arguments" inspection for projection type
- [`KT-30970`](https://youtrack.jetbrains.com/issue/KT-30970) No warning for empty `if` operator and `also`method
- [`KT-31855`](https://youtrack.jetbrains.com/issue/KT-31855) IDE + new inference: Java SAM conversion is not suggested by IDE services
### IDE. JS
- [`KT-31895`](https://youtrack.jetbrains.com/issue/KT-31895) New Project wizard: Kotlin Gradle + Kotlin/JS for Node.js: incorrect DSL is inserted
### IDE. Libraries
- [`KT-30790`](https://youtrack.jetbrains.com/issue/KT-30790) Unstable IDE navigation behavior to `expect`/`actual` symbols in stdlib
- [`KT-30821`](https://youtrack.jetbrains.com/issue/KT-30821) K/N: Navigation downwards the hierarchy in stdlib source code opens to stubs
### IDE. Misc
- [`KT-31364`](https://youtrack.jetbrains.com/issue/KT-31364) IntelliJ routinely hangs and spikes CPU / Memory usage when editing kotlin files
### IDE. Navigation
- [`KT-18322`](https://youtrack.jetbrains.com/issue/KT-18322) Find Usages not finding Java usage of @JvmField declared in primary constructor
- [`KT-27332`](https://youtrack.jetbrains.com/issue/KT-27332) Gutter icons are still shown even if disabled
### IDE. Refactorings
- [`KT-30471`](https://youtrack.jetbrains.com/issue/KT-30471) Make `KotlinElementActionsFactory.createChangeParametersActions` able to just add parameters
### IDE. Run Configurations
- [`KT-29352`](https://youtrack.jetbrains.com/issue/KT-29352) Kotlin + Java 11 + Windows : impossible to run applications with long command lines, even with dynamic.classpath=true
### IDE. Scratch
- [`KT-29642`](https://youtrack.jetbrains.com/issue/KT-29642) Once hidden, `Scratch Output` window wouldn't show the results unless the project is reopened
### IDE. Script
- [`KT-30295`](https://youtrack.jetbrains.com/issue/KT-30295) Resolver for 'completion/highlighting in ScriptDependenciesSourceInfo...' does not know how to resolve [] or [Library(null)]
- [`KT-30690`](https://youtrack.jetbrains.com/issue/KT-30690) Highlighting for scripts in diff view doesn't work for left part
- [`KT-31452`](https://youtrack.jetbrains.com/issue/KT-31452) IDE editor: MISSING_SCRIPT_STANDARD_TEMPLATE is reported inconsistently with the single line in script
### IDE. Tests Support
- [`KT-30995`](https://youtrack.jetbrains.com/issue/KT-30995) Gradle test runner: "No tasks available" for a test class in non-MPP project
### IDE. Ultimate
- [`KT-30886`](https://youtrack.jetbrains.com/issue/KT-30886) KotlinIdeaResolutionException in Velocity template (.ft) with Kotlin code
### IDE. Wizards
- [`KT-30645`](https://youtrack.jetbrains.com/issue/KT-30645) Update New Project Wizard templates related to Kotlin/JS
- [`KT-31099`](https://youtrack.jetbrains.com/issue/KT-31099) Remove Gradle configuration boilerplate for JS from multiplatform New Project Wizard templates related to Kotlin/JS
- [`KT-31695`](https://youtrack.jetbrains.com/issue/KT-31695) Gradle, JS: update wizard templates
### JS. Tools
- [`KT-31563`](https://youtrack.jetbrains.com/issue/KT-31563) Gradle/JS: npmResolve fails with "Invalid version" when user project's version does not match npm rules
- [`KT-31566`](https://youtrack.jetbrains.com/issue/KT-31566) Gradle/JS: with explicit call to `nodejs { testTask { useNodeJs() } }` configuration fails : "Could not find which method to invoke"
- [`KT-31560`](https://youtrack.jetbrains.com/issue/KT-31560) Gradle: provide descriptions for JS tasks
- [`KT-31564`](https://youtrack.jetbrains.com/issue/KT-31564) Gradle/JS: npmResolve reports warning "karma-webpack@3.0.5 has unmet peer dependency"
- [`KT-31662`](https://youtrack.jetbrains.com/issue/KT-31662) Gradle/JS: with empty `useKarma {}` lambda the execution of `jsBrowserTest` never stops
- [`KT-31686`](https://youtrack.jetbrains.com/issue/KT-31686) Gradle/JS: useKarma { useConfigDirectory() } fails to configure
- [`KT-31694`](https://youtrack.jetbrains.com/issue/KT-31694) Gradle, NPM, windows: creating symlink requires administrator privilege
- [`KT-31931`](https://youtrack.jetbrains.com/issue/KT-31931) Gradle JS or Native: test processing fails in some cases
### JavaScript
- [`KT-31007`](https://youtrack.jetbrains.com/issue/KT-31007) Kotlin/JS 1.3.30 - private method in an interface in the external library causes ReferenceError
### Libraries
- [`KT-30174`](https://youtrack.jetbrains.com/issue/KT-30174) Annotation for experimental stdlib API
- [`KT-30451`](https://youtrack.jetbrains.com/issue/KT-30451) Redundant call of selector in maxBy&minBy
- [`KT-30560`](https://youtrack.jetbrains.com/issue/KT-30560) Fix Throwable::addSuppressed from stdlib to make it work without stdlib-jdk7 in runtime
- [`KT-24810`](https://youtrack.jetbrains.com/issue/KT-24810) Support common string<->ByteArray UTF-8 conversion
- [`KT-29265`](https://youtrack.jetbrains.com/issue/KT-29265) String.toCharArray() is not available in common stdlib
- [`KT-31194`](https://youtrack.jetbrains.com/issue/KT-31194) assertFails and assertFailsWith don't work with suspend functions
- [`KT-31639`](https://youtrack.jetbrains.com/issue/KT-31639) 'Iterbale.drop' drops too much because of overflow
- [`KT-28933`](https://youtrack.jetbrains.com/issue/KT-28933) capitalize() with Locale argument in the JDK stdlib
### Reflection
- [`KT-25541`](https://youtrack.jetbrains.com/issue/KT-25541) Incorrect parameter names in reflection for inner class constructor from Java class compiled with "-parameters"
- [`KT-29041`](https://youtrack.jetbrains.com/issue/KT-29041) KAnnotatedElement should have an extension function to verify if certain annotation is present
- [`KT-30344`](https://youtrack.jetbrains.com/issue/KT-30344) Avoid using .kotlin_module in kotlin-reflect
### Tools. Android Extensions
- [`KT-30993`](https://youtrack.jetbrains.com/issue/KT-30993) Android Extensions: Make @Parcelize functionality non-experimental
### Tools. CLI
- [`KT-27638`](https://youtrack.jetbrains.com/issue/KT-27638) Add -Xjava-sources compiler argument to specify directories with .java source files which can be referenced from the compiled Kotlin sources
- [`KT-27778`](https://youtrack.jetbrains.com/issue/KT-27778) Add -Xpackage-prefix compiler argument to specify package prefix for Java sources resolution
- [`KT-30973`](https://youtrack.jetbrains.com/issue/KT-30973) Compilation on IBM J9 (build 2.9, JRE 1.8.0 AIX ppc64-64-Bit) fails unless -Xuse-javac is specified
### Tools. Compiler Plugins
- [`KT-30343`](https://youtrack.jetbrains.com/issue/KT-30343) Add new Quarkus preset to all-open compiler plugin
### Tools. Gradle
#### New Features
- [`KT-20156`](https://youtrack.jetbrains.com/issue/KT-20156) Publish the Kotlin Javascript Gradle plugin to the Gradle Plugins Portal
- [`KT-26256`](https://youtrack.jetbrains.com/issue/KT-26256) In new MPP, support Java compilation in JVM targets
- [`KT-27273`](https://youtrack.jetbrains.com/issue/KT-27273) Support the Gradle 'application' plugin in new MPP or provide an alternative
- [`KT-30528`](https://youtrack.jetbrains.com/issue/KT-30528) Gradle, JS tests: support basic builtin test runner
- [`KT-31015`](https://youtrack.jetbrains.com/issue/KT-31015) Gradle, JS: Change default for new kotlin-js and experimental kotlin-multiplatform plugins
- [`KT-30573`](https://youtrack.jetbrains.com/issue/KT-30573) Gradle, JS: enable source maps by default, change paths relative to node_modules directory
- [`KT-30747`](https://youtrack.jetbrains.com/issue/KT-30747) Gradle, JS tests: provide option to disable test configuration per target
- [`KT-31010`](https://youtrack.jetbrains.com/issue/KT-31010) Gradle, JS tests: Mocha
- [`KT-31011`](https://youtrack.jetbrains.com/issue/KT-31011) Gradle, JS tests: Karma
- [`KT-31013`](https://youtrack.jetbrains.com/issue/KT-31013) Gradle, JS: Webpack
- [`KT-31016`](https://youtrack.jetbrains.com/issue/KT-31016) Gradle: yarn downloading
- [`KT-31017`](https://youtrack.jetbrains.com/issue/KT-31017) Gradle, yarn: support workspaces
#### Fixes
- [`KT-13256`](https://youtrack.jetbrains.com/issue/KT-13256) CompileJava tasks in Kotlin2Js Gradle plugin
- [`KT-16355`](https://youtrack.jetbrains.com/issue/KT-16355) Rename "compileKotlin2Js" Gradle task to "compileKotlinJs"
- [`KT-26255`](https://youtrack.jetbrains.com/issue/KT-26255) Using the jvmWithJava preset in new MPP leads to counter-intuitive source set names and directory structure
- [`KT-27640`](https://youtrack.jetbrains.com/issue/KT-27640) Do not use `-Xbuild-file` when invoking the Kotlin compiler in Gradle plugins
- [`KT-29284`](https://youtrack.jetbrains.com/issue/KT-29284) kotlin2js plugin applies java plugin
- [`KT-30132`](https://youtrack.jetbrains.com/issue/KT-30132) Could not initialize class org.jetbrains.kotlin.com.intellij.openapi.util.io.FileUtil on build by gradle
- [`KT-30596`](https://youtrack.jetbrains.com/issue/KT-30596) Kotlin Gradle Plugin: Forward stdout and stderr logger of out of process though gradle logger
- [`KT-31106`](https://youtrack.jetbrains.com/issue/KT-31106) Kotlin compilation fails with locked build script dependencies and Gradle 5
- [`KT-28985`](https://youtrack.jetbrains.com/issue/KT-28985) Java tests not executed in a module created with presets.jvmWithJava
- [`KT-30340`](https://youtrack.jetbrains.com/issue/KT-30340) kotlin("multiplatform") plugin is not working properly with Spring Boot
- [`KT-30784`](https://youtrack.jetbrains.com/issue/KT-30784) Deprecation warning "API 'variant.getPackageLibrary()' is obsolete and has been replaced with 'variant.getPackageLibraryProvider()'" for a multiplatform library with Android target
- [`KT-31027`](https://youtrack.jetbrains.com/issue/KT-31027) java.lang.NoSuchMethodError: No static method hashCode(Z)I in class Ljava/lang/Boolean; or its super classes (declaration of 'java.lang.Boolean' appears in /system/framework/core-libart.jar)
- [`KT-31696`](https://youtrack.jetbrains.com/issue/KT-31696) Gradle, NPM: select one version between tools and all of compile configurations
- [`KT-31697`](https://youtrack.jetbrains.com/issue/KT-31697) Gradle, NPM: report about clashes in packages_imported
- [`KT-31891`](https://youtrack.jetbrains.com/issue/KT-31891) Gradle: JS or Native tests execution: `build --scan` fails with ISE "Expected attachment of type ... but did not find it"
- [`KT-31023`](https://youtrack.jetbrains.com/issue/KT-31023) Update Gradle module metadata warning in MPP publishing
### Tools. Incremental Compile
- [`KT-31131`](https://youtrack.jetbrains.com/issue/KT-31131) Regression: incremental compilation of multi-file part throws exception
### Tools. J2K
- [`KT-23023`](https://youtrack.jetbrains.com/issue/KT-23023) J2K: Inspection to convert Arrays.copyOf(a, size) to a.copyOf(size)
- [`KT-26550`](https://youtrack.jetbrains.com/issue/KT-26550) J2K: Check context/applicability of conversion, don't suggest for libraries, jars, etc.
- [`KT-29568`](https://youtrack.jetbrains.com/issue/KT-29568) Disabled "Convert Java File to Kotlin File" action is shown in project view context menu for XML files
### Tools. JPS
- [`KT-13563`](https://youtrack.jetbrains.com/issue/KT-13563) Kotlin jps-plugin should allow to instrument bytecode from Intellij IDEA.
### Tools. REPL
- [`KT-21443`](https://youtrack.jetbrains.com/issue/KT-21443) Kotlin's JSR223 script engine does not work when used by a fat jar
### Tools. Scripts
- [`KT-30986`](https://youtrack.jetbrains.com/issue/KT-30986) Missing dependencies when JSR-223 script engines are used from `kotlin-script-util`
### Tools. kapt
- [`KT-26203`](https://youtrack.jetbrains.com/issue/KT-26203) `kapt.use.worker.api=true` throws a NullPointerException on Java 10/11
- [`KT-30739`](https://youtrack.jetbrains.com/issue/KT-30739) Kapt generated sources are not visible from the IDE when "Create separate module per source set" is disabled
- [`KT-31064`](https://youtrack.jetbrains.com/issue/KT-31064) Periodically build crash when using incremental kapt
- [`KT-23880`](https://youtrack.jetbrains.com/issue/KT-23880) Kapt: Support incremental annotation processors
- [`KT-31322`](https://youtrack.jetbrains.com/issue/KT-31322) Kapt does not run annotation processing when sources change.
- [`KT-30979`](https://youtrack.jetbrains.com/issue/KT-30979) Issue with Dagger2 providers MissingBinding with 1.3.30
- [`KT-31127`](https://youtrack.jetbrains.com/issue/KT-31127) Kotlin-generating processor which uses Filer API breaks JavaCompile task
- [`KT-31714`](https://youtrack.jetbrains.com/issue/KT-31714) incremental kapt: FileSystemException: Too many open files
## Previous releases
This release also includes the fixes and improvements from the
[`1.2.60`](https://github.com/JetBrains/kotlin/blob/1.2.60/ChangeLog.md) release.
This release also includes the fixes and improvements from the [previous releases](https://github.com/JetBrains/kotlin/releases/tag/v1.3.31).

View File

@@ -1,8 +1,7 @@
[![official project](http://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
<a href="http://slack.kotlinlang.org/"><img src="http://slack.kotlinlang.org/badge.svg" height="20"></a>
[![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
@@ -10,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
@@ -42,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
@@ -84,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.
@@ -101,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".
@@ -134,36 +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.
Also the [JavaScript translation](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.
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.
## Submitting patches
The best way to submit a patch is to [fork the project on github](https://help.github.com/articles/fork-a-repo/) 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.
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

@@ -38,7 +38,7 @@ internal object KotlinAntTaskUtil {
}
val compilerJar: File by jar("kotlin-compiler.jar")
val runtimeJar: File by jar("kotlin-runtime.jar")
val runtimeJar: File by jar("kotlin-stdlib.jar")
val reflectJar: File by jar("kotlin-reflect.jar")
private fun jar(name: String) = lazy {

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
@@ -64,6 +64,9 @@ abstract class BuildMetaInfoFactory<T : BuildMetaInfo>(private val metaInfoClass
)
}
fun serializeToString(args: CommonCompilerArguments): String =
serializeToString(create(args))
fun serializeToString(info: T): String =
serializeToPlainText(info, metaInfoClass)

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,111 +0,0 @@
/*
* Copyright 2010-2015 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.
*/
package org.jetbrains.kotlin.incremental
import org.jetbrains.annotations.TestOnly
import org.jetbrains.kotlin.config.IncrementalCompilation
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmBytecodeBinaryVersion
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmMetadataVersion
import java.io.File
import java.io.IOException
private val NORMAL_VERSION = 9
private val DATA_CONTAINER_VERSION = 3
private val NORMAL_VERSION_FILE_NAME = "format-version.txt"
private val DATA_CONTAINER_VERSION_FILE_NAME = "data-container-format-version.txt"
class CacheVersion(
private val ownVersion: Int,
private val versionFile: File,
private val whenVersionChanged: CacheVersion.Action,
private val whenTurnedOn: CacheVersion.Action,
private val whenTurnedOff: CacheVersion.Action,
private val isEnabled: Boolean
) {
private val actualVersion: Int?
get() = try {
versionFile.readText().toInt()
}
catch (e: NumberFormatException) {
null
}
catch (e: IOException) {
null
}
private val expectedVersion: Int
get() {
val metadata = JvmMetadataVersion.INSTANCE
val bytecode = JvmBytecodeBinaryVersion.INSTANCE
return ownVersion * 1000000 +
bytecode.major * 10000 + bytecode.minor * 100 +
metadata.major * 1000 + metadata.minor
}
fun checkVersion(): Action =
when (versionFile.exists() to isEnabled) {
true to true -> if (actualVersion != expectedVersion) whenVersionChanged else Action.DO_NOTHING
false to true -> whenTurnedOn
true to false -> whenTurnedOff
else -> Action.DO_NOTHING
}
fun saveIfNeeded() {
if (!isEnabled) return
if (!versionFile.parentFile.exists()) {
versionFile.parentFile.mkdirs()
}
versionFile.writeText(expectedVersion.toString())
}
fun clean() {
versionFile.delete()
}
@get:TestOnly
val formatVersionFile: File
get() = versionFile
// Order of entries is important, because actions are sorted in KotlinBuilder::checkVersions
enum class Action {
REBUILD_ALL_KOTLIN,
REBUILD_CHUNK,
CLEAN_NORMAL_CACHES,
CLEAN_DATA_CONTAINER,
DO_NOTHING
}
}
fun normalCacheVersion(dataRoot: File, enabled: Boolean): CacheVersion =
CacheVersion(ownVersion = NORMAL_VERSION,
versionFile = File(dataRoot, NORMAL_VERSION_FILE_NAME),
whenVersionChanged = CacheVersion.Action.REBUILD_CHUNK,
whenTurnedOn = CacheVersion.Action.REBUILD_CHUNK,
whenTurnedOff = CacheVersion.Action.CLEAN_NORMAL_CACHES,
isEnabled = enabled)
fun dataContainerCacheVersion(dataRoot: File, enabled: Boolean): CacheVersion =
CacheVersion(ownVersion = DATA_CONTAINER_VERSION,
versionFile = File(dataRoot, DATA_CONTAINER_VERSION_FILE_NAME),
whenVersionChanged = CacheVersion.Action.REBUILD_ALL_KOTLIN,
whenTurnedOn = CacheVersion.Action.REBUILD_ALL_KOTLIN,
whenTurnedOff = CacheVersion.Action.CLEAN_DATA_CONTAINER,
isEnabled = enabled)

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,7 +23,6 @@ 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.inline.inlineFunctionsJvmNames
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader
@@ -43,9 +42,13 @@ import java.util.*
val KOTLIN_CACHE_DIRECTORY_NAME = "kotlin"
open class IncrementalJvmCache(
private val targetDataRoot: File,
targetOutputDir: File?
) : AbstractIncrementalCache<JvmClassName>(File(targetDataRoot, KOTLIN_CACHE_DIRECTORY_NAME)), IncrementalCache {
private val targetDataRoot: File,
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"
@@ -59,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))
@@ -69,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" } }
@@ -81,16 +85,16 @@ open class IncrementalJvmCache(
// used in gradle
@Suppress("unused")
fun classesBySources(sources: Iterable<File>): Iterable<JvmClassName> =
sources.flatMap { sourceToClassesMap[it] }
sources.flatMap { sourceToClassesMap[it] }
fun sourceInCache(file: File): Boolean =
sourceToClassesMap.contains(file)
fun sourcesByInternalName(internalName: String): Collection<File> =
internalNameToSource[internalName]
internalNameToSource[internalName]
fun isMultifileFacade(className: JvmClassName): Boolean =
className in multifileFacadeToParts
className in multifileFacadeToParts
override fun getClassFilePath(internalClassName: String): String {
return toSystemIndependentName(File(outputDir, "$internalClassName.class").canonicalPath)
@@ -129,7 +133,7 @@ open class IncrementalJvmCache(
}
KotlinClassHeader.Kind.MULTIFILE_CLASS -> {
val partNames = kotlinClass.classHeader.data?.toList()
?: throw AssertionError("Multifile class has no parts: ${kotlinClass.className}")
?: throw AssertionError("Multifile class has no parts: ${kotlinClass.className}")
multifileFacadeToParts[className] = partNames
// When a class is replaced with a facade with the same name,
// the class' proto wouldn't ever be deleted,
@@ -177,15 +181,15 @@ open class IncrementalJvmCache(
}
fun getObsoleteJavaClasses(): Collection<ClassId> =
dirtyOutputClassesMap.getDirtyOutputClasses()
.mapNotNull {
javaSourcesProtoMap[it]?.classId
}
dirtyOutputClassesMap.getDirtyOutputClasses()
.mapNotNull {
javaSourcesProtoMap[it]?.classId
}
fun isJavaClassToTrack(classId: ClassId): Boolean {
val jvmClassName = JvmClassName.byClassId(classId)
return dirtyOutputClassesMap.isDirty(jvmClassName) ||
jvmClassName !in javaSourcesProtoMap
jvmClassName !in javaSourcesProtoMap
}
fun isJavaClassAlreadyInCache(classId: ClassId): Boolean {
@@ -210,8 +214,7 @@ open class IncrementalJvmCache(
if (notRemovedParts.isEmpty()) {
multifileFacadeToParts.remove(facade)
}
else {
} else {
multifileFacadeToParts[facade] = notRemovedParts
}
}
@@ -263,11 +266,6 @@ open class IncrementalJvmCache(
return protoMap[JvmClassName.byInternalName(MODULE_MAPPING_FILE_NAME)]?.bytes
}
override fun clean() {
super.clean()
normalCacheVersion(targetDataRoot, IncrementalCompilation.isEnabledForJvm()).clean()
}
private inner class ProtoMap(storageFile: File) : BasicStringMap<ProtoMapValue>(storageFile, ProtoMapValueExternalizer) {
fun process(kotlinClass: LocalFileKotlinClass, changesCollector: ChangesCollector) {
@@ -290,9 +288,11 @@ open class IncrementalJvmCache(
val key = kotlinClass.className.internalName
val oldData = storage[key]
val newData = ProtoMapValue(header.kind != KotlinClassHeader.Kind.CLASS,
BitEncoding.decodeBytes(header.data!!),
header.strings!!)
val newData = ProtoMapValue(
header.kind != KotlinClassHeader.Kind.CLASS,
BitEncoding.decodeBytes(header.data!!),
header.strings!!
)
storage[key] = newData
val packageFqName = kotlinClass.className.packageFqName
@@ -300,10 +300,10 @@ open class IncrementalJvmCache(
}
operator fun contains(className: JvmClassName): Boolean =
className.internalName in storage
className.internalName in storage
operator fun get(className: JvmClassName): ProtoMapValue? =
storage[className.internalName]
storage[className.internalName]
fun remove(className: JvmClassName, changesCollector: ChangesCollector) {
val key = className.internalName
@@ -319,15 +319,16 @@ open class IncrementalJvmCache(
}
}
private inner class JavaSourcesProtoMap(storageFile: File) : BasicStringMap<SerializedJavaClass>(storageFile, JavaClassProtoMapValueExternalizer) {
private inner class JavaSourcesProtoMap(storageFile: File) :
BasicStringMap<SerializedJavaClass>(storageFile, JavaClassProtoMapValueExternalizer) {
fun process(jvmClassName: JvmClassName, newData: SerializedJavaClass, changesCollector: ChangesCollector) {
val key = jvmClassName.internalName
val oldData = storage[key]
storage[key] = newData
changesCollector.collectProtoChanges(
oldData?.toProtoData(), newData.toProtoData(),
collectAllMembersForNewClass = true
oldData?.toProtoData(), newData.toProtoData(),
collectAllMembersForNewClass = true
)
}
@@ -340,13 +341,13 @@ open class IncrementalJvmCache(
}
operator fun get(className: JvmClassName): SerializedJavaClass? =
storage[className.internalName]
storage[className.internalName]
operator fun contains(className: JvmClassName): Boolean =
className.internalName in storage
className.internalName in storage
override fun dumpValue(value: SerializedJavaClass): String =
java.lang.Long.toHexString(value.proto.toByteArray().md5())
java.lang.Long.toHexString(value.proto.toByteArray().md5())
}
// todo: reuse code with InlineFunctionsMap?
@@ -354,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) {
@@ -368,7 +369,7 @@ open class IncrementalJvmCache(
}
operator fun contains(className: JvmClassName): Boolean =
className.internalName in storage
className.internalName in storage
fun process(kotlinClass: LocalFileKotlinClass, changesCollector: ChangesCollector) {
val key = kotlinClass.className.internalName
@@ -377,8 +378,7 @@ open class IncrementalJvmCache(
val newMap = getConstantsMap(kotlinClass.fileContents)
if (newMap.isNotEmpty()) {
storage[key] = newMap
}
else {
} else {
storage.remove(key)
}
@@ -392,7 +392,7 @@ open class IncrementalJvmCache(
}
override fun dumpValue(value: Map<String, Any>): String =
value.dumpMap(Any::toString)
value.dumpMap(Any::toString)
}
private inner class PackagePartMap(storageFile: File) : BasicStringMap<Boolean>(storageFile, BooleanDataDescriptor.INSTANCE) {
@@ -405,21 +405,22 @@ open class IncrementalJvmCache(
}
fun isPackagePart(className: JvmClassName): Boolean =
className.internalName in storage
className.internalName in storage
override fun dumpValue(value: Boolean) = ""
}
private inner class MultifileClassFacadeMap(storageFile: File) : BasicStringMap<Collection<String>>(storageFile, StringCollectionExternalizer) {
private inner class MultifileClassFacadeMap(storageFile: File) :
BasicStringMap<Collection<String>>(storageFile, StringCollectionExternalizer) {
operator fun set(className: JvmClassName, partNames: Collection<String>) {
storage[className.internalName] = partNames
}
operator fun get(className: JvmClassName): Collection<String>? =
storage[className.internalName]
storage[className.internalName]
operator fun contains(className: JvmClassName): Boolean =
className.internalName in storage
className.internalName in storage
fun remove(className: JvmClassName) {
storage.remove(className.internalName)
@@ -428,13 +429,14 @@ open class IncrementalJvmCache(
override fun dumpValue(value: Collection<String>): String = value.dumpCollection()
}
private inner class MultifileClassPartMap(storageFile: File) : BasicStringMap<String>(storageFile, EnumeratorStringDescriptor.INSTANCE) {
private inner class MultifileClassPartMap(storageFile: File) :
BasicStringMap<String>(storageFile, EnumeratorStringDescriptor.INSTANCE) {
fun set(partName: String, facadeName: String) {
storage[partName] = facadeName
}
fun get(partName: JvmClassName): String? =
storage[partName.internalName]
storage[partName.internalName]
fun remove(className: JvmClassName) {
storage.remove(className.internalName)
@@ -443,20 +445,23 @@ 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)
}
override fun dumpValue(value: Collection<String>): String =
value.dumpCollection()
value.dumpCollection()
}
private fun addToClassStorage(kotlinClass: LocalFileKotlinClass, srcFile: File) {
@@ -464,18 +469,25 @@ open class IncrementalJvmCache(
addToClassStorage(proto, nameResolver, srcFile)
}
private inner class InlineFunctionsMap(storageFile: File) : BasicStringMap<Map<String, Long>>(storageFile, StringToLongMapExternalizer) {
private inner class InlineFunctionsMap(storageFile: File) :
BasicStringMap<Map<String, Long>>(storageFile, StringToLongMapExternalizer) {
private fun getInlineFunctionsMap(header: KotlinClassHeader, bytes: ByteArray): Map<String, Long> {
val inlineFunctions = inlineFunctionsJvmNames(header)
if (inlineFunctions.isEmpty()) return emptyMap()
val result = HashMap<String, Long>()
ClassReader(bytes).accept(object : ClassVisitor(Opcodes.ASM5) {
override fun visitMethod(access: Int, name: String, desc: String, signature: String?, exceptions: Array<out String>?): MethodVisitor? {
val dummyClassWriter = ClassWriter(Opcodes.ASM5)
ClassReader(bytes).accept(object : ClassVisitor(Opcodes.API_VERSION) {
override fun visitMethod(
access: Int,
name: String,
desc: String,
signature: String?,
exceptions: Array<out String>?
): MethodVisitor? {
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
@@ -499,30 +511,35 @@ open class IncrementalJvmCache(
val newMap = getInlineFunctionsMap(kotlinClass.classHeader, kotlinClass.fileContents)
if (newMap.isNotEmpty()) {
storage[key] = newMap
}
else {
} else {
storage.remove(key)
}
for (fn in oldMap.keys + newMap.keys) {
changesCollector.collectMemberIfValueWasChanged(kotlinClass.scopeFqName(), functionNameBySignature(fn), oldMap[fn], newMap[fn])
changesCollector.collectMemberIfValueWasChanged(
kotlinClass.scopeFqName(),
functionNameBySignature(fn),
oldMap[fn],
newMap[fn]
)
}
}
// TODO get name in better way instead of using substringBefore
private fun functionNameBySignature(signature: String): String =
signature.substringBefore("(")
signature.substringBefore("(")
fun remove(className: JvmClassName) {
storage.remove(className.internalName)
}
override fun dumpValue(value: Map<String, Long>): String =
value.dumpMap { java.lang.Long.toHexString(it) }
value.dumpMap { java.lang.Long.toHexString(it) }
}
}
private object PathCollectionExternalizer : CollectionExternalizer<String>(PathStringDescriptor, { THashSet(FileUtil.PATH_HASHING_STRATEGY) })
private object PathCollectionExternalizer :
CollectionExternalizer<String>(PathStringDescriptor, { THashSet(FileUtil.PATH_HASHING_STRATEGY) })
sealed class ChangeInfo(val fqName: FqName) {
open class MembersChanged(fqName: FqName, val names: Collection<String>) : ChangeInfo(fqName) {
@@ -542,10 +559,10 @@ sealed class ChangeInfo(val fqName: FqName) {
}
private fun LocalFileKotlinClass.scopeFqName() =
when (classHeader.kind) {
KotlinClassHeader.Kind.CLASS -> className.fqNameForClassNameWithoutDollars
else -> className.packageFqName
}
when (classHeader.kind) {
KotlinClassHeader.Kind.CLASS -> className.fqNameForClassNameWithoutDollars
else -> className.packageFqName
}
fun ByteArray.md5(): Long {
val d = MessageDigest.getInstance("MD5").digest(this)!!
@@ -557,23 +574,24 @@ fun ByteArray.md5(): Long {
or ((d[5].toLong() and 0xFFL) shl 40)
or ((d[6].toLong() and 0xFFL) shl 48)
or ((d[7].toLong() and 0xFFL) shl 56)
)
)
}
@TestOnly
fun <K : Comparable<K>, V> Map<K, V>.dumpMap(dumpValue: (V)->String): String =
buildString {
append("{")
for (key in keys.sorted()) {
if (length != 1) {
append(", ")
}
val value = get(key)?.let(dumpValue) ?: "null"
append("$key -> $value")
fun <K : Comparable<K>, V> Map<K, V>.dumpMap(dumpValue: (V) -> String): String =
buildString {
append("{")
for (key in keys.sorted()) {
if (length != 1) {
append(", ")
}
append("}")
}
@TestOnly fun <T : Comparable<T>> Collection<T>.dumpCollection(): String =
"[${sorted().joinToString(", ", transform = Any::toString)}]"
val value = get(key)?.let(dumpValue) ?: "null"
append("$key -> $value")
}
append("}")
}
@TestOnly
fun <T : Comparable<T>> Collection<T>.dumpCollection(): String =
"[${sorted().joinToString(", ", transform = Any::toString)}]"

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

@@ -177,10 +177,7 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEquals(old.typeTable, new.typeTable)) return false
}
if (old.hasVersionRequirement() != new.hasVersionRequirement()) return false
if (old.hasVersionRequirement()) {
if (old.versionRequirement != new.versionRequirement) return false
}
if (!checkEqualsClassVersionRequirement(old, new)) return false
if (old.hasVersionRequirementTable() != new.hasVersionRequirementTable()) return false
if (old.hasVersionRequirementTable()) {
@@ -251,7 +248,7 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
ENUM_ENTRY_LIST,
SEALED_SUBCLASS_FQ_NAME_LIST,
TYPE_TABLE,
VERSION_REQUIREMENT,
VERSION_REQUIREMENT_LIST,
VERSION_REQUIREMENT_TABLE,
JVM_EXT_CLASS_MODULE_NAME,
JVM_EXT_CLASS_LOCAL_VARIABLE_LIST,
@@ -302,10 +299,7 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEquals(old.typeTable, new.typeTable)) result.add(ProtoBufClassKind.TYPE_TABLE)
}
if (old.hasVersionRequirement() != new.hasVersionRequirement()) result.add(ProtoBufClassKind.VERSION_REQUIREMENT)
if (old.hasVersionRequirement()) {
if (old.versionRequirement != new.versionRequirement) result.add(ProtoBufClassKind.VERSION_REQUIREMENT)
}
if (!checkEqualsClassVersionRequirement(old, new)) result.add(ProtoBufClassKind.VERSION_REQUIREMENT_LIST)
if (old.hasVersionRequirementTable() != new.hasVersionRequirementTable()) result.add(ProtoBufClassKind.VERSION_REQUIREMENT_TABLE)
if (old.hasVersionRequirementTable()) {
@@ -404,10 +398,7 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEquals(old.typeTable, new.typeTable)) return false
}
if (old.hasVersionRequirement() != new.hasVersionRequirement()) return false
if (old.hasVersionRequirement()) {
if (old.versionRequirement != new.versionRequirement) return false
}
if (!checkEqualsFunctionVersionRequirement(old, new)) return false
if (old.hasContract() != new.hasContract()) return false
if (old.hasContract()) {
@@ -510,10 +501,7 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (old.setterFlags != new.setterFlags) return false
}
if (old.hasVersionRequirement() != new.hasVersionRequirement()) return false
if (old.hasVersionRequirement()) {
if (old.versionRequirement != new.versionRequirement) return false
}
if (!checkEqualsPropertyVersionRequirement(old, new)) return false
if (old.hasExtension(JvmProtoBuf.propertySignature) != new.hasExtension(JvmProtoBuf.propertySignature)) return false
if (old.hasExtension(JvmProtoBuf.propertySignature)) {
@@ -534,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
@@ -563,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
@@ -603,10 +627,7 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEqualsTypeAliasAnnotation(old, new)) return false
if (old.hasVersionRequirement() != new.hasVersionRequirement()) return false
if (old.hasVersionRequirement()) {
if (old.versionRequirement != new.versionRequirement) return false
}
if (!checkEqualsTypeAliasVersionRequirement(old, new)) return false
return true
}
@@ -788,10 +809,7 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEqualsConstructorValueParameter(old, new)) return false
if (old.hasVersionRequirement() != new.hasVersionRequirement()) return false
if (old.hasVersionRequirement()) {
if (old.versionRequirement != new.versionRequirement) return false
}
if (!checkEqualsConstructorVersionRequirement(old, new)) return false
if (old.hasExtension(JvmProtoBuf.constructorSignature) != new.hasExtension(JvmProtoBuf.constructorSignature)) return false
if (old.hasExtension(JvmProtoBuf.constructorSignature)) {
@@ -995,6 +1013,11 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
if (!checkEqualsAnnotationArgumentValueArrayElement(old, new)) return false
if (old.hasArrayDimensionCount() != new.hasArrayDimensionCount()) return false
if (old.hasArrayDimensionCount()) {
if (old.arrayDimensionCount != new.arrayDimensionCount) return false
}
if (old.hasFlags() != new.hasFlags()) return false
if (old.hasFlags()) {
if (old.flags != new.flags) return false
@@ -1262,6 +1285,16 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
return true
}
open fun checkEqualsClassVersionRequirement(old: ProtoBuf.Class, new: ProtoBuf.Class): Boolean {
if (old.versionRequirementCount != new.versionRequirementCount) return false
for(i in 0..old.versionRequirementCount - 1) {
if (old.getVersionRequirement(i) != new.getVersionRequirement(i)) return false
}
return true
}
open fun checkEqualsFunctionTypeParameter(old: ProtoBuf.Function, new: ProtoBuf.Function): Boolean {
if (old.typeParameterCount != new.typeParameterCount) return false
@@ -1282,6 +1315,16 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
return true
}
open fun checkEqualsFunctionVersionRequirement(old: ProtoBuf.Function, new: ProtoBuf.Function): Boolean {
if (old.versionRequirementCount != new.versionRequirementCount) return false
for(i in 0..old.versionRequirementCount - 1) {
if (old.getVersionRequirement(i) != new.getVersionRequirement(i)) return false
}
return true
}
open fun checkEqualsPropertyTypeParameter(old: ProtoBuf.Property, new: ProtoBuf.Property): Boolean {
if (old.typeParameterCount != new.typeParameterCount) return false
@@ -1292,6 +1335,16 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
return true
}
open fun checkEqualsPropertyVersionRequirement(old: ProtoBuf.Property, new: ProtoBuf.Property): Boolean {
if (old.versionRequirementCount != new.versionRequirementCount) return false
for(i in 0..old.versionRequirementCount - 1) {
if (old.getVersionRequirement(i) != new.getVersionRequirement(i)) return false
}
return true
}
open fun checkEqualsTypeAliasTypeParameter(old: ProtoBuf.TypeAlias, new: ProtoBuf.TypeAlias): Boolean {
if (old.typeParameterCount != new.typeParameterCount) return false
@@ -1312,6 +1365,16 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
return true
}
open fun checkEqualsTypeAliasVersionRequirement(old: ProtoBuf.TypeAlias, new: ProtoBuf.TypeAlias): Boolean {
if (old.versionRequirementCount != new.versionRequirementCount) return false
for(i in 0..old.versionRequirementCount - 1) {
if (old.getVersionRequirement(i) != new.getVersionRequirement(i)) return false
}
return true
}
open fun checkEqualsTypeTableType(old: ProtoBuf.TypeTable, new: ProtoBuf.TypeTable): Boolean {
if (old.typeCount != new.typeCount) return false
@@ -1372,6 +1435,16 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
return true
}
open fun checkEqualsConstructorVersionRequirement(old: ProtoBuf.Constructor, new: ProtoBuf.Constructor): Boolean {
if (old.versionRequirementCount != new.versionRequirementCount) return false
for(i in 0..old.versionRequirementCount - 1) {
if (old.getVersionRequirement(i) != new.getVersionRequirement(i)) return false
}
return true
}
open fun checkEqualsAnnotationArgument(old: ProtoBuf.Annotation, new: ProtoBuf.Annotation): Boolean {
if (old.argumentCount != new.argumentCount) return false
@@ -1562,8 +1635,8 @@ fun ProtoBuf.Class.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) ->
hashCode = 31 * hashCode + typeTable.hashCode(stringIndexes, fqNameIndexes)
}
if (hasVersionRequirement()) {
hashCode = 31 * hashCode + versionRequirement
for(i in 0..versionRequirementCount - 1) {
hashCode = 31 * hashCode + getVersionRequirement(i)
}
if (hasVersionRequirementTable()) {
@@ -1642,8 +1715,8 @@ fun ProtoBuf.Function.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int)
hashCode = 31 * hashCode + typeTable.hashCode(stringIndexes, fqNameIndexes)
}
if (hasVersionRequirement()) {
hashCode = 31 * hashCode + versionRequirement
for(i in 0..versionRequirementCount - 1) {
hashCode = 31 * hashCode + getVersionRequirement(i)
}
if (hasContract()) {
@@ -1726,8 +1799,8 @@ fun ProtoBuf.Property.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int)
hashCode = 31 * hashCode + setterFlags
}
if (hasVersionRequirement()) {
hashCode = 31 * hashCode + versionRequirement
for(i in 0..versionRequirementCount - 1) {
hashCode = 31 * hashCode + getVersionRequirement(i)
}
if (hasExtension(JvmProtoBuf.propertySignature)) {
@@ -1742,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)
}
@@ -1762,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)
}
@@ -1802,8 +1891,8 @@ fun ProtoBuf.TypeAlias.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int
hashCode = 31 * hashCode + getAnnotation(i).hashCode(stringIndexes, fqNameIndexes)
}
if (hasVersionRequirement()) {
hashCode = 31 * hashCode + versionRequirement
for(i in 0..versionRequirementCount - 1) {
hashCode = 31 * hashCode + getVersionRequirement(i)
}
return hashCode
@@ -1960,8 +2049,8 @@ fun ProtoBuf.Constructor.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (I
hashCode = 31 * hashCode + getValueParameter(i).hashCode(stringIndexes, fqNameIndexes)
}
if (hasVersionRequirement()) {
hashCode = 31 * hashCode + versionRequirement
for(i in 0..versionRequirementCount - 1) {
hashCode = 31 * hashCode + getVersionRequirement(i)
}
if (hasExtension(JvmProtoBuf.constructorSignature)) {
@@ -2134,6 +2223,10 @@ fun ProtoBuf.Annotation.Argument.Value.hashCode(stringIndexes: (Int) -> Int, fqN
hashCode = 31 * hashCode + getArrayElement(i).hashCode(stringIndexes, fqNameIndexes)
}
if (hasArrayDimensionCount()) {
hashCode = 31 * hashCode + arrayDimensionCount
}
if (hasFlags()) {
hashCode = 31 * hashCode + flags
}

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,14 +29,19 @@ 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"
fun makeModuleFile(
name: String,
isTest: Boolean,
outputDir: File,
sourcesToCompile: Iterable<File>,
commonSources: Iterable<File>,
javaSourceRoots: Iterable<JvmSourceRoot>,
classpath: Iterable<File>,
friendDirs: Iterable<File>
@@ -53,6 +56,7 @@ fun makeModuleFile(
sourcesToCompile.map { it.absoluteFile },
javaSourceRoots,
classpath,
commonSources.map { it.absoluteFile },
null,
"java-production",
isTest,
@@ -61,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,
@@ -126,10 +142,11 @@ 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)
dirtyClassesFqNames.addAll(fqNames)
for (classFqName in fqNames) {
assert(!classFqName.isRoot) { "$classFqName is root when processing $change" }
@@ -138,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)
@@ -156,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)
}
@@ -178,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

@@ -223,7 +223,7 @@ class DifferenceCalculatorForClass(
ProtoBufClassKind.TYPE_TABLE -> {
// TODO
}
ProtoCompareGenerated.ProtoBufClassKind.VERSION_REQUIREMENT,
ProtoCompareGenerated.ProtoBufClassKind.VERSION_REQUIREMENT_LIST,
ProtoCompareGenerated.ProtoBufClassKind.VERSION_REQUIREMENT_TABLE -> {
// TODO
}

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

@@ -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
@@ -34,16 +32,18 @@ class KotlinModuleXmlBuilder {
}
fun addModule(
moduleName: String,
outputDir: String,
sourceFiles: Iterable<File>,
javaSourceRoots: Iterable<JvmSourceRoot>,
classpathRoots: Iterable<File>,
modularJdkRoot: File?,
targetTypeId: String,
isTests: Boolean,
directoriesToFilterOut: Set<File>,
friendDirs: Iterable<File>): KotlinModuleXmlBuilder {
moduleName: String,
outputDir: String,
sourceFiles: Iterable<File>,
javaSourceRoots: Iterable<JvmSourceRoot>,
classpathRoots: Iterable<File>,
commonSourceFiles: Iterable<File>,
modularJdkRoot: File?,
targetTypeId: String,
isTests: Boolean,
directoriesToFilterOut: Set<File>,
friendDirs: Iterable<File>
): KotlinModuleXmlBuilder {
assert(!done) { "Already done" }
p.println("<!-- Module script for ${if (isTests) "tests" else "production"} -->")
@@ -62,6 +62,10 @@ class KotlinModuleXmlBuilder {
p.println("<", SOURCES, " ", PATH, "=\"", getEscapedPath(sourceFile), "\"/>")
}
for (commonSourceFile in commonSourceFiles) {
p.println("<", COMMON_SOURCES, " ", PATH, "=\"", getEscapedPath(commonSourceFile), "\"/>")
}
processJavaSourceRoots(javaSourceRoots)
processClasspath(classpathRoots, directoriesToFilterOut)
@@ -131,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

@@ -27,10 +27,11 @@ data class BuildLogFinder(
private const val JS_LOG = "js-build.log"
private const val GRADLE_LOG = "gradle-build.log"
private const val DATA_CONTAINER_LOG = "data-container-version-build.log"
const val JS_JPS_LOG = "js-jps-build.log"
private const val SIMPLE_LOG = "build.log"
fun isJpsLogFile(file: File): Boolean =
file.name.let { it == SIMPLE_LOG || it == DATA_CONTAINER_LOG }
file.name in arrayOf(SIMPLE_LOG, JS_JPS_LOG, DATA_CONTAINER_LOG)
}
fun findBuildLog(dir: File): File? {
@@ -39,6 +40,7 @@ data class BuildLogFinder(
val matchedName = when {
isJsEnabled && JS_LOG in files -> JS_LOG
isGradleEnabled && GRADLE_LOG in files -> GRADLE_LOG
isJsEnabled && JS_JPS_LOG in files -> JS_JPS_LOG
isDataContainerBuildLogEnabled && DATA_CONTAINER_LOG in files -> DATA_CONTAINER_LOG
SIMPLE_LOG in files -> SIMPLE_LOG
else -> null

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

@@ -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();
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,39 +1,20 @@
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-M1-eap-77", projectExtId = "Kotlin_13M1_Compiler", 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))
val mirrorRepo: String? = findProperty("maven.repository.mirror")?.toString()
val repos = listOfNotNull(
mirrorRepo,
bootstrapKotlinRepo,
"https://jcenter.bintray.com/",
"https://plugins.gradle.org/m2",
"http://dl.bintray.com/kotlin/kotlinx",
"https://repo.gradle.org/gradle/ext-releases-local", // for native-platform
"https://jetbrains.bintray.com/intellij-third-party-dependencies", // for jflex
"https://dl.bintray.com/jetbrains/markdown" // for org.jetbrains:markdown
)
extra["repos"] = repos
repositories {
for (repo in repos) {
maven(url = repo)
}
repositories.withRedirector(project) {
bootstrapKotlinRepo?.let(::maven)
maven("https://plugins.gradle.org/m2")
}
// a workaround for kotlin compiler classpath in kotlin project: sometimes gradle substitutes
@@ -42,11 +23,17 @@ buildscript {
val bootstrapCompilerClasspath by configurations.creating
dependencies {
bootstrapCompilerClasspath(kotlinDep("compiler-embeddable", bootstrapKotlinVersion))
bootstrapCompilerClasspath(kotlin("compiler-embeddable", bootstrapKotlinVersion))
classpath("com.gradle.publish:plugin-publish-plugin:0.9.7")
classpath(kotlinDep("gradle-plugin", bootstrapKotlinVersion))
classpath("net.sf.proguard:proguard-gradle:5.3.3")
classpath(kotlin("gradle-plugin", bootstrapKotlinVersion))
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")
}
}
}
@@ -54,6 +41,7 @@ plugins {
`build-scan`
idea
id("jps-compatible")
id("org.jetbrains.gradle.plugin.idea-ext")
}
pill {
@@ -90,21 +78,7 @@ allprojects {
extra["kotlin_root"] = rootDir
val bootstrapCompileCfg = configurations.create("bootstrapCompile")
repositories {
for (repo in (rootProject.extra["repos"] as List<String>)) {
maven(url = repo)
}
}
val cidrKotlinPlugin by configurations.creating
dependencies {
bootstrapCompileCfg(kotlinDep("compiler-embeddable", bootstrapKotlinVersion))
cidrKotlinPlugin(project(":prepare:cidr-plugin", "runtimeJar"))
}
val jpsBootstrap by configurations.creating
val commonBuildDir = File(rootDir, "build")
val distDir by extra("$rootDir/dist")
@@ -113,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)
@@ -125,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"
@@ -148,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"
@@ -157,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.1"
}
val isTeamcityBuild = project.hasProperty("teamcity") || System.getenv("TEAMCITY_VERSION") != null
val intellijUltimateEnabled = project.getBooleanProperty("intellijUltimateEnabled") ?: isTeamcityBuild
@@ -169,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",
@@ -180,17 +182,6 @@ extra["IntellijCoreDependencies"] =
"streamex",
"trove4j")
extra["nativePlatformVariants"] =
listOf("windows-amd64",
"windows-i386",
"osx-amd64",
"osx-i386",
"linux-amd64",
"linux-i386",
"freebsd-amd64-libcpp",
"freebsd-amd64-libstdcpp",
"freebsd-i386-libcpp",
"freebsd-i386-libstdcpp")
extra["compilerModules"] = arrayOf(
":compiler:util",
@@ -199,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",
@@ -227,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",
@@ -281,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
@@ -295,19 +303,27 @@ allprojects {
// therefore it is disabled by default
// buildDir = File(commonBuildDir, project.name)
val repos = rootProject.extra["repos"] as List<String>
repositories {
intellijSdkRepo(project)
androidDxJarRepo(project)
val mirrorRepo: String? = findProperty("maven.repository.mirror")?.toString()
for (repo in repos) {
maven(repo)
}
repositories {
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") }, "-XXLanguage:-ReleaseCoroutines")
val commonCompilerArgs = listOfNotNull(
"-Xallow-kotlin-package",
"-Xread-deserialized-contracts",
"-Xjvm-default=compatibility",
"-Xprogressive".takeIf { hasProperty("test.progressive.mode") } // TODO: change to "-progressive" after bootstrap
)
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
kotlinOptions {
@@ -331,10 +347,6 @@ allprojects {
enabled = false
}
task<Jar>("javadocJar") {
classifier = "javadoc"
}
tasks.withType<Jar> {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
@@ -346,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
@@ -369,22 +381,32 @@ allprojects {
dependencies.add(it.name, files(bootstrapCompilerClasspath))
}
}
if (cacheRedirectorEnabled()) {
logger.info("Redirecting repositories for $displayName")
repositories.redirect()
}
}
}
if (!isTeamcityBuild) {
gradle.taskGraph.whenReady {
for (project in allprojects) {
for (task in project.tasks) {
when (task) {
is AbstractKotlinCompile<*> -> task.incremental = true
is JavaCompile -> task.options.isIncremental = true
is org.gradle.jvm.tasks.Jar -> task.entryCompression = ZipEntryCompression.STORED
}
gradle.taskGraph.whenReady {
if (isTeamcityBuild) {
logger.warn("CI build profile is active (IC is off, proguard is on). Use -Pteamcity=false to reproduce local build")
for (task in allTasks) {
when (task) {
is AbstractKotlinCompile<*> -> task.incremental = false
is JavaCompile -> task.options.isIncremental = false
}
}
} else {
logger.warn("Local build profile is active (IC is on, proguard is off). Use -Pteamcity=true to reproduce TC build")
for (task in allTasks) {
when (task) {
// todo: remove when Gradle 4.10+ is used (Java IC on by default)
is JavaCompile -> task.options.isIncremental = true
is org.gradle.jvm.tasks.Jar -> task.entryCompression = ZipEntryCompression.STORED
}
}
}
}
@@ -405,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",
@@ -436,96 +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")
}
"androidCodegenTest" {
create("specTest") {
dependsOn("dist")
dependsOn(":compiler:tests-spec:test")
}
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",
@@ -533,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",
@@ -548,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() {
@@ -581,6 +632,8 @@ val zipTestData by task<Zip> {
from("compiler/testData") { into("compiler") }
from("idea/testData") { into("ide") }
from("idea/idea-completion/testData") { into("ide/completion") }
from("libraries/stdlib/common/test") { into("stdlib/common") }
from("libraries/stdlib/test") { into("stdlib/test") }
doLast {
logger.lifecycle("Test data packed to $archivePath")
}
@@ -610,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(
@@ -659,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> {
@@ -681,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,37 +59,49 @@ 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)
val verifyDependencyOutput by extra( getBooleanProperty("kotlin.build.dependency.output.verification") ?: isTeamcityBuild)
extra["intellijReleaseType"] = if (extra["versions.intellijSdk"]?.toString()?.endsWith("SNAPSHOT") == true)
"snapshots"
else
"releases"
extra["intellijRepo"] = "https://www.jetbrains.com/intellij-repository"
extra["intellijReleaseType"] = "releases" // or "snapshots"
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 {
@@ -91,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

@@ -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,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

@@ -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,287 +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") }
ivy {
artifactPattern("https://raw.github.com/JetBrains/intellij-community/[revision]/lib/src/[artifact].zip")
metadataSources {
artifact()
}
}
}
val intellij by configurations.creating
val intellijUltimate by configurations.creating
val sources by configurations.creating
val `asm-shaded-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")
if (platformBaseVersion == "182") {
// There is no asm sources for 182 yet
`asm-shaded-sources`("asmsources:asm-src:181@zip")
} else {
`asm-shaded-sources`("asmsources:asm-src:$platformBaseVersion@zip")
}
`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 copyAsmShadedSources by tasks.creating(Copy::class.java) {
from(`asm-shaded-sources`)
rename(".zip", ".jar")
destinationDir = File(repoDir, `asm-shaded-sources`.name)
}
val copyIntellijSdkSources by tasks.creating(ShadowJar::class.java) {
from(copyAsmShadedSources)
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, copyAsmShadedSources)
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`, `asm-shaded-sources`)
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,298 +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()
}
}
ivy {
artifactPattern("https://dl.bintray.com/kotlin/as/[artifact]-[revision].zip")
credentials {
username = System.getenv("AS_BINTRAY_USER_NAME")
password = System.getenv("AS_BINTRAY_API_KEY")
}
metadataSources {
artifact()
}
}
}
maven { setUrl("$intellijRepo/$intellijReleaseType") }
maven { setUrl("https://plugins.jetbrains.com/maven") }
// github returns broken pipe =(
// ivy {
// artifactPattern("https://raw.github.com/JetBrains/intellij-community/[revision]/lib/src/[artifact].zip")
// metadataSources {
// artifact()
// }
// }
}
val intellij by configurations.creating
val intellijUltimate by configurations.creating
val sources by configurations.creating
val `asm-shaded-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")
// if (platformBaseVersion == "182") {
// // There is no asm sources for 182 yet
// `asm-shaded-sources`("asmsources:asm-src:181@zip")
// } else {
// `asm-shaded-sources`("asmsources:asm-src:$platformBaseVersion@zip")
// }
`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 = 2 // 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 copyAsmShadedSources by tasks.creating(Copy::class.java) {
// from(`asm-shaded-sources`)
// rename(".zip", ".jar")
// destinationDir = File(repoDir, `asm-shaded-sources`.name)
//}
val copyIntellijSdkSources by tasks.creating(ShadowJar::class.java) {
// from(copyAsmShadedSources)
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/*, copyAsmShadedSources */)
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`, `asm-shaded-sources`)
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

@@ -15,11 +15,12 @@ fun Project.kotlinBootstrapFrom(defaultSource: BootstrapOption) {
val customVersion = project.findProperty("bootstrap.kotlin.version") as String?
val customRepo = project.findProperty("bootstrap.kotlin.repo") as String?
val teamCityVersion = project.findProperty("bootstrap.teamcity.kotlin.version") as String?
val teamCityBuild = project.findProperty("bootstrap.teamcity.build.number") as String?
val teamCityProject = project.findProperty("bootstrap.teamcity.project") as String?
val bootstrapSource = when {
project.hasProperty("bootstrap.local") -> BootstrapOption.Local(project.findProperty("bootstrap.local.version") as String?, project.findProperty("bootstrap.local.path") as String?)
teamCityVersion != null -> BootstrapOption.TeamCity(teamCityVersion, projectExtId = teamCityProject, onlySuccessBootstrap = false)
teamCityVersion != null -> BootstrapOption.TeamCity(teamCityVersion, teamCityBuild, projectExtId = teamCityProject, onlySuccessBootstrap = false)
customVersion != null -> BootstrapOption.Custom(kotlinVersion = customVersion, repo = customRepo)
else -> defaultSource
}
@@ -47,14 +48,15 @@ sealed class BootstrapOption {
/** Get bootstrap from teamcity maven artifacts of the specified build configuration
*
* [kotlinVersion] build number and the version of maven artifacts
* [kotlinVersion] the version of maven artifacts
* [buildNumber] build number of a teamcity build, by default the same as [kotlinVersion],
* [projectExtId] extId of a teamcity build configuration, by default "Kotlin_dev_Compiler",
* [onlySuccessBootstrap] allow artifacts only from success builds of the default branch tagged with 'bootstrap' tag
*/
class TeamCity(val kotlinVersion: String, val projectExtId: String? = null, val onlySuccessBootstrap: Boolean = true) : BootstrapOption() {
class TeamCity(val kotlinVersion: String, val buildNumber: String? = null, val projectExtId: String? = null, val onlySuccessBootstrap: Boolean = true) : BootstrapOption() {
override fun applyToProject(project: Project) {
val query = if (onlySuccessBootstrap) "status:SUCCESS,tag:bootstrap,pinned:true" else "branch:default:any"
project.bootstrapKotlinRepo = "https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:${projectExtId ?: "Kotlin_dev_Compiler"}),number:$kotlinVersion,$query/artifacts/content/maven/"
project.bootstrapKotlinRepo = "https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:${projectExtId ?: "Kotlin_dev_Compiler"}),number:${buildNumber ?: kotlinVersion},$query/artifacts/content/maven/"
project.bootstrapKotlinVersion = kotlinVersion
}
}

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,66 +35,89 @@ 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
configurations.findByName("archives")?.artifacts?.removeAll {
(it as? ArchivePublishArtifact)?.archiveTask?.let { it == defaultJarTask } ?: false
defaultJarTask.actions = emptyList()
configurations.forEach { cfg ->
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 {
addArtifact(it, task, artifactRef, body)
}
}
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 {
setupPublicJar()
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
configurations.findByName("embedded")?.let { embedded ->
dependsOn(embedded)
from {
embedded.map(::zipTree)
}
}
setupPublicJar(project.the<BasePluginConvention>().archivesBaseName)
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()
@@ -120,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")
@@ -130,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")
@@ -181,26 +172,27 @@ private fun Project.runtimeJarTaskIfExists(): Task? =
fun ConfigurationContainer.getOrCreate(name: String): Configuration = findByName(name) ?: create(name)
fun Jar.setupPublicJar(classifier: String = "") {
fun Jar.setupPublicJar(baseName: String, classifier: String = "") {
val buildNumber = project.rootProject.extra["buildNumber"] as String
this.baseName = baseName
this.classifier = classifier
manifest.attributes.apply {
put("Implementation-Vendor", "JetBrains")
put("Implementation-Title", project.the<BasePluginConvention>().archivesBaseName)
put("Implementation-Version", project.rootProject.extra["buildNumber"])
put("Build-Jdk", System.getProperty("java.version"))
put("Implementation-Title", baseName)
put("Implementation-Version", buildNumber)
}
}
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,20 +75,35 @@ fun Project.ideaUltimatePreloadedDeps(vararg artifactBaseNames: String, subdir:
fun Project.kotlinDep(artifactBaseName: String, version: String): String = "org.jetbrains.kotlin:kotlin-$artifactBaseName:$version"
fun DependencyHandler.projectDist(name: String): ProjectDependency = project(name, configuration = "distJar").apply { isTransitive = false }
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())
@@ -92,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)
@@ -103,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")
}
}

Some files were not shown because too many files have changed in this diff Show More