Compare commits

...

4715 Commits

Author SHA1 Message Date
Elena Lepilkina
783851ffe0 Update Kotlin/Native version 2020-04-10 16:43:23 +03:00
Mikhail Zarechenskiy
9177b74a2e Fix delegated property resolve with intermediate ID provideDelegate
#KT-37406 Fixed
2020-04-09 15:48:10 +03:00
Toshiaki Kameyama
237bf05d17 Replace with: do not remove annotation use-site targets
(cherry picked from commit 06bd620dd6)
2020-04-09 17:45:45 +07:00
Kevin Bierhoff
6e0708fb4a only stub default constructor when compiling against .java source files
(cherry picked from commit 7448761dfd)
2020-04-08 19:28:00 +02:00
Kirill Shmakov
8652cff489 Fix tests for KT-38079
(cherry picked from commit 5460327c8d)
2020-04-08 11:16:10 +03:00
Kirill Shmakov
a0268f98ac Adapt exception line numbering for file link (KT-38079)
#KT-38079 Fixed

(cherry picked from commit 2b8b5af18b)
2020-04-08 11:16:06 +03:00
Vladimir Dolzhenko
1416564b72 Improvements in KotlinCopyPasteReferenceProcessor
reduced scope of nonBlockingRead to avoid long rerun of it
used smart pointers to keep valid elements over changes
moved back to non-modal progress

Relates to #KT-37414
#KT-37971 Fixed
#KT-37808 Fixed

(cherry picked from commit 87242b419a)
2020-04-07 18:42:31 +02:00
Ilya Matveev
2128d3dfe7 Gradle, native: Correctly clear flag when detecting parallel compilation
Issue #KT-37696 Fixed
2020-03-27 16:36:09 +07:00
Igor Yakovlev
3aaf376c73 Rename of "destruction declarations" to "destructuring declarations" in UI
Fixed #KT-37487
2020-03-26 12:33:09 +03:00
Dmitry Gridin
f6725ba880 i18n, konan: fix bundles
#KT-37483

(cherry picked from commit 3a5deaac09)
2020-03-26 10:18:02 +07:00
Vladimir Dolzhenko
e0be2044a5 Add checkCanceled on common autocompletion, hl resolve path
(cherry picked from commit 15e2afe5ab)

Relates to #KT-35135
2020-03-25 18:31:30 +01:00
Denis Zharkov
752ef6d3f3 Fix UI freezes caused by calls with a huge number overloads
While we have an overload resolution algorithm working for O(n^2),
call resolution for the single particular call may work more then just
a second.
Thus, we need to call ProgressManager.checkCanceled() with more granularity

^KT-35135 Fixed

(cherry picked from commit aac72871e7)
2020-03-25 18:30:59 +01:00
Vladimir Dolzhenko
05cbeae123 Fix incremental analysis for whitespaces
incremental analysis could ignore whitespace iff old item was whitespace

#KT-37629 Fixed

(cherry picked from commit 0073d260f8)
2020-03-25 16:15:20 +01:00
Vladimir Ilmov
b76f7ea56c (CoroutineDebugger) NPE fix in CoroutineAsyncStackTraceProvider 2020-03-25 11:14:37 +01:00
Dmitry Gridin
1566c2e219 i18n: NativeDefinitions: remove redundant bundle
#KT-37483

(cherry picked from commit 84c9929935)
2020-03-25 14:55:58 +07:00
Dmitry Gridin
cfbf8ee81a i18n: NativeDefinitions: add getter to property
#KT-37483

(cherry picked from commit afb8ff1dd5)
2020-03-25 14:55:57 +07:00
nikita.movshin
7fe66d3456 Fix changelog for 1.3.71 2020-03-23 18:05:51 +03:00
nikita.movshin
b659ad424c Fix changelog for 1.3.71 2020-03-23 15:50:11 +03:00
nikita.movshin
c4ab358aab Add changelog for 1.3.71 2020-03-23 11:49:56 +03:00
Dmitry Gridin
61a60317aa KotlinSdkType: fix i18n for 192
#KT-37632 Fixed
#KT-37483

(cherry picked from commit d84f528a47)
2020-03-20 18:20:14 +07:00
Alexander Podkhalyuzin
fc81533c16 Fixed diff with master 2020-03-20 09:50:02 +03:00
Valentin Kipyatkov
6473e35c73 Suppress suggested refactoring for unused private and local declarations
(cherry picked from commit 084276ef1f)
2020-03-20 09:45:44 +03:00
Valentin Kipyatkov
05c33660ae Do not suggest to update usages on renaming duplicated method or property
(cherry picked from commit e95d1c1224)
2020-03-20 09:45:31 +03:00
Valentin Kipyatkov
bcdb9344a6 Using new API
(cherry picked from commit 395ba7d008)
2020-03-20 09:45:16 +03:00
Valentin Kipyatkov
a5ef38ab18 Minor changes after code review
(cherry picked from commit 12bf8a44e7)
2020-03-20 09:43:54 +03:00
Valentin Kipyatkov
1c7a952ca6 Suggested Rename and Change Signature implementation for Kotlin
(cherry picked from commit b9a9000569)
2020-03-20 09:43:39 +03:00
Natalia Selezneva
703be29c0e Remove idea-gradle-tooling-api.jar from IDEA 2020
Because gradle-6.1.jar is now bundled into idea-gradle plugin

(cherry picked from commit 04c924a119)
2020-03-18 21:26:04 +03:00
Vladimir Dolzhenko
5519806a0e Run inspections after completion of general highlight pass in 201
#KT-37553 Fixed

(cherry picked from commit e1ae81e0a1)
2020-03-18 18:29:58 +01:00
Vladimir Dolzhenko
52cb5bfa36 Register Kotlin specific highlight passes via highlightingPassFactory in 193+
(cherry picked from commit 3cdcdbf6a8)
2020-03-18 18:29:38 +01:00
Vladimir Dolzhenko
5032dde2a6 Update to 201.6487-EAP-CANDIDATE-SNAPSHOT
(cherry picked from commit 2e20cdf2e6)
2020-03-18 18:28:25 +01:00
nikita.movshin
05d16cac90 Update K/N 2020-03-18 17:15:51 +03:00
Mikhail Zarechenskiy
c63f8176cb Fix project compilation against bootstrap compiler
This is needed after e3b6104489
2020-03-18 16:26:57 +03:00
Dmitry Gridin
a4438287f0 Formatter: fix continuation indent in call chain
#KT-37545 Fixed

(cherry picked from commit 7a3f6f5312)
2020-03-18 19:48:43 +07:00
Alexander Gorshenev
65956caf2e 1.3.70 to fail nicely on 1.4 klibs 2020-03-18 13:44:50 +03:00
Alexander Gorshenev
6616660456 Provide library producer compiler version in klib abi mismatch disagnostics 2020-03-18 13:44:50 +03:00
Alexander Gorshenev
deaeaa3ab3 Be prepared if in the future we extend klib abi version to a triple 2020-03-18 13:44:50 +03:00
Yan Zhulanow
33f30e2c42 Add more robust check for plugin application order (KT-37245)
Cause build to fail if the 'kotlin-kapt' plugin is applied before the
  main Kotlin plugin ('kotlin' or 'kotlin-android').
  The 'logger.error()' prints an error message, however the build
  continues.

(cherry picked from commit 897c48f97e)
2020-03-18 18:27:26 +09:00
Andrey Uskov
29e0c84996 Fix import of MPP projects in IDEA 2020.1 2020-03-18 11:35:07 +03:00
Anton Bannykh
46abf98743 JS: fix KT-37386
Anonymous object constructor parameters should not reuse JsName's
of the super class. Otherwise the temporary name renamer gets
confused.

(cherry picked from commit 63a909dee6)
2020-03-18 10:33:37 +03:00
Ilya Matveev
1c1b637cc4 Gradle, native: Forbid parallel in-process compiler execution
After enabling the in-process compiler execution, we got several
reports related to the race condition that takes place during
system properties configuring (e.g. KT-37442, KT-37444, probably
KT-37362).

The right fix here is to get rid of using system properties at all.
But it requires changes in many places of the K/N compiler and such
a patch is not safe enough to include it into a bug-fix release. So
it's decided to forbid parallel in-process compiler execution in 1.3.71

Issue #KT-37565 Fixed
2020-03-18 12:01:55 +07:00
Vladimir Dolzhenko
8a21d3d506 Don't show modal progress dialog on calculate method parameter hint info
#KT-37537 Fixed
Relates to #EA-216268

(cherry picked from commit c29f76580c)
2020-03-17 11:17:30 +01:00
Igor Yakovlev
3753bf0e20 Fix for change signature refactoring type resolve
Fixed #KT-37451
2020-03-17 12:03:58 +03:00
Dmitry Gridin
7c0f68c007 i18n: remove template name from bundle
#KT-37483

(cherry picked from commit 309ceef49a)
2020-03-17 15:38:37 +07:00
Dmitry Gridin
f12ecbccf5 Replace ConfigurationFactory with SimpleConfigurationType
#KT-36781 Fixed

(cherry picked from commit b9ffed3f04)
2020-03-16 22:11:05 +07:00
Sergey Igushkin
8ad6ace648 Filter kapt generate stubs classpath for non-existent entries (KT-37241)
Issue #KT-37241 Fixed

(cherry picked from commit a0aeb1554d)
2020-03-16 16:59:09 +03:00
Dmitry Gridin
5919fc4054 EqualsOrHashCodeInspection: update bundle for 201
#KT-37483

(cherry picked from commit 75f1fb0237)
2020-03-16 18:54:08 +07:00
Dmitry Gridin
7b06b6d233 i18n: fix findUsages for 201
#KT-37483

(cherry picked from commit c7a21a094f)
2020-03-16 18:54:00 +07:00
Dmitry Gridin
e5b208de44 i18n: fix findUsages dialogs
#KT-37483

(cherry picked from commit 49cdea7fdb)
2020-03-16 18:53:52 +07:00
Vladimir Dolzhenko
7933b06fdb Fix ExtensionTestUtil compilation for 191; CustomUsageSearcherTest compilation for 201
Relates to #KT-36657
2020-03-15 09:32:08 +01:00
Dmitry Gridin
d72913b100 i18n: update bundle for IdeErrorMessages 2020-03-13 20:23:39 +07:00
Dmitry Gridin
7fdd660ec8 i18n: update bundle for *.form 2020-03-13 20:23:39 +07:00
Dmitry Gridin
6bcc9008b3 i18n: fix tests 2020-03-13 20:23:39 +07:00
Dmitry Gridin
a9157c4657 i18n: update bundle for idea 2020-03-13 20:23:39 +07:00
Dmitry Gridin
2d1de19246 i18n: fix tests 2020-03-13 20:23:39 +07:00
Dmitry Gridin
eb7f5dc4f1 i18n: update bundle for jvm-debugger 2020-03-13 20:23:39 +07:00
Dmitry Gridin
458d8c91a3 i18n: add bundle for idea-repl 2020-03-13 20:23:39 +07:00
Dmitry Gridin
3ecdcf8436 i18n: add bundle for idea-live-templates 2020-03-13 20:23:39 +07:00
Dmitry Gridin
ad974f4c97 i18n: update bundle for idea-jvm 2020-03-13 20:23:38 +07:00
Dmitry Gridin
dfa615dc73 i18n: update bundle for idea-gradle 2020-03-13 20:23:38 +07:00
Dmitry Gridin
60566b0808 i18n: add bundle for idea-completion 2020-03-13 20:23:38 +07:00
Dmitry Gridin
0e19c05db8 i18n: update bundle for idea-analysis 2020-03-13 20:23:38 +07:00
Dmitry Gridin
392a70785a i18n: fix bundle location 2020-03-13 20:23:38 +07:00
Dmitry Gridin
1c24e4b72b i18n: add @NonNls to NodeIndentStrategy 2020-03-13 20:23:38 +07:00
Dmitry Gridin
6ab0bfebcc i18n: add bundle for idea/intentions 2020-03-13 20:23:38 +07:00
Dmitry Gridin
3b3ec92015 i18n: fix tests 2020-03-13 20:23:37 +07:00
Dmitry Gridin
6a15465e8d i18n: fix compilation 2020-03-13 20:23:37 +07:00
Dmitry Gridin
40d96812c4 i18n: fix text 2020-03-13 20:23:37 +07:00
Dmitry Gridin
7d2d6f1671 i18n: replace KotlinBundleBase with AbstractKotlinBundle 2020-03-13 20:23:37 +07:00
Dmitry Gridin
90c5b1d9b8 i18n: add bundle for idea/inspections 2020-03-13 20:23:37 +07:00
Dmitry Gridin
88c71bdb7d i18n: add bundle for idea/inspections/* 2020-03-13 20:23:37 +07:00
Dmitry Gridin
aa55353916 i18n: add bundle for idea/codeInsight 2020-03-13 20:23:37 +07:00
Dmitry Gridin
3448dd87be i18n: add bundle for idea/actions 2020-03-13 20:23:36 +07:00
Dmitry Gridin
669f801aeb i18n: add bundle for idea/quickfix 2020-03-13 20:23:36 +07:00
Dmitry Gridin
e70f1e9cc7 i18n: createByPattern: add @NonNls to parameters 2020-03-13 20:23:36 +07:00
Dmitry Gridin
66111eb9c6 i18n: KtPsiFactory: add @NonNls to parameters 2020-03-13 20:23:36 +07:00
Dmitry Gridin
8cbe8d8e63 i18n: add bundle for idea/quickfix/* 2020-03-13 20:23:36 +07:00
Dmitry Gridin
f0f252730d i18n: add bundle for idea/refactoring/ui 2020-03-13 20:23:36 +07:00
Dmitry Gridin
47133126b9 i18n: add bundle for idea/refactoring/safeDelete 2020-03-13 20:23:36 +07:00
Dmitry Gridin
16d8b66a62 i18n: fix tests 2020-03-13 20:23:36 +07:00
Roman Golyshev
5ed7937d83 i18n: move all kotlin bundles to resources/messages directories 2020-03-13 20:23:35 +07:00
Roman Golyshev
bc6d563205 i18n: fix bundle messages/testData messages where necessary 2020-03-13 20:23:35 +07:00
Roman Golyshev
e923541d07 i18n: add bundle for idea/refactoring/rename
- Modify `text.parameter` value to `Parameter`;
use `text.parameter.0` in previous usages
- Add @Nls and @NonNls annotations to few places
2020-03-13 20:23:35 +07:00
Roman Golyshev
ff192a7d81 i18n: add bundle for idea/refactoring/pushDown 2020-03-13 20:23:35 +07:00
Roman Golyshev
7be8159365 i18n: add bundle for idea/refactoring/pullUp
- Add @NonNls to used methods from `KtPsiFactory`
2020-03-13 20:23:35 +07:00
Roman Golyshev
936518d07f i18n: add bundle for idea/refactoring/move 2020-03-13 20:23:35 +07:00
Roman Golyshev
09b9c93bdf i18n: add bundle for idea/refactoring/memberInfo 2020-03-13 20:23:34 +07:00
Dmitry Gridin
4f0c3c583a i18n: fix compilation 2020-03-13 20:23:34 +07:00
Dmitry Gridin
9a010ffc33 i18n: move to KotlinBundle 2020-03-13 20:23:34 +07:00
Dmitry Gridin
bbb905b60a i18n: add bundle for idea/refactoring/introduce 2020-03-13 20:23:33 +07:00
Dmitry Gridin
87daee8641 i18n: add bundle for idea/refactoring/inline 2020-03-13 20:23:33 +07:00
Dmitry Gridin
88e5a34de0 i18n: add bundle for idea/refactoring/cutPaste 2020-03-13 20:23:33 +07:00
Dmitry Gridin
307c7962f1 i18n: add bundle for idea/refactoring/copy 2020-03-13 20:23:33 +07:00
Dmitry Gridin
a57e0c6957 i18n: add bundle for idea/refactoring/changeSignature 2020-03-13 20:23:33 +07:00
Dmitry Gridin
c9875fbb07 i18n: add @NotNls to bundles 2020-03-13 20:23:33 +07:00
Dmitry Gridin
330eeb62d2 i18n: add bundle for idea/reporter 2020-03-13 20:23:32 +07:00
Dmitry Gridin
1290e807df i18n: add bundle for idea/roots 2020-03-13 20:23:32 +07:00
Dmitry Gridin
d8f5f0a5a1 i18n: add bundle for idea/script 2020-03-13 20:23:32 +07:00
Dmitry Gridin
33876a4857 i18n: add bundle for idea/slicer 2020-03-13 20:23:32 +07:00
Dmitry Gridin
6187103cdd i18n: add bundle for idea/testIntegration 2020-03-13 20:23:32 +07:00
Dmitry Gridin
da536d816f i18n: add bundle for idea/update 2020-03-13 20:23:32 +07:00
Dmitry Gridin
b9fa42cd8a i18n: add bundle for idea/versions 2020-03-13 20:23:32 +07:00
Dmitry Gridin
c773216b68 i18n: add bundle for idea/internal 2020-03-13 20:23:32 +07:00
Dmitry Gridin
caa00c207d i18n: add bundle for idea/imports 2020-03-13 20:23:32 +07:00
Dmitry Gridin
ef459e1c47 i18n: fix bundle for idea/findUsages 2020-03-13 20:23:31 +07:00
Dmitry Gridin
f5e9c03e09 i18n: add bundle for idea/highlighter 2020-03-13 20:23:31 +07:00
Dmitry Gridin
d354fd16ae i18n: add bundle for idea/hierarchy 2020-03-13 20:23:31 +07:00
Dmitry Gridin
ef4ba70626 i18n: add bundle for idea/framework 2020-03-13 20:23:31 +07:00
Dmitry Gridin
ace06e0a86 i18n: add bundle for idea/formatter 2020-03-13 20:23:31 +07:00
Yan Zhulanow
30a886a9ae i18n: Internationalize part of the 'idea' module 2020-03-13 20:23:31 +07:00
Dmitry Gridin
b5a5d9be47 i18n: add bundle for idea/findUsages 2020-03-13 20:23:31 +07:00
Dmitry Gridin
c98735e25d i18n: add bundle for idea/filters 2020-03-13 20:23:31 +07:00
Dmitry Gridin
542073914d i18n: add bundle for idea/facet 2020-03-13 20:23:30 +07:00
Dmitry Gridin
15ceee9813 i18n: add bundle for idea/editor 2020-03-13 20:23:30 +07:00
Dmitry Gridin
9dc530d060 i18n: add bundle for idea/copy 2020-03-13 20:23:30 +07:00
Dmitry Gridin
d22610b448 i18n: fix compilation 192 2020-03-13 20:23:30 +07:00
Dmitry Gridin
d143f22405 i18n: add bundle for idea/configuration 2020-03-13 20:23:30 +07:00
Dmitry Gridin
8b5aab5b6c i18n: add bundle for j2k 2020-03-13 20:23:30 +07:00
Dmitry Gridin
5ea660ad49 i18n: fix properties in idea-gradle 2020-03-13 20:23:30 +07:00
Yan Zhulanow
3a86f7a50f i18n: Unify string naming in KotlinBundle 2020-03-13 20:23:30 +07:00
Yan Zhulanow
8838a72889 i18n: Add bundle for idea-jvm 2020-03-13 20:23:29 +07:00
Yan Zhulanow
40019a4c2b i18n: Add bundle for idea-gradle-native 2020-03-13 20:23:29 +07:00
Yan Zhulanow
c415b902ab i18n: Add bundle for idea-new-project-wizard 2020-03-13 20:23:29 +07:00
Yan Zhulanow
6aa10b4f1b i18n: Add bundle for idea-native 2020-03-13 20:23:29 +07:00
Yan Zhulanow
71a6667d5b i18n: Add bundle for idea-maven 2020-03-13 20:23:29 +07:00
Yan Zhulanow
f8c5f50f54 i18n: Add bundle for JVM debugger (evaluation) 2020-03-13 20:23:29 +07:00
Yan Zhulanow
d54cd6c3eb i18n: Add bundle for JVM debugger (coroutine) 2020-03-13 20:23:29 +07:00
Yan Zhulanow
b82870624e i18n: Add bundle for JVM debugger (core) 2020-03-13 20:23:29 +07:00
Yan Zhulanow
0f07aa3c26 i18n: Add bundle for New J2K 2020-03-13 20:23:29 +07:00
Yan Zhulanow
ef5de7cf96 i18n: Add bundle for New J2K services 2020-03-13 20:23:28 +07:00
Yan Zhulanow
f5e042dd67 i18n: Add bundle for idea-git 2020-03-13 20:23:28 +07:00
Yan Zhulanow
297598af4e i18n: Extract common caching code from bundles, J2K existing bundles 2020-03-13 20:23:28 +07:00
Yan Zhulanow
6b4bc145cd Rename .java to .kt 2020-03-13 20:23:28 +07:00
Dmitry Gridin
e7acac9db4 i18n: add bundle for idea-gradle 2020-03-13 20:23:28 +07:00
Dmitry Gridin
207ce72c42 i18n: rewrite bundles with AbstractKotlinBundle 2020-03-13 20:23:28 +07:00
Dmitry Gridin
3173881779 i18n: add bundle for idea-gradle 2020-03-13 20:23:28 +07:00
Dmitry Gridin
2892ccf168 i18n: add bundle for idea-core 2020-03-13 20:23:28 +07:00
Dmitry Gridin
9e2ebbf1af i18n: add bundle for ide-common 2020-03-13 20:23:27 +07:00
Dmitry Gridin
cc44efc1c3 i18n: add bundle for formatter 2020-03-13 20:23:27 +07:00
Dmitry Gridin
9380eb0258 i18n: introduce AbstractKotlinBundle 2020-03-13 20:23:27 +07:00
Nicolay Mitropolsky
1e691a7d23 Uast: UastFakeLightMethod hashcode fix (KT-37200)
(cherry picked from commit d1739289c6)
2020-03-13 12:00:38 +03:00
Nicolay Mitropolsky
7dc08666ed Uast: UastFakeLightMethod equality fix (KT-37200)
(cherry picked from commit 753d4b3cbd)
2020-03-13 12:00:38 +03:00
kovalp
1ea8900fc4 Do not stop searchTextOccurrences when isSearchForTextOccurrences is false
#KT-36657 Fixed

(cherry picked from commit 9ceca69154)
2020-03-13 10:00:07 +03:00
kovalp
e0bad4b4d3 Adds AdditionalExtractableAnalyser EP.
Adds annotations to ExtractableCodeDescriptor.
Adds functionality of adding annotations to KtPsiFactory.CallableBuilder

(cherry picked from commit 86f9cb6eef)
2020-03-13 09:59:50 +03:00
Dmitry Gridin
f4883f2912 UnusedUnaryOperatorInspection: shouldn't report on annotation entry
#KT-37294 Fixed

(cherry picked from commit 80caa063b3)
2020-03-12 15:58:20 +07:00
Anton Yalyshev
b9f1efe868 Disable FUS for Code Completion in 1.3.71
(cherry picked from commit b44be51b5c)
2020-03-12 10:53:41 +03:00
Mikhail Zarechenskiy
7254a72abc Filter out PSI values & valueOf methods from Java structure
These methods were recently added in Java PSI for IJ 201 and now have
 clash with the methods that we add on our side. Note that we can't
 start using methods from PSI as is because of different nullability:
 they have flexible types in their signatures while current methods
 have not-null types

 #KT-36095 Fixed
2020-03-12 10:25:30 +03:00
Leonid Startsev
5e603318b8 Do not check visibility of enum entries in explicit api mode
Although they're instances of DeclarationDescriptorWithVisibility,
they can't have visibilities

#KT-37040 Fixed

(cherry picked from commit 5d73550b48 and 01108d595c)
2020-03-11 17:13:10 +03:00
Leonid Startsev
9608f1798f Do not insert @SerializableWith marker annotation if already present
Such situation may happen if generic class is customized by user
with object-kind serializer. In such case, both arguments from
generateSerializerGetter and generateSerializerFactory are objects.
See linked issue for details:

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

(cherry picked from commit 15fa6ea757)
2020-03-11 17:12:24 +03:00
Leonid Startsev
373a1147c8 Do not check 'no ctor parameters' for serializable enums
fixes https://github.com/Kotlin/kotlinx.serialization/issues/742

Do not use serializableIrClass if it is not bound (this may happen
in case we're generating external serializer for library class)

fixes https://github.com/Kotlin/kotlinx.serialization/issues/744

(cherry picked from commit e20354926b)
2020-03-11 17:12:07 +03:00
Alexander Podkhalyuzin
9bc0dff4b9 Fixed generated text from jvm classfile, when quotes is required
#KT-34759 Fixed

(cherry picked from commit 5bb74d9840)
2020-03-11 15:55:29 +03:00
Alexander Udalov
726c66e0bf Remove unneeded workaround for IBM JDK and older intellij-core
The underlying problem (IDEA-206446) was fixed a long time ago and the
compiler is no longer affected by it.

 #KT-37286 Fixed

(cherry picked from commit 4d2ee279c0)
2020-03-11 13:25:04 +01:00
Vladimir Dolzhenko
2c5e3798b3 Make copy-paste resolve task modal to avoid invalid psi elements
Due to background formatting pasted PSI elements become invalid quite soon and it is not possible to make resolve

#KT-37414 Fixed

(cherry picked from commit 8af5e2bb04)
2020-03-11 11:59:07 +01:00
Nikolay Krasko
eb0e5e3aca 201: Update to 201.6073.9 2020-03-11 12:09:43 +03:00
Nikolay Krasko
0734da0461 201: Mute JS android tests in MultiplatformProjectImportingTest 2020-03-11 12:09:43 +03:00
Nikolay Krasko
4cfc3cfc99 201: Mute test because of NPE: element.parent must not be null (IDEA-234737) 2020-03-11 12:09:43 +03:00
Nikolay Krasko
8474b23b4f 201: Fix setup for AbstractKotlinExceptionFilterTest tests 2020-03-11 12:09:43 +03:00
Nikolay Krasko
bba8ed21bc 201: Mute SpringRenameTestGenerated tests 2020-03-11 12:09:43 +03:00
Nikolay Krasko
01ddb0be62 201: Remove declarations added for dropped newApi in hierarchy 2020-03-11 12:09:42 +03:00
Nikolay Krasko
4084c48edd 201: Update to 201.5985.32 2020-03-11 12:09:42 +03:00
Nikolay Krasko
67eea10b19 Update to 201.5259.13-EAP-SNAPSHOT
- No UIUtil.removeLeakingAppleListeners anymore
- getParameterHints nullability
- versions of lz4-java and guava were changed

(cherry picked from commit 2340a86d8d)
2020-03-11 12:09:42 +03:00
Nikolay Krasko
019ce473a5 Access to test root disposable through accessor
(cherry picked from commit 6c968859ad)
2020-03-11 12:09:42 +03:00
Nikolay Krasko
27b732e035 Refactoring: extract resetApplicationToNull to separate file
(cherry picked from commit 272ccf64ae)
2020-03-11 12:09:42 +03:00
Nikolay Krasko
34954f79aa Fixes 2020-03-11 12:09:42 +03:00
Nikolay Krasko
90a05e51e5 Remove trailing commas 2020-03-11 12:09:42 +03:00
Nikolay Krasko
01924b8d08 Disable parallel execution for gradle tests
(cherry picked from commit 208c7274dd)
2020-03-11 12:09:42 +03:00
Nikolay Krasko
889277827a Fix testUnresolvedMultiline test data
(cherry picked from commit d47fc7280b)
2020-03-11 12:09:42 +03:00
Nikolay Krasko
8f3ea372f2 201: Mute HierarchicalMultiplatformProjectImportingTest: No module dependency found
(cherry picked from commit 6a9dfd4935)
2020-03-11 12:09:41 +03:00
Nikolay Krasko
de7e77053a 201: Mute quick fix tests: Range must be inside element being annotated
(cherry picked from commit 774db02b23)
2020-03-11 12:09:41 +03:00
Nikolay Krasko
34e2208fbf 201: Mute TodoSearchTest: duplicate TODO items
(cherry picked from commit 06adac1abf)
2020-03-11 12:09:41 +03:00
Nikolay Krasko
601a647ebe 201: Mute incremental compilation tests with constants
(cherry picked from commit 543168c61d)
2020-03-11 12:09:41 +03:00
Nikolay Krasko
381e560335 201: Mute a lot of tests with enums
(cherry picked from commit 8501ea78c8)
2020-03-11 12:09:41 +03:00
Nikolay Krasko
0278cf710b 201: Mute QuickFixTestGenerate: Range must be inside element being annotated
(cherry picked from commit 79e663828a)
2020-03-11 12:09:41 +03:00
Nikolay Krasko
b1110e0e46 201: Mute GradleScriptInputsWatcherTest failures
(cherry picked from commit f5a97ea56e)
2020-03-11 12:09:41 +03:00
Nikolay Krasko
d2b2f71789 201: Upgrade nodejs plugin in 201 branch
(cherry picked from commit dad7fd383c)
2020-03-11 12:09:41 +03:00
Nikolay Krasko
ba0068578c 201: Mute NewMultiplatformProjectImportingTest tests
No module dependency found
No source folder found

(cherry picked from commit f0a4f838f2)
2020-03-11 12:09:41 +03:00
Nikolay Krasko
44ce7b6017 201: Mute MultiplatformProjectImportingTest tests
Failed search dependency in Gradle tests.

(cherry picked from commit f4cd25ce72)
2020-03-11 12:09:41 +03:00
Nikolay Krasko
a4c4c8574c 201: Mute NewJavaToKotlinConverterSingleFileTestGenerated tests
(cherry picked from commit 67dee52b8a)
2020-03-11 12:09:40 +03:00
Nikolay Krasko
0b6cce6b0b 201: Fix maven plugin loading by adding repository-search to runtime
(cherry picked from commit 958b8a0b10)
2020-03-11 12:09:40 +03:00
Nikolay Krasko
40cc9b934b 201: Fix loading project in configuration tests
De-bunch AbstractConfigureKotlinTest.kt, just don't use field in 193.

(cherry picked from commit 0fcd011abb)
2020-03-11 12:09:40 +03:00
Nikolay Krasko
769fdc2c1f 201: Trick idea home path exception with custom idea.home variable
(cherry picked from commit 1a01ba0ae5)
2020-03-11 12:09:40 +03:00
Nikolay Krasko
6bc1ab9583 Copy 192 muted tests
(cherry picked from commit da2683d180)
2020-03-11 12:09:40 +03:00
Nikolay Krasko
c76bca3483 Register JDK for default project to prevent create leaking one for Gradle import
(cherry picked from commit dd21736471)
2020-03-11 12:09:40 +03:00
Nikolay Krasko
522529eb1c Enable mute in code for all KotlinLightCodeInsightFixtureTestCaseBase
(cherry picked from commit c9fd79c311)
2020-03-11 12:09:40 +03:00
Nikolay Krasko
8c6ad6efe3 Minor: better asserts in TodoSearchTest.kt
(cherry picked from commit 1c0a9d2981)
2020-03-11 12:09:40 +03:00
Nikolay Krasko
56417b7577 Enable mute test with database in BaseKotlinJpsBuildTestCase
(cherry picked from commit 26df2a5c68)
2020-03-11 12:09:40 +03:00
Nikolay Krasko
f1eebf60d9 Ignore auto-mute files
(cherry picked from commit 31ba40cc99)
2020-03-11 12:09:39 +03:00
Nikolay Krasko
e8e8121aa1 Enable mute for KotlinCompletionTestCase
(cherry picked from commit c22272bbca)
2020-03-11 12:09:39 +03:00
Nikolay Krasko
295cc79181 Update method after UsefulTestCase update to make in work in 201
(cherry picked from commit 66e2f95dba)
2020-03-11 12:09:39 +03:00
Nikolay Krasko
d17d6386f7 Support auto-mute in parametrized JUnit 4 tests
(cherry picked from commit 3c3b1bb5e4)
2020-03-11 12:09:39 +03:00
Nikolay Krasko
a8a80d0d31 Minor: remove unneeded class
(cherry picked from commit f042b04320)
2020-03-11 12:09:39 +03:00
Nikolay Krasko
92fec04b91 Revert global project settings to LATEST_STABLE in teardown
(cherry picked from commit a46c6ce5df)
2020-03-11 12:09:39 +03:00
Nikolay Krasko
b148d0c4a1 Always configure and restore api version settings in tests
(cherry picked from commit f995192f21)
2020-03-11 12:09:39 +03:00
Nikolay Krasko
568553af3b Clean LANGUAGE_VERSION_SETTINGS after the test
(cherry picked from commit 6c83e9fb85)
2020-03-11 12:09:39 +03:00
Nikolay Krasko
bc095ef1af Clean facet if it wasn't set before test (fix tests on 201)
(cherry picked from commit 19bc39d3ab)
2020-03-11 12:09:39 +03:00
Nikolay Krasko
e214a18f8d Always clean language and api versions after usage
(cherry picked from commit af3b057ba2)
2020-03-11 12:09:38 +03:00
Nikolay Krasko
3d4b7f1936 Refactoring: extract long function out of local context
(cherry picked from commit c0dac9bf32)
2020-03-11 12:09:38 +03:00
Nikolay Krasko
d95a94a6c1 Refactoring: always use compiler settings with de-configuration in tests
(cherry picked from commit 3a5f42cc5e)
2020-03-11 12:09:38 +03:00
Nikolay Krasko
fd4b10985a De-bunch KotlinLightCodeInsightFixtureTestCase.kt
(cherry picked from commit 018215f47d)
2020-03-11 12:09:38 +03:00
nikita.movshin
352d8cabf8 Fix changelog 2020-03-07 23:51:02 +03:00
nikita.movshin
9efc495990 Update compatibility range for AS 3.6 and 4.0 2020-03-06 19:09:33 +03:00
Sergey Igushkin
59e8a4992e Internal visibility between common source sets in Gradle (KT-37264)
In KotlinCompileCommon, pass the friendPaths and refinesPaths arguments

In KotlinNativeCompilation, add both friend and refined dependencies as
friends for now.

In getVisibleSourceSetsFromAssociateCompilations, exclude the metadata
compilations to avoid incorrect results (those compilations don't have
proper kotlin

Issue #KT-37264 Fixed
2020-03-06 18:44:57 +03:00
Sergey Igushkin
671f9ebe06 Support friend internal visibility in K2Metadata compiler (KT-37264)
Add and handle the friend paths and refines paths compiler arguments;
Reuse klib dependency module descriptors in the resolver for project;

Issue #KT-37264
2020-03-06 18:44:55 +03:00
Ilya Goncharov
1db02e921a [Gradle, JS] Move logic of resolving NpmDependency to Npm Api
#KT-36196 fixed

[Gradle, JS] Support transitive mode for npm dependencies

#KT-36196 fixed

[Gradle, JS] Fix naming

#KT-36196 fixed

[Gradle, JS] Consider transitivity in cache of npm dependencies

#KT-36196 fixed

[Gradle, JS] Migrate from singletons to classes

#KT-36196 fixed
2020-03-06 16:43:02 +03:00
Vladimir Dolzhenko
4eaabf2a1a Handle properly lambda change in incremental analysis
Fixed #KT-37273

(cherry picked from commit dc6be68a41)
2020-03-06 11:47:59 +01:00
Alexander Podkhalyuzin
709195d069 Revert "Since build updated for 193 branch due incompatibility"
This reverts commit 070a6546
2020-03-06 10:29:03 +03:00
Alexander Podkhalyuzin
070a654658 Since build updated for 193 branch due incompatibility
(cherry picked from commit 135ae32f75)
2020-03-06 10:26:16 +03:00
Dmitry Petrov
58f75f0ba5 Generate compiler tests 2020-03-04 20:26:23 +03:00
Dmitry Petrov
7cb6be8b18 KT-37024 Optimized delegated property metadata generation in inline fun 2020-03-04 20:26:22 +03:00
Vladimir Dolzhenko
c99801cc04 Use LightJavaModule.getModule for 193
Fixed #KT-37229

(cherry picked from commit 0be5a82460)
2020-03-04 17:23:34 +01:00
Yan Zhulanow
f8c36eb0a0 Changelog: remove "trailing comma" feature from 1.3.70 2020-03-04 20:44:45 +09:00
Yan Zhulanow
1889376aba Remove 1.4-specific language features from 1.3.70 changelog 2020-03-04 17:17:54 +09:00
Dmitriy Novozhilov
5d9e053928 Update ChangeLog.md 2020-03-03 19:34:15 +03:00
nikita.movshin
bfb48645f3 Update K/N 2020-03-03 12:53:48 +03:00
Dmitry Gridin
facddfc77c ExperimentalFixesFactory: OptIn shouldn't be added for old version
#KT-36478

(cherry picked from commit ecb7478794)
2020-03-03 14:50:39 +07:00
Natalia Selezneva
9922e745f7 .gradle.kts: fix freezes by avoiding fs walking
^KT-36502 Fixed
2020-03-02 16:35:44 +03:00
Ilya Goncharov
0cf79f851b [Gradle, JS] Fix timeout for debug
#KT-37035 fixed

(cherry picked from commit 7719dfca4a)
2020-02-26 11:58:19 +03:00
Dmitry Gridin
0f22b3cd43 Tests: fix some tests in formatter for AS
(cherry picked from commit 50c2c38624)
2020-02-26 14:43:34 +07:00
Dmitry Gridin
ead89cb080 Formatter: fix indent after trailing comma in calls
#KT-36917 Fixed

(cherry picked from commit ca598b6465)
2020-02-26 14:37:42 +07:00
Dmitry Gridin
f5528bca0b Formatter: shouldn't format property chains
(cherry picked from commit feaa53c4f2)
2020-02-26 11:52:33 +07:00
Dmitry Savvinov
e7d1dac7f0 Remove accidentally committed dependency on kotlin-gradle-testing.xml
This dependency is not needed in 1.3.70 and actually leads to duplicate
EP registration
2020-02-25 18:53:15 +03:00
Zalim Bashorov
ffc3d7ffc6 [JS DCE] Add an ability to define overwriting strategy when copying dependencies in dev-mode
* CLI option "-Xdev-mode-overwriting-strategy"
* System Property "kotlin.js.dce.devmode.overwriting.strategy"

Possible values: "older", "all".

#KT-36349 Fixed

(cherry picked from commit 6f61ea7f67)
2020-02-21 20:47:50 +03:00
Dmitry Savvinov
1f9b772053 Disable platform-specific checkers in common 2020-02-21 14:05:48 +03:00
Dmitry Savvinov
df2b049b85 Add test on platform checks in project without that target 2020-02-21 14:05:29 +03:00
Konstantin Tskhovrebov
d6c7b7bd5d Fix class name for test suite descriptor.
Issue #KT-36725 Fixed
Issue #KT-36716 Fixed
Issue #KT-36726 Fixed
2020-02-20 18:55:35 +03:00
Vladimir Dolzhenko
e9f42c04c1 Move copy/paste resource bundles to Kotlin
#EA-224686 #KT-36877 Fixed
2020-02-20 14:16:06 +01:00
Yan Zhulanow
9f2a5898c5 Update changelog (EAP 3) 2020-02-20 16:43:01 +09:00
nikita.movshin
62a0cd3d87 Update K/N 2020-02-19 08:44:50 +03:00
Sergey Igushkin
89b75bb158 Fix KT-36804 by eagerly instantiating the Kotlin/Native tasks
This commit partially reverts 970ee4539b.

The Kotlin/Native klib compilation task configuration logic involved
adding dependencies for the compiler plugin artifacts. However, the
compiler plugins classpath, shared across all of the K/N tasks, was
tracked as the tasks' input. This made the following scenario possible:

1. Configuration of some of the Kotlin/Native tasks is avoided at the
   evaluation phase;

2. During task graph construction, one of the tasks are evaluated, and
   to determine their dependencies, Gradle resolves their inputs,
   including the compiler plugins classpath mentioned above;

3. Another K/N task is evaluated afterwards, and the configuration logic
   attempts to add a dependency into the compiler plugin classpath
   configuration, which has already been resolved in (2).
   The build fails.

Fix this by cancelling task configuration avoidance for the K/N tasks.

Issue #KT-36804 Fixed
2020-02-18 17:01:36 +03:00
Nikolay Krasko
a0d64ea859 Make 201 plugin compatible with IDEA trunk (KT-36780)
^KT-36780 Fixed
2020-02-18 15:31:41 +03:00
Abduqodiri Qurbonzoda
40e104ff12 Mark shared global vals to fix K/N worker thread crash
(cherry picked from commit 5a4ce2aa4c)
2020-02-18 12:16:43 +03:00
nikita.movshin
17e43f0c37 Update K/N 2020-02-18 09:54:21 +03:00
Dmitry Savvinov
f7c4afd00d Force-set path to exact project for MPP run configurations
Otherwise, path will be set to the root project. Given that we provide
task names in relative form rather than absolute, that will lead to
launching this task in all subprojects (e.g. task 'jvmTest'). This might
be a huge issue, because when we create run configuration for specific
test method/class, we pass test filter as well. This test filter will
execute in all projects with matched test tasks, so if some other
subproject has similarly-named test task, but doesn't have a suitable
tests for that filter, the whole build will fail.

Note that the ideal fix would involve using fully-qualified task names:
the current approach might lead to isses in advanced scenarious (e.g.
when user selects several test files from different modules -- then, we
won't be able to find one exact project path for the whole test run)

^KT-35038 Fixed
2020-02-17 20:18:17 +03:00
Natalia Selezneva
f6685b30d6 Fix requesting KotlinDslScriptModels for 191
^KT-36756 Fixed
2020-02-17 11:22:40 +03:00
Sergey Rostov
de71c7bd06 .gradle.kts: more clear tooltip for out of project scripts notification
The current text/action/help text may not be clear: action is not related to project import, and help text doesn't make it clear.

#KT-36703 Fixed

(cherry picked from commit 2677fa7472)
2020-02-17 08:46:03 +03:00
Nikolay Krasko
4fe339c7b8 201: Fix icon set in ShowFirAction.kt 2020-02-17 01:43:22 +03:00
Nikolay Krasko
2126837b37 201: Fix usage of picocontainer and openapi 2020-02-17 01:42:30 +03:00
Nikolay Krasko
15fc7dec1f Clean trailing commas in ported commits 2020-02-16 23:37:54 +03:00
Roman Golyshev
556e5662bd KT-33372 Remove renaming file reference to the contents of the file
- There is still a hack with returning null from `getLastFileReference`,
it is here to keep KT-25674 issue fixed
- Overrides of `bindToElement` are removed, they caused renames of the
file references to their contents
- Code of `KotlinFilePathReferenceContributor.kt` is refactored
- ^KT-33372 ^KT-32514 ^KT-36306 Fixed

(cherry picked from commit 3461effd47)
2020-02-16 17:25:38 +03:00
Vladimir Dolzhenko
286cacd55e Add missed create in usage of new annotation highlighting API
Relates to #KT-36712

(cherry picked from commit ba5a335e95)
2020-02-15 08:29:16 +01:00
Natalia Selezneva
35f3a66e83 Fix compilation for AS35 2020-02-14 22:09:03 +03:00
Natalia Selezneva
88f2afdc4a Fix compilation for 1.3.70 2020-02-14 22:09:03 +03:00
Natalia Selezneva
c9b9d51e03 KotlinDslScriptsModel: pass provider mode properly 2020-02-14 22:09:01 +03:00
Natalia Selezneva
478db14ae6 KotlinDslScriptsModel: do not add prepare task for each gradle task invocation
^KT-36090 Fixed
2020-02-14 22:09:01 +03:00
Natalia Selezneva
8ef1b43f8d KotlinDslScriptsModel: pass correlationId during the request
^KT-36200 Fixed
2020-02-14 22:09:00 +03:00
Nikolay Krasko
8e04fafcc9 Remove trailing comma in 1.3.70 2020-02-14 21:21:32 +03:00
Nikolay Krasko
5edbed9ce7 201: Restrict 193 and own plugin for 201
(cherry picked from commit b75d0eb1a1)
2020-02-14 21:21:32 +03:00
Nikolay Krasko
002fa48b5a 201: Additional method getOwnReferences is introduced (bunched)
(cherry picked from commit a983b0bf74)
2020-02-14 21:21:32 +03:00
Nikolay Krasko
df02fb2628 201: Notification group was rewritten to Kotlin (no sam conversion)
(cherry picked from commit c9d97ae555)
2020-02-14 21:21:32 +03:00
Nikolay Krasko
5df8f4b961 201: ExecutionManager.contentManager was rewritten to Kotlin (bunched)
(cherry picked from commit 034243b5e7)
2020-02-14 21:21:31 +03:00
Nikolay Krasko
b7c35148d5 201: Processor<in PsiMethod> used in PsiShortNamesCache
(cherry picked from commit 1cb56ee946)
2020-02-14 21:21:31 +03:00
Nikolay Krasko
8f176d1035 201: Processors changed for UsageInfo and SliceUsage
(cherry picked from commit 9f6f8088e3)
2020-02-14 21:21:31 +03:00
Nikolay Krasko
f16d27c0d9 201: New DynamicBundle.LanguageBundleEP.EP_NAME needed for Java
https://github.com/JetBrains/intellij-community/commits/master/platform/core-api/src/com/intellij/DynamicBundle.java
(cherry picked from commit e23f3b54c6)
2020-02-14 21:21:31 +03:00
Nikolay Krasko
d9de37715e 201: Return JavaCoreApplicationEnvironment subclassing (bunched)
(cherry picked from commit 51244d7b1d)
2020-02-14 21:21:30 +03:00
Nikolay Krasko
3b59638d1c 201: Update version to 201.4515.24-EAP-SNAPSHOT
(cherry picked from commit cfd92f252a)
2020-02-14 21:21:30 +03:00
Nikolay Krasko
10c5cbaf2d 201: uast-tests.jar new dependency (depend on whole idea in tests)
(cherry picked from commit 314474c33b)
2020-02-14 21:21:30 +03:00
Nikolay Krasko
b874a194f1 201: Change of ProblemDescriptorBase.getFixes() return type
15a39d5742
(cherry picked from commit 7a89bd9c90)
2020-02-14 21:21:30 +03:00
Nikolay Krasko
e8d275b14a 201: Raw Class -> Class<?> (bunched)
f8b7e8b0b5
(cherry picked from commit 8cb4a8f5c6)
2020-02-14 21:21:30 +03:00
Nikolay Krasko
86e8d91728 201: PsiElementVisitor.visitElement nullability
(cherry picked from commit 890109beb8)
2020-02-14 21:21:29 +03:00
Nikolay Krasko
5ac0a620ab 201: BinaryFileStubBuilders.EP_NAME dropped (bunched)
(cherry picked from commit 98c6efaed9)
2020-02-14 21:21:29 +03:00
Nikolay Krasko
8c10c0268a 201: ProjectManagerEx.forceCloseProject(project, true) - no second parameter
(cherry picked from commit 2cc4d878a8)
2020-02-14 21:21:29 +03:00
Nikolay Krasko
6599094843 201: MadTestingUtil.enableAllInspections second parameter was removed
(cherry picked from commit 41ca51cb9e)
2020-02-14 21:21:29 +03:00
Nikolay Krasko
de5837acef 201: IdeaTestApplication -> TestApplicationManager in tests
(cherry picked from commit ae1cfff5d2)
2020-02-14 21:21:29 +03:00
Nikolay Krasko
49d7266e45 201: ExternalProjectsManagerImpl.disableProjectWatcherAutoUpdate removed (bunched)
(cherry picked from commit 3eb4d46c3d)
2020-02-14 21:21:28 +03:00
Nikolay Krasko
ffe2eb13f8 201: No PlatformTestCase.myProjectManager anymore (bunched)
(cherry picked from commit 10ce3c58e1)
2020-02-14 21:21:28 +03:00
Nikolay Krasko
832acaf366 201: TemplateManagerImpl.setTemplateTesting() parameter removed
(cherry picked from commit 75f05d8329)
2020-02-14 21:21:28 +03:00
Nikolay Krasko
04bf9d739b 201: Can't instantiate subclass of Task anymore
(cherry picked from commit b17a28381b)
2020-02-14 21:21:28 +03:00
Nikolay Krasko
bbe5c3df24 201: LookupImpl.focusedDegree renamed
(cherry picked from commit 54b1c512c5)
2020-02-14 21:21:27 +03:00
Nikolay Krasko
f02b1d7086 201: "testFramework" and "testFramework.core" libs introduced
(cherry picked from commit 56d960c65b)
2020-02-14 21:21:27 +03:00
Nikolay Krasko
ead0b45443 201: TextEditorWithPreview.java update - no ApiStatus (bunched)
Class should be removed

(cherry picked from commit 641fa1f17c)
2020-02-14 21:21:27 +03:00
Nikolay Krasko
6de44dfa56 201: AbstractProjectResolverExtension.createModule returns nullable
(cherry picked from commit 10aef79434)
2020-02-14 21:21:27 +03:00
Nikolay Krasko
48e904a3c5 201: Tool windows - source incompatible change with Kotlin (bunched)
(cherry picked from commit 066d77f396)
2020-02-14 21:21:27 +03:00
Nikolay Krasko
53e026505c 201: AbstractTreeNode generified in ide.projectView package (bunched)
(cherry picked from commit 4afd7c553b)
2020-02-14 21:21:26 +03:00
Nikolay Krasko
353c525657 201: TreeStructureProvider api changed: AbstractTreeNode<Any -> *>
(cherry picked from commit b425bf9a1b)
2020-02-14 21:21:26 +03:00
Nikolay Krasko
f8b7e76a3b 201: MoveDestination.analyzeModuleConflicts variance in parameter changed
(cherry picked from commit 9261f69dc8)
2020-02-14 21:21:26 +03:00
Nikolay Krasko
f3eebc9aad 201: Print type explicitly as RefactoringBundle.message() not null
(cherry picked from commit 7ea52ebb45)
2020-02-14 21:21:26 +03:00
Nikolay Krasko
b871555b72 201: MoveMultipleElementsViewDescriptor constructor nullability
(cherry picked from commit 4bc10f4c4f)
2020-02-14 21:21:26 +03:00
Nikolay Krasko
ada42cf5d6 201: AbstractNavBarModelExtension.adjustElement nullability (bunched)
(cherry picked from commit 2c72f53937)
2020-02-14 21:21:25 +03:00
Nikolay Krasko
e0c0b91750 201: Update hierarchy to new API (fix bugs introduced by the platform)
193 plugins with old API are affected while being binary compatible.

(cherry picked from commit 78385d5f63)
2020-02-14 21:21:25 +03:00
Nikolay Krasko
766046591b 201: Convert KotlinHierarchyViewTestBase.java because of typealiases
(cherry picked from commit 5e58a66c58)
2020-02-14 21:21:25 +03:00
Nikolay Krasko
08e72ec0d2 201: Rename .java to .kt
(cherry picked from commit 6bd91ec5b0)
2020-02-14 21:21:25 +03:00
Nikolay Krasko
580f0df4a2 201: Convert AbstractHierarchyTest.java because of typealiases
(cherry picked from commit 27467e4db7)
2020-02-14 21:21:25 +03:00
Nikolay Krasko
68cd7922b3 201: Rename .java to .kt
(cherry picked from commit 9f6f6838b8)
2020-02-14 21:21:24 +03:00
Nikolay Krasko
fcf9dd51c8 201: J2K manual
(cherry picked from commit 579dd8f8fe)
2020-02-14 21:21:24 +03:00
Nikolay Krasko
8a49941717 201: Convert KotlinCallHierarchyBrowser and KotlinCallHierarchyBrowser
Need convert to use Kotlin typealias feature.

(cherry picked from commit b92a228fb3)
2020-02-14 21:21:24 +03:00
Nikolay Krasko
2e8d948c88 201: Rename .java to .kt
(cherry picked from commit b795b38794)
2020-02-14 21:21:24 +03:00
Nikolay Krasko
0a46a9a6f9 201: RefactoringHelper.prepareOperation nullability (bunched)
(cherry picked from commit 866c33fbde)
2020-02-14 21:21:23 +03:00
Nikolay Krasko
07ad659769 201: No BinaryFileStubBuilders.EP_NAME anymore (bunched)
(cherry picked from commit 5440a5e228)
2020-02-14 21:21:23 +03:00
Nikolay Krasko
1500631dcf 201: CoreApplicationEnvironment.registerExtensionPointAndExtensions accepts Path
(cherry picked from commit beb70526a2)
2020-02-14 21:21:23 +03:00
Nikolay Krasko
00b6976e7f 201: PsiShortNamesCache.getAllClassNames(HashSet<String>) removed
(cherry picked from commit cf78058cc2)
2020-02-14 21:21:23 +03:00
Nikolay Krasko
457153f0b9 201: ContainerUtil.newTroveSet<T>() removed
(cherry picked from commit 4668518b2f)
2020-02-14 21:21:23 +03:00
Nikolay Krasko
7faf442b39 201: Remove JpsPersistentHashMap (bunched)
(cherry picked from commit 9d3d59fccb)
2020-02-14 21:21:22 +03:00
Nikolay Krasko
295091deb0 201: Processor<String> -> Processor<in String> in PsiShortNamesCache
(cherry picked from commit 1ecd1a293d)
2020-02-14 21:21:22 +03:00
Nikolay Krasko
8b0ae3a8d5 201: picocontainer.jar is removed
(cherry picked from commit 2a71fe97cf)
2020-02-14 21:21:22 +03:00
Nikolay Krasko
e91eb5dea4 201: versions.jar.streamex and versions.jar.gson versions
(cherry picked from commit 354d7306dd)
2020-02-14 21:21:22 +03:00
Nikolay Krasko
a3eed22f90 201: openapi.jar is removed
(cherry picked from commit 162c2f3dc9)
2020-02-14 21:21:22 +03:00
Nikolay Krasko
558898d1c1 201: Introduce 201 platform
(cherry picked from commit c26e1e9c1a)
2020-02-14 21:21:21 +03:00
Nikolay Krasko
4ca62a9baa 201: Create bunch
(cherry picked from commit 0f4fadf104)
2020-02-14 21:21:21 +03:00
Vladimir Dolzhenko
204e564ae6 Use new annotation highlighting API
Fixed #KT-36712

(cherry picked from commit 2e597a3a32)
2020-02-14 15:58:45 +01:00
Igor Yakovlev
dbbc5211f4 Disable facade fake classes with registry key
Fix #KT-35122 #EA-218642 #EA-217640
2020-02-14 17:40:58 +03:00
Shagen Ogandzhanian
01d88b27e1 Update dukat dependency to 0.0.28
(cherry picked from commit 3fcdf6c78c)
2020-02-14 15:16:16 +01:00
Ilya Goncharov
bdfedea231 [Gradle, JS] Migrate on strings
(cherry picked from commit 64f13ab3ae)

#KT-36714 fixed
2020-02-14 16:53:22 +03:00
Ilya Goncharov
801d697e57 [Gradle, JS] Add all possible values of library target as enums
(cherry picked from commit 9b462b76d4)
2020-02-14 16:53:00 +03:00
Ilya Goncharov
ad6c84f649 [Gradle, JS] Add webpack output
(cherry picked from commit fbabbfab44)
2020-02-14 16:52:58 +03:00
Natalia Selezneva
3137add817 GradleScriptInputsWatcher: move long running operation out of EDT
^KT-36502

(cherry picked from commit dc77df1083)
2020-02-14 16:32:26 +03:00
Leonid Startsev
a2f7cf1644 Remove special casing for Unit in kotlinx.serialization
Unignore test since it is in muted list and auto-generated

(cherry picked from commit bdf1441c80)
2020-02-14 15:33:27 +03:00
Mikhail Zarechenskiy
b7231d9b58 Enable new inference in IDE by default 2020-02-14 15:24:03 +03:00
Yan Zhulanow
c418b47a5e Minor: Update generated tests for KT-34569
(cherry picked from commit 36a6eedd9c)
2020-02-14 21:22:32 +09:00
Ivan Gavrilovic
80452f779f KT-35472: Detect when content of annotation processor changes
Even if annotation processor classpath is the same, in case
individual entries change (e.g. bulding annotationo processor
from source), KATP should run non-incrementally.

Test: KaptIncrementalWithIsolatingApt.testUnchangedAnnotationProcessorClasspathButContentChanged
2020-02-14 21:22:32 +09:00
Ivan Gavrilovic
3b45d80f5c KT-36113: Make KAPT classpath snapshot deterministic
When snapshotting a classpath entry, sort information about types
so there is no dependency on the order of entries in jar.

Test: ClasspathAnalyzerTest
2020-02-14 21:22:32 +09:00
Sergey Igushkin
95ec589834 Add a non-public-API mechanism to import free args for MPP source sets
Arguments can be set using a project extra property following the
pattern: `kotlin.mpp.freeCompilerArgsForSourceSet.$sourceSetName`.

Only a compilation's default source set free args are appended to the
compiler args during Gradle builds.

(cherry picked from commit 764bf1cb32)
2020-02-14 14:17:05 +03:00
Sergey Igushkin
11a46c8795 Fix API version parsing: add 1.4 to available values
In Kotlin 1.3, we didn't allow setting language version to 1.4. With
the default language version changed to 1.4, it worked because the
language version had only been checked in the setter of the language
settings, and the default value had not been checked.

(cherry picked from commit a8aa334203)
2020-02-14 14:17:02 +03:00
Sergey Igushkin
4edcf801a1 Fix MPP Gradle tests
* Use `maven { setUrl(...) }` in Groovy DSL
* Configure compilation tasks beforehand
  in testMppBuildWithCompilerPlugins
* Prevent `gradleSettingsScript()` from failing
  when no settings script is found

(cherry picked from commit cd32cef2b6)
2020-02-14 14:16:59 +03:00
Sergey Igushkin
34eb27ab9a Enable KlibBasedMppIT by default and on all host (using Linux targets)
(cherry picked from commit 77f60d6d6c)
2020-02-14 14:16:56 +03:00
Sergey Igushkin
16049dfe69 Compile common code to klib whenever HMPP is enabled
As the HMPP with *.kotlin_metadata was never widespread, we can
immediately move to *.klib compilations whenever a build author
enables HMPP.

(cherry picked from commit 5cc8dfb2a3)
2020-02-14 14:16:54 +03:00
Sergey Igushkin
a265f29532 Rework legacy metadata variant in MPP with source sets metadata
* Make publishing the compatibility variant optional, and don't publish
  the compatibility variant by default -- the library maintainer should
  do this explicitly
* To build the compatibility artifact, compile the commonMain source
  set using a separate compilation (the default `main` compilation,
  while creating a separate `commonMain` compilation; this separation
  is needed to be able to still compile *.kotlin_metadata from
  commonMain even when compiling *.klib from all source sets)
* When the compatibility variant is disabled, clear the dependencies of
  the `main` compilation and disable its Kotlin compilation task
* When the compatibility variant is enabled, exposed it for project
  dependencies resolution as well, so that its artifact can be used by
  the dependent project instead of the granular metadata artifact that
  will contain *.klib (which can't be read by the legacy compiler)
* Refactor the configuration of the metadata compilation dependencies:
  concentrate all the logic in one place and make it process the source
  sets graph lazily.

(cherry picked from commit 0ef8d23f57)
2020-02-14 14:16:52 +03:00
Sergey Igushkin
9d0db2f8eb Export implementation dependencies of Native-shared source sets as API
As the Kotlin/Native compiler always requires transitive dependencies
to be present among the libraries during compilation, it is necessary
to export the implementation dependencies of Native-shared source sets
as if they were API dependencies.

To do that, add the extendsFrom-relationship between the apiElements
configuration of the metadata target (so that Gradle adds the
dependencies to the transitive dependencies graph) and also add the
dependencies to the project structure metadata (so that the consumer
can find out that it's only their corresponding Native-shared source
sets that need these particular transitive dependencies)

(cherry picked from commit 8a08fef2b3)
2020-02-14 14:15:05 +03:00
Sergey Igushkin
12302390ab Use the project name + compilation name for secondary klib compilations
This helps avoid duplicate library names when compiling shared-Native
source sets (the resulting klibs will have a more unique name than just
the source set name which likely repeats between projects)

(cherry picked from commit 81216ceb51)
2020-02-14 14:15:03 +03:00
Abduqodiri Qurbonzoda
db3602d1b1 Scan functions for Sequences and Iterable #KT-7657
(cherry picked from commit ed7b8e9b85)
2020-02-13 21:36:59 +03:00
Ilya Kirillov
4b864e0168 Show experimental features panel only for non-stable plugin versions
Also, use registry as backend for features settings

(cherry picked from commit 531a63bd19)
2020-02-13 15:27:41 +03:00
Vladimir Dolzhenko
453dc53b1d Avoid using quite new ScratchFileService API
Relates to #KT-35918

(cherry picked from commit 918895b88f)
2020-02-13 12:22:30 +01:00
Ilya Kirillov
ab154aa097 Fix compilation for 191 & as35
(cherry picked from commit 40f907ec2f)
2020-02-11 23:53:35 +03:00
Vladimir Dolzhenko
e8575551cb Enforce analysis inside top-level property initializer
Relates to #KT-36460

(cherry picked from commit a0ed2c8640)
2020-02-11 17:00:24 +01:00
Ilya Kirillov
d1c052ae62 Do not render redundant Nullable annotations when generating declarations
#KT-36321 fixed

(cherry picked from commit 0fe5694cb7)
2020-02-11 14:55:24 +03:00
Ilya Kirillov
be9fe86352 Rename by-name parameter usage in function calls when renaming function's parameter
#KT-32999 fixed

(cherry picked from commit 4df8744b34)
2020-02-11 14:55:22 +03:00
Vladimir Dolzhenko
3a23083a92 Use PluginManagerCore instead of PluginManager
Relates to #KT-35918
2020-02-10 20:45:38 +01:00
Vladimir Dolzhenko
a1595675f9 Fixed MoveJavaInnerClassKotlinUsagesHandler after obsolete API drop off
Relates to #KT-35918

(cherry picked from commit b451c25dba)
2020-02-09 20:52:36 +01:00
Vladimir Dolzhenko
641bd35705 Added missed runReadAction to access psi on bg thread
Relates to #KT-24122

(cherry picked from commit 5b48f63bb9)
2020-02-08 15:08:38 +01:00
Vladimir Dolzhenko
f08804a3e5 Fix documentListener leakage in PluginStartupActivity
drop trailing comma
Fix 191, 192 compatibility

Relates to #KT-35918
2020-02-07 22:24:58 +01:00
Vladimir Dolzhenko
1f21c9a712 Cleaned IDEA 193 and below obsolete API
Fixed #KT-35918
2020-02-07 11:10:12 +01:00
Abduqodiri Qurbonzoda
c55ed7ac5f Update number of reachable nodes because of MutableList.removeFirst/Last
(cherry picked from commit b06645d1c0)
2020-02-06 21:28:16 +03:00
Natalia Selezneva
053af9a875 Tests: fix gradle tests for script configuration loading
Introduce `testAffectedGradleProjectFiles` property
to avoid full gradle project import in some tests

(cherry picked from commit e33a81a968)
2020-02-06 10:15:07 +03:00
Natalia Selezneva
5c5966730f Idea compatibility: remove usages of deprecated icons in Call Hierarchy
This also should fix the problem with overlay of icon and text in tree view
2020-02-06 10:15:07 +03:00
Natalia Selezneva
37f54f181e Idea compatibility: remove usages of deprecated icons in REPL, use similar ones 2020-02-06 10:15:07 +03:00
Ilya Matveev
1bfac9fde2 Fix data race in zip FileSystem reference counting
Issue #KT-36076 Fixed

(cherry picked from commit 0725a336fc)
2020-02-05 17:54:07 +07:00
Vladimir Dolzhenko
48429d9fe2 Fix 192 compilation for move remove redundant imports to bg thread
Relates to #KT-24122

(cherry picked from commit 6489b56fb0)
2020-02-04 18:41:22 +01:00
Vladimir Dolzhenko
bae024ed87 Move remove redundant imports to bg thread
#KT-24122 Fixed

(cherry picked from commit dd0613bc7a)
2020-02-04 16:46:59 +01:00
Ilya Goncharov
65e3655e62 [Gradle, JS] Fix test 2020-02-04 16:18:23 +03:00
Ilya Goncharov
3ab0a0d627 [Gradle, JS] Distribution and distributeResources
(cherry picked from commit 60da37404e)
2020-02-04 14:49:15 +03:00
Ilya Goncharov
c0857f79b1 [Gradle, JS] Fix Task Configuration Avoidance
(cherry picked from commit ca150005a8)
2020-02-04 14:48:50 +03:00
Ilya Goncharov
0f8d4ed143 [Gradle, JS] Distribution task depends on processResources
(cherry picked from commit a2b774b186)
2020-02-04 14:48:48 +03:00
Ilya Kirillov
0b97edbca5 Wizard: do not show disable/enable checkbox for new project wizard in AS
#KT-36195 fixed

(cherry picked from commit ed5156ee83)
2020-02-04 14:22:58 +03:00
Ilya Kirillov
8d14259225 Fix change signature refactoring
Do not increase modification count for OutOfCodeBlockTracker when KtTypeCodeFragment is modified

KtTypeCodeFragment is used in UI for providing completion for types.
When OutOfCodeBlockModification happens it invalidates ModuleDescriptors
But change signature relies on them which causes InvalidModuleException

#KT-35903 fixed
#KT-35689 fixed
#KT-34415 fixed
#KT-34415 fixed
2020-02-04 14:08:42 +03:00
Nicolay Mitropolsky
5d6c0c1d72 Uast: fix for Lambda in place call identifiers (KT-35432)
(cherry picked from commit 222ceb7698)
2020-02-04 11:19:35 +03:00
Nicolay Mitropolsky
7cfe41a913 Uast: fixes for Enum identifiers (KT-35432)
(cherry picked from commit ac3a8eb494)
2020-02-04 11:19:35 +03:00
Mikhail Zarechenskiy
53fb90f3d9 [NI] Record substituted generic signature for SAM arguments
#KT-36297 Fixed
2020-02-04 11:05:38 +03:00
Mark Punzalan
12d527bf5c ForLoopsLowering: Fix issue with break/continue in loop over withIndex.
(cherry picked from commit 3ee344b836)
2020-02-04 08:56:48 +01:00
Mikhail Zarechenskiy
28b69d0b3a Regenerate compiler tests 2020-02-04 10:32:08 +03:00
Mikhail Zarechenskiy
db8e045172 Update test data: add missing diagnostics for NI 2020-02-04 10:32:02 +03:00
Mikhail Glukhikh
bcfcb30104 [FIR] Add forgotten test data for old FE test 2020-02-04 10:31:55 +03:00
Dmitriy Novozhilov
b8fed578ca [TEST] Add js runtime to failing box test 2020-02-04 10:31:48 +03:00
Dmitriy Novozhilov
fe31eff855 Add js runtime to failing blackbox test 2020-02-04 10:31:42 +03:00
Dmitriy Novozhilov
a2a298214f [FIR-TEST] Mute failing blackbox test 2020-02-04 10:31:21 +03:00
Dmitriy Dolovov
d5ff419d0e Fix GradleNativeLibrariesInIDENamingTest 2020-02-04 14:19:19 +07:00
Dmitriy Dolovov
097e745b3c Fix: KotlinNativeABICompatibilityChecker.dispose() leads to dead lock
Issue #KT-36040
2020-02-04 14:19:10 +07:00
Yan Zhulanow
fdc700724c Update 1.3.70 changelog for EAP 2 2020-02-03 23:28:05 +09:00
Kirill Shmakov
a0516d6aec Use better wording in plugin advertiser
(cherry picked from commit 46b4620fdd)
2020-02-03 11:41:06 +03:00
Nikolay Krasko
63a3373c52 Leave hack for PsiSubstitutor in AS40 (KT-36039)
KotlinCoreApplicationEnvironment is not expected to be triggered from the plugin.
2020-01-31 01:33:53 +03:00
nikita.movshin
160ed0a438 Update K/N 2020-01-30 11:36:12 +03:00
Nikolay Krasko
7197b918e2 Update to a newer idea to fix bad initialization of PsiSubstitutor (KT-36039)
PsiSubstitutor instantiation doesn't need EmptySubstitutor service anymore.
Remove hack with interface field reassign that doesn't work with JDK >= 12.
2020-01-28 14:58:54 +03:00
Andrey Uskov
a7cabe352a Fixed locking statistics files when multiple gradle daemons started 2020-01-27 19:49:45 +03:00
nikita.movshin
712264aaac Update K/N 2020-01-27 12:01:43 +03:00
Vladimir Ilmov
1f7a27ad8f [coroutine] Coroutine's missing frames added from continuation info. 2020-01-27 09:27:39 +01:00
Ilya Kirillov
19b2247666 Fix as40 compilation: add missing bunch file 2020-01-27 10:31:34 +03:00
Ilya Kirillov
13cf304b0a Use snakeyaml from maven instead of from intellij
As new-project-wizard-cli module is not bundled into the plugin jar

(cherry picked from commit 69e9ae94c6)
2020-01-27 01:43:03 +03:00
Yan Zhulanow
55e6fbd3f1 Imitate behavior of old light classes to fix method run configurations (KT-33787)
The bug appeared when we turned “ultra light classes” on by default. The difference with the old implementation is that PsiClass.getTextRange() returns the correct non-null value. This triggers JavaExecutionUtil#stepIntoSingleClass() to return a light class instead of the original location (of a PsiIdentifier). So AbstractJavaTestConfigurationProducer#isConfigurationFromContext() returns true, and the wrong configuration is reused instead of creating the new one.
By the way, for Java it also returns an identifier because of the PsiTreeUtil.getParentOfType(element, PsiClass.class) != null check.

The proper fix should land in the newer versions of IDEA, however this (hopefully, temporary) hack will fix test method gutters for all platform versions.
2020-01-27 05:09:46 +09:00
Yan Zhulanow
36b81dffb8 Revert "Import Kotlin JUnit run configuration settings from Gradle"
This reverts commit 748cbd7e
2020-01-27 05:09:46 +09:00
Yan Zhulanow
c215ef9003 Partially revert "Prefer Kotlin Gradle test run configurations when possible (KT-33787)"
This commit reverts 987307cf92.
Tests are left behind as the different fix will be provided for KT-33787.
2020-01-27 05:09:46 +09:00
Yan Zhulanow
9f49918ec3 Partially revert "Prefer Kotlin Junit test run configurations when possible (KT-33787)"
This commit reverts parts of ef8b3cb72a.
Tests are left behind as the different fix will be provided for KT-33787.
2020-01-27 05:09:46 +09:00
Yan Zhulanow
b39e65608f Minor: Update copyrights in Fir elements 2020-01-27 05:09:46 +09:00
Dmitry Savvinov
02183148f1 Add IDE support for common klibs 2020-01-25 16:09:09 +03:00
Dmitry Savvinov
3de465b77d Check for presence of ir-folder in klibs additionally for Kotlin/Native 2020-01-25 16:09:08 +03:00
Dmitry Savvinov
953dc87c43 Minor: extract name of ir-folder in klib into const property 2020-01-25 16:09:08 +03:00
Dmitry Savvinov
9b6f405710 Pass proper metadata_version in K2MetadataKlibSerializer
Otherwise newer IDE Plugins will think that it's an old klib and will
refuse to analyze against it
2020-01-25 16:09:07 +03:00
Dmitriy Dolovov
cc0f4d59db Fast check of Kotlin/Native KLIBs by virtual files 2020-01-25 16:08:17 +03:00
Vladimir Ilmov
6e879206b0 [coroutine] debugger extension signature fixed for 193 bunch 2020-01-24 20:16:04 +01:00
Ilya Gorbunov
e562ce1359 KT-15363 Rename expectedSize to capacity and edit docs
(cherry picked from commit 7bb504321c)
2020-01-24 21:24:26 +03:00
Ilya Gorbunov
1c3e0da8d4 KT-15363 Fix failing test: missing capacity parameter check in JS
Partially restore JVM map capacity implementation

(cherry picked from commit 14351446d7)
2020-01-24 21:24:26 +03:00
Ilya Gorbunov
f46b37ec5d KT-15363 Collection builders: improve tests and samples
(cherry picked from commit 4aa7d45a5a)
2020-01-24 21:24:25 +03:00
Fleshgrinder
b239f0e8e1 KT-15363 Collection Builders
Added container builders for lists, sets, and maps.
The new experimental type inference only works for the simple builders
with a single generic type. The versions with nullability and the maps
still require explicit specification of the types. Obviously explicit
specification is required for all users who are not using the new
experimental inference. Improving the type inference is something that
should be done separately and many things – including these builders –
will benefit from it, however, this is not a blocker for these builders
in my opinion.

(cherry picked from commit bf9d3d87a6)
2020-01-24 21:24:25 +03:00
Ilya Gorbunov
b120cb8ae3 Advance bootstrap to 1.3.70-eap-145 2020-01-24 21:23:22 +03:00
Sergey Igushkin
85116652c9 Fix KlibBasedMppIT test compilation error (missing import)
(cherry picked from commit 1f42951152)
2020-01-24 20:51:57 +03:00
Sergey Igushkin
d3e283f438 Fix the K/N stdlib leaking into other common source sets
The Kotlin/Native stdlib was added to the shared-native source sets
in order for the IDE to import the stdlib dependency.

However, it was added to the '*Implementation' configuration, from
where it was also collected for the dependency source set
visibility inference algorithm. The current implementation of source
sets visibility inference only works for module dependencies and is
not quite suitable for local file dependencies. The implementation
should likely be fixed, but for now, it's enough to add the dependency
directly to the place where the visibility inference results are
taken from by the IDE during import, i.e. to the
'*ImplementationDependenciesMetadata' configurations.

Also, since all tests were flawed by the leakin K/N stdlib, the
K2Metadata/Klib compiler mistakenly didn't include its own built-ins
to the module dependencies (and everything worked because the K/N
built-ins were there). Now that the K/N doesn't leak, the compiler
must add its own built-ins.

(cherry picked from commit d1826374a6)
2020-01-24 19:02:52 +03:00
Sergey Igushkin
7324a5ea0e Common klib support in the Kotlin Gradle plugin (KT-32677)
Refactor the Kotlin/Native compilations and tasks to support
Kotlin/Native-shared source sets compilation within the metadata target.

Provide the feature flag kotlin.mpp.enableCommonKlibs that enables
the following behavior:
* compilation of Kotlin/Native-shared source sets to a klib using
the Kotlin/Native compiler.
* compilation of common source sets (not just Kotlin/Native) into a
klib rather than *.kotlin_metadata

Issue #KT-32677 Fixed

(cherry picked from commit 970ee4539b)
2020-01-24 19:02:48 +03:00
Anton Yalyshev
48bd96b95c Enable FUS for Code Completion in 1.3.70
(cherry picked from commit 90fe1bb1ab)
2020-01-24 18:31:51 +03:00
Vyacheslav Gerasimov
ca8504a482 Build: Add :compiler:ir.serialization.common to kotlin-plugin.jar
:compiler:ir.serialization.jvm contains classes depending on this module
which makes idea plugin verifier to fail.

 #KT-36103
2020-01-24 18:09:14 +03:00
Vsevolod Tolstopyatov
17bf57fd81 KT-36118 Introduce AbstractCoroutineContextKey and corresponding extensions required by its implementors
* It enables subtyping relationship for keys and elements, allowing type-safe and concise manipulations on the context when complex hierarchies of elements (e.g. implementors of ContinuationInterceptor) are present
    * It unblocks possibility to implement suspendCancellableCoroutine in stdlib
    * Implementing proper polymorphic get and minusKey in AbstractCoroutineContextElement is impossible because it will introduce source-incompatible change
    * ContinuationInterceptor get and minusKey are adjusted in a completely backwards-compatible way
2020-01-24 18:04:02 +03:00
Mikhail Zarechenskiy
9f9c2b0135 Regenerate tests after rebase 2020-01-24 17:21:04 +03:00
Mikhail Zarechenskiy
ccbf2fc603 Fix project compilation after rebase 2020-01-24 17:17:40 +03:00
Mikhail Zarechenskiy
d7295ced58 [NI] Fix issue with returning non-deparenthesized lambdas from labmdas
#KT-36080 Fixed
2020-01-24 17:17:39 +03:00
Denis Zharkov
d0d1ea2b4b NI: Fix resolution ambiguity for references returned from lambda
^KT-32267 Fixed
2020-01-24 17:17:39 +03:00
Pavel Kirpichenkov
2120e68db0 [NI] Soften restictions on using Nothing as proper constraint for full call completion
Consider lower `Nothing` constraint non-proper only if there is a dependant not analyzed postponed atom.
Early completion to `Nothing` provides data flow info for smart casts.

KT-35668 Fixed
2020-01-24 17:17:39 +03:00
Mikhail Zarechenskiy
9a6a88b191 [NI] Fix adapting arguments for callable references with receivers
#KT-35912 Fixed
2020-01-24 17:17:39 +03:00
Dmitriy Novozhilov
288f817dbf [NI] Add collecting forgotten type variables from callable references 2020-01-24 17:17:38 +03:00
Dmitriy Novozhilov
646b29f890 [NI] Add missing type variables to common system in builder inference 2020-01-24 17:17:38 +03:00
Pavel Kirpichenkov
55c9713e54 [NI] Make behaviour of anonymous functions consistent with lambdas
Fix completion of anonymous functions with expression body without expected type.
Premature completion led to losing type info from outer calls.
Also report type mismatches on empty lambda expressions.

KT-34729 In progress
2020-01-24 17:17:38 +03:00
Pavel Kirpichenkov
a3cd1f23ab [NI] Check stub types in result type
An uninferred parameter stub may leak through calculation of CST(Inv<Uninferred Stub>, Nothing) into a result type.
A stub type in the result type means a type error. So we can afford recalculating
CST with stub-containing types filtered out, since its an error anyway.
This prevents stub types leakages and helps with reporting type error diagnostics.

KT-35914 Fixed
KT-35943 Fixed
2020-01-24 17:17:37 +03:00
Victor Petukhov
8d04ba0611 NI: Prefer nullable lower bound to flexible one when substitution of type variable is performed and remember flexibility of type parameters based on flexibility of its upper bounds
^KT-32435 Fixed
2020-01-24 17:17:37 +03:00
Victor Petukhov
3051bcf878 Temporary change sinceVersion to null for ProhibitVarargAsArrayAfterSamArgument
It will be set to `KOTLIN_1_5` as it will be added.
2020-01-24 17:17:36 +03:00
Mikhail Zarechenskiy
3457b3f4a4 [NI] Fix CST calculation for covariant type projections 2020-01-24 17:17:36 +03:00
Pavel Kirpichenkov
a97751ee89 [NI] Refactor OnlyInputType annotation check
Hold position consumed during incorporation in Constraint instead of ConstraintPosition.
2020-01-24 17:17:36 +03:00
Pavel Kirpichenkov
3c48218097 [NI] Update filtering of constraints with equal types
Make check for synthetic nullability constraint status before skipping
new constraint with nonunique type.
2020-01-24 17:17:36 +03:00
Pavel Kirpichenkov
2878800030 [NI] Consider synthetic lower nullability constraint non-proper 2020-01-24 17:17:36 +03:00
Denis Zharkov
5260916cb3 NI: Fix exception during callable references overload resolution
^KT-35847 Fixed
2020-01-24 17:17:35 +03:00
Dmitriy Novozhilov
976ae1c967 [NI] Fix resolve of lambdas with expected function type with receiver
#KT-30245
2020-01-24 17:17:35 +03:00
Dmitriy Novozhilov
ec1aa0689c [NI] Improve completing callable references with type variable as expected type
#KT-32462 Fixed
2020-01-24 17:17:35 +03:00
Denis Zharkov
87c2f30b99 Fix project compilation after fix for KT-35920
See KT-35931 for a feature request allowing to write IrConstImpl::int
2020-01-24 17:17:34 +03:00
Denis Zharkov
11fbf77b9f NI: Do not resolve static callable references on generic types
As they weren't resolved in old inference

^KT-35920 Fixed
2020-01-24 17:17:34 +03:00
Denis Zharkov
392e84f538 NI: Fix callable references resolution when LHS is generic nested class
In case of null qualifier, we should not look into any static scope
NB: factory::createCallableProcessor returns NoExplicitReceiver processor
in case of null-receiver, that makes resolving the call in the test as
`property(::key)` that matches to the property itself, thus leading to
overload resolution ambiguity

^KT-35887 Fixed
2020-01-24 17:17:34 +03:00
Pavel Kirpichenkov
a290524f89 [NI] Restore old behaviour of AbstractPartialBodyResolveTest
Smartcasts between partial and full resolution mode should almost never match,
comparing smartcasted types in test runner is incorrect in general case.
Mute failing test until decision about correct behaviour (KT-35922).
2020-01-24 17:17:33 +03:00
Pavel Kirpichenkov
4ecfcc0340 [minor] Move quickFixUtil to util package 2020-01-24 17:17:33 +03:00
Pavel Kirpichenkov
0c02064363 Remove dependencies on data flow aware expression type in BindingContext
`BindingContext.getType`'s behaviour on argument expression has been different for OI and NI for some time.
New inference used to rewrite argument's type after smartcast, which led to missing subsequent smartcasts in some cases.
This commit makes retrieval of smartcasted argument type explicit.
2020-01-24 17:17:33 +03:00
Pavel Kirpichenkov
430f9b0e6e [NI] Add restored smart casts to spec tests
KT-35668 Fixed
2020-01-24 17:17:33 +03:00
Pavel Kirpichenkov
75a575b49f [NI] Restore missing smart casts after another smart cast in call
Expression type serves as a part of a key for retrieving smart cast info.
Rewriting expression type with SmartCastManager leads to incorrect processing of following smartcasts for same expression, therefore it was removed.

KT-32507 Fixed
KT-32358 Fixed
2020-01-24 17:17:33 +03:00
Dmitriy Novozhilov
640f734657 [NI] Use new type substitutor instead of old in completion of callable references
It's necessary because of new type substitutor is eager than odl, so
  if there is a substitution of type parameter deep inside type arguments
  then second substitutor wins against first

#KT-35896 Fixed
2020-01-24 17:17:32 +03:00
Dmitriy Novozhilov
0cff128038 [NI] Postpone calls with not enough information in builder inference 2020-01-24 17:17:32 +03:00
Denis Zharkov
6a5f88ac0b NI: In subtyping do not intersect arguments for non-covariant types
It partially reverts 7898922066
because it's not obvious that it's a safe operation
for invariant/contravariant types.

Also, there's a necessary fix in prepareReceiverRegardingCaptureTypes
to make types order stable
Otherwise test bareTypesWithStarProjections becomes flaky.

Also, the changes in bareTypesWithStarProjections.kt are also expected
because the type of the expression `coneSymbol` after the second "if" is
FirVariableSymbol<*> & FirPropertySymbol & AbstractFirBasedSymbol<*>
thus we fix D in the call `coneSymbol.phasedFir()` to FirVariableSymbol<*>
because it's the first type in the list
(see the next line after the last changed in AbstractTypeChecker)
2020-01-24 17:17:32 +03:00
Denis Zharkov
11302532c5 NI: Fix regression for star-projections approximation
See the test added

^KT-35703 Fixed
2020-01-24 17:17:32 +03:00
Denis Zharkov
0f7ad244db NI: Fix smart-cast related regression
See the test and the issue for the clarification
After the change 7898922066
the expected type for "a" in expression "foo(a)" is A<E & B<*>>
But we have the original type A<E> and smart-casted enriched type A<B<*>>
(non of them is a subtype of A<E & B<*>>)
and fail in checkTypeInternal when checking types in during completion

^KT-35844 Fixed
2020-01-24 17:17:31 +03:00
Pavel Kirpichenkov
154f28175f [NI] discriminate Nothing for reified parameters
Related issues: KT-32836, KT-35728
2020-01-24 17:17:31 +03:00
Mikhail Zarechenskiy
cbca609d45 [NI] Fix ambiguity when there are no applicable candidates
#KT-35064 Fixed
2020-01-24 17:17:31 +03:00
Dmitriy Novozhilov
0ceeac0c63 [NI] Use infered delegate expression type if there is no resolved call in trace
#KT-35707 Fixed
2020-01-24 17:17:30 +03:00
Pavel Kirpichenkov
79b9a058e5 [NI] Decrease only input types check diagnostic level to warning 2020-01-24 17:17:30 +03:00
Pavel Kirpichenkov
4c128c7735 [NI] Report "not enough information" on callable references in lambdas
^KT-34314 Fixed
2020-01-24 17:17:30 +03:00
Ilya Chernikov
5eb94e4903 [NI] Convert extension lambda to the non-extension one, if needed 2020-01-24 17:17:30 +03:00
Pavel Kirpichenkov
7da991f76b [NI] Remove hack for special functions
Treating special functions for `if`, `when`, `try`, `?:` as not accepting `Nothing` result type is incorrect.
Making so leads to cases with uninferred `Nothing` result type for inner calls and lost data flow info.
2020-01-24 17:17:29 +03:00
Dmitriy Novozhilov
a8ad8e0e29 [NI] Don't replace context dependency for blocks with expected type
#KT-35702 Fixed
2020-01-24 17:17:29 +03:00
Denis Zharkov
3e7b2beac9 NI: Fix type mismatch caused by smartcast
^KT-25434 Fixed
2020-01-24 17:17:29 +03:00
Denis Zharkov
7c4d79e6ee Fix bare typed smartcasts in NI
Star projections should be replaced with star projections
not for their expansions

See the test
2020-01-24 17:17:28 +03:00
Denis Zharkov
eb2c17992c Remove effectively dead code in AbstractTypeCheckerContext 2020-01-24 17:17:28 +03:00
Denis Zharkov
0fd6c5c628 NI: Approximate captured-for-star-projections to *
^KT-35602 Fixed
2020-01-24 17:17:28 +03:00
Dmitriy Novozhilov
84913a71b0 Cleanup and reformart DelegatedPropertyResolver.kt 2020-01-24 17:17:28 +03:00
Dmitriy Novozhilov
c5a96f7c11 [NI] Fix completion of error delegates with receiver with type parameters 2020-01-24 17:17:28 +03:00
Dmitriy Novozhilov
aba050fc1b [NI] Don't resolve delegates twice
#KT-31219 Fixed
#KT-31679 Fixed
#KT-32249 Fixed
2020-01-24 17:17:27 +03:00
Dmitriy Novozhilov
68ea4f7d09 [NI] Improve completing calls with multiple postponed arguments 2020-01-24 17:17:27 +03:00
Victor Petukhov
df81249d59 NI: don't filter flexible types during CST calculation and force return as result the first of such types
^KT-35658 Fixed
2020-01-24 17:17:27 +03:00
Dmitriy Novozhilov
19bf96a8b1 [NI] Add constraint K <: T from constraint K <: CapturedType(in T)
#KT-33263 Fixed
2020-01-24 17:17:27 +03:00
Dmitriy Novozhilov
4ec6b4eca9 [NI] Fix substitution in completion of callable references in coroutine inference 2020-01-24 17:17:26 +03:00
Pavel Kirpichenkov
e193e42e07 [NI] Discriminate Nothing? result type from nullability constraints
Nullability constraints should not be chosen when proper
argument constraints for variables in contravariant position present.

^KT-32106 Fixed
^KT-33166 Fixed
2020-01-24 17:17:26 +03:00
Pavel Kirpichenkov
9e9d953728 [NI] Disallow full completion based on lower Nothing constraint 2020-01-24 17:17:26 +03:00
Pavel Kirpichenkov
41debe5806 [NI] Support fixation to subtype in completion mode calculator
Allow full compltion mode for return type depending on type parameters in
contravariant position only if they have proper equality constraint.
2020-01-24 17:17:25 +03:00
Pavel Kirpichenkov
409bbfca7c [NI] Remove direcion calculator from variable fixation
Force constraint system completer to always fix variable with unknown position.
This makes inferred type for in parameters less specific, but OI infers to
subtype in such cases, so NI won't infer to less specific types than before.
2020-01-24 17:17:25 +03:00
Pavel Kirpichenkov
c4d2abcdef [NI] Implement algorithm for completion mode selection
Current selection of completion mode for call is not always correct in case of full mode,
and sometimes too conservative in case of partial mode. Updated algorithm checks constraints
wrt position of type variables in return type and in other related constraints.
Full completion happens if proper constraint requirements are satisfied for variables.
2020-01-24 17:17:25 +03:00
Pavel Kirpichenkov
79c4390aa6 [NI] Remove Nothing result type restriction in most cases
Make Nothing as result type not suitable only for if, when, try and ?: special functions.
2020-01-24 17:17:25 +03:00
Mikhail Zarechenskiy
2386132d6f [NI] Don't discriminate Nothing-type from resulting ones
^KT-32106 Fixed
2020-01-24 17:17:24 +03:00
Mikhail Zarechenskiy
d53af5a7e7 Fix incorrect use of language feature
See #KT-34889 for details
2020-01-24 17:17:24 +03:00
Dmitriy Novozhilov
281f87c934 [NI] Approximate intersection type in type argument to star if it's necessary
#KT-32196 Fixed
2020-01-24 17:17:24 +03:00
Dmitriy Novozhilov
85564530e3 [NI] Infer type variable to Nothing if all upper constraints are from upper bounds
#KT-32196 Fixed
2020-01-24 17:17:24 +03:00
Ilya Chernikov
65a4ea9de3 [NI] Fix inference if inner system has only by "uninteresting" constraint
#KT-32250 fixed
2020-01-24 17:17:23 +03:00
Ilya Chernikov
a11ab4ef83 [minor] [NI] Additional test for loosing type annotations on extension functions
taken from KT-34820
2020-01-24 17:17:23 +03:00
Denis Zharkov
20fb8cc43b NI: Report incompatible receiver of callable reference
^KT-35535 Fixed
2020-01-24 17:17:23 +03:00
Denis Zharkov
1ebae512c5 NI: Fix property references overload ambiguity
^KT-35213 Fixed
2020-01-24 17:17:22 +03:00
Pavel Kirpichenkov
ff23b094f3 [NI] Fix issues with star projection uncapturing
Prevent stack overflow during uncapturing of star projection
for parameter with recursive upper bound.
Uncapture star projections for flexible type parameters with
respect to flexible upper bound.

^KT-35210 Fixed
2020-01-24 17:17:22 +03:00
Pavel Kirpichenkov
a15ee1b5fc [NI] Preserve constraint position for OnlyInputType during incorporation
Variable with complex dependency on other variable loses its
original constraint position when variable it depends on is fixed.
To prevent that, original input position is saved in incorporation
position.
2020-01-24 17:17:22 +03:00
Pavel Kirpichenkov
cf936fe372 [NI] Fix OnlyInputTypes for captured types
Uncapture projections recursively for cases when captured type is not
top-level type or first level type argument
2020-01-24 17:17:22 +03:00
Natalia Selezneva
1fae69264c build.gradle.kts: change notification text 2020-01-24 15:59:54 +03:00
Ilya Goncharov
32d5999508 [IDEA] Use withType instead of isAssignableFrom
#KT-36093 fixed

(cherry picked from commit fa811c731f)
2020-01-24 15:27:18 +03:00
Ilya Goncharov
a51b9b59a9 [IDEA] Check assignable from task to KotlinTest class
(cherry picked from commit 6dc9109736)
2020-01-24 15:27:15 +03:00
Ilya Goncharov
0cdb337870 [IDEA] Use GradleVersion fqn to use it in case when there is no import
(cherry picked from commit 6b860206bd)
2020-01-24 15:27:10 +03:00
Ilya Goncharov
543a3a9d2a [IDEA] Preload KotlinTest class instead of loop finding
(cherry picked from commit c3951d394b)
2020-01-24 15:27:07 +03:00
Ilya Goncharov
1df47400f1 [IDEA] Add check on gradle version not to broke Gradle older 4.0
(cherry picked from commit 2c4cfd2fb8)
2020-01-24 15:27:03 +03:00
Shagen Ogandzhanian
a8cb0fd281 Update dukat dependency to 0.0.26
(cherry picked from commit de07d3387b)
2020-01-24 12:20:14 +01:00
Kevin Bierhoff
c776b7be8c suppress duplicate @Override annotations
(cherry picked from commit 6d32b3256b)
2020-01-24 18:56:10 +09:00
Yan Zhulanow
bf47acd232 Revert "Remove deprecated method from CommandLineProcessor"
This reverts commit 508330e0bb.

An external plugin depends on the deprecated API: com.jereksel.jailbreakk:0.0.2.

(cherry picked from commit 632fe18db6)
2020-01-24 18:46:30 +09:00
Yan Zhulanow
3742726579 Kapt, minor: Add extra case for property initializers
(cherry picked from commit 9bf63f5399)
2020-01-24 18:46:26 +09:00
Yan Zhulanow
26dd649a57 Minor: Fix deprecation notice in KotlinIndicesHelperExtension
(cherry picked from commit 9782f6808d)
2020-01-24 18:46:24 +09:00
Yan Zhulanow
5ec9aa709d Kapt: Support all kinds of constant types (KT-35536)
(cherry picked from commit 520f9a6da5)
2020-01-24 18:46:17 +09:00
Ivan Gavrilovic
50c4f480b6 KT-35536: Fix enum constants in KAPT
Enum constants are Pair, so make sure to unpack them correctly.

(cherry picked from commit eab6864269)
2020-01-24 18:46:08 +09:00
Yan Zhulanow
1570196dc1 Pill: Fix gradle-api artifacts attaching after migration to compileClasspath/runtimeClasspath
(cherry picked from commit 532e879d5c)
2020-01-24 18:44:08 +09:00
Yan Zhulanow
7f8fe34a36 Pill: Support Kotlin JUnit configurations
(cherry picked from commit ea957872eb)
2020-01-24 18:44:05 +09:00
Yan Zhulanow
29224ad4d4 Pill: Remove robolectric classpath passing
(cherry picked from commit 66cd78fbc0)
2020-01-24 18:44:03 +09:00
Yan Zhulanow
1eac5518f8 Pill: Support api/implementation configurations
(cherry picked from commit 5fe06ceb06)
2020-01-24 18:44:02 +09:00
Natalia Selezneva
4dbd5e9885 Scripts: clear manual configuration loading state after project import
^KT-35268

(cherry picked from commit a55a0d94de)
2020-01-24 12:03:08 +03:00
Natalia Selezneva
b7a651fe01 Provide a notification for gradle script that aren't related to any gradle project (KT-35268)
Add action to load/reload configuration for them manually
^KT-35268 Fixed

(cherry picked from commit 858698cf9a)
2020-01-24 12:03:05 +03:00
Natalia Selezneva
fc05b8edbb Implement persistent storage for script class path roots (KT-35886)
Save absolute paths instead of getCanonicalPath usages

^KT-34444
^KT-35886 Fixed

(cherry picked from commit a373ab96d4)
2020-01-24 12:03:03 +03:00
Anton Yalyshev
c0b8b10976 Properly handle a case when Code Style settings = null
(cherry picked from commit 0f049fd536)
2020-01-24 11:33:23 +03:00
Anton Yalyshev
a4c3267c7b Add bunches for unsupported versions
(cherry picked from commit 6d49f36cd6)
2020-01-24 11:33:23 +03:00
Anton Yalyshev
18e7741546 Add Formatter settings tracking to FUS
(cherry picked from commit 1d7dcf3633)
2020-01-24 11:33:23 +03:00
Anton Yalyshev
4d89903b48 Add languageVersion tracking to FUS
(cherry picked from commit 7c0d8ad6c7)
2020-01-24 11:33:22 +03:00
Andrey Uskov
c49bf7ddb1 Added project size and metrics collectors in gradle plugin 2020-01-24 11:22:32 +03:00
Ilya Kirillov
5918bbde21 Wizard: change new wizard title 2020-01-24 09:22:48 +03:00
Ilya Kirillov
9c467c01d9 Wizard: make new wizard to be second in the Kotlin group 2020-01-24 09:22:47 +03:00
Ilya Kirillov
ca0a398a31 Wizard: add FUS statistic collection 2020-01-24 09:22:45 +03:00
Ilya Kirillov
339fd2ae58 Wizard: allow simple js template to be used with JsSingleplatformModuleConfigurator 2020-01-24 09:22:44 +03:00
Ilya Kirillov
ebd825ac8c Wizard: fix removing template in UI 2020-01-24 09:22:43 +03:00
Ilya Kirillov
c87d48eedd Wizard: allow enabling new wizard in UI 2020-01-24 09:22:41 +03:00
Ilya Kirillov
f83f48c803 Wizard: fix tests 2020-01-24 09:22:40 +03:00
Ilya Kirillov
e2f81ee85b Wizard: fix adding dependencies to targets 2020-01-24 09:22:39 +03:00
Ilya Kirillov
0d63c35ee0 Wizard: temporary hide sourcesets editing for users 2020-01-24 09:22:38 +03:00
Ilya Kirillov
ef675dba06 Wizard: fix incorrectly added classpath dependency for Android with Groovy dsl 2020-01-24 09:22:36 +03:00
Ilya Kirillov
70d26bff46 Wizard: put pluginManagement section in the beginning of settings.gradle file 2020-01-24 09:22:35 +03:00
Ilya Kirillov
7da178c345 Wizard: add support of creating run configurations
#KT-36043 fixed
2020-01-24 09:22:33 +03:00
Ilya Kirillov
c2b02afe29 Wizard: add support of react js to the js template 2020-01-24 09:22:32 +03:00
Ilya Kirillov
8882c2e958 Wizard: fix not added dependencies for MPP modules 2020-01-24 09:22:31 +03:00
Ilya Kirillov
9c6e561349 Wizard: fix text of module configurators which is shown in module editor 2020-01-24 09:22:29 +03:00
Ilya Kirillov
6309710c0e Wizard: add support of JS singleplatform projects 2020-01-24 09:22:28 +03:00
Ilya Kirillov
d2602cd5bf Wizard: automatically determine Kotlin version based on Kotlin plugin version
For snapshot plugin just take the latest eap or stable version
2020-01-24 09:22:26 +03:00
Ilya Kirillov
142600f91f Wizard: remove empty border from module settings 2020-01-24 09:22:25 +03:00
Ilya Kirillov
5efb9934a3 Wizard: remove unused function 2020-01-24 09:22:24 +03:00
Ilya Kirillov
36bd7791b2 Wizard: fix incorrectly added modules to the tree 2020-01-24 09:22:23 +03:00
Ilya Kirillov
c6b6f07d3d Wizard: move "validation error" string from message to title 2020-01-24 09:22:21 +03:00
Ilya Kirillov
5e08272f25 Wizard: add validation for project name 2020-01-24 09:22:20 +03:00
Ilya Kirillov
15469c4f8d Wizard: do not suggest invalid groupId 2020-01-24 09:22:19 +03:00
Ilya Kirillov
12a18a8860 Wizard: do not show expert panel form wizard 2020-01-24 09:22:18 +03:00
Ilya Kirillov
46b824ade3 Wizard: remove duplicated string validator 2020-01-24 09:22:16 +03:00
Ilya Kirillov
d2175822e8 Wizard: add validators for POM data 2020-01-24 09:22:15 +03:00
Ilya Kirillov
0faa152537 Wizard: Show message when module has no configurable settings 2020-01-24 09:22:14 +03:00
Ilya Kirillov
051d6afae6 Wizard: Move test framework settings to module configurators 2020-01-24 09:22:12 +03:00
Ilya Kirillov
d4c458e77a Wizard: Move module templates to modules: separate SourcetModuleIR to MultiplatformModuleIR & SourcesetIR 2020-01-24 09:22:11 +03:00
Ilya Kirillov
b864bfe08f Wizard: move module templates to modules 2020-01-24 09:22:10 +03:00
Ilya Kirillov
cf2fa7f27a Wizard: add module dependencies for JPS 2020-01-24 09:22:08 +03:00
Ilya Kirillov
fabb1fed09 Wizard: add kotlin native console application template 2020-01-24 09:22:07 +03:00
Ilya Kirillov
f8ca0d031f Wizard: do not print binaries specification for all native targets
#KT-35719 fixed
2020-01-24 09:22:06 +03:00
Ilya Kirillov
0b8af7d6f8 Wizard: sort & distinct imports in Gradle build files 2020-01-24 09:22:04 +03:00
Ilya Kirillov
78f4a35317 Wizard: move fqName to import in NativeTargetConfigurator 2020-01-24 09:22:03 +03:00
Ilya Kirillov
dfa09aa5ba Wizard: add irs for build files from targets 2020-01-24 09:21:59 +03:00
Ilya Kirillov
540aabc357 Wizard: do not add empty gradle project to settings.gradle 2020-01-24 09:21:58 +03:00
Ilya Kirillov
bd2ed53e33 Wizard: use settings.gradle instead of .kts for Groovy DSL Gradle projects
#KT-35694 fixed
2020-01-24 09:21:57 +03:00
Ilya Kirillov
1450c0ad83 Wizard: print repositories for Maven
#KT-35715 fixed
2020-01-24 09:21:55 +03:00
Ilya Kirillov
3b74c305c8 Wizard: retrieve repositories from artifacts 2020-01-24 09:21:54 +03:00
Ilya Kirillov
ad359f0198 Wizard: correctly add Kotlin dependencies to singleplatform modules with gradle dsl build system
#KT-35695 fixed
2020-01-24 09:21:53 +03:00
Ilya Kirillov
0413c73574 Wizard: fix adding invalid dependencies for maven build files
#KT-35711 fixed
2020-01-24 09:21:52 +03:00
Ilya Kirillov
259d85fdbb Wizard: allow dashes for module names
#KT-35584 fixed
2020-01-24 09:21:51 +03:00
Ilya Kirillov
8c5c5345ff Wizard: Use default Java source roots for JPS projects
#KT-35710 fixed
2020-01-24 09:21:49 +03:00
Ilya Kirillov
c14152eeb0 Wizard: rework UI components for settings
#KT-35712 fixed
2020-01-24 09:21:48 +03:00
Ilya Kirillov
b3ca8308d9 Wizard: fix incorrect ktor repository
#KT-35718 fixed
2020-01-24 09:21:47 +03:00
Ilya Kirillov
bad2a3a946 Wizard: remove redundant return in native target configuration
#KT-35720 fixed
2020-01-24 09:21:42 +03:00
Ilya Kirillov
ab47d3d508 Wizard: fix swapped artifactId and groupId fields titles
#KT-35690 fixed
2020-01-24 09:21:41 +03:00
Ilya Kirillov
59537803d5 Wizard: do not overwrite existing artifactId & groupId settings
#KT-35713 fixed
2020-01-24 09:21:40 +03:00
Ilya Kirillov
2acafe32d0 Fix 191 & as35 compilation
(cherry picked from commit c311a66e5e)
2020-01-24 09:21:20 +03:00
Ilya Kirillov
586a1d3c8f Fix "Protected function call from public-API inline function is prohibited" error
(cherry picked from commit d6daaf14f8)
2020-01-24 09:21:19 +03:00
Ilya Kirillov
d0634d2b6f Fix compilation for AS
(cherry picked from commit 06dc2caf41)
2020-01-24 09:21:18 +03:00
Nikolay Krasko
9cf23713fd Allow @author usage in ...projectWizard.settings.version.maven package
(cherry picked from commit 1f878049eb)
2020-01-24 09:18:51 +03:00
Ilya Kirillov
8815f67511 Fix class not found exception in gradle wizard tests
(cherry picked from commit 830f0c6137)
2020-01-24 09:18:22 +03:00
Ilya Kirillov
a275716dd6 Wizard: introduce unit test mode
(cherry picked from commit 1ab405a86c)
2020-01-24 09:18:21 +03:00
Ilya Kirillov
3b83af751a Wizard: fix android tests
(cherry picked from commit 1c30572844)
2020-01-24 09:18:20 +03:00
Ilya Kirillov
845251f2da Wizard: fix wrong checking for project kind in UI
(cherry picked from commit b2166dc40d)
2020-01-24 09:18:19 +03:00
Ilya Kirillov
a927841af1 Wizard: disable abbility to switch between targets in existing module
(cherry picked from commit c1ce215b5d)
2020-01-24 09:18:18 +03:00
Ilya Kirillov
e47bfec05e Wizard: add suggested module names for js targets
(cherry picked from commit 7204ab091a)
2020-01-24 09:18:17 +03:00
Ilya Kirillov
820a90c3bc Wizard: do not allow to create more than one target of each type
(cherry picked from commit fc9f63d49f)
2020-01-24 09:18:16 +03:00
Ilya Kirillov
a7099c6c30 Wizard: add additional applicability checker for template
(cherry picked from commit aa2992e84a)
2020-01-24 09:18:15 +03:00
Ilya Kirillov
c7e97c2861 Wizard: remove unused android service
(cherry picked from commit 40367635cc)
2020-01-24 09:18:13 +03:00
Ilya Kirillov
1e2c56380a Wizard: format templates code
(cherry picked from commit af174b4f74)
2020-01-24 09:18:12 +03:00
Ilya Kirillov
83c559cf49 Wizard: add simple js template
(cherry picked from commit b29e6d0c69)
2020-01-24 09:18:11 +03:00
Ilya Kirillov
09a771dad0 Wizard: do not print duplicated repositories
(cherry picked from commit 5d56f3d28b)
2020-01-24 09:18:09 +03:00
Ilya Kirillov
d80512dd98 Wizard: introduce interceptors for module templates
(cherry picked from commit 32a151f561)
2020-01-24 09:18:07 +03:00
Ilya Kirillov
d8df582975 Wizard: add simple JS client template
(cherry picked from commit 8bf9c31880)
2020-01-24 09:18:05 +03:00
Ilya Kirillov
a1ece3b529 Wizard: add basic ktor server template
(cherry picked from commit 56fccce305)
2020-01-24 09:18:02 +03:00
Ilya Kirillov
388668edf7 Wizard: introduce ServicesManager & correctly handle disabled gradle & maven Idea plugins
(cherry picked from commit f927fb3471)
2020-01-24 09:18:00 +03:00
Ilya Kirillov
03c1eee25d Wizard: change wizard title to experimental
(cherry picked from commit 9011eecfdf)
2020-01-24 09:17:59 +03:00
Ilya Kirillov
24fc714e01 Wizard: Create parent group for current and experimental project wizard
(cherry picked from commit b10e157147)
2020-01-24 09:17:57 +03:00
Ilya Kirillov
aad67ddbda Wizard: show experimental new project wizard only by registry flag
(cherry picked from commit 8684b0d6c1)
2020-01-24 09:17:56 +03:00
Ilya Kirillov
aeab899542 Wizard: Add initial version of the new project wizard
(cherry picked from commit aca193ddd2)
2020-01-24 09:17:55 +03:00
Abduqodiri Qurbonzoda
cdf89677fb Optimize ArrayDeque tests run time
(cherry picked from commit e89893b6fd)
2020-01-24 05:57:18 +03:00
Ilya Gorbunov
d17908b9ce ArrayDeque: avoid triggering JDK 1.6 bug in tests
Use System.arraycopy instead of Arrays.copyOfRange to
avoid triggering JDK-7174363 bug in copyOfRange.

Fix package of ArrayDequeTest

(cherry picked from commit 8733d5f9ed)
2020-01-24 05:56:54 +03:00
Abduqodiri Qurbonzoda
a00c12d876 Add removeFirst(OrNull) and removeLast(OrNull) methods to MutableList
(cherry picked from commit e459542e6f)
2020-01-24 05:56:25 +03:00
Abduqodiri Qurbonzoda
d8193a5a9f Common ArrayDeque
(cherry picked from commit b6849efd47)
2020-01-24 05:56:02 +03:00
Vladimir Dolzhenko
2af2140f70 Track changes of non physical files with incOutOfBlockModificationCount
To invalidate synthetic file cache have to increment
incOutOfBlockModificationCount on valuable psi changes

#KT-35186 Fixed

(cherry picked from commit 6352cded1b)
2020-01-23 21:24:16 +01:00
Vladimir Dolzhenko
20f5ad2be5 Track changes of non physical files with incOutOfBlockModificationCount
To invalidate synthetic file cache have to increment
incOutOfBlockModificationCount on valuable psi changes

#KT-35186 Fixed

(cherry picked from commit 6352cded1b)
2020-01-23 21:22:38 +01:00
Andrey Uskov
9eb8700d3a Added FUS extensions and new metrics for reporting statistics from gradle 2020-01-23 20:36:47 +03:00
Andrey Uskov
b5202dc104 Added tests to gradle statistics reporter 2020-01-23 20:36:36 +03:00
Andrey Uskov
937a8947cd Metric description and anonymization rules added
Added metrics and their anonymization rules added. Persisted gradle
statistical information will not contain any sensitive information.
#KT-33404 Fixed
2020-01-23 20:36:28 +03:00
Andrey Uskov
ae1be18241 Collecting performance information in Gradle plugin supported
The build performance information is collected during the build
when the Kotlin Gradle plugin is applied. Only hashed values are
saved if they may contain sensitive information. Numeric metrics
obtained on the basis of user's project are saved with random seed.
Persisted information is saved in gradleUserHomeDir.

#KT-33404 Fixed
2020-01-23 20:36:23 +03:00
Andrey Uskov
c0d1b76b62 Open files leak on incremental compilation fixed
#KT-25206 Fixed
2020-01-23 20:36:18 +03:00
Andrey Uskov
0db48ed660 Do not show warnings when some projects are not generated before import
#KT-35442 Fixed
2020-01-23 20:36:14 +03:00
Vladimir Ilmov
765dc2dc28 AsyncStackTraceContext extra logging removed 2020-01-23 15:26:47 +01:00
Vladimir Ilmov
35f4dc57a1 Coroutine debugger starting even if registry key set to false - fixed 2020-01-23 15:26:47 +01:00
Vladimir Ilmov
9a23886042 [coroutine] ComboBox disabled as in progress 2020-01-23 15:26:47 +01:00
Vladimir Ilmov
823cc41123 [coroutine] Exception fixed for SUSPEND coroutines. 2020-01-23 15:26:47 +01:00
Vladimir Ilmov
21ba1f2455 Flaky ConcurrentModificationException in NewMultiplatformProjectImportingTest.testFileCollectionDependency fixed 2020-01-23 15:26:47 +01:00
Vladimir Ilmov
0fac6d2d50 POC coroutine panel removed 2020-01-23 15:26:47 +01:00
Vladimir Ilmov
0903e0dcdc [debug] coroutine's stack frame locations pre-calculated on initialization 2020-01-23 15:26:46 +01:00
Vladimir Ilmov
cd39237566 CodeConformanceTest @author mention in sources fixed 2020-01-23 15:26:46 +01:00
Vladimir Ilmov
a934b348e1 Coroutine as35 compatibility patch also added to 191. 2020-01-23 15:26:46 +01:00
Vladimir Ilmov
abd956c123 CoroutineAsyncStackTraceProvider stack corruption fix 2020-01-23 15:26:46 +01:00
Vladimir Ilmov
ab727cbfbf coroutine debugger toolbar added 2020-01-23 15:26:46 +01:00
Vladimir Ilmov
9f1d8f38a3 coroutine debugger logic moved to jvm-debugger-coroutine module 2020-01-23 15:26:46 +01:00
Vladimir Ilmov
58bbf6a57a [coroutine][debugger] implementation basing on X-* approach
XCoroutine view added for direct comparison with Coroutines
2020-01-23 15:26:46 +01:00
Vladimir Ilmov
8ed20ce667 [coroutine][debugger] refactoring being done
X-view approach added for review, thread groups added
2020-01-23 15:26:46 +01:00
Leonid Startsev
90fe752ae9 Do not include annotations and KDoc into NO_EXPLICIT_VISIBILITY_IN_API_MODE report range
Rename positioning strategy to better reflect its behavior.
#KT-36021 Fixed

(cherry picked from commit 43858e8169)
2020-01-23 17:17:15 +03:00
Leonid Startsev
7b82c0e90b Fix unavailable 'Specify visibility explicitly' quickfix
in explicit API mode due to incorrect cast.
Add tests for applying this quickfix.
#KT-36020 Fixed

(cherry picked from commit 4285c6045a)
2020-01-23 17:17:05 +03:00
Leonid Startsev
dcb5df4f48 Search for standard serializers in both internal and root packages
To allow graduate migration of some classes (e.g. IntSerializer)
from kotlinx.serialization.internal.* to kotlinx.serialization.*

(cherry picked from commit 9e8f21cc20)
2020-01-23 12:42:30 +03:00
Leonid Startsev
38965ccf51 Pass actual serializable properties count in the generated code
to SerialClassDescImpl.
This is needed to optimize space allocation.

(cherry picked from commit db4273d677)
2020-01-23 12:42:06 +03:00
Leonid Startsev
b695f2b8fe Refactor plugin-generated call to EnumSerializer():
support new values() argument.
Get rid of old @JvmOverloads requirements in runtime.

(cherry picked from commit 9558538d15)
2020-01-23 12:41:54 +03:00
Vladimir Dolzhenko
f0535a787f Put a proper version of ProgressIndicatorUtils.kt.192
Relates to #KT-33939
2020-01-23 08:57:56 +01:00
Vladimir Dolzhenko
f95d9ca024 Handle kdoc case for Introduce import alias inspection
#EA-210889 Fixed
2020-01-22 22:26:01 +01:00
Vladimir Dolzhenko
59df5711aa Show Review Added Imports on paste action
Fixed multi-caret selection in kotlin-to-kotlin copy-paste processor

Relates to #KT-33939

(cherry picked from commit db8b0a6593)
2020-01-22 17:23:05 +01:00
Vladimir Dolzhenko
036f88424a Fixed ProgressIndicatorUtils.kt for 201
#KT-36008 Fixed
Relates to #KT-33939

(cherry picked from commit 1911cbb077)
2020-01-22 17:22:49 +01:00
Vladimir Dolzhenko
b49b795bd2 ProgressIndicatorUtils.kt for 191 is added
Relates to #KT-33939

(cherry picked from commit c0c929c449)
2020-01-22 17:22:09 +01:00
Vladimir Dolzhenko
ce829cb220 Reworked k2k copy-paste action.
Get rid of resolve from copy phase, paste phase performs resolve in bg

#KT-33939 Fixed

(cherry picked from commit 5730a21e7b)
2020-01-22 17:22:00 +01:00
Ilya Matveev
4ec1ec7fd9 Gradle, native: Allow setting destination directory for binaries
Issue #KT-29395 fixed
2020-01-22 17:41:00 +07:00
Ilya Matveev
0611e79d98 Gradle, native: Don't pass to compiler missing klib files
We don't compile a klib if there are no sources for it (NO-SOURCE
checks). So, we need to take this fact into account and don't
pass such libraries to compiler in dependent modules. See also:
GH-2617 in the K/N repo.

This patch checks that a klib file exists before passing it to the
compiler.
2020-01-22 17:40:59 +07:00
Ilya Matveev
90ef8f9b55 Gradle, tests: Skip building in native binaries test for Groovy DSL
This test is one of the most time-consuming tests because
it builds a lot of final native binaries. Moreover, it exists
in two versions: for Groovy DSL and for Kotlin DSL. The only
difference between these versions is build script DSL.

This patch disables project building for the Groovy DSL version to
reduce total test execution time. Now this test only checks that
project configuration is successful. But it's enough to detect DSL
problems.
2020-01-22 17:40:58 +07:00
Ilya Matveev
9b5bd0dd5d Gradle, native: Support exporting dependencies for static and shared libs
Issue #KT-35352 fixed
2020-01-22 17:40:57 +07:00
Yaroslav Chernyshev
17d3f1d075 [Gradle, Native] Implement custom name for generated framework for XCode
(cherry picked from commit 401baa35ab)
2020-01-22 10:53:21 +03:00
Natalia Selezneva
1af05fd600 Fix script configurations for gradle project without source roots in 193 and as40
GradleKtsImportTest:testEmpty fixed
(cherry picked from commit b38836c488)
2020-01-22 09:51:48 +03:00
Natalia Selezneva
9a36ec0219 KotlinDslScriptModel request shouldn't fail the gradle build
(cherry picked from commit f0cb51a5bc)
2020-01-22 09:51:48 +03:00
Natalia Selezneva
f3bb45c59c as36: Update to AS 3.6 RC (192.7142.36.36.6071332)
^KT-36005 Fixed

(cherry picked from commit 606279b462)
2020-01-22 09:51:48 +03:00
Natalia Selezneva
a9ba149554 Remove unnecessary bunch file for AS4.0
(cherry picked from commit 4699ba758e)
2020-01-22 09:51:48 +03:00
Natalia Selezneva
521d3eee70 Scripting: do not call getConfiguration inside ScriptClassRootsCache
We already have all configurations inside `all` property.
If script doesn't have loaded configuration getting script sdk - ask for configuration explicitly to avoid situations when configuration is already loaded but not yet saved in memory cache

Looks related to KT-35590
^KT-35590

(cherry picked from commit a24e62eaf7)
2020-01-22 09:51:47 +03:00
Vladimir Dolzhenko
195104f7cf Store addUnambiguousImportsOnTheFly in kotlin code insight settings
store optimizeImportsOnTheFly in kotlin code insight workspace settings

#KT-36034 Fixed
2020-01-21 17:56:18 +01:00
Alexander Podkhalyuzin
a1ec739727 Now using Kotlin setting instead of Java one in 191 as well 2020-01-21 17:55:49 +01:00
Ilya Chernikov
8e812c2685 Add only non-jdk classpath entries from the compiler to script
remove unnecessary manifest classpath entries in the saved compiled
script jar
2020-01-21 15:12:03 +01:00
Ilya Chernikov
19ddcc0895 Use scripting cache earlier in the pipeline:
before initializing compiler and processing callbacks
2020-01-21 15:12:03 +01:00
Ilya Chernikov
6b25f14bfd Speed up REPL package member declaration provider
about 10-15% on specific test
also preparing test infrastructure for it
2020-01-21 15:12:03 +01:00
Ilya Chernikov
794c22b758 [minor] fix typo in function name 2020-01-21 15:12:03 +01:00
Ilya Chernikov
401f659734 Immplement default cache in main-kts 2020-01-21 15:12:03 +01:00
Ilya Chernikov
874d08b04e Get rid of kotlinx.coroutines usage in saved script runner
to reduce dpendencies for the save dscipt running
2020-01-21 15:12:03 +01:00
Ilya Chernikov
995699cc36 Fix ivy mapping to the maven repos in main-kts 2020-01-21 15:12:03 +01:00
Ilya Chernikov
c9d0e97eaf Implement automatic loading of .main.kts scripts support
also fix discovery from ScriptDefinitionsProvider
2020-01-21 15:12:03 +01:00
Ilya Chernikov
afed7fde01 Check REPL snippet syntax before calling analysis
restores the behaviour of the GenericRepl implementation and fixes
issues then invalid code is being compiled
#KT-34888 fixed
2020-01-21 15:12:02 +01:00
Ilya Gorbunov
464c8782c2 Rename Clock to TimeSource, ClockMark to TimeMark
Step 2: rename classes and interfaces.
Provide deprecated typealiases to smooth migration.

(cherry picked from commit 1336da8453)
2020-01-21 16:07:52 +03:00
Ilya Gorbunov
57c5d0ee83 Rename Clock to TimeSource, ClockMark to TimeMark
Step 1: rename files

(cherry picked from commit a11a25087a)
2020-01-21 16:07:52 +03:00
Elena Lepilkina
2abdeaf365 Update K/N version 2020-01-21 14:05:59 +03:00
Zalim Bashorov
c544749e14 [Build] Remove the property to skip JS IR BE tests
It's no longer needed since we going to start building libraries using the new BE,
so we have to be sure that everything works well in releases branches too.

(cherry picked from commit 9cf1a2b404)
2020-01-21 00:09:36 +03:00
Zalim Bashorov
86441a95c4 [JS BE] Fix is check with Function
#KT-33149 fixed

(cherry picked from commit ee06678484)
2020-01-21 00:09:36 +03:00
Igor Chevdar
2c2aa081e4 [kotlin-native-plugin] Enabled compiler daemon 2020-01-20 18:43:14 +03:00
Leonid Startsev
7993a02d9f Support SerializerFactory in Native
kotlinx.serialization plugin now adds additional function to companions
of generic classes in order to overcome lack of reflection. This
helps retrieving generic serializers from KType.

(cherry picked from commit 137c500e3a)
2020-01-20 14:57:12 +03:00
Nikolay Krasko
5db3ae7680 Switch to 193 platform 2020-01-20 13:46:44 +03:00
Nikolay Krasko
7e3ba2f976 Update 193 to 193.6015.22-EAP-SNAPSHOT 2020-01-20 13:44:42 +03:00
Nikolay Krasko
3d632163d8 Advance version to 193.5662.53
(cherry picked from commit 80d5723a07)
2020-01-20 13:44:42 +03:00
Nikolay Krasko
7562bc44d2 Mute TCServiceMessageOutputStreamHandlerTest for 193 platform (KT-35938)
(cherry picked from commit b4ae1645ec)
2020-01-20 13:44:42 +03:00
Nikolay Krasko
513f8b26d5 JUnit 4 runner for ignoring muted tests
(cherry picked from commit fd8ff463bb)
2020-01-20 13:44:42 +03:00
Nikolay Krasko
059b0b4e8c Run tests in kotlin-gradle-plugin in repository working dir
Unify with other modules and make GradleNodeModuleBuilderTest work under
JPS.

(cherry picked from commit 6963c81b40)
2020-01-20 13:44:42 +03:00
Mikhael Bogdanov
6100899487 Minor. Convert test
(cherry picked from commit 52ac8d788d)
2020-01-20 10:57:47 +01:00
Mikhael Bogdanov
01b1567723 Don't generate type annotations on synthetic accessors
#KT-35843 Fixed

(cherry picked from commit 70d71f0f07)
2020-01-20 10:57:35 +01:00
Mikhael Bogdanov
3bb25c889a Support field type annotations
#KT-35843 Fixed

(cherry picked from commit 1032e3a17c)
2020-01-20 10:57:22 +01:00
Mikhael Bogdanov
a4b3912ea7 Support type annotations
#KT-35843 Fixed

(cherry picked from commit 2ed0cb2a89)
2020-01-20 10:57:06 +01:00
victor.petukhov
04ad28046a Fix isNegated psi method in KtWhenConditionInRange
^KT-34395 Fixed

(cherry picked from commit fc7b836151)
2020-01-17 19:26:17 +03:00
Victor Petukhov
982d86b4a3 Workaround an inliner problem upon which the compiler code itself stumbled
^KT-35856 Fixed

(cherry picked from commit 5917591205)
2020-01-17 19:26:07 +03:00
Sergey Igushkin
c5fdddb719 Support serializing a module's own descriptors without dependencies
The KlibMetadataSerializer used to serialize all package fragments that a module
could provide, including those coming from the module's dependencies. In order
to produce a klib from a module that is analyzed by the K2MetadataCompiler, the
serializer needs to take just the own package fragments of the module, excluding
those of the dependencies.

(cherry picked from commit 1129b2d3eb)
2020-01-17 18:51:11 +03:00
Sergey Igushkin
65b4680521 Support generating a klib from common code with K2MetadataCompiler
(cherry picked from commit ed6034e449)
2020-01-17 18:51:10 +03:00
Sergey Igushkin
820be03e25 Allow not providing IR to serialize a klib with just the frontend metadata
(cherry picked from commit 28e0089259)
2020-01-17 18:51:08 +03:00
Sergey Igushkin
a1909b10ef Fix non-existing files passed in classpath to Kotlin/JS compiler
(cherry picked from commit 38feadcfe8)
2020-01-17 18:31:51 +03:00
Nikolay Krasko
f184c4d2ac Simplify adding Kotlin sdk by inlining internals of ProjectSdksModel
Because of using cloning sdks inside ProjectSdksModel tests fail with sdk leaked errors.

(cherry picked from commit c7d39b612c)
2020-01-17 18:25:08 +03:00
Nikolay Krasko
48cd03a66c Better fix for compiler plugin test initialization
The previous one didn't work in 191.
Also revert changes in tests-common module.

(cherry picked from commit 70067bc9bf)
2020-01-17 18:25:08 +03:00
Nikolay Krasko
919092558c Mute flaky JavaAgainstKotlin.testUsingMutableInterfaces
(cherry picked from commit ddda93ad96)
2020-01-17 18:25:07 +03:00
Nikolay Krasko
1d1453197b Enable mute tests feature for BuiltInDecompilerTest
(cherry picked from commit e20c66011a)
2020-01-17 18:25:07 +03:00
Nikolay Krasko
7e0e94736e Mute flaky step over tests on Android Studio
(cherry picked from commit 28e23f0aa8)
2020-01-17 18:25:07 +03:00
Nikolay Krasko
4c89c4bccc Mute GradleMigrateTest.testMigrateStdlib in AS
(cherry picked from commit 11e4b710b5)
2020-01-17 18:25:07 +03:00
Nikolay Krasko
44fd8a8a16 Mute tests for preferring JDK classes in completion and auto-import in 191 and 192 (KT-35709)
BasicCompletionWeigherTestGenerated.testPreferFromJdk
AutoImports.testAmbiguousNamePreferFromJdk

(cherry picked from commit 77edfed764)
2020-01-17 18:25:07 +03:00
Nikolay Krasko
a64f0366b1 Fix test data for QuickFixTestGenerated.SupertypeInitialization in 191
(cherry picked from commit 74e2c98426)
2020-01-17 18:25:07 +03:00
Nikolay Krasko
be7ae53b40 Mute JavaToKotlinConverterSingleFileTestGenerated in 191
(cherry picked from commit 0d48855333)
2020-01-17 18:25:07 +03:00
Nikolay Krasko
d4bb1f3f42 Fix UpdateConfigurationQuickFixTest.testEnableCoroutinesFacet test
(cherry picked from commit 28eb6a223d)
2020-01-17 18:25:07 +03:00
Nikolay Krasko
e9d6cce9a3 Split tests to common and platform parts
(cherry picked from commit 4c28e0dec3)
2020-01-17 18:25:06 +03:00
Nikolay Krasko
2e436a2c25 Minor: sort tests in mute database
(cherry picked from commit 570b522e8e)
2020-01-17 18:25:06 +03:00
Nikolay Krasko
ad0884e0cb Port muting database from master
(cherry picked from commit 8014a6509e)
(cherry picked from commit 482cb07420)
(cherry picked from commit 9d54d1ec40)
(cherry picked from commit c5d4213a5c)
(cherry picked from commit c935078f05)
(cherry picked from commit c848212ae9)
(cherry picked from commit 08ade450ff)
(cherry picked from commit f41b588f70)
(cherry picked from commit 712517a02e)
(cherry picked from commit 5f25242cbf)
(cherry picked from commit 3520d5b81d)
(cherry picked from commit 18b1d64adc)
(cherry picked from commit c11f36cf1d)
(cherry picked from commit 84604b91bf)
(cherry picked from commit 1058f04c53)
(cherry picked from commit 1e3736ec1e)
(cherry picked from commit 6613b73657)
(cherry picked from commit dca5ff10c7)
(cherry picked from commit d80fdf307f)
(cherry picked from commit d2909814c2)
(cherry picked from commit 03bd80b1ba)
(cherry picked from commit 3210e1d44c)
(cherry picked from commit 1682ace428)
(cherry picked from commit 9206f1cfb2)
(cherry picked from commit 1e14c48742)
(cherry picked from commit 0884681662)
(cherry picked from commit c372dc7f0a)
(cherry picked from commit 9b68008208)
(cherry picked from commit d575df56e9)
(cherry picked from commit 1b9bae0cca)
(cherry picked from commit bf79b660c4)
(cherry picked from commit 2f129ea435)
(cherry picked from commit 7a94b1d88b)
(cherry picked from commit 5583b57ed7)
(cherry picked from commit 70ff3d36d0)
2020-01-17 18:25:06 +03:00
Yan Zhulanow
899d1c844e Remove changelog for previous releases 2020-01-17 21:10:16 +09:00
Dmitry Gridin
cabe30f973 idea: cleanup code
(cherry picked from commit 8dbbd64beb)
2020-01-17 17:29:23 +07:00
Ilya Matveev
5585074266 Gradle, native: Don't use an arg file when compiler daemon is enabled
We pass compiler flags using an arg file if the compiler is executed
in a separate process because Windows limits maximal command line
length (see https://github.com/JetBrains/kotlin-native/issues/1999).

But for the compiler daemon we pass the args directly to the compiler
entry point method. So we can abandon using an arg file here.
2020-01-17 12:45:50 +07:00
Ilya Matveev
fd89b9000b Gradle, native: Escape spaces in K/N compiler args
We use an argument file to pass arguments to the K/N compiler.
Earlier each line of such a file was treated by the compiler
as a separate argument. But this logic was updated some time
ago and now content for this file is treated as a space separated
list of arguments.

This patch takes this into account at the Gradle side and quotes
arguments written to the arg file.

Issue #KT-35934 Fixed
2020-01-17 12:45:49 +07:00
Abduqodiri Qurbonzoda
96059aead3 Create method Collection.randomOrNull() #KT-35347
(cherry picked from commit 3cad1bbb51)
2020-01-16 22:56:28 +03:00
Sergey Rostov
db8be3fc8a AbstractScriptConfigurationLoadingTest: add asserting messages
(cherry picked from commit 07041574da)
2020-01-16 19:17:42 +03:00
Sergey Rostov
287cbd8382 .gralde.kts: optimize getAffectedGradleProjectFiles (EA-220597 fixed)
(cherry picked from commit 40914e79ee)
2020-01-16 19:17:41 +03:00
Alexander Udalov
13aea1382e Revert "JVM/JVM_IR: fix mapping of KClass in annotation classes"
This reverts commit 7cd55c85e6.

Since we don't have much time for carrying out the deprecation policy,
KT-35207 will be supported since 1.4-M1.
2020-01-16 17:02:06 +01:00
Alexander Udalov
8f09dcbe9b Keep annotation FQ name in experimental API diagnostics
This fixes compilation of ExperimentalFixesFactory where this FQ name
is used to construct a correct quick fix instance.

(cherry picked from commit b5afdc7553)
2020-01-16 17:01:06 +01:00
Alexander Udalov
f9f286dd8c Deprecate Experimental/UseExperimental in favor of RequiresOptIn/OptIn
(cherry picked from commit 514bf3eec0)
2020-01-16 17:01:06 +01:00
Alexander Udalov
fd879cb4f5 Support custom message in RequiresOptIn
#KT-34648 Fixed

(cherry picked from commit f954a6c812)
2020-01-16 17:01:05 +01:00
Alexander Udalov
73d3b7632c Rename UseExperimental->OptIn, Experimental->RequiresOptIn in quickfix and IDE tests
(cherry picked from commit 9187a85aaf)
2020-01-16 17:01:05 +01:00
Alexander Udalov
82b18c9291 Fix compiler and IDE tests on Experimental/RequiresOptIn
See cdbabf224f, e009c7064e

(cherry picked from commit 16db3a8b5f)
2020-01-16 17:01:05 +01:00
Alexander Udalov
cd668eae98 Rename UseExperimental->OptIn, Experimental->RequiresOptIn in Gradle plugin
(cherry picked from commit da077b5353)
2020-01-16 17:01:05 +01:00
Alexander Udalov
e821a7c516 Rename UseExperimental->OptIn, Experimental->RequiresOptIn in stdlib kdocs
(cherry picked from commit 8f94a2bb75)
2020-01-16 17:01:05 +01:00
Alexander Udalov
e35f1c4bbc Rename UseExperimental->OptIn, Experimental->RequiresOptIn in compiler tests
(cherry picked from commit 7742a3b697)
2020-01-16 17:01:04 +01:00
Alexander Udalov
834fc4d457 Rename Experimental/UseExperimental in compiler diagnostic messages
#KT-34647

(cherry picked from commit b839b905b5)
2020-01-16 17:01:04 +01:00
Alexander Udalov
deced92e8d Fix NPE in ExperimentalUsageChecker in corner case
Since there's no nullability assertion, null could end up in this list
and cause NPE further at `reportNotAcceptedExperimentalities`. This
could happen if a declaration was annotated with WasExperimental, the
marker was annotated with the new RequiresOptIn, and API version 1.2 was
used.

No new tests are added because 1.2 is obsolete and WasExperimental is
internal.

(cherry picked from commit d547af00aa)
2020-01-16 17:01:04 +01:00
Alexander Udalov
1c047daeae Add -Xopt-in command line argument
As per https://github.com/Kotlin/KEEP/pull/201

(cherry picked from commit e009c7064e)
2020-01-16 17:01:04 +01:00
Alexander Udalov
adec550d1a Introduce RequiresOptIn and OptIn annotations
RequiresOptIn should be used now instead of Experimental, OptIn instead
of UseExperimental. See https://github.com/Kotlin/KEEP/pull/201.

This change adds the new declarations only to the stdlib, and supports
them in the compiler. Because of the way compiler loads annotations, we
need to bootstrap it first before deprecating the old annotations and
updating tests.

 #KT-34647 Fixed

(cherry picked from commit cdbabf224f)
2020-01-16 17:01:04 +01:00
Alexander Udalov
35258657af Deprecate -Xexperimental compiler argument
This option is not widely used and its implementation relies on a
complicated mechanism of a module-wide metadata, which is not properly
supported in the IDE (see IdeModuleAnnotationsResolver).

 #KT-34649 Fixed

(cherry picked from commit 33bc3db144)
2020-01-16 17:01:03 +01:00
Vyacheslav Gerasimov
6d8148f64b Build: Add missing com.github.node-gradle.node plugin versions
(cherry picked from commit fa1c6c9697)
2020-01-16 18:52:25 +03:00
Vyacheslav Gerasimov
5ca2a9b79f Build: Add kotlinPluginPublication to idea-gradle-tooling-api
(cherry picked from commit a0e73bffa0)
2020-01-16 18:52:14 +03:00
Dmitry Gridin
fb10a6de3a KtScratchExecutionSession: fix compilation for 191
(cherry picked from commit 09acdb655d)
2020-01-16 18:40:12 +07:00
Dmitry Gridin
353404705f KotlinDebuggerCaches: fix INRE
#EA-219472 Fixed

(cherry picked from commit 898308c7ba)
2020-01-16 18:40:09 +07:00
Dmitry Gridin
33251ee2ee KotlinConsoleRunner: fix INRE
#EA-219478 Fixed

(cherry picked from commit 3f500c6e92)
2020-01-16 18:40:07 +07:00
Dmitry Gridin
2dcf96cd71 IDEKotlinAsJavaSupport: fix INRE
#EA-213321 Fixed

(cherry picked from commit 02beb72ab1)
2020-01-16 18:38:09 +07:00
Dmitry Gridin
c82520e1bf KotlinFunctionBreakpoint: fix INRE
#KT-35316 Fixed
#EA-219418 Fixed

(cherry picked from commit 4d7fe78a51)
2020-01-16 18:38:05 +07:00
Dmitry Gridin
286149efe5 KotlinNativeModuleConfigurator: fix INRE
#EA-219416 Fixed

(cherry picked from commit 09bcfab047)
2020-01-16 18:38:04 +07:00
Dmitry Gridin
4be844bbe7 KtScratchExecutionSession: fix INRE
#EA-218701 Fixed

(cherry picked from commit 86f9253fa0)
2020-01-16 18:38:01 +07:00
Dmitry Gridin
de7f8c34c8 KotlinVariableInplaceIntroducer: fix PIEAE
#EA-209820 Fixed

(cherry picked from commit 78f7ed2c27)
2020-01-16 18:37:58 +07:00
Dmitry Gridin
6b4d2ed7db JavaToKotlinAction: fix KNPE
#EA-215300 Fixed

(cherry picked from commit 580885245d)
2020-01-16 18:36:50 +07:00
Dmitry Gridin
83ed2150a5 idea: fix some ControlFlowException
#EA-219412 Fixed

(cherry picked from commit 34dcc72e7f)
2020-01-16 18:36:47 +07:00
Dmitry Gridin
327acd5f5f PerModulePackageCacheService: fix NPE for code injection
#KT-35208 Fixed

(cherry picked from commit 7c9826b60b)
2020-01-16 18:35:05 +07:00
Nicolay Mitropolsky
b31f88a51d 191: Uast: fix compilation for 191
(cherry picked from commit ed57a53ad6)
2020-01-16 10:24:02 +03:00
Nicolay Mitropolsky
72a7bc2beb Uast: KotlinIDERenderLogTest for running UAST tests with ULC
In case of result difference the `-ide`-suffixed testdata is used.
Actually the difference in results is more likely to be a bug
but currently we are fixating at least some behaviour to protect from
 unexpected regressions in Ultra Light Classes.

`object Local` were removed because there is no local objects in actual
 Kotlin syntax

(cherry picked from commit 54285d328f)
2020-01-16 10:24:00 +03:00
Mikhail Zarechenskiy
589a07494d Add feature that allows references to synthetic properties with warning
See KT-35933 for details
2020-01-16 09:46:00 +03:00
Natalia Selezneva
9e3ed92e26 Scripting: use VFS events instead of document changes to track changes outside of IDE (KT-35557)
^KT-35557 Fixed

(cherry picked from commit a653feb2dc)
2020-01-16 09:38:05 +03:00
Natalia Selezneva
bdf3543ebf Simplify check for that gradle script configurations is up to date
Get time stamp for script inputs before gradle import

(cherry picked from commit 6bf0e4b1a9)
2020-01-16 09:38:04 +03:00
Natalia Selezneva
cf3c505097 Implement persistent storage for time stamps of files that affect build script configuration (KT-3556)
^KT-3556 Fixed

(cherry picked from commit 3dfbd824e4)
2020-01-16 09:38:04 +03:00
Natalia Selezneva
426815b8ae Scripting: extract API to check if script is related to any gradle project
KT-35268 cannot be implemented without explicit action for loading configurations for script outside of project model

^KT-35268
^KT-34625

(cherry picked from commit ecb05ace91)
2020-01-16 09:38:04 +03:00
Natalia Selezneva
d3bcbcc7eb Tests: switch off script configuration update in MutlifileRefactoringTests
(cherry picked from commit feda832eb7)
2020-01-16 09:38:04 +03:00
Natalia Selezneva
0ef8ecea02 Scripting: remove unexpected cache clear
(cherry picked from commit 233d400e93)
2020-01-16 09:38:04 +03:00
Sergey Igushkin
b9888d160b Deprecate 1.2.x MPP Gradle plugins
Issue #KT-31570 Fixed
2020-01-16 00:00:28 +03:00
Sergey Igushkin
0cb15d8c88 Support Gradle instant execution for Kapt tasks
* In the Kotlin/JVM tasks, move the compiler arguments setup logic to
  a separate class, so that it can be reused by the Kapt tasks without
  directly referencing the Kotlin/JVM tasks

* In the Kapt tasks, carefully capture the values using the Provider API
  so that the task can be serialized for Instant Execution and then
  deserialized and executed without relying on the project model

Issue #KT-35181 Fixed

(cherry picked from commit f9acc0ab88)
2020-01-15 23:55:49 +03:00
Ilmir Usmanov
0ddeb3975c Unconditionally remove $$forInline suffix from enclosing method
when transforming objects with suspend functions/lambdas, which
capture crossinline suspend lambdas. Since functions with the
suffix have a counterpart without the suffix, for java interop
and reflection call purposes, it is safe change.
 #KT-31242 Fixed
2020-01-15 15:12:57 +01:00
Ilya Kirillov
bbb0788e4a New J2K: fix exception when met PsiLambdaParameterType
#KT-35431 fixed

(cherry picked from commit a10f37dd50)
2020-01-15 14:18:25 +03:00
Ilya Kirillov
0dcec158ec New J2K: fix converting multiline comment with /* inside
#KT-18001 fixed
#KT-35081 fixed

(cherry picked from commit 5be80be74d)
2020-01-15 14:18:24 +03:00
Ilya Kirillov
b3654b7d03 New J2K: add missing line break between property and getter
#KT-35739 fixed

(cherry picked from commit a87de01c74)
2020-01-15 14:18:24 +03:00
Ilya Kirillov
47ee2452aa New J2K: fix incorrectly removed line break before constructor comment
That caused class body brace to be under the comment

#KT-35478 fixed

(cherry picked from commit b83a529b77)
2020-01-15 14:18:23 +03:00
Ilya Kirillov
3990d7337a New J2K: correctly convert compound Java assignment expression
#KT-35476 fixed

(cherry picked from commit 7bfad12e6a)
2020-01-15 14:18:23 +03:00
Ilya Kirillov
0b7f44d5ea New J2K: fix UninitializedPropertyAccessException when calculating type of anonymous class
#KT-35395 fixed

(cherry picked from commit 6a8a68a263)
2020-01-15 14:18:22 +03:00
Ilya Kirillov
62eaad300a New J2K: Fix SOE in nj2k Java declarations printer
(cherry picked from commit 7882f566be)
2020-01-15 14:18:22 +03:00
Ilya Kirillov
77cc29b42d New J2K: remove initializer from property without backing field
#KT-33637 fixed

(cherry picked from commit 14a8d3726d)
2020-01-15 14:18:21 +03:00
Leonid Startsev
85dd870693 Supply correct Native platform for module descriptor while compiling from CLI
(cherry picked from commit 9bd966c123)
2020-01-15 12:51:07 +03:00
Leonid Startsev
dddab06b9f Support .decodeSequentially call on JVM and Native and remove READ_ALL handling from all platforms
Fix codegen test

Ignore JVM IR codegen test for a while since it requires updated kotlinx-serialization-runtime in classpath

(cherry picked from commit f2026a49bb)
2020-01-15 12:50:49 +03:00
Yaroslav Chernyshev
49f7aa38ea [Gradle, Native] Added subspecs support in CocoaPods plugin
#KT-32750 fixed
2020-01-15 15:42:59 +07:00
Alexander Gorshenev
797dd80ee5 Allow parallel access to klib zip filesystem 2020-01-14 19:12:30 +03:00
Nicolay Mitropolsky
2d8701a2d9 Uast: fake light method for uast is created only when containing class exists (KT-35310, EA-219604)
(cherry picked from commit 23c2a5c830)
2020-01-14 17:05:29 +03:00
Nicolay Mitropolsky
3330db8c7b Uast: the returnType support for light methods for reified functions (KT-35610)
(cherry picked from commit ed4e73c8e9)
2020-01-14 17:05:27 +03:00
Nicolay Mitropolsky
c54f55d460 Uast: properly handling annotations on destructured variables (KT-35673, EA-220128)
(cherry picked from commit c04ba009e6)
2020-01-14 17:05:26 +03:00
Vladimir Dolzhenko
6aa9fe6def IAE: RangeMarkerImpl.<init>
#EA-141884 Fixed
2020-01-14 13:11:22 +01:00
Vladimir Dolzhenko
e972901b9c Access index under runReadActionInSmartMode in ProbablyContractedCallableNamesImpl
#EA-219476 Fixed
2020-01-14 13:11:10 +01:00
Vladimir Dolzhenko
c5a669ead4 Improve investigation info in KtDotQualifiedExpression
Relates to #EA-212081
2020-01-14 13:11:01 +01:00
Vladimir Dolzhenko
5d4ab93db3 Access index under runReadActionInSmartMode in KotlinRuntimeLibraryUtil
#EA-220414 Fixed
2020-01-14 13:10:52 +01:00
Vladimir Dolzhenko
550d057fc8 Edit kdoc reference in Introducing import alias
#KT-35837 Fixed
2020-01-14 13:10:41 +01:00
Vladimir Dolzhenko
c26522dfd2 Handle kdoc case for Introduce import alias inspection
#EA-210889 Fixed
2020-01-14 13:10:30 +01:00
Vladimir Dolzhenko
5f6f2f8af9 Module info has to be read under readAction in KotlinConfigurationCheckerComponent
#EA-209610 Fixed
2020-01-14 13:09:57 +01:00
Vladimir Dolzhenko
bc5ffe14a9 Improve investigation info in PackageCodegenImpl
Relates to #EA-218779
2020-01-14 13:09:46 +01:00
Vladimir Dolzhenko
dc8b3ffd8a Handle \r line endings in plaintext j2k
#KT-35831 #EA-209568 Fixed
2020-01-14 13:09:35 +01:00
Vladimir Dolzhenko
e1beebde08 Handle java ctor case for Introduce import alias inspection
#KT-35824 #EA-218654 Fixed
2020-01-14 13:09:23 +01:00
Vladimir Dolzhenko
edfe97a165 Add more investigation info to diagnoseUnknownModuleInfo
Relates to #EA-220276
2020-01-14 13:09:08 +01:00
Vladimir Dolzhenko
0e66b5ed9d Add disposable to document listener in ScratchEditorSyncHighlighter
#EA-220382 Fixed
2020-01-14 13:08:32 +01:00
Vladimir Dolzhenko
803df7d7a1 Fix renaming class according to a file name when file name has no name (but extension)
#EA-219715 Fixed
2020-01-14 13:08:23 +01:00
Vladimir Dolzhenko
4f3e26e7be Commit documents before createResourceReference in KotlinAndroidAddStringResource
#EA-127016 Fixed
2020-01-14 13:08:09 +01:00
Vladimir Dolzhenko
87477fe15a Add more investigation info to getFilesForElements
Relates to #EA-209630
2020-01-14 13:08:00 +01:00
Vladimir Dolzhenko
175d0da3e8 Module info has to be read under readAction in scriptDefinitionsFromDependencies
#EA-220355 Fixed
2020-01-14 13:07:46 +01:00
Vladimir Dolzhenko
3eb3e55d6f Module info has to be read under readAction in KotlinNativeABICompatibilityChecker
#EA-220356 Fixed
2020-01-14 13:07:37 +01:00
Ilya Gorbunov
85b931b64a Rewrite UnderMigration and MigrationStatus in Java
to remove dependency on kotlin-stdlib.

#KT-33141

(cherry picked from commit 0764a065e8)
2020-01-14 14:34:08 +03:00
Miguel Serra
5a9e771197 KT-20357: Add samples for linkedSetOf
(cherry picked from commit 4fa5e2d85c)
2020-01-14 14:34:08 +03:00
Tillmann Berg
94b82080bc KT-20357: Add sample for reduce, reduceRight and their indexed counterparts
(cherry picked from commit 95300ae31d)
2020-01-14 14:34:08 +03:00
Ilya Gorbunov
cd7a6989ec Add more reduceOrNull tests
- Test for unsigned arrays
- Update binary api dump with the new functions

(cherry picked from commit 6d092b5f71)
2020-01-14 14:34:08 +03:00
Alfredo Delli Bovi
5bfc9ad010 Add sample for reduceOrNull and reduceRightOrNull
(cherry picked from commit 9546307243)
2020-01-14 14:34:07 +03:00
Alfredo Delli Bovi
f28c13bdcc KT-33761 Add reduceRightOrNull
(cherry picked from commit 06008c40ab)
2020-01-14 14:34:07 +03:00
Alfredo Delli Bovi
773cdf314f KT-33761 Add reduceOrNull
(cherry picked from commit f5d696d3c4)
2020-01-14 14:34:07 +03:00
Abduqodiri Qurbonzoda
cc8dcef9aa Rename Appendable methods parameters
(cherry picked from commit b868e6f8da)
2020-01-14 14:34:07 +03:00
Ilmir Usmanov
16d78e45a7 Disable tail-call optimization for suspend functions with Unit return type
if it overrides functions with another return type.
Otherwise, we cannot determine on call site that the function returns Unit
and cannot { POP, PUSH Unit } in order to avoid the situation when callee's
continuation resumes with non-unit result. The observed behavior is that
suspend function, which should return Unit, suddenly returns other value.
 #KT-35262: Fixed
2020-01-14 12:21:23 +01:00
Ilya Matveev
4d0c015575 IDEA plugin: Don't create iOS test in the share lib project template
Since 1.3.70 an iOS simulator test task is created by the MPP Gradle
plugin out of the box. So we stop creating such a task manually in
the shared library project template.

Issue #KT-35560 Fixed.
2020-01-14 17:44:08 +07:00
Vladimir Dolzhenko
787192fc0d Drop UNREACHABLE_CODE eager text range calculation
#KT-35242 Fixed

(cherry picked from commit 272ca002d7)
2020-01-14 11:25:00 +01:00
Ilya Chernikov
49791a3207 Allow only single expression eval in cli compiler and kotlin runner
#KT-35740 fixed
also add tests and drop logger usage in the cli dependencies manager:
the logger is normally unitialized in the usage scenarios, but related
warnings are annoying.

(cherry picked from commit 995c6a32b8)
2020-01-14 07:59:51 +01:00
Ilya Chernikov
8c24a860c1 [minor] "fix" fir testdata for KT-30245 test, todo: fix problems in fir accordingly
(cherry picked from commit 9da536c202)
2020-01-14 07:59:51 +01:00
Ilya Chernikov
a014725187 [NI] Convert extension lambda to the non-extension one, if needed
#KT-30245 fixed
2020-01-14 07:59:51 +01:00
Ilya Goncharov
7fa0f15a11 [Gradle, JS] Actualize node and yarn version
#KT-35599 fixed

(cherry picked from commit 74889ef3ad)
2020-01-13 19:17:09 +03:00
Ilya Goncharov
f05288848c [Gradle, JS] Add check on run and dist task
- Check existence of compile output file to prevent fail in case of NO-SOURCE

#KT-31894 fixed

(cherry picked from commit 24e3310393)
2020-01-13 19:17:09 +03:00
Vyacheslav Gerasimov
4efebea5db Build: Specify version explicitly for com.github.node-gradle.node 2020-01-13 15:48:10 +03:00
Yan Zhulanow
804c57d90a Update Changelog: add entries for 1.3.70 EAP 1 2020-01-13 17:33:30 +09:00
Yan Zhulanow
464076b5d1 Update Changelog: add entries from 1.3.60/61 2020-01-13 17:31:48 +09:00
nikita.movshin
116e34a0ae Update K/N version 2019-12-26 19:46:21 +03:00
Vyacheslav Gerasimov
0d60f2b5b9 as40: Minor: Fix copyright header in AbstractModelBuilderTest.java
(cherry picked from commit 5a9070b6da)
2019-12-26 16:40:55 +03:00
Vyacheslav Gerasimov
21c3050e96 as40: Fix duplicate registration of kotlin-copyright
(cherry picked from commit 3d79e4609e)
2019-12-26 16:40:55 +03:00
Vyacheslav Gerasimov
ba57ab531b Build: Fix android-wizardTemplate-plugin dependencies
Present only in AS 3.6

(cherry picked from commit 7b1c4e72ba)
2019-12-26 16:40:55 +03:00
Vyacheslav Gerasimov
4ca8140d50 as40: Fix test compilation for AS 4.0 C7 2019-12-26 16:40:54 +03:00
Vyacheslav Gerasimov
e2edf54c86 as40: Fix KotlinDslScriptModelProvider and KotlinDslScriptModelResolver for AS 4.0 C7 2019-12-26 16:40:54 +03:00
Vyacheslav Gerasimov
923c1b1bf0 as40: Upgrade to AS 4.0 C7 2019-12-26 16:40:54 +03:00
Vyacheslav Gerasimov
675806569a Build: Use tar.gz extension for linux AS distributions 2019-12-26 16:40:54 +03:00
Vyacheslav Gerasimov
1e1ffcc4b4 Build: Add Ide.AS40 constant
(cherry picked from commit eda27ab298)
2019-12-26 16:40:54 +03:00
Vyacheslav Gerasimov
04a63cc87b Build: Add as40 to .bunch
(cherry picked from commit 19233ee120)
2019-12-26 16:40:54 +03:00
Alexander Gorshenev
c07d04e459 Don't search for expects when not given -Xmpp-klibs 2019-12-26 11:34:56 +03:00
nikita.movshin
0c71dde729 Update K/N version 2019-12-25 17:37:06 +03:00
Igor Chevdar
15384c9230 [native-gradle-plugin] Disabled cache building for iOS devices 2019-12-25 15:52:06 +05:00
nikita.movshin
415750c393 Update K/N version 2019-12-24 11:31:25 +03:00
Igor Chevdar
14f670f058 [kotlin-native-plugin] Disabled compiler daemon for now 2019-12-23 16:24:20 +03:00
Igor Chevdar
6886f1390d [kotlin-native-plugin] Two fixes:
* Added property to select the cache kind (none, dynamic, static)
* Fixed the check if the cache needs to be rebuilt
2019-12-23 13:32:03 +03:00
Mikhail Zarechenskiy
23c61dfb54 Fix ambiguity between Java and Kotlin SAM candidates
Because of incorrect flag we generated synthetic SAM candidates and got ambiguity when feature `SamConversionPerArgument` was enabled (Gradle case) because candidates for Java were duplicated

 #KT-35579 Fixed
2019-12-23 12:48:43 +03:00
Igor Yakovlev
895f2d609b Fix allopen call from UL methods
Fixed #KT-35577
2019-12-20 18:28:50 +03:00
Ilya Kirillov
1feda25af3 New J2K: Fix not converted jetbrains nullability annotations for types
it became broken after annotation started to be assigned to type elements
instead of declarations after 4da7d11

#KT-34987 fixed

(cherry picked from commit 92f8432b1e)
2019-12-20 13:05:34 +03:00
Roman Artemev
e4c06a63e7 Update bootstrap to #1.3.70-eap-17 2019-12-19 15:30:47 +03:00
nikita.movshin
7887cfdf99 Update K/N version 2019-12-19 14:39:39 +03:00
nikita.movshin
ae87b0a83e Update K/N version 2019-12-19 11:00:57 +03:00
Igor Chevdar
2cf6f0b00d [IR Serialization] Removed native-specific hack in mangler 2019-12-18 14:48:03 +03:00
Zalim Bashorov
2427764a87 [IDE, klib] Support in IDE klibs with dynamic type 2019-12-17 22:05:08 +03:00
Alexander Gorshenev
ae996c4819 Properly mute (and unmute) tests for unrelated backends 2019-12-17 20:57:39 +03:00
Alexander Gorshenev
c97abf79fc Reconciled -Xklib-mpp with commonizer 2019-12-17 20:57:39 +03:00
Alexander Gorshenev
5525b1cef5 Expect/actual support in klibs under -Xklib-mpp 2019-12-17 20:57:39 +03:00
Roman Artemev
c397da5e3f [KLIB] Fix references to type made from TypeParameter in KotlinMangler
- promote ABI version

(cherry picked from commit cad3cb1bbe)
2019-12-17 19:37:53 +03:00
Svyatoslav Kuzmich
a71f272b59 [JS IR BE] Support typeOf 2019-12-17 19:17:28 +03:00
Svyatoslav Kuzmich
644d25e3e5 [JS IR] Properly report compiler errors
Report compiler errors using message collector
Instead of crashing with stack trace
2019-12-17 19:17:28 +03:00
Roman Artemev
85949ab82d [JS IR] Fix external fields naming
(cherry picked from commit 0b7c11c96e)
2019-12-17 17:37:24 +03:00
Roman Artemev
d8e6937891 [JS IR] Fix state machine builder
(cherry picked from commit 02db5ea0eb)
2019-12-17 17:37:24 +03:00
Roman Golyshev
ea7b929543 Add ML completion jar to the resulting plugin jar
- Without it, ML completion jar will not be present in the runtime, causing errors when ML completion is enabled
- This step should have been done in 28ec74648e commit

(cherry picked from commit 8e53ccb852)
2019-12-17 16:35:38 +03:00
Dmitry Gridin
3365dfa5ae KotlinImportOptimizer: should use with isIndeterminate=false
#KT-34928 Fixed

(cherry picked from commit cdabff1941)
2019-12-17 20:20:39 +07:00
Igor Chevdar
33c7df6457 [IR] Remapped some forgotten types during IR copying 2019-12-17 15:50:45 +03:00
Mikhael Bogdanov
3e219f4ebf Keep original casts during reification to avoid VerifyError
#KT-26435 Fixed

(cherry picked from commit 03c2350e79)
2019-12-17 12:48:16 +01:00
Igor Chevdar
eb0ba37e88 [gradle-native-plugin] Build static caches instead of dynamic 2019-12-17 14:38:38 +03:00
Natalia Selezneva
759d1da0df Fix configuration for AS 3.5
(cherry picked from commit e77d8657f4)
2019-12-17 09:30:02 +03:00
Natalia Selezneva
38b0de4ab6 Scripting: do not start multiple request when related file was changed 2019-12-16 14:55:50 +03:00
Natalia Selezneva
fba17d5b9a Minor, tests: clear memory cache in tests that check scripting file attributes 2019-12-16 14:55:49 +03:00
Natalia Selezneva
780c61dc16 Fix line separators in tests 2019-12-16 14:55:47 +03:00
Natalia Selezneva
31887d2fd1 Scripting: check if affected scripts are changed using file modification stamp instead of mark them out of date in cache
^KT-35205 Fixed
2019-12-16 14:55:47 +03:00
Natalia Selezneva
ec04f0059c Scripting: do not threat comments and spaces as modifications inside essential block 2019-12-16 14:55:46 +03:00
Natalia Selezneva
2f35d6d868 Scripting: save inputs stamp and diagnostics to file attributes
Check if they are up to date and initiate configuration update only in case they are out of date

^KT-35205
2019-12-16 14:55:45 +03:00
Natalia Selezneva
13b4e8716c Changes inside initscript and pluginManagement blocks should invalidate script configuration
^KT-35129 Fixed
2019-12-16 14:55:43 +03:00
Natalia Selezneva
d68c3584f2 Scripting: add test for loading configuration for gradle scripts 2019-12-16 14:55:42 +03:00
Natalia Selezneva
424a2c72b2 Implement KotlinWordsScanner
This will allow to correctly calculate the file modification crc based on it. this is needed for build.gradle.kts files which show notification about necessity of importing project. Otherwise this notification is shown on every file modification (after virtualFile save)
2019-12-16 14:55:41 +03:00
Natalia Selezneva
886e9613b8 Move script related extensions to separate xml-s 2019-12-16 14:55:40 +03:00
Natalia Selezneva
2e933507c6 Fix duplicated “Kotlin Script” definition for Gradle/Kotlin projects (KT-35096)
^KT-35096 Fixed
2019-12-16 14:55:40 +03:00
Denis Zharkov
153d894afb FIR: Optimize ConeTypeContext::asSimpleType 2019-12-16 13:09:48 +03:00
Denis Zharkov
1790dcf80c FIR: Reorder when entries in ConeTypeContext::typeConstructor
More expected types should be checked first
2019-12-16 13:09:48 +03:00
Denis Zharkov
a14852a6ec Minor. Make ConeClassLikeTypeImpl final 2019-12-16 13:09:48 +03:00
Sergey Rostov
ac81f046fd gradle.kts importing test: don't run on 191 (including as34) 2019-12-16 12:59:02 +03:00
Leonid Startsev
a2d8e2435f Reorder steps in psi2ir so postprocessing goes before unbound symbols stub generating
This is required because currently IR compiler plugins are launched during 'postprocess' step
and for correct work they require unbound symbols for plugin-provided declarations
(see commit message of 3e18350a for detailed explanation)
2019-12-16 12:42:18 +03:00
Mikhail Glukhikh
737eaebee6 FIR resolve: fold flexible types whenever possible #KT-31528 Fixed 2019-12-16 12:06:10 +03:00
Sergey Rostov
9f5a02dc7a gradle.kts importing: fix as36 2019-12-16 11:24:35 +03:00
Mikhail Glukhikh
637e6f5acc FIR: add forgotten test data for old FE test 2019-12-16 11:10:19 +03:00
Mikhail Glukhikh
acf48a1af7 Return NONE from FirSuperTypeScope if nothing is found 2019-12-16 10:50:52 +03:00
Mikhail Glukhikh
001af68495 FIR: distinguish lazy/non-lazy nested scopes more clear 2019-12-16 10:50:52 +03:00
Mikhail Glukhikh
fea224749b FIR: introduce symbolProvider.getNestedClassifierScope to choose lazy/non-lazy
For some reason this breaks two old FE based tests with member type aliases.
It's not very interesting because member aliases aren't supported.
2019-12-16 10:50:52 +03:00
Mikhail Glukhikh
663d545d79 FIR: get rid of symbolProvider.getClassDeclaredMemberScope at all 2019-12-16 10:50:52 +03:00
Mikhail Glukhikh
af87a183c2 FIR: get rid of symbolProvider.getClassDeclaredMemberScope usages in compiler 2019-12-16 10:50:52 +03:00
Mikhail Glukhikh
f497231acd FIR: try to use JavaSymbolProvider directly in lazy nested classifier scope 2019-12-16 10:50:52 +03:00
Sergey Rostov
48d60ed4ea revert accidentally changed vcs.xml 2019-12-16 10:38:42 +03:00
Sergey Rostov
039090d2bf gradle.kts importing tests: run gradle 6.0.1 only for that test 2019-12-16 10:31:12 +03:00
Sergey Rostov
1930ab7c38 gradle.kts importing: reduce bunch files 2019-12-16 10:31:11 +03:00
Sergey Rostov
c0690ff5f6 gradle.kts importing: move code to dedicated package 2019-12-16 10:31:11 +03:00
Sergey Rostov
6e3e65c490 gradle.kts importing: add support for included builds and fix sub projects 2019-12-16 10:31:11 +03:00
Sergey Rostov
fef193be63 gradle.kts: add tests for importing scripts configuration 2019-12-16 10:31:11 +03:00
Sergey Rostov
dcd67d79f4 gradle.kts: script models should be imported in ProjectData key, not in GradleSourceSetData
Or it will be fail if there is no source sets (see org.jetbrains.kotlin.idea.codeInsight.gradle.GradleKtsImportTest.testEmpty for reproduction)
2019-12-16 10:31:11 +03:00
Sergey Rostov
fd16078a34 gradle.kts: add clearCaches method for testing 2019-12-16 10:31:11 +03:00
Sergey Rostov
559b067f91 gradle.kts: move areSimilar to utils.kt to use in tests 2019-12-16 10:31:11 +03:00
Mikhail Glukhikh
249f72585d Fix test data in FIR old FE diagnostics test
Probably broken by 13 Dec commits of Denis Zharkov
2019-12-16 10:27:05 +03:00
Igor Yakovlev
2639ed2c48 Fix invalid equality for UL methods
Potentially fixed #KT-34796
2019-12-15 23:42:31 +03:00
Anton Bannykh
d6fcde7316 JS_IR: fix typecheck corner case
Consider `fun <E : I> foo(a: Any?) = a as? E`, where I is an interface.
This check used to fail, because the `a == null` was missing, and
the `isInterface` stdlib method crashes if the first argument
is null. This change adds the null check.

Also this change prettifies the instance check in case of type parameter
left operand.
2019-12-15 17:36:24 +03:00
Anton Bannykh
9a971172c9 JS: fix object expression constructor delegation to secondary constructors with default arguments (KT-30517 fixed) 2019-12-15 15:21:23 +03:00
Victor Petukhov
419d414681 NI: Update FIR test data after 07269661b4 2019-12-14 17:52:57 +03:00
Georgy Bronnikov
92c2cfa968 JVM_IR: handle property references at class level 2019-12-13 20:44:09 +03:00
Vyacheslav Gerasimov
8d303af395 Build: Add build scan server url setting 2019-12-13 20:11:18 +03:00
Vyacheslav Gerasimov
724884513e Build: Extract build cache setup to kotlin-build-gradle-plugin 2019-12-13 20:11:18 +03:00
Vyacheslav Gerasimov
68ce5dbd90 Build: Use property for disabling/enabling local build cache 2019-12-13 20:11:18 +03:00
Vyacheslav Gerasimov
bfcac5b091 Build: Update kotlin-build-gradle-plugin to 0.0.4 2019-12-13 20:11:18 +03:00
Vyacheslav Gerasimov
283933ace5 Build: Add localBuildCacheEnabled property 2019-12-13 20:11:18 +03:00
Vyacheslav Gerasimov
729b4d33cf Build: Replace deprecated compile configuration with implementation in build script of buildSrc 2019-12-13 20:11:18 +03:00
Vyacheslav Gerasimov
85dcc65695 Build: Use kotlin-build-gradle-plugin in build script of buildSrc 2019-12-13 20:11:18 +03:00
Alexander Shustanov
c9cba34d67 KT-35454 Weird implementation of KtUltraLightFieldImpl.isEquivalentTo 2019-12-13 20:07:45 +03:00
Dmitry Savvinov
f45c11c6f2 Use constantSdkDependencyIfAny in getKeyForSdk as well 2019-12-13 19:11:02 +03:00
Dmitriy Dolovov
5b8be16f13 Kotlin/Native IDE plugin clean-up
- Re-organize classes
2019-12-13 15:52:25 +03:00
Dmitriy Dolovov
36ed29d4d5 Convert KotlinNativeMetaBinary from Java to Kotlin 2019-12-13 15:52:17 +03:00
Dmitriy Dolovov
511a4089ca Kotlin/Native IDE plugin clean-up
- Drop KotlinNativeMetadataVersion in favor of KlibMetadataVersion
- Drop KotlinNativeProtoBasedClassDataFinder in favor of KlibMetadataClassDataFinder
2019-12-13 15:52:10 +03:00
Dmitriy Dolovov
992a702762 Minor: organized imports 2019-12-13 15:52:03 +03:00
Dmitriy Dolovov
deb4025987 Fix: Use more precise KLIB compatibility check (by metadata version)
Issue #KT-34811
2019-12-13 15:51:54 +03:00
Denis Zharkov
34e1ab4e7a FIR: Leave single implementation of ConeInferenceContext 2019-12-13 14:39:06 +03:00
Denis Zharkov
28f4d62ccf FIR: Add different extension for FirSession.inferenceContext 2019-12-13 14:39:06 +03:00
Denis Zharkov
b33d0c2594 Minor. Reformat ConeInferenceContext 2019-12-13 14:39:06 +03:00
Denis Zharkov
0baf1e8fa7 Minor. Get rid of UniversalConeInferenceContext 2019-12-13 14:39:06 +03:00
Denis Zharkov
bbc9927bce Minor. Get rid of DataFlowInferenceContext 2019-12-13 14:39:06 +03:00
Denis Zharkov
0064429339 Avoid using TypeSystemInferenceExtensionContextDelegate in FIR
It's only needed in old FE to avoid clashes when initializing DI

The main idea is gettind rid of intermediate interfaces because
each of them adds another intermediate DefaultImpls call
2019-12-13 14:39:06 +03:00
victor.petukhov
25fdbdfecb NI: Update FIR test data 2019-12-13 11:49:32 +03:00
Yan Zhulanow
a19f8ffe6a Revert "Debugger: Add IR-powered ranking tests"
This reverts commit ce21a559

Because of the erroneous behavior in 'BuilderFactoryForDuplicateSignatureDiagnostics.groupMembersDescriptorsBySignature', two functions with arguments of different inline class types are considered to have the same JVM signature.
Before the error wasn't reported, as classes didn't have proper source elements.
This issue has to be fixed before enabling ranking tests.
2019-12-13 12:23:24 +09:00
Victor Petukhov
1534e2b76d NI: Actualize FIR test after 2d5a05466d 2019-12-13 00:17:37 +03:00
Victor Petukhov
07269661b4 NI: Allow to resolve to functions with SAM conversion and passing array without spread as vararg (with warning)
^KT-35224 Fixed
2019-12-12 23:46:16 +03:00
Simon Ogorodnik
fe875d628d Revert "[FIR] Fix outputs for logs of modularized test"
This reverts commit ae15fa76
2019-12-12 21:23:27 +03:00
Simon Ogorodnik
60cc9fa6f5 Revert "[FIR] Fix outputs for logs of modularized test"
This reverts commit ae15fa76
2019-12-12 20:55:13 +03:00
victor.petukhov
71cb65c064 NI: Add flexible Nothing to trivial constraints to filter it 2019-12-12 18:45:11 +03:00
victor.petukhov
2d5a05466d NI: Fix some unwanted exclusions constraints with remained corresponding optimization 2019-12-12 18:45:07 +03:00
Juan Chen
15f6beed57 Fix Compose extension points in compiler.xml 2019-12-12 18:30:54 +03:00
Mikhael Bogdanov
b95e7dfb6f Don't mark super call to method from any as interface one
#KT-35426 Fixed
2019-12-12 15:29:53 +01:00
Igor Chevdar
df2adb060c Bumped K/N version 2019-12-12 16:53:59 +03:00
Igor Chevdar
a7b3f26cef [native-gradle-plugin] Supported klib cache (building and using) 2019-12-12 16:53:59 +03:00
Ilya Goncharov
364d6a5afa [Gradle, JS] Actualize NPM dependencies 2019-12-12 16:44:30 +03:00
Dmitriy Novozhilov
f1f2e1830b [FIR-TEST] Fix incorrect testdata 2019-12-12 16:11:47 +03:00
Dmitriy Novozhilov
4faa2c0c2c [FIR] Replace static cone types for integers with default classIds in ILT 2019-12-12 16:11:47 +03:00
Dmitriy Novozhilov
c6b9593157 [FIR-TEST] Add identity checker of old frontend and fir testdata to old FE diagnostics tests 2019-12-12 16:11:47 +03:00
Dmitriy Novozhilov
579cb5014a [FIR-TEST] Add !FIR_DUMP directive to diagnostics tests from old frontend 2019-12-12 16:11:47 +03:00
Dmitriy Novozhilov
2536fa0cd5 [FIR-TEST] Add new testdata generated after changes in previous commit 2019-12-12 16:11:46 +03:00
Dmitriy Novozhilov
e9c02a1cca [FIR-TEST] Add fir diagnostics test based on diagnostics tests from old frontend 2019-12-12 16:11:46 +03:00
Dmitriy Novozhilov
e7f8c8e155 [TEST] Regenerate tests after previous commit 2019-12-12 16:11:45 +03:00
Dmitriy Novozhilov
5b1f96ba1b [TEST] Add ability to exclude some testdata with pattern in test generator 2019-12-12 16:11:42 +03:00
Dmitriy Novozhilov
ae15fa7676 [FIR] Fix outputs for logs of modularized test 2019-12-12 16:11:42 +03:00
Georgy Bronnikov
bb301f8aca JVM_IR: fix wrong check in skipping captured vars 2019-12-12 15:38:18 +03:00
Mikhael Bogdanov
26032e4297 Split exception table on finally insertion before non-local return
in nested try blocks without finally

 #KT-31653 Fixed
2019-12-12 13:33:40 +01:00
Mikhael Bogdanov
c335015c05 Generate proper exception table
Don't forget to split nested try blocks without finally block
 on generating finally blocks from outer ones.

 #KT-31923 InProgress
2019-12-12 13:33:39 +01:00
Igor Chevdar
078cfc02a5 [IR] Removed wrong validation
IrEnumConstructorCall behaves differently whether it is inside IrEnumEntry or not.
Remove the validation for now.
2019-12-12 15:05:47 +03:00
Alexander Udalov
62ef280c53 Add compiler:ir.serialization.jvm to IDEA plugin
This fixes a problem caught by the Plugin Verifier. Kotlin IDEA plugin
depends on the JVM IR backend, which depends on ir.serialization.jvm now
2019-12-12 15:03:47 +03:00
Alexander Udalov
5f367278c1 Psi2ir: support generic properties in class delegation
Since property accessor descriptors (unlike corresponding IR elements)
do not have type parameters, we need to take them from the corresponding
property to ensure the correct IR for delegated property accessors.
2019-12-12 15:02:32 +03:00
Alexander Udalov
025360edc4 JVM IR: lookup symbols by name in ProgressionHandlers in known classes only
Alternatively, we could improve the lookup utilities and their usages to
always find the exact override of a symbol from
Collection/Iterable/CharSequence/etc, but since we need to load the
original symbol anyway in cases when the loop subject's type is a type
parameter, we might as well simplify everything and always reference the
original symbol.

Also improve exception message and removed unused declarations in
IrBackendUtils.kt.
2019-12-12 14:55:47 +03:00
Dmitriy Dolovov
359e49fa02 [Commonizer] Blacklist conflicting K/N functions from commonization 2019-12-12 14:52:31 +03:00
Dmitriy Dolovov
c79fcb8cf3 [Commonizer] Add compatible metadata version checks 2019-12-12 14:52:18 +03:00
Dmitriy Dolovov
503fc4883c [Commonizer] Log duration of each CLI phase 2019-12-12 14:52:10 +03:00
Dmitriy Dolovov
18117ed1f3 [Commonizer] Serialize commonized metadata for KLIB writer
- introduce EmptyDescriptorTable
- wipe out unused BindingContext from KlibMetadataSerializer
2019-12-12 14:52:02 +03:00
Dmitriy Dolovov
ce376f49fd [Commonizer] CLI for Kotlin/Native KLIBs 2019-12-12 14:51:55 +03:00
Dmitriy Dolovov
5bc2a4e1e8 [Commonizer] Fix: Don't commonize contents of stdlib 2019-12-12 14:51:44 +03:00
Dmitriy Dolovov
ee42e8c64c [Commonizer] Fix: Correct resolution of nested classes 2019-12-12 14:51:36 +03:00
Dmitriy Dolovov
a74e364849 [Commonizer] Support Kotlin/Native forward declarations 2019-12-12 14:51:29 +03:00
Dmitriy Dolovov
f4780206d9 [Commonizer] Fix: Skip KNI bridge functions 2019-12-12 14:51:21 +03:00
Dmitriy Dolovov
0a6c132241 [Commonizer] Fix: Cache package fragments with module name 2019-12-12 14:51:14 +03:00
Dmitriy Dolovov
a3e3b43aed [Commonizer] Fix: approximate signatures with type parameter upper bounds 2019-12-12 14:51:05 +03:00
Dmitriy Dolovov
92656a53ae [Commonizer] Fix: don't process same package fragments more than once 2019-12-12 14:50:56 +03:00
Pavel Kirpichenkov
8dc2784fc4 Reapply "Drop deprecated displayName from descriptor visibility"
Cancel revert due to update in kotlin-mirror/master in native
This reverts commit 39e0c6d55b
2019-12-12 13:57:52 +03:00
Ilya Goncharov
6e19004a4f [Gradle, JS] Add comment for test 2019-12-12 12:42:35 +03:00
Ilya Goncharov
1bc47b3f6f [Gradle, JS] Add test for package.json deserializing 2019-12-12 12:42:35 +03:00
Ilya Goncharov
b9a529d7d0 [Gradle, JS] Hack for GSON to get non-null values 2019-12-12 12:42:35 +03:00
Ilya Goncharov
7d98d33e3d [Gradle, JS] Hack for GSON to get non-null values 2019-12-12 12:42:34 +03:00
Dmitriy Novozhilov
53480c2266 [FIR] Fix fir2ir testdata broken in 4777dd6 2019-12-12 10:04:12 +03:00
Pavel Kirpichenkov
39e0c6d55b Revert "Drop deprecated displayName from descriptor visibility"
This reverts commit 6fa11d1573.
2019-12-11 18:30:24 +03:00
Pavel Kirpichenkov
d9ef7d0c8a [NI] Update / mute diagnostics
Update diagnostics for new inference.
'Not enough information for parameter' should not be reported for
fake calls and functions with error return type, muted in tests.
2019-12-11 17:53:43 +03:00
Pavel Kirpichenkov
6fa11d1573 Drop deprecated displayName from descriptor visibility
Deprecated displayName has been replaced with internal and external display
names for better diagnostic messages.
2019-12-11 17:30:29 +03:00
Simon Ogorodnik
ebc1562b32 Filter out non-xml model files in modularized test 2019-12-11 17:21:02 +03:00
Simon Ogorodnik
48a05e3688 Support prefixed modularized test-data installation 2019-12-11 17:21:01 +03:00
pyos
498b41b148 JVM_IR: do not do invokeinterface on Object methods
This works on HotSpot, but might confuse other VMs.
2019-12-11 15:09:37 +01:00
Ilmir Usmanov
df0a86ea57 Add NOP as first instruction in coroutine's try blocks
#KT-35035 Fixed
2019-12-11 15:01:41 +01:00
Mark Punzalan
4777dd652b [FIR] Add tests to catch issues with smartcasting of accesses to functions
and properties (type information is stored for the symbol and ALL accesses
to the same symbol are smartcasted).
2019-12-11 16:57:41 +03:00
Mark Punzalan
f031b47363 [FIR] Fix issue with multiple smartcasts of this. 2019-12-11 16:57:41 +03:00
Mark Punzalan
91f97fa611 [FIR] Support FirCheckNotNullCall in HTML dump. 2019-12-11 16:54:15 +03:00
Mark Punzalan
6e00df06e8 [FIR] Add data flow analysis for FirCheckNotNullCall. 2019-12-11 16:54:15 +03:00
Mark Punzalan
692a83f7bb [FIR] Add FirCheckNotNullCall converted to CHECK_NOT_NULL intrinsic
function call.
2019-12-11 16:54:15 +03:00
Ilya Matveev
6bc0fe121a Gradle: Escape TC service messages in debug logs
The MPP plugin uses TC service messages to interact with JS and
native test runs an writes received messages to a debug log. But
if a build is executed by TeamCity, these log messages may be
treated by TC as actual service messages.

This patch transforms the logged messages to avoid this issue.
2019-12-11 19:57:22 +07:00
Ilya Matveev
33df86338b Gradle, tests: Improve tests for running simulator unit-tests 2019-12-11 19:57:22 +07:00
Ilya Matveev
254864a49d Gradle, native, JS: Support excluding tests using TestFilter
TestFilter.excludePatterns was introduced in Gradle 5.0. This
patch adds support for this API in native and JS test tasks
and deprecates the old property used for test excludes.
2019-12-11 19:57:21 +07:00
Ilya Matveev
cc3438f20c Gradle, native: Add separate classes for targets with different tests 2019-12-11 19:57:21 +07:00
Ilya Matveev
e6ab70c18d Gradle, native: Support simulator tests 2019-12-11 19:57:21 +07:00
Mikhael Bogdanov
8225c5a9ce Remove obsolete logic to IS_BUILT_WITH_ASM6 2019-12-11 13:49:34 +01:00
victor.petukhov
a92f58b1ac Revert "NI: Prefer nullable lower bound to flexible one when substitution of type variable is performed ^KT-32435 Fixed"
This reverts commit 09c2b92b
2019-12-11 15:32:46 +03:00
Ilya Goncharov
ccea2b73da [Gradle, JS] Add using Debuggable non headless chrome 2019-12-11 14:29:12 +03:00
Ilya Chernikov
354be2b14f [minor] Change expression evaluation cli argument to -Xexpression 2019-12-11 12:20:49 +01:00
Ilya Chernikov
ba056bf78c [minor] Remove irrelevant part of the test 2019-12-11 12:20:48 +01:00
Yan Zhulanow
748cbd7eec Import Kotlin JUnit run configuration settings from Gradle 2019-12-11 20:04:03 +09:00
Yan Zhulanow
0a9a08eab6 Rename Kotlin-specific Gradle configuration to "Kotlin Gradle" to avoid disambiguation 2019-12-11 20:04:03 +09:00
Yan Zhulanow
1bdff8f884 Rename Kotlin-specific JUnit configuration to "Kotlin JUnit" to avoid disambiguation 2019-12-11 20:04:03 +09:00
Toshiaki Kameyama
8477c1935c Run configuration: do not contain FQN in name
#KT-16886 Fixed
2019-12-11 20:04:03 +09:00
Yan Zhulanow
ce21a55943 Debugger: Add IR-powered ranking tests 2019-12-11 20:04:03 +09:00
Dmitry Gridin
31596f0d0b Formatter: fix some cases of call chain with wrap first call chain
#KT-35388 Fixed
2019-12-11 18:00:39 +07:00
Dmitry Gridin
e7ff0315d4 Formatter: fix line break before value parameter with annotation
#KT-23811 Fixed
2019-12-11 17:57:11 +07:00
Vladimir Ilmov
f05a452ef2 [coroutine][debugger] Unit test support added for Gradle run configurations. 2019-12-11 11:46:28 +01:00
Vladimir Ilmov
82cdcb421b jdi.StringReferenceImpl references replaced with StringReference 2019-12-11 11:44:02 +01:00
Egor Ushakov
e2010cb90d Do not cast to jdi impl classes 2019-12-11 13:16:27 +03:00
Mikhail Glukhikh
038ec8edcf Rethrow ProcessCanceledException in FIR resolve
Before this commit, we catched all exceptions at some points
and wrap them. For ProcessCanceledException it's incorrect,
because IDE logic does not expect wrapping of ProcessCanceledException
2019-12-11 13:01:38 +03:00
Mikhail Glukhikh
2b82618715 Fix unresolved references in bunch generate tests 2019-12-11 13:01:38 +03:00
Mikhail Glukhikh
9e263b6af2 FIR IDE: use registry to obtain kotlin.use.fir.resolution 2019-12-11 13:01:38 +03:00
Mikhail Zarechenskiy
cad0d7ff7f Fix compilation of maven-plugin test after 508330e0bb 2019-12-11 12:43:23 +03:00
Victor Petukhov
09c2b92b1d NI: Prefer nullable lower bound to flexible one when substitution of type variable is performed
^KT-32435 Fixed
2019-12-11 12:15:02 +03:00
pyos
78dfcef160 JVM_IR: move generateParameterNames to FunctionCodegen.kt 2019-12-11 08:19:55 +01:00
pyos
13a2879b78 JVM_IR: generate more correct parameter metadata 2019-12-11 08:19:55 +01:00
Tillmann Berg
cf86dc9a89 KT-20357: Add sample for Collections distinct and distinctBy methods 2019-12-11 07:42:05 +03:00
Ilya Gorbunov
f0e67f8397 Fix coreLibsInstall composite task
It was broken after the commit bbdbc2896b,
which included kotlin-stdlib-js-ir project into coreLibs list,
but that project didn't have 'install' task, on which 'coreLibsInstall' depends
2019-12-11 06:36:40 +03:00
Igor Yakovlev
6792d22c31 Fix minor bugs for UL methods and parameters representation
Remove INSTANCE field for local object declarations
Remove private suspend functions create from UL
Add correct extension function parameter name
Add support for setparam annotation modifier
2019-12-10 18:26:08 +03:00
Georgy Bronnikov
094de9fb5e IR: Do not capture variables from method calls in ClosureAnnotator
To call a method of a class, you never need to supply any values of
local variables (they would always be provided to the constructor).
2019-12-10 17:31:12 +03:00
Mikhail Glukhikh
344bc33096 [FIR TEST]: add problematic test with WeakHashMap.get ambiguity 2019-12-10 16:25:01 +03:00
Toshiaki Kameyama
12f17a6724 "Add constructor parameters" quick fix should add default parameters from super class (#2869)
#KT-33109 Fixed
2019-12-10 13:09:31 +01:00
Denis Zharkov
f0298aad77 FIR: Refine SAM support for methods with names from j.l.Object 2019-12-10 14:21:21 +03:00
Denis Zharkov
e89c777fc6 FIR: Create DefinitelyNotNull only for annotated types 2019-12-10 14:21:21 +03:00
Abduqodiri Qurbonzoda
56cae75404 Fix StringBuilder reverse test 2019-12-10 13:07:27 +03:00
Mikhail Glukhikh
edf5675415 [FIR TEST]: add problematic test with covariant array as receiver 2019-12-10 12:58:40 +03:00
Mikhail Glukhikh
7d62e3ce56 FIR: fix hasTopLevelClassOf optimization in deserialized provider
Before this commit, we answered 'no top level class' if Java class finder
could not calculate known class names. However, it's incorrect,
because this situation means 'don't actually know'.

To precise semantics, function name was also inverted
2019-12-10 12:58:39 +03:00
Mikhail Glukhikh
fa89aa0b49 Do not use member scope provider from FIR resolution API
In this commit we build self importing scope from scratch.
Using member scope provider is probably incorrect because of possible changes.
At any invalidation we should rebuild it.
2019-12-10 12:58:39 +03:00
Mikhail Glukhikh
718a679b72 FIR IDE API: add preliminary control of file in-block modifications
In this commit, we build FirFile from the beginning if in-block modifications are detected.
However, better way would be to rebuild only part of FirFile in this case
2019-12-10 12:58:39 +03:00
Mikhail Glukhikh
83ccd7dd1c FIR: implement separate diagnostic collector/reporter for IDE 2019-12-10 12:58:38 +03:00
Mikhail Glukhikh
fbf1dbf2da FIR: introduce error message renderer 2019-12-10 12:58:38 +03:00
Mikhail Glukhikh
e07b85ff34 FIR Java providers: insert some protection against ProcessCanceledException 2019-12-10 12:57:57 +03:00
Mikhail Glukhikh
cd089658bd IdeFirProvider: insert protection against ProcessCanceledException 2019-12-10 12:57:56 +03:00
Mikhail Glukhikh
fc117466a8 AbstractFirPsiCheckerTest: do partial error diagnostic comparison for some cases 2019-12-10 12:57:15 +03:00
Mikhail Glukhikh
4b251eb986 FIR IDE: lock FIR files before calling runResolve on them
This also fixes various synchronization problems
2019-12-10 12:57:13 +03:00
Mikhail Glukhikh
63121df6ba Synchronized IdeFirProvider.getOrBuild file, don't share RawFirBuilder
Before this commit RawFirBuilder was reused,
that provoked a lot of synchronization problems
2019-12-10 12:57:13 +03:00
Mikhail Glukhikh
ccb343e26b FIR: preliminary implementation of diagnostics highlighter (~30% supported) 2019-12-10 12:57:13 +03:00
Mikhail Glukhikh
34202faaa5 Code cleanup: KotlinPsiChecker 2019-12-10 12:57:12 +03:00
Mikhail Glukhikh
1d6d88b50c FIR reference resolve test: observe mute tests which are actually passing 2019-12-10 12:57:12 +03:00
Mikhail Glukhikh
f8c86d2f9f FIR reference resolve test: mute 37/107 cases which aren't yet supported 2019-12-10 12:57:11 +03:00
Mikhail Glukhikh
900227fdfa KtReferenceResolver: implement resolveToPsiElements() via FE IR (~60% supported) 2019-12-10 12:57:11 +03:00
Mikhail Glukhikh
809b7d8381 FirResolution: store enabled value in field with initial reading from component
Before this commit, we read/wrote 'enabled' directly from PropertiesComponent.
Now we do only initial reading and then store modified value in field.
This should make 'enabled' reading faster.
2019-12-10 12:57:11 +03:00
Mikhail Glukhikh
0d2d76696c Add FirResolution.enabled wrapper 2019-12-10 12:57:10 +03:00
Dmitriy Novozhilov
00112d4227 [FIR] Copy receiver of delegateProvider in fir building
There was a problem that receiver of `delegateProvider` and `expression` field
  of `FirWrappedDelegateExpression` was the same object, so after some changes in
  FirCallCompletionResultsWriterTransformer (where call was partially completed and then
  copied) there was a problem with resolve of `delegateProvider`, because reference of it's
  receiver had resolved reference, but type arguments were unsubstituted (see
  `testCommonCaseForInference`).

Maybe there is a better solution. E.g. we can transform type arguments in completion, so we don't need coping of function call at all
2019-12-10 12:25:42 +03:00
Dmitriy Novozhilov
51560f2f17 [FIR] Fix order of resolving children of FirProperty 2019-12-10 12:25:42 +03:00
Dmitriy Novozhilov
e281d224a3 [FIR] Fix testdata broken in b76c984b 2019-12-10 12:25:42 +03:00
Dmitriy Novozhilov
a89e9966e6 [FIR] Fix call completion of complex constant expressions with integer contants 2019-12-10 12:25:42 +03:00
Ilya Goncharov
f8b1e95830 [Gradle, JS] Inline single used method for prefix matching 2019-12-10 11:41:03 +03:00
Ilya Goncharov
8c6941dc5b [Gradle, JS] Java and JS difference in fqn should affect exclude patterns too 2019-12-10 11:37:13 +03:00
Ilya Goncharov
770e5147d0 [Gradle, JS] Java and JS difference in fqn should affect exclude patterns too 2019-12-10 11:37:13 +03:00
Ilya Goncharov
da16d48068 [Gradle, JS] Remove debug console 2019-12-10 11:26:48 +03:00
Ilya Goncharov
096a6c9551 [Gradle, JS] Fix failing Karma tests for empty tests
#KT-35318 fixed
2019-12-10 11:25:35 +03:00
Natalia Selezneva
36d87c9905 Mute GradleMultiplatformWizardTest
^KT-35368
2019-12-10 09:16:27 +03:00
Natalia Selezneva
b66fdad80c Set since build to IDEA 192.7142.36 for 192 bunch
Fix compilation in idea-gradle module
Android Studio 3.6 doesn't still contain some of those changes
2019-12-10 09:16:27 +03:00
Abduqodiri Qurbonzoda
19e001afad Commonize Float.rangeTo(Float) #KT-35299 2019-12-09 20:24:06 +03:00
Dmitriy Novozhilov
b76c984b26 [FIR] Support IntegerLiteralTypes 2019-12-09 17:24:26 +03:00
Dmitriy Novozhilov
5577f0f8cb [TMP] Make context in inference components universal 2019-12-09 15:28:24 +03:00
Dmitriy Novozhilov
4f3ff84d30 [FIR] [TMP] Complete lambdas that are not part of some call 2019-12-09 15:02:41 +03:00
Dmitriy Novozhilov
e560a67a89 [FIR] Resolve this reference in delegating constructors 2019-12-09 15:01:54 +03:00
Dmitriy Novozhilov
583e07b3e4 [FIR] Don't analyze properties twice 2019-12-09 13:31:39 +03:00
Ilya Chernikov
99b0435de5 Add possibility for JDKs substitution in the build script...
configure substitutions for 1.6 and 1.7 for non-TeanCity builds
2019-12-06 15:51:52 +01:00
Dmitry Petrov
f6b99955f8 Update testData in bytecodeText (argument nullability assertions) 2019-12-06 11:03:07 +03:00
Dmitry Petrov
d28743157a Mute testPlatformValueContains in JVM_IR 2019-12-06 11:03:07 +03:00
Dmitry Petrov
c83f68151c Support @EnhancedNullability in psi2ir 2019-12-06 11:03:07 +03:00
Dmitry Petrov
429bf78afa Add 'Collection#contains' as a special case to psi2ir tests 2019-12-06 11:03:07 +03:00
Dmitry Petrov
26782d7216 Fix exception message checking
Looks like there's no big difference between "J.s() must not be null"
and "s() must not be null".
2019-12-06 11:03:07 +03:00
Dmitry Petrov
a819104d81 JVM_IR: generate nullability assertions for private operators
If a fun is private, we still generate nullability assertions
in case when it is an operator.
This is for bug-to-bug compatibility with 1.3.
2019-12-06 11:03:07 +03:00
Dmitry Petrov
331347f9fe Mute tests for explicit 'equals' on boxed primitives 2019-12-06 11:03:06 +03:00
Dmitry Petrov
89e1941dfd Update testData for argument nullability assertion tests 2019-12-06 11:03:06 +03:00
Dmitry Petrov
fc7783c7dd JVM_IR: JvmArgumentNullabilityAssertionsLowering 2019-12-06 11:03:06 +03:00
Dmitry Petrov
c676b58c14 Minor: JvmBuiltinOptimizationLowering.kt: reformat & fix warnings 2019-12-06 11:03:06 +03:00
Dmitry Petrov
20fb519f1a PSI2IR: Generate IMPLICIT_NOTNULL casts for platform type values 2019-12-06 11:03:06 +03:00
Abduqodiri Qurbonzoda
dabf6376db Update js reachable nodes count after expanding StringBuilder api 2019-12-06 05:37:09 +03:00
Nicolay Mitropolsky
df3bee3038 Annotations: support injections in string arrays (KT-35222) 2019-12-05 19:31:57 +03:00
Mikhail Glukhikh
f82fe20d43 [FIR] fix test data according to last commits 2019-12-05 18:27:47 +03:00
Mikhail Glukhikh
53935db992 [FIR] fix compilation error (arose due to commit conflict) 2019-12-05 18:25:17 +03:00
Dmitriy Novozhilov
6f222edb88 [FIR] Add unresolved type counter to html dump 2019-12-05 18:17:13 +03:00
Mikhail Glukhikh
bef344b33e Optimization / clarifying: getFirClassifierContainerFile 2019-12-05 18:02:04 +03:00
Mikhail Glukhikh
2f3618041b FIR resolve: eliminate CallInfo.containingDeclaration as unused
This also fixes potential KNPE during its calculation
2019-12-05 18:02:04 +03:00
Mikhail Glukhikh
c1789a0ecc FIR IDE: synchronous creation/registration of sessions 2019-12-05 18:02:04 +03:00
Mikhail Glukhikh
70fa12d9d2 Extract FirDiagnosticsCollector to have creation logic in one place 2019-12-05 18:02:03 +03:00
Mikhail Glukhikh
9782ec1b1e FIR resolve phases: set BODY_RESOLVE phased properly
Before this commit, we never set this phase to declaration or file
2019-12-05 18:02:03 +03:00
Mikhail Glukhikh
26ee02ed02 FIR: replace resolve phase in FirFile properly 2019-12-05 18:02:03 +03:00
Mikhail Glukhikh
1539ee30ff FIR IDE: fix local class containing file search 2019-12-05 18:02:03 +03:00
Mikhail Glukhikh
d35a26a75b Optimization: introduce FirIdeResolveStateService to cache FirResolveState 2019-12-05 18:02:02 +03:00
Mikhail Glukhikh
b4760bcbd3 Extract AbstractResolveElementCacheTest to use in FIR cache testing 2019-12-05 18:02:02 +03:00
Mikhail Glukhikh
74a7a8c881 FIR resolve (minor): provide source element for resolved qualifier 2019-12-05 18:02:02 +03:00
Mikhail Glukhikh
8808c775a4 Introduce FirResolvedTypeRef.delegatedTypeRef to see children types in IDE
This is needed to have access to resolved children types (e.g. type arguments) from IDE
2019-12-05 18:02:02 +03:00
Dmitriy Novozhilov
38c1a50c1d [FIR] Resolve delegating constructor calls 2019-12-05 17:47:15 +03:00
Dmitriy Novozhilov
de77bd526b [FIR] Change default visibility for sealed class constructors from private to public 2019-12-05 17:47:15 +03:00
Dmitriy Novozhilov
d840671620 [FIR] Don't create delegating super constructor call to kotlin.Enum for enums 2019-12-05 17:47:14 +03:00
Dmitriy Novozhilov
a0d8e5bde7 [FIR] Don't create delegating constructor call to kotlin.Annotation 2019-12-05 17:47:14 +03:00
Dmitriy Novozhilov
25720e20f4 [FIR] Fix bug in defining of completion mode 2019-12-05 17:46:59 +03:00
Dmitriy Novozhilov
088a949403 [FIR] Add implicit type counter to html dump 2019-12-05 17:46:59 +03:00
Denis Zharkov
e58711cde3 FIR: Select most specific members from supertypes scope 2019-12-05 17:35:33 +03:00
Denis Zharkov
e5166e0e7d FIR: Extract common parts in FirSuperTypeScope 2019-12-05 17:35:33 +03:00
Denis Zharkov
43aa1f87df FIR: Optimize supertypes scope structure 2019-12-05 17:35:33 +03:00
Denis Zharkov
91fce215d2 FIR: Simplify super type scopes related code
- Get rid of unnecessary subclass
- Use more abstract type where possible
2019-12-05 17:35:33 +03:00
Denis Zharkov
b8984d154b FIR: Do not copy type parameters from class to constructors
Use the same instances from class declaration instead

Otherwise, primary constructor value parameter types when used
in the class body are considered as different from types
based on the class type parameters

See the test genericConstructors.kt, before this commit
"id" call was reported in inapplicable
2019-12-05 13:08:51 +03:00
Abduqodiri Qurbonzoda
20d02dd0ee Commonize StringBuilder 2019-12-04 22:15:33 +03:00
Abduqodiri Qurbonzoda
1431e27a7b Move StringBuilder to its own file 2019-12-04 22:15:33 +03:00
Abduqodiri Qurbonzoda
0c033297a8 Move Appendable to its own file 2019-12-04 22:15:33 +03:00
Abduqodiri Qurbonzoda
50752d47fe Move CharacterCodingException to its own file 2019-12-04 22:15:33 +03:00
Abduqodiri Qurbonzoda
956e085b22 Rename text.kt file to StringBuilderJs.kt 2019-12-04 22:15:33 +03:00
Abduqodiri Qurbonzoda
2155f1680f Fix small mistake in CharSequence.lastIndexOf documentation 2019-12-04 22:15:33 +03:00
Georgy Bronnikov
4a0f683bea JVM_IR: repair after switching Ir.Symbols to non-lazy table
Symbols referenced from Jvm>Ir.Symbols stayed unbound, hence I have
to run ExternalDeopendenciesGenerator a second time after
creating JvmBackendContext :(
2019-12-04 16:05:53 +03:00
Georgy Bronnikov
08aeed3b46 IR: do not use lazyWrapper for Ir.Symbols
The reason for switching from lazyWrapper to SymbolTable itself is that
(at least in JS_IR) some of those lazily created structures could later
be deserialized, which created conflicts.
2019-12-04 16:05:53 +03:00
Vladimir Dolzhenko
b0b04eb4cd Use kotlin specific setting "Optimize imports on the fly" in quick fix
#KT-35266 Fixed
2019-12-04 11:19:19 +01:00
Denis Zharkov
be5b7adb5a FIR: Support captured types for sub-arguments 2019-12-04 10:52:19 +03:00
Denis Zharkov
5b4e8170ae Fix variables leaking when adding other system under transaction 2019-12-04 10:52:19 +03:00
Denis Zharkov
692442d7a2 Do not look into captured star projection as types 2019-12-04 10:52:19 +03:00
Denis Zharkov
3634d80cae FIR: Order type variables for fixation
Otherwise there are subtle issues with captured types
(see FirDiagnosticsSmokeTestGenerated$Inference.testDependantOnVariance)
2019-12-04 10:52:19 +03:00
Ivan Gavrilovic
7f77cc55f3 Update the test for cleanup
Make sure all sources are removed before adding a new Java source,
and make assertions about stubs and kotlinc generated .class files.
2019-12-03 23:05:22 +01:00
Ivan Gavrilovic
e07b2e30e2 KT-34258: Make sure to clean up stale files even if no Kotlin sources
If running incrementally, even if there aren't any Kotlin sources to
compile, there could be stale output files that need to be removed. E.g
stub generation must have generated .java files removed if all Kotlin
sources are removed. Kotlin compile task will be skipped only if there
are no Kotlin sources and task run is non-incremental.

Test: KaptIncrementalIT.testRemoveAllKotlinSources
2019-12-03 23:05:21 +01:00
Sergey Igushkin
a22a60118c Fix 'Project#afterEvaluate(Action) <...> cannot be executed' on IDE test run
Update kotlinx.benchmark to 0.2.0-dev-7 which contains the fix for
https://github.com/Kotlin/kotlinx-benchmark/issues/13
2019-12-03 23:57:29 +03:00
Ilya Gorbunov
edfd933348 Improve Result docs to emphasize that any Throwable exception is caught
#KT-33447 Fixed
2019-12-03 21:08:31 +03:00
Alexander Udalov
d84daa0a4b JVM IR: fix value argument offset in -Xjvm-default=compatibility mode 2019-12-03 18:39:43 +01:00
Pavel Kirpichenkov
3de6289c6c [NI] Run completion on subatoms of error calls
Call transformer previously ran completion of argument atoms
only for non-error candidates. This led to missing diagnostics,
i.e. from collection literal resolver.

Now arguments of calls resolved to error descriptor are completed,
with exception to not found provideDelegate calls.
provideDelegate's subatoms are not completed after failure, because
it is a part of delegate competion, which does not end with
unresolved provideDelegate.
Completing after provideDelegate failure removes constraint system
from resolved arguments, which breaks resolve for get/setValue.

^KT-33592 Fixed
2019-12-03 18:19:32 +03:00
Nikolay Krasko
29fbb8e22f Update to 193.5233.102 release (KT-35239)
- Mute android specific import tests (KT-35225).
- Mute GradleMultiplatformWizardTest (IDEA-225878).
- Minor update of test data.
2019-12-03 17:34:47 +03:00
Nikolay Krasko
fa64b5794b Allow to mute parameterized GradleImportingTestCase JUnit 4 tests 2019-12-03 17:34:46 +03:00
Roman Artemev
ca0bff75cd [KLIB] Keep order of constant properties depending on backend
- Fix K/N performance regression
2019-12-03 16:20:52 +03:00
Vyacheslav Gerasimov
6ef3831f14 Build: Take parent directory as rootProject directory in case of buildSrc 2019-12-03 16:16:44 +03:00
Vyacheslav Gerasimov
462d6ac5b6 Build: Add remote build cache parameters for teamcity builds 2019-12-03 16:16:44 +03:00
Vyacheslav Gerasimov
d3c1ef9251 Build: Use kotlin-build-gradle-plugin in buildSrc 2019-12-03 16:16:44 +03:00
Vyacheslav Gerasimov
ab8542bbdb Build: Advance kotlin-build-gradle-plugin version to 0.0.2 2019-12-03 16:16:44 +03:00
Vyacheslav Gerasimov
46d77419a8 Build: Add build cache properties to kotlin-build-gradle-plugin 2019-12-03 16:16:44 +03:00
Vyacheslav Gerasimov
ad79efeba3 Build: Use kotlin version embedded to gradle 2019-12-03 16:16:44 +03:00
Denis Zharkov
fa7bd3dd2e FIR: Support SAM constructors for type aliases 2019-12-03 15:49:22 +03:00
Denis Zharkov
ae01d050c9 FIR: Abstract parts for type alias constructors resolution
It's necessary to support combination of type aliases + SAM
2019-12-03 15:49:22 +03:00
Denis Zharkov
fbe7db5471 FIR: Move constructor processing parts to a separate file 2019-12-03 15:49:22 +03:00
Denis Zharkov
bf68e85a5c FIR: Support SAM conversion for interfaces containing Object methods 2019-12-03 15:49:22 +03:00
pyos
7cd55c85e6 JVM/JVM_IR: fix mapping of KClass in annotation classes
* JVM incorrectly mapped T<KClass<...>> to T<Class<...>> because the
   annotation-ness of the type mapping mode was inherited one level
   down into a generic signature independent of T

 * JVM_IR was even worse as it did not use VALUE_FOR_ANNOTATION at all,
   mapping T<T<KClass<...>> to T<T<Class<...>> as well.

The correct behavior is to map KClass to Class only at top level or as
an argument of Array.
2019-12-03 11:42:23 +01:00
Alexander Udalov
f869be6a71 JVM IR: do not mangle synthetic methods with inline class parameters
For example, synthetic `$annotations` methods for properties were
previously mangled to `$annotations-...`, which breaks annotation
loader, and fails an assert in ClassCodegen.generateMethod.
2019-12-03 11:34:55 +01:00
Roman Golyshev
66ffdf1b2d KT-33979 KT-34150 Remove filtering overridden object members and nested objects
- ^KT-33979 Fixed
- ^KT-34150 Fixed
- Also, in extension completion check descriptor instance first
2019-12-03 13:29:30 +03:00
Alexander Udalov
2552540f71 IR: wrap exceptions and add file path in per-file lowerings
Also add file path to the wrapped exception in JVM IR codegen
2019-12-03 11:06:54 +01:00
Alexander Udalov
fd627603a0 Refactor CompilationErrorHandler
It only had one implementation THROW_EXCEPTION, inline it everywhere
with a call to a static method
2019-12-03 10:48:34 +01:00
Dmitry Petrov
2435b8d9fa Update testData for enum constructor result type in IR 2019-12-03 11:54:41 +03:00
pyos
35c2573b33 PSI2IR: generate IrEnumConstructorCalls with correct return type
Normally, the fact that is was Unit was not visible as enum constructors
are lowered to normal class constructors anyway. The exception is when
the arguments are reordered, causing the incorrect return type to leak
into the block that holds temporary variables.
2019-12-03 11:54:41 +03:00
Denis Zharkov
145ad1a6fa FIR: Minor. Extract common parts in FirCallCompletionResultsWriterTransformer 2019-12-03 11:52:21 +03:00
Dmitriy Novozhilov
71bf8a14e8 [FIR] Make ConeTypeCheckerContext implements ConeInferenceContext 2019-12-03 11:36:34 +03:00
pyos
69033b7b15 JVM_IR: handle @JvmName on annotation getters 2019-12-03 10:53:49 +03:00
pyos
ac7d9fa90d JVM_IR: implement -Xpolymorphic-signature 2019-12-03 08:31:46 +01:00
Mikhail Glukhikh
fe6be0f436 Fix failed FIR multi-module test (forgotten test data update) 2019-12-03 10:25:53 +03:00
Igor Yakovlev
0ff77bd3c5 Add UL support for const fields initializers
Fixed #KT-34081
2019-12-02 20:41:47 +03:00
Victor Petukhov
775eb67219 NI: Add constraints which contain constraining type without projection
^KT-32243 Fixed
^KT-35172 Fixed
2019-12-02 19:42:18 +03:00
pyos
65cc0fa463 PSI2IR: have GeneratorExtensions implement StubGeneratorExtensions 2019-12-02 17:10:04 +01:00
pyos
a950df3c80 PSI2IR: copy isPropertyWithPlatformField to GeneratorExtensions 2019-12-02 17:10:04 +01:00
Ilya Chernikov
3cae90dd26 [minor] fix source root creation from imported scripts:
make the usages of KotlinSourceRoot consistent everywhere
2019-12-02 16:46:55 +01:00
Ilya Chernikov
f2a4a835e7 Improve script cli diagnostics 2019-12-02 16:46:55 +01:00
Ilya Chernikov
49de5e19fb Implement repl, script and expressions evaluation support in kotlin runner 2019-12-02 16:46:54 +01:00
Ilya Chernikov
531ff92791 Implement support for expression evaluation in jvm cli compiler 2019-12-02 16:46:54 +01:00
Ilya Chernikov
7bb9f97b11 Allow to separate top-level script declarations and statements with semicolon
This fix allows to write one-liner scripts like "val x = 3; println(x)", which
were previously rejected by the parser.
2019-12-02 16:46:54 +01:00
Ilya Chernikov
b8034567ef Change script definition lookup key from File to ScriptSource
to make it more generic and allow easier implementation fo the
non-file based scripts.
2019-12-02 16:46:54 +01:00
Ilya Chernikov
615624802c Add kotlinx-html test
Among other things it tests the packagePartProvider fix above
2019-12-02 16:46:53 +01:00
Ilya Chernikov
4439582d23 Remove unnecessary update of the source roots, simplify interface accordingly
The update became unnecessary after the packagePartProvider fix above.
2019-12-02 16:46:53 +01:00
Ilya Chernikov
02a71d2cda Save updated roots before a packagePartProvider is created
Since the function createPackagePartProvider uses initialRoots for
creating packagePartsProvider, if the updateClasspath function
was called before createPackagePartProvider, the provider was created
with incomplete list of roots, that leaded to the unresolved top-level
functions.
Now if no providers are created yet, the initialRoots is updated.
This still may lead to the inconsistencies, when/if we'll have several
providers.
2019-12-02 16:46:53 +01:00
Ilya Chernikov
a190ab260e Load main-kts jar automatically from scripting plugin, if available 2019-12-02 16:46:52 +01:00
Ilya Goncharov
22cb6fa836 [Gradle, JS] Fix case with null distribution 2019-12-02 17:44:26 +03:00
Ilya Goncharov
c267357596 [Gradle, JS] Add distribution DSL 2019-12-02 17:44:26 +03:00
Ilya Goncharov
fe9ddd9f22 [Gradle, JS] Check if resourcesDir exists and resourceDir is input directory 2019-12-02 17:44:26 +03:00
Ilya Goncharov
053469dcec [Gradle, JS] Copy index.html from resources to dist 2019-12-02 17:44:26 +03:00
Mikhael Bogdanov
b9dee4e93a Remove assertion on sorted ranges: it could be empty if lambda doesn't contain any linenumber
#KT-35101 Fixed
2019-12-02 12:08:36 +01:00
Ilya Goncharov
ae4a1e3cca [Gradle, JS] Fix check on Kotlin/JS modules from NPM in DCE
#KT-35198 fixed
2019-12-02 14:06:41 +03:00
Nikolay Krasko
0380380de4 More cleanups after tests execution 2019-12-02 13:29:37 +03:00
Nikolay Krasko
0cbb3a3956 Remove unused ProjectRootModificationTrackerFixer.kt 2019-12-02 13:29:37 +03:00
Nikolay Krasko
c12599a045 Fix test data for testParamTypeLambdaMismatch in >= 192 2019-12-02 13:29:36 +03:00
Ilya Goncharov
408f958273 [Gradle, JS] Add idle run for debug node tests
Source maps can be loaded by NodeJS
2019-12-02 13:23:03 +03:00
Andrey Uskov
38de98429d Fix importing tests in bunch 183 2019-12-02 13:17:21 +03:00
Andrey Uskov
9643d5d28e Added import-resolve integration tests 2019-12-02 13:17:17 +03:00
Alexander Udalov
e9946b21b5 JVM IR: do not hide constructor with inline class types and defaults
This corresponds to the ABI generated by the old backend. Moreover, when
compiling the module 'ir.tree' with JVM IR (could not reproduce on a
small sample), this led to a codegen crash when trying to reassign
parameter value to the default stub, which is an error expression and
can't be generated by ExpressionCodegen.
2019-12-02 10:19:55 +01:00
Mikhail Glukhikh
4e1cd6bcd5 Mute 2 black-box FIR test due to disallowed Kotlin synthetic properties problem
Yet FIR allows synthetic properties both in Kotlin & Java code.
It's unclear how to forbid them in Kotlin fast. Subject to discussion.
2019-12-02 11:33:22 +03:00
Kristoffer Andersen
18e8896c08 [JVM IR] Leave private @JvmDefault methods on interface
Like the old backend, always leave private @JvmDefault annotated
interface members (properties, methods) on the interface, just like
the old backend. Fix naming, and introduce test to document the naming
scheme.
2019-12-02 08:19:52 +01:00
Kristoffer Andersen
6f8682c950 [JVM IR] Stabilize accesor names in IR Backend
- introduce a scoped counter instead of a global one for name
  generation for accessors. Naive solution not working.

- Introduced hardcoded "jd" suffix for accessors on interfaces, under
  the assumption that the only such accessors are due to JvmDefault
  and their bridges from `$DefaultImpls`. Removed all associated
  templated tests, so the old and IR backend correspond on this matter
  again.

- Respecialized writeFlags from regexps to string-equality: we are
  going for exact matches now!

- Fixed package calculation in `IrUtils.kt`.

- Accessors for static members must be due to accessing super
  classes. Actual super-qualified calls are naturally also accessing
  super classes. Hence the `$s+{hashcode(superClassName)}`
  suffix. Added test to affirm this naming scheme.

- Field getters/setters for static fields must be companion accessors,
  otherwise just labelled as accessors. They are also tagged with `s`
  suffix when accessing static fields.

- For naming of accessors to coincide with the old backend, field
  renaming to avoid JVM signature clashes must be done _after_
  generation of accessors for those fields.
2019-12-02 08:19:52 +01:00
Kristoffer Andersen
d1c2862e27 IR: Align Interface Defaults with Old Backend
Change the treatment of default implementations on interfaces in JVM
compatibility mode. Previously, the IR backend moved the actual
default implementation to the DefaultImpls class, and then bridged to
it from the interface default. The old backend did the reverse, at the
cost of an additional accessor, in order to gain better binary
compatibility properties. See #2612 for discussion.

The accessor needs to call a specific implementation, so must be
performed through an `invokespecial`. We trick the
SyntheticAccessorLowering into doing this for us, by marking the
bridging call as a super call. We do this in want of an explicit
`invokespecial` Ir Node.

InterfaceDefaultCallsPhase previously assumed the old behaviour of the
IR backend (that calls to default implementations, e.g. `foo$default`
should target `DefaultImpls.foo$default`). But now the bridge to
foo$default resides on `DefaultImpls` already, causing that pass to
create a recursive loop. We cut that loop with a simple check.
2019-12-02 08:19:52 +01:00
Kristoffer Andersen
b5de625350 Minor refactor: lifting common code 2019-12-02 08:19:52 +01:00
Kristoffer Andersen
6a41700689 [JVM_IR] Fix interface method resolution
The JVM IR was too agressive in delegating statically to $DefaultImpls
class.

Consider the following library, compiled separately, and then client,
compiled against that library:

```
//library
interface A { @JvmDefault fun foo() = "A" }

interface Left : A { }
interface Right : A { @JvmDefault override fun foo() = "Right" }

//client
interface C : Left, Right {}

fun main() {
  val x = object : C {}
  println(x.foo())
}
```

Previously, the IR backend generates an overriding bridge in C, which
calls C$DefaultImpls which calls statically into Right$DefaultImpls.

When then library is recompilerd with an override of foo in Left, the
existing binary of the client continues to run against the recompiled
library erroneously running Right.foo().

The old backend throws an IncompatibleClassChange exception due to
ambiguity of multiple inherited default implementations. kotlinc indeed
rejects the client when recompiled against the new library.

We have no tests constraining this behaviour, but we could conceivably
strap something together in CustomBinaries tests.
2019-12-02 08:19:52 +01:00
Mikhael Bogdanov
df96841c9d Prohibit protected method calls from inline function
#KT-21178 Fixed
2019-12-02 08:04:26 +01:00
Mads Ager
8383274144 Add explicit irReturn when transforming expression body to block body. 2019-12-02 07:10:50 +01:00
Vladimir Dolzhenko
7fede87825 Performance tests DSL is added 2019-12-01 22:54:00 +01:00
Vladimir Dolzhenko
1b075340f8 Fixed dependencies for performance tests 2019-12-01 09:35:32 +01:00
Vladimir Dolzhenko
f8a6217fb5 Fix compilation for 183 after adding support incremental analysis of comment and kdoc
Relates to #KT-35189
2019-11-30 18:50:44 +01:00
Alexander Gorshenev
a923e0d130 Only allow version triples for klib metadata and ir versions 2019-11-30 18:37:38 +03:00
Alexander Gorshenev
b0f077ff4b Plumbing KlibMetadataVersion and KlibIrVersion values to klib manifest 2019-11-30 18:37:38 +03:00
Alexander Udalov
bf12f7eee0 JVM IR: do not lower trimIndent/trimMargin if API version is too high
We cannot be sure that we won't change behavior of these functions in
some corner cases, so only perform this optimization if the API version
specified by the user is not greater than the compiler's own stdlib
version it was compiled against. This is the same as the similar code in
the old backend in IntrinsicMethods.
2019-11-29 19:39:55 +01:00
Ilya Gorbunov
555d503ff9 Improve indexOf sample to showcase return value handling
Remove sample reference from indexOf(Char) overload: both overloads are on
the same page, and showing the sample for indexOf(String) under indexOf(Char)
is redundant and misleading.
2019-11-29 21:34:49 +03:00
Burak Eregar
e30d87ee01 KT-20357: Add samples for indexOf 2019-11-29 21:34:49 +03:00
Vladimir Dolzhenko
a6f829f267 Add secondary ctors to incremental analysis
Relates to #KT-35121
2019-11-29 18:30:01 +01:00
Kerooker
c16b89d770 Fix XorWowRandom documentation
This commit changes XorWowRandom.kt documentation to include a HTTPS link instead of a HTTP link, for security purposes.

This commit also changes the same documentation to reflect the real cycles from the `xorwow` algorithm:

    Simple and very fast (125 million/sec), the elements in its cycle of 2^192 − 2^32 easily pass all the tests in Diehard.

 Marsaglia, G. 2003. Xorshift RNGs. J. Statis. Soft. 8, 14, p. 5

 At last, this commit explicits which part of the code is the implementation of the mentioned algorithm.

 Closes KT-35175
2019-11-29 19:31:55 +03:00
pyos
3e67ff097e JVM_IR: keep offsets of const val reads when inlining them 2019-11-29 16:49:52 +01:00
pyos
e4b1599457 JVM_IR: do not erase constant non-static field initializers...
...unless in 1.4 mode.
2019-11-29 16:49:52 +01:00
pyos
fc6b03b08f JVM_IR: move const initialization handling to lowering
Had to edit some bytecodeText tests to account for the fact that JVM_IR
no longer generates explicit initializations for ConstantValue fields,
but NoConstantValueAttributeForNonConstVals is not the default yet.
2019-11-29 16:49:52 +01:00
pyos
2ebe269448 IR: refactor InitializersLoweringBase and descendants 2019-11-29 16:49:51 +01:00
Mikhail Glukhikh
a6f8859a49 FIR Java: generate accessors only in override Kotlin case, make them non-synthetic 2019-11-29 18:11:27 +03:00
Mikhail Glukhikh
5275b4d0fc Move possibleGetterNamesByPropertyName to FirSyntheticPropertiesScope 2019-11-29 18:11:26 +03:00
Mikhail Glukhikh
d15dae6ac6 FIR: use SyntheticPropertySymbol & synthetic scope instead of FirAccessorSymbol
Before this commit, we used FirAccessorSymbol to emulate synthetic properties.
These symbols were generated in Java use-site scope.
Now, we use synthetic scope instead which is above MemberScopeTowerLevel.
This is more performance-friendly and does not require override matching.
However, accessor symbols should be used in situation when Java accessor
overrides Kotlin property which is broken in this commit
(that's why MapEntry test is corrupted here).
Also, we should not create synthetics for pure Kotlin accessors
(that's why javaAccessorConversion test is corrupted here).
2019-11-29 18:11:25 +03:00
Mikhail Glukhikh
ae62ccb76d [FIR TEST]: add test with synthetic on Java getter overridden in Kotlin 2019-11-29 18:11:24 +03:00
Mikhail Glukhikh
88e260269f FIR resolve: consider SYNTHETIC_RESOLVED as tower-stopper 2019-11-29 18:11:23 +03:00
Mikhail Glukhikh
8bcae80877 [FIR TEST]: add test with Map.Entry-based J/K hierarchy 2019-11-29 18:11:22 +03:00
Mikhail Glukhikh
8a601b5a0e FIR accessors: add protection against special names 2019-11-29 18:11:21 +03:00
Mikhail Glukhikh
b48a4ace57 FIR accessor symbols: check all possible getter name variants 2019-11-29 18:11:21 +03:00
Mikhail Glukhikh
ed6238db4b FIR accessor symbols: support 'is' prefix 2019-11-29 18:11:20 +03:00
Mikhail Glukhikh
eb90bd0e89 FIR: correctly process accessor symbols in derived classes 2019-11-29 18:11:19 +03:00
Mikhail Glukhikh
f1eb0dff1f FIR: disable synthetic scope, make accessor symbols synthetic
Before this commit, we had two methods to do generally the same synthetic thing.
It's an attempt to keep only one of them.
Accessor symbols are generated in Java use-site member scopes,
at this place we know better whether we are in Java class or not.
However, we have to do this at every use-site level, which is relatively slow.
Also we could encounter problems when accessor function is overridden in Kotlin,
and accessor symbol can still contain reference to Java accessor.
2019-11-29 18:09:07 +03:00
Simon Ogorodnik
2f9c94bd9e [FIR] Fix Definitely Not Null type substitution 2019-11-29 18:04:49 +03:00
Simon Ogorodnik
e5f60253f7 [FIR] Improve path usages in generator, provide default output 2019-11-29 18:04:48 +03:00
Simon Ogorodnik
5eb5d8e515 [FIR] Separate generated tree files from non-generated sources 2019-11-29 18:04:47 +03:00
Vladimir Dolzhenko
95129939d4 Add secondary ctors to incremental analysis
#KT-35121 Fixed
2019-11-29 15:45:09 +01:00
Vladimir Dolzhenko
f709377735 Support incremental analysis of comment and kdoc
#KT-35189 Fixed
2019-11-29 15:44:58 +01:00
Dmitry Borodin
664d69b752 Add flatMap sample KT-20357 2019-11-29 17:35:06 +03:00
Vladimir Dolzhenko
29b25e3901 Reworked resolve references in background thread in PlainTextPasteImportResolver
Relates to #KT-16774
2019-11-29 15:27:20 +01:00
Dmitry Gridin
37371edb8c Auto-import: add quickfix for overloaded generic function
#KT-34667 Fixed
2019-11-29 21:09:24 +07:00
Dmitry Gridin
4b98430058 Formatter: fix line break after package & file annotation
#KT-23957 Fixed
2019-11-29 21:09:04 +07:00
Dat Trieu
f334ad2ffc KT-20357: Add samples for associate* functions (#2798)
* KT-20357: Add samples for functions related to associate

* KT-20357: Use same fib function for both samples

* KT-20357: Use examples with duplicate keys and simplify examples with primitives

* KT-20357: Use primitive samples for all arrays

* KT-20357: Use String splitting example to better illustrate the use for associate over associateBy with a valueSelector
2019-11-29 16:54:02 +03:00
Mikhael Bogdanov
d2e5432b2d Minor. Update test data 2019-11-29 13:49:13 +01:00
Ilya Chernikov
b3c5362003 [NI] Fix diagnostic reporting for missing type parameter info
#KT-31975 fixed
2019-11-29 13:44:42 +01:00
Ilya Chernikov
7dd9ed7e38 [NI] Fix loosing type annotations on extension functions
#KT-32138 fixed
2019-11-29 13:44:41 +01:00
Mads Ager
467e6e3d97 JVM_IR: Fix field initialization in secondary enum constructors. 2019-11-29 13:40:18 +01:00
Mads Ager
8cd6dc0cd9 JVM_IR: Use IrInlineReferenceLocator for inline local var lowering. 2019-11-29 13:38:34 +01:00
Mads Ager
e2a1cb1077 JVM_IR: Generate fake inlining local variables for debugging. 2019-11-29 13:38:34 +01:00
pyos
fa8cb7b6e0 PSI2IR: support NewInference + SamConversionPerArgument
except for SAM conversions of varargs (which aren't implemented in the
non-IR JVM backend either btw)
2019-11-29 15:25:32 +03:00
Mikhael Bogdanov
cf6f823d29 Use descriptor from resolved call to inline accessors
In case of inline it should be same descriptor (except of fake override), In general case getter could be synthetic accessor and in such case it's not inline
2019-11-29 13:15:42 +01:00
Mikhael Bogdanov
320c5f6f00 Cast dispatch receiver to actual declaration owner though inline
Otherwise corrupted frame information is generated in bytecode

 #KT-29242 Fixed
2019-11-29 13:15:42 +01:00
Ilya Goncharov
25dea2ccce [Gradle, JS] Add description of separator of java inner classes 2019-11-29 15:09:36 +03:00
Ilya Goncharov
8d123d209a [Gradle, JS] Add description of hack on our side to avoid IDEA run only JVM tests by gutters 2019-11-29 15:09:36 +03:00
Ilya Goncharov
d02bcb30e3 [Gradle, JS] Move classNameOnlyRegExp to class level 2019-11-29 15:09:36 +03:00
Ilya Goncharov
38bd738724 [Gradle, JS] Add comments 2019-11-29 15:09:36 +03:00
Ilya Goncharov
418c0496f1 [Gradle, JS] Fix regex on method
- Find method declaration like not containing dot
2019-11-29 15:09:36 +03:00
Ilya Goncharov
3e1fe0af92 [Gradle, JS] Add exact filter by class name only 2019-11-29 15:09:36 +03:00
Ilya Goncharov
0037e74d3e [Gradle, JS] Fix StartsWith filter 2019-11-29 15:09:35 +03:00
Ilya Goncharov
de8610a279 [Gradle, JS] Add java class filters like in gradle 2019-11-29 15:09:35 +03:00
Ilya Goncharov
50d165167c [Gradle, JS] Update npm dependencies 2019-11-29 15:09:35 +03:00
Ilya Goncharov
1cc980e21b [Gradle, Idea] Create dummy tasks with type Test to WA platform problem
Platform set filters only for Test task
Create dummy Test task
Non JVM test task depends on Test task
After evaluate copy filters from Test task to non JVM test task
2019-11-29 15:09:35 +03:00
Ilya Goncharov
86e665e2b3 [Gradle, Idea] Add Gutter Configurator for non-jvm tests 2019-11-29 15:09:35 +03:00
Roman Golyshev
3112d70420 KT-35042 Fix InsertHandlerProvider.kt to work with suspend functional parameters
- ^KT-35042 Fixed
- Also, fix review suggestions for KOTLIN-CR-3495
2019-11-29 14:55:22 +03:00
Roman Golyshev
6f234beb9c KT-34414 Make sure completion for suspend functional parameters works too
- Replace `isFunctionType` with `isBuiltinFunctionalType` where it is relevant
- ^KT-34414 Fixed
2019-11-29 14:55:21 +03:00
Igor Yakovlev
541ca31584 Fix for exception on HelpAction in KotlinInlineValDialog 2019-11-29 14:42:34 +03:00
Igor Yakovlev
a672427e72 Add invokeLater for inlining extra refactoring in branchedTransformations intension
Fixed #EA214432
2019-11-29 14:42:26 +03:00
Dmitry Petrov
a2188610b1 Promote KotlinABI version 2019-11-29 13:53:05 +03:00
Dmitry Petrov
55e9e8afbf IR ser/deser: IrSimpleFunction.isOperator 2019-11-29 13:53:05 +03:00
Dmitry Petrov
0681c0d956 IR BE Common: IrSimpleFunction.isOperator 2019-11-29 13:53:05 +03:00
Dmitry Petrov
4591dfdf47 JVM_IR: IrSimpleFunction.isOperator 2019-11-29 13:53:05 +03:00
Dmitry Petrov
31b63c0fc8 JS_IR: IrSimpleFunction.isOperator 2019-11-29 13:53:05 +03:00
Dmitry Petrov
cb1b9c2ccf IR testData: IrSimpleFunction.isOperator 2019-11-29 13:53:05 +03:00
Dmitry Petrov
e4303b0173 FIR2IR: IrSimpleFunction.isOperator 2019-11-29 13:53:04 +03:00
Dmitry Petrov
d6db6becb9 IR: IrSimpleFunction.isOperator 2019-11-29 13:53:04 +03:00
Nikolay Krasko
ec03c3b85d Minor: remove url to avoid difference in test data in 183 and 191 2019-11-29 12:56:50 +03:00
Nikolay Krasko
9c0c9ea849 Use Kotlin wrapper for LightIdeaTestCase 2019-11-29 12:56:50 +03:00
Nikolay Krasko
32f4ab96c4 Use Kotlin wrapper for LightCodeInsightTestCase tests
This will help in resolving compatibility issues and will allow to add
common functionality to all tests.
2019-11-29 12:56:49 +03:00
Nikolay Krasko
6f3e7acfa2 Remove adhock flaky highlighting performance tests
We now have dedicated tests for it.
2019-11-29 12:35:44 +03:00
Dmitry Gridin
2fabf86f29 Formatter: cleanup code 2019-11-29 16:28:59 +07:00
Dmitry Gridin
70185ba2a6 Formatter, NJ2K: fix indent for comments inside function literals
#KT-4194 Fixed
#KT-31881 Fixed
#KT-34673 Fixed
#KT-35152 Fixed
2019-11-29 16:28:59 +07:00
Nicolay Mitropolsky
bfa6bd1396 Uast: buildLightMethodFake provides proper containing class and parent 2019-11-29 12:28:02 +03:00
Kirill Shmakov
79bfada65b Read xcodeproj file location from gradle.properties 2019-11-29 12:22:43 +03:00
Toshiaki Kameyama
f7ff397a31 Move statement: enable single lambda expression function
#KT-10478 Fixed
2019-11-29 11:33:27 +03:00
Ilmir Usmanov
51a9df2902 JVM_IR: Support suspend lambdas with receivers and multiple parameters
In old BE we generate `create` for this kind of suspend lambdas, which,
like in simple suspend lambdas is responsible for putting arguments
(including extension receiver) to fields.
But, if number of parameters of suspend lambda (including receiver) >= 1,
there is no need to generate `create`, since `create` is called only by
`createCoroutine` and friends from stdlib, and there is no version of
`createCoroutine` for lambdas with multiple parameters.
Thus, in old BE we generate a redundant method, which affects method
count.
In JVM_BE we decided to 'inline' create into `invoke` for suspend lambdas
with multiple parameters.
2019-11-28 21:19:27 +03:00
pyos
98660cdf2d JVM_IR: serialize anonymous functions' descriptors 2019-11-28 18:17:01 +01:00
victor.petukhov
e246c23a46 Fix prematurely analyzing a lambda while fixing a type variable for another argument
^KT-35168 Fixed
2019-11-28 19:03:30 +03:00
Dmitriy Novozhilov
c4a115720e [FIR-TEST] Update testdata
It was forgotten in 61c17d91
2019-11-28 18:01:14 +03:00
pyos
2f4f09e3a2 JVM_IR: remove some redundant calls to deepCopyWithSymbols 2019-11-28 15:42:06 +01:00
Simon Ogorodnik
dbf0742c00 [FIR] Fix self-type for enum 2019-11-28 17:23:05 +03:00
Vyacheslav Gerasimov
26113b1e0f Create target directories while copying compiler.xml for tests 2019-11-28 16:02:41 +03:00
Mikhail Glukhikh
6401596d58 FIR resolve: support processing extensions before members (forEach case) 2019-11-28 15:36:58 +03:00
Dmitriy Novozhilov
61c17d9110 [FIR-TEST] Add test with missing smartcast 2019-11-28 15:28:21 +03:00
Dmitriy Novozhilov
dcd1c2647e [FIR-TEST] Add test with problem with default java importing scope 2019-11-28 15:28:21 +03:00
Dmitriy Novozhilov
bb89fee431 [FIR-TEST] Add test with ambiguity in static java scopes 2019-11-28 15:28:20 +03:00
Roman Artemev
4759c16428 [JS IR] Fix IrGetClass for Throwable successors
- add test
2019-11-28 14:45:34 +03:00
Roman Artemev
757ddd9179 [JS IR] Fix standard collections
- remove PlatformDependent annotated methods
2019-11-28 14:45:34 +03:00
Yan Zhulanow
606cad1059 Pill: Add fir/lightTree module 2019-11-28 20:02:41 +09:00
Yan Zhulanow
60a77acd7a Pill: Fix compiler tests (support both JPS build and Pill in JUnit 3 runner) 2019-11-28 20:02:40 +09:00
Mikhail Glukhikh
f58af2e4c3 FIR2IR: fix constructor referencing in return statement 2019-11-28 13:50:10 +03:00
Sergey Bogolepov
96e6602da2 [kotlinx-metadata-jvm] Fix typo 2019-11-28 17:32:03 +07:00
Mikhail Glukhikh
29e882eae7 FIR resolve: add minor comments about substitutions around JvmMappedScope 2019-11-28 13:18:11 +03:00
Mikhail Glukhikh
e43a1ee1c5 FIR JvmMappedScope: substitute type parameters in Java scope with Kotlin ones
Without it, override mapping does not work properly.
NB: at this moment Java forEach often supersedes Kotlin forEach,
because call isn't reported as erroneous properly.
2019-11-28 13:18:11 +03:00
Mikhail Glukhikh
2c611d75bc [FIR TEST]: two more tests on forEach potential ambiguity (both passing) 2019-11-28 13:18:10 +03:00
Mikhail Glukhikh
4f1167b16f Move buildDefaultUseSiteMemberScope to FirSymbolProvider 2019-11-28 13:18:10 +03:00
Mikhail Glukhikh
71b95bd91d FIR resolve: make substitution also for mapped Java type parameters 2019-11-28 13:18:10 +03:00
Mikhail Glukhikh
b3056b8bf5 FIR resolve: implement JVM K/J type mapping
Declared member scopes are now wrapped in JvmMappedScope
2019-11-28 13:18:10 +03:00
Toshiaki Kameyama
3a576ce14f KT-21811 Convert string concatenation into multiline string (#2772)
New J2K: Convert string concatenation into multiline string

#KT-21811 Fixed
2019-11-28 13:14:48 +03:00
Nikolay Krasko
c14affd6cd Minor: forgotten change after review 2019-11-28 12:02:00 +03:00
Nikolay Krasko
35fec9e9db Fix withJava test after resorting annotation targets
Was broken after eb71e68.
2019-11-28 12:02:00 +03:00
Nicolay Mitropolsky
c06f737519 Uast: SimpleKotlinRenderLogTest.testBitwise UMethod testdata fix 2019-11-28 11:41:00 +03:00
Toshiaki Kameyama
bfa6c7d399 Move statement: don't move declarations above package and import directives 2019-11-28 11:20:09 +03:00
Mikhael Bogdanov
742c3a228a JVM_IR. Proper lower toArray functions 2019-11-28 08:31:15 +01:00
Natalia Selezneva
6a18ef1417 Minor: compare system independent paths 2019-11-28 09:40:04 +03:00
Sergey Bogolepov
a08cf59017 [kotlinx-metadata] Add extensions for KmValueParameter
There is no extension on jvm, but klibs have parameter annotations.
2019-11-28 10:40:21 +07:00
Sergey Bogolepov
18bb615dd9 [kotlinx-metadata-klib] Fix library reading
* To be able to deserialize metadata we need to include ":core:deserialization".
* Use per-fragment string tables.
* Read file names from strings instead of file names list.
2019-11-28 10:40:20 +07:00
Nikolay Krasko
c341a3e709 Avoid collecting events from other projects in PerModulePackageCacheService (KT-33802)
It looks like VFS_CHANGES subscription ignores project boundaries so all events are processed by every listener. If event has a hard reference to project in the requestor field, it might leak through the collection of pending events.

An attempt to fix holding test projects through pending events.

 #KT-33802 Fixed
2019-11-27 22:34:48 +03:00
Nikolay Krasko
7245bbd822 Explicitly disconnect in KotlinPackageContentModificationListener (KT-33802) 2019-11-27 22:34:48 +03:00
Vyacheslav Gerasimov
0cde2e2f5b Build: Fix ivy repository for android sdk
There is no `artifact()` in metadataSources by default in gradle 6.0
2019-11-27 21:26:34 +03:00
Vyacheslav Gerasimov
8d31d4a60f Replace com.moowork.node plugin with com.github.node-gradle.node 2019-11-27 21:26:34 +03:00
Vyacheslav Gerasimov
81e24fbdb4 Build: Extract version of com.moowork.node to the settings.gradle 2019-11-27 21:26:34 +03:00
Vyacheslav Gerasimov
ea9b490467 Fix usage of nullable in gradle 6.0 DomainObjectContext.project 2019-11-27 21:26:33 +03:00
Vyacheslav Gerasimov
b9031f0c68 Fix overrides of removed in gradle 6.0 AbstractCompile.compile
5e7476de95
2019-11-27 21:26:33 +03:00
Vyacheslav Gerasimov
7de023135e Build: Remove outdated fix broken in gradle 6.0
Can't remove from dependsOn anymore
2019-11-27 21:26:33 +03:00
Vyacheslav Gerasimov
aa05bcc16b Build: Fix usages of this project unavailable in gradle 6.0 2019-11-27 21:26:33 +03:00
Vyacheslav Gerasimov
01929cb234 Build: Upgrade build scan plugin for gradle 6.0 2019-11-27 21:26:33 +03:00
Vyacheslav Gerasimov
d74e53e6bb Build: Properly annotate input properties of IntelliJInstrumentCodeTask 2019-11-27 21:26:33 +03:00
Vyacheslav Gerasimov
9d162ec1f3 Build: Upgrade gradle to 6.0.1 2019-11-27 21:26:33 +03:00
Vyacheslav Gerasimov
5f158f5ce7 Build: Add kotlin-build-gradle-plugin & use it prebuilt from bintray
With extracted buildProperties.kt from buildSrc required for settings.gradle, using buildSrc classes is not allowed there since gradle 6.0
2019-11-27 21:26:32 +03:00
Georgy Bronnikov
1ed23d7c54 IR: reorganize IrProvider handling
Make DeclarationStubGenerator a subclass of IrProvider,
anticipating deserialization of IR structures for JVM_IR backend.
2019-11-27 20:02:27 +03:00
Toshiaki Kameyama
be04912f6f KT-19574 Code with inferred default parameters and parameter vs property name clashes (#2671)
New J2K: add 'this' receiver to default parameter value if needed

#KT-19574 Fixed
2019-11-27 18:55:50 +03:00
Anton Yalyshev
1bbd17c4d6 Turn off FUS data sending in 1.3.61+ as we as we sent enough in 1.3.60 2019-11-27 18:42:42 +03:00
Dmitriy Novozhilov
e38fdae1bc Regenerate DiagnosticsTestWithJsStdLibGenerated 2019-11-27 18:03:05 +03:00
Dmitriy Novozhilov
5190ff9733 [FIR-TEST] Add test with SAM conversion in constructor call 2019-11-27 18:01:20 +03:00
Dmitriy Novozhilov
71acd42727 [FIR-TEST] Add test with ambiguity produced by definitely not null types 2019-11-27 18:01:20 +03:00
Sergey Igushkin
fa2ef816b1 Support Gradle instant execution with Kotlin/JVM and Android tasks
Issue #KT-35126 Fixed
2019-11-27 17:59:45 +03:00
Simon Ogorodnik
d59a171b65 [FIR] Fix isMyTypeVariable in ConeInferenceContext 2019-11-27 17:15:07 +03:00
Anton Yalyshev
ffa0896592 Minor correction of attributes naming 2019-11-27 16:59:27 +03:00
Anton Yalyshev
c57c9b2e63 Prepare data for successful FUS Whitelist parsing 2019-11-27 16:59:27 +03:00
Toshiaki Kameyama
c72622c6d7 KT-32551 New J2K: Non-canonical modifiers order inspection is not applied during convertion of inner super class (#2806)
New J2K: add SortModifiers inspection to post-processing

#KT-32551 Fixed
2019-11-27 16:08:54 +03:00
victor.petukhov
dbacae94d0 Fix common super type calculation for captured dynamic types
^KT-32499 Fixed
2019-11-27 15:48:00 +03:00
Vladimir Dolzhenko
1c4c5520a2 Fix incremental analysis in case of property does not have initializer but could be initialized on a class level
#KT-35028 Fixed
2019-11-27 13:43:30 +01:00
Vladimir Dolzhenko
c67222c176 Add ERRORs check to AbstractOutOfBlockModificationTest 2019-11-27 13:43:10 +01:00
Vladimir Dolzhenko
144f721a44 Kotlinify AbstractOutOfBlockModificationTest, p2 2019-11-27 13:42:49 +01:00
Vladimir Dolzhenko
8f8ed4dbcf Kotlinify AbstractOutOfBlockModificationTest, p1 2019-11-27 13:42:32 +01:00
Dmitriy Novozhilov
567248ebd7 [FIR] Add default upper bounds to type parameter of synthetic when and try calls 2019-11-27 15:00:03 +03:00
Dmitriy Novozhilov
5770d19d61 [FIR] Fix calculating of completion mode 2019-11-27 15:00:03 +03:00
Dmitriy Novozhilov
9c3117ba40 [FIR] Git rid of creating new when and try fir nodes
It's necessary because of before change we safe original `when`
  without infered type as return statement of lambda and after that
  we add incorrect constraint system from it to outer call
2019-11-27 15:00:03 +03:00
Dmitriy Novozhilov
8085ec8b0b [FIR-TEST] Add test with ambiguity between java field and java accessor 2019-11-27 15:00:03 +03:00
Dmitriy Novozhilov
3c661dd142 [FIR-TEST] Add test with unresolved invoke of lambda with receiver 2019-11-27 15:00:03 +03:00
Dmitriy Novozhilov
96d3a06129 [FIR-TEST] Add test with hiding local functions 2019-11-27 15:00:03 +03:00
Dmitriy Novozhilov
5d14c76f70 [FIR-TEST] Add test with unresolved Array<T>.clone() 2019-11-27 15:00:02 +03:00
Dmitriy Novozhilov
4059fae1b7 [FIR-TEST] Add test with type mismatch on receiver with captured type 2019-11-27 15:00:02 +03:00
Dmitriy Novozhilov
572256e2eb [FIR-TEST] Add test with not-working bound smartcast 2019-11-27 15:00:02 +03:00
Mark Punzalan
1a2e09e6a5 ForLoopsLowering: Handle Iterable.withIndex() where the type is a
bounded type parameter.

TODO: Handle Sequences by extending DefaultIterableHandler.
2019-11-27 10:59:34 +01:00
Kevin Bierhoff
e8252ea874 handle kotlin shifts like bitwise binary ops 2019-11-27 12:42:31 +03:00
Nikolay Krasko
a9baec4727 Add headless mode for tests to avoid graphic card switch 2019-11-27 12:26:54 +03:00
Nikolay Krasko
54338686d4 Add test for lambda parameter type 2019-11-27 12:26:54 +03:00
Nikolay Krasko
eb71e686da Stable order of generated annotation targets
A random order of usages is enabled in 193 platform that makes tests flaky without the commit.
2019-11-27 12:26:54 +03:00
Nikolay Krasko
592df477e9 Mute MultiModuleHighlightingTest tests 2019-11-27 12:26:54 +03:00
Denis Zharkov
00a70c51f0 FIR: Generate fake overrides always if there are type parameters
See the comment
2019-11-27 11:20:52 +03:00
Denis Zharkov
8efd59403d FIR: Avoid redundant substitution when type parameters don't change 2019-11-27 11:20:52 +03:00
Denis Zharkov
07a4352809 FIR: Add hack for Fir2IrVisitor
See the comment
2019-11-27 11:20:52 +03:00
Denis Zharkov
3b7ad066fc FIR: Substitute type alias constructors properly 2019-11-27 11:20:52 +03:00
Denis Zharkov
f68929fe74 FIR: Leave functions type parameters in subsituting scope 2019-11-27 11:20:52 +03:00
Denis Zharkov
b5ef063b0f FIR: Cache functions in use-site member scope 2019-11-27 11:20:52 +03:00
Denis Zharkov
f659dc0bea FIR: Add synthetic values/valueOf methods to Java classes 2019-11-27 11:20:52 +03:00
Denis Zharkov
256f5ca0a1 FIR: Support inherited default parameters 2019-11-27 11:20:52 +03:00
Natalia Selezneva
c9cb4dff52 Scripting: introduce ide-specific comparision of script compilation configurations (KT-34626)
Do not take into account fields that doesn't affect IDE
Also it will threat configurations from old and new scripting API as similar
FIt will make sense for script dependencies loaded using Gradle TAPI (new Scripting API) and Old Scripting API
^KT-34626
2019-11-27 11:08:45 +03:00
Natalia Selezneva
07b6dadbf0 Scripting: move additional classpath to the end of script classpath (KT-34626)
Do not add duplicated entries
Original script dependencies should go first
2019-11-27 11:08:44 +03:00
Natalia Selezneva
72e99b5863 Scripting: avoid just in case configuration requests to Gradle (KT-34442)
Listen to changes in files that may affect gradle configuration
Remove configuration request if none of such file was changed since last request
^KT-34442 Fixed
2019-11-27 11:08:44 +03:00
Natalia Selezneva
f27e13035a Minor: introduce helper method to check registry option 2019-11-27 11:08:44 +03:00
Natalia Selezneva
7ade2ec576 Scripting: configurations from gradle import should be always taken into account (KT-34442)
Do not rely on registry option
^KT-34442
2019-11-27 11:08:44 +03:00
Natalia Selezneva
2f1915d85e Scripting: check that kotlin dsl models are provided during import as soon as possible 2019-11-27 11:08:44 +03:00
Dmitry Gridin
249789d6eb Formatter: add test for enum entry with comment
Relates to #KT-15980
2019-11-27 15:01:44 +07:00
Roman Artemev
97c8b2074e [JS] Set correct EXPECTED_REACHABLE_NODES 2019-11-27 00:06:42 +03:00
Igor Yakovlev
12f29bacab Exclude checking for unimplemented method for binary origin classes
Fixed #KT-34971
2019-11-26 21:13:10 +03:00
Mads Ager
8d5e5210a6 JVM_IR: Copy annotations to suspend function views. 2019-11-26 21:00:50 +03:00
Nicolay Mitropolsky
3d1061ee3c Uast: KotlinUMethodWithFakeLightDelegate 183-related fixes 2019-11-26 19:42:30 +03:00
Nicolay Mitropolsky
c5fb51bd85 191: Uast: KotlinUMethod compilation fix 2019-11-26 19:42:29 +03:00
Leonid Startsev
19c28c55c5 Allow serialization plugin to work with inline types which are primitives (e.g. Char in JS IR) 2019-11-26 19:34:49 +03:00
Leonid Startsev
ed786c4daf Enable compiler plugins in JS IR backend (and WASM too, since they use same loadIr function) 2019-11-26 19:34:48 +03:00
Jiaxiang Chen
0441e484a6 PSI2IR: For implicit function return, use expression's end offset as start offset of the IrReturn to generarate correct line number. 2019-11-26 17:59:28 +03:00
Jiaxiang Chen
e49431a12c Debug information test: make stepping information more readable. 2019-11-26 17:59:28 +03:00
Jiaxiang Chen
331b085b2f JVM_IR: Fix line number for catch clause. 2019-11-26 17:59:28 +03:00
Jiaxiang Chen
3ea878b1c6 JVM_IR: Fix line number for varible initializer 2019-11-26 17:59:28 +03:00
Natalia Selezneva
8bb9c572ac Move inProgress lock at the onFinish of background task (KT-34688)
Setting inProgress to false inside run method can lead to multiple notifications because of delay between run method end and progress hide
^KT-34688 Fixed
2019-11-26 16:35:59 +03:00
Ilya Goncharov
ad09492eb0 [Gradle, JS] Migrate on only name-version npm dependencies
#KT-32179 fixed
2019-11-26 16:05:17 +03:00
Ilya Goncharov
95b56e10b4 [Gradle, JS] Activate root npm dependency declaration for multiplatform 2019-11-26 16:04:37 +03:00
Ilya Goncharov
5397023f71 [Gradle, JS] Add Groovy Closure support 2019-11-26 16:04:37 +03:00
Ilya Goncharov
028c73d959 [Gradle, JS] Add compatible operators for npm dependencies 2019-11-26 16:04:37 +03:00
Ilya Goncharov
26cd392a9a [Gradle, JS] First steps for npm dependencies in root 2019-11-26 16:04:37 +03:00
Ilya Goncharov
f73fc5199b [Gradle, JS] Mute testWeb false positive test 2019-11-26 16:03:26 +03:00
Ilya Goncharov
be5b8c1bdb [Gradle, JS] Mute false positive test for MPP JS-JVM 2019-11-26 16:03:26 +03:00
Dmitry Gridin
b40a888f1d Formatter: fix line break between declarations with annotations
#KT-35093 Fixed
#KT-35106 Fixed
2019-11-26 19:40:51 +07:00
Dmitry Gridin
bfd539d5d1 Formatter: fix line break between declarations with comment
#KT-12490 Fixed
#KT-35088 Fixed
2019-11-26 19:40:51 +07:00
Dmitry Gridin
b6b755506c Formatter: support Chop down if long for Chained method calls
#KT-23929 Fixed
#KT-33553 Fixed
2019-11-26 19:40:51 +07:00
Dmitry Gridin
351fef5628 DoubleBangToIfIntention: fix invalid psi tree 2019-11-26 19:40:50 +07:00
Svyatoslav Kuzmich
f48ad25626 Advance bootstrap to 1.3.70-dev-1806
Due to updated K/JS klib ABI

(cherry picked from commit bffbe89f53)
2019-11-26 15:39:28 +03:00
Nikolay Krasko
8185c452fe Ignore jarRepositories.xml 2019-11-26 15:39:28 +03:00
Nikolay Krasko
13b0054e0a Fix compilation for service messages tests in 193 branch 2019-11-26 15:39:28 +03:00
Nikolay Krasko
89f26cc89d Minor: Make diff function for AbstractKotlinFoldingTest
~true~ and ~false~ cases left unresolved
2019-11-26 15:39:27 +03:00
Nikolay Krasko
5d6333f0f4 193: Better services registration for parser tests 2019-11-26 15:39:27 +03:00
Leonid Startsev
3d2800f99b Move out symbols that do not depend on a BackendContext to a separate BuiltinSymbolsBase class.
The goal was to be able to use such symbols before BackendContext is even created – in psi2ir postprocessing step (i.e., IR compiler plugins).

Remove old code from serialization ir plugin.
2019-11-26 15:26:35 +03:00
Leonid Startsev
3e18350a1f Rewrite IR plugin infrastructure (and serialization plugin) so it won't emit LazyIR.
LazyIR was emitted because plugin was not able to declare symbols, only to reference them.
Moreover, declarations added by frontend plugin were also unbound symbols produced by psi2ir,
and declaration stub generator was stubbing them with LazyIR – therefore access to global symbol table is not enough for plugins. IrProvider won't help here, because some functions produced by plugin have circular dependencies.

By moving compiler plugins step between psi2ir and declaration stub generator, both problems are resolved
– unbound symbols produced by psi2ir and compiler plugins are declared where they would be declared if this was a user code,
and only unbound symbols left are external dependencies, which is a correct input for lazy ir.
2019-11-26 15:26:28 +03:00
Nicolay Mitropolsky
e4d0d450ab Uast: keeping annotations from sources in non-light-methods backed UMethods (KT-27806) 2019-11-26 15:13:40 +03:00
Nicolay Mitropolsky
833571d8b2 Uast: tests for suspend and DeprecationLevel.HIDDEN functions appears in Uast tree (KT-27806, KT-32031) 2019-11-26 15:13:40 +03:00
Nicolay Mitropolsky
2772659ed2 Uast: Uast produces reified methods on his own because light-classes doesn't (KT-34316) 2019-11-26 15:13:40 +03:00
Nicolay Mitropolsky
9c18df61ca Uast: KotlinUMethod and KotlinUAnnotationMethod are separated (KT-30489) 2019-11-26 15:13:40 +03:00
Anton Bannykh
9fec2c78d1 JS IR: apply forLoopsLowering
Replaced createTemporaryVariable usages with createTmpVariables.
The latter doesn't rely on KotlinType's. Using KotlinType with
JS_IR backend causes runtime excpetions, as some expected descriptor
API is not implemented, because it avoids descriptors as much as
possible.
2019-11-26 15:08:10 +03:00
Jiaxiang Chen
0ea407fef9 debug information test: handle vm resume correctly. 2019-11-26 14:52:58 +03:00
Toshiaki Kameyama
251899c31a Fix bad indentation when copy-paste to trimIndent()
#KT-33888 Fixed
2019-11-26 18:00:38 +07:00
Mikhail Glukhikh
178dbd3c5d Remove hacky re-initialization of PsiSubstitutor.KEY (branch 193)
After IDEA commit
8b0af11724 (diff-9b39aafa0a7b8d4f089100f3968931d0)
this re-initialization is no more necessary. Moreover, it's harmful,
because this KEY is used as a map key in IDEA code,
and we cannot find information stored by this key.
This was a hidden reason of FIR / IR test failures in branch 193.

After this commit, FIR / IR tests in branch 193 should be fixed
2019-11-26 13:13:48 +03:00
Anton Bannykh
81699299f5 JS_IR: DCE
Could be enabled by toggling `-Xir-dce`

Box test output in js/js.translator/testData/out-min
2019-11-26 12:20:39 +03:00
Roman Golyshev
faf4c05fc8 KT-34644 Give return keyword more priority in completion where appropriate
- See `returnExpressionItems::returnIsProbableInPosition` to get an idea where return is supposed to be more appropriate
  - End of the block (except for top level block of unit function or cycle) or as single expression in if or when
  - Right side of the elvis operator (which is not already in return)
- Add additional `probable_keyword` weigher to signalize about probable keyword (for now it is only for `return`)
- ^KT-34644 Fixed
2019-11-26 11:56:32 +03:00
Roman Golyshev
de11b4cb64 KT-34644 Refactor CompletionUtils::returnExpressionItems
- Collecting `return` lookups to `blockBodyReturns` will later allow to modify them to increase priority in the completion
2019-11-26 11:56:19 +03:00
Pavel Kirpichenkov
cf82efb49f [NI] Add missing diagnostic on callable references in fake calls
Unresolved reference diagnositc was not reported on callable references
returned from if or when expression because of additional block wrapper.

^KT-30953 Fixed
2019-11-26 11:02:25 +03:00
Mikhail Zarechenskiy
eb73650209 Fix race in IDE: inject proper storage manager for type parameters
With NO_LOCKS strategy we can easily end up in a situation when
 constraint system for a generic call is built incorrectly,
 producing flaky errors (or don't produce errors at all)

 Now proper storage manager is injected for all cases except:
 - IR
 - Codegen
 - Serialization plugin
 - Fake local objects

 Most likely, NO_LOCKS strategy for these cases is fine as at that point
 the compiler works in one thread

 #KT-34786 Fixed
2019-11-26 10:52:45 +03:00
Mads Ager
399667a434 JVM_IR: Implement data class array member intrinsics. 2019-11-25 19:00:31 +01:00
Svyatoslav Kuzmich
ea8ade0852 [JS] Refactor and comment for typeOf fix 2019-11-25 20:25:03 +03:00
Svyatoslav Kuzmich
dc336c3c8a [JS] Add marker function getReifiedTypeParameterKType to runtime
So compiler bugs would produce a nicer error message instead of:
"TypeError: getReifiedTypeParameterKType is not a function"
2019-11-25 20:25:03 +03:00
Svyatoslav Kuzmich
600fb723f4 [JS] Fix typeOf for some reified type parameters
Fix getting kType metadata in cases when corresponding jsClass value
is passed through temporary variable.
This can happen when jsClass expression is not consided trivial by
local variable optimizer. This happens for object declarations from
different modules, for example kotlin.Unit
2019-11-25 20:25:02 +03:00
Roman Artemev
c4d993d14c [KLIB] Fix top level property index. Include const properties as well. 2019-11-25 20:22:04 +03:00
Roman Artemev
1e4f8b2946 [JS IR] Do not forbid typeOf inlining if it is not required 2019-11-25 20:22:03 +03:00
Roman Artemev
2e22ddba39 [JS IR] Fix annotation constructor body generation 2019-11-25 20:22:03 +03:00
Roman Artemev
c5e25a0382 [JS IR] Make PrivateMembersLowering global to handle inlined private references correctly
- Fixes [KT-33334]
2019-11-25 20:22:03 +03:00
Roman Artemev
9946feb66c [JS IR] Fix name clash between class members defined on prototype
- Fixes [KT-33327]
2019-11-25 20:22:03 +03:00
Roman Artemev
987c6ab3ee [JS IR] Roll making Char inline class back
- un/mute falling tests
2019-11-25 20:22:03 +03:00
Leonid Startsev
b9ac1341ff Export generic serializer constructor from JS module
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/609
2019-11-25 20:06:15 +03:00
Leonid Startsev
73b9d2466a Do not report 'Missing @Serializable on enum with @SerialInfo' if enum
has custom serializer

#KT-34991 Fixed
2019-11-25 20:06:14 +03:00
Mads Ager
98ceee784a JVM_IR: More special bridge rewriting.
If there is an existing method that will have its argument types
remapped to boxed types, make sure to reflect that in the IR so
that code will be generated for a boxed value instead of a
primitive value.
2019-11-25 17:37:57 +03:00
Ilya Kirillov
f368d9761a Fix for loop conversion when multiple initializers are present
#KT-35074 fixed
2019-11-25 17:01:46 +03:00
Ilya Chernikov
b73625ad9e Switch main-kts to the updated resolvers infrastructure 2019-11-25 14:46:32 +01:00
Ilya Chernikov
baec10fb40 Update apache ivy version to 2.5.0
#KT-34893 fixed
2019-11-25 14:46:32 +01:00
Ilya Chernikov
4234c5ec31 Fix ivy resolver: deps config and maven repos:
Transitive dependencies weren't fetched properly in some cases, because of the two problems:
- missing dependency configuration for the root dependency
- using URLResolver for the maven-based (IBiblio) resolvers

Also adding resolver name for easier debugging.
2019-11-25 14:46:32 +01:00
Dmitriy Novozhilov
5e5038416e Revert "tmp"
This reverts commit 3e336913
2019-11-25 16:20:06 +03:00
Dmitriy Novozhilov
3e336913b6 tmp 2019-11-25 14:44:46 +03:00
Dmitriy Novozhilov
4fc554fa9a [FIR-TEST] Add test with unresolved SAM usage of Comparator 2019-11-25 14:44:46 +03:00
Dmitriy Novozhilov
98af866417 [FIR] Fix stopping in AbstractFirUseSiteMemberScope 2019-11-25 14:44:46 +03:00
Dmitriy Novozhilov
52caa6a58d [FIR] Don't recreate type resolver in FirSpecificTypeResolverTransformer 2019-11-25 14:44:45 +03:00
Dmitriy Novozhilov
841ba6ea11 [FIR] Add generating of rawBuilder tests for light tree 2019-11-25 14:44:45 +03:00
Dmitriy Novozhilov
43e621530f [FIR] Add type parameters to FirQualifierExpression
It is needed for resolving qualifiers with type arguments
  like `Array<String>::class`
2019-11-25 14:44:44 +03:00
Victor Turansky
9330547f87 Gradle 6.0.1 support. Fix Yarn loading progress logging
Details - https://github.com/michel-kraemer/gradle-download-task/issues/143

Otherwise - no loading progress log
2019-11-25 13:00:46 +03:00
Pavel Kirpichenkov
4622041706 Update box test for unsigned to signed conversions
Updated test checks, that large unsigned numbers are converted to corresponding
negative signed numbers properly. Using unsinged constants instead of signed
in test allows to remove supressed OI error as well as use test with NI.
2019-11-25 12:22:58 +03:00
Yan Zhulanow
076166c22f Debugger: Generate line numbers for class initializers with a number on the 'init' keyword (KT-16277)
Debugger tests not absent as they use the bootstrap version of kotlinc.
Obviously, this change is not present in it yet.
2019-11-25 17:26:31 +09:00
Yan Zhulanow
bebc8974b2 Report 5308947: check module validity before asking for library versions 2019-11-25 17:26:30 +09:00
Yan Zhulanow
cf620cc60d Debugger: Synchronize "Add field breakpoint" dialog with the platform code 2019-11-25 17:26:30 +09:00
Yan Zhulanow
75b366fc5e EA-211653: Wrap field breakpoint dialog into a transaction guard 2019-11-25 17:26:30 +09:00
Yan Zhulanow
ffeef6c18d EA-210460: Use 'safeAllLineLocations()' instead of throwing 'allLineLocations()' 2019-11-25 17:26:30 +09:00
Yan Zhulanow
aaa45425da EA-210002: handle interruption in case of background inline callable searcher task 2019-11-25 17:26:30 +09:00
Yan Zhulanow
36073ef61e EA-209923: Add missing read action 2019-11-25 17:26:30 +09:00
Yan Zhulanow
69d5115b89 EA-214241: Remove worthless error reporting 2019-11-25 17:26:29 +09:00
Yan Zhulanow
16c4b0e458 EA-210823: Fix AIE in breakpoint applicability test 2019-11-25 17:26:29 +09:00
Yan Zhulanow
ab06f772fc EA-209419: Fix read action requirement in Light constant evaluator 2019-11-25 17:26:29 +09:00
Yan Zhulanow
2983c87212 EA-215308: Fix unsafe check casts in template entry handling 2019-11-25 17:26:29 +09:00
Yan Zhulanow
3534d4af36 EA-215324: Fix "Module already disposed" in Scratch combo-box 2019-11-25 17:26:29 +09:00
Yan Zhulanow
3d17af0ada EA-215375: Check range, not rangeMarker with nullable 'range' inside 2019-11-25 17:26:29 +09:00
Yan Zhulanow
89bd3b8767 EA-215872: Check text range validity before 'getText(range)' 2019-11-25 17:26:28 +09:00
Yan Zhulanow
49bcb103ef EA-216005: Do not request KotlinFacetSettingsProvider for dead projects 2019-11-25 17:26:28 +09:00
Yan Zhulanow
f91a84872a EA-216299: fix SIOOBE in completion 2019-11-25 17:26:28 +09:00
Yan Zhulanow
f75288b480 EA-216333: check PsiElement validity before light class generation 2019-11-25 17:26:28 +09:00
Yan Zhulanow
59296d6a6b EA-217068: Add missing read action 2019-11-25 17:26:28 +09:00
Yan Zhulanow
e12f17d5dc EA-217069: Add missing read action 2019-11-25 17:26:28 +09:00
Yan Zhulanow
54203100bc EA-217072: Add missing read action 2019-11-25 17:26:28 +09:00
Yan Zhulanow
6a4b658ad4 EA-217153: Add line count check 2019-11-25 17:26:27 +09:00
Yan Zhulanow
ab0f841642 Debugger: Provide fixed implementation of 'toString()' for lambdas (KT-32691) 2019-11-25 17:26:27 +09:00
Yan Zhulanow
82a1750d26 Debugger: Forbid 'Nothing' constructor calls in evaluated code (KT-33093) 2019-11-25 17:26:27 +09:00
Pavel Kirpichenkov
55b3637f03 Fix case of inner object usage in missing supertypes checker
FakeCallableDescriptorForObject instance, which is not ConstructorDescriptor,
is checked with call checkers when object's contents are being used.
Checker of missing supertypes should not be run against this fake descriptor.
Object's members belong to separate member scope, so their resolution doesn't
force containing class' supertypes evaluation. I.e. object's methods
may work fine even if some supertypes of containing class are missing.
2019-11-25 10:57:52 +03:00
Mark Punzalan
5afab1ac2b [FIR] FIR2IR: Populate calls with type arguments and function type
parameters with bounds/supertypes.
2019-11-25 09:37:47 +03:00
Dmitriy Dolovov
58dd9a6004 Fix AWT freeze in KotlinNativeABICompatibilityChecker (part 2)
Issue #KT-35052
2019-11-25 09:07:09 +07:00
Dmitriy Dolovov
0747a4d9b7 Fix AWT freeze in KotlinNativeABICompatibilityChecker
Issue #KT-35052
2019-11-25 09:07:02 +07:00
Vladimir Dolzhenko
e321c9e4e7 Fix diagnostics calculations for incremental analysis 2019-11-23 23:36:49 +01:00
Vladimir Dolzhenko
c7c512d55e Merge pull request #2815 from t-kameyama/KT-35022
Remove `const` modifier on "change to var" quickfix

#KT-35022 Fixed
2019-11-23 13:42:00 +01:00
Vladimir Dolzhenko
d599322503 Calculate method parameter hint info in updateParameterInfo method (with a progress till 201)
Fixed #EA-216268
2019-11-23 09:24:14 +01:00
Svyatoslav Kuzmich
84757964bb Advance bootstrap to 1.3.70-dev-1806
Due to updated K/JS klib ABI

Add dependency of KotlinCoverageExtension to idea test classpath because of a new check introduced in 1806.

(cherry picked from commit bffbe89f53)
2019-11-22 22:12:39 +03:00
Nikolay Krasko
73a152ccc7 Re-mute inspection tests in AS34 (KT-32856) 2019-11-22 22:12:39 +03:00
Nikolay Krasko
e49d7c86ff Re-mute move refactoring tests (KT-34106) 2019-11-22 22:12:38 +03:00
Nikolay Krasko
0ae677e945 Re-mute checker tests (KT-34105) 2019-11-22 22:12:38 +03:00
Nikolay Krasko
394a812329 Re-mute completion tests (KT-32919) 2019-11-22 22:12:37 +03:00
Nikolay Krasko
6797fb476c Support auto-mute from file for database with mutes 2019-11-22 22:12:37 +03:00
Nikolay Krasko
9356155f60 Minor: add bunch directives for better discoverability banched code 2019-11-22 22:12:36 +03:00
Toshiaki Kameyama
f6059c3eb5 "Change to var": remove const modifier
#KT-35022 Fixed
2019-11-23 01:17:38 +09:00
Vyacheslav Gerasimov
027bc671c1 Build: Remove duplicated compiler.xml from idea module
Workaround for JPS build by copying compiler.xml in test runner before tests

For gradle just copy it in the processResourcesTask of idea project

 #KT-34528
2019-11-22 18:52:00 +03:00
Pavel Kirpichenkov
8c103629a6 Disable FIR box test for callable references to vararg function 2019-11-22 18:22:04 +03:00
Nikolay Krasko
4267e9e3d0 Revert "Advance bootstrap to 1.3.70-dev-1806"
This reverts commit bffbe89f
2019-11-22 16:24:04 +03:00
Alexey Tsvetkov
e506efb5b2 Include Klib metadata utils into jps-plugin
#KT-34958 Fixed
2019-11-22 15:35:30 +03:00
Vladimir Ilmov
a0d4d0da58 [coroutine][debug] rollback compilation failed exception as it breaks test scenarios 2019-11-22 13:17:37 +01:00
Denis Zharkov
9dc628bd72 Fix FirJavaElementFinder.kt.183 compilation 2019-11-22 13:01:56 +03:00
Alexey Tsvetkov
d3f906a1a2 Minor: extract method & reformat to improve readability 2019-11-22 12:54:42 +03:00
Kevin Bierhoff
ed6b90002e conservatively generate code if descriptor unavailable, which happens for some suspend inline functions
KT-33604
2019-11-22 12:54:42 +03:00
Kevin Bierhoff
0285b26e40 make FunctionCodegen skip method bodies we don't need, which avoids problems with inlining methods inside methods we don't need
KT-33604
2019-11-22 12:54:42 +03:00
Natalia Selezneva
b10f47b50e Minor: merge util methods for scripting to one file in idea-gradle 2019-11-22 11:43:35 +03:00
Natalia Selezneva
23f95872ad Minor: fix packages after moving classes to idea-gradle module 2019-11-22 11:43:35 +03:00
Sergey Rostov
75a23b4bc4 Minor: changes after review 2019-11-22 11:43:35 +03:00
Sergey Rostov
fc100d13dd Scripting: move gradle specific logic to idea-gradle 2019-11-22 11:43:34 +03:00
Sergey Rostov
0fb58ed94c Scripting loading tests and extension points 2019-11-22 11:43:34 +03:00
Natalia Selezneva
ca71b2fe90 Add script configuration dependencies to script classpath
It was missing during configuration refinement thought new scripting API and during loading script configuration on Gradle project import

Do not pass additional classpath to configuration classpath: this may only affects Gradle with New scripting API (because it isn't used from other places)
In additional classpath kotlin-compiler and kotlin-stdlib was passed and there is no needs for this during loading Script Definitions through new scripting API

^KT-34626 Fixed
2019-11-22 11:43:34 +03:00
Natalia Selezneva
29ef10a919 Check gradle version for loading script configuration during import option 2019-11-22 11:43:33 +03:00
Natalia Selezneva
72ef43f462 Show filePattern in settings for new script definitions if present 2019-11-22 11:43:32 +03:00
Natalia Selezneva
c40cd07cf0 Do not show duplicated error gradle templates in settings
^KT-34530 Fixed
2019-11-22 11:43:32 +03:00
Natalia Selezneva
d355a9f686 Minor: fix typo 2019-11-22 11:43:32 +03:00
Natalia Selezneva
229665d2fc Remove unused environment properties from gradle configuration resolver
getScriptContents is no longer used by Gradle
see https://github.com/gradle/gradle/blob/master/subprojects/kotlin-dsl/src/main/kotlin/org/gradle/kotlin/dsl/resolver/ResolverEnvironment.kt
2019-11-22 11:43:32 +03:00
Natalia Selezneva
9710f1da77 Minor: move class 2019-11-22 11:43:32 +03:00
Natalia Selezneva
6c4de96dcb Minor: extract class to separate file 2019-11-22 11:43:31 +03:00
Natalia Selezneva
4b0844b21d Minor: move classes in idea-gradle module related to scripting 2019-11-22 11:43:31 +03:00
Roman Golyshev
28e2d2faf2 KT-34740 Make getImplicitReceiversWithInstanceToExpression keep script implicit receivers
- This makes completion aware of scripts implicit receivers (it matters in .gradle.kts files, for example)
- ^KT-34740 Fixed
2019-11-22 11:22:46 +03:00
Roman Golyshev
be2fe256ba KT-34740 Refactor implicitReceiversUtils.kt 2019-11-22 11:22:46 +03:00
Pavel Kirpichenkov
34b8b96cde Generate forgotten FIR box test 2019-11-22 11:10:47 +03:00
Ivan Gavrilovic
d269c194c7 Fix java version parsing in KAPT
Handle case when "java.version" returns
"11" or "12". Previously, we expected it to
contain at least one dot in the version string.
2019-11-22 16:06:35 +09:00
Jens Klingenberg
508330e0bb Remove deprecated method from CommandLineProcessor 2019-11-22 16:06:35 +09:00
Ivan Gavrilovic
3a7deffe2e KT-33050: Pass source version to KAPT for JDK12+
In JDK 12+ source version should be passed using --source option,
instead of -source. This commit uses correct option based on the
JDK current build is using.

Fixes KT-33050
2019-11-22 16:06:35 +09:00
Ivan Gavrilovic
f4c6f57354 KT-34194: Pass error/NonExistentClass for incremental KAPT run
When running KAPT incrementally, make sure to pass error/NonExistentClass.java
when there is at least one source file to process. This is to make sure
APs that must resolve all types are able to do so.

Test: updated KaptIncrementalWithAggregating/WithIsolating
2019-11-22 16:06:34 +09:00
Vladimir Ilmov
7bdda22cfa [coroutine][debugger] broken testCompileOnly fix missing dependency aether-dependency-resolver in 192,193 versions 2019-11-22 07:27:18 +01:00
Zalim Bashorov
3fa431e114 [JS IR] Don't use full paths when generating comments with a path for file blocks 2019-11-21 23:51:09 +03:00
Zalim Bashorov
c05c07f243 [JS IR] Generate special region comments at the start and the end of each file block
It allows to fold these blocks and navigate to them in the IDEA.

Also, this commit adds compiler configuration keys to control generating comments with paths for file blocks,
and now generating such comments is enabled only in our tests.
2019-11-21 23:51:08 +03:00
Zalim Bashorov
fa76b9cf83 [JS IR] Use single line comment instead of JsDoc comment for comments with path 2019-11-21 23:51:08 +03:00
Zalim Bashorov
83e85b3ec8 [JS AST] Add single line comment node 2019-11-21 23:51:08 +03:00
Zalim Bashorov
5fe79f71ad [JS IR] Don't generate comment with path for "empty" files 2019-11-21 23:51:08 +03:00
Zalim Bashorov
4e3a2a0b3e [JS AST] Don't generate a new line after try and if-then blocks 2019-11-21 23:51:08 +03:00
Igor Yakovlev
8f9895e64e Add external keyword support for UL
Fixed #KT-34923
2019-11-21 22:49:23 +03:00
Pavel Kirpichenkov
f80a71517f [NI] Handle vararg parameter in reflection type wrt array types
Vararg parameter in reflection type is interpreted as covariant
array type against array in expected functional type and as
vararg element type otherwise. For instance having function
fun foo(vararg args: Int): Unit { /*...*/ }
reference ::foo can be passed against expected
(Int) -> Unit,
(Int, Int) -> Unit, etc.
In none of such cases type for parameter in foo's reflection type
should be changed to array.
However, against expected type (IntArray) -> Unit args' type
must become IntArray.

^KT-25514 Fixed
2019-11-21 20:07:14 +03:00
Igor Yakovlev
aba5ff0c1e Fix copy refactoring for multiply kotlin files
Fixed #KT-34971
2019-11-21 19:19:15 +03:00
Mikhail Glukhikh
7d944e2023 FIR dispatch receiver: check nullability only (expected vs actual type)
This gives a minor performance boost and prepares for upcoming K/J type mapping
2019-11-21 19:00:50 +03:00
Dmitry Savvinov
0dc7c37b62 Choose SDK consistently at least for non-COMPOSITE analysis
In COMPOSITE analysis we don't have a constant SDK dependency for whole
ResolutionFacade, so we have to find it manually via calling
'findSdkAcrossDependencies'

In SEPARATE mode we do have such a constant SDK dependency, but there
was an assumption that it doesn't make a difference (i.e.
findSdkAcrossDependencies always return the same SDK as passed constant
one)

Turns out that assumption was wrong, particularly for projects with
duplicate SDK entries in project structure. Then we would choose one SDK
in some cases, and the other one on other cases - even though they a
bit-to-bit equal, we will create separate descriptors for them, which
might lead to some issues, like in KT-34802

^KT-34802 Fixed
2019-11-21 18:56:49 +03:00
Alexander Udalov
e4afbae954 Minor, fix test data for kotlinx.serialization bytecode text test 2019-11-21 16:44:30 +01:00
Alexander Podkhalyuzin
4e331d0fb9 Update ReadMe.md
Update usages of old IDEA versions in readme
2019-11-21 18:36:01 +03:00
sergey.igushkin
88dae8025e Fix failure with Kotlin/Native distributions that have no stdlib
Add a warning message during Gradle configuration phase if the
Kotlin/Native distribution is missing the stdlib.

Issue #KT-35033 Fixed
2019-11-21 18:28:59 +03:00
Vladimir Dolzhenko
6a28d1da82 Resolve references in background thread in PlainTextPasteImportResolver
#KT-16774 Fixed
2019-11-21 16:05:08 +01:00
Ilya Goncharov
bdb1c2a27f [Gradle, JS] Fix tasks naming
#KT-35019 fixed
2019-11-21 17:48:22 +03:00
pyos
d221c1f242 JVM_IR: refactor MoveCompanionObjectFieldsLowering
* Extract replacement of IrGetField/IrSetField into a separate
   file-level lowering (should reduce the amount of work to linear in
   the number of classes rather than potentially quadratic)

 * Extract static backing field construction into JvmDeclarationFactory
   and move that lowering after PropertiesToFields lowering to reduce
   code duplication
2019-11-21 15:14:44 +01:00
Pavel Kirpichenkov
afd59f0d46 [NI] Fix 'only input type' check for intersection types
Check worked incorrectly in case when argument type and expected type are the
same intersection type, which is possible for local variables without explicit
type declaration.
2019-11-21 15:59:26 +03:00
pyos
57760e5873 FIR: set anonymous initializers' parents 2019-11-21 15:53:52 +03:00
Alexander Udalov
b38153e402 Minor, add runtime and comment to test on multi-file isInitialized 2019-11-21 13:46:53 +01:00
Alexander Udalov
bf06d381b9 Minor, move old Java nullability assertion tests under oldLanguageVersions/
Also drop the (now confusing) "_lv12" suffix from newer tests
2019-11-21 13:46:17 +01:00
Vladimir Dolzhenko
16e76fb75a Resolve imports in background thread in PlainTextPasteImportResolver
#KT-34956 Fixed
2019-11-21 13:40:55 +01:00
Svyatoslav Kuzmich
bffbe89f53 Advance bootstrap to 1.3.70-dev-1806
Due to updated K/JS klib ABI
2019-11-21 15:33:48 +03:00
pyos
0f4f3f2429 FIR: set correspondingPropertySymbol of backing fields 2019-11-21 15:27:53 +03:00
Mikhail Glukhikh
0dcce9f584 FIR: add forgotten annotation calls resolve at some points 2019-11-21 14:25:27 +03:00
Mikhail Glukhikh
1bc4642fc9 Run CompileKotlinAgainstJava tests in both APT / non-APT modes 2019-11-21 14:25:16 +03:00
Mikhail Glukhikh
393047883e JavacWrapper: add Kotlin classes to classpath only in APT mode 2019-11-21 14:25:13 +03:00
Mikhail Glukhikh
89a582b694 JavacWrapper: perform makeOutputDirectoryClasses hack only in non-APT mode
For some reason, working without APT requires this call in JavacWrapper.
From the other hand, working without APT does not require
Kotlin class files to be in javac classpath.
2019-11-21 14:25:08 +03:00
Ilya Goncharov
64380670c5 [Gradle, JS] Add more info for check exit code 2019-11-21 12:59:52 +03:00
Ilya Goncharov
ac241852de [Gradle, JS] Add verbose option to yarn in debug mode 2019-11-21 12:59:52 +03:00
Dmitriy Dolovov
28f2a2a864 Fix: Kotlin/Native libs have non-user friendly representation in IDE
Issue #KT-30288
Issue #KT-34998
Issue #KT-34400 (partially fixes)
2019-11-21 16:56:47 +07:00
Dmitry Petrov
d3a5dcb601 KT-35004: keep track of KotlinType for 'when' subject 2019-11-21 10:48:14 +03:00
Mikhail Glukhikh
338b4e2eab Refactor AbstractCompileKotlinAgainstJavaTest 2019-11-21 10:10:58 +03:00
Mikhail Glukhikh
32aba31819 Cleanup: AbstractCompileKotlinAgainstJavaTest 2019-11-21 10:10:53 +03:00
Georgy Bronnikov
307c82e3a4 JVM_IR: redirect to correct function in special brigdes
The fix in MethodSignatureMapper allows us to avoid the hack
with orphanedCopy() in BridgeLowering.
2019-11-20 21:00:59 +03:00
Mikhail Zarechenskiy
ef567c868e [NI] Add checkCanceled checks before resolving a candidate
This is an analogue that was done for old inference in CandidateResolver
2019-11-20 18:14:58 +03:00
Mikhail Zarechenskiy
63e62dcf42 Add checkCanceled check on resolving imports path
Imports resolution is a rather time consuming task and doesn't have
 `checkCanceled` on its computation path. So, if a thread is resolving
 imports it will do it until the end of computation, which can lead to
 unnecessary work and some IDE freezes.

 #KT-34990 Fixed
2019-11-20 18:14:57 +03:00
Denis Zharkov
db24d4ac9a FIR: Drop ConeTypeAliasLookupTag 2019-11-20 18:02:08 +03:00
Denis Zharkov
38500d27e8 FIR: Add cache for expanded types 2019-11-20 18:02:07 +03:00
Denis Zharkov
159aefd26d FIR: Refactor Cone types
- Get rid of AbbreviatedType
2019-11-20 17:57:35 +03:00
Denis Zharkov
e03162f2dd FIR: Rename ConeClassTypeImpl -> ConeClassLikeTypeImpl 2019-11-20 17:55:23 +03:00
Denis Zharkov
f178cb6fb3 FIR: Replace trivial usages of ConeClassType with ConeClassLikeType 2019-11-20 17:55:23 +03:00
Alexander Udalov
a485a5ffd6 JVM IR: load fields for JvmField properties from dependencies
This is needed to properly lower JvmField property calls to field
accesses.
2019-11-20 15:35:12 +01:00
Alexander Udalov
608449f41d IR: introduce StubGeneratorExtensions for ExternalDependenciesGenerator
This is a refactoring to simplify the API of
ExternalDependenciesGenerator and to constrain future additions of
platform-specific stub generator extensions.
2019-11-20 15:16:57 +01:00
Mikhael Bogdanov
c3af2d5a10 JVM_IR. Combine all inline function resolve logic in ResolveInlineCalls lower 2019-11-20 14:37:53 +01:00
pyos
939a9ff53e JVM_IR: fix NPE in interface companion initializers
* When referencing the companion itself, they should use the $$INSTANCE
  field, not the (null until <clinit> returns) Companion field of the
  interface.

* Interface companion init blocks should be made static.
2019-11-20 14:37:19 +01:00
pyos
7c015564ce JVM_IR: do not set ACC_VARARGS if vararg is not the last parameter
Fun fact: this is not actually validated when loading the class; and
even when compiling a java file against a class file that does this,
only javac 9 has a check (1.8 and before simply crashes with
NullPointerException somewhere deep inside the compiler).
2019-11-20 13:40:46 +01:00
Mark Punzalan
7adffe0007 Handle withIndex() on Iterables (including progressions) and Sequences
in ForLoopsLowering.
2019-11-20 13:02:21 +01:00
Mark Punzalan
a54d9482dd Handle withIndex() on arrays and CharSequences in ForLoopsLowering. 2019-11-20 13:02:21 +01:00
Mark Punzalan
735535dd5a Extract HeaderInfo base class and add NumericHeaderInfo class, in
preparation for handling withIndex().
2019-11-20 13:02:21 +01:00
Mark Punzalan
2ab539c5eb Encapsulate variable construction and declaration order logic within
ForLoopHeader instead of in HeaderProcessor.
2019-11-20 13:02:21 +01:00
Mark Punzalan
60c05362d2 Refactor ForLoopHeader to clarify the purpose of its functions. 2019-11-20 13:02:21 +01:00
Mark Punzalan
7f803e60b6 Fix typo in forInArrayWithIndex testdata filenames. 2019-11-20 13:02:21 +01:00
Mikhael Bogdanov
9066614cb9 Support inlining of implicitly casted lambda parameter 2019-11-20 12:57:41 +01:00
Mikhael Bogdanov
d28ec1d449 Add test for default lambda inlining in suspend inline 2019-11-20 12:57:41 +01:00
Mikhael Bogdanov
a92afc5a89 JVM_IR. Disable private default flag test
JVM_IR generates `public` flag
2019-11-20 12:57:40 +01:00
Mikhael Bogdanov
344c11af7f JVM_IR. Support multifile facades in default function inlining 2019-11-20 12:57:39 +01:00
Mikhael Bogdanov
19ce055322 JVM_IR. Pass stub function reference in 'getSignature' 2019-11-20 12:57:38 +01:00
Mikhael Bogdanov
a214d61567 IR. Change visibility to lowered default function/constructors to public 2019-11-20 12:57:38 +01:00
Mikhael Bogdanov
abef5daea9 IR. Hack to distinguish default values 2019-11-20 12:57:37 +01:00
Mikhael Bogdanov
ac31e0e8c7 Support default lambda inlining in IR 2019-11-20 12:57:36 +01:00
Mikhael Bogdanov
8adac2d1ea Don't add unused label if variables are absent 2019-11-20 12:57:36 +01:00
Mikhael Bogdanov
be3eed5f1f Access to receiver thought reference class 2019-11-20 12:57:35 +01:00
Mikhael Bogdanov
7bab3a1048 Set non-synthetic origin for generated members of PropertyReference 2019-11-20 12:57:34 +01:00
Mikhael Bogdanov
3196893166 Don't write synthetic arguments to LVT 2019-11-20 12:57:33 +01:00
Mikhael Bogdanov
f264942bf9 Don't coerce intrisic value, it's already coerced 2019-11-20 12:57:33 +01:00
Mikhael Bogdanov
e409387078 Don't generate jump for last when condition 2019-11-20 12:57:32 +01:00
Mikhael Bogdanov
9a07063d8b Decrease number of 'invokeMethodDescriptor' usage in inliner 2019-11-20 12:57:31 +01:00
Mikhael Bogdanov
3eec67e5d3 JVM_IR. Don't compare with 0 defaultFlag 2019-11-20 12:57:30 +01:00
Mikhael Bogdanov
f5fb50b224 IR. Add separate origins for synthetic parameters in default functions.
Keep information about types and default values in lowered funtion
2019-11-20 12:57:30 +01:00
Alexey Trilis
764a25f6ae [JS] Add deprecated typealias and extension properties for renamed in dukat update entities 2019-11-20 12:49:03 +01:00
Andrey Uskov
937cffd273 Support Gradle 5.x in GradleInspectionTest 2019-11-20 13:53:58 +03:00
Andrey Uskov
21b9987a76 Support Gradle 5.x in GradleMigrateTest 2019-11-20 13:53:56 +03:00
Andrey Uskov
5fe4baa4a5 Fix GradleNativeLibrariesInIDENamingTest 2019-11-20 13:53:54 +03:00
Andrey Uskov
968ccf667a Fix GradleNativeLibrariesPropagationTest
Dev plugin in tests were replaced with release version
2019-11-20 13:53:52 +03:00
Andrey Uskov
8a3dfe93f2 Fixed GradleFacetImportTests for gradle 5.x 2019-11-20 13:53:50 +03:00
Andrey Uskov
9e7eff7e72 Enable ImportCompilerArgumentsWithInvalidDependencies test 2019-11-20 13:53:48 +03:00
Vladimir Ilmov
25acb1e191 [coroutine][debugger] removed and regenerated tests for not-ready-to-be-tested logic, kt* tests are failing due to KT-32691 2019-11-20 13:17:56 +03:00
Vladimir Ilmov
09d2bd33f8 [coroutine][debug] incorrect merge conflicting with 00a06ef9b9 2019-11-20 12:36:13 +03:00
Mikhail Glukhikh
137e54db05 FIR Java (raw type bounds erasure): make better protection from recursion 2019-11-19 23:22:36 +03:00
Mikhail Glukhikh
95203e9310 FIR: unmute passing black-box tests (nested constructor resolve) 2019-11-19 23:02:35 +03:00
Mikhail Glukhikh
fa739f1aae FIR: optimize classifier scope: don't search for nonexistent symbols 2019-11-19 22:41:19 +03:00
Mikhail Glukhikh
d39a36ee25 FIR declared member scope: remove constructors from callable index
This removes constructor resolve ambiguity in some cases.
Now constructors are resolved only via classifiers
2019-11-19 22:41:17 +03:00
Mikhail Glukhikh
bd71d1dc3f FIR resolve: use lazy nested classifier scopes for Java classes
It's necessary because JavaSymbolProvider adds nested classifiers lazily.
Commit slows things down due to relatively slow search in symbol providers
2019-11-19 22:40:22 +03:00
Dmitriy Novozhilov
cc891c46b1 Mute failing fir blackbox test 2019-11-19 21:09:29 +03:00
Mads Ager
15ed342282 JVM_IR: Generate args check in existing methods for special bridge methods.
Fix the number of arguments checked (1 for getOrDefault and 2 for
remove).
2019-11-19 19:10:04 +03:00
Alexander Gorshenev
369d9bfdab Dropped index from DeserializedSourceFile as it is no longer needed 2019-11-19 18:19:46 +03:00
Alexander Gorshenev
e7ef453d22 Got rid of klib file registry 2019-11-19 18:19:46 +03:00
Simon Ogorodnik
f49bc0e96d [FIR] Improve keyword colors (light-theme) in html dump 2019-11-19 16:50:46 +03:00
Simon Ogorodnik
36979e7937 [FIR] Support ConeDefinitelyNotNullType in html dump 2019-11-19 16:50:44 +03:00
Simon Ogorodnik
9249d1b727 [FIR] Support diagnostics in Html dump 2019-11-19 16:50:43 +03:00
Simon Ogorodnik
6e8f8f9a65 [FIR] Partially support raw types 2019-11-19 16:50:40 +03:00
Georgy Bronnikov
119a3f1306 JVM_IR: do not generate accessors to lateinit private properties 2019-11-19 16:30:04 +03:00
victor.petukhov
be0516348b IDE formatting: add indention for new line in parameters list when there is a trailing comma 2019-11-19 16:08:42 +03:00
Ilya Goncharov
d246d12093 [Gradle, JS] Add intregration test on browser pipeline with transitive dependencies 2019-11-19 14:02:47 +03:00
Ilya Goncharov
c87961dcad [Gradle, JS] Dce should work with runtime classpath
#KT-34946 fixed
2019-11-19 14:02:45 +03:00
Ilya Goncharov
c2b53dfce7 [Gradle, JS] Add debugger; only for debug mode 2019-11-19 13:52:37 +03:00
Ilya Goncharov
4d3698313d [Debugger, JS] Configure timeouts for debugging 2019-11-19 13:52:37 +03:00
Ilya Goncharov
79ef361e1a [Debugger, JS] Remove Mocha configuring in KotlinKarma 2019-11-19 13:52:37 +03:00
Ilya Goncharov
15a606c2b6 [Debugger, JS] Rename karma-debug on karma-debug-runner 2019-11-19 13:52:37 +03:00
Ilya Goncharov
5f8a5d5fca [Debugger, JS] Extract Debug's configurations 2019-11-19 13:52:37 +03:00
Ilya Goncharov
d57127ed08 [Debugger, JS] Fix for mocha timeout 2019-11-19 13:52:36 +03:00
Ilya Goncharov
d7c2d098af [Debugger, JS] Add configuring debuggable browser 2019-11-19 13:52:36 +03:00
Ilya Goncharov
550cc9d775 [Gradle, JS] Add karma debugger by timeout 2019-11-19 13:52:36 +03:00
Ilya Goncharov
821a4ea472 [Debugger, JS] Use default js debug configuration with Karma 2019-11-19 13:52:36 +03:00
Mikhail Glukhikh
3d00212e34 FIR Java: add minor comment (type parameter types) 2019-11-19 13:13:24 +03:00
Mikhail Glukhikh
f60842efe1 FIR resolve: add test with Java static class constructor access from Kotlin
This test does not work because nested classifier scope works incorrectly for Java
2019-11-19 13:08:54 +03:00
Mikhail Glukhikh
19aff81b55 FIR tower resolve: make static members accessible from derived classes 2019-11-19 13:07:53 +03:00
Mikhail Glukhikh
7dea06d2a7 FIR tower resolve: make companion members accessible from derived classes 2019-11-19 13:07:52 +03:00
Mikhail Glukhikh
802ed9b502 FIR: implement protected visibility checker #KT-34788 Fixed 2019-11-19 13:07:52 +03:00
Mikhail Glukhikh
ad3659d1d9 FIR deserializer: add forgotten type parameter bounds for FunctionX 2019-11-19 13:07:51 +03:00
Mikhail Glukhikh
1e548e3f21 FIR substitution: use intersection of bounds for * projection 2019-11-19 13:07:46 +03:00
Dmitriy Novozhilov
43a8c1282f [FIR] Add toString() call to expressions in string templates 2019-11-19 13:04:49 +03:00
Dmitriy Novozhilov
8d9d6fd181 [TEST] Regenerate FirBlackBoxCodegenTest 2019-11-19 13:04:49 +03:00
Vladimir Ilmov
022a31398a [coroutine][debug] creation stack trace jump to line fixed 2019-11-19 12:29:54 +03:00
Vladimir Ilmov
25222b55e6 [coroutine][debug] AsyncStackTraceProvider refactored 2019-11-19 12:29:54 +03:00
Vladimir Ilmov
310b3611ef coroutine extention refactored to minimize brunch-related logic 2019-11-19 12:29:54 +03:00
Vladimir Ilmov
c90cd8c490 [coroutine][debug] compilation error fixed 2019-11-19 12:29:53 +03:00
Aleksandr Prokopyev
3ca5d2d64f Debugger: Add 193 bunch for coroutines debugger 2019-11-19 12:29:53 +03:00
Aleksandr Prokopyev
1dc44b4000 Debugger: Tests refactor 2019-11-19 12:29:53 +03:00
Aleksandr Prokopyev
12313fa5aa Debugger: Fix for coroutine debugger after review 2019-11-19 12:29:52 +03:00
Aleksandr Prokopyev
5975251a32 Debugger: Coroutines stack frames with variables & coroutine dumps 2019-11-19 12:29:06 +03:00
Roman Artemev
c459b2ca6e [JS IR] Fix state machine control flow
- exception loop unwinding: make sure exception state is reset after try block is finished
 - break/continue of suspended loops
2019-11-19 11:15:36 +03:00
Roman Artemev
18d0b477b6 [JS IR] Fix arrayOfNulls API 2019-11-19 11:15:36 +03:00
Roman Artemev
f2093a1763 [JS IR] Fix boxing/unboxing of inline classes in coroutine scope
- don't box/unbox when value is known to be an inline class
 - add unbox state when coroutine resumed
 - correctly handle suspension in case of inline class
 - add tests
2019-11-19 11:15:35 +03:00
Roman Artemev
52b24ead91 [IR] Add REINTERPRET_CAST operator in IrTypeOperatorCall
- fix BE
 - fix Serializer
 - implement builder
 - make Ir a bit more type-correct
 - support developer mode (lowering [dynamic]implicit cast meterialized as general cast)
 - fix autoboxing lowering
2019-11-19 11:15:35 +03:00
Roman Artemev
3795897fb7 [JS IR] Add developer mode in configuration 2019-11-19 11:15:35 +03:00
Roman Artemev
a2703b1534 [IR] Unlink isLocal and isAnonymousObject from Descriptors API 2019-11-19 11:15:35 +03:00
Mikhail Glukhikh
f633102b8c Unmute one of generated FIR black box codegen tests 2019-11-19 11:00:10 +03:00
Mikhail Glukhikh
9c9cf2086d Unmute recently fixed FIR black box tests 2019-11-19 11:00:10 +03:00
Mikhail Glukhikh
f3d0a976b2 Disable recently added FIR black box tests 2019-11-19 11:00:10 +03:00
Mikhail Glukhikh
779b9e97d5 Add IGNORE_BACKEND_FIR into generated black box tests (InRange, Ranges, ...) 2019-11-19 11:00:10 +03:00
Mikhail Glukhikh
7a7fc89c00 Regenerate FIR black box codegen tests 2019-11-19 11:00:09 +03:00
Mikhail Glukhikh
2ab3769998 Generation test utils: extract compileFilesUsing standard mode / FIR 2019-11-19 11:00:09 +03:00
Mark Punzalan
9df2f69f09 [FIR] Disable failing blackbox codegen tests for FIR. 2019-11-19 11:00:09 +03:00
Mark Punzalan
fc9ccafb84 [FIR] Generate and enable blackbox codegen tests. 2019-11-19 11:00:06 +03:00
Dmitriy Novozhilov
ac590fa4c9 [FIR] Fix deserializing nullability of type parameters 2019-11-19 10:43:46 +03:00
Dmitriy Novozhilov
950d1f4fe4 [FIR] Fix enhancement of java array type 2019-11-19 10:43:46 +03:00
Dmitriy Novozhilov
d56412e397 [FIR] Analyze lambda arguments in erroneously resolved calls 2019-11-19 10:43:46 +03:00
Dmitriy Novozhilov
a85ece1d83 [FIR-TEST] Add test with problem of invisible static members of supertype 2019-11-19 10:43:46 +03:00
Dmitriy Novozhilov
35dd1cf75a [FIR] Fix binding return expression to function 2019-11-19 10:43:46 +03:00
Dmitriy Novozhilov
98378d8973 [FIR] Infer type of lambda using all return statements 2019-11-19 10:43:45 +03:00
Dmitriy Novozhilov
99da7272f5 [FIR] Change children order in FirConstructor 2019-11-19 10:43:45 +03:00
Dmitriy Novozhilov
01b47854c6 [FIR] Fix implicit builtin types usages in body resolve 2019-11-19 10:43:45 +03:00
Sergey Bogolepov
e4702bf438 [kotlinx-metadata] Add extensions for type aliases. 2019-11-19 11:41:06 +07:00
Steven Schäfer
85b36dcd88 IR: Introduce IrClassifierSymbol.defaultType 2019-11-18 19:40:04 +01:00
Steven Schäfer
3d7d1022e4 JVM IR: Add supertypes for PropertyReference classes in JvmSymbols
This is still missing overrides, but this change is enough to make
the code generated in PropertyReferenceLowering typecheck.
2019-11-18 19:40:04 +01:00
Steven Schäfer
2db8471dd7 IR: Avoid "raw" IrTypes
The ir type checker cannot deal with types with an incorrect number of arguments.
On the other hand, the JVM IR backend sometimes produces "raw types" - types with
generic parameters but without arguments. This commit removes such raw types as
much as possible, by replacing calls to "typeWith()" with calls to "defaultType"
for classes without type parametes (defaultType doesn't allocate, unlike typeWith)
and with calls to "starProjectedType" for classes with type parameters.
2019-11-18 19:40:04 +01:00
Steven Schäfer
4d67803f04 JVM IR: Fix IR types in default argument stubs 2019-11-18 19:40:04 +01:00
Steven Schäfer
9ef627ebec JVM IR: Fix types in EnumClassLowering 2019-11-18 19:40:04 +01:00
Steven Schäfer
492a46206b JVM IR: Fix return type of IrSetField in SharedVariablesManager 2019-11-18 19:40:04 +01:00
Alexander Udalov
e8cb19fe22 IR: minor, remove obsolete IrBasedDeclarationDescriptor
It was introduced to reference wrapped descriptors in `ir.tree`, but
since 2f544280 it's no longer necessary
2019-11-18 18:58:41 +01:00
Alexander Udalov
0daab88f97 JVM IR: make RemoveInlinedDeclarations a final module phase
Code in inline lambdas can call multifile part members. These calls are
replaced in GenerateMultifileFacades with the call to the facade member.
Previously this didn't happen though because the lambda body was removed
before the GenerateMultifileFacades phase, which led to
IllegalAccessError in the -Xmultifile-parts-inherit mode (because the
part class is package private in another package).
2019-11-18 18:58:41 +01:00
Alexander Udalov
cdb7703947 JVM IR: fix VerifyError on annotated annotation properties
The problem was that we tried to generate an `$annotations` method for a
property declared in an annotation class. That method is final and has a
body, which is not allowed in annotation classes. Now we're generating
this method in the separate `$DefaultImpls` class as for properties in
interfaces.

Note that the added test still doesn't find any annotations because the
proper support is needed in reflection (KT-22463). Currently it only
checks that no VerifyError happens.
2019-11-18 18:58:41 +01:00
Alexander Udalov
994d4e081b JVM IR: fix names of monitorenter/monitorexit intrinsics
Since they're "illegally" accessed from another file in stdlib,
accessors are generated for them, and the calls go through these
accessors
2019-11-18 18:58:41 +01:00
Alexander Udalov
f47b67781d JVM IR: fix containing declaration for top level members in wrapped descriptors
In addition to fixing getContainingDeclaration, change origin of
multifile facades to FILE_CLASS since the corresponding class descriptor
should also be skipped when computing containing declaration. This fixes
the problem with internal function calls in -Xmultifile-parts-inherit
mode (previously we incorrectly mangled the function name in
MethodSignatureMapper), and also fixes coroutine intrinsic calls when
compiling kotlin-stdlib with JVM IR. In the latter case, all intrinsics
(such as isBuiltInSuspendCoroutineUninterceptedOrReturn) are present in
sources, and were previously not detected as intrinsics by the code in
`generateInlineIntrinsic` because the FQ name didn't match: it had an
additional component for the file class name.
2019-11-18 18:58:41 +01:00
Alexander Udalov
59af967292 JVM IR: support suspend inline functions in -Xmultifile-parts-inherit mode
Support in the normal (without -Xmultifile-parts-inherit) mode is a bit
more complicated, see the added test.
2019-11-18 18:58:40 +01:00
Alexander Udalov
6f5aa58338 JVM IR: support -Xmultifile-parts-inherit mode 2019-11-18 18:58:40 +01:00
Alexander Udalov
3b6b3c7e66 JVM IR: minor, don't use symbols for maps of multifile members
To simplify usage of these maps at call sites
2019-11-18 18:58:40 +01:00
pyos
9182f2c796 IR: don't attempt to move defaults to actual in another module
May happen when a function in an `expect` class is aliased through an
`actual typealias`; the matching declaration is filtered out in
`ExpectedActualResolver.findActualForExpected` as it has no source.
2019-11-18 18:41:21 +01:00
pyos
1bc48c3df9 IR: copy annotations when making lateinit fields nullable 2019-11-18 18:35:15 +01:00
Alexey Trilis
4f56b1a960 Add support for Touch API in JS Stdlib
#KT-34948 fixed
#KT-21445 fixed
2019-11-18 19:44:03 +03:00
Vyacheslav Gerasimov
2dfa6c360b Fix version range for Idea 191 plugin
#KT-34385
2019-11-18 18:49:40 +03:00
Svyatoslav Kuzmich
a46e970f47 [JS] Remove kotlin-test-js build from JPS
kotlin-test-js is also built by JS IR backend
JS IR backend does not support JPS yet
2019-11-18 15:31:12 +03:00
Svyatoslav Kuzmich
c8e5b2f2f8 [KLIB] Add error message when failed to resolve library 2019-11-18 15:31:12 +03:00
Pavel Kirpichenkov
3e8c15c62a Introduce component for caching missing supertypes
Profiling has shown, that supertype hierarchy scan for all calls has considerable
performance cost. However, missing supertypes may be calculated only once per
descriptor which would help avoiding multiple supertype hierarchy scans for
resolved calls from the same class. New memoizer is injected into call completers
and checker contexts and then used for retrieving missing super classifiers.

#KT-19234 Fixed
2019-11-18 12:06:41 +03:00
Pavel Kirpichenkov
4b405c6c0f Supply kotlin mock JDK to relevant test runners
Default mock JDK from IDEA 193, "wins" mock JDK from kotlin in some tests.
In script configuration test this breaks resolution of java declarations from script environment.
Overriding getTestProjectJdk replaces default test project JDK with kotlin mock JDK.
Configuration in AbstractMultiFileHighlightingTest was updated similarly to fix test failures.
2019-11-18 12:06:41 +03:00
Pavel Kirpichenkov
8c52bb4212 Add frontend checks for missing dependency supertypes
Call checker and declaration checker are used in order to preserve backward compatibility.
Attempt to use classifier usage checker was not good enouth,
since not all errors found with it would actually be reported before.
For example types and constructor calls don't cause supertypes to resolve,
so missing supertypes would not lead to errors in case they are the only use of class name.

Updated tests failing due to missing Java dependencies in superclasses.
2019-11-18 12:06:41 +03:00
Pavel Kirpichenkov
388cd53105 Add filtering during generation of mockJDK JAR
Adjustments for missing superclasses checker.
Some hierarchies in mock JDK are incomplete.
Absence of its .class file causes some tests to fail without an actual error.
To mitigate this problem, top-level classes and interfaces can only inherit from entries that belong to mock JDK.
Absent superclasses are replaced with java.lang.Object.
This only affects runtime jar of mock JDK.
2019-11-18 12:06:41 +03:00
Ilya Chernikov
27ff2d7816 Prohibit using array based on non-reified type parameters as reified type arguments
#KT-31227 fixed
2019-11-18 09:32:52 +01:00
Andrey Uskov
8a1f8714e7 Fix GradleConfiguratorTest
Kotlin gradle plugin was removed from test classpath
2019-11-18 11:26:13 +03:00
Mikhail Zarechenskiy
43d916e92d [NI] Add tests for obsolete issues
#KT-26303 Obsolete
 #KT-32205 Obsolete
2019-11-18 10:25:41 +03:00
victor.petukhov
cf161f8234 Rework notForIncompletionCall test 2019-11-17 15:19:28 +03:00
pyos
ba93bdb14d JVM_IR: keep the $default suffix for stubs for @JvmName functions
Technically a backwards compatibility problem, as the new backend
*consistently* renamed `f$default` on `f` with `@JvmName("g")` to
`g` instead of `g$default`, so it all worked out. However, this
breaks when encountering libraries compiled with the non-IR backend.
2019-11-15 17:40:52 +01:00
Steven Schäfer
23dfade24f JVM IR: Fix inlining of inline class properties in external modules 2019-11-15 17:30:16 +01:00
Vladimir Dolzhenko
fa62d0c325 Don't clear InBlockModifications on CanceledException
#KT-34914 Fixed
2019-11-15 15:48:27 +01:00
Pavel Kirpichenkov
92dae5d8a9 [NI] Split substitution of inferred type parametes into two steps
Substituting inferred type parameters with single substitutor leads
to incorrect behaviour in cases, when class' type parameters are used in constructor.
As a side effect of two-step substitution, intermediate descriptor is created,
which prevents incorrect substitution. To preserve this side effect, single
resulting substitutor was split into two substitutors: one for substituting fresh
variables and another for substituting inferred variables and known parameters.

^KT-32415 Fixed
2019-11-15 16:58:32 +03:00
Pavel Kirpichenkov
b6af13f18d [NI] Add missing substitution of known type parameters
Known type parameters appear after inheriting from class with type
parameters. Their substitution matters for inner class constructor,
because without substitution it's parameters will be type checked
against incorrect (original) parameter descriptor with unsubstituted
type parameters.

Skip creation of composite substitutor, if old substitutor is empty.

New substitutors return null in case they don't substitute a type,
but old type substitutors have explicit isEmpty method. Composite
substitutor with empty old substitutor leads to creation
of incorrect descriptor copies.
2019-11-15 16:58:07 +03:00
Pavel Kirpichenkov
3122f2704c [Minor] Refactor resulting descriptor substitution in call transformer 2019-11-15 16:58:07 +03:00
Pavel Kirpichenkov
ea66f02035 [Minor] Rename fresh variable substitutor in resolved atom 2019-11-15 16:58:07 +03:00
victor.petukhov
25f3de2085 Use more stable kotlin dependency in tests for enabling inline classes flag 2019-11-15 16:13:44 +03:00
Sergey Bogolepov
4438dd282f [kotlinx-metadata-klib] Bugfixes:
1. Add dependency on `:core:descriptors`
2. Wrap module name with < and >
3. Remove redundant question marks.
4. Fix string table writing.
2019-11-15 19:10:30 +07:00
Sergey Bogolepov
95399b3a41 Introduce kotlinx-metadata-klib.
`kotlinx-metadata-klib` is an extension of `kotlinx-metadata` that can be used to read and write metadata that is stored inside KLIBs.
Note: current version is in its early days and in active development. Almost nothing is stable or properly tested.
2019-11-15 16:38:07 +07:00
Ilya Gorbunov
d91453fb7a Do not preprocess apiVersionIsAtLeast calls inlined into kotlin package
If such call were to be inlined into an inline function in kotlin
package, it would be expanded there preventing the further expansion in
client code.
2019-11-15 05:22:24 +03:00
Andrey Uskov
352a10a0ed Do not fail tests on unknown version of gradle Kotlin plugin 2019-11-14 21:13:21 +03:00
Andrey Uskov
e963b71921 Tests of import with latest gradle plugin are implemented 2019-11-14 21:13:19 +03:00
Andrey Uskov
51590ef1b7 Migrate import tests to annotation-driven determination of target
kotlin plugin versions
2019-11-14 21:13:16 +03:00
Andrey Uskov
d05f893233 Import tests with gradle 5.6.4 were added 2019-11-14 21:13:13 +03:00
Andrey Uskov
a51e2ca4d6 Limit initial heap of gradle daemon in import tests 2019-11-14 21:13:11 +03:00
Andrey Uskov
1f2767ae21 Remove gradle testing import from gradle 3.x 2019-11-14 21:13:09 +03:00
Andrey Uskov
48f6207d26 Support annotation-based declaration of target plugin and gradle version
in gradle importing tests
2019-11-14 21:13:07 +03:00
Andrey Uskov
14aa0eae71 Extract kotlin gradle plugin versions to constants in tests 2019-11-14 21:13:05 +03:00
Roman Golyshev
633005fb57 KT-25732 Perform keywords completion earlier to complete them before freeze
- If you complete keywords too late, the completion list may become frozen, and `null` will never make it to the top of it
- Remove `flushToResultSet` between `addReferenceVariantElements` calls because flush already happens inside of them
- ^KT-25732 Fixed
2019-11-14 19:50:38 +03:00
Alexander Udalov
36ca280b86 Fix compilation error in ResolveInlineCalls.kt 2019-11-14 17:19:27 +01:00
Mikhail Glukhikh
635add4823 FIR substitution: generate fake overrides for accessor symbols 2019-11-14 19:10:59 +03:00
Mikhail Glukhikh
bd70daa3d1 FIR Java: use definitely not-null types for type parameters
We support & use ConeDefinitelyNotNullType more properly here
2019-11-14 19:10:59 +03:00
Mikhail Glukhikh
63f38bb28a FIR [rendering only]: render fake overrides for properties 2019-11-14 19:10:58 +03:00
Dmitriy Novozhilov
4733c78a6a [FIR] Add toString() to ErrorTypeConstructor and ConeClassifierLookupTag 2019-11-14 18:33:47 +03:00
Dmitriy Novozhilov
944be132de [FIR-TEST] Add test with calling constructor of type with aliased import 2019-11-14 18:33:47 +03:00
Dmitriy Novozhilov
d9fe70f97c [FIR] Fix binding overrides with flexible types in arguments 2019-11-14 18:33:47 +03:00
Dmitriy Novozhilov
3a7251a90b [FIR-TEST] Add test with problems in mapping getter name to property name 2019-11-14 18:33:47 +03:00
Dmitriy Novozhilov
6f9e576502 [FIR-TEST] Add test with ambiguity on accidental override property 2019-11-14 18:33:47 +03:00
Dmitriy Novozhilov
f43d77d422 [FIR-TEST] Move nestedClassConstructor test to problems test suite 2019-11-14 18:33:47 +03:00
Dmitriy Novozhilov
2409a74fb5 [FIR-TEST] Add test for problem with += and java synthetic property 2019-11-14 18:33:46 +03:00
Dmitriy Novozhilov
11063a25a8 [FIR] Replace FirEmptyDiagnostic with FirStubDiagnostic
FirStubDiagnostic hold reason from original diagnostic
It's useful in HTML fir dump
2019-11-14 18:33:46 +03:00
Dmitriy Novozhilov
ee20f88837 [FIR] Propagate smartcasts in safe calls chain 2019-11-14 18:33:46 +03:00
Dmitriy Novozhilov
833648d8e0 [FIR] Fix smartcasts on receivers of implict invoke call 2019-11-14 18:33:46 +03:00
Dmitriy Novozhilov
660bcce90a [FIR] Add smartcasts for reassigned vars 2019-11-14 18:33:46 +03:00
Dmitriy Novozhilov
2a74e37e28 [FIR] Ignore expected type for resolve constant expressions 2019-11-14 18:33:46 +03:00
Dmitriy Novozhilov
6a3c07688f Add print of detailed stack trace to NonFir modularized test 2019-11-14 18:33:46 +03:00
pyos
a235dd2891 IR: move defaultParameterDeclarationsCache access up one level
to avoid recomputing overriddenSymbols for fake overrides of default
stubs on repeated calls to generateDefaultsFunction.
2019-11-14 17:41:47 +03:00
pyos
70f09a7531 IR: make DefaultArgumentStubGenerator a few lines shorter 2019-11-14 17:41:47 +03:00
pyos
2b2dd097a3 IR: refactor DefaultParameterInjector 2019-11-14 17:41:47 +03:00
pyos
7a2715da44 IR: refactor generateDefaultsFunction
The check for whether a function needs a default stub should run fewer
times now, and in particular is no longer quadratic. Also, this fixes
a weirdness in that certain inheritance hierarchies would produce
a default stub that points to a non-stub through its overriddenSymbols
field.
2019-11-14 17:41:47 +03:00
pyos
29a14e2330 JVM_IR: resolve inline fake overrides before codegen
See KT-33054 and KT-29242.
2019-11-14 15:29:24 +01:00
Dmitriy Dolovov
1b2091d536 Fix: KLIB reading error on Windows
Issue #KT-34909
2019-11-14 20:37:43 +07:00
Ilya Goncharov
77950c5410 [Gradle, JS] Remove redundant from kotlin-test-js-runner 2019-11-14 16:03:54 +03:00
Ilya Goncharov
6a6bef0f6c [Debugger, JS] Remove kotlin source map support from tests and build 2019-11-14 15:53:18 +03:00
Ilya Goncharov
35cb412dc3 [Gradle, JS] Fix source map support initializing for mocha 2019-11-14 15:53:18 +03:00
Ilya Goncharov
4e427d2ce4 [Gradle, JS] Fix source map support initializing for nodejs 2019-11-14 15:53:18 +03:00
Ilya Goncharov
20e33806ec [Debugger, JS] Provide possibility to debug mocha tests 2019-11-14 15:53:18 +03:00
Igor Yakovlev
30b4622a45 Remove invalid unused reference 2019-11-14 14:54:44 +03:00
Sergey Rostov
c905bbca36 Scripting: invalidate caches on roots changes 2019-11-14 14:01:30 +03:00
Denis Zharkov
b0327964b7 Fix compilation on 183 and as34 2019-11-14 11:26:11 +03:00
Anatoly Nikitin
c7e9a6c5d9 Add new script dependency resolvers
Changes in new API for dependency resolvers (GenericDependenciesResolver) comparing to an old one (GenericResolver:
- Add ability to fast check whether artifact or repository is suitable for current resolver to distinguish between unsuitable resolvers and resolution failures
- Return all artifact resolution failures in ResultWithDiagnostics
- Use single string for artifact coordinates
- Add compound resolver that combines several resolvers
- Merge Direct and FlatLib resolver into single FileSystemDependencyResolver
- Mark resolve() method as suspend to indicate long operation
- Add credentials support for maven resolver (https://youtrack.jetbrains.com/issue/KT-27701)
2019-11-14 08:38:50 +01:00
Anatoly Nikitin
81e2e119e2 Fix propagation of dependency resolution failure reports during script compilation 2019-11-14 08:38:50 +01:00
Mikhael Bogdanov
744dfc6bf9 Minor. Pass proper timeout to logger 2019-11-14 08:32:36 +01:00
Mikhael Bogdanov
4281fd6bd5 Don't write nop for extension lambda during inline 2019-11-14 08:17:33 +01:00
Sergey Rostov
b757224df1 Scripting: invalidate caches on roots changes 2019-11-14 09:50:03 +03:00
Sergey Rostov
df0c250fd8 Scripting: fix lost caches clearing call 2019-11-14 09:50:03 +03:00
Sergey Rostov
542f21b701 Scripting, minor: cache firstScriptSdk 2019-11-14 09:50:03 +03:00
Vladimir Ilmov
ab3f9586b3 Suspend function calls highlighting added.
'If' highlighting fixed at settings sample area.

 #KT-27496 Fixed
2019-11-14 08:07:56 +03:00
Vladimir Ilmov
46423443e9 'it' parameter highlighting fixed for chain usage.
#KT-31037 Fixed
2019-11-14 08:07:56 +03:00
Alexander Udalov
fb9fb2e048 JVM IR: minor, remove obsolete code 2019-11-13 19:30:26 +01:00
Alexander Udalov
180e718752 JVM IR: minor, repurpose JvmBackendContext.getLocalClassInfo to store Type 2019-11-13 19:26:40 +01:00
Alexander Udalov
6be9101675 JVM IR: add jvmLocalClassExtractionPhase to lift out local classes from initializers
Otherwise a local class in a field initializer or anonymous init block
is copied into each constructor of the containing class (because
InitializersLowering calls deepCopy).

Since the code structure no longer resembles the original source code
here, record a custom EnclosingMethod mapping before moving such
classes, and use it in codegen.
2019-11-13 19:26:39 +01:00
Georgy Bronnikov
c5159d9cbe IR: Add UniqId to IrSymbol 2019-11-13 20:07:57 +03:00
Georgy Bronnikov
1647279a8c IR: move UniqId to ir.tree module 2019-11-13 20:07:57 +03:00
Georgy Bronnikov
76016b1a3c IR: move KotlnMangler to ir.tree module 2019-11-13 20:07:57 +03:00
Georgy Bronnikov
92ebb092a2 JvmMangler 2019-11-13 20:07:57 +03:00
Georgy Bronnikov
2f5442800b Move WrappedDescriptors to ir.tree module 2019-11-13 20:07:57 +03:00
igoriakovlev
cb11282183 Merge pull request #2516 from t-kameyama/KT-18539
KT-18539 Default implement fun/property text shouldn't contain scary comment
2019-11-13 19:33:44 +03:00
Sergey Igushkin
3429c07016 Fix Native dependencies not transformed when imported from a source set
Those were only transformed when imported from compilations, not
intermediate source sets. Ue the substitutor for source set dependencies
as well.

(minor) extract function for the Gradle module-qualified IDs
2019-11-13 17:45:31 +03:00
Sergey Igushkin
94f66c237b (minor) replace the predicate for intermediate source set
Use a condition that is safe in projects with just one target and
intermediate source sets.
2019-11-13 17:45:31 +03:00
Dmitry Savvinov
bcabbcf3e1 Add Native stdlib to intermediate source set dependencies
Also fix the dependsOn source set IDs not matcing those
in the IDE.
2019-11-13 17:45:25 +03:00
Igor Yakovlev
1ccda6a8d4 Add fast find usages for data class components
This commit add feature for disabling searching for data class ComponentN method and destruction declarations that could encrease usages search.
See KT-23278
2019-11-13 17:38:35 +03:00
Natalia Selezneva
6d9c00addd Do not add preparation task to project import if registry option is switched off 2019-11-13 15:18:31 +03:00
Mikhail Zarechenskiy
455b9f852d [NI] Disable caching of LHS expression types for "+=" operators
New behavior was introduced in ab506c1579 which breaks compilation on IDE module (see test example) for new inference.

 Now we temporarily disable this optimisation. This is temporarily restriction which will be fixed once we'll have the same rules for lambdas completion

 #KT-34889 Open
2019-11-13 15:07:39 +03:00
Kristoffer Andersen
4973baae4e [JVM IR] Fix JvmOverloads+Parameterless Main
Resolves the interaction of @JvmOverloads annotations and
parameterless main methods.

In the following code, both mechanisms generate methods that
ultimately produce the signature `public static void main(String[] args)`
of which there can be only one (true in general of any signature).

```
fun main() { }

@JvmOverloads
fun main(Array<String> args, x: Int = 42) { }
```

This PR simply shuffles the lowerings around, letting parameterless
main methods detect the presence of the default overload produced by
the annotation.

Additionally, this PR improves the testing of parameterless main
methods by actual bytecode patterns, and not simple check for
successful compilation (as @sfs and I discovered, there are issues in
flagging an error on duplicate signatures on the IR backend).
2019-11-13 13:03:14 +01:00
Sergey Rostov
b4185c9d47 ScriptClassRootsCache: load configuration if it is not cached 2019-11-13 12:39:02 +03:00
Sergey Rostov
a84e948051 Scripting: pass KtFile to ScriptConfigurationLoader 2019-11-13 12:39:02 +03:00
Pavel Kirpichenkov
9a231bbbfa Update trailing lambda quickfix, add tests
Case of incorrect call expression as the receiver of dot-qualified expression
was not handled properly.

Now the following order is used:
- If parent is a call expression or if this call is a receiver of parent
dot-qualified expression, parent must get last lambda as a new receiver;
- Otherwise, if parent is a dot-qualified expression, this call is in selector position.
Then grandparent is checked for being call or dot-qualified expression. If so, trailing
lambda must become grandparent's new receiver. If not, trailing nodes become standalone
epressions after parent.
- Otherwise, incorrect call expression is a standalone expression, so trailing nodes
may be lifted and put after it.
2019-11-13 11:00:01 +03:00
Pavel Kirpichenkov
f1934fa49d Amend "Terminate preceding call with semicolon" quickfix
Quickfix wasn't aware of cases, when expression to be fixed
 is a part of parent call expression or dot-qualified expression.
 Incorrect position for extracting trailing lambdas led to broken
 formatting.

 #KT-34694 Fixed
2019-11-13 11:00:01 +03:00
Denis Zharkov
0f638db3e5 FIR: Turn SupertypeSupplier into a class 2019-11-13 10:52:24 +03:00
Denis Zharkov
56b5d170eb FIR: Minor. Rename FirSupertypeResolverTransformerAdapter -> FirSupertypeResolverTransformer 2019-11-13 10:52:24 +03:00
Denis Zharkov
3a4f9e9109 FIR: Drop FirClassLikeDeclaration::supertypesComputationStatus
It became unused with rewritten supertype resolution
2019-11-13 10:52:24 +03:00
Denis Zharkov
2fba6b54a0 FIR: Minor. Drop old FirSupertypeResolverTransformer 2019-11-13 10:52:24 +03:00
Denis Zharkov
3f7bffa6fd FIR: Do not use FirClass::supertypesComputationStatus 2019-11-13 10:52:24 +03:00
Denis Zharkov
5e0e78e555 FIR: Rewrite supertype resolution 2019-11-13 10:52:24 +03:00
Toshiaki Kameyama
4d9b19da82 Remove comments from function/property implementation template
#KT-18539 Fixed
2019-11-13 08:37:25 +09:00
Alexander Udalov
9a55f418fa IR: extract StaticInitializersLowering out of InitializersLowering
And use it in JVM backend only. Also remove unneeded
`patchDeclarationParents` call.
2019-11-12 19:21:46 +01:00
Alexander Udalov
098561dd5f IR: cleanup InitializersLowering.kt 2019-11-12 19:19:03 +01:00
Alexander Udalov
9772de0088 JVM IR: generate kotlin.Metadata.packageName value for JvmPackageName files
Support this for single file facades as well as for multi-file classes,
similar to code in
MultifileClassCodegen.writeKotlinMultifileFacadeAnnotationIfNeeded.
Extend the test on this attribute to also cover multi-file classes.
2019-11-12 19:13:03 +01:00
Ilya Chernikov
808000e458 Implement warning when non-abstract classes containing abstract members invisible from that classes
#KT-27825 fixed
2019-11-12 19:08:53 +01:00
Dmitriy Novozhilov
eae3688c61 [FIR] Fix collecting approved data flow info from rhs of boolean operator 2019-11-12 21:03:54 +03:00
Dmitriy Novozhilov
8d6cfdf0b1 [FIR] Fix passing data flow info from while loop condition 2019-11-12 21:03:54 +03:00
Dmitriy Novozhilov
7ef13caa33 [FIR] Add test for ambiguity in nested class constructor call 2019-11-12 21:03:54 +03:00
Dmitriy Novozhilov
e9551e2022 [FIR] Don't generate setter by delegate for vals 2019-11-12 21:03:54 +03:00
Dmitriy Novozhilov
2f2aa4ae83 [FIR] Create error type instead of implicit type for incorrect functional types 2019-11-12 21:03:54 +03:00
Dmitriy Novozhilov
cf61a6c30f [FIR] Add support of multiple condition branches to exhaustiveness checker 2019-11-12 21:03:53 +03:00
Roman Artemev
86570a2f91 [KLIB] Promote ABI version 2019-11-12 21:00:32 +03:00
Roman Artemev
63110ab636 [IR] Remove deprecated correspondingProperty from IrField 2019-11-12 20:45:11 +03:00
Roman Artemev
646df8d40a [IR BE] Get rid of descriptor usage in KCallable name property lowering 2019-11-12 20:45:11 +03:00
Roman Artemev
ec1c2eb42d [IR] Remove deprecated correspondingProperty from IrSimpleFunction 2019-11-12 20:45:11 +03:00
Roman Artemev
a343a57207 [IR] Refactor ir infrastructure
- Remove range-based uniq id indexes using to link built ins
 - Limit KotlinType usages, replace them with corresponding IrType
2019-11-12 20:45:11 +03:00
Roman Artemev
90d07eee53 [IR] Move wrapped descriptors from backend.common to ir.descriptors 2019-11-12 20:45:11 +03:00
Roman Artemev
ed79ab68ab [IR] Remove DeclarationDescriptor from IrExpression* tree API 2019-11-12 20:45:11 +03:00
Roman Artemev
d4fc7fcd96 [IR] Get rid of substituted descriptor from IrMemberAccessExpression interface 2019-11-12 20:45:11 +03:00
Roman Artemev
b391c066d6 [IR] Pass class Type Parameters into IrConstructorCall factory explicitly
to avoid unexpected crash on uninitialized parent in psi2ir phase
2019-11-12 20:45:11 +03:00
Roman Artemev
ba373c67d7 [IR] Remove FunctionDescriptor from IrCall-like node's constructor interface 2019-11-12 20:45:11 +03:00
Roman Artemev
bf367003f9 [IR] Make IrMemberAccessExpression be IrDeclarationReference 2019-11-12 20:45:10 +03:00
Roman Artemev
eee594101a [IR] Remove superQualifier property from IrCall 2019-11-12 20:45:10 +03:00
Ilmir Usmanov
ea5b529d19 Check default parameters of expect suspend functions on original
functions instead of function views.
 #KT-24461 Fixed
2019-11-12 20:12:37 +03:00
igoriakovlev
633d1c9ea3 Merge pull request #2773 from t-kameyama/KT-28607
KT-28607 Extract/Introduce variable fails if caret is just after expression
2019-11-12 19:13:56 +03:00
Svyatoslav Kuzmich
42c4591df8 [JS IR] Add -Xgenerate-dts CLI argument 2019-11-12 18:19:06 +03:00
Toshiaki Kameyama
e81fbe0a05 Folding: fold function with expression body (KT-6316)
#KT-6316 Fixed
2019-11-12 16:07:52 +03:00
Toshiaki Kameyama
58fb1dede3 Multiline string enter handler: do not insert 'trimIndent()' in const (KT-34785)
#KT-34785 Fixed
2019-11-12 16:07:52 +03:00
pyos
ce0fb662c0 JVM_IR: fold inline lambdas when computing OUTERCLASS
so that the enclosing method of objects defined inside lambdas is the
one they are declared in.

Note that this does not fix *all* enclosingInfo tests because JVM_IR
currently follows the KT-28064 proposal, i.e. does not regenerate
objects defined inside lambdas under any circumstances. For example,
this causes test boxInline/enclosingInfo/inlineChain2.kt to fail because
the enclosing method of objects is _2Kt.box instead of (non-existent in
source code) `_2Kt$box$inlined$call$1.invoke` or whatever. What's more
important is that OUTERCLASS no longer points to a non-existent
`box$lambda-N` and therefore `.enclosingMethod` no longer throws.
2019-11-12 12:44:46 +01:00
pyos
f906524d76 Mark a SAM conversion test as JVM-only 2019-11-12 12:24:55 +01:00
Mikhail Glukhikh
c66b6b6a3a FIR visibility check: support companion private members correctly 2019-11-12 11:24:31 +03:00
Mikhail Glukhikh
e96aeb77a6 FIR visibility check: support private class members 2019-11-12 11:24:25 +03:00
Mikhail Glukhikh
a5ad05083a Add some stubs for FIR visibility checking 2019-11-12 11:24:24 +03:00
Mikhail Glukhikh
7e07b88eab Code cleanup: FirCallResolver 2019-11-12 11:03:59 +03:00
Mikhail Glukhikh
ac13a8c8b2 Cone conflict resolver: extract JVM equivalent call filtering to a separate class 2019-11-12 11:03:58 +03:00
Mikhail Glukhikh
96c5003a13 Cone conflict resolver: filter equivalent top-level callables 2019-11-12 11:03:58 +03:00
Mark Punzalan
dc10d25661 Ensure ForLoopsLowering only handles the CharSequence.iterator()
extension function from the standard library (kotlin.text.iterator()).
2019-11-12 08:09:30 +01:00
Toshiaki Kameyama
d04f88ff66 Extract/Introduce variable: fix to work correctly if caret is before right parenthesis or comment
#KT-28607 Fixed
2019-11-12 12:03:16 +09:00
Simon Ogorodnik
1bd861c5eb Save use_ni key state to log 2019-11-11 20:32:07 +03:00
Alexander Udalov
57a674e9e6 Make fast class files reading mode default in compiler tests
This makes sense because this mode is the default in the production
compiler. Forgetting to enable it where necessary led to different
bizarre test failures, see for example changes around 3fee84b966 and
KT-34826
2019-11-11 15:40:49 +01:00
Mikhail Glukhikh
dde2d08cfc FIR resolve: add extra test for generic with bounds in Java 2019-11-11 17:07:58 +03:00
Mikhail Glukhikh
f66b2ca772 FIR resolve: add forgotten constraint subsystem from generic qualified access
This fixes exception in resolve of an attached test
2019-11-11 17:07:57 +03:00
Mikhail Glukhikh
26281bfe89 FIR Java: use different names for anonymous parameters (p0, p1, p2, ...) 2019-11-11 17:07:57 +03:00
Mikhail Glukhikh
c657d46437 FIR Java: add nullable (instead of not-null) type parameter bounds 2019-11-11 17:07:57 +03:00
Mikhail Glukhikh
db11c14fee FIR Java: don't add type parameter bounds multiple times 2019-11-11 17:07:57 +03:00
Roman Golyshev
a18da68171 Remove redundant toList call in LazyJavaPackageScope 2019-11-11 16:01:23 +03:00
pyos
82fb5c4d19 JVM_IR: move lambda captures to end of signature when inlining
For example, a lambda `{ param -> captured }` of type `E.(T) -> U` will
be transformed by LocalDeclarationsLowering into a private static method

    fun f$lambda-0($this: E, $captured: U, param: T) = $captured

The reason for such an ordering is that a lambda looks the same as a
local function, and local function can have default arguments, and those
arguments can reference captured variables; thus, captured variables
must come before actual declared arguments.

However, this is not the order that the inliner wants. Moreover, since
it was written to handle lambdas represented as `invoke` methods of
anonymous objects, it does not expect the actual callable method to have
any parameters corresponding to captured variables at all. This results
in it attempting to generate a temporary node with descriptor

    (LE;LU;LT;LU;)LU;

while still using locals 1 and 2 as `param` and `$captured` respectively.
In the example above, this is not critical, as they both have reference
type and the lambda will eventually be pasted into a different node
anyway; however, if it happens that one of them is a primitive, or both
are primitives of different types, the bytecode will use incorrect
instructions, causing verification errors. The correct descriptor is

    (LE;LT;LU;)LU;
2019-11-11 13:46:42 +01:00
pyos
433e0e4740 JVM_IR: remember facade fqnames of imported classes
Necessary to support importing file classes annotated @JvmPackageName,
since the actual package fragment they are a part of has the name from
the `package` declaration.
2019-11-11 13:31:57 +01:00
Natalia Selezneva
42cb53a380 Always apply new script configuration in tests 2019-11-11 15:15:17 +03:00
Natalia Selezneva
423f1909fa Disable script configuration update in AbstractInspectionTest 2019-11-11 15:15:17 +03:00
Sergey Rostov
698d675efe Scripting: fix saving to file attributes 2019-11-11 15:15:17 +03:00
Sergey Rostov
05e8acffa7 Scripting: restore reports for applied configuration in case of previous error 2019-11-11 15:15:17 +03:00
Sergey Rostov
96b4ceb067 scripting: skip loading when reverting to applied configuration 2019-11-11 15:15:17 +03:00
Sergey Rostov
2499c42ac4 scripting: PsiModificationStamp add virtual file modification stamp 2019-11-11 15:15:17 +03:00
Sergey Rostov
789ad23e8d Minor: isScriptDependenciesUpdaterDisabled -> isScriptChangesNotifierDisabled 2019-11-11 15:15:17 +03:00
Sergey Rostov
61b17de625 Minor: change ScriptConfigurationCache.kt declarations order for better readability, more docs 2019-11-11 15:15:16 +03:00
Sergey Rostov
fbb2b260dd Split script configuration state into applied and loaded to make markUpToDate more clear 2019-11-11 15:15:16 +03:00
Natalia Selezneva
fde1d3fdf7 Wrap exceptions from external script configuration loader with error handling 2019-11-11 15:15:16 +03:00
Natalia Selezneva
56eb86b7c6 Remove KotlinGradleBuildScriptsResolver for IDEA < 191
In 191 there is no method to invoke model building after invocation of some task
2019-11-11 15:15:16 +03:00
Natalia Selezneva
2a22cc23e9 KotlinGradleBuildScriptsResolver: update to new API from IDEA Gradle plugin 2019-11-11 15:15:16 +03:00
Natalia Selezneva
8bb6cf81c5 Extract logic common for different platforms to simplify bunch process 2019-11-11 15:15:16 +03:00
Sergey Rostov
e2928550ca Fix retrieving virtual file 2019-11-11 15:15:16 +03:00
Sergey Rostov
9105e38041 Mark not applied configuration as up-to-date, simplify concurrency handling 2019-11-11 15:15:16 +03:00
Sergey Rostov
0422abdb7b LoadedScriptConfiguration and CachedConfigurationSnapshot are merged to ScriptConfigurationSnapshot 2019-11-11 15:15:15 +03:00
Sergey Rostov
a89ce4c590 BackgroundExecutor: cancel all tasks on user cancel, remove useless updateProgress call 2019-11-11 15:15:15 +03:00
Sergey Rostov
19d35d7f27 Implement Gradle specific behavior for script configuration update logic
We have plans to extract separate implementation for Gradle scripts, but it
would be better to support something at this point.
For now, we have custom listener, loader and up-to-date check for default configuration manager:
- listener will do forced reload on editor activation, even it is already up-to-date
this is required for Gradle scripts, since it's classpath may depend on other files (`.properties` for example)
- loader will force save failures before running loader. also it will skip loading if
`kotlin.gradle.scripts.useIdeaProjectImport` registry key is enabled
- loader will return inputs with overridden up-to-date checks: file will be considered
out-of-date only when `buildscript` or `plugins` blocks are changed
2019-11-11 15:15:15 +03:00
Natalia Selezneva
548e8e27dc Minor: rename parameter 2019-11-11 15:15:15 +03:00
Natalia Selezneva
f0053ee34c Minor: use properties instead of string constants 2019-11-11 15:15:15 +03:00
Sergey Rostov
9d2cc484aa ide, scripting: rework script configuration caching, introduce persistent fs cache
## Simplify ScriptConfigurationManager mental model
Everything related to cache managing moved to `org.jetbrains.kotlin.idea.core.script.configuration`.
DefaultScriptConfigurationManager slitted into:
- `AbstractScriptConfigurationManager`
- `DefaultScriptConfigurationManager`
- `ScriptClassRootsCache`
The main idea is to simplify the mental model of ScriptConfigurationManager.
Concrete implementation should provide just two things:
- `createCache(): ScriptConfigurationCache` that should return cache implementation with `get` and `set` methods
- `reloadOutOfDateConfiguration(...)` will be called on [cache] miss or when [file] is changed.

Implementation should initiate loading of [file]'s script configuration and call [saveChangedConfiguration]
immediately or in some future (e.g. after user will click "apply context" or/and configuration will be
calculated by some background thread).
Everything around it is implemented in `AbstractScriptConfigurationManager`.

`ScriptClassRootsCache` is extracted from `DefaultScriptConfigurationManager`:
this simplifies `AbstractScriptConfigurationManager`
Also it simplifies ScriptClassRootsCache reset: we can just drop old `ScriptClassRootsCache`
and create new one instead of resetting all internals of `ScriptClassRootsCache`.
Please see KDoc of these classes for more details:
- AbstractScriptConfigurationManager
- DefaultScriptConfigurationManager
- ScriptClassRootsCache

## Cache and up-to-date checks
Writer should put related inputs snapshot for loaded configuration.
This allows reader make up-to-date check for existed entry to avoid starting loading
process for same inputs.
Cache entry may be marked out-of-date.
Also it can be marked up-to-date, but it means that we have up-to-date loaded configuration,
ScriptConfigurationSnapshot.configuration will still contain old applied configuration.
todo: make it more clear by splitting cache entry into loaded and applied configuration with
it's own inputs.

## Loaders
Previously both sync and background loaders may be started for same files - this was useful, but not
required anymore and at the same time greatly complicates the model. So, it was dropped
and now exactly one loader should work for given file (first applicable loader will be called).
Also `ScriptConfigurationLoadingContext` is introduced to limit access to the `ScriptConfigurationManager`
internals.

## Listeners and updating configuration
This things is introduces:
- `ScriptChangesNotifier`
- `ScriptChangeListener`
- `ScriptConfigurationUpdater`
`ScriptChangesNotifier` will call first applicable `ScriptChangeListener` when editor is activated or document changed.
(it treated as applicable if [editorActivated] or [documentChanged] will return true).
Listener may call [ScriptConfigurationUpdater] to invalidate configuration and schedule reloading.
Plugins may override default listening logic by adding it's oven `ScriptChangeListener`.
`ScriptConfigurationUpdater` was extracted from `ScriptConfigurationManagerImpl`.

## Fixed issues and implement persistent FS cache
- Script configuration was not reloaded if query for same file already in progress or ready but not yet applied
- Don't start async loaders for outsider files
- Unused imports: don't start loading script configuration if the result will be not applied automatically
- Fix cases when virtual file can be null

See `DefaultScriptConfigurationManager.reloadOutOfDateConfiguration` KDoc for more details on
dealing with concurrent operations.

## Background executor and progress indicator
This things changed and fixed:
- progress displayed not only when we have more then 3 loading tasks, but also
after 1sec of loading (including case with 1 loading task for example)
- current file is displayed under the progress bar
- progress indication added: it works similar to indexing indicator. When
progress bar is displayed, max is fixed. When all work done for this max,
progress will be started from zero and new max is fixed, and so on
- cancel will drop all loading operation, not just current
- concurrency issues fixed: EA-5244265 and other related to switching between silent and
under progress worker
See `BackgroundExecutor` for more details.

## Gradle specific behavior
We have plans to extract separate implementation for Gradle scripts, but it
would be better to support something at this point.
For now, we have custom listener, loader and up-to-date check for default configuration manager:
- listener will do forced reload on editor activation, even it is already up-to-date
this is required for Gradle scripts, since it's classpath may depend on other files (`.properties` for example)
- loader will force save fails before running loader. also it will skip loading if
`kotlin.gradle.scripts.useIdeaProjectImport` registry key is enabled
- loader will return inputs with overridden up-to-date checks: file will be considered
out-of-date only when `buildscript` or `plugins` blocks are changed
2019-11-11 15:15:15 +03:00
Natalia Selezneva
915c9c367c Minor: rename script related classes 2019-11-11 15:15:15 +03:00
Natalia Selezneva
33475f30bc Minor: move files 2019-11-11 15:15:15 +03:00
Sergey Rostov
9f3c2d0292 build.gradle.kts: import script dependencies on Gradle Project sync 2019-11-11 15:15:14 +03:00
Alexander Udalov
de54e549af Refactor CHECK_BYTECODE_LISTING directive for JVM IR tests
Create a separate _ir.txt bytecode listing file for JVM IR, to avoid
duplicate tests and to fix "Codegent tests on different JDKs"
configuration where this test is muted but passes because only execution
is checked there, not bytecode listing.
2019-11-11 12:10:31 +01:00
Alexander Udalov
ce09be3f59 Add TargetBackend.isIR, simplify JVM IR test configuration 2019-11-11 12:10:29 +01:00
Vladimir Ilmov
ab65a6bc6c Build fix, tests regenerated 2019-11-11 12:34:58 +03:00
Sergey Bogolepov
608885d118 [Linker] Extend KotlinIrLinker infrastructure to support libraries that
doesn't contain IR. Also bump ABI version because of addition of `ir_provider` property
2019-11-11 15:55:36 +07:00
Kirill Shmakov
5629627cca Mobile MPP: Initialize Mobile MPP plugin 2019-11-11 11:20:37 +03:00
Yan Zhulanow
f3770314c5 Pill: Fix reflect dependency in compiler/fir.resolve module 2019-11-11 17:13:58 +09:00
Yan Zhulanow
ef8b3cb72a Prefer Kotlin Junit test run configurations when possible (KT-33787) 2019-11-11 17:13:58 +09:00
Yan Zhulanow
987307cf92 Prefer Kotlin Gradle test run configurations when possible (KT-33787) 2019-11-11 17:13:58 +09:00
Vladimir Ilmov
214810ca01 Suspend test removed. Will be added later as part of appropriate ticket. 2019-11-11 00:57:52 +03:00
Dmitriy Novozhilov
0c190f6040 Enable -Xuse-mixed-named-arguments feature for compiler project 2019-11-10 11:46:22 +03:00
Dmitriy Novozhilov
be4ae5d7ba Upgrade kotlin version in gradle configuration testdata 2019-11-10 11:46:22 +03:00
Dmitriy Novozhilov
d485ea44e8 Update bootstrap version 2019-11-10 11:45:59 +03:00
Vadim Brilyantov
ba77e5eba8 #KT-29622: Fix bunches for 191 and earlier idea versions 2019-11-09 16:44:12 +03:00
Vadim Brilyantov
66eeeb4705 Add Focus Mode support to kotlin language 2019-11-09 16:44:10 +03:00
Alexander Udalov
f7ef16d2d5 Regenerate tests
This fixes project compilation after incorrect merge of
da4097f4/e89a87b2 and 4ed64b02
2019-11-09 00:42:10 +01:00
Alexander Udalov
f9b66d57cf Fix test data for -Xuse-mixed-named-arguments
Remove incorrect jar clash warning and avoid unrelated unused parameter
warnings
2019-11-08 20:52:22 +01:00
Alexander Udalov
228fdb4436 Don't optimize null checks for unsafe primitive type boxes as well
#KT-34829 Fixed
2019-11-08 18:54:33 +01:00
Steven Schäfer
b80e157381 JVM, JVM IR: Don't optimize null-checks based on nullability information
Since Java interop allows us to circumvent the Kotlin type system we
cannot rely on nullability information.
2019-11-08 18:28:07 +01:00
Alexander Udalov
de082543f1 Minor, ignore another test with java.util.function on JDK 6 2019-11-08 17:50:10 +01:00
Alexander Udalov
9b3e64257f Minor, ignore test with java.util.function on JDK 6 2019-11-08 17:46:43 +01:00
Roman Golyshev
e89a87b2e3 KT-29926: Support completion of suspend lambda body and parameters
- ^KT-29926 Fixed
2019-11-08 19:24:05 +03:00
Roman Golyshev
da4097f488 KT-29926: Support completion of suspend lambda parameters in the body
- `suspendLambdaSignature` directory is just a copy of `lambdaSignature`
2019-11-08 19:24:05 +03:00
Roman Golyshev
84b9044187 KT-29926: Get rid of filterFunctionExpected
- `filterFunctionExpected` does not provide meaningful concept, and will be a problem in the next steps on this issue.
- Refactor `SmartCompletionSession::descriptorKindFilter` to more precisely tell why we include references to constructors if we are completion functions
2019-11-08 19:24:05 +03:00
Vladimir Ilmov
e2b91cfec7 Properties with custom property declarations highlighting rule.
Added support for package and class-level properties with custom PD.
Java syntethic extensions are ignored from this rule.

 #KT-30806 Fixed
2019-11-08 17:58:49 +03:00
Dmitriy Dolovov
bf37572b93 Offload heavy part of KotlinNativeABICompatibilityChecker to non-EDT thread pool
Issue #KT-34814
2019-11-08 17:12:57 +03:00
Dmitriy Dolovov
d97aeb9fe0 Build KotlinNativeABICompatibilityChecker notifications in a separate function
Issue #KT-34814
2019-11-08 17:12:52 +03:00
Nikolay Krasko
526e7e463b Mute flaky failure in KotlinGotoImplementationMultiModuleTestGenerated in 193 2019-11-08 16:34:20 +03:00
Nikolay Krasko
ce1e57d798 Mute IdeReplCompletionTestGenerated tests in 193 (KT-34825) 2019-11-08 16:34:19 +03:00
Mikhail Glukhikh
93aba85f51 Fix FIR built-ins test 2019-11-08 15:54:21 +03:00
Dmitriy Novozhilov
5313c964c6 [FIR] Fix SOF in fir consistency checker 2019-11-08 15:30:55 +03:00
Dmitriy Novozhilov
bc453e5917 [FIR] Fix testdata forgotten in e910653d 2019-11-08 15:30:55 +03:00
Dmitriy Novozhilov
e6b005a7dc Disable -Xuse-mixed-named-arguments feature for compiler project 2019-11-08 15:30:50 +03:00
Dmitriy Novozhilov
45523a5767 Fix -Xuse-mixed-named-arguments compiler arg 2019-11-08 15:30:04 +03:00
Kristoffer Andersen
8561f08f06 [JVM_IR] Reintroduce non-IEEE comparisons
- Ieee754Equality and PrimitiveComparisons intrinsics
  respects absence of -Xproper-ieee754-comparisons, unmuted tests to
  show.
2019-11-08 12:58:31 +01:00
Alexander Udalov
0675b54e11 Minor, add regression test for KT-34766 2019-11-08 12:29:08 +01:00
Roman Artemev
ea543eac13 [IC KLIB] Fix after rebase 2019-11-08 14:14:59 +03:00
Roman Artemev
3e3cb8734b [IC] Unmute IC klib tests 2019-11-08 14:14:59 +03:00
Roman Artemev
b11d69b719 [IC] Temporary restore removed method to fix proto comparison tests 2019-11-08 14:14:59 +03:00
Roman Artemev
a91ed694bf [IC KLIB] Use new klib argument 2019-11-08 14:14:59 +03:00
Alexey Tsvetkov
eb5e954e2a Minor: adjust formatting 2019-11-08 14:14:58 +03:00
Alexey Tsvetkov
d776e92111 Use Klib JS serializer protocol for IC 2019-11-08 14:14:58 +03:00
Alexey Tsvetkov
6e9cd85b54 Exclude some proto messages from proto comparison in IC 2019-11-08 14:14:58 +03:00
Alexey Tsvetkov
ac9b7fa268 Exclude some proto fields from proto comparison in IC 2019-11-08 14:14:58 +03:00
Alexey Tsvetkov
28e6219b0b Fix proto comparison for fields mapped to type table 2019-11-08 14:14:58 +03:00
Alexey Tsvetkov
c694752b4f Generate Klib JS extensions for proto comparison 2019-11-08 14:14:58 +03:00
Alexey Tsvetkov
83f060ad3e Minor: add functions to distinguish initial and incremental builds when debugging IC tests 2019-11-08 14:14:57 +03:00
Alexey Tsvetkov
537199e0fa Minor: replace UsefulTestCase with KtUsefulTestCase
UsefulTestCase does not resolve in IDE for some reason
2019-11-08 14:14:57 +03:00
Roman Artemev
72c4be785d [JS IR] Add proper extension point in FE to customize incremental data loading
- fix IC klib
2019-11-08 14:14:57 +03:00
Alexander Gorshenev
21c436c64c Klib metadata cached package fragment and package fragment provider 2019-11-08 14:14:57 +03:00
Roman Artemev
1bced5d2a2 [KLIB IC] Fix file index allocation, make them stable between recompilations 2019-11-08 14:14:57 +03:00
Steven Schäfer
ab506c1579 Frontend: Avoid retypechecking the right hand side of assignment operators 2019-11-08 14:02:56 +03:00
Mikhail Glukhikh
41c81d25a0 FIR body resolve: use nested classifier scopes only via member scopes 2019-11-08 13:42:42 +03:00
Mikhail Glukhikh
f0130d0460 FIR (minor): remove unnecessary withScopeCleanup call 2019-11-08 13:39:45 +03:00
Mikhael Bogdanov
cf15359079 Decrease number of forked test processes on local machine
There are no any benefits in execution time
2019-11-08 11:32:30 +01:00
Steven Schäfer
7c9578116b JVM IR: Fix types in LateInitLowering
On the JVM backend the throwUninitializedPropertyAccessException
function is implemented in Java and has a return type of Unit instead of
Nothing. In order to make the types match up we have to wrap its call in
a block with an additional IrThrow.
2019-11-08 11:20:43 +01:00
Dmitriy Novozhilov
3ee013aac6 Change compiler flag for enabling mixed named argumetns in compiler project
It's neccessary to avoid useless warnings until build
2019-11-08 12:12:39 +03:00
Dmitriy Novozhilov
5b1cc7d8d5 Update bootstrap version 2019-11-08 12:12:39 +03:00
Dmitriy Novozhilov
e910653d6f [FIR] Add pretty rendering of functional types 2019-11-08 12:12:39 +03:00
Dmitriy Novozhilov
18dc652404 [FIR] Get rid of operation in FirVariableAssignment
`FirVariableAssignment` is creates only for expressions `x = y`
For other assign operators there is a `FirOperatorCall`
2019-11-08 12:12:39 +03:00
Dmitriy Novozhilov
b5210e6a9b [FIR] Fix building fir for += with complex rhs
Also fix choosing candidate for assignment operator call
2019-11-08 12:12:38 +03:00
Dmitriy Novozhilov
cadc2dfe4d [FIR] Fix generating fir for invoke calls 2019-11-08 12:12:38 +03:00
Pavel Kirpichenkov
ff32eab3d1 [NI] Run call checkers on resolved calls for callable references
#KT-34391 Fixed
2019-11-08 11:04:43 +03:00
Mark Punzalan
f444702cf3 JVM: Always invoke get()/charAt() in optimized for-loop over
CharSequence.withIndex(), even if element variable is unused in
destructuring declaration.

#KT-34779 Fixed
2019-11-08 10:55:09 +03:00
Mikhail Glukhikh
411dc5d60e FIR nested classifier scope building: optimize companion search 2019-11-08 09:58:37 +03:00
Mikhail Glukhikh
48938a20a7 Raw FIR: add synthesized Enum.valueOf() function 2019-11-08 09:58:02 +03:00
Alexander Udalov
1978db9d0e Move codegen tests on old language versions under oldLanguageVersions/
This directory is skipped in JVM IR test generator, so they won't show
up as failed anymore.

Note that only failing tests are moved to oldLanguageVersions/. Tests
which already pass are still being run. It may be useful not to break
them in case we _do_ need to support some pre-1.3 language feature
switches in JVM IR.
2019-11-07 19:05:24 +01:00
Alexander Udalov
c3729c8189 Reorganize codegen tests for old language versions
Put all files under a single "oldLanguageVersions" directory under test
data of each test
2019-11-07 18:49:27 +01:00
Steven Schäfer
dcd72b06d8 JVM IR: Implement CHECK_NOT_NULL as a lowering 2019-11-07 18:47:53 +01:00
Nikolay Krasko
ea6c43dabd Mute inline testMultipleInExpression because of unstable order of usages in 193 2019-11-07 20:23:29 +03:00
Nikolay Krasko
fe9c5cac45 Fix TypedHandlerTest in 193
Unify TypedHandlerTest.kt with the KotlinLightCodeInsightTestCase
2019-11-07 20:23:29 +03:00
Nikolay Krasko
f6bdaf992e Fix jps build in buildSrc by explicitly using mutable set 2019-11-07 20:23:29 +03:00
Nikolay Krasko
c053bd213a Don't assert order of todo items to fix platform update to 193 2019-11-07 20:23:29 +03:00
Nikolay Krasko
b2a61eb5e6 Additional mute for IdeReplCompletionTestGenerated.testFunctions in 193 2019-11-07 20:23:29 +03:00
Nikolay Krasko
2aa251fd0c Remove deprecated API from InlayScratchFileRenderer 2019-11-07 20:23:28 +03:00
Vladimir Ilmov
9fb95e776e [HIGHLIGHT] Specific keyword rules for val,var highlighting.
'Kotlin keyword' rule configured as fallback rule for all Kotlin keywords:
- Created 'var'/'val' rules with fallback to 'Kotlin keyword'
- BUILTIN_ANNOTATION rule fallback changed from Java to 'Kotlin keyword'

 #KT-13344 Fixed
2019-11-07 18:48:59 +03:00
Dmitriy Dolovov
34ea47a868 Extract Konan Gradle model into a separate JAR file 2019-11-07 18:25:35 +03:00
pyos
fb9f43c119 JVM_IR: fix load check in inliner (should accept primitives too) 2019-11-07 15:58:44 +01:00
Alexander Udalov
4164b620e8 Minor, remove obsolete directives and suppressions from contracts test data 2019-11-07 15:20:34 +01:00
Alexander Udalov
66e19b13ce IR: create shared variables for val-variables when needed
This is possible when a lambda's contract guarantees initialization of a
variable.
2019-11-07 15:20:34 +01:00
Igor Chevdar
5c4b47c336 [native-gradle-plugin] Disabled native daemon for tests for now 2019-11-07 17:01:18 +03:00
Igor Chevdar
83331a0afb [native-gradle-plugin] Test fix 2019-11-07 17:00:59 +03:00
Igor Chevdar
ecb001d5db Bumped K/N version 2019-11-07 17:00:03 +03:00
Igor Chevdar
d36effd725 [native-gradle-plugin] Run konan directly from the gradle process 2019-11-07 17:00:03 +03:00
Nikolay Krasko
d755002ac4 Advance bootstrap to 1.3.70-dev-1231 2019-11-07 16:24:13 +03:00
Nikolay Krasko
0ea64c8d4b Avoid using js dist library during jps build as it absent in bootstrap 2019-11-07 16:24:13 +03:00
Nikolay Krasko
155a760ee9 Revert "Revert [JS IR] commits that failed build"
This reverts commit 740f851a
2019-11-07 16:24:13 +03:00
Steven Schäfer
181d023e3c JVM IR: Remove JvmBackendContext.getTopLevelClass 2019-11-07 13:48:43 +01:00
Steven Schäfer
1ac753602e JVM IR: Avoid getTopLevelClass in CollectionStubMethodLowering 2019-11-07 13:48:43 +01:00
Steven Schäfer
f9ff3771e5 JVM IR: Avoid getTopLevelClass in AddContinuationLowering 2019-11-07 13:48:43 +01:00
Steven Schäfer
481d4d72b9 JVM IR: Avoid getTopLevelClass in JvmSymbols 2019-11-07 13:48:43 +01:00
Mark Punzalan
d0c261c779 Ensure the correct functions (with correct params) are being used in
ForLoopsLowering.
2019-11-07 13:43:24 +01:00
Mark Punzalan
21178a4f1a Fix issue getting the size property from Collection bounded type
parameters, when lowering for-loops over Collection.indices.
2019-11-07 13:43:24 +01:00
Mikhail Glukhikh
30679ebfaf FIR Java: implement correct type matching in SuperTypeScope 2019-11-07 15:07:41 +03:00
Ilya Kirillov
7fffd3d0f2 Fix using method removed from 193 in old J2K 2019-11-07 14:59:08 +03:00
Toshiaki Kameyama
39db76b2ab "Indent raw string" intention: do not suggest in const
#KT-34784 Fixed
2019-11-07 14:57:56 +03:00
Georgy Bronnikov
688a2185fa Tests for Kapt3 with JVM_IR backend 2019-11-07 13:28:09 +03:00
Mikhail Glukhikh
4d9839a790 JavaClassUseSiteMemberScope: add mutable vs non-mutable type matching 2019-11-07 13:08:38 +03:00
Dmitriy Novozhilov
61c337588b Revert testdata accidentally committed in 665405c4 2019-11-07 10:41:15 +03:00
Dmitriy Novozhilov
4f8a8f84ba [FIR] Update some testdata in fir visualizer test 2019-11-07 10:39:22 +03:00
Dmitriy Novozhilov
abf41f87a1 [FIR] Fix rendering of local variables in Visualizer 2019-11-07 10:39:21 +03:00
Dmitriy Novozhilov
f0ba9c3c40 [FIR] Make file separator in AbstractVisualizer OS independent 2019-11-07 10:39:21 +03:00
Mikhail Glukhikh
581504aac5 Raw FIR: add synthesized Enum.values() function #KT-24076 Fixed 2019-11-07 09:29:00 +03:00
Mikhail Glukhikh
6e0148c7a8 FIR: cleanup of DataClassUtils: remove redundant status field assignments 2019-11-07 09:28:16 +03:00
Leonid Startsev
3b100e57f2 Change NO_EXPLICIT_VISIBILITY_IN_API_MODE diagnostic range to 'declaration modifiers + name'.
Motivation: missing visibility modifier is an error in visibility modifiers list, so we should highlight this list.
Including a name in the range is convenient for using alt+enter (you don't have to move cursor from name to fun/class/val keyword)

 Also change NO_EXPLICIT_RETURN_TYPE_IN_API_MODE diagnostic range to 'declaration name' to match corresponding IDE inspection.

Fix stylistic problems and typos after review
2019-11-06 19:54:00 +03:00
Leonid Startsev
24688f3503 Do not disable 'redundant visibility modifier' inspection completely in Explicit API mode.
Instead, disable it only for effectively public declarations.

Add tests for this IDE inspection.
2019-11-06 19:54:00 +03:00
Leonid Startsev
5ab262c977 Skip explicit API inspection for data class properties and add inspection for public API in interfaces
Add tests for almost all the cases
2019-11-06 19:54:00 +03:00
Leonid Startsev
ebb7e434c8 Explicit Api mode: Renamings after design discussions
Change CLI flag to -Xexplicit-api=strict|warning. 'Disable' state and 'mode' suffix are left out as implementation details.

Change intention title to 'make X public explicitly'

Do not report 'no explicit visibility' on property accessors

Set DECLARATION_SIGNATURE as a range for report

Rename internal diagnostic from _MIGRATION to _WARNING
2019-11-06 19:53:59 +03:00
Leonid Startsev
7fada51c42 Add quickfix for setting explicit public visibility for diagnostic reported in API mode 2019-11-06 19:53:59 +03:00
Leonid Startsev
2b708093c0 Add explicit return type check for API mode
It will use the same SpecifyTypeExplicitlyIntention as in other places; to reuse check logic, some parts of code were moved from corresponding inspection (PublicApiImplicitTypeInspection) into ApiModeDeclarationChecker.

Also disable RedundantVisibilityModifierInspection when API mode is on.
2019-11-06 19:53:58 +03:00
Leonid Startsev
7058492b55 Explicit Api mode: prototype with check for missing explicit visibility
Add cli flag with 3-state switch
2019-11-06 19:53:58 +03:00
Alexander Udalov
a7d60fbf2d JVM IR: minor, fix IR builder scope for multifile bridges 2019-11-06 17:05:49 +01:00
Alexander Udalov
7a2c467bb5 JVM IR: remove obsolete hack in JvmMultifileClass facade generation 2019-11-06 17:05:49 +01:00
pyos
5d8aac456f JVM_IR: create temporaries for complex super constructor arguments
As for SAM wrappers, the bytecode sequence

    new A
    dup
    new B
    dup
    invokespecial B.<init>
    invokespecial A.<init>

breaks the inliner, so instead we do

    new B
    dup
    invokespecial B.<init>
    store x
    new A
    dup
    load x
    invokespecial A.<init>
2019-11-06 15:54:40 +01:00
pyos
42f75b3247 JVM_IR: have SAM wrapper constructors accept FunctionN
Otherwise, the cached instances cannot be reused for different wrapped
types. Also, if the wrapped type is regenerated during inlining, the
inliner would produce a call to a nonexistent constructor that takes the
regenerated type as an argument.
2019-11-06 15:54:40 +01:00
pyos
862197d713 JVM_IR: create temporaries for complex SAM conversion arguments
To avoid bytecode sequences like

    new _1Kt$sam$i$java_lang_Runnable$0
    dup
    new _1Kt$f$1
    dup
    invokespecial _1Kt$f$1.<init>()V
    invokespecial _1Kt$sam$i$java_lang_Runnable$0.<init>(...)V

as the different order of `new` and `<init>` confuses the inliner.
2019-11-06 15:54:40 +01:00
Mikhail Zarechenskiy
650e2501bb [NI] Prioritize variables with trivial constraints over complex ones
Consider the following constraint system (from the test example):

Nothing? <: V1
F!! <: V2
Inv<V1> <: S
Inv<V2> <: S

Where V1, V2, S are type variables, and F has nullable upper bound.
Type variable fixation order should be: V2 -> V1 -> S, and the problem
was that previously after fixation of type variable V2 we were trying
to fix S (before V1), so we had the following constraints on S:
Inv<F!!> <: S
Inv<V1> <: S
=> S were fixed to Inv<F!!>

And after this V1 was fixed to F!! which is contradictory as Nothing?
is not a subtype of F!!.

 #KT-33033 Fixed
2019-11-06 15:20:17 +03:00
Mikhail Zarechenskiy
5582fd4056 [NI] Discard DefNotNull types inside invariant positions
#KT-30297 Fixed
 #KT-32168 Fixed
 #KT-27722 Fixed (actually, it was fixed with addition of DefNotNullTypes, and now test was added to save this behavior)
 #KT-32345 Fixed
2019-11-06 15:20:17 +03:00
pyos
4fc1bd9ec5 Support inlining functions with KT-28064 style objects
Namely, anonymous objects defined in lambdas that have all captured
variables as loose fields instead of a single reference to the parent.

The question is, when a lambda inside an inline function defines an
anonymous object, and that object is not regenerated during codegen for
the inline function itself, but then has to be regenerated at call site
anyway, do we use an outer `this` or loose capture fields? For example,
before KT-28064:

    inline fun f1(g: () -> Unit) = object { g() }
    // -> f1$1 { $g: () -> Unit }
    inline fun f2(g: () -> Unit) = f1 { object { g() } }
    // -> f2$$inlined$f1$1 { $g: () -> Unit }
    //    f2$$inlined$f1$1$lambda$1 { this$0: f2$$inlined$f1$1 }
    inline fun f3(g: () -> Unit) = f2 { object { g() } }
    // -> f3$$inlined$f2$1 { $g: () -> Unit }
    //    f3$$inlined$f2$1$1 { this$0: f3$$inlined$f2$1 }
    //    f3$$inlined$f2$1$1$lambda$1 { this$0: f3$$inlined$f2$1$1 }

After KT-28064:

    inline fun f2(g: () -> Unit) = f1 { object { g() } }
    // -> f2$$inlined$f1$1 { $g: () -> Unit }
    //    f2$1$1 { $g: () -> Unit }
    inline fun f3(g: () -> Unit) = f2 { object { g() } }
    // -> f3$$inlined$f2$1 { $g: () -> Unit }
    //    f3$$inlined$f2$2 { ??? }
    //    f3$1$1 { $g: () -> Unit }

Should `???` be `this$0: f3$$inlined$f2$1` or `$g: () -> Unit`? This
commit chooses the latter for KT-28064 bytecode and keeps `this$0` when
inlining the old bytecode.
2019-11-06 13:11:44 +01:00
Dmitriy Novozhilov
27e1a54d4e [FIR] Add descriptors.runtime as dependency to psi2fir test 2019-11-06 15:05:06 +03:00
Dmitriy Novozhilov
665405c435 [FIR] Add discriminating generics into ConeOverloadConflictResolver 2019-11-06 15:05:06 +03:00
Mikhail Zarechenskiy
86a8412b05 Don't try loading PSI tree in IDE mode via stubs (e.g. decompiled code)
Here we want getting trailing comma in order to check its correctness
  and then to report diagnostics. Now, note that if we have stub for
  some PSI element, it means that we're definitely not in the compiler as
  there are no stubs and we're definitely not in the current source file,
  because in the current file we have full PSI tree in IDE.

  Stubs are required, for example, for decompiled code and there is no
  need to report any diagnostics about trailing comma there.

  Also, because we don't have stubs for destructuring declarations,
  one check for trailing commas is left without similar guard (
  see resolveLocalVariablesFromDestructuringDeclaration method)

  This commit fixes several IDE-tests:
   MultiFileJvmBasicCompletionTestGenerated.testDoNotCompleteWithConstraints
   MultiFileJvmBasicCompletionTestGenerated.testInImport
   MultiFileJvmBasicCompletionTestGenerated.testInImportedFunctionLiteralParameter
   MultiFileJvmBasicCompletionTestGenerated.testMoreSpecificExtensionGeneric
   MultiFileJvmBasicCompletionTestGenerated.testNoGenericFunDuplication
   MultiFileJvmBasicCompletionTestGenerated.testNotImportedExtensionFunction2
2019-11-06 14:32:09 +03:00
Mikhail Glukhikh
aff9ae2ecf FIR resolve bench: collect unique problems also from callee, ignore empty problems 2019-11-06 14:04:24 +03:00
Mikhail Glukhikh
bd1127cfa3 FIR: resolve lambda arguments even if an outer call is unresolved 2019-11-06 13:19:20 +03:00
Mikhail Glukhikh
3b4edb3901 Don't recreate FirSpecificTypeResolverTransformer during type resolve stage 2019-11-06 13:19:20 +03:00
Mikhail Glukhikh
3dd3421437 Temporary: resolve type to kotlin/reflect/Function instead of kotlin/Function
This arises in callable reference resolve test due to incorrect fictitious symbols caching
2019-11-06 13:19:19 +03:00
Mikhail Glukhikh
60e6d2e521 Resolve local declaration statuses & types inside bodies in FirBodyResolveTransformer 2019-11-06 13:19:10 +03:00
Mikhail Glukhikh
668a2a58be FIR: switch off body visiting in status & type resolve transformers (breaks many tests) 2019-11-06 13:19:09 +03:00
Mikhail Glukhikh
d6daf321a2 FIR: render implicit built-in type references as resolved ones 2019-11-06 13:19:08 +03:00
Alexander Udalov
7f4b568021 Mark new KClass.cast/safeCast extensions as low-priority
To avoid overload resolution ambiguity error in sources where everything
from both kotlin.reflect and kotlin.reflect.full is imported with a
star-import
2019-11-05 19:34:06 +01:00
Nikolay Krasko
3c7b0e6ccc Fix gradle runtime dependency issue for completion-ranking-kotlin library
Execution failed for task ':idea:idea-test-framework:test'.
> Could not resolve all files for configuration ':idea:idea-test-framework:testRuntimeClasspath'.
   > Could not find org.jetbrains.intellij.deps.completion:completion-ranking-kotlin:0.0.2.
...
        Required by:
            project :idea:idea-test-framework > project :idea

It looks like when resolving this dependency gradle doesn't check the list of repositories in :idea module.
2019-11-05 20:13:30 +03:00
Nikolay Krasko
279deb3a78 Mention navigation fails asserts in 193 in common file (KT-34542) 2019-11-05 20:13:30 +03:00
Nikolay Krasko
5ca3698d13 Remute JoinLinesTestGenerated tests in 193 (KT-34408) 2019-11-05 20:13:30 +03:00
Nikolay Krasko
651a70ae54 Remute MultiLineStringIndentTestGenerated tests in 193 (KT-34566) 2019-11-05 20:13:30 +03:00
Nikolay Krasko
c50e60f90f More mutes for 193 branch
One more test for KT-34689.
2019-11-05 20:13:30 +03:00
Nikolay Krasko
5d19b2c3c4 Allow to mute tests with spaces in names 2019-11-05 20:13:30 +03:00
Alexander Podkhalyuzin
e3c6a1fbd8 Updating progress for optimize imports
#KT-33905 Fixed
2019-11-05 18:10:06 +03:00
Alexander Podkhalyuzin
d2ae39489f SmartPointers in Smart Completion for anonymous object generation
#KT-32615 Fixed
2019-11-05 17:51:34 +03:00
Dmitry Gridin
d321f4626f Formatter: fix line break before OperationReference in elvis
#KT-22362 Fixed
2019-11-05 20:13:11 +07:00
Dmitry Gridin
247619c565 Formatter: fix line break between label and property
#KT-22273 Fixed
2019-11-05 20:13:11 +07:00
Dmitry Gridin
7f1935b82e formatter: cleanup code 2019-11-05 20:13:11 +07:00
Dmitry Gridin
0098588a6b NodeIndentStrategy: remove code duplication 2019-11-05 20:13:11 +07:00
Dmitry Gridin
196dd25637 ProjectCodeStyleImporter: fix deprecated elements 2019-11-05 20:13:11 +07:00
Mark Punzalan
f2289c216c Fix type of IllegalArgumentException call for illegal step in StepHandler. 2019-11-05 14:04:56 +01:00
Dmitriy Novozhilov
ca4784ffd3 Fix CLI testdata broken in 7f58162a 2019-11-05 15:41:35 +03:00
Dmitriy Novozhilov
c58ca27b2e [FIR] Introduce ResolutionMode as data for body resolve instead of Any? 2019-11-05 15:22:23 +03:00
Dmitriy Novozhilov
7f58162abc Add -Xuse-mixed-named-arguments compiler flag
That flags enables MixedNamedArgumentsInTheirOwnPosition feature
  (see #KT-7745) without experimental warning
2019-11-05 15:22:23 +03:00
Dmitriy Novozhilov
23d492646d [FIR] Update testdata of SAM conversions diagnostics tests after lambda resolution fix 2019-11-05 15:22:23 +03:00
Dmitriy Novozhilov
010dae454e [FIR] Fix extracting parameters from extension function types 2019-11-05 15:22:23 +03:00
Dmitriy Novozhilov
9c8d6fb49b [FIR] Check for lambda arguments that expected type is functional type 2019-11-05 15:22:22 +03:00
Dmitriy Novozhilov
297d07f465 [FIR] Refactor fir resolve tests
Now there is only base test runner for all kinds of diagnostics test
  (`AbstractFirBaseDiagnosticsTest`)
2019-11-05 15:22:22 +03:00
Dmitriy Novozhilov
66abbe1aad [FIR] Fix testdata in fir diagnostic tests broken in 01f09af6 2019-11-05 15:22:22 +03:00
Steven Schäfer
704e6e96fa Fir2Ir: Produce IR_TEMPORARY_VARIABLE origins 2019-11-05 14:58:47 +03:00
Steven Schäfer
733c7579aa Normalize names of temporary variables in IrTextTests 2019-11-05 14:58:47 +03:00
Nikolay Krasko
740f851a10 Revert [JS IR] commits that failed build
Revert "[JS IR] Build hybrid versions of stdlib and kotlin.test"
This reverts commit b9f88350dd.

Revert "[JS IR] Add gradle plugin integration tests"
This reverts commit d872b27663.

Revert "Update bootstrap"
This reverts commit bc47594c7a.

Revert "[JS IR] Support generating both IR and pre-IR libraries"
This reverts commit 1b8df45bfe.
2019-11-05 13:58:39 +03:00
Alexander Podkhalyuzin
722f7ff056 Now using Kotlin setting instead of Java one 2019-11-05 11:57:08 +03:00
Alexander Udalov
efaf779133 Minor, fix test data for kotlinx.serialization bytecode text test 2019-11-04 16:17:58 +01:00
Georgy Bronnikov
51459adb8c Add integration test for Kapt3+IR 2019-11-04 11:26:45 +03:00
Georgy Bronnikov
195f225e36 Run Kapt3 with old backend, even if IR is specified in configuration
Kapt does not currently work with IR backend. Temporarily switch to the
old JVM backend when running it.
2019-11-04 11:26:45 +03:00
Svyatoslav Kuzmich
b9f88350dd [JS IR] Build hybrid versions of stdlib and kotlin.test
IR version of libraries are no published by default inside pre-IR JARs
2019-11-01 19:42:06 +03:00
Svyatoslav Kuzmich
d872b27663 [JS IR] Add gradle plugin integration tests 2019-11-01 19:42:06 +03:00
Svyatoslav Kuzmich
bc47594c7a Update bootstrap
New compiler arguments needed to publish JS IR libraries:
    - stdlib
    - kotlin-test
2019-11-01 19:42:06 +03:00
Svyatoslav Kuzmich
1b8df45bfe [JS IR] Support generating both IR and pre-IR libraries
Remove all previous -Xir options

Add:
 -Xir-produce-klib-dir
 -Xir-produce-klib-file
 -Xir-produce-js
 -Xir-only
2019-11-01 19:42:05 +03:00
victor.petukhov
62d204f4d6 Support trailing comma
^KT-34743 Fixed
2019-11-01 19:40:20 +03:00
LepilkinaElena
e638b9fd12 K/N performance gradle plugin. Added options and right code size for … (#2752) 2019-11-01 18:16:43 +03:00
Ilmir Usmanov
8c079706a5 Add tests for case when result of tail-call suspend function returning
Unit is not Unit.
 #KT-34703 Fixed
2019-11-01 17:48:06 +03:00
Ilmir Usmanov
ca527444cb Return Unit manually in callSuspend and callSuspendBy if callable
returns Unit. The reason is the same as in the previous commit.
If the callable is tail-call and its callee returns something other that
Unit and suspends, on resume the result of the call will not be Unit.
 #KT-34703
2019-11-01 17:48:04 +03:00
Ilmir Usmanov
04441da095 Replace result on stack with Unit if callee is suspend function
returning Unit. Because on resume the result might be not a Unit if
the callee is tail-call and its callee return something different from
Unit and suspends.
Luckily, we generated ReturnsUnitMarker on such calls in all release
versions since 1.3. So, even if the code is inline and generated by
older versions, it will still work correctly.
The only version of the compiler, which does not generate the markers,
is 1.3.60-eap-76, because we did not generate the markers since
cc06798e2c. But I think, this is not
an issue.
 #KT-34703
2019-11-01 17:48:02 +03:00
Vyacheslav Gerasimov
3b088818a5 Build: Add sources and javadocs to Kotlin Plugin publication 2019-11-01 16:22:42 +03:00
Vyacheslav Gerasimov
579645bcfa Build: Publish ide-common as separate artifact in KotlinPlugin publication
#KT-34452
2019-11-01 16:22:42 +03:00
Vyacheslav Gerasimov
7401a7c63f Build: Fix dependencies of ide-common
#KT-34452
2019-11-01 16:22:42 +03:00
Dmitry Petrov
1e63101a27 FIR2IR: fix testData after rebase 2019-11-01 14:55:12 +03:00
Dmitry Petrov
6cde86139c IR: isFakeOverride: fix testData after rebase 2019-11-01 14:55:11 +03:00
Dmitry Petrov
35b9f43608 IR: use isFakeOverride
(and see what breaks)
2019-11-01 14:55:11 +03:00
Dmitry Petrov
f79909d724 IR serialization: isFakeOverride in proto
NB It's not clear yet if we actually want to serialize fake overrides
or generate and resolve them on deserialization.
2019-11-01 14:55:11 +03:00
Dmitry Petrov
5c390d9426 IR serialization: IrField.isFakeOverride 2019-11-01 14:55:11 +03:00
Dmitry Petrov
ce96053940 JVM_IR: IrField.isFakeOverride 2019-11-01 14:55:11 +03:00
Dmitry Petrov
0b26f32674 JS_IR: IrField.isFakeOverride 2019-11-01 14:55:11 +03:00
Dmitry Petrov
6101f00611 IR BE common: IrField.isFakeOverride 2019-11-01 14:55:10 +03:00
Dmitry Petrov
3fcdbf2c88 FIR2IR: IrField.isFakeOverride 2019-11-01 14:55:10 +03:00
Dmitry Petrov
edaa42ea46 IR: IrField.isFakeOverride 2019-11-01 14:55:10 +03:00
Dmitry Petrov
e9337ec8f2 IR serialization: IrProperty.isFakeOverride 2019-11-01 14:55:10 +03:00
Dmitry Petrov
da63d16c33 IR BE common: IrProperty.isFakeOverride 2019-11-01 14:55:10 +03:00
Dmitry Petrov
8b8b96bff4 FIR2IR: IrProperty.isFakeOverride 2019-11-01 14:55:10 +03:00
Dmitry Petrov
82c527c2cc IR: IrProperty.isFakeOverride 2019-11-01 14:55:10 +03:00
Dmitry Petrov
2682057767 IR tests: update testData for IrSimpleFunction.isFakeOverride 2019-11-01 14:55:09 +03:00
Dmitry Petrov
65e6a84831 IR tests: check IrSimpleFunction.isFakeOverride 2019-11-01 14:55:09 +03:00
Dmitry Petrov
46745adfd9 FIR2IR: IrSimpleFunction.isFakeOverride 2019-11-01 14:55:09 +03:00
Dmitry Petrov
d23f13e3dc IR serialization: IrSimpleFunction.isFakeOverride 2019-11-01 14:55:09 +03:00
Dmitry Petrov
5831b08a6e JVM_IR: IrSimpleFunction.isFakeOverride 2019-11-01 14:55:09 +03:00
Dmitry Petrov
f24278941d JS_IR: IrSimpleFunction.isFakeOverride 2019-11-01 14:55:09 +03:00
Dmitry Petrov
b36d8f556a IR BE common: IrSimpleFunction.isFakeOverride 2019-11-01 14:55:09 +03:00
Dmitry Petrov
843fb88459 IR: IrSimpleFunction.isFakeOverride 2019-11-01 14:55:09 +03:00
Dmitriy Novozhilov
01f09af608 [FIR] Fix generated name for FirErrorNameReferenceImpl 2019-11-01 13:24:57 +03:00
Dmitriy Novozhilov
829227255d [FIR] Add rendering of error numbers per file/package/module in HTML dump 2019-11-01 13:24:57 +03:00
Dmitriy Novozhilov
528e538b2a [FIR] Remove duplicating diagnostics from error function calls 2019-11-01 13:24:57 +03:00
Nikolay Krasko
a3ae629f53 Fix bunch file in 193 2019-11-01 12:25:44 +03:00
Nikolay Krasko
ffafd96f1b Fix url for developers builds (KT-34246)
#KT-34246 Fixed
2019-11-01 12:25:44 +03:00
Ilya Matveev
955300dd34 Deserializer: Fix initialization of private top-levels
Consider a file with only private top-level properties compiled into
a klib. If this klib is deserialized with deserializationStrategy.ALL
(e.g. if this library if passed using the -Xinclude flag),
initializers of these properties will not be generated  in a final
binary.

This patch fixes this error by unconditionally adding IrFiles into
deserialization queue if deserializationStrategy.ALL is specified.

Issue #KT-34722 fixed
2019-11-01 12:02:59 +03:00
Dmitriy Novozhilov
073578bf1c [FIR] Fix Fir2Ir testdata broken in a501e514 2019-11-01 11:07:16 +03:00
Dmitriy Novozhilov
098616ac76 [FIR] Add dependency of :descriptors.runtime to :fir2ir module 2019-11-01 11:06:33 +03:00
Dmitriy Novozhilov
1b44566e6f [FIR] Fix compilation error in lightTree module
There was a extra comma that I missed
2019-11-01 11:06:31 +03:00
Dmitriy Novozhilov
27c70eedd9 Enable MixedNamedArgumentsInTheirOwnPosition feature in compiler module 2019-11-01 10:25:37 +03:00
Dmitriy Novozhilov
09fa15c22b [FIR] Support old FE-like multifile tests 2019-11-01 10:25:36 +03:00
Dmitriy Novozhilov
65eed24dbb [FIR] Add diagnostics reporting to FIR resolve tests 2019-11-01 10:25:36 +03:00
Dmitriy Novozhilov
38bb9f78d6 [FIR] Add diagnostic collector component that collects diagnostics from error nodes 2019-11-01 10:25:36 +03:00
Dmitriy Novozhilov
0428916d3c [FIR] Add error nodes to default transformer and visitors 2019-11-01 10:25:35 +03:00
Dmitriy Novozhilov
a501e514c9 [FIR] Add meaningful diagnostics in all error elements 2019-11-01 10:25:35 +03:00
Dmitriy Novozhilov
7503449e8d [FIR] Add kind to diagnostics reported by RawFirBuilder 2019-11-01 10:25:35 +03:00
Dmitriy Novozhilov
8b5f568a15 [FIR] Introduce FirDiagnostic in FIR instead of errorReason 2019-11-01 10:25:34 +03:00
Dmitriy Novozhilov
8eabe08e7a [FIR] Move components into separate package 2019-11-01 10:25:34 +03:00
Dmitriy Novozhilov
f72fa87583 [FIR] Add old FE-like diagnostic tests 2019-11-01 10:25:33 +03:00
Dmitriy Novozhilov
8b900624d3 [FIR] Add bridge for diagnostics from old FE to ConeDiagnostic 2019-11-01 10:25:33 +03:00
Dmitriy Novozhilov
9b77dec99c [FIR] Add prototype of diagnostic collector 2019-11-01 10:25:33 +03:00
Andrey Uskov
e909b63d30 Revert "Fix GradleConfiguratorTest"
This reverts commit 5360a7a3
2019-10-31 21:40:44 +03:00
Andrey Uskov
fd2b75e39b Fixed import of MPP project with single Android target
#KT-34639 Fixed
2019-10-31 21:39:18 +03:00
Andrey Uskov
5c3b00cd0c Improve performance of import in Android Studio
Improve performance of dependency tree calculation when module per
source set mode is disabled.
#KT-34663 Fixed
2019-10-31 21:39:16 +03:00
Alexander Udalov
e8e04ca98e Do not use new stdlib API in reflection implementation
Otherwise this brings incompatibility between kotlin-reflect 1.3.70+ and
kotlin-stdlib 1.3.60-.

This commit reverts the relevant parts of c164745301, 5c89f2fa54 and
896512f7cd.
2019-10-31 17:39:34 +01:00
Kirill Shmakov
72591e34b3 Support android_x64/86 in cinterop definitions 2019-10-31 18:35:06 +03:00
Alexander Podkhalyuzin
4c21b234b1 Fixed compilation in 191 2019-10-31 17:31:09 +03:00
Alexander Podkhalyuzin
7b8fbb5fea Fixed freezes with add unambiguous imports on the fly
We still had backup way to recalculate things for the case when fix
is not available. So if error is not importable, or we have second
error, which will be outdated after adding first import, we could get
freezes. 2019.2 and 2019.1 have different APIs, so it's implemented in
different way.

#KT-30863 Fixed
2019-10-31 17:25:29 +03:00
Alexander Podkhalyuzin
24d620657b Java doesn't have extension methods, so we don't need to look
for imports for qualified references

#KT-26162 Fixed
2019-10-31 16:00:44 +03:00
Vyacheslav Gerasimov
95ac0e328f Build: Extract bootstrap teamcity url to parameter 2019-10-31 15:41:57 +03:00
Dmitry Gridin
f641e2a139 RedundantRequireNotNullCallInspection: should use BodyResolveMode.PARTIAL_WITH_CFA instead of BodyResolveMode.PARTIAL
#KT-34672 Fixed
2019-10-31 19:24:37 +07:00
Dmitry Gridin
04c8c888ee KotlinLightCodeInsightFixtureTestCase: remove deprecated call for 193 2019-10-31 19:24:36 +07:00
Dmitry Gridin
17429d333e Create expect/actual should move cursor to target declaration
#KT-34411 Fixed
2019-10-31 19:24:36 +07:00
Mikhael Bogdanov
8e2943ae2a Temporary increase timeout to avoid NPE 2019-10-31 13:15:51 +01:00
Ilya Matveev
7c4033f0bf Deserializer: Fix initialization order
Top-level initializers must be deserialized in the same order they
where in the original source file. Before this patch this rule might
be violated. Consider the following case:

// lib1.kt
val a = 5
val b = a * 5

// lib2.kt
fun foo() = println(b)

Compile both files into libraries and then link an application
against them. During deserialization of lib2 'b' will be added
to the deserialization queue of lib1. After that we will add 'a'
to this queue too. Thus 'b' and 'a' will be in a wrong order
in this queue resulting in a wrong order of corresponding
top-level initializers in a final executable.

This patch fixes this issue by adding all top-level initializers
to a deserialization queue before all other declarations.
2019-10-31 14:51:56 +03:00
Roman Artemev
78b29349c9 Fix lateinit isInitialized check in multi-file case 2019-10-31 14:45:15 +03:00
Toshiaki Kameyama
d75b938089 Formatter: don't format elvis operator in string template
#KT-34049 Fixed
2019-10-31 18:34:42 +07:00
Roman Golyshev
bcee8ce04b KT-34692: Invoke ScratchAction::update without invokeLater
- `invokeLater` is bad here, since `AnAction::update` must update action look immediately, not later in the future
- Because of `invokeLater`, `RunScratchAction` wasn't properly rendered in the context menu
- `invokeLater` was added in the a24da280ca to fix EA-210180
  - EA-210180 is not reproducible; however, the main reason of the exception is that `AnAction::update` was called not from EDT, but from regular thread updating "Run From Here" (>>) gutter actions
  - all exception under EA-210180 are from 1.3.50; my guess is that those exceptions were caused by changes in scratch editor implementation details and will not appear again; if they will, we will need to investigate them
- ^KT-34692 Fixed
2019-10-31 14:22:06 +03:00
Roman Golyshev
28ec74648e Use ML completion extension point from 193 platform
- completion-ranking-kotlin jar used to be in the IDEA itself; thanks to new extension it can reside in the plugin from now on
- ML completion is turned off by default
- use `implementation` dependency because `completion-ranking-kotlin` is required during runtime
2019-10-31 13:37:38 +03:00
Mikhail Zarechenskiy
b30a9e1d3e [NI] Remove capturing from supertypes during computation of CST 2019-10-31 11:32:05 +03:00
Mikhail Zarechenskiy
e8907c078d [NI] Don't recreate subtyping context every time 2019-10-31 11:32:04 +03:00
Mikhail Zarechenskiy
de009a2ff2 [NI] Minor, use singleton instead of creating anonymous object 2019-10-31 11:32:03 +03:00
Mikhail Zarechenskiy
77577dfa6f [FIR] Introduce ConeStubType to have subtyping for non-fixed variables
Currently, it's needed after changes in d7b47108f70a107818a04c8b8db33bfbf7c7e590

 Later it'll be also used for builder-inference
2019-10-31 11:32:03 +03:00
Mikhail Zarechenskiy
01ad9c47c8 [NI] Fix subtyping between integer literal types and intersection ones
Consider a call like `select(1, "")`, the resulting type for it is
 Comparable<Int & String> & Serializable.

 After variable fixation, the compiler incorporates this type into the
 constraint system to check for a contradiction, so it checks
 applicability of argument to the resulting type.

 In other words, for the above call it checks is
 `Comparable<Int & String> & Serializable` subtype of `IntegerLiteralType`?
 Which ends up in checking is `IntegerLiteralType` subtype of `Int & String`.

 Before this commit, such check was leading to the false result, but
 because of losing diagnostic (which was fixed in the previous commit:
 29f591b1), there was no error
2019-10-31 11:32:02 +03:00
Mikhail Zarechenskiy
e0fb586aaf [NI] Don't loose diagnostic after type variable fixation
#KT-24488 Fixed
2019-10-31 11:32:02 +03:00
Mikhail Zarechenskiy
ca8da22569 [NI] Improve CST algorithm to handle non-fixed variables
#KT-32456 Fixed
 #KT-32423 Fixed
 #KT-32818 Fixed
 #KT-33197 Fixed
2019-10-31 11:32:00 +03:00
Mikhail Zarechenskiy
ba6648d535 Minor, reformat Annotations.kt file 2019-10-31 11:31:59 +03:00
Dmitry Petrov
2ff36c808e Minor: mute testEa35963 in WASM 2019-10-31 11:13:45 +03:00
Dmitry Petrov
8b2fdca706 FIR2IR: fix testData 2019-10-31 11:13:45 +03:00
Steven Schäfer
b1b70e503c JVM IR: Improve codegen for try/catch statements 2019-10-31 11:13:44 +03:00
Steven Schäfer
af74fd047a psi2ir: Consistently use type unit for statements
These changes allow us to accurately distinguish between statements and
expressions in the IR.

This also fixes the types of non-exhaustive conditional statements.
2019-10-31 11:13:44 +03:00
Steven Schäfer
0da4b06074 psi2ir: Fix return insertion
We should only insert a return statement at the end of a lambda or
function if the final statement is used as an expression (slice
USED_AS_RESULT_OF_LAMBDA and USED_AS_EXPRESSION).
2019-10-31 11:13:44 +03:00
Nikolay Krasko
b3e733ea4f 193: More mutes in 193 (SurroundWithTestGenerated, KT-34689, KT-34542, KT-34672) 2019-10-31 11:11:50 +03:00
Nikolay Krasko
f7c775a080 193: Mute tests for find usages in libraries in 193 (KT-34542) 2019-10-31 11:11:50 +03:00
Nikolay Krasko
7e5316b9f1 Fix completion test for Java in 193
It looks like java completion doesn't use () anymore.
2019-10-31 11:11:50 +03:00
Nikolay Krasko
42312c3060 Fix GradleConfiguratorTest.testProjectWithModule in 193 2019-10-31 11:11:49 +03:00
Nikolay Krasko
0d2e790b32 Fix IdeaModuleInfoTest.testSdkForScript in 193
There's automatic jdk 7 registration starting from 193.
2019-10-31 11:11:49 +03:00
Nikolay Krasko
c9793e4bf4 Fix IdeaModuleInfo tests in 193 2019-10-31 11:11:49 +03:00
Nikolay Krasko
4ef063c656 Log information about failed test 2019-10-31 11:11:49 +03:00
Nikolay Krasko
201859be92 Mute RedundantRequireNotNullCall tests in 193 (KT-34672) 2019-10-31 11:11:49 +03:00
Nikolay Krasko
bed2e21a1a Mute CoroutineNonBlockingontextDetectionTest tests in 193 (KT-34659) 2019-10-31 11:11:49 +03:00
Nikolay Krasko
1811b79503 Mute custom navigation tests (KT-34542) 2019-10-31 11:11:48 +03:00
pyos
a835f07d51 JVM_IR: don't regenerate objects in lambdas inlined into objects 2019-10-31 09:09:54 +01:00
Ilya Goncharov
eeadc95bc1 [Gradle, JS] Remove check on duplicated targets
Useful (for KT-33828), if provider of artifact has changed, but remained only one

#KT-33828 fixed
2019-10-31 10:46:17 +03:00
Kristoffer Andersen
1074a0ef69 JVM_IR: Fix Inline CallableReferences with Varargs
- Added tests to demonstrate broken behaviour: the interaction of inline
  functions and callable references with varargs and defaults in various
  combinations.
- Refactored InlineCallableReferencesToLambdaPhase to look like and use
  some of the infrastructure from CallableReferenceLowering.
- Lifted some of this infrastructure out to be broadly reusable.
2019-10-31 08:15:22 +01:00
Andrey Uskov
5360a7a3fe Fix GradleConfiguratorTest
Fixed naming of jdk platforms in mocks in order to pass IDE validation
2019-10-31 00:40:13 +03:00
Andrey Uskov
33cacb87d3 Fix import tests for IDE 183 2019-10-31 00:40:11 +03:00
Vladimir Dolzhenko
4b2834c4a8 Provide incremental analysis of a file when it is applicable
#KT32868 Fixed
2019-10-30 21:41:29 +01:00
Kirill Shmakov
c7bd6d8ede Support watchos and tvos in cinterop definitions 2019-10-30 22:14:38 +03:00
Ilya Goncharov
08f9dd2aea [Gradle, JS] Fix entry for webpack (with Configuration Avoidance broke) 2019-10-30 18:58:56 +03:00
Dmitriy Novozhilov
6f91c0e679 [FIR] Don't check @ExtensionFunction in fir consistency tests 2019-10-30 18:49:12 +03:00
Dmitriy Novozhilov
ad9bf62b2f [FIR] Remove adding annotations from bounds to type parameter in lightTree2Fir 2019-10-30 18:49:11 +03:00
Dmitriy Novozhilov
36ad065792 [FIR] Fix testdata broken after d2b895d8 2019-10-30 18:49:07 +03:00
Alexander Podkhalyuzin
ddd25c703a SmartPointers in Introduce Variable refactoring
It's often case, when psi can die after reparse, especially after
reformatting cases, SmartPointers are opposite to it, can survive

#KT-32601 Fixed
2019-10-30 18:08:14 +03:00
Alexander Podkhalyuzin
aa604d0854 Fixed new/old type inference diff, sometimes causes problems in JPS 2019-10-30 18:05:34 +03:00
Stanislav Erokhin
607249e899 Make computeTasksAndResolveCall public for compiler plugins 2019-10-30 16:44:38 +03:00
Vyacheslav Gerasimov
17bd547666 Build: Fix internalKotlinRepo url for JPS build 2019-10-30 16:38:10 +03:00
Alexander Udalov
28187da750 Fix compilation of :idea:compileTestKotlin
Original patch authored by @h0tk3y.
2019-10-30 12:56:42 +01:00
Jiaxiang Chen
6454cfad87 add local variable test. This test runs box() method and checks local variable types and names avaiable at every step. 2019-10-30 14:13:12 +03:00
Jiaxiang Chen
6b73ef4b0b refactor stepping test to extract common logic for other debug information test 2019-10-30 14:13:12 +03:00
Anton Yalyshev
dec7f51902 Return an old stepping cause new one requires a big refactoring for GradleModuleBuilder 2019-10-30 13:49:40 +03:00
Anton Yalyshev
9075a83ebe Prevents creating of new Gradle-based Kotlin project in a path of previous one 2019-10-30 13:49:40 +03:00
Mads Ager
1713625718 JVM: Improve line number handling for suspend calls.
Take branching and method calls into account when finding the line
number of the continuation. If there is no line number before
branching instructions or method calls, the following code is
still on the line of the suspend call itself.

This fixes a couple of issues with incorrect line numbers for
multiple throws on the same line or multipe suspend calls on
the same line.

In addition, it avoids the need to spam the method node with
repeated line number instructions in the IR backend.
2019-10-30 13:40:21 +03:00
Mikhail Glukhikh
34d9959b17 FIR: add more correct handling of Java raw types 2019-10-30 12:55:38 +03:00
Mikhail Glukhikh
d4af35d794 FIR: add substitution for Java fields 2019-10-30 12:55:37 +03:00
Mikhail Glukhikh
83cd7cf516 FIR: add new problematic tests 2019-10-30 12:55:37 +03:00
Alexander Udalov
544b402d06 Update bootstrap to 1.3.70-dev-1070 2019-10-30 10:31:51 +01:00
Georgy Bronnikov
9c8e8651be IR: make stub marker parameter for constructors nullable
In constructor stubs for default arguments, a marker parameter used
to have a non-null type, but null was passed as the corresponding
argument. This patch corrects the type.
2019-10-30 12:23:27 +03:00
Natalia Selezneva
35e2c9eb59 Fix scripting tests in 193
^KT-34541 Fixed
2019-10-30 12:02:45 +03:00
Natalia Selezneva
4613bf4b06 Minimize bunch files size for AbstractScriptConfigurationTest.kt 2019-10-30 12:02:45 +03:00
Dmitriy Novozhilov
d2b895d8c2 [FIR] Add @ExtensionFunction to lambdas with receivers 2019-10-30 11:03:15 +03:00
Vyacheslav Gerasimov
5776d115b7 Build: Add space packages to maven-settings servers 2019-10-29 23:31:43 +03:00
Ilya Chernikov
9aaf08de08 Fix equality for the KtFileScriptSource 2019-10-29 20:44:18 +01:00
Vladimir Dolzhenko
26255f8501 Added AllowNullableArrayArgsInMain (1.4+) language setting 2019-10-29 19:20:35 +01:00
Ilya Goncharov
6ecc7eab7e [Gradle, JS] Add compatible aliases for old tasks
#KT-32323 fixed
#KT-32283 fixed
2019-10-29 19:41:20 +03:00
Ilya Goncharov
dc3f3ce80d [Gradle, JS] Rename experimental annotation with warning level 2019-10-29 19:39:12 +03:00
Ilya Goncharov
e7a45fb536 [Gradle, JS] JS specific build variants 2019-10-29 19:39:12 +03:00
Ilya Goncharov
e3ec37b14f [Gradle, JS] Common webpack's configurations 2019-10-29 19:39:12 +03:00
Ilya Goncharov
eb7fe6b0a4 [Gradle, JS] Each task configure your own dceOutputFileApplier 2019-10-29 19:39:12 +03:00
Ilya Goncharov
2d026e7973 [Gradle, JS] Make disambiguate take vararg 2019-10-29 19:39:12 +03:00
Ilya Goncharov
92c5b9c66e [Gradle, JS] Configure build and run in one place: configureMain 2019-10-29 19:39:12 +03:00
Ilya Goncharov
aca5628622 [Gradle, JS] Use experimental dce annotation 2019-10-29 19:39:12 +03:00
Ilya Goncharov
f55680a737 [Gradle, JS] Configure build and run in one place: configureMain 2019-10-29 19:39:12 +03:00
Ilya Goncharov
ead4528445 [Gradle, JS] Make multiple entry points and output for webpack 2019-10-29 19:39:12 +03:00
Ilya Goncharov
f66e6337fe [Gradle, JS] Fix test on DCE working with usual js files 2019-10-29 19:39:11 +03:00
Ilya Goncharov
83527a6d0e [Gradle, JS] DCE dsl interface used in browserDsl 2019-10-29 19:39:11 +03:00
Ilya Goncharov
2ffd8bed48 [Gradle, JS] Depends on according to Task Configuration Avoidance 2019-10-29 19:39:11 +03:00
Ilya Goncharov
d2727e2f25 [Gradle, JS] Add possibility to configure dce task 2019-10-29 19:39:11 +03:00
Ilya Goncharov
e1387e3d3d [Gradle, JS] Provide entry for DCE to webpack 2019-10-29 19:39:11 +03:00
Ilya Goncharov
174fd5975d [Gradle, JS] Add resolveFromModulesFirst option
When we collect all DCE'd files, we need, that webpack to watch on these files, not on node_modules module
2019-10-29 19:39:11 +03:00
Ilya Goncharov
51f4dc5af0 [Gradle, JS] Filter DCE candidates
We should process DCE only for:
- JARs
- JSs with neighbors meta.js
2019-10-29 19:39:11 +03:00
Ilya Goncharov
faa5846252 [Gradle, JS] Add DCE task with dependsOn relationships 2019-10-29 19:39:11 +03:00
Ilya Goncharov
a7cae0fc78 [Gradle, JS] Cartesian product of build variant and task types 2019-10-29 19:39:11 +03:00
Ilya Goncharov
6e0f5f71f1 [Gradle, JS] Divide values for devtool (source maps) 2019-10-29 19:39:11 +03:00
Ilya Goncharov
6c4e7921f7 [Gradle, JS] Single entry for webpack 2019-10-29 19:39:11 +03:00
Ilya Goncharov
973cd51497 [Gradle, JS] Add webpack mode depends on build variant kind 2019-10-29 19:39:10 +03:00
Ilya Goncharov
603e263003 [Gradle, JS] Add BuildVariants 2019-10-29 19:39:10 +03:00
Ilya Goncharov
3e9e9c02c6 [Gradle, JS] Extract build task configuration from run task 2019-10-29 19:39:10 +03:00
Georgy Bronnikov
cd78e6ec50 JVM_IR: handle property references in SAM conversions 2019-10-29 18:38:59 +03:00
Alexander Udalov
74c9120d9d Minor, don't use outdated Groovy dependency
See https://ossindex.sonatype.org/vuln/91433254-870c-47a2-aa06-1b303a92c018

 #TPV-3545 Fixed
2019-10-29 16:07:52 +01:00
Alexander Udalov
59959c52ad Don't report missing reflection diagnostic for KType/KTypeProjection/KVariance 2019-10-29 15:52:01 +01:00
Alexander Udalov
896512f7cd Support KClass.isInstance/cast/safeCast in stdlib-only reflection implementation
#KT-14720 Fixed
2019-10-29 15:52:00 +01:00
Alexander Udalov
5c89f2fa54 Support KClass.qualifiedName in stdlib-only reflection implementation
#KT-34586 Fixed
2019-10-29 15:51:25 +01:00
Alexander Udalov
c164745301 Support KClass.simpleName in stdlib-only reflection implementation
#KT-33646 Fixed
2019-10-29 15:51:21 +01:00
Anton Yalyshev
e146d308db Add statistics collector 2019-10-29 16:40:53 +03:00
Igor Yakovlev
63e687f67e Add feature for data and inline class parameters smart typing
When one typing data/inline class primary ctor this feature adds missing val keyword for parameters
i.e.
data class xxx(x: Int<caret>)
when typing comma symbol convert code to
data class xxx(val x: Int,<caret>)

Fixed #KT-34567
2019-10-29 16:40:52 +03:00
Mikhail Glukhikh
0708f574fc FIR: simplify companion scope building for implicit dispatch receiver 2019-10-29 16:27:42 +03:00
Mikhail Glukhikh
79e584519f FirTypeResolverImpl: minor style fix 2019-10-29 16:27:42 +03:00
Mikhail Glukhikh
37cad476e8 Fix incorrect assertion in FIR DFA 2019-10-29 16:27:41 +03:00
Mikhail Glukhikh
4adacfa5a2 Add a pair of new tests for FIR local classes / objects 2019-10-29 16:27:41 +03:00
Mikhail Glukhikh
384134a069 FIR2IR: fix handling constructors & their symbols (related also to local classes) 2019-10-29 16:27:41 +03:00
Mikhail Glukhikh
7dee1cd9d2 Build member scope for FirAnonymousObject correctly 2019-10-29 16:27:41 +03:00
Mikhail Glukhikh
e1c889e871 Make FirClass a kind of FirClassLikeDeclaration, introduce FirRegularClass/AnonymousObject symbols 2019-10-29 16:27:41 +03:00
Mikhail Glukhikh
1e4f07ebc7 FIR: expect getClassLikeSymbolByFqName to return null for local classes 2019-10-29 16:27:40 +03:00
Mikhail Glukhikh
a13ae08b52 FIR: add classifiers to local scopes, process local class symbols correctly 2019-10-29 16:27:40 +03:00
Vyacheslav Gerasimov
aa2765bab8 Build: Setup pom for KotlinPlugin maven publication 2019-10-29 15:32:32 +03:00
Nikolay Krasko
f5cdaafeb0 Fix compilation errors in QuickFixMultiModuleTestGenerated 2019-10-29 15:04:13 +03:00
Alexander Udalov
df4ab4ed81 Add JVM bytecode target version 13
#KT-34119 Fixed
2019-10-29 12:54:24 +01:00
Georgy Bronnikov
1354de1780 JVM_IR: stylistic, use transform instead of add/remove
In InterfaceDeclarationLowering, functions are being replaced by
redirections to default implementations. Use `transform`, as suggested
by @pyos.
2019-10-29 14:42:35 +03:00
Toshiaki Kameyama
68ea677cc4 Import quick fix: support extension iterator function
#KT-34303 Fixed
2019-10-29 18:35:14 +07:00
Dmitry Savvinov
3abfe59d75 Deduplicate incompatible actual descriptors
Otherwise, we might get false positive AMBIGUOUS_ACTUALS due to one and
the same descriptor appearing multiple times in a list
2019-10-29 14:28:41 +03:00
Dmitry Savvinov
9198b7a039 Add test on weakly incompatible actual in intermediate source-set 2019-10-29 14:28:41 +03:00
Dmitry Savvinov
2c6fbb6ece Fix dependsOn module names
Use Gradle Project IDs instead of names, because for composite Gradle
builds module names are appended with some additional prefixes, which
causes mismatch
2019-10-29 14:27:38 +03:00
LepilkinaElena
b37dc32e03 Kotlin/Native performance gradle plugin (#2713) 2019-10-29 14:23:50 +03:00
Nikolay Krasko
7160653546 Fix KotlinConfidenceTest in 193 2019-10-29 13:47:14 +03:00
Nikolay Krasko
8d50aea471 Allow to use mutations from several files 2019-10-29 13:45:04 +03:00
Nikolay Krasko
620898c73e Use local single-thread cached value instead of thread locals (KT-28940)
It looks like thread locals are not needed here as their global state
is not utilized but creates troubles with memory management.
2019-10-29 13:40:34 +03:00
Nikolay Krasko
02f9b255e6 Clean using thread local in all threads (KT-28940) 2019-10-29 13:40:34 +03:00
Dmitry Gridin
587b0de2b8 RemoveExplicitTypeIntention: fix false positive for type aliases
#KT-33902 Fixed
2019-10-29 17:26:59 +07:00
Dmitry Gridin
6ea82a0c7d MoveMember: cleanup code 2019-10-29 17:26:34 +07:00
Dmitry Gridin
18aa9ffce8 expectActualUtil: introduce runCommandOnAllExpectAndActualDeclaration function 2019-10-29 17:26:34 +07:00
Dmitry Gridin
9aa49e61fe expectActualUtil: add parameter useOnSelf to runOnExpectAndAllActuals 2019-10-29 17:26:34 +07:00
Dmitry Gridin
4285f63bcc ChangeVisibilityFix: cleanup code 2019-10-29 17:26:34 +07:00
Dmitry Gridin
9c61f42121 ChangeVisibilityModifierIntention: should affect all actual/expect declarations
#KT-29737 Fixed
2019-10-29 17:26:34 +07:00
Dmitry Gridin
13e98e712e RedundantLetInspection: fix false negative for references
#KT-34603 Fixed
2019-10-29 17:25:50 +07:00
Dmitry Gridin
5fc70f6cfd RedundantLetInspection: fix false positive for inner lambda expression
#KT-25271 Fixed
2019-10-29 17:25:50 +07:00
Dmitry Gridin
5d16753285 ImportFix: add support for WRONG_NUMBER_OF_TYPE_ARGUMENTS
#KT-23834 Fixed
2019-10-29 17:25:17 +07:00
Dmitry Gridin
e14d589279 KotlinInternalInJavaInspection: fix false positive for java test module
#KT-17659 Fixed
2019-10-29 17:24:46 +07:00
Dmitry Gridin
865e1bf631 KotlinInternalInJavaInspection: cleanup code 2019-10-29 17:24:46 +07:00
Dmitry Gridin
81f3a98f49 Convert ConvertTwoComparisonsToRangeCheck intention to inspection
Relates to #KT-17310
2019-10-29 17:24:21 +07:00
Alexander Udalov
8e4c7ad65d Merge pull request #2727 from pyos/fix-synthetic-accessors-v101
JVM_IR: add accessors for protected members in divergent hierarchies
2019-10-29 11:10:58 +01:00
Dmitriy Novozhilov
3658bee253 [FIR] Fix testdata related to callable references 2019-10-29 13:03:13 +03:00
Dmitriy Novozhilov
0d15ff1ddd [FIR] Introduce FirSourceElement instead of FirElement as source in fir nodes 2019-10-29 13:03:13 +03:00
Dmitriy Novozhilov
b93357be48 [FIR] Support assignment operators 2019-10-29 13:03:13 +03:00
Dmitriy Novozhilov
6298889358 [FIR] Add forgotten exhaustiveness checking for erroneously resolved when 2019-10-29 13:03:13 +03:00
Dmitriy Novozhilov
7e55960943 [FIR] Support Conditional effects 2019-10-29 13:03:13 +03:00
Dmitriy Novozhilov
57f1eac9a8 [FIR] Support CallsInPlace effects 2019-10-29 13:03:12 +03:00
Dmitriy Novozhilov
fd852ec07d [FIR] Add deserialization of contracts 2019-10-29 13:03:12 +03:00
Dmitriy Novozhilov
18c3d1c140 [FIR] Add contract description classes to fir 2019-10-29 13:03:12 +03:00
Roman Golyshev
3661dedacf KT-31762: Fix completion in enum entries constructors
- The issue was caused by incorrect parsing of enum entry because of `$` in the `KotlinCompletionContributor::DEFAULT_DUMMY_IDENTIFIER`
  - Incorrect parsing caused arguments next to completed one to be recognized as another enum entries
- Change `KotlinCompletionContributor::isInClassHeader` to accept classes without bodies, so identifier without `$` is used inside enum entries constructors
- ^KT-31762 Fixed
2019-10-29 12:35:13 +03:00
Ilya Goncharov
042100ea77 [Gradle, JS] Disable puppeteer downloading Chrome 2019-10-29 12:03:49 +03:00
Mikhael Bogdanov
63b115abb6 Workaround for KT-34656: temporary disable assertion 2019-10-29 09:48:49 +01:00
Mark Punzalan
de333c18fc JVM_IR: Enable loopVarInterval and forInReversedCollectionIndices
bytecode text tests.
2019-10-29 07:43:37 +01:00
Natalia Selezneva
934cbcbbec Use more abstract class for gradleModuleBuilder
In IDEA 201.* another class is in super class list
^KT-34463 Fixed
2019-10-29 09:11:12 +03:00
Vladimir Dolzhenko
46d843643d Fixed BoxJsTestGenerated.Main due to nullable arguments in main method 2019-10-28 16:42:14 +01:00
Steven Schäfer
2043dd8a10 JVM IR: Respect extension receiver parameter type in AddContinuationLowering 2019-10-28 18:34:06 +03:00
Steven Schäfer
184c83bcb0 JVM IR: Fix type of IrReturn in AddContinuationLowering 2019-10-28 18:34:06 +03:00
Mark Punzalan
b4d2eae12d Add test data generator for stepped progression box tests. 2019-10-28 15:26:38 +01:00
Mark Punzalan
1738c2d4f6 Invoke GenerateInRangeExpressionTestData and
GeneratePrimitiveVsObjectEqualityTestData during
:compiler:generateTests.
2019-10-28 15:26:38 +01:00
Mark Punzalan
3c775c598c Extract utility function to create temporary variables if necessary. 2019-10-28 15:26:38 +01:00
Mark Punzalan
9bb9ab67a7 Add bytecode text tests for ForLoopsLowering. 2019-10-28 15:26:38 +01:00
Mark Punzalan
277cb39e3b Add new tests for step progressions and fix existing tests. 2019-10-28 15:26:38 +01:00
Mark Punzalan
27642514b1 Move ForLoopsLowering before JvmStringConcatenationLowering.
ForLoopsLowering may produce IrStringConcatenations which should be
eliminated before codegen.
2019-10-28 15:26:38 +01:00
Mark Punzalan
8a4185202f Handle step progressions in ForLoopsLowering. 2019-10-28 15:26:38 +01:00
Vyacheslav Gerasimov
38f0fd256e Build: Specify LIBRARY_ELEMENTS_ATTRIBUTE to JAR for configurations with js libraries 2019-10-28 17:21:23 +03:00
Vyacheslav Gerasimov
1a68a772c4 Build: Update gradle to 5.6.2 2019-10-28 17:21:23 +03:00
Denis Zharkov
ea43d2880c FIR: Update FIR2IR test data changed because of callable references
^KT-32725 Fixed
2019-10-28 17:07:26 +03:00
Denis Zharkov
9ac0ac50ea FIR: Support callable references to vars
^KT-32725 In Progress
2019-10-28 17:07:25 +03:00
Denis Zharkov
4233cf1bd6 FIR: Get rid of the cycle in delegated properties resolution
^KT-32725 In Progress
2019-10-28 17:07:23 +03:00
Denis Zharkov
f97f06a99a FIR: Support callable references for constructors
^KT-32725 In Progress
2019-10-28 17:07:22 +03:00
Denis Zharkov
1e0105d40e FIR: Fix initialization pieces for callable references after rebase
^KT-32725 In Progress
2019-10-28 17:07:21 +03:00
Denis Zharkov
7ae3eda37f FIR: Rename FirResolvedRealCallableReference -> FirResolvedCallableReference
^KT-32725 In Progress
2019-10-28 17:07:19 +03:00
Denis Zharkov
1564e72b59 FIR: Rename FirResolvedCallableReference -> FirResolvedNamedReference
^KT-32725 In Progress
2019-10-28 17:07:18 +03:00
Denis Zharkov
5e322a2dd9 FIR: Refactor ResolvedCallableReferenceAtom
^KT-32725 In Progress
2019-10-28 17:07:16 +03:00
Denis Zharkov
fe8cd195aa FIR: Support callable references outside of the calls
^KT-32725 In Progress
2019-10-28 17:07:15 +03:00
Denis Zharkov
152236d84a FIR: Support callable references to declarations with implicit types
^KT-32725 In Progress
2019-10-28 17:07:14 +03:00
Denis Zharkov
af72cea8b3 FIR: Add simple test on SAM conversion for callable receivers
^KT-32725 In Progress
2019-10-28 17:07:12 +03:00
Denis Zharkov
7feb1aecfe FIR: Add constraints for extension receiver of callable reference
^KT-32725 In Progress
2019-10-28 17:07:11 +03:00
Denis Zharkov
74b9ba1613 FIR: Support callable references to properties
^KT-32725 In Progress
2019-10-28 17:07:10 +03:00
Denis Zharkov
38ab6521aa FIR: Support static methods in callable references
^KT-32725 In Progress
2019-10-28 17:07:09 +03:00
Denis Zharkov
937ea3d8a0 FIR: Support postponed callable references resolution
^KT-32725 In Progress
2019-10-28 17:07:08 +03:00
Denis Zharkov
cb50ea2707 FIR: Resolve callable references separately for each outer candidate
^KT-32725 In Progress
2019-10-28 17:07:02 +03:00
Denis Zharkov
03a9bfbea5 FIR: Provide Candidate receiver to argument resolution helpers
The receiver might be useful for working with postponed atoms
and other info from the Candidate

^KT-32725 In Progress
2019-10-28 17:04:53 +03:00
Denis Zharkov
006e475a99 FIR: Support callable references partially
^KT-32725 In Progress
2019-10-28 17:04:48 +03:00
Denis Zharkov
cdb2bb2b45 FIR: Prepare tree for callable references resolution
^KT-32725 In Progress
2019-10-28 17:04:44 +03:00
Denis Zharkov
aeceee5af0 FIR: Fix StoreReceiver transformer
^KT-32725 In Progress
2019-10-28 17:04:39 +03:00
Denis Zharkov
e359791ab4 Minor. FIR: Simplify createFunctionalType
^KT-32725 In Progress
2019-10-28 17:04:29 +03:00
Florian Kistner
bffcf8478e 193: Fix outdated gradle plugin id 2019-10-28 14:19:14 +01:00
Nikolay Krasko
01d3b8d9c4 Store mute tests database in the code instead of build server 2019-10-28 14:06:06 +03:00
Nikolay Krasko
edc1fa3ae8 Change version to the stable one to avoid downloading from teamcity 2019-10-28 14:06:06 +03:00
Nikolay Krasko
3643ae4765 Update 193 to more recent 193.4778.7-EAP 2019-10-28 14:06:06 +03:00
Nikolay Krasko
810e1973f6 193: Mute multiline enter tests in 193 (KT-34566) 2019-10-28 14:06:06 +03:00
Nikolay Krasko
697d3a0e5a 193: Mute scripting test in 193 (KT-34541) 2019-10-28 14:06:06 +03:00
Nikolay Krasko
8563614b69 193: Mute navigation tests in 193 (KT-34542) 2019-10-28 14:06:05 +03:00
Nikolay Krasko
3e7767f096 Fix compilation on 193 and clean up other warnings 2019-10-28 14:06:05 +03:00
Igor Chevdar
7b0f03cc1c [IR] Made IR validator weaker during validating IrConstNull 2019-10-28 12:39:29 +03:00
Igor Chevdar
f413da3e58 Turned off test for native
It fixes current JVM BE behavior but seems like this should've been a FE error.
2019-10-28 12:38:19 +03:00
Georgy Bronnikov
b63f9176a3 JVM_IR: repair overriddenSymbols in InterfaceDelegationLowering
When creating delegation redirectors for default implementations of
interface functions, `overriddenSymbols` should be repaired across the
whole module, not just a particular file.
2019-10-28 12:12:32 +03:00
Ilya Goncharov
c127cbaa6a [Gradle, JS] Fix stack trace for inner classes
Necessary only classname, Gradle find package on itself

#KT-30917 fixed
2019-10-28 11:50:52 +03:00
Mads Ager
88dd8f663c JVM_IR: Do not generate null checks for suspend function views.
The arguments are null whenever the suspend function is resumed
and takes its state from the continuation parameter.
2019-10-27 07:37:15 +03:00
Vladimir Dolzhenko
03c7f4bf00 Wrap KtClassOrObject.isLocal, KtFile.isScript with runReadAction in LightClasses
#EA-211576 Fixed

(cherry picked from commit 75a59d4bced714af51abd7e354bc873313b28051)
2019-10-26 21:10:38 +02:00
Vladimir Dolzhenko
00055fc20a Wrap KtClassOrObject.isLocal, KtFile.isScript with runReadAction in LightClasses
#EA-211576 Fixed

(cherry picked from commit 75a59d4bced714af51abd7e354bc873313b28051)
2019-10-26 09:42:49 +02:00
Vladimir Dolzhenko
96768cbf2d Clean up after acquire lock for several seconds to create LightClasses to workaround dead-lock over resolve
Relates to #KT-34279
2019-10-25 22:05:28 +02:00
Vyacheslav Gerasimov
28e34f5175 Build: Exclude kotlin-stdlib-common from kotlin-osgi-bundle
#KT-31365
2019-10-25 21:53:41 +03:00
Alexander Udalov
dac0fc7397 Remove obsolete assertion in ExpressionCodegen
With the mangling added in 488418d960, there's no longer any risk in
writing "special" function name ("<anonymous>" in this case) to the
local variable table.

 #KT-34356 Fixed
2019-10-25 19:31:20 +02:00
Alexander Udalov
e7fe144f5c Minor, fix markdown rendering in GenerateGradleOptions
To make it more in line with changes in
649bd6bbc4
and
4e78c2ea94
2019-10-25 19:26:20 +02:00
Alexander Udalov
f248e4a2ee Update CLI test data and Gradle option descriptions 2019-10-25 19:26:20 +02:00
Pavel Semyonov
c6f54b6412 Improve descriptions of compiler options 2019-10-25 19:26:19 +02:00
Pavel Kirpichenkov
87b88a738e [Minor] Update test data for NI 2019-10-25 19:37:06 +03:00
Nikolay Krasko
1b96e14b1e Remove reference to temporary thread local explicitly (KT-28940)
There're issue with storing variables in memory longer than needed.
2019-10-25 17:01:52 +03:00
Mikhail Zarechenskiy
588218658c [NI] Fix ambiguity for extension functions with exact transient receiver 2019-10-25 16:28:40 +03:00
Vladimir Dolzhenko
eb3f50dce7 Revert "Fix readAccess in IDELightClassGenerationSupport on obtaining script"
This reverts commit ba01678a
2019-10-25 14:11:46 +02:00
Steven Schäfer
210c354ae5 Fir2Ir: Set initializers for temporary variables 2019-10-25 14:27:19 +03:00
Alexander Udalov
cf61957e3c Minor, fix kotlinx-serialization bytecode test data
After some changes to the JVM IR backend
2019-10-25 11:23:11 +02:00
Pavel Kirpichenkov
c21e699783 Fix default type of static classes inside parametrized parents
Default type of LazySubstitutingClassDescriptor is not lazy. However, most of default types are,
and there is an optimization in KotlinTypeFactory, which uses default type for simple type without
type arguments and/or annotations. LazySubstitutingClassDescriptor's default type creates simple type
with factory, which may therefore cause recursion.

#KT-34029 Fixed
2019-10-25 11:59:27 +03:00
Dmitriy Dolovov
905823fb1d Fix: Notify user in IDE on K/N KLIBs with incompatible ABI version
Issue #KT-34159
2019-10-25 11:10:46 +07:00
Dmitriy Dolovov
8ffc58a77d Fix: Don't index and decompile incompatible .knm files from K/N KLIBs
Issue #KT-34159
2019-10-25 11:10:40 +07:00
Dmitriy Dolovov
9c887c1e79 Fix: Don't analyse incompatible K/N KLIBs in IDE
Issue #KT-34159
2019-10-25 11:10:34 +07:00
Vyacheslav Gerasimov
b1d7df697d Build: Add dependency on gradle plugin to android-extensions-idea module 2019-10-24 21:01:27 +03:00
Vyacheslav Gerasimov
e096691bd8 Build: Add dependency on gradle plugin to idea-android module 2019-10-24 19:32:16 +03:00
Mads Ager
52febbcc07 [JVM_IR] Support default interface suspend functions.
Do this by reordering the lowerings so that the lowering that
adds continuations happen after default methods have been
eliminated if needed.

Mark more functions as known to be tail-calls: bridges and
delegated members.

Preserve source info and annotations when creating replacement
functions.
2019-10-24 18:51:41 +03:00
Vladimir Dolzhenko
d16a1b14d8 Acquire lock for several seconds to create LightClasses to workaround dead-lock over resolve
Relates to #KT-34279
2019-10-24 17:32:36 +02:00
Alexander Udalov
c676a30919 Minor, clarify comment on SafePublicationLazyImpl.final 2019-10-24 16:57:54 +02:00
Alexander Udalov
c24f2d06d4 Mark value fields in ReflectProperties as volatile
These fields were originally non-volatile because of an incorrect
assumption I had at the time that a value was safely published if the
underlying object's class has at least one final field. This is true for
almost all values used in lazy/lazySoft: DeserializedFunctionDescriptor,
DeserializedPropertyDescriptor, KTypeImpl, java.lang.reflect.Field, etc.
But of course, this only means that the object was _safely initialized_
and not safely published via the non-volatile reference, where other
threads can still observe null, even after that constructed object was
leaked to the outer world by some other means and led to observable
changes in behavior.

This can fix some concurrency issues in kotlin-reflect. I wasn't able to
reproduce the problem in stress tests though.
2019-10-24 16:57:53 +02:00
Kristoffer Andersen
8af3b3e51e [Backend] Reorganize version 1.0 codegen tests
- Extract all backend codegen tests that specifically target behaviour
  in to-be-deprecated functionality from language versions < 1.3"
- Remove those tests from the JVM IR test suite.
2019-10-24 16:51:19 +02:00
Vyacheslav Gerasimov
38ea5a85a3 Build: Add maven publication for Kotlin plugin artifacts 2019-10-24 17:06:19 +03:00
Ilya Gorbunov
c1cb6da436 Use stable compiler option for enabling progressive mode 2019-10-24 16:05:48 +03:00
Ilya Gorbunov
59482f6827 Do not blank opt in for allowing kotlin package in all subprojects
-Xallow-kotlin-package must be specified explicitly to prevent
unintended declarations in kotlin package.
2019-10-24 16:05:48 +03:00
Kevin Bierhoff
5c9cbf7e77 allow relative friend paths matching relative classpaths 2019-10-24 14:56:46 +02:00
Yan Zhulanow
68deedb589 Kapt: Register AP options as inputs in worker mode as it done with kotlinc compiler plugin mode
This commit fixes the 'KotlinAndroid32GradleIT.testKaptUsingApOptionProvidersAsNestedInputOutput()' test that started to fail after switching to the worker API mode by default.
2019-10-24 21:33:02 +09:00
Yan Zhulanow
958e6623fc Kapt: Enable worker API mode by default (KT-32832) 2019-10-24 21:33:02 +09:00
Ivan Gavrilovic
68723125f2 Clean up KAPT incremental tests
Remove redundant class to invalidate sources, because it is already
handled in the KaptContext constructor.
2019-10-24 21:33:01 +09:00
Yan Zhulanow
7fc25a9c04 Pill: Add GenerateRuntimeDescriptorTests to the "Generate all tests" run configuration (KT-34494) 2019-10-24 21:33:01 +09:00
Yan Zhulanow
2cb055a3bd Debugger: Log evaluation status from Java contexts
IntelliJ doesn't call KotlinDebuggerEvaluator from Java contexts; instead, it calls JavaDebuggerEvaluator.
Unfortunately, there seems to be no way to figure out the exact evaluation type for Java contexts. However, we can at least log the evaluation status itself.
2019-10-24 21:33:01 +09:00
Yan Zhulanow
6bf15b6d37 Kapt: Generate constant value initializers for mutable properties (KT-30164, KT-29355) 2019-10-24 21:33:01 +09:00
Yan Zhulanow
9edd4554a9 Kapt: Support @Deprecated annotations (KT-30368) 2019-10-24 21:33:01 +09:00
Yan Zhulanow
1309c0c67a An attempt to fix flaky debugger tests 2019-10-24 21:33:01 +09:00
Yan Zhulanow
bf027fb824 Do not show Smart Step Into targets for @InlineOnly callables (KT-33728) 2019-10-24 21:33:00 +09:00
Yan Zhulanow
ff7f1c62a9 Minor: Refactor KotlinMethodStepTarget a bit 2019-10-24 21:33:00 +09:00
Yan Zhulanow
87e0a2d98c Debugger: Fix evaluation of function declarations with expression bodies (KT-32704)
Before this commit, the substituted FunctionDescriptor didn't have a source element.
As a result, 'CodeFragmentParameterAnalyzer.isCodeFragmentDeclaration' failed to recognize such a descriptor as fragment-local, and it was erroneously captured.
2019-10-24 21:33:00 +09:00
Yan Zhulanow
fa45122c6b Minor: Fix warnings in KtCodeFragment 2019-10-24 21:33:00 +09:00
Yan Zhulanow
716c9f79f7 Debugger: Do not use expression code fragments for evaluator (KT-32736, KT-32741)
It seems like it doesn't make much sense to create expression code fragments.
People type statements or several expressions separated with a semicolon to a single-line expression line.
That is exactly what block code fragment was designed for.
2019-10-24 21:33:00 +09:00
Yan Zhulanow
39662c09e9 Debugger: Fix breakpoints and stepping on a first line (KT-33304)
This commit fixes the 'SmartStepIntoTestGenerated#testFunWithExpressionBody' test.
2019-10-24 21:32:59 +09:00
Yan Zhulanow
c3e46ebe5c Debugger: Search candidates for smart step into in a read action 2019-10-24 21:32:59 +09:00
Yan Zhulanow
9cc7ff0efc Debugger: Fix "smart step into" for library declarations (KT-33303) 2019-10-24 21:32:59 +09:00
Yan Zhulanow
c6a5733b3d Debugger: Move 'smart step into' classes to the 'smartStepInto' package 2019-10-24 21:32:59 +09:00
Yan Zhulanow
d2b058c1e5 Debugger: Extract Smart step visitor 2019-10-24 21:32:58 +09:00
Yan Zhulanow
8325216d38 Debugger: Fix "Step over" with inline function calls in non-functions (KT-20342) 2019-10-24 21:32:58 +09:00
Yan Zhulanow
7bd628f989 Debugger: Check max document index before figuring out line offsets 2019-10-24 21:32:58 +09:00
Yan Zhulanow
d7eb0f4bb0 Debugger: Cleanup stepping code 2019-10-24 21:32:58 +09:00
Yan Zhulanow
00a06ef9b9 Debugger: Move "Show Kotlin variables" check button to the Debugger settings menu (KT-30909) 2019-10-24 21:32:58 +09:00
Yan Zhulanow
f93549748a Fix a number of compiler/IDE warnings in IDE and kapt modules 2019-10-24 21:32:57 +09:00
Yan Zhulanow
9fb622e148 Debugger: Do not disable breakpoints on evaluation (KT-12242) 2019-10-24 21:32:57 +09:00
Ilya Goncharov
d46510897b [Gradle, JS] Refactor and extract team city formatting in separate file 2019-10-24 15:00:31 +03:00
Ilya Goncharov
7f49caf503 [Gradle, JS] Depends node test on our own mocha reporter 2019-10-24 15:00:31 +03:00
Ilya Goncharov
e69ff4363f [Gradle, JS] Copy mocha-teamcity-reporter with licensies 2019-10-24 15:00:31 +03:00
Ilya Goncharov
1ad8ecabfd [Gradle, JS] Fully copy of karma-teamcity-reporter (remove npm dependency on it) 2019-10-24 15:00:31 +03:00
Ilya Goncharov
0c911f4359 [Gradle, JS] Fix module.exports for adapter and modulization
- semicolon should be before Function expression, because in JS Standard there is no terminated semicolons
- If use output.libraryExport for Webpack, entry files for karma should export something

#KT-34554 fixed
#KT-34555 fixed
2019-10-24 14:58:57 +03:00
pyos
75aef4633a JVM_IR: add accessors for protected members in divergent hierarchies
Class B : A cannot access a protected field of A through a reference to
an instance of C : A.
2019-10-24 12:46:48 +02:00
Mikhail Glukhikh
5e2b594638 FirBodyResolveTransformerAdapters: optimize imports 2019-10-24 13:04:27 +03:00
Mikhail Glukhikh
e14b63dfe1 FIR Java enhancement: get rid of FirAnnotationCall.resolvedFqName 2019-10-24 13:04:27 +03:00
Mikhail Glukhikh
be6100527b FIR Java enhancement: fix JVM signature generation for type parameters 2019-10-24 13:04:27 +03:00
Mikhail Glukhikh
47cf7373af Add extra tests for FIR J/K type mapping 2019-10-24 13:04:26 +03:00
Mikhail Glukhikh
dc657dfda5 FIR Java refactoring: calculate JVM signatures directly by Java types 2019-10-24 13:04:26 +03:00
Vladimir Dolzhenko
6250f1a042 Detects main method with argument Array<String?> 2019-10-24 11:06:13 +02:00
Mikhail Glukhikh
cb3d027463 Fix typo in file name 2019-10-23 20:26:03 +03:00
Mikhail Glukhikh
f63c3aeac9 Extract FirMemberScopeProvider to a separate file 2019-10-23 19:28:42 +03:00
Mikhail Glukhikh
b86f529a8a Minor: add a pair of TODO about FIR scopes 2019-10-23 19:28:41 +03:00
Mikhail Glukhikh
e28d41aa61 FIR supertype resolve: decrease priority of type parameter scope 2019-10-23 19:28:41 +03:00
Mikhail Glukhikh
634f324f51 FIR supertype resolve: generate error types for type parameters 2019-10-23 19:28:40 +03:00
Mikhail Glukhikh
15a8da5f7b Rename: Fir...UseSiteScope -> Fir...UseSiteMemberScope 2019-10-23 19:28:40 +03:00
Mikhail Glukhikh
bb60a8f334 Code cleanup: get rid of FirPosition 2019-10-23 19:28:40 +03:00
Mikhail Glukhikh
374c3b4561 Cache FirSelfImportingScope and callables inside 2019-10-23 19:28:39 +03:00
Mikhail Glukhikh
f136813059 Return "lazy" kind of nested classifier scope for special cases 2019-10-23 19:28:39 +03:00
Mikhail Glukhikh
bf75274053 Organize FirClassDeclaredMemberScope & FirNestedClassifierScope in the similar way 2019-10-23 19:28:39 +03:00
Mikhail Glukhikh
17b966daaa Unify API of FirScope.processClassifiersByName (use ProcessorAction) 2019-10-23 19:28:39 +03:00
Pavel Kirpichenkov
d886d48cf0 Record resolution results for ambiguous callable references
#KT-34282 Fixed
2019-10-23 18:52:53 +03:00
Stanislav Erokhin
352a4dc836 Added extension points to the second compiler.xml
This is a workaround for KT-34528.
Extension points from 26728711
2019-10-23 18:14:35 +03:00
Igor Yakovlev
2dfe3c568d Copy refactoring update kotlin packages on target files
Fix #KT-18191
2019-10-23 16:44:18 +03:00
Igor Yakovlev
59a6f03a47 Copy refactoring refactoring 2019-10-23 16:44:18 +03:00
Vladimir Dolzhenko
072b67442f Detects main method with argument Array<String?> 2019-10-23 15:36:31 +02:00
Dmitry Gridin
474645f04f idea-core: fix compatibility of insertMembersAfter function 2019-10-23 20:10:34 +07:00
Dmitriy Novozhilov
45de26763a [FIR] Fix import broken in 93a3c232 2019-10-23 15:50:43 +03:00
Dmitriy Novozhilov
93a3c23292 [FIR] Split FirBodyResolveTransformer to separate transformers 2019-10-23 15:21:26 +03:00
Anton Bannykh
a1569dfbf0 JS IR: fix circular dependencies in Gradle tasks 2019-10-23 13:17:29 +03:00
Ilya Goncharov
651dd363e3 [Gradle, JS] Add timeout property 2019-10-23 13:04:41 +03:00
Nikolay Krasko
ebf5e4b590 Mute IncrementalJsKlibCompilerRunnerTestGenerated tests (KT-34538)
#KT-34538 Fixed
2019-10-23 12:49:49 +03:00
Nikolay Krasko
e1a5a55972 Refactoring: remove ownImports method 2019-10-23 12:49:49 +03:00
Nikolay Krasko
6d5dc6ea9a Allow to auto-generate files for asserting failures 2019-10-23 12:49:48 +03:00
Nikolay Krasko
4ed64b0283 Regenerate tests with TargetBackend.ANY remove and using runTest with this 2019-10-23 12:49:48 +03:00
Nikolay Krasko
28abfe6dfa Avoid generating irrelevant imports in test classes
Now methods can request generating additional imports.
2019-10-23 12:49:47 +03:00
Nikolay Krasko
0c5dc507e9 Allow to add additional annotations to generated classes 2019-10-23 12:49:47 +03:00
Nikolay Krasko
b885b848f4 Allow to mute test working with directories 2019-10-23 12:49:47 +03:00
Nikolay Krasko
f3e5b8c67f Allow to setup additional extension for mute with annotation 2019-10-23 12:49:47 +03:00
Nikolay Krasko
98ac2af402 Use TargetBackend.ANY as default parameter and migrate to more generic runTest method 2019-10-23 12:49:47 +03:00
Nikolay Krasko
3891f9fcaa Refactoring: extract tests files utilities to separate class 2019-10-23 12:49:47 +03:00
Nikolay Krasko
2c0ce40f75 Refactoring: extract test dummy traces 2019-10-23 12:49:47 +03:00
Nikolay Krasko
fda2022214 Refactoring: extract mutation with file logic to separate file 2019-10-23 12:49:47 +03:00
Nikolay Krasko
a9c84299c6 Allow to auto-mute tests with file 2019-10-23 12:49:46 +03:00
Nikolay Krasko
e4436c80c4 Refactoring: extract mute with file to the separate method 2019-10-23 12:49:38 +03:00
pyos
55acc296a2 JVM_IR: never create temporaries in $default stubs
Given the strict pattern-matching in the inliner, this is the only way
to make it not crash when attempting to inline these stubs. Note that
the IR backend does not currently use the inliner's default method stub
handling; the crash only occurs when a module compiled with the non-IR
JVM backend is attempting to call an inline function with default
arguments defined in a module that was compiled with the IR backend.
2019-10-23 11:11:16 +02:00
Alexander Udalov
95be7171bc JVM IR: fix "null" as the first entry in MappedEnumWhenLowering
If "null" was the first entry in an optimizable "when" over enum,
mapRuntimeEnumEntry was called before mapConstEnumEntry, and the
$WhenMappings field was not created. Now both mapConstEnumEntry and
mapRuntimeEnumEntry create this field on the first access
2019-10-23 11:03:22 +02:00
Efeturi Money
35d7bb4a26 Add support for @CompilerOptions annotation for supplying compiler
options from scripts.

#KT-34274 fixed
2019-10-23 11:37:28 +03:00
pyos
8c6916af52 JVM_IR inliner fixes: remove code that does nothing
other than randomly throw assertion errors on inline calls in synthetic
functions, which have no line number attached.

`lazySourceMapper.callSiteMarker` is set in `InlineCodegen.inlineCall`;
`IrSourceCompilerForInline.doCreateMethodNodeFromSource` does not need
to touch it.
2019-10-22 19:29:42 +03:00
Toshiaki Kameyama
60f4ed914a "Add parameter to function" quick fix: apply for TYPE_MISMATCH error
#KT-8478 Fixed
2019-10-22 21:22:33 +07:00
Pavel Kirpichenkov
636f5da883 [Minor] Inline and drop reduntant isCallableReflectionType property 2019-10-22 14:51:04 +03:00
Pavel Kirpichenkov
02fc921eed Report diagnostics about callable reference resolution ambiguity
Found diagnostics were not reported before.
#KT-32862 In Progress
2019-10-22 13:50:59 +03:00
Pavel Kirpichenkov
138d558f6a Fix compiler exception during resolution of ambiguous callable references
Function return type can't and should not be used during overload resolution of callable references.
Since it can be DeferredType, its substitution in CS caused exception.
2019-10-22 13:20:27 +03:00
Mads Ager
8b97819c04 [JVM_IR] Support suspend functions that can be overriden.
The challenge for overridable suspend functions is that the calling
the state machine method to resume after suspension would be
virtually dispatced to the wrong method. To avoid that a static
suspend implementation method is generated which becomes the
state machine method used to resume.
2019-10-22 12:48:21 +03:00
Dmitry Petrov
eebb071ae9 KT-34509 Properly unwrap callable reference descriptor
NB there's a problem with callable references to SAM constructors,
see also KT-16789
2019-10-22 12:30:15 +03:00
Dmitry Petrov
7dde503697 KT-34500 Use correct loop parameter type in ForInArrayLoopGenerator 2019-10-22 12:23:59 +03:00
Toshiaki Kameyama
bdc04547cc "Redundant qualifier name": fix false positive with inner class as constructor parameter for outer
#KT-33123 Fixed
2019-10-22 13:44:10 +07:00
Igor Yakovlev
bc66834c3c Fix UL classes descriptors leaks
UL classes built upon descriptors and UL support classes are saving a descriptors.
This could lead to descriptors leakage so we have to eliminate any fields with descriptor references.

Fixed #KT-34337
2019-10-21 22:04:49 +03:00
Andrey Uskov
b01014982f Disable new MPP kapt paths importing test in IDEA 183 2019-10-21 21:38:52 +03:00
Andrey Uskov
0188a0923e Update Kotlin plugin in KaptImportingTests
#KT-34033 Fixed
2019-10-21 21:38:49 +03:00
Andrey Uskov
40bb48e19b Fix actualisation of common source sets when HMPP is disabled
#KT-34256 Fixed
#KT-34402 Fixed
2019-10-21 21:38:45 +03:00
pyos
847e287bd6 JVM_IR: add $assertionsDisabled when an inlined function uses it
NOTE: jvmCrossinlineLambdaDeclarationSite.kt is muted because the
inliner does not remap references to an anonymous object's parent
class after regenerating it. Unlike the JVM backend, JVM_IR uses the
top level named class' assertion status for all inner classes. (The
test used to pass because the lambda in `inline fun call` read the
`$assertionsDisabled` field of `CrossinlineLambdaContainer`, which
was not reloaded after changing the assertion status of package `test`.)
2019-10-21 21:05:18 +03:00
Leonid Startsev
e89aabbba1 Provide a diagnostic when @Serializable annotation is missing on enum.
It is required when enum members contain some special annotations which should be recorded in descriptor.
Due to some recursive/lazy resolve problems, compiler plugin frontend can't infer @Serializable on enum automatically, therefore, we ask a user to explicitly provide it.

Also fix ir tests
2019-10-21 19:48:29 +03:00
Leonid Startsev
3c9a02e271 Associate serializers added via @UseSerializers by argument class, not type
Use class instead of type because MyType<T> and MyType<Int> are different types, therefore map lookup was failing.

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/533
2019-10-21 19:48:27 +03:00
Leonid Startsev
855a867893 Support sealed, generic and abstract polymorphic inheritors in sealed class serialization 2019-10-21 19:48:26 +03:00
Leonid Startsev
1ebc65b8e4 Sealed classes serialization 2019-10-21 19:48:26 +03:00
Leonid Startsev
72f8f2b7b5 Custom-serializable enums for IR 2019-10-21 19:48:24 +03:00
Leonid Startsev
bd8133e02c Custom-serializable enums for JS 2019-10-21 19:48:24 +03:00
Leonid Startsev
e76ab06029 Custom-serializable enums for JVM 2019-10-21 19:48:23 +03:00
Leonid Startsev
e9e7d1479a Remove redundant additional check for @Polymorphic annotation 2019-10-21 19:48:23 +03:00
Leonid Startsev
8a90b82e9b Object serialization for JVM, JS and Native 2019-10-21 19:48:22 +03:00
Toshiaki Kameyama
449c406e24 Redundant visibility modifier: do not report for public modifier that overrides protected setter visibility
#KT-33580 Fixed
2019-10-21 23:45:09 +07:00
Toshiaki Kameyama
e8effe6727 Replace with safe call: do not add redundant elvis operator
#KT-34432 Fixed
2019-10-21 23:28:19 +07:00
Vladimir Dolzhenko
fa0398ffd3 Fix readAccess in ScriptExtraImportsProviderExtension on checking isScript
#EA-214435 Fixed
2019-10-21 17:18:24 +02:00
Vladimir Dolzhenko
34e941f26f Render unresolved types in a presentable way in refactorings
#KT-34459 Fixed
2019-10-21 17:18:24 +02:00
Vladimir Dolzhenko
7ecaef377f Fix readAccess in KtFileClassProviderImpl on checking isScript
#EA-214283 Fixed
2019-10-21 17:18:23 +02:00
Vladimir Dolzhenko
30229da95a Don't render pure error types in OverrideMemberChooserObject
#KT-34379 Fixed
2019-10-21 17:18:23 +02:00
Vladimir Dolzhenko
148a6bd54d Fix read action in 'searchReferences'
#EA-209421 Fixed
2019-10-21 17:18:23 +02:00
Vladimir Dolzhenko
96198a1cd3 Report no parent KtNamedDeclaration for declaration instead of NPE in BindingContextUtils.getEnclosingDescriptor
#EA-210816 Fixed
2019-10-21 17:18:23 +02:00
Vladimir Dolzhenko
46a083cd1e Fix readAccess in ResolveSession.java on checking is a local declaration
#EA-213627 Fixed
2019-10-21 17:18:23 +02:00
Vladimir Dolzhenko
78527abad9 Fix readAccess in TargetPlatformDetector.java on checking is file a script
#EA-211576 Fixed
2019-10-21 17:18:22 +02:00
Vladimir Dolzhenko
15997bf635 Save change script configuration within a transaction
#EA-214281 Fixed
2019-10-21 17:18:22 +02:00
Vladimir Dolzhenko
625dbfa699 Fix readAccess in getModuleInfo.kt on obtaining script
#EA-211576 Fixed
2019-10-21 17:18:22 +02:00
Vladimir Dolzhenko
ba01678abb Fix readAccess in IDELightClassGenerationSupport on obtaining script
#EA-211576 Fixed
2019-10-21 17:18:05 +02:00
Vladimir Dolzhenko
10ea8abc2b Wrap file.declarations with runReadAction
#EA-209932 Fixed
2019-10-21 17:18:04 +02:00
Alexander Gorshenev
597e760fab Broght back a condition lost during a refactoring 2019-10-21 17:41:56 +03:00
Roman Artemev
2cde7f2402 [KLIB] Fix explicitlyExported mode
- Refactor deserialization pipeline
 - Fix K/N test
2019-10-21 17:41:56 +03:00
Roman Artemev
43e855150c [KLIB] Correctly restore top level property order during deserialization - Add test - Fix KT-34273 2019-10-21 17:41:56 +03:00
Roman Artemev
aecd08e562 [Psi2Ir] Fix IrText test generation 2019-10-21 17:41:55 +03:00
Ilya Goncharov
6ddc05a5a8 [Gradle, JS] Fix for wildcard npm dependency version
#KT-34460 fixed
2019-10-21 17:37:07 +03:00
Ilya Goncharov
e17b9097df [Gradle, JS] Add test on success installation of duplicated dependencies 2019-10-21 17:29:47 +03:00
Ilya Goncharov
bdd6186a07 [Gradle, JS] Resolve devDependencies and dependencies modules clash 2019-10-21 17:29:46 +03:00
Ilya Goncharov
fa647680d3 [Gradle, JS] Update npm dependencies
- Karma - provide possibility to check exit code
- Webpack - bug fixes
- Mocha - bug fixes
2019-10-21 17:28:49 +03:00
Ilya Goncharov
2cf79b7502 Check Karma exit code with disabled failOnFailingTestSuite
https://github.com/karma-runner/karma/pull/3116
2019-10-21 17:28:49 +03:00
Denis Zharkov
d902a5f304 Temporary disable assertion in bridges generation
^KT-34431 Fixed
^KT-34507 Open
2019-10-21 17:24:15 +03:00
Kristoffer Andersen
28b6913a25 JVM IR: Support parameterless main methods
This commit:

- introduces tests explicating what is and isn't considered a
  proper main method on the JVM backends.
- implements support for parameterless main methods on the JVM IR
  backend
- See KT-34338 for more tests.
2019-10-21 15:08:34 +02:00
Mads Ager
4b77db8979 Fix test to actually fail if expected exception is not thrown. 2019-10-21 15:05:32 +02:00
Mikhail Glukhikh
1a59e41224 Add JvmSymbols.String & StringBuilder for FIR mode to fix context initialization
This commit fixes in particular testFirHello
2019-10-21 16:01:35 +03:00
pyos
0c3dfca6ee JVM_IR: remove an assertion that triggers due to a frontend bug 2019-10-21 14:59:03 +02:00
Nikolay Krasko
e5cc0eec9c 193: Adjust test data for HierarchyTestGenerated tests in 193 2019-10-21 15:52:33 +03:00
Nikolay Krasko
693603db68 193: Mute join lines tests in 193 (KT-34408) 2019-10-21 15:52:33 +03:00
Nikolay Krasko
9665870118 Fix AbstractSmartStepIntoTest tests in 193 2019-10-21 15:52:33 +03:00
DmiitriiJarosh
613fbf7a5d Merge else-if intention (KT-34218)
#KT-34218 Fixed
2019-10-21 15:52:32 +03:00
Jim Sproch
383239aff6 Make useIR available from Gradle KotlinJvmOptions 2019-10-21 13:20:54 +03:00
Mads Ager
8be6a1fe8a [JVM_IR] Contain 'invokeSuspend' rewriting to the suspend function.
Do not rewrite returns in methods in nested lambda implementations.
That leads to unintended non-local returns from nested non-suspend
lambdas.
2019-10-21 13:16:57 +03:00
Ilmir Usmanov
78b9c082e7 JVM_IR: Generate 'create' for suspend lambdas with one parameter 2019-10-21 13:15:45 +03:00
Ilmir Usmanov
5eeb2958f7 JVM_IR: Support is/as SuspendFunction operators 2019-10-21 13:15:43 +03:00
Ilmir Usmanov
6f47699796 JVM_IR: Calculate correct arity of callable reference to suspend
function
2019-10-21 13:15:41 +03:00
Ilmir Usmanov
b0a0399dd0 JVM_IR: Support callable references to suspend functions 2019-10-21 13:15:39 +03:00
Ilmir Usmanov
e736b782dd JVM_IR: Support suspend lambdas with multiple parameters 2019-10-21 13:15:37 +03:00
Ilmir Usmanov
f4a7c839d3 JVM_IR: Generate as much LINENUMBER information as possible inside
suspend functions and lambdas.

Otherwise, when state-machine builder splits instructions and adds
LINENUMBER between states, the information becomes corrupted.
2019-10-21 13:15:35 +03:00
Dmitry Petrov
69a9559eac IR serialization: isExpect in proto and ser/deser 2019-10-21 13:04:59 +03:00
Dmitry Petrov
922b1e576d IR serialization: isExpect (TODO actual value in proto) 2019-10-21 13:04:59 +03:00
Dmitry Petrov
66b63c4296 JS_IR: isExpect 2019-10-21 13:04:59 +03:00
Dmitry Petrov
e87517764d JVM_IR: isExpect 2019-10-21 13:04:59 +03:00
Dmitry Petrov
6bdc9ee65b IR BE common: isExpect 2019-10-21 13:04:59 +03:00
Dmitry Petrov
1d229b6dca FIR2IR: isExpect 2019-10-21 13:04:59 +03:00
Dmitry Petrov
6532f29cc6 IR: isExpect 2019-10-21 13:04:59 +03:00
Ilya Matveev
3a234d46ed Gradle, native: Support watchOS and tvOS in CocoaPods plugin
Issue #KT-34329 fixed
2019-10-21 12:43:20 +03:00
Dmitriy Novozhilov
4df4c58a05 [FIR] Resolve type of when expression to Unit if it is not exhaustive 2019-10-21 11:59:44 +03:00
Toshiaki Kameyama
131567474a "Redundant qualifier name": fix false positive with enum constant initialized with companion object field
#KT-33526 Fixed
2019-10-21 15:55:04 +07:00
Toshiaki Kameyama
27eea882fb ChangeVisibilityFix: remove redundant property setter
#KT-33796 Fixed
2019-10-21 15:55:04 +07:00
Toshiaki Kameyama
48968c0fe2 Replace deprecated symbol usage: do not include 'Companion' in import directives when importing companion object
#KT-34078 Fixed
2019-10-21 15:55:04 +07:00
Dmitriy Novozhilov
5250421002 Regenerate tests forgotten in f19a8789 2019-10-21 10:47:15 +03:00
Dmitriy Novozhilov
b8bc449bc3 [FIR] Fix generating of redundant empty else branch in light tree fir generator 2019-10-21 10:44:30 +03:00
Ilya Chernikov
d97e497da0 Remove embeddable tests - they are causing conflicts...
between embeddable compiler contents and intellij sdk modules
To make it work, the dependencies to the intellij sdk should
be eliminated
2019-10-19 11:22:55 +03:00
Ilya Chernikov
08b77bc916 Implement tests to sam-with-receiver support in new scripting API
plus minor tests refactoring
2019-10-19 11:22:55 +03:00
Ilya Chernikov
cf3bf5a9b9 [minor] Fix files and jars pattern matching on windows 2019-10-19 11:22:54 +03:00
Igor Yakovlev
8c65a9a2aa Move AllOpen UL support to separate extension 2019-10-18 23:22:48 +03:00
Igor Yakovlev
58b8d8868a Remove fallbacking of UL (to LightClasses) by complexity checking 2019-10-18 23:22:47 +03:00
Igor Yakovlev
3f9bffcc5f Move UL compiler plugin support to separate extension point 2019-10-18 23:22:47 +03:00
Igor Yakovlev
6ce37fff95 Add UL support for AllOpen compiler plugin 2019-10-18 23:22:47 +03:00
Igor Yakovlev
558a700f51 Add UL support for ParcelableCodegenExtension compiler plugin 2019-10-18 23:22:47 +03:00
Igor Yakovlev
110a6700e4 Add UL support for NoArg compiler plugin 2019-10-18 23:22:47 +03:00
Mikhail Glukhikh
c9f6482f25 Throw exception from FIR smoke test if failure file does not exist
It's more convenient to see exception from the beginning and
not a strange message about generated .fir.fail file
2019-10-18 20:40:21 +03:00
Steven Schäfer
eb744cc9e1 JVM IR: Fix constant folding for unsigned toString 2019-10-18 17:24:53 +02:00
Steven Schäfer
c905209504 JVM IR: Lower IrStringConcatenation 2019-10-18 17:24:53 +02:00
Steven Schäfer
78b4024ccb JVM IR: Unify the handling of IrStringConcatenation and toString 2019-10-18 17:24:12 +02:00
Steven Schäfer
c2de89cb8c Minor: Make String.valueOf bytecode tests more precise 2019-10-18 17:24:12 +02:00
Steven Schäfer
64aa50a921 Add more tests for SAM wrappers 2019-10-18 17:22:58 +02:00
Steven Schäfer
c3d0a7582c JVM IR: Fix names, caching, and visibilities for SAM wrappers used in inline functions. 2019-10-18 17:22:58 +02:00
Steven Schäfer
f2e0c1a930 JVM IR: Minor fix for nullable SAM wrappers 2019-10-18 17:22:58 +02:00
Dmitriy Novozhilov
4d43c13fb1 [FIR] Add logging to artifact in ModularizedTest for old frontend 2019-10-18 18:21:36 +03:00
Steven Schäfer
f2d01aeabd Update serialization IR bytecode listing test 2019-10-18 17:20:22 +02:00
Steven Schäfer
18940ab0cb JVM IR: Refactor SyntheticAccessorLowering to use a single traversal 2019-10-18 17:20:22 +02:00
Steven Schäfer
3098723406 Minor: Fix outdated test 2019-10-18 17:20:22 +02:00
Steven Schäfer
3db3f5bf7f JVM IR: Don't compute signatures in CallableReferenceLowering 2019-10-18 17:20:22 +02:00
Steven Schäfer
417c570243 IR: Fix InnerClassConstructorCallsLowering
Prevent repeated passes over nested functions.
2019-10-18 17:20:22 +02:00
Steven Schäfer
a8730eae62 Minor: Fix error message in reflection.jvm 2019-10-18 17:20:22 +02:00
Steven Schäfer
21af7dfbe1 Add tests for constructors taking inline class arguments 2019-10-18 17:20:22 +02:00
Steven Schäfer
9389d88232 JVM IR: Hide constructors with inline class parameters 2019-10-18 17:20:22 +02:00
Steven Schäfer
bdd5705a30 JVM IR: Fix test for anonymous object constructors in FunctionCodegen 2019-10-18 17:20:22 +02:00
Roman Golyshev
6560ecc82b KT-15286: Provide object member extensions in the completion
- Add extensions only when completion of static members is enabled (double ctrl + space and nonempty prefix)
- Add full import for callables with receiver in `LookupElement.decorateAsStaticMember`
2019-10-18 17:17:28 +03:00
Toshiaki Kameyama
15613afa20 Control flow with empty body: do not report 'if' with comments
#KT-34325 Fixed
2019-10-18 21:07:52 +07:00
Dmitriy Novozhilov
615d3aafef [FIR] Automatically generated abstract classes instead of interfaces if possible 2019-10-18 16:45:14 +03:00
pyos
6b48112a2b IR: deserialize backing field annotations
Probably going to be necessary for handling imported @JvmField
annotated declarations.
2019-10-18 16:43:53 +03:00
Dmitriy Novozhilov
ecf98d3141 Regenerate tests forgotten in f19a8789 2019-10-18 16:03:41 +03:00
Toshiaki Kameyama
74970ddfeb Introduce "Unused unary operator" inspection
#KT-12073 Fixed
2019-10-18 18:50:53 +07:00
Jordan Demeulenaere
158f7f1cd7 Avoid PsiFile searching when resolving imported scripts descriptors. 2019-10-18 13:17:28 +03:00
Mikhail Glukhikh
91a58fffb8 Add CLI test for K/javac project with non-transitive dependency, KT-33932 2019-10-18 12:29:05 +03:00
Mikhail Glukhikh
87e2f9d96b Add CLI test for K/javac project with K/J interdependency
Yet this test fails if JavacWrapper does not add Kotlin output dir to classpath
2019-10-18 12:02:04 +03:00
Mikhail Glukhikh
9f3d834b2a JavacWrapper: optimize building of tree-based stuff 2019-10-18 11:56:18 +03:00
Mikhail Glukhikh
39ff04e043 JavacWrapper: optimize toJavacList away 2019-10-18 11:55:59 +03:00
Georgy Bronnikov
7f32f43a48 Pass isIR flag from KotlinToJVMBytecodeCompiler to GenerationState 2019-10-17 16:44:20 +03:00
pyos
d1f25d1c26 JVM_IR: discard results of nonexhaustive whens' branches 2019-10-17 15:41:42 +02:00
Dmitriy Novozhilov
cfa9950c22 [FIR] Fix building CFG and resolving when expression without branches 2019-10-17 16:20:59 +03:00
Dmitriy Novozhilov
f8f2d8b9a1 [FIR] Add FirAbstractElement as base type for all fir node implementations 2019-10-17 16:20:59 +03:00
Dmitriy Novozhilov
f19a878948 [FIR] Add exhaustive checker for when expressions
Also remove generating default else branch introduced in 38fa0122 and 54eb4cf9
2019-10-17 16:20:59 +03:00
Dmitriy Novozhilov
25e853606e [FIR] Add deserialization of inheritors of sealed classes 2019-10-17 16:20:59 +03:00
Dmitriy Novozhilov
3dc49ab1d4 [FIR] Add resolve phase for resolving inheritors of sealed classes 2019-10-17 16:20:59 +03:00
Dmitriy Novozhilov
59fd47bfd0 [FIR] Add special node for sealed classes 2019-10-17 16:20:59 +03:00
Dmitriy Novozhilov
d0089c6747 [FIR] Add flag that enables fir dump in modularized test 2019-10-17 16:20:58 +03:00
Dmitriy Novozhilov
2ec305b34e [FIR] Don't generate replace and transform in implementations with kind = Interface 2019-10-17 16:20:58 +03:00
Dmitriy Novozhilov
f86f582922 [FIR] Automatically make field mutable if it has replace function 2019-10-17 16:20:58 +03:00
Dmitriy Novozhilov
89fc17da41 [FIR] Allow generate boolean fields with replace 2019-10-17 16:20:58 +03:00
Dmitriy Novozhilov
2c2a1cdfe8 [FIR] Fix smartcasts in when expressions with this subject
Also get rid of excess `getOrCreateRealVariable` function.
2019-10-17 16:20:58 +03:00
Kirill Shmakov
739340a57d Rename cidr-native -> common-cidr-native
Modules in :kotlin-ultimate:ide
2019-10-17 14:15:43 +03:00
Mikhael Bogdanov
c78dbaf6b3 Initializer default values in 'tailrec' method in proper order
#KT-31540 Fixed
2019-10-17 13:06:36 +02:00
Mikhael Bogdanov
077092d619 Convert TailRecursionCodegen.java to Kotlin 2019-10-17 13:06:35 +02:00
Mikhael Bogdanov
2eda7cb4b0 Rename .java to .kt 2019-10-17 13:06:34 +02:00
Mikhail Glukhikh
b3d8f2d677 Introduce AbstractFirUseSiteScope and store common J/K code there 2019-10-17 13:39:33 +03:00
Mikhail Glukhikh
fb22a31976 JavaClassUseSiteScope is made not-provider based
Before this commit, Java use-site scope was provider based for some reason.
In fact, provider was not used in this scope anyway,
so this can be safely removed
2019-10-17 13:39:33 +03:00
Mikhail Glukhikh
79c0a69219 Add new FIR tests related to KT-31508 problems, replace failing MM testJava...Signature 2019-10-17 13:39:32 +03:00
pyos
27094d0371 JVM_IR: fix synthetic accessor generation (again)
Turns out private inline functions *can* be called from other classes.
2019-10-17 12:38:19 +02:00
Toshiaki Kameyama
89180e2650 Redundant companion reference: fix false positive with Java synthetic property
#KT-33771 Fixed
2019-10-17 17:17:44 +07:00
Toshiaki Kameyama
d72e55d1b7 Add "Make private and overrides member" quick fix for ACCIDENTAL_OVERRIDE
#KT-18536 Fixed
2019-10-17 17:08:03 +07:00
Vladimir Dolzhenko
30b98aaeb7 Keep attachments of cause exception in KotlinExceptionWithAttachments and provide elements in attachments in case of errors during kotlin idea resolution
Relates to EA-210942, EA-209622 etc
2019-10-17 10:22:32 +02:00
Nikolay Krasko
39f4a95278 Remove unregisterComponentByInstance usages that fails in 193 2019-10-17 11:19:13 +03:00
Nikolay Krasko
a743835011 193: Fix compilation because method replace in 193 2019-10-17 11:19:13 +03:00
Nikolay Krasko
8d355f7003 Advance 193 version to 193.4697-EAP-CANDIDATE-SNAPSHOT 2019-10-17 11:19:13 +03:00
Nikolay Krasko
db913e519f Avoid using specific version because they may differ in different platforms 2019-10-17 11:19:13 +03:00
Nikolay Krasko
da9a25fd21 Minor: remove useless overrides 2019-10-17 11:19:13 +03:00
Dmitry Gridin
92bfb2788e idea: cleanup "Remove redundant qualifier name" 2019-10-17 14:30:25 +07:00
Dmitry Gridin
696b832a9c RemoveRedundantQualifierInspection: fix false positive for enum/object
#KT-34113 Fixed
#KT-32965 Fixed
#KT-33991 Fixed
#KT-33597 Fixed
2019-10-17 14:30:25 +07:00
Toshiaki Kameyama
a4f805ccd0 "Redundant qualifier name": add tests for enum/object
Relates to #KT-34113
Relates to #KT-32965
Relates to #KT-33991
Relates to #KT-33597
2019-10-17 14:30:25 +07:00
Andrey Uskov
866ab51ce5 Work-around for importing intermediate android source sets
Fixed failure on import fully actualized intermediate source sets with K2Metadata compiler arguments (Android plugin expects compiler arguments of another type)
2019-10-17 10:26:36 +03:00
Andrey Uskov
aa6ff4b9da Fix creation of common source roots if android plugin is involved
#KT-34237 Fixed
2019-10-17 10:26:28 +03:00
Andrey Uskov
a60cbef5d2 Do not build metadata dependency tree for platform source sets 2019-10-17 10:26:24 +03:00
Andrey Uskov
74f4a1357f Do not create deep copy for MPP project is model is not a proxy 2019-10-17 10:26:22 +03:00
Andrey Uskov
f567df283e Improved performance non-MPP projects import
#KT-32960 Fixed
2019-10-17 10:26:20 +03:00
Stanislav Erokhin
84aff5f630 Add some changes to introduced extension points 2019-10-17 04:41:29 +03:00
Jim
267287118b Frontend plugins to upstream
Change-Id: Id9203c92d0a711e4f21565bd225a465bd41db476
2019-10-17 04:41:27 +03:00
Steven Schäfer
4878c7967a JVM: Handle inline class equality in when statement with declaration
#KT-34268 Fixed
2019-10-16 19:23:49 +02:00
Ilya Gorbunov
bbdbc2896b Workaround in FloatMathTest.powers to avoid failures with js-ir runtime
Include kotlin-stdlib-js-ir in local core libs build/test and
enable failing build on test failures.

Relates to: KT-24975
2019-10-16 17:48:47 +03:00
Alexander Udalov
65c09a5e57 Minor, use experimental unsigned types in CityHash
This fixes 233 experimental usage API warnings
2019-10-16 15:00:31 +02:00
Alexander Udalov
d0b241b681 Minor, fix typo in -include-runtime argument help
#KT-34240 Fixed
2019-10-16 15:00:03 +02:00
Mikhael Bogdanov
adae629258 Report diagnostic on virtual tailrec function
#KT-18541 Fixed
2019-10-16 13:02:31 +02:00
Mads Ager
8305baa5fe [JVM_IR] Avoid unbounded recursion for recursive suspend functions.
Additionally, deal with primitive types in AddContinuationLowering.
2019-10-16 13:50:52 +03:00
Georgy Bronnikov
ed6ca7d67e JVM_IR: fix for SingletonReferencesLowering
When replacing an enum entry reference with `this`, you need to take
`this` from the function's `dispatchReceiverParameter`, not the class's
`thisReceiver`. Otherwise the code generator fails to find the reference
among accessible variables.
2019-10-16 13:19:40 +03:00
Nikolay Krasko
fa44cab9dc Extend compatibility for 193 branch to upcoming 201.* release 2019-10-16 13:03:58 +03:00
Dmitry Gridin
40c3e436d1 ShortenReferences: add test with lots of FqName with root prefix 2019-10-16 16:35:43 +07:00
Dmitry Gridin
bf7c325f43 Completion: should prefer ShortenReferences by elements instead of text range 2019-10-16 15:59:47 +07:00
Dmitry Gridin
2d43d71727 CompletionUtils: cleanup code 2019-10-16 15:59:47 +07:00
Dmitry Gridin
8161403e69 ShortenReferences: shouldn't analyze root prefix elements & should get rid of them at end
Relates to #KT-33937
2019-10-16 15:59:47 +07:00
Dmitry Gridin
aa364ea14e KotlinIntroduceImportAliasHandler: fix PIEAE 2019-10-16 15:36:20 +07:00
Dmitry Gridin
d9faaddcca delayedRequestsWaitingSet: performDelayedRefactoringRequests should commit all documents before refactoring
#KT-34365 Fixed
2019-10-16 15:36:00 +07:00
Dmitry Gridin
72eee17bff delayedRequestsWaitingSet: cleanup code 2019-10-16 15:36:00 +07:00
Ivan Gavrilovic
4e807692e5 KT-34167: Warn when incremental AP does not follow the contract
Isolating incremental AP must report exactly one originating source file.
This commit logs a warning when this constraint is violated.

Test: AnnotationProcessorDependencyCollectorTest.testIsolatingWithoutOrigin
2019-10-16 16:33:00 +09:00
Ivan Gavrilovic
8f94a71de7 KT-33617: Handle non-hierarchical URIs for incremental annotation processing
JDK9 may decide to load .java files from jar when resolving a type, even
when .class file exists in the same jar. Further on, these files will be
parsed and analyzed, which triggers the listener used by incremental
annotation processing. This commit avoids analyzing those files, and
makes sure URI passed from the compiler are such that a File instance
can be created.

Test: KaptIncrementalWithIsolatingApt.testSourcesInCompileClasspathJars
2019-10-16 16:33:00 +09:00
Ilya Gorbunov
941980c154 Cleanup FE analysis flag allowKotlinPackage
It was used to allow custom contracts when compiling stdlib
with the Kotlin 1.2 compiler. Since 1.3 compiler is used now, this
flag is no longer necessary.
2019-10-15 19:08:57 +03:00
Anton Yalyshev
1e921647fe Bump FUS Collectors versions after last changes for proper data fetching 2019-10-15 16:15:10 +03:00
Yan Zhulanow
d31f234311 Pill: Add kotlin-scripting-js module to Pill 2019-10-15 22:06:45 +09:00
Yan Zhulanow
9c88a1f807 Debugger: Fix language detection in FUS 2019-10-15 22:06:45 +09:00
Georgy Bronnikov
f3cae210f8 JVM_IR: handle type parameters in constructors for @JvmOverloads stubs 2019-10-15 14:55:18 +03:00
Ilya Goncharov
7ceb2c79b8 [Gradle, JS] Exclude output directory from conformance test 2019-10-15 14:09:28 +03:00
Ilya Goncharov
8ae43c6c36 [Gradle, JS] Add kotlin-source-map-loader' ignores to exclude in tests
- node_modules
- .gradle
2019-10-15 11:38:11 +03:00
Vladimir Dolzhenko
eb9875b6f5 Added missed kotlin-reflect to nj2k testRuntime 2019-10-15 09:33:57 +02:00
Kirill Shmakov
b76d58de54 Handle case when property is missed 2019-10-15 09:48:15 +03:00
Kirill Shmakov
02cedfde21 Make build more stable 2019-10-14 19:31:03 +03:00
Dmitry Gridin
20eb3fb492 referenceUtil: fix matchesTarget for import alias
#KT-30012 Fixed
#KT-30432 Fixed
#KT-30736 Fixed
2019-10-14 21:45:12 +07:00
Dmitry Gridin
348d2376b1 referenceUtil: cleanup code 2019-10-14 21:45:12 +07:00
Dmitry Gridin
20784d50ff CallableBuilder: fix PIEAE
#EA-214253 Fix
2019-10-14 21:45:12 +07:00
Dmitry Gridin
0ac2303fad KotlinSuppressIntentionAction: fix PIEAE
#EA-214227 Fix
2019-10-14 21:45:12 +07:00
Dmitry Gridin
e3d9f05d28 KotlinSuppressIntentionAction: cleanup code 2019-10-14 21:45:11 +07:00
Dmitry Gridin
3832924bd7 KotlinMavenPluginPhaseInspection: fix potential PIEAE 2019-10-14 21:45:11 +07:00
Dmitry Gridin
1e81f9499a KotlinMavenPluginPhaseInspection: cleanup code 2019-10-14 21:45:11 +07:00
Dmitry Gridin
a652a0f6b3 AddReifiedToTypeParameterOfFunctionFix: fix PIEAE 2019-10-14 21:45:11 +07:00
Dmitry Gridin
6898d437cf AddConstModifierFix: fix PIEAE
#EA-214417 Fixed
2019-10-14 21:45:11 +07:00
Dmitry Gridin
bce2202ea3 LetImplementInterfaceFix: fix PIEAE
#EA-214415 Fixed
2019-10-14 21:45:11 +07:00
Dmitry Gridin
859537a38d LetImplementInterfaceFix: cleanup code 2019-10-14 21:45:11 +07:00
Dmitry Gridin
2eb035aff2 generateUtil: fix PIEAE
#EA-142347 Fixed
2019-10-14 21:45:11 +07:00
Dmitry Gridin
1a8796c79a LightClassDataHolder: shouldn't catch ControlFlowException 2019-10-14 21:45:10 +07:00
Dmitry Gridin
7c1f2e8735 LightClassDataHolder: cleanup code 2019-10-14 21:45:10 +07:00
Dmitry Gridin
87ac31d957 UsageReplacementStrategy: shouldn't catch ControlFlowException 2019-10-14 21:45:10 +07:00
Dmitry Gridin
585222b4bb ScriptDefinitionsManager: shouldn't catch ControlFlowException
#EA-209928 Fixed
2019-10-14 21:45:10 +07:00
Dmitry Gridin
ee8e9a76f9 KtScratchExecutionSession: shouldn't catch ControlFlowException
#EA-210849 Fixed
2019-10-14 21:45:10 +07:00
Nikolay Krasko
79cb10a755 Patch initializing EmptySubstitutor service and fix null references
There's a cycle in service initialization and PsiSubstitutor 'clinit'
2019-10-14 16:55:25 +03:00
Vladimir Dolzhenko
c20bdd3c30 Clean up after reusing allDescriptors() from LazyJavaScope to avoid compute contributed descriptors in LazyJavaPackageScope 2019-10-14 15:49:45 +02:00
pyos
d3992826e4 JVM_IR: discard parameter annotations in anonymous object constructors 2019-10-14 14:54:44 +02:00
Mark Punzalan
78465e280f Exclude additional generated testData/out-min dir in js/js.translator.
This was causing re-indexing in IntelliJ after every time the JS tests
are run.
2019-10-14 14:51:27 +03:00
Egor Ushakov
ea7f6dbd33 EA-208866 - IAE: SafeUtilKt.safeSourceName - fixed in platform 2019-10-14 12:55:18 +03:00
Nicolay Mitropolsky
f6e0e5b80d Uast: a workaround for getting parent for KotlinUAnonymousClass
when it is used in field initialisation
2019-10-14 11:30:20 +03:00
Ilya Goncharov
cb31b42930 [Gradle, JS] Update npm versions 2019-10-14 11:20:36 +03:00
Vladimir Dolzhenko
8bba596c4e Reuse allDescriptors() from LazyJavaScope to avoid compute contributed descriptors in LazyJavaPackageScope 2019-10-14 10:13:30 +02:00
Mikhail Glukhikh
88bc6b992f Move .gitattributes for generated files from fir:resolve to fir:tree 2019-10-14 11:12:19 +03:00
Ilya Goncharov
1b929cd93e [Gradle, JS] Add args instead of full override 2019-10-14 11:09:09 +03:00
Ilya Goncharov
ee49c96650 [Gradle, JS] Set cli args for yarn install 2019-10-14 11:09:09 +03:00
Vladimir Dolzhenko
7b0646d2a5 Reuse allDescriptors() from LazyJavaScope to avoid compute contributed descriptors in LazyJavaPackageScope 2019-10-14 09:57:04 +02:00
Dmitry Gridin
a24e229d7a CreateExpectedFix: should generate expect declaration in selected module
#KT-33933 Fixed
2019-10-14 14:42:29 +07:00
Dmitry Gridin
ac3009082f QuickFixMultiModuleTest: support hierarchy MPP 2019-10-14 14:42:29 +07:00
Nikolay Krasko
728ccdee63 Don't publish computed value to other threads till post compute is finished (KT-28940)
This fixes a race condition with counting supertypes (the only client
of createLazyValueWithPostCompute left at the moment).

 #KT-28940 Fixed
2019-10-13 18:21:38 +03:00
Nikolay Krasko
4f488ddd16 Remove lazy values with dummy post compute lambdas 2019-10-13 18:21:38 +03:00
Ivan Gavrilovic
fbde7e47e9 KT-33503: Avoid analyzing module-info.class in KAPT classpath
When analyzing classpath changes for incremental KAPT, avoid
analyzing module-info.class files.

Test: ClasspathAnalyzerTest
2019-10-13 15:14:40 +09:00
Ilya Kirillov
1ec620b753 New J2K: fix SOE in inference processing for star-projection as type argument
#KT-33942 fixed
#KT-33941 fixed
2019-10-12 15:28:03 +03:00
Ilya Kirillov
b350515237 New J2K: make post-processing aware of other files which are being converted
Before post-processing was able to handle only one converting file at once
So, some conversions (like (field, getter, setter) to Kotlin property)
was not able to work when converting class hierarchy was split into
multiple files.
Also, inferring nullability for a set of files was broken

#KT-19569 fixed
#KT-34266 fixed
#KT-32518 fixed
2019-10-12 12:50:34 +03:00
Ilya Kirillov
999918d499 New J2K: add multi-file conversion tests from old j2k 2019-10-12 12:50:34 +03:00
Ilya Kirillov
f951ed9dba New J2K: introduce external code processing for new J2K
It will update usages from files not in conversion scope to a valid ones:
1. When converting (field, getter, setter) triple from Java to a Kotlin property,
   it will:
      1. Update every usage of getter/setter in Java/Kotlin code to a usage of actual property
      2. If property is used in Java directly then will add @JvmField to it
2. When converting static method or static field without getter and setter, which has Java usages then add @JvmStatic to it

#KT-34164 fixed
2019-10-12 12:50:33 +03:00
Ilya Kirillov
7535c2f249 New J2K: fix expose internal/private type errors 2019-10-12 12:50:33 +03:00
Ilya Kirillov
d0f0b9e355 New J2K: do not allow field and method declarations to be internal
For internal members new names are generated,
So, references to them from Java will be broken
2019-10-12 12:50:32 +03:00
Alexey Trilis
b30537de0e Generate Kotlin/JS stdlib dependencies via dukat 2019-10-12 01:39:25 +02:00
Mikhail Zarechenskiy
83bb07e5ac Revert "Fix performance issue for case when there are a lot of warnings in file"
This reverts commit 3d8e5c4f8e.

 Temporarily reverting this commit due to new flaky tests
2019-10-12 00:44:00 +03:00
Sergey Igushkin
c13f55f0ad Cache PropertiesProvider, read the local.properties file lazily
Issue #KT-33980 Fixed
2019-10-11 21:32:20 +03:00
Sergey Igushkin
d0604ffde8 Fix requiresVisibilityOf in the Gradle plugin (KT-34312)
* Fix adding new items (which was untested, as the logic was only tested
 by unit tests)

* Exclude the source set's dependsOn transitive closure from the
requiresVisibilityOf checks (i.e. these source sets are considered
visible)

* Fix minor issues in the `UnsatisfiedSourceSetVisibilityException`
message

* Add `requiresVisibilityOf` to integration tests

Issue #KT-34312 Fixed
2019-10-11 21:32:08 +03:00
Kirill Shmakov
d7a48e7229 Add Native Debug plugin advertising 2019-10-11 19:21:15 +03:00
Mikhail Zarechenskiy
3d8e5c4f8e Fix performance issue for case when there are a lot of warnings in file
There was a problem with `reportDiagnosticOnce` method which was
 called, for example, to report diagnostics about experimentalities. It
 was crucial for code as in the issue (KT-34204).

 The whole complexity was "count of experimental diagnostics" multiply
 "count of all diagnostics" multiply very large constant. Almost on
 each `reportDiagnosticOnce` method `readonlyView()` was called which
 in turn called computation of cache. During cache computation we were
 iterating through the all diagnostics and also were using
 KotlinSuppressCache, which is not very fast.

 #KT-34204 Fixed
2019-10-11 18:47:54 +03:00
Mikhail Zarechenskiy
71cb5e07db Minor, don't recreate Set with the same values 2019-10-11 18:47:54 +03:00
Ilya Chernikov
1f46e60153 Implement samWithReceiver support for scripts when ...
it configured from script compilation configuration
#KT-34294 fixed
2019-10-11 17:43:50 +02:00
Ilya Chernikov
2568804eaa Instruct platform code to use NIO2 always
since we're not always use jna (means that we can get warnings about missing jna libs)
and according to the IDEA team, NIO2 works well enough to rely on it
2019-10-11 17:43:49 +02:00
Ilya Chernikov
d51291b187 [minor] Fix file pattern matching test and converting paths to universal separator on calling the walking function 2019-10-11 17:43:48 +02:00
Ilya Matveev
b7f9694f3a Fat frameworks: Run tests only on MacOS 2019-10-11 18:28:19 +03:00
Ilya Matveev
919c09d849 Fat frameworks: Support for watchOS and tvOS
Issue #KT-34259 fixed
2019-10-11 18:28:18 +03:00
Ilya Matveev
37e828d4aa Gradle, native: Disable watchOS x64
Currently a 64-bit simulator for watchOS is not available so
we disable this target.
2019-10-11 18:28:18 +03:00
Ilya Matveev
02504767aa Fat frameworks: Add tests 2019-10-11 18:28:18 +03:00
Ilya Matveev
57b111cbe8 Fat frameworks: Don't add simulators into CFBundleSupportedPlatforms
Issue #KT-32223 fixed
2019-10-11 18:28:18 +03:00
Ilya Goncharov
d978f9671e [Gradle, JS] Not consider mocha default arguments
#KT-33747 fixed
2019-10-11 17:51:02 +03:00
Ilya Goncharov
1fad109fc1 [Gradle, JS] Deprecate useNodeJs for compatibility 2019-10-11 17:51:02 +03:00
Ilya Goncharov
5957bda40c [Gradle, JS] Remove redundant NodeJs runner 2019-10-11 17:51:02 +03:00
Ilya Goncharov
7cde993b43 [Gradle, JS] Detect adapter automatically, not depends on JasmineLike 2019-10-11 17:51:02 +03:00
Ilya Goncharov
55fb9be7f6 [Gradle, JS] Remove copypaste for karma and nodejs test adapters 2019-10-11 17:51:02 +03:00
Ilya Goncharov
cb096db6be [Gradle, JS] useMocha by default 2019-10-11 17:51:02 +03:00
Ilya Goncharov
5c3c196f8e [Gradle, JS] Return result of testing function
- It is useful for async testing (Promise returning)
2019-10-11 17:51:02 +03:00
Ilya Goncharov
3b29112885 [Gradle, JS] Remove redundant related with JS test run 2019-10-11 17:51:02 +03:00
Ilya Goncharov
287351a4c2 [Gradle, JS] Only one sender of team city stdOut messages
- NodeJS and Browser tests should use one code to send TeamCity messages
2019-10-11 17:51:02 +03:00
Ilya Goncharov
a4c761aa33 Use team city messages for mocha test output 2019-10-11 17:51:02 +03:00
Ilya Goncharov
07e4b1f3de Migrate filtering adapter on mocha's initial adapter 2019-10-11 17:51:02 +03:00
Ilya Matveev
9ab2b928bc Gradle, native: Add a DSL shortcut for iOS, watchsOS and tvOS
This patch adds a group of shortcut DSL methods allowing a user to
create simulator and device targets for Apple platforms along with
corresponding common source set(s) in one command. iOS, tvOS and
watchOS targets are supported.

Issue #KT-33856 fixed
2019-10-11 17:40:57 +03:00
Ilya Matveev
912690517f Update K/N version: 1.3.60-eap-12915 2019-10-11 17:40:56 +03:00
Alexander Gorshenev
f18a3f7fa9 Several more librry resolver tweaks.
Made library builder a member function.
Moved resolverByName() back to Native for now
2019-10-11 17:02:06 +03:00
Alexander Gorshenev
55805ddeb8 JS search path resolver with attributes.
Warn on inclusion of klibs with the same name in manifest
2019-10-11 17:02:06 +03:00
pyos
bc4be53569 JVM: generate $assertionsDisabled before inlining the node
This fixes the problem where compiling a class initializer that contains
a call to an `assert`ing function in a separate module causes the
assertion to always be enabled (i.e. the attached test used to fail in
CompileKotlinAgainstInlineKotlin mode).
2019-10-11 14:54:52 +03:00
Leonid Startsev
d8ad0ec43a Do not add synthetic deserialization constructor if .deserialize method is customized
Otherwise, there was an added descriptor without generated IR on Native
2019-10-11 14:24:51 +03:00
Leonid Startsev
1ed4930a2e Fix failing tests after 395d595b 2019-10-11 14:24:51 +03:00
Nikolay Krasko
93c91862f1 Fix debugger tests compilation in 193 after the big refactoring 2019-10-11 14:06:47 +03:00
Anton Bannykh
82e8bcfca9 Proto: update the workaround which reduces memory allocations 2019-10-11 13:58:22 +03:00
Georgy Bronnikov
1abdcf3f57 JVM_IR: support function references with default parameters 2019-10-11 13:30:30 +03:00
Natalia Selezneva
1a7f1dff10 Simplify scratch test without runtime to avoid exception form resolver
Create an issue that caused failure of the original test
^KT-34233
2019-10-11 12:33:17 +03:00
Natalia Selezneva
768200266a Add idea-android module to dependencies of scripting-support because it is needed for tests 2019-10-11 12:31:42 +03:00
Ilya Goncharov
18b287def5 Fix license information for js modules 2019-10-11 12:23:20 +03:00
Dmitriy Novozhilov
29cda7cb24 [FIR] Always use LF line endings in generated fir tree 2019-10-11 10:27:23 +03:00
Dmitriy Novozhilov
8e4e7c4a11 [FIR] Configure IC for fir tree generation task 2019-10-11 10:27:23 +03:00
Ilya Chernikov
9bf46cf435 Fix filename pattern building under Windows 2019-10-11 08:13:05 +02:00
Dmitriy Novozhilov
dc1874af3c [FIR] Add empty line at the end of generated fir tree files 2019-10-10 20:45:21 +03:00
Vladimir Dolzhenko
e9894fb35a Fixed errors reporting in tearDown in performance tests 2019-10-10 18:01:07 +02:00
Ilya Chernikov
8b750bfdc7 Add a property for resolving via classloader in JSR-223 2019-10-10 17:43:31 +02:00
Ilya Chernikov
54caf4bf16 Add resolving from classloader to REPL pipeline 2019-10-10 17:43:30 +02:00
Ilya Chernikov
2219b950f1 Implement resolve top-level functions and props from classloader
#KT-33892 fixed
2019-10-10 17:43:29 +02:00
Ilya Chernikov
7b93970ce2 Use default scripting host configuration if not provided 2019-10-10 17:43:27 +02:00
Dmitriy Novozhilov
0c27b863b0 [FIR] Add Readme for tree generator 2019-10-10 17:53:31 +03:00
Dmitriy Novozhilov
b8a8a5575b [FIR] Move default visitors from separate sourceset 2019-10-10 17:53:30 +03:00
Dmitriy Novozhilov
a8192dba90 [FIR] Remove old visitor generator and configure gradle task for tree generator 2019-10-10 17:53:30 +03:00
Dmitriy Novozhilov
cb981919f9 [FIR] Replace FIR tree with generated implementation 2019-10-10 17:53:30 +03:00
Dmitriy Novozhilov
d6d4b3329b [FIR] Add FIR tree generator 2019-10-10 17:53:29 +03:00
pyos
807050b159 JVM_IR: generate SMAPs for classes local to inline lambdas...
...if they are declared inside inline functions.
2019-10-10 14:54:13 +02:00
pyos
301e3d27fd JVM_IR: "fix" reified type parameter scope check
where "fix" means "work around a bug that is much harder to fix". When
lambdas are extracted into the nearest class, captured type parameters
are not transformed into type parameters of the new method; because of
this, to check whether a reified type parameter is captured by a method
we need to check the outermost named function, not the current function.
2019-10-10 14:54:13 +02:00
Georgy Bronnikov
c70b2e3e4b JVM_IR: specify correct type for defaultConstructorMarker arguments 2019-10-10 14:07:43 +03:00
Roman Artemev
6f2768e774 [JS SCRIPT] Use new dependency resolver in script/js subsytem 2019-10-10 12:52:06 +03:00
Roman Artemev
c0f279811e [JS SCRIPT] refactor js script infrastructure
- Implement proper script compiler proxy to correctly handle script and its closed-world dependencies
 - Clean up zoo of JsScriptCompilers
2019-10-10 12:52:06 +03:00
Vitaliy.Tikhonov
f59e393e37 [CLI] add support running scripts in js compiler, extract common code with jvm part 2019-10-10 12:52:06 +03:00
Vitaliy.Tikhonov
50c08b25d3 [SCRIPTING] create extension for scripting in JS and extract common code with JVM part 2019-10-10 12:52:06 +03:00
Vitaliy.Tikhonov
c6c3d2de9e [JS SCRIPTING] create tests for repl 2019-10-10 12:52:06 +03:00
Vitaliy.Tikhonov
62885ba497 [JS SCRIPTING] create compilers for scripting 2019-10-10 12:52:06 +03:00
Vitaliy.Tikhonov
9b4d92cc07 [JS SCRIPTING] create evaluators for repl and scripting 2019-10-10 12:52:05 +03:00
Vitaliy.Tikhonov
24cfd0e88c [IR JS BE] update NameTables for working with repl 2019-10-10 12:52:05 +03:00
Vitaliy.Tikhonov
184ae2fa43 [IR JS BE] create lowering for scripts 2019-10-10 12:52:05 +03:00
Vitaliy.Tikhonov
240abdb750 [JS IR BE] update current lowerings for IrScript 2019-10-10 12:52:05 +03:00
Vitaliy.Tikhonov
d79279d8a5 [JS SCRIPTING] create CoreCompiler for scripting 2019-10-10 12:52:05 +03:00
Vitaliy.Tikhonov
cf5a1615ea [IR] add JsTextTest for IrScript 2019-10-10 12:52:05 +03:00
Vitaliy.Tikhonov
209a20153e [Psi2IR] support IrScript 2019-10-10 12:52:05 +03:00
Vitaliy.Tikhonov
14510c1da3 [IR] create IrScript, infrastructure for it and update visitors 2019-10-10 12:52:05 +03:00
Vitaliy.Tikhonov
f13e05de7d [JS SCRIPTING] moved the javascript engines to a separate module 2019-10-10 12:52:05 +03:00
Ilya Goncharov
bf0b4f6878 Commonization of condition for linking node packages 2019-10-10 11:58:18 +03:00
Ilya Goncharov
bcbc408892 Remove NpmSimpleLinker
- Now only Yarn is responsible to link modules
2019-10-10 11:58:18 +03:00
Mads Ager
92cf521e11 [IR] Deal with forward references in default argument lambdas.
Rely on the frontend weeding out cases that are not supported.

In psi2ir, introduce all the parameters before processing default
values.

Change the DefaultArgumentStubGenerator to generate code that
matches the behavior of the current backend.
2019-10-10 09:00:51 +02:00
Abduqodiri Qurbonzoda
834eeb567b Alter componentN documentation 2019-10-10 05:08:44 +03:00
Abduqodiri Qurbonzoda
e54b405fe4 Fix Iterable, Sequence and String index overflow in windowed 2019-10-09 19:48:39 +03:00
Pavel Kirpichenkov
42740c8b97 Fix capturing of outer type parameters for classes declared inside init block 2019-10-09 16:01:46 +03:00
Vladimir Dolzhenko
5e1efead9a Fixed errors reporting in tearDown in performance tests 2019-10-09 13:39:13 +02:00
Leonid Startsev
395d595b22 Supply JVM and JS platforms when compile from CLI
To be able to check descriptor's platform in frontend during plugin processing.

This is needed for serialization plugin because some synthesized descriptors (annotation interface implementation) must be JVM-only (or the Native compilation fails).
2019-10-09 14:18:54 +03:00
Kristoffer Andersen
9d1d6a7b1f JVM IR: Do not generate DefaultImpls if it's empty. This revealed that InterfaceDelegationLowering was relying on the presence of DefaultImpls even when empty. Hence, simply dropping it from InterfaceLowering was not trivial. Moved default delegation in DefaultImpls to SuperType.DefaultImpls to InterfaceLowering. Clean up logic considerably, and document inter-phase dependencies. 2019-10-09 13:03:21 +02:00
Kristoffer Andersen
cc6252098f Add a test to reveal flaw in call delegation with default implementations in interfaces. 2019-10-09 13:03:21 +02:00
Kristoffer Andersen
5cefd4e443 JVM IR: Implement -Xjvm-default=enable 2019-10-09 13:03:21 +02:00
Ilya Goncharov
48e2e1f0c1 Remain only license files 2019-10-09 13:52:51 +03:00
Roman Artemev
e738534bef [KLIB] Promote Konan ABI Version 2019-10-09 13:23:19 +03:00
Roman Artemev
d5176cbf5d [IR SERIALIZATION] Get rid of UniqId proto message
- encode locality flag in major bit of uniqid (1 - global, 0 - local)
2019-10-09 13:23:18 +03:00
Roman Artemev
fcae5873d0 [IR SERIALIZATION] Get rid of Annotations message 2019-10-09 13:23:18 +03:00
Roman Artemev
aeafaf78f1 [IR SERIALIZATION] Replace DescriptorReference boolean fields with single flag in proto 2019-10-09 13:23:13 +03:00
Roman Artemev
105fc4b0ca [IR SERIALIZATION] Get rid of FqName 2019-10-09 13:06:01 +03:00
Roman Artemev
9fa89bf7e2 [IR SERIALIZATION] Get rid of IrDataIndex 2019-10-09 13:06:01 +03:00
Ilya Goncharov
8c2ae4f91a Migrate on copyfiles 2019-10-09 12:57:26 +03:00
Ilya Goncharov
896271cd87 Add similarity with kotlin-test-js-runner 2019-10-09 12:57:26 +03:00
Natalia Selezneva
1bb6a7cc91 Remove fir tests from idea <= 183
Broken at 17dcdb59de
2019-10-09 11:17:13 +03:00
Pavel Kirpichenkov
9bcee2cc74 Minor: fix typo in diagnostic message 2019-10-09 10:53:12 +03:00
Vladimir Dolzhenko
55548d9199 Use test path relative to testDataPath in fixture.configureByFile to be complaint with 193, part 3 2019-10-09 07:34:25 +02:00
nikita.movshin
b3392c792b Add changelog for 1.3.50 2019-10-08 20:36:38 +03:00
Abduqodiri Qurbonzoda
b4d580fa91 JS: document array destructuring behavior (KT-17544) 2019-10-08 19:24:31 +03:00
Mads Ager
f9d117970a [JVM_IR] Map suspend lambdas to original function for inlining. 2019-10-08 19:21:37 +03:00
Ilya Goncharov
8ef28446cc Remove webpack protocol for processing stacktrace 2019-10-08 18:51:40 +03:00
Ilya Goncharov
f4ba132327 Simplify progress procentage 2019-10-08 18:51:40 +03:00
Ilya Goncharov
7e5c51e6aa Windows source-map-loading with absolute paths 2019-10-08 18:51:40 +03:00
Alexey Kudravtsev
9c1e59c720 Use ReentrantLock instead of ReadWriteLock as a more cheaper alternative more suitable to usage pattern 2019-10-08 18:20:05 +03:00
pyos
b6a1154672 Add a test for non-null assertions in local classes/functions 2019-10-08 17:19:41 +02:00
pyos
06c00f4d9e Unmute some JVM_IR inlining tests 2019-10-08 17:19:41 +02:00
pyos
a0edf2934b JVM_IR: implement isCallInsideSameModuleAsDeclared 2019-10-08 17:19:41 +02:00
pyos
f6fe273774 JVM_IR: don't reset callSiteMarker to null after generating lambdas 2019-10-08 17:19:41 +02:00
pyos
cea69e0706 JVM_IR: do not generate redundant load+stores before inline calls 2019-10-08 17:19:41 +02:00
pyos
59408242db JVM_IR: ignore captured parameters in lambda invokeMethodDescriptor 2019-10-08 17:19:41 +02:00
pyos
a20d212908 JVM_IR: take lambda arguments from signature, not call site 2019-10-08 17:19:41 +02:00
pyos
4ea4bc1c2b JVM_IR: pass callee after fake override resolution to source inliner
Fixes NPE in:

    open class A {
        inline fun f() = 1
    }

    class B : A() {
        fun g() = f()
    }
2019-10-08 17:19:41 +02:00
pyos
07bde889b4 JVM_IR: generate more correct names for regenerated objects
and fake lambda types, too. (But those only matter for debugging.)

Also, share object name generators between methods with the same name to
avoid rewriting objects from one with objects from the other.
2019-10-08 17:19:41 +02:00
pyos
58775275e7 JVM_IR: omit nullability assertions in anonymous object constructors 2019-10-08 17:19:41 +02:00
Ilya Chernikov
37fed8bbc9 Add jvmCompilerIntegrationTest task as a subtask of compilerTest:
add embeddable compiler and client tests to it
2019-10-08 17:05:34 +02:00
Ilya Chernikov
1a8bcee86c Restore embeddable compiler smoke test
also move sources and testdata to the appropriate place
2019-10-08 17:05:33 +02:00
Ilya Chernikov
cd4cce3f9f Refactor embeddable compiler client tests:
- move from the legacy location to the project dir
- move testdata from resources to the separate folder (fixes global compileTestKotlin build)
- fix classpaths handling
2019-10-08 17:05:31 +02:00
Mikhail Glukhikh
07e067102b FIR body resolve: use one scope session per module
Gives significant (~5%) performance boost mainly due to use-site scope caching
2019-10-08 17:59:44 +03:00
Alexander Gorshenev
c2c88a9ee6 Use MessageCollector.NONE as a dummy logger collector for js library resolver 2019-10-08 16:56:29 +03:00
Alexander Gorshenev
71eb413350 Attached library resolver to messge collector 2019-10-08 16:56:29 +03:00
Alexander Gorshenev
47fba2ee4b A couple of fixes for js library resolver 2019-10-08 16:56:29 +03:00
Alexander Gorshenev
e5dbec4523 Commonized FileRegistry with SourceFileMap for klib metadata 2019-10-08 16:56:29 +03:00
Alexander Gorshenev
b7a0546634 The friend module identification has regressed recently 2019-10-08 16:56:29 +03:00
Svyatoslav Kuzmich
18d9e9b2b5 [JS] Make JsExport experimental
- JsExport was meant to be experimental from the beginning but
annotation was missing
- Add missing @SinceKotlin
2019-10-08 16:33:17 +03:00
Toshiaki Kameyama
4da7d11364 KT-30643 J2K: wrong position of TYPE_USE annotation (#2543)
New J2K: fix wrong position of TYPE_USE annotation

#KT-30643 Fixed
2019-10-08 16:21:27 +03:00
Mikhail Glukhikh
58f2348647 FIR buildJavaUseSiteScope: fix visited symbols handling 2019-10-08 16:19:55 +03:00
Mikhail Glukhikh
1e8003e9a8 Use use-site session in buildJavaUseSiteScope 2019-10-08 16:19:55 +03:00
Mikhail Glukhikh
69905ab325 Derive FirClassDeclaredMemberScopeProvider from FirSessionComponent 2019-10-08 16:19:55 +03:00
Mikhail Glukhikh
75a3d2fb97 FirClassDeclaredMemberScope: keep cache in provider but not in ScopeSession 2019-10-08 16:19:55 +03:00
Mikhail Glukhikh
dfa494a21e FIR: remove duplicate of 'wrapSubstitutionScopeIfNeed' 2019-10-08 16:19:55 +03:00
Mikhail Glukhikh
a0ed03a121 FIR: apply overload conflict resolver even for variable (due to receivers) 2019-10-08 16:19:55 +03:00
Mikhail Glukhikh
4cd8b78779 FIR: eliminate most usages of FirSession.service() and getService() 2019-10-08 16:19:54 +03:00
Mikhail Glukhikh
708d914224 FIR: don't recreate tower resolver / conflict resolver / call completer 2019-10-08 16:19:54 +03:00
Mikhail Glukhikh
9801e06eac Use .firSymbolProvider instead of service, deprecate FirSession.service 2019-10-08 16:19:54 +03:00
Mikhail Glukhikh
3fee1445b9 Set more precise type in FirQualifiedNameResolver 2019-10-08 16:19:54 +03:00
pyos
432ba62143 JVM_IR: omit annotations on outer this parameters 2019-10-08 14:41:05 +02:00
victor.petukhov
94469827ba Use new -Xinline-classes compiler flag in the corresponding IDEA intention 2019-10-08 15:17:34 +03:00
Natalia Selezneva
17dcdb59de Configuration: move scratch tests to separate module 2019-10-08 15:02:32 +03:00
Natalia Selezneva
f2f97a9991 Troubleshooting tests: check that REPL process is stopped before continue test 2019-10-08 15:02:06 +03:00
Alexander Udalov
0c939d2f86 Use correct class file version when copying anonymous objects in inliner
Generally, using state.classFileVersion would be enough because we
report an error when inlining bytecode into a class file with a lower
target version (see INLINE_FROM_HIGHER_PLATFORM). However, we take maxOf
with the original version of the class file, _just in case_ the user has
suppressed this error (for example, to workaround some other corner case
in the compiler).

 #KT-30744 Fixed
2019-10-08 13:44:40 +02:00
Louis CAD
45ab07654e Use receiver syntax for lambda execution (#2508) 2019-10-08 14:34:55 +03:00
Dmitriy Dolovov
ddc5a62e4a [Commonizer] Annotations 2019-10-08 18:27:43 +07:00
Dmitriy Dolovov
72869e848d [Commonizer] Kotlin types 2019-10-08 18:27:36 +07:00
Dmitriy Dolovov
310166443a [Commonizer] Rename Commonizer IR (CIR) entities 2019-10-08 18:27:29 +07:00
Dmitriy Dolovov
2bc0a3c9c0 Fix KNPE after calling completion in native targeted filesIssue KT-34158 Fixed 2019-10-08 18:27:23 +07:00
Vladimir Dolzhenko
cd32c06df8 Don't grab ref to DeclarationDescriptor into LookupElement, KT-33898 2019-10-08 12:48:33 +02:00
Yan Zhulanow
a4c8ccee06 kapt: Fix compilation in 'compile' running mode (KT-33800) 2019-10-08 19:13:57 +09:00
Yan Zhulanow
66758472c7 Fix EA-209316: Allow null JDI values in captured value data 2019-10-08 19:13:56 +09:00
Yan Zhulanow
d153aa87a8 Fix EA-126019: Handle 'null' PsiType as nullable Any in "Create" actions 2019-10-08 19:13:56 +09:00
Yan Zhulanow
472ec72eb9 Refactor debugger tests
1. Move tests to their own module
2. Avoid sharing the 'tinyApp' project between tests
3. Clean up option directive handling
2019-10-08 19:13:56 +09:00
Yan Zhulanow
d8d81c51d7 Move debugger test data to the new location 2019-10-08 19:13:55 +09:00
Yan Zhulanow
b4cc5703de Minor: Reformat several IDEA debugger tests 2019-10-08 19:13:53 +09:00
Yan Zhulanow
6b2b66e8e3 Run configurations: Fix compatibility with 2018.3 2019-10-08 18:17:07 +09:00
Yan Zhulanow
44b7a5cc36 Make KotlinFacetSettingsProvider.getInstance() nullable
A module may not have a KotlinFacet.
It isn't correct to throw an exception in that case.
2019-10-08 18:17:06 +09:00
Yan Zhulanow
f408c249f1 Implement class/method run configurations for MPP projects 2019-10-08 18:17:06 +09:00
Yan Zhulanow
0a8f15c745 Generify Gradle importing tests so they can be used in the Ultimate repo 2019-10-08 18:17:06 +09:00
Yan Zhulanow
82c88f9cc4 Disable alternative locations for new MPP as alternative locations aren't supported in Gradle 2019-10-08 18:17:05 +09:00
Yan Zhulanow
8f4063b36c Implement test icon provider for 'native' platform 2019-10-08 18:17:05 +09:00
Yan Zhulanow
c19d62af73 Pill: Disable Pill for benchmarks module 2019-10-08 18:17:04 +09:00
Yan Zhulanow
339ba499fb Pill: Add IDEA Ultimate run configuration 2019-10-08 18:17:04 +09:00
Nikolay Krasko
8cda36ef15 Fix IdeLightClassTestGenerated tests for idea <= 191 2019-10-08 01:04:54 +03:00
Steven Schäfer
e25a09f2f9 JVM IR: Fix local delegated properties with inline class types 2019-10-07 17:12:30 +02:00
Vyacheslav Gerasimov
24a8e1cd9c Build: Fix maven dependencies for compiler daemon and util-klib-metadata artifacts 2019-10-07 15:18:38 +02:00
pyos
cd47c11efd Generate unique parameter names in LocalDeclarationsLowering 2019-10-07 15:14:48 +02:00
Mads Ager
3b2843fe7a Introduce local variable type checker.
CheckLocalVariablesTableTests will now check the validity of
the locals table against types of locals computed based on the
bytecode.

These checks and the new destructuringInFor test act as a
regression test for the changes in
https://github.com/JetBrains/kotlin/pull/2613

These checks also caught a similar issue for destructuring
lambda parameters, where the local is introduced before the
value has been written to the local slot. This change also
fixes that.

Finally, this change fixes the asmLike tests to correctly
look up the name of parameters in the locals table.
2019-10-07 15:06:44 +02:00
Mikhael Bogdanov
13b69b730a Regenerate JS tests 2019-10-07 14:53:54 +02:00
Nikolay Krasko
080407e8e6 Separate versions for 192 and 193 plugins (KT-34191)
#KT-34191 Fixed
2019-10-07 15:00:05 +03:00
Steven Schäfer
3659b517bb Minor: Fix some test cases 2019-10-07 12:54:11 +02:00
pyos
6e9ee2a46c JVM_IR: fix const reads from other files in same module 2019-10-07 12:28:55 +02:00
Toshiaki Kameyama
eda4206428 New J2K: convert Integer.MAX_VALUE to Int.MAX_VALUE
#KT-7940 Fixed
2019-10-06 01:09:33 +03:00
Steven Schäfer
0b76f60b63 JVM IR: Handle NonInlinedConst 2019-10-05 10:52:59 +02:00
Jiaxiang Chen
e40636f6ab re-generate for debug information tests 2019-10-05 10:41:11 +02:00
Jiaxiang Chen
74e4e8b18e enable test generator to generate tests using JUnit 4 infrastructure 2019-10-05 10:41:11 +02:00
Jiaxiang Chen
2c78f1fe85 debug information test: instantiate a single thread for all tests under same test class 2019-10-05 10:41:11 +02:00
Jiaxiang Chen
0a2812f83b Add a JVM backend debug information test, this commit is for verifying
line numbers for stepping.

Running JVM instance and read stepping events from it to verify with the
test data.
2019-10-05 10:41:11 +02:00
Anton Yalyshev
f17e9ba9fe Return older android.tools.build version, as we have problems with newer one 2019-10-04 20:43:44 +03:00
Vyacheslav Gerasimov
daa25dd56a 193: Fix AbstractResolveByStubTest fixture configuration 2019-10-04 20:23:02 +03:00
Vyacheslav Gerasimov
a5d668a093 193: Fix AbstractInlineTest fixture configuration 2019-10-04 20:23:02 +03:00
Vyacheslav Gerasimov
c07833f13a 193: Fix AbstractNameSuggestionProviderTest fixture configuration 2019-10-04 20:23:02 +03:00
Vyacheslav Gerasimov
04ee38c913 193: Fix AbstractParameterInfoTest fixture configuration 2019-10-04 20:23:02 +03:00
Vyacheslav Gerasimov
1392e7574c 193: Fix AbstractKotlinGotoTest fixture configuration 2019-10-04 20:23:01 +03:00
Vyacheslav Gerasimov
98f8e0c800 193: Fix code fragment tests fixture configuration 2019-10-04 20:23:01 +03:00
Mikhail Glukhikh
f7d12efc24 Memoize absent classifier names in FIR star importing scopes 2019-10-04 19:05:15 +03:00
Mikhail Glukhikh
6d8aa69878 FIR: rename CallResolver to FirTowerResolver 2019-10-04 19:02:52 +03:00
Mikhail Glukhikh
16de3257d5 FIR abstract importing scope: return NONE when we have no top-level callables 2019-10-04 18:59:12 +03:00
Mikhail Glukhikh
7ba40ac963 Memoize absent function/property names in FirSuperTypeScope 2019-10-04 18:59:12 +03:00
Mikhail Glukhikh
840ecf1a77 Don't enter twice top-level scopes w/out particular name in FIR tower resolver 2019-10-04 18:59:11 +03:00
Mikhail Glukhikh
e276e8d9f3 Don't enter twice local scopes w/out particular name in FIR tower resolver 2019-10-04 18:59:11 +03:00
Mikhail Glukhikh
e48428d39d FIR ScopeSession: use HashMap instead of LinkedHashMap 2019-10-04 18:59:11 +03:00
Mikhail Glukhikh
813e35643c FIR resolve: fix constructor handling in qualifier scope
Constructors aren't more visited twice in regular scopes
2019-10-04 18:59:10 +03:00
Mikhail Glukhikh
26e8202771 FIR: add 'isInner' parameter to constructors
This is helpful because inner class constructors are resolved in a bit
different way (like non-static vs static)
2019-10-04 18:59:10 +03:00
Anton Bannykh
aad9cbbf01 [JS IR BE] Fix tests failing due to reduced runtime 2019-10-04 17:30:45 +03:00
Ilya Goncharov
b2fb81e9cc Temp ignore tests on missing source file
#KT-32319 fixed
2019-10-04 17:12:15 +03:00
Ilya Goncharov
6688df8f6a Fix webpack delimiter and add test on short path in stack trace 2019-10-04 17:10:13 +03:00
Ilya Goncharov
f7ba1c56e2 Source-map-loader resolves relative paths into absolute even
- Now event sources with content in source map should be resolved with absolute path
2019-10-04 17:10:13 +03:00
Ilya Goncharov
f3db846bce Add tests for source-map-loader 2019-10-04 17:10:13 +03:00
Ilya Goncharov
e8efe5407d Add patched kotlin-source-map-loader 2019-10-04 17:10:13 +03:00
Vyacheslav Gerasimov
dad9958adf 193: Fix test fixture configuration
Path to test data file should be relative to test data directory
2019-10-04 17:04:54 +03:00
Vyacheslav Gerasimov
3f1d3dab14 193: Request StubComputationTracker as component from project
Fixes assert:
com.intellij.testFramework.LoggedErrorProcessor$TestLoggerAssertionError: org.jetbrains.kotlin.asJava.builder.StubComputationTracker requested as a service, but it is a component - convert it to a service or change call to project.getComponent()
2019-10-04 17:04:54 +03:00
Anton Yalyshev
fa9125df7d Set JVM 1.8 for test source set as well #KT-34154 Fixed 2019-10-04 16:19:59 +03:00
Ilya Goncharov
d2c2128aad Fix test logging for Windows 2019-10-04 15:19:50 +03:00
Ilya Kirillov
f950a0246c New J2K: handle correctly short names which are imported by default in kotlin (like List or Result)
Kotlin default import inserter was unable to correctly insert such imports

#KT-34165 fixed
2019-10-04 15:17:35 +03:00
Ilya Kirillov
81341e3fd3 New J2K: add hack for incorrect comment parsing in J2K (KT-16845)
#KT-33825 fixed
2019-10-04 15:17:35 +03:00
Alexey Kudravtsev
008b916755 avoid unnecessary usage of private API class HighlightSession 2019-10-04 15:14:39 +03:00
pyos
354e5d86ee JVM_IR: use correct descriptor type in JvmStaticAnnotationLowering 2019-10-04 15:06:29 +03:00
Ilya Goncharov
1f5a760ac8 Add typings field for DtsResolver
#KT-33549 fixed
2019-10-04 11:57:38 +03:00
Pavel Kirpichenkov
b7e5d9faae Update annotation rendering in diagnostics
Disable annotation rendering in default type and descriptor renderers.
Preserve annotations in Android and Serialization plugins.
Update error texts in ide tests.
Nullability annotations in Java descriptors are rendered with context-dependent renderer.

#KT-20258 Fixed
2019-10-04 11:18:45 +03:00
Kirill Shmakov
2a99687a95 Advance 193 bunch to 193.4099 2019-10-04 10:47:12 +03:00
Igor Yakovlev
f1f4bc6c2a Fix IdeRegression.testImplementingMutableSet test data 2019-10-04 09:55:39 +03:00
Ilya Goncharov
58e9b756f1 Add tests for processing karma stack traces 2019-10-03 17:20:48 +03:00
Georgy Bronnikov
4b5877f3b5 JVM_IR, codegen: handle names for classes within local classes 2019-10-03 17:11:48 +03:00
Kirill Shmakov
cd251458bd Merge pull request #2647 from JetBrains/kishmakov/gd/review
Advance 193 bunch
2019-10-03 16:40:34 +03:00
Natalia Selezneva
5da75897e4 Minor: regenerate IdeLightClassTestGenerated 2019-10-03 13:52:57 +03:00
Ilya Chernikov
b8258bfc71 Drop TestCaseWithTempDir usage from scripting compiler plugin tests
fighting with flaky tests
2019-10-03 12:24:50 +02:00
Ilya Chernikov
cb5622fc8b [minor] Fix URL conversion to the file
possibly fixes the exception from https://stackoverflow.com/questions/57727150/kotlin-script-engine-with-spring-boot-self-running-war
2019-10-03 12:24:50 +02:00
Ilya Chernikov
3fec15202f [minor] fix source root creation from imported scripts:
make the usages of KotlinSourceRoot consistent everywhere
2019-10-03 12:24:50 +02:00
Svyatoslav Kuzmich
5d7f18b1b9 [JS] Support wrapped and dynamic types in typeOf 2019-10-03 13:12:46 +03:00
Nikolay Krasko
030aaee117 Mute completion tests (KT-32919) 2019-10-03 12:24:46 +03:00
Dmitry Gridin
eaa07dac17 CreateExpect: shouldn't generate expect declaration from actual function with private, lateinit or const
#KT-33930 Fixed
2019-10-03 16:00:07 +07:00
Dmitry Gridin
9da6dcf840 DescriptorRenderer: shouldn't render private modifier by default
#KT-31587 Fixed
2019-10-03 16:00:06 +07:00
Dmitry Gridin
847295bf1c CreateExpect: shouldn't generate expect declaration from actual function with default implementation from interface
#KT-32737 Fixed
2019-10-03 16:00:06 +07:00
Nikolay Krasko
e9f8693a73 as34: Mute several inspection/intention tests in as34 (KT-32856) 2019-10-03 11:56:01 +03:00
Mikhail Glukhikh
7e87357ed0 FIR2IR: fix top-level parent settings thus fixing Cli.testFirHello 2019-10-03 11:47:22 +03:00
Dmitry Gridin
1b7b546249 Tests: fix some tests in quickfix 2019-10-03 15:23:05 +07:00
Mikhail Glukhikh
f74b3e6ece SymbolBasedClassifierType: fix exception in case with not found class
This can arise with non-transitive dependencies
#KT-33932 Fixed
2019-10-03 11:16:25 +03:00
Mikhail Glukhikh
6b8f4b4b4e SymbolBasedClass: cleanup code 2019-10-03 11:16:25 +03:00
Mikhail Glukhikh
ac1b957f8d Symbol based types: cleanup code 2019-10-03 11:16:25 +03:00
Mikhail Glukhikh
4bb5fbaa4d JavacWrapper: add output directory to classpath to see Kotlin files
Without this commit, Java cannot see Kotlin in some cases

Controversial: probably javac should be able to find Kotlin files
inside its existing tabs without this directory in classpath
2019-10-03 11:16:24 +03:00
Mikhail Glukhikh
b75e630932 JavacWrapper: minor renames to make code clearer 2019-10-03 11:16:24 +03:00
Mikhail Glukhikh
0c662a5a34 JavacWrapper: remove code duplication around getVisibility 2019-10-03 11:16:24 +03:00
Mikhail Glukhikh
298a30d245 Minor: run javac-mode compileJava after destroying of generation state
Not very important but seems more logical
2019-10-03 11:16:24 +03:00
Mikhail Glukhikh
bbd8fb8b23 JavacWrapper: add support for JvmPackageName annotation
This fixes previously added testWithStdLib/streams.kt test
2019-10-03 11:16:24 +03:00
Mikhail Glukhikh
e8cf0b5d4f Add test for kotlin.streams function usage in Kotlin code
NB: does not pass in javac mode due to lack of JvmPackageName support
2019-10-03 11:16:24 +03:00
Mikhail Glukhikh
f6ff580852 Cleanup code: JavacWrapper 2019-10-03 11:16:23 +03:00
Mikhail Glukhikh
2bec60a3dd Fix potential NPE in JavacWrapper 2019-10-03 11:16:23 +03:00
Igor Yakovlev
d252e795be Remove unnecessary fallback LigthClasses from UL 2019-10-02 20:18:24 +03:00
Igor Yakovlev
d5e4227a1d Revert commit and additional workaround to diagnostics problem
Another workaround of testClassObjectCopiedFieldObject test fix

Revert "Fix testClassObjectCopiedFieldObject test"

This reverts commit 8def1f07aa.
2019-10-02 20:18:24 +03:00
Igor Yakovlev
32a8fe1ca9 Fix IdeRegression.testImplementingMutableSet test data 2019-10-02 20:18:24 +03:00
Dmitry Petrov
107ab06042 Minor: make diagnostic tests usable with IDEA & JPS 2019-10-02 17:14:48 +04:00
Dmitry Petrov
a633a33627 KT-14513 Don't generate delegated property metadata when unused
If the delegated property operators involved are inline, and delegated
property metadata parameter is not used (which is often the case, e.g.,
'lazy'), we can skip those properties in metadata generation.

NOT implemented: special case when only 'kProperty.name' is used by the
corresponding delegated property operators.

Also a sneak fix for KT-34060.
2019-10-02 17:14:48 +04:00
Dmitry Petrov
92ba298e68 KT-14513 DELEGATED_PROPERTIES -> DELEGATED_PROPERTIES_WITH_METADATA 2019-10-02 17:14:48 +04:00
Dmitry Savvinov
3989f351ff Use modules instead of files for MPP diagnostic
Using files turned to be a bad idea, because people often
use the same name for files with expects and with corresponding actuals.

This commits disambiguiates ambiguous message for
AMBIGUOUS_ACTUALS/AMBGIUOUS_EXPECTS diagnostics by using modules instead
of files

^KT-32582 Fixed
2019-10-02 16:52:40 +03:00
Dmitry Savvinov
45737e51fb Minor: let 'Renderer'-helper return more specific type
This allows to easily re-use other renderers from 'Renderer'-block
(previously, one had to declare 'ContextDependentRenderer' just to get
hold of 'RenderingContext' just to call 'render(O, RenderingContext)'
from DiagnosticParameterRenderer, which would be unused anyways)

This commit introduces more specific subtype,
'ContextIndependentParameterRenderer', which exposes 'render(O)' method
for easy re-use.

Several (ab)uses of 'ContextDependentRenderer' have been removed
2019-10-02 16:52:39 +03:00
Dmitry Savvinov
8bfd30fc69 Minor: reformat IdeRenderers.kt 2019-10-02 16:52:39 +03:00
Dmitry Savvinov
249e5da53b Add internal action to toggle analysis mode
^KT-32562 Fixed
2019-10-02 16:52:39 +03:00
Dmitry Savvinov
f7eb294b80 Configure facets depending on MPP version in tests setup 2019-10-02 16:52:39 +03:00
Dmitry Savvinov
182f5fafad Take dependsOn-graph from corresponding property for MPP.M3 2019-10-02 16:52:39 +03:00
Dmitry Savvinov
958a7d9315 Refactor MPP versioning
- Use 'null' as indicator of non-MPP version. Consequently, remove
useless 'isMpp' method, and lift all methods to extensions (to be able
to call them on nullable 'facetSettings.mppVersion')

- Change semantics of extensions to check for exact equality rather than
for "at least specified version"

- Deprecate old MPP-versioning in favour of 'facetSettings.mppVersion'
2019-10-02 16:52:39 +03:00
Dmitry Savvinov
dbd352e2ba Minor: simplify condition in KotlinFacetSettings 2019-10-02 16:52:39 +03:00
Georgy Bronnikov
e38ff8753e JVM_IR: support type parameters in @JvmOverload functions 2019-10-02 16:19:06 +03:00
Nikolay Krasko
7467c80970 Fix bunch rule 2019-10-02 15:58:44 +03:00
Nikolay Krasko
343502125b Rename ResolveInWriteActionManager -> ResolveInDispatchThreadManager 2019-10-02 15:58:44 +03:00
pyos
ea56a5e8b1 Unmute some JVM_IR inlining tests 2019-10-02 14:48:05 +02:00
pyos
6163a8cf56 IR: keep source container when making functions static 2019-10-02 14:48:05 +02:00
pyos
35a0fc40a6 Don't create redundant copies in DefaultArgumentStubGenerator 2019-10-02 14:48:05 +02:00
pyos
8bf5afbba2 JVM_IR: lift pre-super() computations out of anonymous objects 2019-10-02 14:48:05 +02:00
pyos
fa54b2cb81 JVM_IR: improve scope detection in accessor generation.
* Sometimes, there's a class after the last function in the scope
   stack: that's the local type's (non-inline) primary constructor.

 * In an inline (but not crossinline) lambda, accessors are needed
   if and only if they would be needed in the function that the
   lambda is defined in.
2019-10-02 14:48:05 +02:00
Toshiaki Kameyama
d86e87d35e Add quickfix to change object to class
#KT-33586 Fixed
2019-10-02 19:42:30 +07:00
Toshiaki Kameyama
6a329210cb Convert to anonymous object: fix wrong replacement when SAM is nested interface
#KT-33660 Fixed
2019-10-02 19:09:55 +07:00
Georgy Bronnikov
2e3428bbe7 JVM_IR: incorporate validation into jvmPhases 2019-10-02 14:56:54 +03:00
Mark Punzalan
05527fbc9a Fix all IR element duplication warnings/errors in JVM IR. 2019-10-02 14:56:54 +03:00
Toshiaki Kameyama
ac7e955d3e Change parameter type quick fix: don't use qualified name
#KT-32012 Fixed
2019-10-02 18:41:54 +07:00
Kirill Shmakov
1310796a16 Advance 193 bunch
Affected method was removed in f516dc4160
2019-10-02 13:47:10 +03:00
Roman Golyshev
c463fad3b7 KT-34000: Allow autoimport to suggest fixes in qualified expressions
- it is required to be able to autoimport extensions from objects,
not only from the top level
- use `substituteExtensionIfCallable` to handle generics for extension methods
- move finding expression receivers to the separate method, add `Receivers` value class to hold found receivers
- change `CallableDescriptor.isValidByReceiversFor` to return false
if explicit receiver is not required for the descriptor
- ^KT-34000 Fixed
2019-10-02 13:46:47 +03:00
Toshiaki Kameyama
b2d2165342 Add "Remove redundant label" quick fix for REDUNDANT_LABEL_WARNING
#KT-26431 Fixed
2019-10-02 16:40:13 +07:00
Denis Zharkov
18df5d9db0 Support mixed positioned/named arguments in AddNameToArgumentIntention
^KT-7745 Fixed
2019-10-02 11:13:15 +03:00
Denis Zharkov
e54d2c7c32 Support named arguments in their own position
^KT-7745 In Proggress
2019-10-02 11:13:15 +03:00
Natalia Selezneva
bd6481b9e8 Add support for settings.gradle.kts configuring kotlin in project (KT-34114)
^KT-34114 Fixed
2019-10-02 10:30:42 +03:00
Natalia Selezneva
fac49df177 Invoke in CompilerSettingsListeners in invokeLater
script templates that are loaded from compiler settings are subscribed on this topic.
When ScriptTemplatesFromCompilerSettingsProvider invokes KotlinCompilerSettings.getInstance, deadlock may happen if those settings aren't initialized yet.

^KT-25373
2019-10-02 10:25:18 +03:00
Steven Schäfer
217f681b6e JVM IR: Use WrappedClassDescriptor in class builder. 2019-10-02 08:29:22 +02:00
Georgy Bronnikov
be002fc417 JVM_IR: do not copy bodies when creating static functions 2019-10-01 20:52:57 +03:00
Georgy Bronnikov
4920d71d70 JVM_IR: set dispatchReceiverParameter of imported JvmStatic object methods to null 2019-10-01 20:52:56 +03:00
Mikhail Glukhikh
c7904b273f FIR: fix FirArraySetCall.acceptChildren thus fixing visitConsistencyTest 2019-10-01 18:23:06 +03:00
Ilya Goncharov
7e47be9765 Add kotlin js test runner as required dependency for Karma
#KT-34123 fixed
2019-10-01 17:49:09 +03:00
Alexander Gorshenev
e53260e27c Bumped klib ABI version 2019-10-01 17:38:57 +03:00
Alexander Gorshenev
147681f335 Fixed native PackageAccessTracker 2019-10-01 17:38:57 +03:00
Dmitriy Dolovov
df6dcd646f Fix ClassCastException in KLIB reader 2019-10-01 17:38:57 +03:00
Dmitriy Dolovov
5985c0c02b KLIB API constants clean-up 2019-10-01 17:38:57 +03:00
Dmitriy Dolovov
781c73335d Use cache everywhere where K/N KLIBs are read in IDE 2019-10-01 17:38:57 +03:00
Dmitriy Dolovov
185b10fa06 Rename module capability: "KotlinLibrary" -> "KotlinNativeLibrary" 2019-10-01 17:38:57 +03:00
Dmitriy Dolovov
0196ce7c2f IDE plugin: Add missed dependency 'util-klib-metadata' 2019-10-01 17:38:57 +03:00
Alexander Gorshenev
c227c13799 Commonizing klib metadata between native and js 2019-10-01 17:38:57 +03:00
Vyacheslav Gerasimov
f38123e78c 193: Update to 193.3793.14-EAP-SNAPSHOT 2019-10-01 17:23:47 +03:00
Georgy Bronnikov
7e9cfbc91a IR: use toLowerCaseAsciiOnly 2019-10-01 16:43:23 +03:00
Igor Yakovlev
a68090db5a Fix 191 branch build 2019-10-01 16:27:16 +03:00
Mark Punzalan
a01c53fb74 Use getPropertyGetter() in ForLoopsLowering to retrieve property
getters instead of directly retrieving the property first.

When the IR backend is used to compile the standard library, the
progression classes (in sources) are lowered, and therefore do not have
properties anymore (only fields and functions).
2019-10-01 13:34:59 +02:00
Igor Yakovlev
a19c5f944e Mute tests with new tickets to resolve it later
Muted test with next tickets:
https://youtrack.jetbrains.com/issue/KT-34105
https://youtrack.jetbrains.com/issue/KT-34106
https://youtrack.jetbrains.com/issue/KT-34107
2019-10-01 13:53:21 +03:00
Igor Yakovlev
8def1f07aa Fix testClassObjectCopiedFieldObject test
Fix of the test
PsiCheckerTestGenerated$DuplicateJvmSignature$Fields.testClassObjectCopiedFieldObject
additionally fixed the bug with blinking this test example in IDEA with UL classes enabled.

The story:
Extra diagnostics could be requested for any KtClassOrObject but for _nested_  classes result may depend on outer class members signature collecting. So the the order of outer/nested diagnostic reporting takes matter.
So for nested classes/objects we have to gen members of outer classes.
2019-10-01 13:53:21 +03:00
Igor Yakovlev
de5fb347e7 Fix SyntheticPropertyUsages tests
testJavaGetterToOrdinaryMethod_JavaGetterToOrdinaryMethod
testSyntheticPropertyUsages1_RenameGetMethod

from 192 disabled to call findReferences(elem), so overload does not worked
2019-10-01 13:53:21 +03:00
Igor Yakovlev
ca9e760379 Remove redundant analyzeWithAllCompilerChecks from NoArg plugin test 2019-10-01 13:53:20 +03:00
Igor Yakovlev
cef6b71897 Fix ultraLightClass method argument types erasure
Fix IdeRegression.testImplementingMap test
2019-10-01 13:53:20 +03:00
Igor Yakovlev
c5fc55b84c Fix exception when Enum.valueOf got an invalid argument value
#Fixed KT-30515
2019-10-01 13:53:20 +03:00
Mark Punzalan
9daea89221 Avoid duplicate IR elements in ForLoopsLowering (accidentally introduced
in #2620).
2019-10-01 12:40:50 +02:00
Vladimir Dolzhenko
3b563eaca1 Use test path relative to testDataPath in fixture.configureByFile to be complaint with 193, part 2 2019-10-01 11:39:17 +02:00
Andrey Uskov
d7a2de59ac Import: support mixing of TaskProviders and Tasks in task executors
#KT-34101 Fixed
2019-10-01 08:30:12 +03:00
Andrey Uskov
6d9be0ab5d Fix MPP import tests 2019-10-01 08:30:09 +03:00
Andrey Uskov
c0f2be478f Fix calculation of target platform for common test modules for NMPP
#KT-34070 Fixed
2019-10-01 08:30:07 +03:00
Anton Yalyshev
9af6efcb24 Return old-style DSL for Gradle versions < 5.0 2019-10-01 07:18:00 +02:00
Ilya Gorbunov
2106274fa3 Minor: fix Charset type reference in kdoc
#KT-34086 Fixed
2019-10-01 03:01:11 +03:00
Shagen Ogandzhanian
3181d02d11 Update dukat dependency to 0.0.19 2019-09-30 23:30:50 +02:00
Georgy Bronnikov
53b7766910 IR: call toLowerCase() with root locale
Preventing complexities with Turkish Iı vs. İi.
2019-09-30 22:55:19 +03:00
Denis Zharkov
f91db5f0b8 Restore correct overloads ambiguity accidentally removed in 1.3.60
This problem is only relevant when isTypeRefinementEnabled == true (HMPP projects)

Ambiguity accidentally was removed after 471134d
There, for areCallableDescriptorsEquivalent we stopped assuming
as impossible a situation of having identity-different descriptors
in the same containing declaraton that still might be considered equal

So, before 471134d we were comparing
"fun foo(x: String)" with "[substituted] fun foo(x: String)"
and areCallableDescriptorsEquivalent returned false for such case.
Thus, both overrides were left in the resulting set.

After 471134d, those two descriptors
becamed considered as equal thus having a possibility to remove any of them.

The problem is that "areCallableDescriptorsEquivalent" has kind of
unclear contract. Effectively it checks whether two descriptors match
to the same declaration.

But some of the usages expect that it also makes sure that descriptors
have the same substitution (see org.jetbrains.kotlin.resolve.calls.smartcasts.IdentifierInfo.Variable#equals)

So, the straight solution is using original descriptors for the cases
where we need to make sure that descriptors relates to actually different
declarations

^KT-34027 Fixed
2019-09-30 20:09:42 +03:00
Denis Zharkov
67410f7a57 Parametrize behavior of DescriptorEquivalenceForOverrides::areCallableDescriptorsEquivalent
The changes introduced 471134d31e are only needed
for the case of HMPP project while for other cases it might break the behavior
a bit like in KT-34027

See org.jetbrains.kotlin.resolve.calls.results.OverloadingConflictResolver#filterOutEquivalentCalls

Before 471134d we were comparing
"fun foo(x: String)" with "[substituted] fun foo(x: String)"
and areCallableDescriptorsEquivalent returned false for such case.
Thus, both overrides were left in the resulting set.

After 471134d, those two descriptors
becamed considered as equal thus having a possibility to remove any of them.

The problem is that "areCallableDescriptorsEquivalent" has kind of
unclear contract. Effectively it checks whether two descriptors match
to the same declaration

But straightforward fixing of this exact call-site (using original descriptors)
doesn't help: behavior might change in a very subtle way (see org.jetbrains.kotlin.spec.checkers.DiagnosticsTestSpecGenerated.NotLinked.Dfa.Pos#test72)

So, the main idea is changing the contract for areCallableDescriptorsEquivalent
only when project is HMPP one.

^KT-34027 In Progress
2019-09-30 20:09:42 +03:00
Ilmir Usmanov
08794d17a0 Do not box function argument if it is used in EXACTLY_ONCE lambda
Since we cannot change type of parameter, we cannot replace it with
box type.
 #KT-29510 Fixed
 #KT-29614 Fixed
 #KT-29385 Fixed
2019-09-30 17:42:17 +03:00
Ilya Goncharov
c5ba19451f Fix leading zero for percents less than 10
- To avoid status text jumping
2019-09-30 16:53:25 +03:00
Ilya Goncharov
305b6091cd Consider, that ':' can be in file path (Windows case)
#KT-31478 fixed
2019-09-30 16:53:24 +03:00
Ilya Goncharov
923ecaf6b9 Fix js quoted strings for Windows 2019-09-30 16:50:42 +03:00
Ilya Goncharov
842cbf51c9 Assign of revertMethods instead of copying 2019-09-30 16:50:42 +03:00
Ilya Goncharov
9a5f937f2d Fix progress percentage 2019-09-30 16:50:42 +03:00
Ilya Goncharov
71963de70c Move revertible methods to finally 2019-09-30 16:50:42 +03:00
Ilya Goncharov
7680c21fb6 Print parsed stack trace 2019-09-30 16:50:42 +03:00
Ilya Goncharov
e911e0acbb Only parsed stacktrace consider
- NodeJs and Karma testing logging, exception handling and source maps works consistently
2019-09-30 16:50:42 +03:00
Ilya Goncharov
2ac24efc8b Process stack trace for karma 2019-09-30 16:50:42 +03:00
Ilya Goncharov
7010c03706 Move Karma Kotlin reporter to kotlin-test-js-runner 2019-09-30 16:50:42 +03:00
Ilya Goncharov
fa4f39f5eb Use own format error for source maps processing in karma reporter 2019-09-30 16:50:42 +03:00
Ilya Goncharov
9f64c426e5 Parse stack trace for extract original sources 2019-09-30 16:50:41 +03:00
Ilya Goncharov
a5c8882ccb Format error for teamcity log reporter
- formatError contains source map processing
2019-09-30 16:50:41 +03:00
Ilya Goncharov
efe8c2fa7c Remove redundant karma-source-map-support 2019-09-30 16:50:41 +03:00
Ilya Goncharov
36d9fe5a3a Add process stack trace for failing tests 2019-09-30 16:50:41 +03:00
Ilya Goncharov
3ca3842c3f Fix format 2019-09-30 16:50:41 +03:00
Ilya Goncharov
fb97375f86 Remove redundant debug flag for karma start 2019-09-30 16:50:41 +03:00
Ilya Goncharov
b22e56e1ba Fix IE karma alias 2019-09-30 16:50:41 +03:00
Ilya Goncharov
bbe51469ee Add devtool property for webpack
- Use inline-source-map for karma-webpack
2019-09-30 16:50:41 +03:00
Sergey Rostov
4c579f5286 build.gradle.kts: collect statistics about auto reload, fix 183 as as34 2019-09-30 14:08:43 +03:00
Nikolay Krasko
552408e887 Minor: update test data for quick doc with deprecated annotation 2019-09-30 13:38:27 +03:00
Nikolay Krasko
2ec231f381 Minor: fix CompletionMultiFileHandlerTest test 2019-09-30 13:38:27 +03:00
Nikolay Krasko
751a18e64b Minor: update test data PartialBodyResolveTestGenerated 2019-09-30 13:38:26 +03:00
Natalia Selezneva
064689b6b7 Merge pull request #2467 from t-kameyama/KT-14756
KT-14756 Move statement down breaks code in argument list
2019-09-30 13:19:07 +03:00
Mikhail Zarechenskiy
932d84d568 Fix performance regression in NI by fixing totally incorrect hashCode
The actual problem was introduced in 4f1e85b468, note how `hashCode` is implemented:
```
var currentHashCode = cachedHashCode
if (currentHashCode == 0) return currentHashCode
...
```
It's a silly bug, there should be check `if (currentHashCode != 0) ...` because `0` is used a marker for "uncomputed value".

Now, in the commit 0219b86d06 I added map with `KotlinType` as a key and because of constant `hash` for `KotlinType`, we basically got `List` instead of `Map`, which caused this performance regression

 #KT-34063 Fixed
2019-09-30 10:22:30 +03:00
Mikhail Zarechenskiy
957af741cd [NI] Don't forget marker interface for type variables 2019-09-30 10:22:30 +03:00
Natalia Selezneva
66a6713577 Tests: extract scripts testdata for light classes in ide to separate test
For compiled scripts there is AbstractIdeCompiledLightClassTest
For now there is a difference in light classes constructed from source and from compiled class (missing baseClass and constructor parameter for script class)
But it doesn't affect users because calling script class from Java isn't supported yet

testData for AbstractIdeLightClassTest and AbstractIdeLightClassForScriptTest can be merged when the difference will be fixed
2019-09-30 09:47:20 +03:00
Sergey Rostov
46f8feaf98 build.gradle.kts: collect statistics about auto reload 2019-09-30 09:44:52 +03:00
Alexey Tsvetkov
6c90279694 Ensure all output roots exist after Kotlin is compiled in JPS 2019-09-30 09:03:49 +03:00
Nikolay Krasko
1804619076 Fix AmbiguousCalls test in 192 2019-09-30 00:53:03 +03:00
Nikolay Krasko
7e691a0864 Store project to avoid creating psi factory from invalid element
Fix ConvertLineCommentToBlockCommentIntention tests
2019-09-30 00:53:03 +03:00
Nikolay Krasko
057c16bf10 Allow to mute and assert special failure for generated tests 2019-09-30 00:53:03 +03:00
Nikolay Krasko
319cabcc88 Remove deprecated InjectorUtils#putInjectedFileUserData in injection (KT-33775)
#KT-33775 Fixed
2019-09-30 00:53:03 +03:00
Ilya Kirillov
f70654d16b Fix CreateTypeParameter quick fix tests
Partially reset 21429f0b94
2019-09-29 20:43:19 +03:00
Ilya Kirillov
04515eda3d Fix nj2k module compilation for 191 & 183 branches 2019-09-29 18:45:48 +03:00
Ilya Kirillov
2ace905429 Fix IndexOutOfBoundsException (EA-211554) in SerializationPluginDeclarationChecker 2019-09-29 12:27:44 +03:00
Ilya Kirillov
41fd9fff76 Minor: reformat CreateTypeParameterUnmatchedTypeArgumentActionFactory 2019-09-29 12:27:44 +03:00
Ilya Kirillov
21429f0b94 Do not try to add type parameter to non-writable declaration (EA-209570) 2019-09-29 12:27:43 +03:00
Ilya Kirillov
a24da280ca Call update for ScratchAction in EDT thread (EA-210180) 2019-09-29 12:27:43 +03:00
Ilya Kirillov
7831237aaa Minor: reformat KotlinRunConfigurationProducer 2019-09-29 12:27:43 +03:00
Ilya Kirillov
016132c762 Fix NPE in KotlinRunConfiguration & do not throw exception on unknown container type (EA-209426) 2019-09-29 12:27:43 +03:00
Ilya Kirillov
9deb7dc8d6 New J2K: do not require module to be present on converting
It may not be present when performing conversion inside repl
2019-09-29 12:13:41 +03:00
Ilya Kirillov
f77825b85a New J2K: remove RedundantCompanionReferenceInspectionBasedProcessing as it already applied on shortening references 2019-09-29 11:39:39 +03:00
Ilya Kirillov
95f69a9b58 New J2K: do not print debug info in inference tests 2019-09-29 11:39:39 +03:00
Ilya Kirillov
aaf05d5eb2 New J2K: reduce count of post-processing groups 2019-09-29 11:39:38 +03:00
Ilya Kirillov
208c4d6fc7 New J2K: move visitor generator out of src folder 2019-09-29 11:39:38 +03:00
Ilya Kirillov
41935bdd34 New J2K: separate logic in code builder to different classes 2019-09-29 11:39:37 +03:00
Ilya Kirillov
043a669812 New J2K: do not print qualified names if corresponding qualifier can unambiguously resolved
This speeds up shortening qualified references phase
2019-09-29 11:39:37 +03:00
Ilya Kirillov
678cc35008 New J2K: reuse already calculated type arguments in inference post-processing 2019-09-29 11:39:36 +03:00
Ilya Kirillov
c000f33955 New J2K: make initial generating code formatting better 2019-09-29 11:39:36 +03:00
Ilya Kirillov
f3b53a9532 New J2K: rework Java code formatting collecting
#KT-33687 fixed
2019-09-29 11:39:35 +03:00
Ilya Kirillov
37ee81dfa1 New J2K: use Java classes for instance checking instead of Kotlin ones 2019-09-29 11:39:35 +03:00
Ilya Kirillov
392a75e6b8 New J2K: use KotlinExceptionWithAttachments to report tree building errors
Also, try not to throw exceptions when possible
2019-09-29 11:39:34 +03:00
Vladimir Dolzhenko
3e2dac6586 Use test path relative to testDataPath in fixture.configureByFile to be complaint with 193 2019-09-29 09:45:42 +02:00
Vladimir Dolzhenko
7c80c6ba63 Fix performanceTests for 193 2019-09-29 09:38:27 +02:00
Ilya Gorbunov
885d99068c Test reading files with incorrectly reported length
#KT-33864
2019-09-28 19:23:26 +03:00
Ilya Gorbunov
c9dd8344d1 Do not use file length estimate in File.readText
This handles the situation when reported file length is less than actual.

#KT-33864
2019-09-28 19:20:54 +03:00
Ilya Gorbunov
fe31509044 Support File.readBytes when reported file length is less than actual
After reading 'length' bytes from a file, check if there's extra content
available and read it into a resizable buffer, then append it after
the first 'length' bytes.

#KT-33864
2019-09-28 19:20:54 +03:00
Ilya Chernikov
3220101c7b [minor] fix Gradle test broken on the build refactoring 2019-09-28 17:50:45 +02:00
Ilya Chernikov
4d19299e95 [minor] Fix scripting classpath test on windows 2019-09-27 19:44:49 +02:00
Anton Yalyshev
6fa7da57a4 It's better to get plugin version once but not in cycle 2019-09-27 20:06:53 +03:00
Anton Yalyshev
db189fa218 Remove Maven and JPS targets collectors that are unused now 2019-09-27 20:06:53 +03:00
Anton Yalyshev
d4266e1be6 Bunches for ProjectConfigurationCollector 2019-09-27 20:06:53 +03:00
Anton Yalyshev
21b7d873e7 Move build system and targets statistics collection from StartupActivity to FUS State Collector 2019-09-27 20:06:53 +03:00
Anton Bannykh
ead8379c50 JS: add -Xmetadata-only flag for JS common code modules (KT-33142 fixed) 2019-09-27 19:12:03 +03:00
Andrey Uskov
6a808ce842 Fix import tests compilation in bunch 183 2019-09-27 17:28:07 +03:00
Dmitriy Novozhilov
439e8faf94 [NI] Remove outdated intention test according to fixed consistency of OI and NI 2019-09-27 17:20:47 +03:00
Anton Bannykh
b4917ec816 JS: remove unconditional as SimpleType cast
This is a workround for a bug introduced in the typeOf
support
2019-09-27 16:55:10 +03:00
Toshiaki Kameyama
82f75c707e "Convert to range check" inspection: apply ReplaceRangeToWithUntilInspection after convertion
#KT-33880 Fixed
2019-09-27 20:33:48 +07:00
Toshiaki Kameyama
54df0aad16 Reformat ConvertTwoComparisonsToRangeCheckIntention 2019-09-27 20:33:48 +07:00
Georgy Bronnikov
6c2eb3dd16 Change expected test output 2019-09-27 16:32:15 +03:00
Anton Yalyshev
6c06c4e3fc Group Id and Version fields generation doesn't need 193 bunches. It works well with previos versions. 2019-09-27 14:58:19 +03:00
Anton Yalyshev
18cfa42930 Bump Gradle to 5.5.1 cause it contains several major fixes for 5.5 2019-09-27 14:58:19 +03:00
Anton Yalyshev
a53f66ca4e Gradle 5.5 Daemon requires -Xmx256m 2019-09-27 14:58:19 +03:00
Anton Yalyshev
ee7b583a82 Bump Gradle and Android build tools version in New Kotlin Project Templates #KT-27587 Fixed 2019-09-27 14:58:18 +03:00
Anton Yalyshev
626087a46e Use type-safe model accessors for Gradle plugin #KT-31766 Fixed 2019-09-27 14:58:18 +03:00
Anton Yalyshev
721aa81ca5 Relying on platform stepping goes better only from 2019.3 2019-09-27 14:58:18 +03:00
Anton Yalyshev
a66078f2cd Let New Gradle project or module wizard rely on platform stepping to avoid inconsistency #KT-33927 Fixed #KT-30685 Fixed #KT-28404 Fixed 2019-09-27 14:58:18 +03:00
Mark Punzalan
c16b59191b Do not cache "last" value (i.e., size/length) in lowered for-loop
iteration over CharSequences.

CharSequences may be mutable (e.g., StringBuilder) and therefore its
contents and length can change within the loop.
2019-09-27 13:44:40 +02:00
Ilya Matveev
3da3e1cae9 IDE: Add native extensions to KotlinCompilation 2019-09-27 18:06:58 +07:00
Ilya Matveev
95cbb4e8b4 IDE: Add a flag to disable native libraries propagation 2019-09-27 18:06:58 +07:00
Ilya Matveev
becdd7a5e6 Add a test for native dependency propagation 2019-09-27 18:06:57 +07:00
Ilya Matveev
701e92ace2 IDE: Propagate platform libraries to common modules for some native targets
Some native platforms (e.g. ios_arm64 and ios_x64) have almost
identical platform libraries. For such platforms we can workaround
a lack of the commonizer and resolve common sources against
libraries of one of these platforms. This patch enables this
workaround by propagating dependencies to common modules.

Issue #KT-33999 fixed
2019-09-27 18:06:56 +07:00
Ilya Matveev
6b10336497 Common iOS: Store konanTarget in KotlinNativeCompilation 2019-09-27 18:06:56 +07:00
Dmitry Gridin
c185cecb40 Completion: fix shortening of fully qualified name for case of conflicts between property and function
#KT-31902 Fixed
#KT-33937 Fixed
2019-09-27 17:52:11 +07:00
Dmitry Gridin
589094377e QualifiedExpressionResolver: change root prefix from _Qfadj4tPV to _root_ide_package_ 2019-09-27 17:52:11 +07:00
Alexander Podkhalyuzin
9a2da67919 ShortenReferences: cleanup code & add tests for property-function conflicts 2019-09-27 17:52:11 +07:00
Natalia Selezneva
917a7f572d Check that project is open before starting highlighting
This may be false when user opens Kotlin Scripting Settings, so default project is passed to ScriptDefinitionsManager
^KT-30206 Fixed
2019-09-27 12:59:43 +03:00
Natalia Selezneva
5ab119ecfb Do no try to find script definitions for default project
This may happen when user opens Kotlin Scripting Settings
^KT-32401 Fixed
2019-09-27 12:58:36 +03:00
Ilya Chernikov
1e80c03d41 Fix Extensions/Components API usage in core environment for 193+
for it the com.intellij.core.JavaCoreApplicationEnvironment has to be
copied to the compiler (named now KotlinCoreApplicationEnvironment)
and modified accordingly
2019-09-27 11:51:25 +02:00
nicolay.mitropolsky
995dda3785 Uast: support for String-identifiers 2019-09-27 12:22:07 +03:00
Andrey Uskov
a4a03aeb5c Fix compilation of KotlinMPPGradleModelBuilder 2019-09-27 12:14:43 +03:00
Andrey Uskov
ca75aeb534 Update kotlin gradle plugin version in HMPP tests 2019-09-27 12:00:08 +03:00
Andrey Uskov
ed750f4d10 Do not import orphan source sets 2019-09-27 12:00:05 +03:00
Andrey Uskov
03b58d9941 Point to module names instead of source set names in dependsOn of Facet 2019-09-27 12:00:02 +03:00
Andrey Uskov
715fad849d Importing test tasks and targets is implemented 2019-09-27 11:59:58 +03:00
Vladimir Dolzhenko
e2f9eaa483 Use async profiler for perfTests if it presents in env variable; Add kt project copy-n-paste perfTests 2019-09-27 10:33:49 +02:00
Natalia Selezneva
de369e6527 Revert "Fix testdata for IdeLightClassTestGenerated.Script after scripting API refactoring"
This reverts commit a3f4effe
2019-09-27 10:52:16 +03:00
Mikhail Glukhikh
4718ae4186 FIR: don't perform argument check for callable references
This fixes failing FIR2IR test
2019-09-27 09:23:34 +03:00
Mikhail Glukhikh
da7d5d5702 FIR: provide receiver for accessor of extension property 2019-09-27 09:22:52 +03:00
Mikhail Glukhikh
0d4ca06372 Fix FirCallableReferenceAccessImpl.transformChildren 2019-09-27 09:21:53 +03:00
Mikhail Glukhikh
11fb121458 FirProvider: search for fake overridden symbol containing file correctly 2019-09-27 09:21:02 +03:00
Mikhail Glukhikh
0438ab96e1 FIR: add a test with current top resolve problems 2019-09-27 09:20:31 +03:00
Toshiaki Kameyama
40dd229021 Join with assignment: place the result at the assignment
#KT-21172 Fixed
2019-09-27 09:16:52 +03:00
Toshiaki Kameyama
8078c5da40 Reformat JoinDeclarationAndAssignmentIntention 2019-09-27 09:16:51 +03:00
Mikhail Glukhikh
d45e83b27d Introduce subject to when: don't perform analysis in if transformation
Otherwise we get an exception about non-analysable file
Related to KT-18772
2019-09-27 09:16:50 +03:00
Toshiaki Kameyama
fdf9acfb6a Introduce subject to when: suggest for qualified, not for obj / constant
#KT-18772 Fixed
2019-09-27 08:26:52 +03:00
Dmitriy Dolovov
2cde0a800a [Commonizer] Fine-grained use of KotlinBuiltIns 2019-09-27 09:18:36 +07:00
Dmitriy Dolovov
14fa3d30d5 Turn on running Kotlin/Native-specific tests 2019-09-27 09:18:27 +07:00
Dmitriy Dolovov
25e5442a13 [Commonizer] Clean-up in facade API 2019-09-27 09:18:15 +07:00
Dmitriy Dolovov
acd146363e [Commonizer] Classifiers tests 2019-09-27 09:18:06 +07:00
Dmitriy Dolovov
1a49d88578 [Commonizer] Classifiers 2019-09-27 09:17:56 +07:00
Dmitriy Dolovov
e6b17e4bb5 [Commonizer] Internal improvements, p.2 2019-09-27 09:17:48 +07:00
Dmitriy Dolovov
81eef5152e [Commonizer] Type parameters, type parameter tests 2019-09-27 09:17:38 +07:00
Dmitriy Dolovov
7fff5407be [Commonizer] Internal improvements 2019-09-27 09:17:13 +07:00
Dmitriy Dolovov
a5e9671df2 [Commonizer] Function descriptors, function descriptor tests 2019-09-27 09:17:07 +07:00
Dmitriy Dolovov
6a20a14f6e [Commonizer] Property descriptor tests 2019-09-27 09:16:57 +07:00
Dmitriy Dolovov
7fee9d2f5a [Commonizer] Property descriptors 2019-09-27 09:16:45 +07:00
Roman Golyshev
0239229dfc KT-33903: consider imports from objects when removing descriptors duplicates
- `ImportedFromObjectCallableDescriptor` and descriptors in general do
not have consistent `equals`,  which leads to duplication in completion
when multiple functions from objects are imported, or when function is
visible in some scope both implicitly and by import (see KT33903_1.kt)
- ^KT-33903 Fixed
2019-09-26 18:23:04 +03:00
Alexander Podkhalyuzin
cdebd6bc05 Fixed testdata as Enter shouldn't override completion 2019-09-26 16:25:50 +03:00
Alexander Podkhalyuzin
66bed85176 Fixed testdata for new inference 2019-09-26 16:25:50 +03:00
Alexander Podkhalyuzin
d018489621 Fixed testdata
JS stdlib contains more classes now, so we need to filter them out
2019-09-26 16:25:50 +03:00
Dmitry Gridin
57d25fc5f5 Create actual: add type accessibility checker
#KT-28740 Fixed
2019-09-26 20:21:54 +07:00
Dmitry Gridin
fcaa897b9f Tests: extract addMissingActualMembers from multiModuleQuickFix/other 2019-09-26 20:21:54 +07:00
Dmitry Gridin
a552f06526 Create expect/actual: improve error hint message
#KT-33754 Fixed
2019-09-26 20:21:54 +07:00
Dmitry Gridin
773e4764b1 TypeAccessibilityCheckerImpl: fix incorrectTypes for KtNamedDeclaration 2019-09-26 20:21:54 +07:00
Natalia Selezneva
a3f4effe3e Fix testdata for IdeLightClassTestGenerated.Script after scripting API refactoring
Generated script class no longer has a supertype
2019-09-26 14:24:47 +03:00
Ilya Chernikov
3430a21fa1 Add test to the scripting fixes for maven plugin
tests KT-34011 and KT-34006 fixes
2019-09-26 11:46:55 +02:00
Ilya Chernikov
517e5e8954 Fix loading scripting plugin from the current classloader
previous code was completely wrong - wrong package and wrong procedure
#KT-34011 fixed
2019-09-26 11:46:55 +02:00
Ilya Chernikov
a1118ce209 Do not skip maven compilation if sources contain .kts files but no .kt files
#KT-34006 fixed
2019-09-26 11:46:55 +02:00
Ilya Chernikov
c53a805696 [minor} Refactor scripting host tests:
- move definitions into one place
- reduce script/repl compilation classpath - spedd-ups tests (~10%)
2019-09-26 07:16:24 +02:00
Ilya Chernikov
0a1aff4f80 Do not add updated script classpath to the compilation configuration
it is added via the updateClasspath call with proper duplicates control
2019-09-26 07:16:24 +02:00
Ilya Chernikov
256d3a79e4 [minor] refactor and extend script dependencies resolving tests 2019-09-26 07:16:23 +02:00
Ilya Chernikov
bda2e46697 [minor] Fix classpath from class calculation utility for classes dir 2019-09-26 07:16:23 +02:00
Svyatoslav Kuzmich
7592048437 [JS] Support typeOf 2019-09-25 18:12:55 +03:00
Vyacheslav Gerasimov
c1e1dbd83e Build: Fix usages of "java.home" for tools.jar dependency
#KT-33984
2019-09-25 17:54:18 +03:00
Abduqodiri Qurbonzoda
eae6fbad3a Document String.contentEquals overloads difference 2019-09-25 17:43:45 +03:00
Vyacheslav Gerasimov
71416f9dbf Build: Make internalKotlinRepo url independent from bootstrap 2019-09-25 15:58:49 +03:00
Vyacheslav Gerasimov
60dc52f364 Build: Use cacheRedirector flag for bootstrap 2019-09-25 15:58:49 +03:00
Vyacheslav Gerasimov
9e495f8810 Build: Use bootstraps from kotlin-bootstrap repository 2019-09-25 15:58:49 +03:00
Vyacheslav Gerasimov
1b5417e422 Minor: Build use cache-redirector for bootstrap repos 2019-09-25 15:58:49 +03:00
Vyacheslav Gerasimov
ed59741e14 Minor: Reformat 'buildSrc/src/main/kotlin/Bootstrap.kt' 2019-09-25 15:58:49 +03:00
Vyacheslav Gerasimov
b7ebe17fe0 Build: Add kotlin-bootstrap repository to bootstrap options 2019-09-25 15:58:49 +03:00
Natalia Selezneva
dd85dcc1c7 193: Do not modify registry property since the default changed in 193
Review in IDEA: IDEA-CR-51492
2019-09-25 15:54:04 +03:00
Natalia Selezneva
153339bc26 193: Remove Gradle Kotlin DSL template because they are provided by Gradle Plugin (since 193)
^IDEA-219018
2019-09-25 15:54:04 +03:00
Vladimir Dolzhenko
750a677366 Register manually IDEKotlinBinaryClassCache for AbstractLoadJavaClsStubTest.kt 2019-09-25 14:49:17 +02:00
Sergey Igushkin
ece7a3e70e Add extensions with explicit Class<*> instance for Kotlin DSL, KT-31077 2019-09-25 15:46:07 +03:00
Sergey Igushkin
3abb1b3f40 Fix lint task in Android projects depending on MPP, KT-27170 2019-09-25 15:46:06 +03:00
Sergey Igushkin
032686ebe0 Fix kapt class structure configuration not resolving MPP deps, KT-33105 2019-09-25 15:46:06 +03:00
Sergey Igushkin
3deff3b347 Fix Kapt configuration not resolving MPP deps to JVM variants, KT-31641 2019-09-25 15:46:06 +03:00
Sergey Igushkin
f2d2fb9e6b Fix Kapt-generated sources not compiled by jvm.withJava(), KT-32804
Given that the Kapt subplugin creates new tasks, it is impossible
to run it in the context of lazy task configuration. Disable lazy
task configuration for Kotlin/JVM by always accessing the task
instance until subplugins are refactored to be able to properly
work with task configuration avoidance.
2019-09-25 15:46:05 +03:00
Sergey Igushkin
0456220f7a Fix issues found in KOTLIN-CR-3233 2019-09-25 15:46:05 +03:00
Sergey Igushkin
f0ef5a90b3 Add an integration test for the test runs API
Issue #KT-32679
2019-09-25 15:46:05 +03:00
Sergey Igushkin
d1016f0221 Reimplement friend task/friend paths using associated compilations
Replace the old ad-hoc task matching mechanism used for connecting the
compilation tasks that need to share internal visibility with an
implementation based on the associate compilations and compilation
outputs rather than `destinationDir`s of the tasks.

The only place that still requires ad-hoc friend paths is the Android
instrumented tests compiling against the JAR of the main variant, not
its classes dirs. Support that with `friendArtifacts`.

Issue #KT-17630 Fixed
Issue #KT-20760 Fixed
2019-09-25 15:46:05 +03:00
Sergey Igushkin
c4d9c4cee4 Group associated compilations into modules with a single module name
As associated compilations will see internals of each other, they now
need to share the module name for the compiler to be able to correctly
generate calls to the internals.

Move `moduleName` to `KotlinCompilation`.

Group associate compilations into modules in a DSU-like way, use a
single module name for all of the compilations grouped into a module.
2019-09-25 15:46:04 +03:00
Sergey Igushkin
94fd5c2884 Implement source sets visibility inference via associate compilations
Add non-public API for the IDE to query additional visible source sets
for each source set.
Implement visibility inference via associate compilation links.
Implement visibility requirements for source sets and requirements
satisfaction checks in Gradle build.
2019-09-25 15:46:04 +03:00
Sergey Igushkin
8c1c687e92 Implement associate compilations, KT-34009
Partial implementation of the associate compilations proposal. A
compilation can now contain links to other compilation that it compiles
against. This links will replace ad-hoc inter-compilation dependencies.

Issue #KT-34009 Fixed
2019-09-25 15:46:04 +03:00
Sergey Igushkin
bb6f406be4 Partial cleanup & refactoring of the Android plugin
The `KotlinAndroidPlugin` used to support two different sets of APIs of
the Android Gradle plugin and used `AbstractAndroidProjectHandler` to
wrap those APIs. Now that there's only one implementation, it
doesn't need the generic `V` (variant data), and some cleanup is needed.
2019-09-25 15:46:03 +03:00
Sergey Igushkin
0e59553d12 Add Kotlin & Java destination dirs as output of Android compilation
The compilation outputs of Android compilations accidentally were left
empty. The `destinationDir`s of the Kotlin & Java tasks should be
registered in the `output.classesDirs`.
2019-09-25 15:46:03 +03:00
Sergey Igushkin
9836a1ca4a Make compilationsBySourceSets safe to use during evaluation
This function used to only calculate the mapping once and store it for
the project, so it was unsafe to use early. Fix that by evaluating the
value each time and then freezing it at the point of either task graph
being ready, or any task being executed.

Also, store the map in the project's `ext` rather than in a static weak
hash map, which is safer wrt memory leaks.
2019-09-25 15:46:03 +03:00
Sergey Igushkin
5dd4e0ed42 Track the compilation outputs as inputs of Gradle JS test tasks, KT-33313
Issue #KT-33313 Fixed
2019-09-25 15:46:02 +03:00
Sergey Igushkin
3011a3cf81 Create objects via Gradle ObjectFactory to allow access from Groovy 2019-09-25 15:46:02 +03:00
Sergey Igushkin
fe50029beb Adjust task output detection for Gradle 4.9 2019-09-25 15:46:02 +03:00
Sergey Igushkin
43c3122a13 Drop Gradle versions older than 4.9
* Replace `TaskHolder` with `TaskProvider`, remove `TaskHolder`
* Migrate Gradle integration tests to Gradle 4.9+
2019-09-25 15:46:01 +03:00
Sergey Igushkin
9f0c5675bd Introduce execution & test run API, KT-32679
* KotlinExecution
* KotlinExecutionSource
* KotlinTestRun
* Aggregating executions and execution sources
* KotlinTargetWithTests

* Add a `testableTargets` extension
* Make some Kotlin/Native targets testable (this requires
  having a separate preset type for them)
* Implement test runs encapsulating the tests for all
  existing testable targets by refactoring their
  TargetConfigurator classes

Issue #KT-32679 Fixed
2019-09-25 15:46:01 +03:00
Pavel Kirpichenkov
6c8e829f19 Update diagnostics for trailing lambdas, add quickfix
Alternative message for errors, caused by unexpected lambda expression arguments on a new line.
Both diagnostic are reported, if multiple lambda expressions were passed to the call.
For other errors trailing lambda diagnostic overrides the original one.

Quickfix for erroneous trailing lambdas on a new line after call.
Fix separates lambda expression from previous call with semicolon.
All trailing lambda arguments become standalone lambda expressions.
2019-09-25 15:38:17 +03:00
Nikolay Krasko
f00d609459 Fix KotlinConfidenceTest tests 2019-09-25 14:06:36 +03:00
Ivan Gavrilovic
f89885224e Add tests for running incremental KAPT on JDK9
Add test for aggregating incremental annotation processors and JDK9.
This makes sure the implementation is not using any types that have
been removed in JDK 9.
2019-09-25 19:21:10 +09:00
Ivan Gavrilovic
4da6675640 Do not depend on BaseFileObject type for incremental KAPT
This class does not exist in JDK9, so running incremental KAPT on
JDK9 fails. Because it is used only to get the name of the file,
this has been replaced with usage of the public JavaFileObject API.
2019-09-25 19:21:10 +09:00
Ivan Gavrilovic
aaa00b0f6f KT-33889: Do not use private non-API methods from JavacProcessingEnvironment
Avoid using JavacProcessingEnvironment.validImportStringToPattern method
because it has been removed in JDK9. This commit changes how we compute
pattern to match the class names, and it create instances of Pattern
manually by following spec for Processor.getSupportedAnnotationTypes().
Support for module prefix is not added yet.
2019-09-25 19:21:10 +09:00
LepilkinaElena
594f4a6f56 New flag for KotlinNativeCompilation to enable endorsed libraries (#2618) 2019-09-25 10:28:09 +03:00
Alex Chmyr
b8cce67d2e KT-19355 fix for "Variable expected" error after J2K for increment/decrement of an object field 2019-09-25 10:08:42 +03:00
Toshiaki Kameyama
748e458ad7 "Override members": add semicolon between enum entry and function
#KT-31139 Fixed
2019-09-25 12:34:49 +07:00
Toshiaki Kameyama
7fcca71b4b Replace with dot call quickfix: don't break formatting
#KT-25697 Fixed
2019-09-25 12:06:51 +07:00
Toshiaki Kameyama
7b56733bda Reforma ReplaceCallFix 2019-09-25 12:06:51 +07:00
Mikhail Zarechenskiy
78affdd2b4 Fix old testdata: add missing operator modifier
This testdata was written when there was no "operator" modifier.

 After a83225218f rules for operators become stricter and now functions without operators are not considered as such
2019-09-25 01:52:55 +03:00
Vladimir Dolzhenko
a98c610958 Fix KotlinCodeStyleSettings and IDEKotlinBinaryClassCache.kt 191 compilation 2019-09-24 22:01:05 +02:00
Vladimir Dolzhenko
c961de7289 Fix kotlinRefactoringUtil.kt.193 compilation 2019-09-24 21:03:35 +02:00
Mads Ager
b00858a886 Start local var scope for destructuring variables after init.
If the scope for a local variable is started before a value
has been written, another value from a previous use of the local
slot can be present. That value could have a different type which
would lead to weird debugging situations and also leads to other
tools (such as D8) rejecting the locals information as it is
invalid.

Fixes KT-33959.
2019-09-24 18:32:19 +03:00
Vyacheslav Gerasimov
d54bc3a4bb 193: Fix tests compilation for 193 platform 2019-09-24 18:22:35 +03:00
Vladimir Dolzhenko
a8c72b7e84 Do not resolve services in static initializers in IDEKotlinBinaryClassCache, KT-33973 2019-09-24 16:47:49 +02:00
Vladimir Dolzhenko
6f739db3b1 Fixed KotlinCodeInsightWorkspaceSettings plugin service description for 193 2019-09-24 16:42:58 +02:00
Ilya Kirillov
cb569f8493 Do not use resolving to understand which method we use in "replace get or set inspection" 2019-09-24 17:21:49 +03:00
Ilya Kirillov
4e27d2e658 New J2K: do not use global write action for some post-processings which may use resolving while applying
Also, modify that post-processings & inspections to explicitly use write action
when modifying PSI elements

#KT-33875 fixed
2019-09-24 17:21:49 +03:00
Ilya Kirillov
74ba5b210a New J2K: do not analyze code for post-processings in edt thread 2019-09-24 17:21:48 +03:00
Ilya Kirillov
e6f2e0041c New J2K: get rid of generalInspectionPostProcessing 2019-09-24 17:21:47 +03:00
Ilya Kirillov
a4cf7a912b Split some non applicability based inspections into isApplicable and apply
This is needed to fit new nj2k post-processing structure
2019-09-24 17:21:47 +03:00
Ilya Kirillov
3724e2bb02 New J2K: convert all custom post-processing to applicability based ones 2019-09-24 17:21:46 +03:00
Ilya Kirillov
509fcb17c7 New J2K: consider empty/singleton children list when comparing trees in default arguments conversion 2019-09-24 17:13:13 +03:00
Ilya Kirillov
704b3bd2e6 New J2K: always print real fqNames for static calls
As fqNames of some symbols may change during conversion
E.g, when moving Java static method to Kotlin companion object

#KT-19607 fixed
#KT-32903 fixed
#KT-33743 fixed
#KT-33556 fixed
2019-09-24 17:13:12 +03:00
Ilya Kirillov
f9fac0acf5 New J2K: do not save import statements in files as we print fqNames for calls
This may cause conflicts on shortening fq references post-processing step
2019-09-24 17:13:11 +03:00
Dmitry Savvinov
e3b7b41544 Minor: rename globalFacade -> facadeForModules 2019-09-24 17:05:05 +03:00
Dmitry Savvinov
937d041bc3 Minor: rename file ResolverForProjectImpl.kt -> AbstractResolverForProject 2019-09-24 17:05:05 +03:00
Dmitry Savvinov
bef33e971f Make ResolverForProject own BuiltInsCache
Previously, BuiltInsCache was a separate abstraction with its own
lifecycle. In particular, it had a CachedValue inside, which uses
SoftReference to hold the computed data. This is bad, because this might
lead to disalignment of lifetimes with respective ResolverForProject,
leading to potential exceptions in analysis, see KT-33504 for details.

This commit fixes it by making root ResolverForProject own BuiltInsCache
and removing any logic about invalidation from BuiltInsCache. So, now,
BuiltInsCache is disposed iff corresponding ResolverForProject is
disposed

^KT-33504 Fixed
2019-09-24 17:05:05 +03:00
Dmitry Savvinov
bfacc1a3c5 Introduce AbstractResolverForProject
Previously, ResolverForProjectImpl had multiple callbacks in
constructor. Some of those callbacks were used only to overcome module
visibility and provide an ability to inject IDE-specific logic into
compiler (ResolverForProject is in the 'compiler'-module)

This commit introduces abstract class which implements
environment-independent logic (previously, this logic had been stored in
ResolverForProjectImpl) with several abstract met hods (previously,
callbacks). Then, we provide few concrete implementations of
AbstractResolverForProject with clear semantics:

- IdeaResolverForProject: resolver used in IDE, where we have indices,
  oracles, multiple modules, etc.
- ResolverForSingleModuleProject: resolver for project with only one
  module, commonly used for CLI compiler/tests
- one anonymous implementation for MultimoduleTests

This refactoring achieves several things:
- now it is easier to see what kinds of ResolverForProject you might see
  in some particular environment (previously, one had to inspect all
  call-sites of constructor)
- we can easily add IDE-specific logic in IdeaResolverForProject without
  adding noisy callbacks (which most probably wouldn't have any other
  non-trivial implementations)
2019-09-24 17:05:05 +03:00
Dmitry Savvinov
48719c4050 Minor: extract ResolverForProjectImpl into separate file 2019-09-24 17:05:05 +03:00
Dmitry Savvinov
1e288c03c3 Minor: fix typos in KDoc 2019-09-24 17:05:04 +03:00
Dmitry Savvinov
4f700f5df3 Minor: drop unused parameter from createFacadeForScriptDependencies 2019-09-24 17:05:04 +03:00
Andrey Uskov
8ff4a92562 Fix serialization of data nodes tree
#KT-33987 Fixed
2019-09-24 16:27:13 +03:00
Ilya Kirillov
41f7519244 Fix old j2k test data to actual one 2019-09-24 16:22:24 +03:00
Vladimir Dolzhenko
8b0aeb9a55 Do not resolve services in non-default ctors 2019-09-24 15:15:37 +02:00
Toshiaki Kameyama
0e1e1e350f "Convert lambda to reference": do not remove required backticks
#KT-15700 Fixed
2019-09-24 19:45:53 +07:00
Toshiaki Kameyama
44edd94fea "Create member function" quick fix: do not add redundant semicolons after enum entry
#KT-14899 Fixed
2019-09-24 19:40:31 +07:00
Toshiaki Kameyama
0497f0cba4 "Create enum constant" quick fix: add before semicolon
#KT-33718 Fixed
2019-09-24 19:31:52 +07:00
Toshiaki Kameyama
30c41e6720 "Create type parameter from usage": don't suggest for not extension property
#KT-33300 Fixed
2019-09-24 19:28:40 +07:00
Toshiaki Kameyama
68609401c4 Reformat CreateTypeParameterByUnresolvedRefActionFactory 2019-09-24 19:28:40 +07:00
Toshiaki Kameyama
5b666ff33f "Create type parameter from usage": don't remove backticks if necessary
#KT-33299 Fixed
2019-09-24 19:24:02 +07:00
Ilya Goncharov
bfc698a521 Add comment for log-reporter and its necessity 2019-09-24 14:36:11 +03:00
Ilya Goncharov
09e2ebe60a Both js targets use one TC service message classes 2019-09-24 14:36:11 +03:00
Ilya Goncharov
7d4b43f819 Remove annoying spaces in karma-teamcity-reporter 2019-09-24 14:36:10 +03:00
Ilya Goncharov
b4e3cf1d7a Move teamcity reporting only to nodejs 2019-09-24 14:36:10 +03:00
Ilya Goncharov
46e82468e4 Provide logging through kotlin-test=js-runner 2019-09-24 14:36:10 +03:00
Ilya Goncharov
f0e72c4d71 Remove mangling for kotlin-test-js-runner 2019-09-24 14:36:10 +03:00
Ilya Goncharov
e59d1a0ef1 Use terser instead of uglify 2019-09-24 14:36:10 +03:00
Toshiaki Kameyama
784ba69b7a "Cleanup code": remove 'final' keyword for overridden function with non-canonical modifiers order
#KT-33060 Fixed
2019-09-24 18:28:00 +07:00
Steven Schäfer
f49d5da929 JVM IR: Fix enum constructor visibility 2019-09-24 13:28:08 +03:00
Kristoffer Andersen
52dc469657 JVM IR: Generate synthetic methods for type aliases with annotations 2019-09-24 12:21:42 +02:00
romanart
acd1cc5a57 [KLIB] Normalize path string to keep file order on Windows OS 2019-09-24 12:41:48 +03:00
Dmitry Gridin
1ee827bfc8 Import quick fix: support provideDelegate
#KT-28049 Fixed
2019-09-24 16:27:10 +07:00
Toshiaki Kameyama
79199260b9 Import quick fix: suggest for operator extension function called from name reference
#KT-28049 Fixed
2019-09-24 16:27:09 +07:00
Toshiaki Kameyama
998adfb098 Move variable declaration into when: don't report when property has 'break' or 'continue'
#KT-31999
2019-09-24 12:11:41 +03:00
Toshiaki Kameyama
877e583a96 Move variable declaration into when: don't report when property has 'return' or 'throw'
#KT-31999 Fixed
2019-09-24 12:11:41 +03:00
Toshiaki Kameyama
d9d04fc556 "Create enum constant" quick fix: do not add redundant empty line
#KT-32981 Fixed
2019-09-24 13:23:06 +07:00
Dmitry Gridin
5dddc464a5 Completion: add tests for case with overloaded function with lambda with receiver parameter
Relates to #KT-31073
2019-09-23 23:20:26 +07:00
Dmitry Gridin
e3ce799993 Refactoring: change signature should affected expect/actual
#KT-33972 Fixed
2019-09-23 23:01:47 +07:00
Dmitry Gridin
484dda478e AbstractIntentionTest: should check startInWriteAction flag 2019-09-23 23:01:46 +07:00
Dmitry Gridin
667e9a33e8 AbstractIntentionTest: cleanup code 2019-09-23 23:01:46 +07:00
Dmitry Gridin
cbdda6f9a8 KotlinChangeSignatureData: cleanup code 2019-09-23 23:01:46 +07:00
Nikolay Krasko
7271e65851 Don't store hard references to psi elements in transferable data (KT-33802)
This leads to project leaked errors in tests.
2019-09-23 18:58:11 +03:00
Igor Yakovlev
f8bd3518dc UL method and parameter Move&Rename refactoring 2019-09-23 17:30:15 +03:00
Igor Yakovlev
fc70fd05fc Enable kotlin.collections support for UL classes
Removed restriction for classes derived from Kotlin collections
Added type erasure for java collection overrided methods
2019-09-23 17:30:15 +03:00
Igor Yakovlev
286702a99c Format code for NoArgPlugin 2019-09-23 17:07:33 +03:00
Igor Yakovlev
1deba19e1c Refactoring NoArg compiler plugin
Remove NoArgClassKey relation betwen AbstractNoArgDeclarationChecker and NoArgExpressionCodegenExtension
Separate NoArgExpressionCodegenExtension to Ide and Cli versions
2019-09-23 17:07:33 +03:00
Vladimir Dolzhenko
027c60080b Added KotlinCodeInsightWorkspaceSettings in place of sharing kotlin settings with java CodeInsightSettings 2019-09-23 16:05:11 +02:00
Nikolay Krasko
6b5a73ffa9 Enable resolve in dispatch thread check for copy-paste tests 2019-09-23 16:54:35 +03:00
Nikolay Krasko
ee4ab967a4 Force resolve check for dispatch thread instead of isWriteAccessAllowed
isWriteAccessAllowed = dispatch thread + write lock
2019-09-23 16:54:35 +03:00
Nikolay Krasko
9f81de293f Minor: add intention name to test failure 2019-09-23 16:54:35 +03:00
Ilya Matveev
fabd336856 Update K/N: 1.3.60-dev-12485 2019-09-23 18:45:17 +07:00
Vladimir Dolzhenko
17e2359a41 Added copy-paste performance tests 2019-09-23 12:48:59 +02:00
Natalia Selezneva
63e5d4fe95 Tests: rewrite some AbstractScriptConfigurationTest to the new script infrastructure 2019-09-23 12:06:25 +03:00
Natalia Selezneva
eca7bbdb8c Scripts: Check if file is in all script dependencies class files scope instead of searching for module info
^KT-32799 Fixed
^KT-16760 Add test
2019-09-23 12:06:25 +03:00
Toshiaki Kameyama
245b2aecb3 "Replace guard clause with kotlin's function call" inspection : decrease severity to INFORMATION
#KT-33235 Fixed
2019-09-23 11:36:14 +03:00
Ivan Gavrilovic
573e7f2eee Run JDK11 tests for KAPT only if JDK11 is available
Otherwise, just skip running them.
2019-09-23 17:32:37 +09:00
Ivan Gavrilovic
6e7f046471 Fix gradle integeration tests
Fix test failure on Windows, where backslash was not escaped
in a build file. Also, remove obsolete test for Gradle 4.2,
because 4.3 is the minimum supported version.
2019-09-23 17:32:36 +09:00
Toshiaki Kameyama
92dcb54207 "Redundant overriding method" inspection: do not report when overriding package private method
#KT-33153 Fixed
2019-09-23 12:35:56 +07:00
Alexander Udalov
25799447a6 Minor, use slightly less internal argument to enable inline classes 2019-09-21 02:03:31 +02:00
Steven Schäfer
e4609a9968 JVM IR: Cache inline class replacements at the module level 2019-09-20 23:41:39 +02:00
Steven Schäfer
f40f9611c3 JVM IR: Fix spread operator on unsigned array type 2019-09-20 18:17:31 +02:00
Mikhail Zarechenskiy
1a50a3cbb1 [NI] Avoid computing few things for simple calls without type variables 2019-09-20 17:56:07 +03:00
Mikhail Zarechenskiy
7bd65c0bcd [NI] Avoid collecting possible types for call expressions 2019-09-20 17:56:07 +03:00
Mikhail Zarechenskiy
a83225218f [NI] Fix checks for infix/operator conventions 2019-09-20 17:56:06 +03:00
Pavel Kirpichenkov
f45a49b122 Remove uncapturing in type mismatch diagnostics
#KT-32587 Fixed
2019-09-20 17:05:03 +03:00
Ilya Matveev
5c904250be Gradle, native: Update a K/N version in tests
Earlier, K/N 1.1 was used when testing the kotlin.native.version
property. But this version doesn't support the -no-endorsed-libs
flag add recently. This patch updates K/N version in tests.
2019-09-20 16:54:30 +07:00
Ilya Goncharov
31aa4e4738 Rename kotlin-test-nodejs-runner to kotlin-test-js-runner 2019-09-20 10:56:18 +03:00
Ilya Goncharov
10c36ae5c5 Change naming from commin cli.ts to concrete platform nodejs.ts 2019-09-20 10:56:17 +03:00
Ilya Goncharov
c2b5df83f6 Add filtering feature to karma testing
- Now karma use generated adapter.js as input, in which right runner and
also all real input files are required

#KT-32216 fixed
2019-09-20 10:56:15 +03:00
Ilya Goncharov
09a602d8ad Move common logic of js test running on upper level (js) 2019-09-20 10:49:57 +03:00
Ilya Goncharov
e750bd302d Add karma input for kotlin-test-nodejs-runner
- To set custom adapter for kotlin-test, it is necessary to inject adapting
code to webpack's input, so then it is executed inside browser and set
custom adapter
This code will be injected to webpack's input
2019-09-20 10:49:56 +03:00
Ilya Goncharov
e242856124 Enable cli description to have free args title 2019-09-20 10:49:56 +03:00
Ilya Goncharov
80ea91f574 Extract Adapter getting to common place 2019-09-20 10:49:56 +03:00
Ilya Goncharov
b44249255c Extract default cli parser to common place 2019-09-20 10:49:56 +03:00
Ilya Goncharov
f0af4756a9 Fix accuracy for regex filtering for nodejs testing 2019-09-20 10:49:56 +03:00
Ilya Goncharov
e2aecee925 Fix exact test filtering for nodejs 2019-09-20 10:49:56 +03:00
Natalia Selezneva
a62863128c Fix exception from ProjectResolutionFacade when switching some definition off in settings
Fix AbstractScriptDefinitionsOrderTest
Remove updating script dependencies in test because in affects cache behavior: script will be already up to date when highlighting is called for the second time
2019-09-20 10:35:52 +03:00
Natalia Selezneva
3ad7f516be Add caret to test to check exception in ProjectResolutionFacade that can happen during resolving of symbol from script dependencies 2019-09-20 10:35:52 +03:00
Natalia Selezneva
5872a47c0e Scripts: rehighlighting should be called for opened scripts after changing script definitions
In case when script dependencies were absent for script, highlighting was called only when the script changed
2019-09-20 10:35:52 +03:00
Natalia Selezneva
3ac099fc9a Fix freeze during script definitions update (KT-32513)
loadScriptDefinitions is a long running operation, so it shouldn't be called under write lock.
This may cause a freeze when someone else wants to get definitions from the same loader during loading process

^KT-32513 Fixed
2019-09-20 10:35:44 +03:00
Ilya Matveev
1b64583855 Gradle, native: Embed bitcode for watchOS and tvOS 2019-09-20 12:52:48 +07:00
Abduqodiri Qurbonzoda
2819ab4ae9 Avoid division in string-to-unsigned conversions (KT-26309) 2019-09-20 01:08:33 +03:00
Abduqodiri Qurbonzoda
d66f07a84e CollectionsKt.windowed throws IllegalArgumentException 2019-09-20 00:50:54 +03:00
Alexander Udalov
a7b984bcbf JVM IR: fix generation of generic multi-file delegates 2019-09-19 22:23:16 +02:00
Alexander Udalov
acbe5c4e21 JVM IR: fix IOOBE from remapTypeParameters for synthetic property annotations method 2019-09-19 22:23:16 +02:00
Igor Yakovlev
c972bf5882 Add [JPS] IDEA (No ProcessCanceledException) configuration 2019-09-19 19:56:35 +03:00
Ilmir Usmanov
f1d31c8221 JVM_IR: Minor. Unmute tests
Rename FAKE_CONTINUATION -> fakeContinuation
2019-09-19 19:28:11 +03:00
Ilmir Usmanov
06d0e8a521 JVM_IR: Support suspend functions with extension receivers 2019-09-19 19:28:10 +03:00
Ilmir Usmanov
2bfd17d8fb JVM_IR: Minor. Unmute test. 2019-09-19 19:28:08 +03:00
Ilmir Usmanov
63f6d515bc JVM_IR: Generate correct invoke of numbered suspend lambda
Instead of continuation type as last parameter's type, generate Object
type.
2019-09-19 19:28:05 +03:00
Ilmir Usmanov
587fcafc85 JVM_IR: Support continuation crossing inline lambda boundaries
I.E. generate fake continuation markers.
2019-09-19 19:28:03 +03:00
Ivan Gavrilovic
0cdfe89a26 KT-33052: Fix KAPT stub generation for enums on JDK11
When using JDK11, generating stubs for enums is broken.
This commit handles the faulty generation by JDK11 by
fully printing enums in custom implementation of tree
printing.

Test: added JDK11 tests for KAPT stub  generation
2019-09-20 00:04:27 +09:00
Ivan Gavrilovic
58efa34a33 KT-31291: KAPT - make sure ASM version is not inlined
Switch to Java reflection when getting the ASM version used
to analyze classes. Using Kotlin reflection resulted in the constant
being inlined.

Fixes KT-31291
Fixes KT-33493
2019-09-20 00:04:27 +09:00
Ivan Gavrilovic
60fa632d02 KT-33515: Remove Kotlin sources generated by KAPT
When KAPT is unable to run incrementally make sure to
clean directory that contains generated Kotlin sources.
This location is specified using '-Akapt.kotlin.generated'
option.
2019-09-20 00:04:27 +09:00
Ivan Gavrilovic
434fb75eb7 Incremental KAPT: when unable to process incremental changes, run non-incrementally
When analyzing incremental changes in the KAPT task, incremental compilation
can handle directory changes, Java source file changes, jar/.class file changes,
and changes to the ABI structure of the classpath. Anything else should cause
a full recompilation.

Test: KaptIncrementalWithIsolatingApt.testNonIncrementalWithUnrecognizedInputs
2019-09-20 00:04:27 +09:00
Ilya Goncharov
b59fba6707 Fix mocha run
#KT-33579 fixed
2019-09-19 15:42:49 +03:00
Nicolay Mitropolsky
9d01c87c51 KotlinElementActionsFactory: cleanup JvmElementActionsFactory API (KT-33779) 2019-09-19 10:45:12 +03:00
Vladimir Dolzhenko
3bcbcbfd47 Fix read action in 'processLightClassLocalImplementations' (EA-210464) 2019-09-18 10:44:43 -07:00
Vladimir Dolzhenko
81c9edfff4 Get rid of implicit resolve within statsInfo for KotlinAddImportAction (EA-210670) 2019-09-18 10:43:38 -07:00
Vladimir Dolzhenko
3a1d649b30 Don't trigger refresh of vfs in 'getOutsiderFileOrigin' (EA-209420) 2019-09-18 10:23:34 -07:00
Mads Ager
507857d452 [IR] Support Collection<*>.indices in for loop lowering.
Unmute a couple of tests that are working as intended.
2019-09-18 19:00:17 +02:00
Steven Schäfer
76ab631214 psi2ir: Optimize generated data class members
- Access underlying fields directly, instead of using accessors. This is
  safe since data classes are always final.
- Don't generate a temporary variable in hashCode to use as the
  accumulator.

Both optimizations are effectively present in the current JVM backend
and with these changes the generated code is much closer to what the
current backend generates.
2019-09-18 18:56:42 +02:00
Steven Schäfer
7ccf314808 Minor: Remove dead conditional in psi2ir 2019-09-18 18:56:42 +02:00
Steven Schäfer
ce3ef4e4d0 Add more tests for inline class equality with nullable arguments 2019-09-18 18:52:58 +02:00
Steven Schäfer
1833a69c87 JVM: Optimize inline class equality with nullable arguments 2019-09-18 18:52:58 +02:00
Steven Schäfer
eda4953cb3 JVM IR: Optimize inline class equality with nullable arguments 2019-09-18 18:52:58 +02:00
Steven Schäfer
d8646e29b7 Add additional Result api test 2019-09-18 18:52:58 +02:00
Steven Schäfer
49efa5fbc4 Split up Result API boxing tests 2019-09-18 18:52:58 +02:00
Steven Schäfer
2e53e36fd5 JVM: Do not use equals-impl0 methods generated by older compiler versions 2019-09-18 18:52:58 +02:00
Steven Schäfer
b85b2d9af8 Add more tests for inline class equality 2019-09-18 18:52:58 +02:00
Steven Schäfer
cdc5e1347b JVM: Avoid boxing in inline class equality 2019-09-18 18:52:58 +02:00
Steven Schäfer
f53b28e8a3 JVM: Generate equals-impl0 method for inline classes 2019-09-18 18:52:58 +02:00
Steven Schäfer
2c7da67600 JVM IR: Avoid boxing in inline class equality 2019-09-18 18:52:58 +02:00
Steven Schäfer
b85a475358 JVM IR: Generate equals-impl0 method for inline classes 2019-09-18 18:52:58 +02:00
Steven Schäfer
e4456127e4 JVM IR: Don't use JS IR specific inlineClasses.kt 2019-09-18 18:52:58 +02:00
Steven Schäfer
475079611d JVM IR: Avoid parameter null-checks in inline class impl methods 2019-09-18 18:52:58 +02:00
Steven Schäfer
cdd3f82396 JVM IR: Use correct scope owner in JvmInlineClassLowering 2019-09-18 18:52:58 +02:00
Vladimir Dolzhenko
2afbeaa353 Drop resolve on 'collectTransferableData' and reworked MoveDeclarations QuickFix (EA-210670) 2019-09-18 09:01:09 -07:00
Alexander Udalov
6ef434a711 JVM IR: add -Xir-check-local-names to check names for consistency
Since KotlinTypeMapper is no longer used in the JVM IR backend, we need
not run CodegenBinding.initTrace and check that names of local entities
are exactly equal to local names computed by that algorithm.

However, it's still useful as an opt-in flag, to discover issues where
unwanted elements take part in the naming (such as temporary IR
variables, see for example cb2e68fece). So we introduce a new command
line argument -Xir-check-local-names which, when the IR backend is used
(via -Xuse-ir), launches the name computation algorithm from the old
backend and then compares that the names are exactly equal to the names
computed by the IR backend in InventNamesForLocalClasses.
2019-09-18 17:55:42 +02:00
Alexander Udalov
530c1411c3 Remove IR backend-specific code from KotlinTypeMapper
Add an assertion to check that we don't call mapType anymore in JVM IR.
2019-09-18 17:55:41 +02:00
Vladimir Dolzhenko
3d79e77df3 Add async profiler to perfTests 2019-09-18 08:49:28 -07:00
Ilya Chernikov
0f4176a88e [Pill] Fix pill after refactoring reflect 2019-09-18 14:44:30 +02:00
Alexander Udalov
aa77f6c245 Improve KParameter.toString for instance and extension receiver parameter
#KT-17860 Fixed
2019-09-18 14:05:43 +02:00
Alexander Udalov
59186b2617 Psi2ir: ignore unresolved class literals in annotations
Similarly to 38536638, skip annotation arguments that reference classes
which are not found in our compilation classpath.

This fix is especially needed because of the way _nested_ classes are
currently referenced in annotations. Since we don't generate all needed
InnerClasses attributes yet (KT-27936), we can't unambiguously resolve a
reference to a nested class in annotation arguments. This leads to an
ErrorValue loaded in the annotation descriptor. The old backend doesn't
care, since it doesn't look at that annotation or its arguments, but
psi2ir tries to convert all annotation arguments and it crashed with CCE
here, trying to cast IrErrorType to IrSimpleType.
2019-09-18 14:05:28 +02:00
Alexander Udalov
c69997491f JVM IR: generate file annotations on file facade classes 2019-09-18 14:05:28 +02:00
Kevin Bierhoff
565099d941 fix new test name 2019-09-18 14:42:32 +03:00
Kevin Bierhoff
bc207ed8db fix for KT-29471
#KT-29471 Fixed
2019-09-18 14:42:09 +03:00
Nikolay Krasko
220a8f2872 Clear internal caches in PerModulePackageCacheService on dispose (KT-33802) 2019-09-18 11:30:02 +03:00
Nikolay Krasko
4387862d20 Remap android home directory to allow parallel test execution (KT-33870)
Using same directory for android (user home) leads to exception on Windows
because of file lock:

com.google.gson.JsonSyntaxException: java.io.IOException: The process cannot access the file because another process has locked a portion of the file
at com.google.gson.Gson.fromJson(Gson.java:942)
at com.google.gson.Gson.fromJson(Gson.java:865)
at com.android.tools.analytics.AnalyticsSettings.loadSettingsData(AnalyticsSettings.kt:140)
at com.android.tools.analytics.AnalyticsSettings.initialize(AnalyticsSettings.kt:211)
at org.jetbrains.android.AndroidPlugin.initializeForNonStudio(AndroidPlugin.java:56)
at org.jetbrains.android.AndroidPlugin.initComponent(AndroidPlugin.java:30)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:503)
at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponents(ComponentManagerImpl.java:126)
at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:411)
at com.intellij.idea.IdeaTestApplication.a(IdeaTestApplication.java:114)
at com.intellij.idea.IdeaTestApplication.getInstance(IdeaTestApplication.java:61)
at com.intellij.idea.IdeaTestApplication.getInstance(IdeaTestApplication.java:54)
at com.intellij.testFramework.LightPlatformTestCase.initApplication(LightPlatformTestCase.java:166)
at com.intellij.testFramework.fixtures.impl.LightIdeaTestFixtureImpl.setUp(LightIdeaTestFixtureImpl.java:41)
at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.lambda$setUp$27(CodeInsightTestFixtureImpl.java:1142)
at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:18)
at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:13)
at com.intellij.testFramework.EdtTestUtilKt.runInEdtAndWait(EdtTestUtil.kt:63)
at com.intellij.testFramework.EdtTestUtil$Companion.runInEdtAndWait(EdtTestUtil.kt:18)
at com.intellij.testFramework.EdtTestUtil.runInEdtAndWait(EdtTestUtil.kt)
at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.setUp(CodeInsightTestFixtureImpl.java:1141)
at com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase.setUp(LightJavaCodeInsightFixtureTestCase.java:96)
at org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase.setUp(KotlinLightCodeInsightFixtureTestCase.kt:66)
at com.intellij.testFramework.UsefulTestCase.defaultRunBare(UsefulTestCase.java:388)
at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:18)
at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:13)
at com.intellij.testFramework.EdtTestUtilKt$runInEdtAndWait$3.run(EdtTestUtil.kt:67)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:433)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.io.IOException: The process cannot access the file because another process has locked a portion of the file
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at sun.nio.ch.FileDispatcherImpl.read(FileDispatcherImpl.java:61)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:197)
at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:159)
at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:65)
at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:109)
at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:103)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at com.google.gson.stream.JsonReader.fillBuffer(JsonReader.java:1295)
at com.google.gson.stream.JsonReader.nextNonWhitespace(JsonReader.java:1333)
at com.google.gson.stream.JsonReader.consumeNonExecutePrefix(JsonReader.java:1576)
at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:534)
at com.google.gson.stream.JsonReader.peek(JsonReader.java:425)
at com.google.gson.Gson.fromJson(Gson.java:923)
... 41 more

#KT-33870 Fixed
2019-09-18 11:30:02 +03:00
Anton Yalyshev
dfde3b4076 Rename collector of debugger events 2019-09-18 10:06:45 +03:00
Anton Yalyshev
61eb9faecd Move status of evaluation from eventId to context for better data analytics 2019-09-18 10:06:45 +03:00
Denis Zharkov
2bdbed978b FIR: Support SAM constructors 2019-09-18 10:03:55 +07:00
Denis Zharkov
b3e96a1fcf FIR: Merge FirTopLevelDeclaredMemberScope into FirSelfImportingScope
It's strange that those scopes have similar semantics but belong
to different level (that might change semantics a bit)
2019-09-18 10:03:55 +07:00
Denis Zharkov
391346ae46 FIR: Pass BodyResolveComponents to ScopeTowerLevel 2019-09-18 10:03:28 +07:00
Denis Zharkov
fb4b6b8290 FIR: Move constructor processing from scopes to tower resolvers 2019-09-18 10:03:28 +07:00
Denis Zharkov
08a8a9fa61 FIR: Move SamResolver to BodyResolveComponents 2019-09-18 10:00:04 +07:00
Denis Zharkov
5ebde93eb9 FIR: Provide BodyResolveComponents instead of InferenceComponents to resolution
It seems to be more reasonable to store SamResolver, ScopeSession
and other per-transformer/per-thread components there
2019-09-18 10:00:04 +07:00
Denis Zharkov
5567620563 FIR: Support SAM conversion 2019-09-18 10:00:04 +07:00
Denis Zharkov
f501730d86 Minor. Reformat Arguments.kt in fir 2019-09-18 10:00:04 +07:00
Denis Zharkov
9d517d914b Minor. Get rid of redundant elvis operand in AbstractConeSubstitutor::substituteOrNull 2019-09-18 10:00:04 +07:00
Denis Zharkov
6e51bed30c FIR: Support lambda inference from platform types 2019-09-18 10:00:04 +07:00
Denis Zharkov
d787df3880 Minor. Reformat ConeKotlinType::isBuiltinFunctionalType 2019-09-18 10:00:04 +07:00
Mikhail Zarechenskiy
0431c21f9a [NI] Remove unneeded computation of possible types for return type
This call was needed at some point for smartcasts on qualified
 expressions but become obsolete (most likely after
 daa27016ca).

 Now `ComplexDataFlowBenchmark` has similar results for NI and OI
2019-09-18 00:19:21 +03:00
Mikhail Zarechenskiy
d47fc85868 [NI] Minor, small improvements around KotlinCall creation 2019-09-18 00:13:10 +03:00
Mikhail Zarechenskiy
971b02494c [NI] Minor, simplify code a bit for sub calls preparation 2019-09-18 00:13:10 +03:00
Mikhail Zarechenskiy
7e8784dca1 [NI] Simplify code that capture types from expression 2019-09-18 00:13:10 +03:00
Vyacheslav Gerasimov
6327f657a5 193: Add bunches for 193 platform 2019-09-17 21:16:13 +03:00
Vyacheslav Gerasimov
381f6d8226 193: Inline removed parents method in UastLightIdentifier 2019-09-17 21:16:13 +03:00
Vyacheslav Gerasimov
7fe25e922c 193: Fix nullability in KotlinImportOptimizer 2019-09-17 21:16:12 +03:00
Vyacheslav Gerasimov
c220ad4b00 Build: Add dsl constants for 193 platform 2019-09-17 21:16:12 +03:00
Svyatoslav Scherbina
df570ec2a2 Add CompilerOutputKind.DYNAMIC_CACHE and .STATIC_CACHE for Native BE 2019-09-17 20:28:01 +03:00
Ilmir Usmanov
0e3f0c98e5 JVM_IR: Support inline suspend lambdas 2019-09-17 19:19:27 +03:00
Dmitriy Novozhilov
61ae98df40 [FIR] Add default visitors and transformers with useful part of visited hierarchy 2019-09-17 18:09:18 +03:00
Dmitriy Novozhilov
e70c1d6959 [FIR] Remove default visited hierarchy 2019-09-17 18:09:18 +03:00
Nikolay Krasko
9b32bd7138 Do special insert even for custom trimIndent() function to avoid using resolve (KT-31810) 2019-09-17 17:16:30 +03:00
Toshiaki Kameyama
147f805c56 Paste inside indented .trimIndent() raw string: respect indentation (KT-31810)
#KT-31810 Fixed
2019-09-17 17:16:30 +03:00
Ilya Chernikov
d3b826c71d Improve class name generation for scripts and REPL snippets
- allow to override default name/scheme
- implement host/engine specific names for jsr223 to avoid classloading
  clashes (also fix "eval in eval" test)
2019-09-17 16:05:38 +02:00
Ilya Chernikov
6de05bb2c7 Drop hardcoded extraction of the snippet id from script name
rely on the userdate instead
2019-09-17 16:05:38 +02:00
Ilya Chernikov
dd953e0f66 Deduplicating classloaders and classpath entries on constructing script classloader 2019-09-17 16:05:37 +02:00
Simon Ogorodnik
df3fbaf417 Add various configuration parameters to Non Fir modularized tests 2019-09-17 16:10:37 +03:00
Simon Ogorodnik
f3a0632b9a [FIR] Fix dump html for each pass 2019-09-17 16:10:32 +03:00
Dmitry Petrov
0531bd4fe6 KT-29229 Intrinsify 'in' operator for unsigned integer ranges
Support mixed type case, e.g., '[UByte] in [UIntRange]'.
2019-09-17 15:50:47 +03:00
Ilya Chernikov
5426071102 Add dependency classloader to the evaluation classloader:
allows to use dependencies from classloader in the scenario with
evaluation in the isolated environment
2019-09-17 12:43:18 +02:00
Ilya Chernikov
61d517fb31 Implement script dependencies resolution directly from classloader
#KT-27956 fixed
2019-09-17 12:43:18 +02:00
Ilya Chernikov
f8db150a2b [minor] Drop some usages of kotlin reflection in scripting compiler plugin 2019-09-17 12:43:16 +02:00
Ilya Chernikov
689a5cbdf5 Add descriptors.runtime to the compiler...
move it into appropriate package and ensure that it gets relocated
properly in kotlin-reflect.jar
This change is needed to use the functionality that provides descriptors
from classloaders for scripts compilation.
2019-09-17 12:43:15 +02:00
Ilya Kirillov
8dce22c335 New J2K: use proper resolution facade when getting class reference in inference post-processing 2019-09-17 11:56:07 +03:00
Ilya Kirillov
cfd476ca7e New J2K: correctly convert main method with varargs argument
#KT-33756 fixed
2019-09-17 11:56:06 +03:00
Ilya Kirillov
5d6cf34045 New J2K: consider that type argument may be null in inference post-processing 2019-09-17 11:56:06 +03:00
Ilya Kirillov
934d491c1c New J2K: use Any? instead of star projection for raw supertypes
#KT-33863 fixed
2019-09-17 11:56:06 +03:00
Ilya Kirillov
c6e0356a59 Do not search for getter usages for every "may be const" quickfix invocation
It is a rather expensive operation which is critical for j2k

relates to #KT-33854
2019-09-17 11:56:05 +03:00
Ilya Kirillov
1b3c5f5d37 New J2K: use proper progress indicator for showing progress
#KT-33854 fixed
2019-09-17 11:56:05 +03:00
Ilya Kirillov
2916be6a53 Remove duplicating interface in J2K
#KT-33445 fixed
2019-09-17 11:56:05 +03:00
Ilya Kirillov
1cf348baba Do not commit document on non-kotlin files when trying to perform j2k conversion
#KT-33725 fixed
2019-09-17 11:56:04 +03:00
Mikhail Glukhikh
13b16cfe75 Refactoring: get rid of firSafeNullable, enhance getSymbolByLookupTag 2019-09-17 10:10:07 +03:00
Mikhail Glukhikh
0493432723 Remove some usages of FirBasedSymbol 2019-09-17 10:10:06 +03:00
Matthew Gharrity
a1f4a4572a Check cancelation in KotlinJavaPsiFacade.findPackage()
This may help with some UI freezes caused by KT-33394, although
it does not fix the underlying performance problem.
2019-09-16 10:58:58 -07:00
Pavel Kirpichenkov
0a1b3a8455 Clearify diagnostic messages that involve internal visibilities
KT-7354 Fixed

Visibility.displayText is deprecated with warning.
Diagnostics for java visibilities changed.
2019-09-16 19:00:43 +03:00
Nikolay Krasko
fc4865a440 Don't extend to comments when a comment is being moved (KT-23461) 2019-09-16 16:57:48 +03:00
Nikolay Krasko
11de99f9d7 Minor refactoring for KotlinExpressionMover (KT-23461)
Extract function, some better naming.
2019-09-16 16:57:48 +03:00
Toshiaki Kameyama
ed28a06285 Move statement: move expression over comments (KT-23461)
#KT-23461 Fixed
2019-09-16 16:57:48 +03:00
Mikhail Glukhikh
20c45a8382 FIR general refactoring: get rid of ConeSymbols 2019-09-16 16:55:42 +03:00
Ilmir Usmanov
c1c46daa01 Use en_US.UTF-8 locale instead of default locale to work around errors
in tr_TR.UTF-8 locale in coroutines-specific code.

 #KT-33821: Fixed
2019-09-16 16:50:05 +03:00
Ilmir Usmanov
1951ff8054 JVM_IR: Minor. Unmute tests 2019-09-16 16:49:24 +03:00
Ilmir Usmanov
a3284326af JVM_IR: Do not box/unbox result in continuations
Otherwise, it leads to CCE from kotlin/Result.
2019-09-16 16:49:22 +03:00
Ilmir Usmanov
402a77126f JVM_IR: Support inline suspend functions
Only no state-machine version for now.
2019-09-16 16:49:21 +03:00
Ilmir Usmanov
2ec3417e0e JVM_IR: Move suspend functions into view transformation to codegen phase
Support suspend functions with default arguments.
2019-09-16 16:49:18 +03:00
Toshiaki Kameyama
6b36833ee2 Highlight usages: highlight declaration/usage on call of function with lambda argument (KT-30824)
#KT-30824 Fixed
2019-09-16 16:26:02 +03:00
Nikolay Krasko
26bef2d109 Fix muted usage highlighter test by ignoring irrelevant highlighting
UsageHighlightingTestGenerated.testImplicitReturnExpressionsInLambdasNoHightlighting
2019-09-16 16:26:02 +03:00
Toshiaki Kameyama
7b8abc5457 Move statement: enable expression ended with semicolon (KT-8581)
#KT-8581 Fixed
2019-09-16 16:26:02 +03:00
Alexander Udalov
5259af157a JVM IR: workaround correspondingPropertySymbol absence after deep copy 2019-09-16 14:57:21 +02:00
Alexander Udalov
b782cf6bdb JVM IR: workaround KotlinTypeMapper usages in boxing optimization on inline classes 2019-09-16 14:57:21 +02:00
Alexander Udalov
c425bd0e0b JVM IR: do not use KotlinTypeMapper in BuilderFactoryForDuplicateSignatureDiagnostics 2019-09-16 14:57:21 +02:00
Alexander Udalov
3a0c41dca4 JVM IR: do not use KotlinTypeMapper indirectly in CallableReferenceLowering 2019-09-16 14:57:21 +02:00
Alexander Udalov
26874a6e1e JVM IR: do not use KotlinTypeMapper in MethodSignatureMapper 2019-09-16 14:57:20 +02:00
Alexander Udalov
ee976020bc JVM IR: add KotlinTypeMapperBase, do not use KotlinTypeMapper in metadata serialization 2019-09-16 14:57:20 +02:00
Alexander Udalov
bd8ea9412d JVM IR: implement MethodSignatureMapper.mapFunctionName directly 2019-09-16 14:57:20 +02:00
Alexander Udalov
36c242764f JVM IR: implement MethodSignatureMapper.mapSignature directly
As well as mapFieldSignature, mapReturnType, mapAsmMethod and smaller
methods. This removes yet another dependency on KotlinTypeMapper in the
IR backend.
2019-09-16 14:44:16 +02:00
Alexander Udalov
46ced326b8 JVM IR: minimize usages of some methods in MethodSignatureMapper
Also do not pass useless parameters such as OwnerKind which is always
IMPLEMENTATION in the IR backend
2019-09-16 14:44:16 +02:00
Alexander Udalov
4dc1d61c38 JVM IR: do not remove overridden symbols in BridgeLowering
This information might be needed in subsequent lowerings or codegen. For
example, it'll be needed in MethodSignatureMapper to determine that we
need to box primitive return type if one of overridden functions has a
non-primitive return type.

For invoke in lambda classes specifically though, we need to remove this
override from the specialized invoke because otherwise we'd call a boxed
version in the bridge (see 73d2ae961c). In this change, we still keep
the override on a bridge though just for the sake of IR consistency.
2019-09-16 14:44:16 +02:00
Alexander Udalov
45929f57b6 Minor, add test on name mangling of private multi-file part members 2019-09-16 14:44:16 +02:00
Vyacheslav Gerasimov
cb482571cb Build: Fix javadocJar task configuration
Add artifact outside of lazy configuration lambda, otherwise it is never
added
2019-09-16 15:26:56 +03:00
Leonid Startsev
cec37cf78a Add supertype type arguments to super() call in deserialization ctor
#KT-31619 fixed
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/525
2019-09-16 15:03:17 +03:00
Leonid Startsev
0b669e72b0 Do not report error about 'initializer required for @Transient properties' on lateinit vars
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/553
2019-09-16 15:03:17 +03:00
Leonid Startsev
4e516d7c94 Fix IR validation warnings in serialization plugin
- Insert patchDeclarationParents after whole processing
- Copy IR nodes to avoid duplications
- Insert correct type for getter during serialization of properties from parent class
- Do not use irThrowIse because it is broken somewhere in Native backend
2019-09-16 15:03:17 +03:00
Ilya Matveev
d3f1cf1cdd Gradle, native: Don't ignore exit codes of K/N tests
Issue #KT-32872 fixed
2019-09-16 18:28:03 +07:00
Alexander Udalov
9d257a1ed8 JVM IR: generate call to checkNotNull in IrCheckNotNull since 1.4
#KT-22275
2019-09-16 12:33:01 +02:00
Ilya Goncharov
acc86be043 Extend karma-teamcity-reporter to log browser's output
#KT-32073 fixed
#KT-32281 fixed
2019-09-16 12:33:45 +03:00
Ilya Goncharov
8fbdb15626 Show suppressed output in case of karma launch failed 2019-09-16 12:31:59 +03:00
Ilya Goncharov
425582bb4b Use only custom karma reporter
- Ideally these changes should be on karma-teamcity-reporter
2019-09-16 12:31:59 +03:00
Ilya Goncharov
ddbae98841 Remove redundant marker of browser log starting 2019-09-16 12:31:58 +03:00
Ilya Goncharov
355f847ee0 Add parse of karma log to find browser's messages
- Log browser's message respects their log level
2019-09-16 12:31:58 +03:00
Ilya Goncharov
8c46fab6d8 Add own reporter that reports only browser log in specific format 2019-09-16 12:31:57 +03:00
Ilya Goncharov
9bb5022eb4 Move nested classes 2019-09-16 12:31:57 +03:00
Ilya Goncharov
6277267563 Make KarmaConfig as data class 2019-09-16 12:31:57 +03:00
Ilya Goncharov
8f7c5c13f8 Parse karma problem to fail task
#KT-31663 fixed
2019-09-16 12:31:55 +03:00
Ilya Goncharov
3d67b952f8 Parse browser output to log 2019-09-16 12:25:55 +03:00
Dmitriy Novozhilov
c8d087d744 [FIR] Tests. Save failed tests into testdata 2019-09-16 10:58:51 +03:00
LepilkinaElena
7cae9214d7 Disable endorsed libraries in plugin (#2536) 2019-09-16 09:43:22 +03:00
Ilya Matveev
3120eff6f5 Update K/N: 1.3.60-dev-12266 2019-09-16 12:45:06 +07:00
Ilya Matveev
45a413c892 Gradle, native: Minor fixes
Fix ReplaceWith for compilation.extraOpts
Simplify languageSettings access in compile tasks
Use checkedReplace in binary integration tests
2019-09-16 12:45:06 +07:00
Ilya Matveev
60ae03f08b Gradle, native: Don't use deprecated DefaultTask.newOutputFile()
This method is planned to be removed in Gradle 6.0, so we avoid
using it.
2019-09-16 12:45:05 +07:00
Ilya Matveev
dda25875d4 Gradle, native: Use language settings when link from sources
Take language settings into account when a final binary is
being built from sources.
2019-09-16 12:45:05 +07:00
Ilya Matveev
57635f7ba3 Update Kotlin/Native: 1.3.60-dev-12104 2019-09-16 12:45:05 +07:00
Ilya Matveev
7122a9d819 Gradle, native: Propagate compilation free args to link tasks
The free args DSL may be changed in 1.3.70 for all platforms. So it
was decided to preserve the old behaviour here to avoid making
similar changes in two releases in a row.
2019-09-16 12:45:04 +07:00
Ilya Matveev
20332ae231 Gradle, native: Pass --progressive to both compile and link tasks 2019-09-16 12:45:04 +07:00
Ilya Matveev
90358dee55 Gradle, native: Allow user to force old behaviour of link tasks
We leave an ability to build final native binaries directly from
sources instead of building them from a klib. Thus we allow
a user to workaround possible bugs related to building a final
binary from a klib (-Xinclude compiler flag).
2019-09-16 12:45:04 +07:00
Ilya Matveev
f07e0594e2 Gradle, native: Report passing binary-specific args to compilation
Earlier we propagated all free args specified for a compilation into
a link task. It was required because the link task actually compiled
the same source as the compile task but with another output kind.

But currently a link task produces a final binary from a klib instead
of sources. It means that such a propagation becomes incorrect. Now
options related to the compiler frontend like -Xexperimental must
be specified per compilation while options related to the compiler
backend (e.g. -opt, -g, -Xstatic-framework etc) - per binary.

This path shows a special warning if some of "binary-specific"
arguments are passed to a compilation.
2019-09-16 12:45:03 +07:00
Ilya Matveev
8d495c4b45 Gradle, native: Produce binaries from klibs and bump K/N version
Earlier all native binaries were produced directly from sources of
corresponding compilations. This patch changes this behavior. Now
a klibrary produced by a compilation is used to build a final
binary instead of sources. This allows us to avoid parsing the same
sources several times and reduces build time.

This patch also updates K/N version to 1.3.60-dev-11975, to get the
corresponding support from the compiler side.

Issue #KT-33076 Fixed
2019-09-16 12:45:03 +07:00
Ilya Matveev
3a935402a4 Gradle: Deprecate native extraOpts method in favor of common API 2019-09-16 12:45:02 +07:00
Abduqodiri Qurbonzoda
f01420332f Avoid division in string-to-number conversions (KT-26309) 2019-09-15 21:08:23 +03:00
Abduqodiri Qurbonzoda
11f3c4b03f Clarify the error message when File.copyTo fails (KT-27545) 2019-09-13 21:29:13 +03:00
Igor Yakovlev
27accbb089 Fix KotlinLintTestGenerated.testParcel + extensions registrations fixes 2019-09-13 19:40:31 +03:00
Vladimir Dolzhenko
c3265a8bf0 Decrease Light classes code generation in multithreaded cases by guarding KotlinClassInnerStuffCache, LightClassDataHolder.ForClass cache values calculation with lock 2019-09-13 15:10:09 +02:00
Vladimir Dolzhenko
d3d85d50ab Rewrite KotlinClassInnerStuffCache into Kt, p2 2019-09-13 15:09:02 +02:00
Vladimir Dolzhenko
6146b0eb53 Rewrite KotlinClassInnerStuffCache into Kt, p1 2019-09-13 15:08:40 +02:00
Roman Golyshev
b422485440 KT-30996: Use the last receiver to complete dsl methods
- change `detectReceiverTypes` return type to `List` instead of `Collection`
  - it reflects that receiver types are actually ordered
  - did not propagate signature changes to all possible places because it creates too much noise in git history
- ^KT-30996 Fixed
2019-09-13 15:52:52 +03:00
Ilya Chernikov
b2d2ba5811 Refactor test utils: don't add main-kts to the classpath...
by default on running scripting tests via the call to K2JVMCompiler
2019-09-13 13:19:26 +02:00
Ilya Chernikov
49003c9839 Do not embed script-runtime into main-kts:
it is unused in it and may interfere with mixed usages when
main-kts is used along with legacy/default scripts
2019-09-13 13:19:26 +02:00
Ilya Chernikov
a12ea37ae8 [minor] Fix non-fatal exception during the embeddable test 2019-09-13 13:19:26 +02:00
Ilya Chernikov
45f5c42a53 Add appropriate script extension to the source name, if not provided
#KT-31704 fixed
2019-09-13 13:19:26 +02:00
Ilya Chernikov
92778cc5b5 Set contextClassLoader for the script evaluation
#KT-31661
2019-09-13 13:19:26 +02:00
Ilya Chernikov
939d76fd2a Isolate script execution from compiler classloader
Since fix of KT-33554, the script execution classpath is set correctly
according to the compilation classpath, so isolation makes sense now.
2019-09-13 13:19:26 +02:00
Ilya Chernikov
771f5c13dd Fix imported script functionality in JSR-223/REPL:
- setup compilation properly to take imported scripts into account
- add compiled imported scripts into generated results
= calculate ScriptLightVirtualFile path as relative - simplifies imported scripts location
2019-09-13 13:19:26 +02:00
Ilya Chernikov
0fe137d75c Fix script arguments order for imports with implicit receivers
#KT-33572 fixed
2019-09-13 13:19:25 +02:00
Ilya Chernikov
8989bfa235 Fix main-kts jsr223 direct bindings processing
Before the jsr context was configured only when a dependency or import
annotation is encountered, so direct properties mapping didn't work
without using any of the annotations. (It was implemented like this
as a workaround due to the problem with handlers composability, that was
fixed some time ago.)
2019-09-13 13:19:25 +02:00
Ilya Chernikov
c5f9e0a399 Fix host configuration replacements 2019-09-13 13:19:25 +02:00
Ilya Chernikov
f350c24846 Implement more general "apply defaults" functionality for host configurations 2019-09-13 13:19:25 +02:00
Ilya Goncharov
e3187217ee Fix executable files for nodejs
- For windows NPM doesn't create symlinks, but cretae CMD files, so it is necessary to provide path to JS file explicitly

#KT-33710 fixed
2019-09-13 12:44:56 +03:00
Ilya Goncharov
2fe5feac94 Remove source map support runtime for webpack
- Browsers support source maps OOB
- source-map-support is necessary to install to make a sense, but now we only include it in bundle w/o installing
- Additional webpack's options like output.library doesn't works with multiple entries if last item is not bundled library

#KT-33288 fixed
2019-09-13 12:40:35 +03:00
Dmitriy Novozhilov
8614323f80 [FIR] Tests. Update some outdated testdata 2019-09-13 12:21:59 +03:00
Dmitriy Novozhilov
b76b4b0229 [FIR] Pass flow to local functions 2019-09-13 12:21:59 +03:00
Dmitriy Novozhilov
e1947e6884 [FIR] Don't create synthetic calls for when with only one branch 2019-09-13 10:42:19 +03:00
Dmitriy Novozhilov
43a873a2ec [FIR] Make SimpleFlow (old implementation) implement abstract Flow 2019-09-13 10:42:19 +03:00
Dmitriy Novozhilov
60343c721c [FIR] Make Flow and LogicSystem abstract
It's needed for simple changing of different Flow implementations
2019-09-13 10:42:19 +03:00
Dmitriy Novozhilov
c19da5846c [FIR] Fix processing inPlace lambdas as named arguments 2019-09-13 10:42:19 +03:00
Dmitriy Novozhilov
3ff185d36c [FIR] Dummy fix of lambda functions inside init block
Init still works not well, but now they at least don't fail
2019-09-13 10:42:19 +03:00
Dmitriy Novozhilov
0e0e6da917 [FIR] Fix passing flow throw loops 2019-09-13 10:42:19 +03:00
Dmitriy Novozhilov
f77a414e93 [FIR] Fix passing flow throw try expression 2019-09-13 10:42:19 +03:00
Dmitriy Novozhilov
be58e95b2b [FIR] Replace Flow with DelegatingFlow 2019-09-13 10:42:19 +03:00
Dmitriy Novozhilov
44571fbd8f [FIR] Minor. Extract methods used DataFlowInfo from DataFlowInferenceContext 2019-09-13 10:42:18 +03:00
Dmitriy Novozhilov
65edf73bee [FIR] Add node for enter to body of when branch 2019-09-13 10:42:18 +03:00
Dmitriy Novozhilov
531c2b9617 [FIR] Add supprot of InvocationKind.UNKNOWN for in-place lambdas 2019-09-13 10:42:18 +03:00
Dmitriy Novozhilov
2f6f07bc7d [FIR] Remove callbacks from stacks in DFA 2019-09-13 10:42:18 +03:00
Dmitriy Novozhilov
beaab19eb9 [FIR] Replace ControlFlowGraphNodeBuilder with extensions on ControlFlowGraphBuilder 2019-09-13 10:42:18 +03:00
Dmitriy Novozhilov
15ff86fc50 [FIR] Refactor DataFlowVariables
Make inheritors of DataFlowVariable public, replace flags in DFV with types
2019-09-13 10:42:18 +03:00
Dmitriy Novozhilov
f9d45d2f2a [FIR] Some minor fixes in DFA after review 2019-09-13 10:42:18 +03:00
Dmitriy Novozhilov
6b7aa21b8f [FIR] Minor. Remove useless creating data flow variables for value parameters 2019-09-13 10:42:18 +03:00
Dmitriy Novozhilov
cb1322eaef [FIR] Add smartcasts on implicit receivers 2019-09-13 10:42:18 +03:00
Dmitriy Novozhilov
f8459f8201 [FIR] Fix result type of const expressions with expected type 2019-09-13 10:42:17 +03:00
Dmitriy Novozhilov
546bbceeea [FIR] Reduce coping of flow and inline default value of it 2019-09-13 10:42:17 +03:00
Dmitriy Novozhilov
c2180b9361 [FIR] Move reporting of errors in modularized tests in separate log file 2019-09-13 10:42:17 +03:00
Igor Yakovlev
5dc29b9059 Fix build 183 - add missing functions 2019-09-12 18:42:56 +03:00
Simon Ogorodnik
375920da58 [FIR] Add gradle property for extending jvmArgs of modularized test 2019-09-12 18:06:47 +03:00
Igor Yakovlev
841ed45440 Fix build 183 - missing imports added 2019-09-12 17:53:31 +03:00
Dmitry Petrov
cb13dd3cdd Add psi2ir tests for 'break' and 'continue' inside 'when' 2019-09-12 15:11:01 +03:00
Dmitry Petrov
f3837e91e3 Add BE tests for 'break' and 'continue' inside 'when' 2019-09-12 15:11:01 +03:00
Dmitry Petrov
f06f6f4660 Allow 'break' and 'continue' inside 'when' in 1.4+ 2019-09-12 15:11:00 +03:00
Pavel Kirpichenkov
55cb9561c2 Provide better error messages for read-only delegate
Split error reporting into two parts for incorrect and missing candidates.
Missing function error is not reported on provideDelegate.
Update error factory and default message for error.
Update error texts in quick fix test data.

#KT-16526 Fixed
2019-09-12 14:58:21 +03:00
Dmitriy Novozhilov
68bcdaa6c3 Don't ask for member scope for ILT in IterableTypesDetection
EA-206183 fixed
2019-09-12 12:27:12 +03:00
Mikhail Zarechenskiy
7472c789c6 Add tests for obsolete issues
#KT-28001 Obsolete
 #KT-30236 Obsolete
2019-09-12 12:03:01 +03:00
Natalia Selezneva
89140be71d Minor: better error message 2019-09-12 09:56:42 +03:00
Natalia Selezneva
6d53636cc9 Minor: extract classes 2019-09-12 09:56:42 +03:00
Natalia Selezneva
8f2aaf62c2 Implement modification stamp for ScriptInitializer
This should influence ResolveElementCache to correctly update caches
because it rely on modifications stamps of the declaration
Before this change file.modificationStamp was used for script initializers in file, so they all became outdated after some change in file
2019-09-12 09:56:42 +03:00
Alexander Udalov
d6cb857c97 JVM IR: don't use descriptors to map suspend function types 2019-09-11 23:33:11 +02:00
Alexander Udalov
34d2d7374c Do not use KotlinTypeMapper in enum values/valueOf intrinsic
Remove KotlinTypeMapper from inlineIntrinsics.kt completely
2019-09-11 23:33:11 +02:00
Alexander Udalov
8cdec31990 Do not use KotlinTypeMapper in coroutine inline intrinsics 2019-09-11 23:33:11 +02:00
Alexander Udalov
d16bdded7f JVM IR: reuse JVM code for reified type parameter mappings instead of copy-paste 2019-09-11 23:33:11 +02:00
Alexander Udalov
d1df453edc Do not use KotlinTypeMapper in generateTypeOf inline intrinsic
Make ReifiedTypeInliner and related classes generic over the
KotlinTypeMarker subtype (KotlinType or IrType), add a typeSystem to get
arguments/nullability and other properties of types regardless of their
representation, but still fall back to KotlinType when generating the
actual bytecode of other intrinsics (as/is)
2019-09-11 23:33:11 +02:00
Alexander Udalov
ece09866f0 Simplify reified operations on type parameters in ExpressionCodegen
Move the "without propagation" logic to ReifiedTypeInliner since it's
only used from inline intrinsics.
2019-09-11 23:33:10 +02:00
Alexander Udalov
8efbcc5350 Do not use KotlinTypeMapper when generating JVM assert inline intrinsics 2019-09-11 23:33:10 +02:00
Andrey Uskov
15bfb7498c Minor. Fix target platforms formatting in FacetSettings
#KT-33813 Fixed
2019-09-11 22:57:11 +03:00
Nikolay Krasko
a5b21308fd Minor refactoring for TypeHints properties (KT-22433) 2019-09-11 17:42:05 +03:00
Toshiaki Kameyama
36de8f1aa9 Type hints: don't show for incomplete expressions followed by Unit type expressions (KT-22433)
#KT-22433 Fixed
2019-09-11 17:42:04 +03:00
Toshiaki Kameyama
6e852837f7 Folding: fold "when" expression (KT-6314)
#KT-6314 Fixed
2019-09-11 17:42:04 +03:00
Igor Yakovlev
cfcecaaeab LightClassApplicabilityCheckExtensions refactoring and IdeSerializationPluginApplicabilityExtension fix 2019-09-11 17:05:13 +03:00
Igor Yakovlev
2b7dee6f8d Add CodegenApplicabilityCheckerExtension and use it to fallback to Heavy LigthClasses
+ Fixed #KT-33584
2019-09-11 15:29:12 +03:00
Nikolay Krasko
f3b7d2fca9 Fix exception of getting parent for the root package (EA-210820) 2019-09-11 12:51:55 +03:00
Nikolay Krasko
d3f03cc607 Remove deprecated usage of BulkFileListener.Adapter 2019-09-11 12:40:26 +03:00
Nikolay Krasko
7f8774f68e Fix NPE in KotlinIndicesHelper (EA-209799) 2019-09-11 12:40:26 +03:00
Nikolay Krasko
90511c734d Fix NPE in JavaToKotlinAction (EA-210821) 2019-09-11 12:40:26 +03:00
Alexander Udalov
77399a175e Cleanup compiler warnings in compiler tests 2019-09-11 10:47:34 +02:00
Mads Ager
90a37617a4 [JVM_IR, IR] Remove more needless temporary variables.
Avoid using a separate origin for temporary variables introduced
for for loops. That doesn't add anything and gives one more case
for optimizations to deal with.

Extend the JVM specific optimizations to remove temporary
variables to deal with more cases encountered in for loops
lowering.
2019-09-11 10:07:45 +02:00
Roman Artemev
e5a1040dbd [KLIB] Fix references to private top-level typealias via type abbreviation 2019-09-10 19:59:01 +03:00
Dmitriy Novozhilov
40ebe4063c [FIR] Refactor collecting statistics in modularized tests
Also add printing statistics of best pass at the end of build log
2019-09-10 18:34:03 +03:00
Dmitriy Novozhilov
6a75a9072c [FIR] Remove redundant resolution stage from resolution of synthetic function calls 2019-09-10 18:34:02 +03:00
Dmitriy Novozhilov
ef5ac7df93 [FIR] Don't create member function for each when and try expression
Use one function (per session) instead
2019-09-10 18:34:02 +03:00
Yan Zhulanow
996d9a5d90 Pill: Enable Pill for FIR visualizer modules 2019-09-10 21:38:38 +09:00
Vladimir Dolzhenko
d1285d9dbf Fix performanceTests for 192; Add perfCounters 2019-09-10 14:02:56 +02:00
Igor Yakovlev
8fa67f0478 Add correct modification tracking on UltraLight classes
Fixed #KT-32820
2019-09-10 14:38:10 +03:00
Ilya Kirillov
b2002d56bd New J2K: move type calculation to expression node 2019-09-10 14:09:31 +03:00
Ilya Kirillov
be94eb5405 New J2K: remove extra interfaces in AST structure & split AST definitions to proper files 2019-09-10 14:09:30 +03:00
Ilya Kirillov
fd85c2bb43 New J2K: use mutable lists for storing comments 2019-09-10 14:09:30 +03:00
Ilya Kirillov
5d99419e9c New J2K: check call name before resolving in post-processing 2019-09-10 14:09:29 +03:00
Ilya Kirillov
dca0dc1933 New J2K: do not recalculate types for binary & unary expressions and rewrite assignment expressions conversion
#KT-33679 fixed
2019-09-10 14:09:29 +03:00
Ilya Kirillov
c93d810685 New J2K: introduce TypeFactory for creating J2K types 2019-09-10 14:09:28 +03:00
Ilya Kirillov
047bb07727 New J2K: store reference to conversionContext & symbolProvider in conversion 2019-09-10 14:09:27 +03:00
Ilya Kirillov
eb690f451e New J2K: do not recreate typeElement on updating type 2019-09-10 14:09:26 +03:00
Ilya Kirillov
f61bb5aa39 New J2K: implement mutability inference in post-processing
#KT-24293 fixed
#KT-19603 fixed
2019-09-10 14:09:26 +03:00
Ilya Kirillov
c28515be59 New J2K: use nullable type for unknown for public declarations & prepare for mutability inference
#KT-32518 fixed
2019-09-10 14:09:25 +03:00
Simon Ogorodnik
0040490daf [FIR] Fix FIR modularized tests after switch to 192 2019-09-10 12:33:00 +03:00
Ilya Goncharov
fc4bcfb536 Add test on yarn downloading non-default version
- Previously we skipped yarn setup, if yarn folder exists, not paying attention on what concrete yarn version installed
2019-09-10 10:44:30 +03:00
Ilya Goncharov
8a6ee66f81 Yarn manipulation in build script
- Remove yarn folder in task inside build script to not import GradleUserHomeLookup
- Check yarn folder existence in task inside build script
2019-09-10 10:44:30 +03:00
Ilya Goncharov
48c06aeeba Add test for yarn setup by kotlinYarnSetup task 2019-09-10 10:44:30 +03:00
Ilya Goncharov
f609e21c82 Remove asserts, that failed build
- TeamCity cannot run browser tests yet, so disable such assertions related with browser tests checking

#KT-32075 fixed
2019-09-10 10:39:11 +03:00
Ilya Goncharov
49391e64d6 Add testing for karma use puppeteer for downloading chrome 2019-09-10 10:35:31 +03:00
Ilya Goncharov
18f2ba889e Make envJsCollector as map 2019-09-10 10:35:30 +03:00
Ilya Goncharov
3bfb980a39 Collect env variables to separate collector 2019-09-10 10:35:30 +03:00
Ilya Goncharov
613391d00b Add puppeteer for Chrome browsers 2019-09-10 10:35:30 +03:00
Ilya Goncharov
df646233ef Fix KarmaConfig file name 2019-09-10 10:35:30 +03:00
Vasily Levchenko
89d49479ab [util-io][properties] close file stream after save property operation ends.
(cherry picked from commit f0ae971f9304ecd7a2ba134ab77b511a0569ed5f)
2019-09-09 21:14:19 +03:00
Sebastian Schuberth
cc40387788 YarnSetupTask: Remove a too coarse "onlyIf" in the "init" block
"installationDir" is the non-version specific top-level Yarn
installation directory simply called "yarn". Checking for its existence
is not sufficient to be able to skip the task, as another version than
the requested one could be installed below the "yarn" directory.

Instead of taking the version into account in this check, simply remove
it as the version-specific installation directory at "env.home" is
already marked as an "OutputDirectory", so Gradle itself already takes
care of skipping task execution if the output files were created before.
2019-09-09 17:03:17 +03:00
Mikhail Zarechenskiy
85ff979bd4 Use PARTIAL mode in analyzer to provide lambda return value hints
It only uses `isUsedAsResultOfLambda` (so, CFA) and don't have to
 resolve bodies fully
2019-09-09 15:22:41 +03:00
Nikolay Krasko
d253cd5032 Ignore external annotations in AbstractResolveByStubTest (KT-33732)
In IDE with have descriptors with additional annotations obtained from
external annotations manager. They are probably only java overrides so
shouldn't be present in stubs, thus must be ignored in this test.

Tests with enums started to fail after upgrading to 192 platform because
of additional NotNull annotation on `getDeclaringClass()` method.

 #KT-33732 Fixed
2019-09-09 14:35:58 +03:00
Nikolay Krasko
80b5c76d98 Minor: fix warnings in AbstractResolveByStubTest 2019-09-09 14:35:58 +03:00
Kristoffer Andersen
e7d0909979 JVM_IR: Fix null-constant comparison with primitive types. 2019-09-09 10:23:11 +02:00
Mikhail Zarechenskiy
e21da3a61a Avoid resolving array-set method several times
While origin problem was in NI, it's also nice to have this change in OI
 in order to slightly improve performance

 #KT-33125 Fixed
2019-09-09 11:04:18 +03:00
Mikhail Zarechenskiy
f8449bf15a [NI] Clear partially resolved calls after resolve of top-level call
#KT-32433 Fixed
2019-09-09 11:04:17 +03:00
Mikhail Zarechenskiy
f305475e3f Make "nothing to inline" diagnostic shorter
#KT-33421 Fixed
2019-09-09 11:04:17 +03:00
Mikhail Zarechenskiy
dc25f7b7ac [NI] Minor, remove unneeded computation of constant evaluator 2019-09-09 11:04:16 +03:00
Denis Zharkov
3569eaabcf Rename FirJavaElementFinder.kt.as34 to FirJavaElementFinder.kt.183 2019-09-09 10:14:19 +03:00
Steven Schäfer
62a1ea643a Add additional tests for bound receivers in callable references 2019-09-06 15:11:59 +02:00
Steven Schäfer
d89d68e3df JVM IR: Cache SAM wrappers in top-level classes and use proper naming scheme 2019-09-06 15:11:59 +02:00
Steven Schäfer
2be4abe9a6 Refactoring: Consistently use Symbols in JvmSymbols 2019-09-06 15:11:59 +02:00
Steven Schäfer
c77fa1ecd6 JVM IR: Fixes in SAM lowering 2019-09-06 15:11:59 +02:00
Denis Zharkov
829102b3e3 FIR: Fix exception in inference
Default SimpleTypeMarker::withNullability from ConeTypeContext
doesn't take into account inference-related type kinds like type variables

These cases are properly handled in
org.jetbrains.kotlin.fir.resolve.ResolveUtilsKt#withNullability

Original exception trace:
	at org.jetbrains.kotlin.fir.types.ConeTypeContext$DefaultImpls.withNullability(ConeTypeContext.kt:142)
	at org.jetbrains.kotlin.fir.resolve.calls.ConeInferenceContext$DefaultImpls.withNullability(ConeInferenceContext.kt)
	at org.jetbrains.kotlin.fir.resolve.transformers.FirBodyResolveTransformerKt$inferenceComponents$1.withNullability(FirBodyResolveTransformer.kt:943)
	at org.jetbrains.kotlin.fir.resolve.calls.ConeInferenceContext$DefaultImpls.makeSimpleTypeDefinitelyNotNullOrNotNull(ConeInferenceContext.kt:195)
	at org.jetbrains.kotlin.fir.resolve.transformers.FirBodyResolveTransformerKt$inferenceComponents$1.makeSimpleTypeDefinitelyNotNullOrNotNull(FirBodyResolveTransformer.kt:943)
	at org.jetbrains.kotlin.resolve.calls.inference.model.NewConstraintSystemImpl.makeSimpleTypeDefinitelyNotNullOrNotNull(NewConstraintSystemImpl.kt)
	at org.jetbrains.kotlin.resolve.calls.inference.components.ConstraintInjector$TypeCheckerContext.makeSimpleTypeDefinitelyNotNullOrNotNull(ConstraintInjector.kt)
	at org.jetbrains.kotlin.resolve.calls.inference.components.AbstractTypeCheckerContextForConstraintSystem.simplifyLowerConstraint(AbstractTypeCheckerContextForConstraintSystem.kt:163)
	at org.jetbrains.kotlin.resolve.calls.inference.components.AbstractTypeCheckerContextForConstraintSystem.internalAddSubtypeConstraint(AbstractTypeCheckerContextForConstraintSystem.kt:71)
	at org.jetbrains.kotlin.resolve.calls.inference.components.AbstractTypeCheckerContextForConstraintSystem.addSubtypeConstraint(AbstractTypeCheckerContextForConstraintSystem.kt:50)
	at org.jetbrains.kotlin.types.AbstractTypeChecker.completeIsSubTypeOf(AbstractTypeChecker.kt:193)
	at org.jetbrains.kotlin.types.AbstractTypeChecker.isSubtypeOf(AbstractTypeChecker.kt:164)
	at org.jetbrains.kotlin.resolve.calls.inference.components.ConstraintInjector$TypeCheckerContext.runIsSubtypeOf(ConstraintInjector.kt:153)
	at org.jetbrains.kotlin.resolve.calls.inference.components.ConstraintInjector.addSubTypeConstraintAndIncorporateIt(ConstraintInjector.kt:77)
	at org.jetbrains.kotlin.resolve.calls.inference.components.ConstraintInjector.addInitialSubtypeConstraint(ConstraintInjector.kt:55)
	at org.jetbrains.kotlin.resolve.calls.inference.model.NewConstraintSystemImpl.addSubtypeConstraint(NewConstraintSystemImpl.kt:84)
	at org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystemBuilderKt$addSubtypeConstraintIfCompatible$1.invoke(ConstraintSystemBuilder.kt:61)
	at org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystemBuilderKt$addSubtypeConstraintIfCompatible$1.invoke(ConstraintSystemBuilder.kt)
	at org.jetbrains.kotlin.resolve.calls.inference.model.NewConstraintSystemImpl.runTransaction(NewConstraintSystemImpl.kt:130)
	at org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystemBuilderKt.addSubtypeConstraintIfCompatible(ConstraintSystemBuilder.kt:60)
	at org.jetbrains.kotlin.fir.resolve.calls.ArgumentsKt.checkApplicabilityForArgumentType(Arguments.kt:170)
	at org.jetbrains.kotlin.fir.resolve.calls.ArgumentsKt.resolvePlainArgumentType(Arguments.kt:158)
	at org.jetbrains.kotlin.fir.resolve.calls.ArgumentsKt.resolveSubCallArgument(Arguments.kt:123)
	at org.jetbrains.kotlin.fir.resolve.calls.ArgumentsKt.resolveArgumentExpression(Arguments.kt:42)
	at org.jetbrains.kotlin.fir.resolve.calls.ArgumentsKt.resolveArgument(Arguments.kt:196)
	at org.jetbrains.kotlin.fir.resolve.calls.CheckArguments.check(ResolverParts.kt:145)
	at org.jetbrains.kotlin.fir.resolve.calls.CheckArguments$check$1.invokeSuspend(ResolverParts.kt)
2019-09-06 13:45:28 +03:00
Denis Zharkov
8c52ff31b3 Add bunch for AS34: FirJavaElementFinder 2019-09-06 13:45:28 +03:00
Denis Zharkov
3f0887dc0c FIR: Do not try building light classes for invalid names 2019-09-06 13:45:28 +03:00
Denis Zharkov
106b6c901d FIR: Get rid of FirRegularClass::setCallbackOnSupertypesComputed 2019-09-06 13:45:28 +03:00
Denis Zharkov
122c229a8b FIR: Add possibility to run SupertypeResolverTransformer ad-hoc 2019-09-06 13:45:28 +03:00
Denis Zharkov
d9d6c38c2b FIR: Introduce FirClassLikeDeclaration::supertypesComputationStatus 2019-09-06 13:44:32 +03:00
Denis Zharkov
6058f9d286 FIR: Avoid recursions while building Java enhancement scopes 2019-09-06 13:44:32 +03:00
Denis Zharkov
7f5c4d90fd FIR: make "collectSuperTypes" recursion-resistant 2019-09-06 13:44:32 +03:00
Denis Zharkov
1f23184db9 FIR: Get rid of code duplication in SupertypesUtils.kt 2019-09-06 13:44:32 +03:00
Denis Zharkov
bf610323cf Support basic light-classes basic with FIR for CLI 2019-09-06 13:44:32 +03:00
Steven Schäfer
e7410348a7 JVM IR: Fix visibility for @InlineOnly functions 2019-09-06 12:12:58 +02:00
Steven Schäfer
ee45933e33 JVM IR: Create local classes in PropertyReferenceLowering
In particular, we should not cache classes or instances for property
references, since they may be used inside of inline funtions. This also
allows us to mark the $$delegatedProperties array as package private.
2019-09-06 12:12:58 +02:00
Steven Schäfer
626f4c94f6 Handle special case visibility rules in LocalDeclarationsLowering 2019-09-06 12:12:58 +02:00
Roman Golyshev
9a938b07ba KT-17689: Fix TypeAliasQualifier to provide enum entries descriptors
- this adds enum entries to the completion on the typealiases
- we cannot use `unsubstitutedInnerClassesScope` instead of `EnumEntriesScope` because it allows to complete things that are not allowed to be resolved by the Kotlin compiler; see `EnumEntriesScope` doc for details
- ^KT-17689 Fixed
2019-09-06 12:11:23 +03:00
Roman Golyshev
f419d2eb30 KT-33585: Add synchronization between scratch editor and preview
- fix problem with not working shortcuts in the preview window by passing more params into view editor creation
2019-09-06 12:03:35 +03:00
Roman Golyshev
d12d9d86bc KT-33585: Refactor KtsScratchFileEditorWithPreview and its output handlers
- now `PreviewOutputBlocksManager` is injected into `PreviewEditorScratchOutputHandler`, so `KtsScratchFileEditorWithPreview` can use it too
2019-09-06 11:36:37 +03:00
Nikolay Krasko
edb700b898 Switch to 192 platform 2019-09-06 11:28:25 +03:00
Dmitry Gridin
650a6e5cc4 MakeOverriddenMemberOpenFix: should update actual members
#KT-32586 Fixed
2019-09-06 15:25:01 +07:00
Dmitry Gridin
58d303afcc MakeOverriddenMemberOpenFix: cleanup code 2019-09-06 15:25:01 +07:00
Natalia Selezneva
3f451d7eaf Switch off SAM adapter conversion for constructors in completion
It is very slow in completion for build.gradle.kts because it creates SAM adapters for constructors of all imported classes
Note that those SamAdapters weren't shown in completion in any case because they were filtered by name filter (SamAdapters for constructors have <init> name)
2019-09-06 10:53:16 +03:00
Natalia Selezneva
f7b8c7f76e Check that project isn't disposed showing notification for scripts
EA-209612 - (Scripting, Notification) assert: ComponentManagerImpl.lambda$throwAlreadyDisposed$
2019-09-06 10:53:15 +03:00
Natalia Selezneva
fb01f7be5e Rename ScriptDependenciesManager to ScriptConfigurationManager 2019-09-06 10:52:59 +03:00
Natalia Selezneva
fa6b5b567b Fix org.jetbrains.kotlin.idea.script.ScriptConfigurationHighlightingTestGenerated.Highlighting.testThrowingResolver 2019-09-06 10:52:30 +03:00
Natalia Selezneva
961e8c2c74 Refactor the mechanism how script configurations are updated
Introduce file attributes cache, which is only applicable when no dependencies are cached in memory cache
Refactor ScriptDependenciesCache to memory cache that is able to get configuration from cache and checks if it is up to date
Move all public methods to ScriptDependenciesManager
Introduce ScriptClassRootsManager that checks if root change event should be called after script configuration update
2019-09-06 10:52:17 +03:00
Natalia Selezneva
dc46f73ecf Rewrite scripting related API to PsiFile instead of VirtualFile
There were several places where we converted virtualFile to PsiFile. This operation need a read access and may throw ProcessCanceledException,
so we want to minimize its usages in IDE
2019-09-06 10:51:26 +03:00
Sergey Rostov
5b48dcca4f ResultWithDiagnostics: remove unused equals and hashCode
They are overridden by sealed data classes
2019-09-06 09:33:33 +03:00
Mikhail Glukhikh
91f39a0ecf FIR [optimization]: eliminate some unnecessary ScopeSessions 2019-09-06 09:29:19 +03:00
Georgy Bronnikov
7ede26e8f4 IrCompileKotlinAgainstInlineKotlin tests 2019-09-06 09:19:57 +03:00
Nikolay Krasko
0807987ef7 Update 192 to release version 2019-09-05 19:39:04 +03:00
Nikolay Krasko
655e77b0dd Update lz4 for 192 in :compiler:incremental-compilation 2019-09-05 19:39:03 +03:00
Ilya Ryzhenkov
7968ecef1c Initial import of benchmarks from https://github.com/dzharkov/kotlin-compiler-benchmarks 2019-09-05 18:31:54 +03:00
Vyacheslav Gerasimov
1bd5b68b4a Build: Instrument only java tasks for main & test source sets 2019-09-05 18:31:54 +03:00
Vyacheslav Gerasimov
50eb98194a Build: Move dependencies.properties to the root build directory 2019-09-05 17:21:48 +03:00
pyos
20626e4aaf Make ReturnableBlockLowering common
and remove special handling in JVM_IR codegen.
2019-09-05 15:48:26 +02:00
Sascha Peilicke
ae8c93de6a Support symlinked JAVA_HOME
When testing for the JAVA_HOME environment variable, expand potential
symlinks first. This is almost guaranteed to be the case on all modern
Linux distributions putting the JDK / JRE behind update-alternatives to
be able to select the *current* version [0], e.g. on Fedora:

  $ ls -l $JAVA_HOME
  lrwxrwxrwx. ... /usr/lib/jvm/java -> /etc/alternatives/java_sdk

[0] https://linux.die.net/man/8/update-alternatives
2019-09-05 16:36:08 +03:00
Mikhail Glukhikh
98f72e58bd FIR deserializer: use class type parameters in constructor directly
This allows calls like Pair(...) to be resolved correctly
2019-09-05 16:26:15 +03:00
Mikhail Glukhikh
6a7ebe8928 FIR substitution: do not create fake overrides if types aren't changed 2019-09-05 16:26:14 +03:00
Mikhail Glukhikh
5386cfe254 FIR2IR: support fake overridden properties 2019-09-05 16:26:14 +03:00
Mikhail Glukhikh
687db20029 FIR: support fake overrides for properties 2019-09-05 16:26:14 +03:00
Mikhail Glukhikh
5741ff5d86 FIR: split default importing scopes into low/high priority ones
This fixes resolve of StringBuilder(), AssertionError(), etc.
2019-09-05 16:26:14 +03:00
Mikhail Glukhikh
044dfd14ce FIR: more accurate type checking in typeFromCallee 2019-09-05 16:26:06 +03:00
Ilya Goncharov
c27ed0cfd3 Update ReadMe for gradle-plugin-integration-tests 2019-09-05 14:37:00 +03:00
Nikolay Krasko
5deaca9ace Fix building tests for fir:lightTree in 192 branch 2019-09-05 14:35:17 +03:00
Nikolay Krasko
7bdde7cad3 Disable HierarchicalMultiplatformProjectImportingTest in Android Studio (KT-33067) 2019-09-05 14:35:17 +03:00
Andrey Uskov
48d666daea Make platforms order reproducible in iml-files
#KT-33316 Fixed
2019-09-05 14:14:33 +03:00
Dmitry Gridin
a843c23f20 Completion: add root prefix support
#KT-10340 Fixed
2019-09-05 18:01:23 +07:00
Dmitry Gridin
7a4c3e4d6a BaseDeclarationInsertHandler: fix startOffset 2019-09-05 18:01:23 +07:00
Dmitry Gridin
c4a1101600 KtSimpleNameReference: add root prefix support to bindToFqName function 2019-09-05 18:01:23 +07:00
Dmitry Gridin
2e781a7a27 KtSimpleNameReference: cleanup code 2019-09-05 18:01:22 +07:00
Dmitry Gridin
dd2bd320ba ShortenReferences: add root prefix support
#KT-9204 Fixed
2019-09-05 18:01:22 +07:00
Dmitry Gridin
0c81173b71 idea-core.Utils: add extension to FqName to support root prefix 2019-09-05 18:01:22 +07:00
Dmitry Gridin
953aaadee1 idea-core.Utils: cleanup code 2019-09-05 18:01:22 +07:00
Dmitry Gridin
14ad6284d9 QualifiedExpressionResolver: add root prefix resolve for IDE analysis 2019-09-05 18:01:22 +07:00
Dmitry Gridin
68d20dae66 QualifierExpressionResolver: cleanup code 2019-09-05 18:01:22 +07:00
Dmitry Gridin
4224d109e2 AnalysisFlags: add flag ideMode for IDE specific analysis 2019-09-05 18:01:22 +07:00
Andrey Uskov
106452b5f0 Add list of modules available via dependsOn in FacetSettings 2019-09-05 13:58:58 +03:00
Andrey Uskov
4642127c28 Introduce versioning of multiplatform in KotlinFacetSettings 2019-09-05 13:58:51 +03:00
Mads Ager
75f9532959 [IR] Avoid duplicate IR elements in for loops lowering. 2019-09-05 11:33:26 +02:00
Sebastian Schuberth
4ce6a54236 YarnSetupTask: Fix setup() to be a Gradle TaskAction 2019-09-05 11:30:22 +03:00
Roman Artemev
0040298eac Fix master
- improve assertion message
 - compare correct file paths
 - fix C JS BE testData
2019-09-04 14:37:14 +03:00
Roman Golyshev
870dbd158c KT-28910: Add tooltips for toolbar checkboxes in .kts scratch editor
- make `ScratchFileAutoRunner.AUTO_RUN_DELAY_IN_SECONDS` public
- remove `Show preview only` mode button from the toolbar
- ^KT-28910 Fixed
2019-09-04 10:56:41 +03:00
Roman Golyshev
f0f2fd5684 KT-28910: Extract labels from scratch editor to KotlinBundle messages 2019-09-04 10:56:41 +03:00
Ilya Chernikov
72b68ee683 Fix proguarding of jline library in compiler
#KT-32234 fixed
#KT-32259 fixed
2019-09-04 09:35:04 +02:00
Mads Ager
3f28b71509 [IR] Fix issue getting the length property from CharSequence bounded type parameter
Use the class of the subtype of CharSequence when available. When
it is not (for type parameters bounded by CharSequence) call the
CharSequence getter and 'get' method. Using the most specific type
posible fixes the forInStringSpecialized test that expects the
use of INVOKEVIRTUAL and not INVOKEINTERFACE.

Add tests for the type parameter use.
2019-09-03 20:18:03 +02:00
Alexander Udalov
eb5e91d6bb Do not use typeMapper to count number of coroutine parameters in MethodInliner 2019-09-03 19:33:55 +02:00
Alexander Udalov
2648fb2ddd Do not use typeMapper.mapAsmMethod for erased invoke in MethodInliner
Return type of erased `invoke` is always java/lang/Object anyway
2019-09-03 19:33:54 +02:00
Alexander Udalov
4953f67563 JVM IR: do not use KotlinTypeMapper indirectly via InlineCodegen
Move JVM signature and method owner computation out of InlineCodegen's
constructor to the call sites.
2019-09-03 19:33:54 +02:00
Alexander Udalov
ad8b7ff645 Minor, extract PsiInlineCodegen to a separate file 2019-09-03 19:33:54 +02:00
Alexander Udalov
bf5ca2ed84 Cleanup compiler warnings in IR-related modules 2019-09-03 19:32:57 +02:00
Alexander Udalov
406462d422 Regenerate FIR tree visitors and transformers 2019-09-03 16:37:53 +02:00
Sergey Bogolepov
ac3864543c Add Family.TVOS, Family.WATCHOS and KonanTarget.ANDROID_X86, KonanTarget.WATCHOS_X86, KonanTarget.WATCHOS_ARM32. 2019-09-03 18:54:30 +07:00
Igor Chevdar
5bd88f3191 [IR] ForLoopsLowering: fixed problems with type parameters 2019-09-03 14:40:06 +03:00
Roman Artemev
21c7c89dbc [JS KLIB IC] Support incremental klib generation for JS IR
Note: the following test do not work yet because of IrField FO issue
testSecondaryConstructorAdded
testCompanionObjectInheritedMemberChanged
2019-09-03 14:21:32 +03:00
Roman Artemev
d6facf2976 [JS KLIB IC] Fix test runner 2019-09-03 14:21:32 +03:00
Roman Artemev
3753b75609 [JS KLIB IC] Implement incremental cache for IR 2019-09-03 14:21:32 +03:00
Roman Artemev
7840cf70f0 [IC] Add missed runtime dependency 2019-09-03 14:21:32 +03:00
Roman Artemev
104a50f786 [KLIB] Update ABI version 2019-09-03 14:21:32 +03:00
Roman Artemev
6bea403338 [KLIB] Fix ir serializer output format 2019-09-03 14:21:32 +03:00
Roman Artemev
c8c9328973 [KLIB] Switch to monolithic layout 2019-09-03 14:21:32 +03:00
Roman Artemev
c8a3374829 [KLIB] Do not store Date in klib manifest 2019-09-03 14:21:31 +03:00
Roman Artemev
1cdff7810e [Psi2Ir] Fix Lazy Fake override field
- add comment about problem with DeserializedPropertyDescriptor
2019-09-03 14:21:31 +03:00
Roman Artemev
f2a5ab8c16 [IR SERIALIZATION] Fix zipped layout 2019-09-03 14:21:31 +03:00
Roman Artemev
90504c797a [IR SERIALIZATION] Add tests about klib linkage 2019-09-03 14:21:31 +03:00
Roman Artemev
1e547dd1cd [IR SERIALIZATION] Add more informative error message 2019-09-03 14:21:31 +03:00
Roman Artemev
31f3e668d2 [IR SERIALIZATION] Cleanup mangler interface 2019-09-03 14:21:31 +03:00
Roman Artemev
2e0ab8ba3f [IR SERIALIZATION] Fix ONLY_DECLARATION_HEADERS mode 2019-09-03 14:21:31 +03:00
Roman Artemev
0c7454c918 [IR SERIALIZATION] Fix forward Declarations in deserializaer 2019-09-03 14:21:31 +03:00
Roman Artemev
2bd3d90fe0 [IR SERIALIZATION] Link depend modules lazily 2019-09-03 14:21:31 +03:00
Roman Artemev
aa8b58e396 [IR SERIALIZATION] Get rid of UniqIdKey 2019-09-03 14:21:31 +03:00
Roman Artemev
aa313903cc [IR SERIALIZATION] Support both Per-File and Monolitic klib layout 2019-09-03 14:21:30 +03:00
Roman Artemev
125982841a [IR SERIALIZATION] Fix clashes 2019-09-03 14:21:30 +03:00
Roman Artemev
55f06ecff5 [IR SERIALIZATION] Fix rebase 2019-09-03 14:21:30 +03:00
Roman Artemev
16be3b6d6e [IR SERIALIZATION] Add deserializaFullModule API 2019-09-03 14:21:30 +03:00
Roman Artemev
d9affc5abb [IR SERIALIZATION] Raname IrIrSeriazlizedIrFile -> SerializedIrFile 2019-09-03 14:21:30 +03:00
Roman Artemev
f6339bcf93 [IR SERIALIZATION] Handle UniqId clashes 2019-09-03 14:21:30 +03:00
Roman Artemev
5e14b94a88 [IR SERIALIZATION] Do not track non-metadata descriptors in descriptor table 2019-09-03 14:21:30 +03:00
Roman Artemev
df5f6a2a12 [IR SERIALIZATION] Refactored uniqId allocation
- split DeclarationTable into local and global one
 - minimize usages of kotlin mangler
 - clean up interfaces
2019-09-03 14:21:30 +03:00
Roman Artemev
19b5d57f0e [IR PROTO] Delete unused proto.java files 2019-09-03 14:21:30 +03:00
Roman Artemev
b7b951c8c8 [IR] Refactoring 2019-09-03 14:21:30 +03:00
Roman Artemev
ea42eb6a5c [IR] Fix rebase 2019-09-03 14:21:29 +03:00
Roman Artemev
d50eb5ce52 [IR SERIALIZATION] Make [de]serialization processes incremental
- Use local uniqID local indexation file-local
 - Rethink the way declaration is looked for
 - Store in public file index only publicly accessible symbols
 - refactor API
 - code clean up
2019-09-03 14:21:29 +03:00
Roman Artemev
96a2cc1f17 [JS IR] Clean up Declaration Table code 2019-09-03 14:21:29 +03:00
Roman Artemev
f14107bf65 [IR] Sort dependencies a bit early 2019-09-03 14:21:29 +03:00
Roman Artemev
1465121266 [IR] Split declaration & descriptor tables 2019-09-03 14:21:29 +03:00
Roman Artemev
a7714a5589 [JS IR BE] Split IrModule/IrFile serializers 2019-09-03 14:21:29 +03:00
Roman Artemev
15a49cf2aa [IR BE] Rename IrModuleSerializer -> IrFileSerializer 2019-09-03 14:21:29 +03:00
Roman Artemev
94a03c9cb4 [IC KLIB] Serialization infrastructure refactoring
- remove IrModule header
 - put IrDeclaration and its body into separate files
 - use only one type of IrData index
 - separate deserialization of declarations and its bodies
 - introduce FqName message
2019-09-03 14:21:29 +03:00
Roman Artemev
5a45960c04 [IR] Do not interact with file system during Ir Serialization
- make `IrModuleSerializer` produce ByteArrays with serialized data
 - isolate file system access on Klib writer
2019-09-03 14:21:28 +03:00
Mads Ager
85b1e0165b [IR] For loop lowering for CharacterSequence.indices. 2019-09-03 13:18:21 +02:00
Nikolay Krasko
63f43d9b2e Revert "Use lazySync instead of lazyPub to avoid raise on creation LightClasses"
The commit causes deadlock in 183 branch in KotlinLintTestGenerated test.

This reverts commit d6c54b84
2019-09-03 12:42:56 +03:00
Dmitry Gridin
d0c02a1a34 PackageDirectoryMismatchInspection: fix exception from empty script file
#KT-33437 Fixed
2019-09-03 16:20:40 +07:00
Steven Schäfer
102a3d60e0 IR: Consistently copyAttributes in DeepCopyIrTreeWithSymbols
This was missing for IrFunctionReferences, which caused problems when
copying default parameters before CallableReferenceLowering in the
JVM_IR backend.
2019-09-02 19:55:36 +02:00
Darya Razumova
5fc6fa8619 Unregistered bunch directives and files test 2019-09-02 18:31:06 +03:00
Darya Razumova
412c562572 Updated switch usage in README 2019-09-02 18:31:06 +03:00
Nikolay Krasko
4dc4acd25f Move CoroutineNonBlockingContextChecker to common code 2019-09-02 18:31:06 +03:00
Igor Yakovlev
79a603768a UltraLight implementation for local and anonymous declarations 2019-09-02 17:42:50 +03:00
Vladimir Dolzhenko
d6c54b845b Use lazySync instead of lazyPub to avoid raise on creation LightClasses 2019-09-02 15:30:08 +02:00
Nikolay Krasko
b856d60575 Add required plugins for Android Studio 3.6 to runtime 2019-09-02 15:14:32 +03:00
Nikolay Krasko
a6fb2bd7a7 Update to AS 3.6.0.9 2019-09-02 15:14:32 +03:00
Yanis Batura
a65967a164 Mention the master branch as the target of pull requests in contributing.md. (#2533)
Also, improve grammar a bit in the same guide.
2019-09-02 14:54:31 +03:00
Mikhail Glukhikh
7eac7d96dc Fix NJ2K test related to KT-30136 2019-09-02 12:57:53 +03:00
Dmitriy Novozhilov
5b118b65fc [FIR] Tests. Update testdata broken in 9508fc60 2019-09-02 11:13:27 +03:00
Dmitriy Novozhilov
54eb4cf928 [FIR] Add synthetic else branch to when if it's missing to LightTreeFirBuilder 2019-09-02 11:12:35 +03:00
Dmitriy Novozhilov
5c29af4b53 [FIR] Tests. Update some outdated FIR testdata 2019-09-02 10:43:10 +03:00
Dmitriy Novozhilov
f494e0008c [FIR] Minor. Add kdoc to FirDataFlowAnalyzer 2019-09-02 10:43:10 +03:00
Dmitriy Novozhilov
286a322b55 [FIR] Remove DummyFirDataFlowAnalyzer 2019-09-02 10:43:10 +03:00
Dmitriy Novozhilov
92acd30bd6 [FIR] Refactor Condition classes 2019-09-02 10:43:10 +03:00
Dmitriy Novozhilov
84787013dd [FIR] Fix CFG form for boolean operators 2019-09-02 10:43:10 +03:00
Dmitriy Novozhilov
63bd920f16 [FIR] Tests. Make cfg graphs more strict 2019-09-02 10:43:10 +03:00
Dmitriy Novozhilov
a87891bec9 [FIR] Some control flow graph building fixes
- fix edges for `continue` and labeled return
- fix deadness for init block and properties
2019-09-02 10:43:10 +03:00
Dmitriy Novozhilov
9508fc60c9 [FIR] Remove FirUncheckedNotNullCastImpl from FIR 2019-09-02 10:43:09 +03:00
Dmitriy Novozhilov
c2602fda1f [FIR] Transform all qualified access nodes with smartcasts 2019-09-02 10:43:09 +03:00
Dmitriy Novozhilov
c1a8344b45 [FIR] Add forgotten nullability for receivers of safe calls 2019-09-02 10:43:09 +03:00
Dmitriy Novozhilov
fd84202c08 [FIR] Add fir node for qualified access with smartcast 2019-09-02 10:43:09 +03:00
Dmitriy Novozhilov
04b6c48ae7 [FIR] Disable smartcasts to Nothing? 2019-09-02 10:43:09 +03:00
Dmitriy Novozhilov
b58a03458e [FIR] Tests. Improve style of control flow graphs
Add borders to control flow graphs of different functions
Highlight enter and exit nodes of each graph
2019-09-02 10:43:09 +03:00
Dmitriy Novozhilov
7851657b98 [FIR] Store fir in DataFlowVariable 2019-09-02 10:43:09 +03:00
Dmitriy Novozhilov
163c5d699f [FIR] Pass flow to right operand of && expression 2019-09-02 10:43:09 +03:00
Dmitriy Novozhilov
59205cac13 [FIR] Tests. Add orthogonal edge routing for cfg dumps 2019-09-02 10:43:09 +03:00
Dmitriy Novozhilov
b2e95eebab [FIR] Add processing of loops with constant boolean value in condition 2019-09-02 10:43:08 +03:00
Dmitriy Novozhilov
a60115c452 [FIR] Fix propagating deadness for loops and when expressions 2019-09-02 10:43:08 +03:00
Dmitriy Novozhilov
006cb536e0 [FIR] Add detecting dead edges for boolean operators with consts 2019-09-02 10:43:08 +03:00
Dmitriy Novozhilov
fd1347f2b7 [FIR] Tests. Add instruction for configuring tool for cfg dump viewing 2019-09-02 10:43:08 +03:00
Dmitriy Novozhilov
b7e1e7704e [FIR] Tests. Change extension for testdata with cgf from .cfg.dot to .dot
Also remove cfg dumps in made with old renderer
2019-09-02 10:43:08 +03:00
Dmitriy Novozhilov
7e43a0d9ef [FIR] Add boolean constant folding for DFA 2019-09-02 10:43:08 +03:00
Dmitriy Novozhilov
78f7211587 [FIR] Add test for smartcast with return in elvis 2019-09-02 10:43:08 +03:00
Dmitriy Novozhilov
98b3901f9c [FIR] Fix bug in building cfg for || 2019-09-02 10:43:08 +03:00
Dmitriy Novozhilov
fc43c8a74b [FIR] Add inlining of control flow graphs of in-place anonymous functions 2019-09-02 10:43:08 +03:00
Dmitriy Novozhilov
e72d8e675a [FIR] Add invocation kind to anonymous functions 2019-09-02 10:43:07 +03:00
Dmitriy Novozhilov
e937e4b261 [FIR] Add bound smartcasts 2019-09-02 10:43:07 +03:00
Dmitriy Novozhilov
e6c04c0454 [FIR] hold one-to-one mapping for data flow variable and Fir 2019-09-02 10:43:07 +03:00
Dmitriy Novozhilov
bda8c7ee1c [FIR] Fix smartcasts on when subject 2019-09-02 10:43:07 +03:00
Dmitriy Novozhilov
200c13baf5 [FIR] Add tests for smartcasts 2019-09-02 10:43:07 +03:00
Dmitriy Novozhilov
7a81c37f5c [FIR] Fix building cfg for binary or 2019-09-02 10:43:07 +03:00
Dmitriy Novozhilov
2d3e9fe539 [FIR] Add creating simple type for type parameters symbols 2019-09-02 10:43:07 +03:00
Mikhail Glukhikh
b1731749c0 Add failing test for smart-cast branch 2019-09-02 10:43:07 +03:00
Dmitriy Novozhilov
b4a4d4d709 [FIR] Add renderer to .dot for control flow graph tests 2019-09-02 10:43:07 +03:00
Dmitriy Novozhilov
2e501e0f97 [FIR] Implement Data Flow Analysis 2019-09-02 10:43:06 +03:00
Dmitriy Novozhilov
216b9ad933 [FIR] Add logic system for data flow analysis 2019-09-02 10:43:06 +03:00
Dmitriy Novozhilov
6e0f4f140f [FIR] Minor. Add set of type operations to FirOperation 2019-09-02 10:43:06 +03:00
Dmitriy Novozhilov
6b4e95ec52 [FIR] Add tests for control flow graph building 2019-09-02 10:43:06 +03:00
Dmitriy Novozhilov
fc982cc7e8 [FIR] Add data flow analyzer that delegates to CFG builder 2019-09-02 10:43:06 +03:00
Dmitriy Novozhilov
9f0781c9de [FIR] Add references to control flow graph to FirFunction and FirProperty
Also add updating CFG references anfter data flow analyzer builds graph
That graph is needed for further control flow analysis
2019-09-02 10:43:06 +03:00
Dmitriy Novozhilov
56ac1201b6 [FIR] Add abstract data flow analyzer with callbacks for body resolve transformer 2019-09-02 10:43:06 +03:00
Dmitriy Novozhilov
dcfc75a58f [FIR] Add control flow graph and infrastructure for building it
For some of language constructions cfg is dummy (e.g. for finally blocks
  or anonymous initializers)
2019-09-02 10:43:06 +03:00
Dmitriy Novozhilov
198599f3c7 [FIR] Add builtins types to FirSession 2019-09-02 10:43:05 +03:00
Dmitriy Novozhilov
7d4c635e85 [FIR] Minor. Add util functions for checks that type is builtin 2019-09-02 10:43:05 +03:00
Dmitriy Novozhilov
38fa0122e8 [FIR] Add synthetic else branch to when if it's missing
This change is needed for correct work of data flow, because for
  non-exhaustive when there is a else branch in terms of control flow
  graph.

This change leads to some errors when when is actually exhaustive, but
  we still add else branch. Those errors will be gone when exhaustive
  checker will be introduced
2019-09-02 10:43:05 +03:00
Anton Yalyshev
e904e638e9 LookupCancelWatcher bunches update 2019-09-01 08:22:40 +03:00
Anton Yalyshev
7b769b74a1 Add bunches for AS ans 183 2019-09-01 08:22:39 +03:00
Anton Yalyshev
a962dd7155 Add a bunch for as33 2019-09-01 08:22:38 +03:00
Anton Yalyshev
fa1a558b76 Exclude logging in case of non-kotlin files 2019-09-01 08:22:37 +03:00
Anton Yalyshev
cd78f3d9d7 Add finish_reason and invocation_count to context 2019-09-01 08:22:36 +03:00
Anton Yalyshev
3926b91bb1 Add window appearance time. Fix final context data structure. 2019-09-01 08:22:34 +03:00
Anton Yalyshev
7afa75e802 Set event context structure 2019-09-01 08:22:33 +03:00
Anton Yalyshev
e99395e548 Register FUS collector for Code Completion 2019-09-01 08:22:03 +03:00
Alexander Podkhalyuzin
ac7c89b3b5 Completions stats physical part, collector part left
#KT-33090 Comment
2019-09-01 08:19:35 +03:00
Nikolay Krasko
edd2cedfd3 Disable GradleConfiguratorPlatformSpecificTest in AS 3.6 2019-08-30 22:26:00 +03:00
Nikolay Krasko
5fa2b62de4 Fix test failures in AS 3.6 because of InjectedLanguageManager (KT-33606)
Advance android studio to 3.6 Canary 8 where problem with
InjectedLanguageManager is already fixed.
2019-08-30 22:26:00 +03:00
Nikolay Krasko
c0270ef47b More plugins registration for Android Studio 3.6 2019-08-30 22:26:00 +03:00
Nikolay Krasko
e28802fbfa Fix test failure because of duplicates file templates in classpath
There're two ways for getting templates in test runtime. One is from
sources resource files, the second one is from compiled jar.

Remove the first entry manually.

A better fix is to extract tests to separate module. This will leave
only jar in the test runtime classpath.
2019-08-30 22:25:59 +03:00
Igor Yakovlev
0eea2479fc Added possibility to override Path Chooser for MoveKotlinNestedClassesToUpperLevelModel 2019-08-30 20:59:53 +03:00
Simon Ogorodnik
99972a08a1 [FIR] Fix table rendering 2019-08-30 16:51:25 +03:00
Simon Ogorodnik
438c90b477 Silence fir bench output for diagnostic smoke tests 2019-08-30 16:32:48 +03:00
Simon Ogorodnik
312e93859b Add more info to fir bench report & format as table
Properly measure raw fir builder time in fir benchmark
2019-08-30 16:32:48 +03:00
Vladimir Krivosheev
dca88db16a remove unused org.jetbrains.kotlin.idea.inspections.gradle.KotlinPlatformGradleDetector EP
Not required after cc85ac44b3

Leads to warning in IDEA 2019.3
2019-08-30 16:15:27 +03:00
Igor Yakovlev
02a6a1ea49 Fix ExtractDeclarationFromCurrentFileIntention assertion
Refactorings should be invoked inside transaction 'exception occurs when extracting sealed class from file with the same name assertion failed when refactoring tries to use MoveKotlinTopLevelDeclarationsDialog
+ move refactorings
+ small improvement of applicability range calculation

Fixed #KT-33357
2019-08-30 14:31:34 +03:00
Svyatoslav Kuzmich
9594e9b3b1 [JS IR BE] Initial export generation 2019-08-30 13:15:37 +03:00
Svyatoslav Kuzmich
6670180782 [JS IR BE] Use internal visibility for generated helper methods 2019-08-30 13:15:37 +03:00
Vasily Levchenko
22c53e14e6 [IR][inliner] fixed occasional endless recursion in InlinerExpressionLocationHint::toString 2019-08-30 12:23:18 +03:00
Nikolay Krasko
8218ca5bae More 182 branch mentioning remove
#KT-33536 Fixed
2019-08-30 12:14:58 +03:00
Nikolay Krasko
8ae4293a0f Remove 181 branch from build scripts
#KT-33536 Fixed
2019-08-30 12:14:54 +03:00
Nikolay Krasko
0ae9240e5f Remove 182 and AS33 from build scripts
#KT-33536 Fixed
2019-08-30 12:14:50 +03:00
Nikolay Krasko
51cfafc619 Minor: advance comment
#KT-33536 Fixed
2019-08-30 12:14:46 +03:00
Nikolay Krasko
3989f5244f Minor: Fix comment about absent method
#KT-33536 Fixed
2019-08-30 12:14:42 +03:00
Nikolay Krasko
d04749dd3f Remove other specific code after removing 182
#KT-33536 Fixed
2019-08-30 12:14:38 +03:00
Nikolay Krasko
63f0eae7e2 Remove CodeStyleSettingsProviderCompat.java after removing 182
#KT-33536 Fixed
2019-08-30 12:14:34 +03:00
Nikolay Krasko
d1aca83dd5 Remove getInvalidIcon default implementation after removing 182
#KT-33536 Fixed
2019-08-30 12:14:30 +03:00
Nikolay Krasko
edb83f4ed9 Remove IconExtensionChooser and png icons after removing 182
#KT-33536 Fixed
2019-08-30 12:14:25 +03:00
Nikolay Krasko
888a93115f Use function icon from the platform after removing 182
#KT-33536 Fixed
2019-08-30 12:14:21 +03:00
Nikolay Krasko
169aa6348c Remove runConfigurationsCompat.kt after removing 182
#KT-33536 Fixed
2019-08-30 12:14:16 +03:00
Nikolay Krasko
ddcadc8138 Remove default implementations after removing 182
#KT-33536 Fixed
2019-08-30 12:14:12 +03:00
Nikolay Krasko
081ffe7d19 Remove ScriptModificationListener compat after removing 182
#KT-33536 Fixed
2019-08-30 12:14:07 +03:00
Nikolay Krasko
23f488498f Remove EditorFactoryListenerWrapper compat after removing 182
#KT-33536 Fixed
2019-08-30 12:14:01 +03:00
Nikolay Krasko
9abdddf09a Remove psiFile extension after removing 182
#KT-33536 Fixed
2019-08-30 12:13:56 +03:00
Nikolay Krasko
372c6377e8 Remove AstLoadingUtil after removing 182
#KT-33536 Fixed
2019-08-30 12:13:50 +03:00
Nikolay Krasko
4d0fc1dc22 Remove 182 support
#KT-33536 Fixed
2019-08-30 12:13:44 +03:00
Nikolay Krasko
1c4ee6bd79 Remove as33 support
#KT-33536 Fixed
2019-08-30 12:13:09 +03:00
Toshiaki Kameyama
0ec18b4a33 Explicit this inspection: fix false negative with local variable
#KT-30136 Fixed
2019-08-30 12:07:13 +03:00
Ivan Cilcic
eb469b924f Add frontend visualizer module auto test in gradle 2019-08-30 11:54:27 +03:00
Ivan Cilcic
24cce75899 Add FIR_IGNORE directive to test files that must be skipped 2019-08-30 11:54:21 +03:00
Ivan Cilcic
350bd33769 Move FirRenderer class inside FirVisualizer to avoid ambiguity with existed FirRenderer 2019-08-30 11:50:35 +03:00
Ivan Cilcic
262f57d938 Add more tests in uncommonCases folder
1) dataClass.kt - test with data class
2) receiver.kt - test with Int extension receiver
3) delegation.kt - test with implementation by delegation
2019-08-30 11:50:35 +03:00
Ivan Cilcic
b8ef09a157 Repalce work with stack variable to work with extension functions 2019-08-30 11:50:34 +03:00
Ivan Cilcic
fd461a5147 Fix current package removing from properties 2019-08-30 11:50:34 +03:00
Ivan Cilcic
f0e7dcc4f6 Fix superTypes test by adding parameter to primary constructor 2019-08-30 11:50:34 +03:00
Ivan Cilcic
f0c7aadb20 Exctract common code from psi and fir visualizer classes 2019-08-30 11:50:33 +03:00
Ivan Cilcic
d504774527 Create fir renderer class 2019-08-30 11:50:33 +03:00
Ivan Cilcic
7a45155eb3 Create tests for fir visualizer 2019-08-30 11:50:33 +03:00
Ivan Cilcic
2179f97006 Create fir visualizer abstract test class and extract common code with psi tests 2019-08-30 11:50:32 +03:00
Ivan Cilcic
fe328f8c7a Add some additional information to psi renderer
1) Trim unused spaces in annotations
2) Rewrote fq name rendering
3) Added annotations to for loop variable
4) Added type arguments render along to type parameters in functions
2019-08-30 11:50:32 +03:00
Ivan Cilcic
8fb2383845 Move psi visualizer test to separate "psi" package 2019-08-30 11:50:32 +03:00
Ivan Cilcic
aebe8c36f5 Add test methods and data for uncommon cases
Uncommon means mostly that aren't present in raw fir builder data
2019-08-30 11:50:31 +03:00
Ivan Cilcic
8047aa22a4 Add test methods and data base on raw fir builder test data 2019-08-30 11:50:31 +03:00
Ivan Cilcic
fd8205e317 Add removing current file package name from fq name 2019-08-30 11:50:31 +03:00
Ivan Cilcic
d2e47aea01 Change render to separate package names with slash symbol 2019-08-30 11:50:30 +03:00
Ivan Cilcic
08c9fa5259 Rewrite Annotator to be able to put several annotations in one position 2019-08-30 11:50:30 +03:00
Ivan Cilcic
1c2ffa65ca Revert commit with changes in DescriptorRenderer 2019-08-30 11:50:30 +03:00
Ivan Cilcic
3a12bac910 Wrote separate descriptor renderer
It was easier to write my own renderer than change current one
2019-08-30 11:50:29 +03:00
Ivan Cilcic
b57c34fd4d Remove rendering from super and this expressions and from package directive 2019-08-30 11:50:29 +03:00
Ivan Cilcic
d0e1234434 Add separate method to render special functions
Specials functions are elvis (?:) and exclexcl (!!)
2019-08-30 11:50:29 +03:00
Ivan Cilcic
e94417e27b Remove unnecessary data from render result 2019-08-30 11:50:28 +03:00
Ivan Cilcic
feec5b1a7c Make annotation process a little clearer 2019-08-30 11:50:28 +03:00
Ivan Cilcic
e23e662ba7 Remove names from value parameters list 2019-08-30 11:50:28 +03:00
Ivan Cilcic
6fa7435cd4 Add additional options to DescriptorRender
1) renderContextNearLocalVariable - if true renderer add fq name for local variables after "@" symbol
2) fullContextForLocalVariable - if true then renderer add all fq names for local variables, else only last one
3) useBaseClassAsReceiver - if true then renderer uses dispatch receiver as extension receiver if the last is null
2019-08-30 11:50:27 +03:00
Ivan Cilcic
1879fd19eb Create simple renderer for old frontend
It uses DescriptorRendererImpl that isn't quite good.
2019-08-30 11:50:27 +03:00
Ivan Cilcic
e69e6a1eeb Create simple text annotator based on binary search
Co-authored-by: Simon Ogorodnik <simon.ogorodnik@jetbrains.com>
2019-08-30 11:50:27 +03:00
Ivan Cilcic
77c330d94e Make a structure for frontend visualizer
Created visualizer module in compiler. It will contain basic tests for renderer. Additionally added three different modules in visualizer:
1) psi - will contain renderer for old frontend
2) fir - renderer for new frontend
3) common - will contain common code for both renderers
2019-08-30 11:50:26 +03:00
Mikhail Glukhikh
e895a0b8a0 FIR resolve: integrate implicit receivers into ImplicitReceiverStack
It can work both by order & by name
2019-08-30 11:47:34 +03:00
Mikhail Glukhikh
f2c77c45e9 FIR: simplify rendering of dispatch & extension receivers 2019-08-30 11:47:33 +03:00
Mikhail Glukhikh
dfacc2d68f FIR builder test: remove always-false check 2019-08-30 11:47:33 +03:00
Mikhail Glukhikh
e36a75250b FIR: visit/transform dispatch & extension receivers only once 2019-08-30 11:47:33 +03:00
Mikhail Glukhikh
5defe22651 FIR [MapArguments]: transform only arguments but not all children 2019-08-30 11:47:33 +03:00
Mikhail Glukhikh
8bb539ce19 FIR resolve: integrate receiverExpression inside ReceiverValue 2019-08-30 11:47:33 +03:00
Mikhail Glukhikh
0962755fde FIR2IR: drop field receiver consistency check (due to delegate field case) 2019-08-30 11:47:33 +03:00
Mikhail Glukhikh
75c4c88d0a FIR: set receivers for invoke case more precisely 2019-08-30 11:47:32 +03:00
Mikhail Glukhikh
62bb127fc9 FIR: add K/J test with getValue() / value fake cycle 2019-08-30 11:47:32 +03:00
Mikhail Glukhikh
f0f4ddecc0 FIR: set dispatch receiver for field symbols 2019-08-30 11:47:32 +03:00
Mikhail Glukhikh
bd5e1aeef5 FIR2IR: change backing field visibility to private 2019-08-30 11:47:32 +03:00
Mikhail Glukhikh
271c15114c FIR: add test with problematic cases 2019-08-30 11:47:32 +03:00
Mikhail Glukhikh
652fd7ee73 FIR: fix dispatch receivers for objects 2019-08-30 11:47:31 +03:00
Mikhail Glukhikh
29b406c731 FIR: set dispatch receiver for backing field access 2019-08-30 11:47:31 +03:00
Mikhail Glukhikh
13d14df8ae FIR: set dispatch receiver for data class generated functions 2019-08-30 11:47:31 +03:00
Mikhail Glukhikh
0d5cfa97a5 FIR2IR: read & set dispatch & extension receivers
NB: this commit includes receiver-based assertions yet failing for some tests
2019-08-30 11:47:31 +03:00
Mikhail Glukhikh
b531e535b6 FIR call resolve: set values of dispatch & extension receivers 2019-08-30 11:47:31 +03:00
Mikhail Glukhikh
67a7243361 FIR (rename): candidateOwner -> boundSymbol 2019-08-30 11:47:31 +03:00
Mikhail Glukhikh
8633a33108 FIR: add new qualified access implementation (FirThisReceiverExpression) 2019-08-30 11:47:30 +03:00
Mikhail Glukhikh
c63919f224 FIR tree: add dispatch & extension receivers 2019-08-30 11:47:30 +03:00
Mikhail Glukhikh
da22898a19 FIR2IR: set 'SetField' type to Unit, convert explicit 'this' references 2019-08-30 11:47:30 +03:00
Mikhail Glukhikh
6604539154 FIR: set bound symbol for explicit this references 2019-08-30 11:47:30 +03:00
victor.petukhov
aa79064a96 Remove deprecated spec tests map generators 2019-08-30 11:39:09 +03:00
Dmitriy Novozhilov
e4938c6c36 [FIR] Remove status map from intersection type 2019-08-30 11:10:31 +03:00
Dmitriy Novozhilov
ef4ef08b1d [FIR] Add default upper bound for java type parameters 2019-08-30 11:10:31 +03:00
Mads Ager
8ed1317839 [IR] For loop lowering for iteration over CharacterSequences.
Change-Id: I7aeadfffc80f791ec19a3607e219c1dc4de028db
2019-08-30 09:35:59 +02:00
Sergey Rostov
26fbe3f07b JPS Build: remove outdated note about updating bootstrap 2019-08-30 09:05:58 +03:00
Igor Yakovlev
63892891db Add internal move refactoring testing action
This action doing further steps in infinite loop (breaks after user request):
1) Generate random move refactoring model
2) Run this model (if it is correct)
3) Recompile the project
4) If compilation was not succeeded write model parameters into output file
5) Delete all new files and directories and make "git reset"
2019-08-29 18:23:21 +03:00
Igor Yakovlev
3951fde081 Save 'Search for references' checkbox state on move of kotlin file
Fixed #KT-24929
2019-08-29 18:16:21 +03:00
Igor Yakovlev
eca2707dbf Refactor of Move Refactoring
The main purpose of this commit - to make this refactoring logic can be covered as much as possible.
To make this possible we should to extract all possible UI code from business logic (and vice versa).
Additional fixes was applied during refactoring process.

There is come major steps made in this commit:
1) Extract business logic to separate models
2) Fixes of business models logic
3) Add "Delete empty source file" checkbox instead of modal message box
4) Improve error messaging in move refactoring dialogs
5) Inject interface into move handler that makes UI dialogs could be overrided
6) Inject flag into move handler that makes UI conflicts dialog could be overrided
2019-08-29 18:16:20 +03:00
Vasily Levchenko
d6c5fbace0 [IR][inliner] prevent of parameters location information loss 2019-08-29 16:53:56 +03:00
Vladimir Dolzhenko
a2fcefd456 Added fallback for LightClasses getOwnFields, getOwnMethods if dummy resolve failed (KT-27243, KT-33561) 2019-08-29 15:46:57 +02:00
Ilya Kirillov
78b0d5750b New J2K: consider literal expressions in data class conversion & fix names conflict
#KT-32253 fixed
2019-08-29 11:31:55 +03:00
Ilya Kirillov
405a3beeab New J2K: move helper functions to corresponding files & use better names for tree nodes files 2019-08-29 11:31:54 +03:00
Ilya Kirillov
64ecbd1418 New J2K: use internal getStrictParentOfType instead of custom one 2019-08-29 11:31:54 +03:00
Ilya Kirillov
2f5fa49c52 New J2K: remove unused abstractions for conversions running 2019-08-29 11:31:54 +03:00
Ilya Kirillov
131df66087 New J2K: check if method reference has functional type on PsiType instead of JKType
As it may reference to uninitialized universe symbol

#KT-33434 fixed
2019-08-29 11:31:53 +03:00
Ilya Kirillov
ca0cc13097 New J2K: retrieve constructor call return type correctly
#KT-33431 fixed
2019-08-29 11:31:53 +03:00
Ilya Kirillov
982e7fdd86 New J2K: do not shorten class references for some Java primitive class wrappers classes
It may cause unresolved call errors

#KT-33500 fixed
2019-08-29 11:31:53 +03:00
Steven Schäfer
fd2ad89799 JVM IR: Write ACC_DEPRECATED flags 2019-08-28 19:41:12 +02:00
Steven Schäfer
a90ac2438d Set correct field visibility in psi2ir 2019-08-28 19:41:11 +02:00
Mads Ager
6c7a904663 Psi2Ir: Mark accessors with no bodies as default accessors.
They are currently marked as defined even when they get a
default implementation. That makes it hard to figure out
if the accessor should be removed when introducing a backing
field in the JVM_IR backend.
2019-08-28 19:25:13 +02:00
Ilya Chernikov
fda37eaaae [minor] Rearrange test utils for easier reuse 2019-08-28 17:59:12 +02:00
Ilya Chernikov
947867286c [minor] Fix potential problems with sequence, add a todo 2019-08-28 17:59:12 +02:00
Ilya Chernikov
c9b25cad01 Fix classpath handling when evaluating legacy scripts from kotlinc
#KT-33554 fixed
2019-08-28 17:59:12 +02:00
Ilya Chernikov
31c56d7794 Set java.class.path property in runner and loader
#KT-24991 fixed
2019-08-28 17:59:12 +02:00
Ilya Chernikov
08720a3dc6 Set thread context classloader in the kotlin runner
#KT-26624 fixed
2019-08-28 17:59:11 +02:00
Ilya Chernikov
d3f32c0d8a Set thread context classloader in preloader
#KT-33529 fixed
2019-08-28 17:59:11 +02:00
Igor Yakovlev
7b2f39530a Fix invalid testdata for ConvertToScopeIntention applicability 2019-08-28 16:31:49 +03:00
Vyacheslav Gerasimov
cf39803074 Pass cacheRedirectorEnabled flag to performance test gradle import
#KT-33582
2019-08-28 16:14:05 +03:00
Dmitry Gridin
b04fbbd43b Fix testUnusedSymbol_class_inspectionData_Inspections_test test 2019-08-28 19:11:42 +07:00
Igor Yakovlev
1e72116a9c Fix test data for intention tests
The ExtractDeclarationFromCurrentFileIntention applicability range was changed by commit 3b35c2d24 so the test data of several test comes invalid
2019-08-28 13:07:33 +03:00
Dmitry Gridin
55f4610926 Tests: fix invalidBundleOrProperty test for 183
#KT-32860 Fixed
2019-08-28 17:03:13 +07:00
Toshiaki Kameyama
d4e4a4c3e7 To ordinary string literal: remove 'trimIndent()' if string is single line
#KT-32616 Fixed
2019-08-27 22:21:49 +03:00
Alexander Udalov
fbe66c3496 JVM IR: fix another naming inconsistency with old backend
This fixes slice rewrite stacktraces from RecordNamesForKotlinTypeMapper
which are printed out when running some JVM IR tests (even though
they're ignored), e.g. localClassSimpleName.kt
2019-08-27 19:27:46 +02:00
Alexander Udalov
fec8dbf6df JVM IR: do not use AsmUtil.putJavaLangClassInstance
To get rid of the last external usage of IrTypeMapper.kotlinTypeMapper
2019-08-27 19:27:46 +02:00
Alexander Udalov
23eb6daae9 JVM IR: remove MethodSignatureMapper.mapImplementationOwner 2019-08-27 19:27:46 +02:00
Alexander Udalov
aea9642ea0 JVM IR: implement MethodSignatureMapper.mapToCallableMethod directly
Instead of calling enormously complicated
KotlinTypeMapper.mapToCallableMethod, where most of special cases are
handled in the IR backend via lowerings.
2019-08-27 19:27:46 +02:00
Alexander Udalov
e0823e20c7 JVM IR: do not use AsmUtil.genToString
AsmUtil.genToString requires an instance of KotlinTypeMapper and calls
KotlinTypeMapper.mapToCallableMethod inside, which (in subsequent
commits) we're getting rid of in the IR backend
2019-08-27 19:27:46 +02:00
Alexander Udalov
bf40b72451 JVM IR: remove unneeded usages of MethodSignatureMapper.mapToCallableMethod 2019-08-27 19:27:46 +02:00
Alexander Udalov
0f1a15daf1 JVM IR: add lowering to remove calls to KFunction{n}.invoke 2019-08-27 19:27:46 +02:00
Alexander Udalov
2b4424b564 JVM IR: replace function accesses in multi-file parts
Any access to a function from a multi-file part needs to be replaced
with the access to the corresponding public method (if it exists) from
the facade class. Note that this has no immediate effect because we use
KotlinTypeMapper for mapping calls, and it understands that a call to a
function from the part must actually be generated into a call to the
function from the facade in the bytecode. This commit merely changes the
IR to better reflect what's generated in the final bytecode, and to be
able to use simplified IR-based method signature mapping instead of the
legacy KotlinTypeMapper in the future.
2019-08-27 19:27:45 +02:00
Zalim Bashorov
21b2487290 Minor: add an additional message for further investigation EA-141821 2019-08-27 18:19:18 +03:00
Simon Ogorodnik
b78ba71224 [FIR] Set mem-limit 8g 2019-08-27 17:24:56 +03:00
Simon Ogorodnik
6a9fb46985 [FIR] Make fir modularized test depends on dist 2019-08-27 17:24:45 +03:00
Simon Ogorodnik
5ef4a01a45 [FIR] Fix module qualified names 2019-08-27 17:24:35 +03:00
Simon Ogorodnik
9338a3c086 [FIR] Filter out common modules 2019-08-27 17:23:40 +03:00
Simon Ogorodnik
b99d9e0e0b [FIR] Disambiguate module names 2019-08-27 17:23:03 +03:00
Simon Ogorodnik
9530389583 [FIR] Group multiple pass logs into one 2019-08-27 17:23:01 +03:00
Simon Ogorodnik
4c246faddb [FIR] Fix redeclaration 2019-08-27 17:23:00 +03:00
Simon Ogorodnik
8c31a0be07 [FIR] Add filter param 2019-08-27 17:22:59 +03:00
Simon Ogorodnik
2ca1e5c8c7 [FIR] Pass properties to test 2019-08-27 17:22:58 +03:00
Simon Ogorodnik
96627fc1ae [FIR] Add parameters to modularized tests 2019-08-27 17:22:57 +03:00
Dmitry Gridin
e9b2e74b15 escapeXML: fix bunch for 183 2019-08-27 18:06:06 +07:00
Dmitry Gridin
ea02d0c632 ExpectActualUtils: repairSuperTypeList should consider type parameters 2019-08-27 17:26:11 +07:00
Dmitry Gridin
03141be11e ExpectActualUtils: update repairAnnotationEntries for more cases with annotations 2019-08-27 17:26:11 +07:00
Dmitry Gridin
ba0ba3422d CreateExpectedFix: rename isCorrectAndHaveNonPrivate to isCorrectAndHaveNonPrivateModifier 2019-08-27 17:26:10 +07:00
Dmitry Gridin
3c6da0bfe6 TypeAccessibilityChecker: rename existingFqNames to existingTypeNames and add comments 2019-08-27 17:26:10 +07:00
Dmitry Gridin
531f695404 CreateExpectedFix: remove recursive call from findAndApplyExistingClasses 2019-08-27 17:26:10 +07:00
Dmitry Gridin
35d64f85f8 TypeAccessibilityCheckerImpl: explicitParameters change return type to Sequence 2019-08-27 17:26:10 +07:00
Dmitry Gridin
aa135bc505 TypeAccessibilityCheckerImpl: move visibility check for KtNamedDeclaration to outside 2019-08-27 17:26:10 +07:00
Dmitry Gridin
eaa28fd4ed CreateExpect: fix build for a33 2019-08-27 17:26:10 +07:00
Dmitry Gridin
27d7ee8518 TypeAccessibilityChecker: move to idea-analysis module 2019-08-27 17:26:10 +07:00
Dmitry Gridin
56a7445660 CreateExpect: should prefer type aliases
#KT-32571 Fixed
2019-08-27 17:26:10 +07:00
Dmitry Gridin
5928a36fa2 CreateExpect: should save receiver annotations
#KT-32694 Fixed
2019-08-27 17:26:09 +07:00
Dmitry Gridin
42ef9d634a ExpectActualUtils: merge generateFunction with generateProperty to generateCallable & remove old checker 2019-08-27 17:26:09 +07:00
Dmitry Gridin
90b82c96eb TypeAccessibilityChecker: fix incorrectTypes for descriptor 2019-08-27 17:26:09 +07:00
Dmitry Gridin
1c98cb763e addRemoveModifier: shouldn't add extra new line
#KT-26635 Fixed
2019-08-27 17:26:09 +07:00
Dmitry Gridin
0458a22f78 TypeAccessibilityChecker: fix case with unresolved type params 2019-08-27 17:26:09 +07:00
Dmitry Gridin
4ed56908af CreateExpect: add actual modifier to original class if needed 2019-08-27 17:26:09 +07:00
Dmitry Gridin
73ae993d81 TypeAccessibilityChecker: add more tests 2019-08-27 17:26:09 +07:00
Dmitry Gridin
84d167b7bd TypeAccessibilityChecker: add logs for tests 2019-08-27 17:26:08 +07:00
Dmitry Gridin
7c850e44d2 CreateExpectedFix: add escaping for error text 2019-08-27 17:26:08 +07:00
Dmitry Gridin
3617f3d247 TypeAccessibilityChecker: fix callable with upper bound 2019-08-27 17:26:08 +07:00
Dmitry Gridin
46fefde09c ExpectActualUtils: introduce TypeAccessibilityChecker
#KT-28537 Fixed
#KT-28538 Fixed
#KT-28549 Fixed
#KT-28620 Fixed
#KT-31433 Fixed
#KT-31475 Fixed
#KT-32642 Fixed
#KT-32768 Fixed
#KT-33150 Fixed
2019-08-27 17:26:08 +07:00
Dmitry Gridin
d1b33485a4 ExpectActualUtils: rename checkTypeInSequence to incorrectTypesInSequence & change return type 2019-08-27 17:26:08 +07:00
Dmitry Gridin
18f0bbe8f1 QuickFixMultiModule: change tests structure 2019-08-27 17:26:08 +07:00
Dmitry Gridin
02fd137cec SimpleTestClassModel: add deep field 2019-08-27 17:26:08 +07:00
Dmitry Gridin
65ce4aed1a TestGenerationDSL: cleanup code 2019-08-27 17:26:07 +07:00
Dmitry Gridin
bddf768d59 CreateExpect: fix case with parameters in constructor without var/val 2019-08-27 17:26:07 +07:00
Dmitry Gridin
1b718761b2 AbstractQuickFixMultiModuleTest: support multiline errors SHOULD_FAIL_WITH 2019-08-27 17:26:07 +07:00
Dmitry Gridin
3f7c983f04 CreateExpectFix: fix selection for primary constructor 2019-08-27 17:26:07 +07:00
Dmitry Gridin
4a049b9b01 GenerateTests: cleanup code 2019-08-27 17:26:07 +07:00
Dmitry Gridin
1748906d9a ExpectActualUtils: should add annotations 2019-08-27 17:22:16 +07:00
Dmitry Gridin
5e60ea2272 ExpectActualUtils: should remove override 2019-08-27 17:22:16 +07:00
Dmitry Gridin
7561905676 ExpectActualUtils: add type accessibility check for supertypes 2019-08-27 17:22:15 +07:00
Dmitry Gridin
8e9952e203 multiplatformUtil: implement Module.toDescriptor() 2019-08-27 17:22:15 +07:00
Dmitry Gridin
755f7e8739 elementRenderingUtils: override visitor for KtTypeReference, KtParameterList, KtParameter 2019-08-27 17:22:15 +07:00
Dmitry Gridin
c17e19b004 elementRenderingUtils: cleanup code 2019-08-27 17:22:15 +07:00
Dmitry Gridin
2b32c9d2f9 ExpectActualUtils: add type arguments accessibility check for constructors 2019-08-27 17:22:15 +07:00
Dmitry Gridin
e59571c482 ExpectActualUtils: add type arguments accessibility check for top level classes 2019-08-27 17:22:15 +07:00
Dmitry Gridin
bad9459978 ExpectActualUtils: add type arguments accessibility check 2019-08-27 17:22:15 +07:00
Dmitry Gridin
5884c65857 ExpectActualUtils: add type accessibility check 2019-08-27 17:22:15 +07:00
Dmitry Gridin
dffb44c11c Create actual/expect quick fix should render super type correctly 2019-08-27 17:22:15 +07:00
Dmitry Gridin
a21375508d ExpectActualUtils: drop missedDeclarations parameter from generateClassOrObject function 2019-08-27 17:22:14 +07:00
Alexander Udalov
22f8b9f475 Remove codegen tests on inline classes based on type parameters
According to KT-23819, such inline classes are prohibited. These tests
can be restored (and fixed if needed) as soon as we allow this back
2019-08-27 11:01:08 +02:00
Steven Schäfer
6bf16a96e1 Add more tests for type operators on the jvm 2019-08-27 10:44:23 +02:00
Steven Schäfer
b6ea135e70 Add a TypeOperatorLowering for JVM_IR 2019-08-27 10:44:23 +02:00
Alexander Udalov
39ba462540 JVM IR: remove unneeded part of a hack for inlining $default methods
Every non-intrinsic IrFunction now has a class container in JVM IR, so
this logic is no longer necessary
2019-08-26 19:41:26 +02:00
Alexander Udalov
34400add22 Minor, add IrCallableMethod.toString 2019-08-26 19:41:25 +02:00
Alexander Udalov
dd74794f97 Minor, add message to exception thrown in parentAsClass 2019-08-26 19:41:25 +02:00
Toshiaki Kameyama
a3c3ab08fd Override/Implement members: place members in the same order as super class members 2019-08-26 13:18:31 +07:00
Roman Golyshev
a38651c1ec KT-32366: Add missing 182 bunch file for the foldingTestUtils.kt 2019-08-23 22:59:45 +03:00
Igor Yakovlev
5a511dd635 Refactor and fix of the run/apply/let/also intention converter
1) Optimize and refactored code
2) Added support for correct renaming of target identifier to this/it
3) Added support of cases with difficult application targets (like: var x = 1 + 2)
4) Show error hint when refactoring failed for some reason
5) Improved intention applicability checking to eliminate false-positive cases
6) Fixed EA-209577
2019-08-23 19:37:00 +03:00
Ilmir Usmanov
ef5fcb4e9e Fix test data 2019-08-23 19:09:28 +03:00
Roman Golyshev
37e3c41b57 KT-32366: Add sync scroll for source and preview editor
- ^KT-32366 Fixed
2019-08-23 18:22:27 +03:00
Roman Golyshev
e488e920d8 KT-32366: Add tests for right preview window
- also, fix missing test generation in `GenerateTests` bunch files (which was introduced in e54b43ba)
2019-08-23 18:22:26 +03:00
Roman Golyshev
bddf87337c KT-32366: Add printing scratch output to preview window
- printing is done with `PreviewEditorScratchOutputHandler`
- `KtsScratchFileEditorWithPreview` redirects output depending on the layout selection
2019-08-23 18:22:26 +03:00
Roman Golyshev
e321ee1396 KT-32366: Inject toolWindowHandler from InlayScratchOutputHandler
- `toolWindowHandler` would be shared between different scratch editors, so we need `ScratchToolWindowHandlerKeeper` to provide proper mechanism for its acquiring and releasing
- fix problem when scratch output panel is never released after first scratch opening by properly unregistering `toolWindow` with `ToolWindowManager`
2019-08-23 18:22:26 +03:00
Roman Golyshev
d0cd4967a7 KT-32366: Extract text styling variables to outputStylingUtils 2019-08-23 18:22:25 +03:00
Roman Golyshev
358ec2b8bd KT-32366: Refactor tests to allow testing of preview window
- add directive `PREVIEW_ENABLED` into scratch file settings
2019-08-23 18:22:25 +03:00
Roman Golyshev
dd1ace37d2 KT-32366: Add TextEditorWithPreview.setLayout method
- it is done to be able to trace when layout is changed
- all actions use this method too
2019-08-23 18:22:24 +03:00
Roman Golyshev
1d6de45db6 KT-32366: Use TextEditorWithPreview as editor for scratch files
- get rid of `ScratchFileHook` completely
- use `KtsScratchFileEditorProvider` to encapsulate details about scratch file presentation
- remove obsolete functions from `scratchUtils`
2019-08-23 18:22:24 +03:00
Roman Golyshev
37c6102a03 KT-32366: Change base of AbstractScratchLineMarkersTest
- with `FileEditorManagerTestCase` it is possible to work with actual TextEditors instead of wrappers during tests, so it will be possible to use `TextEditorWithPreview` via `TextEditorProvider` service
2019-08-23 18:22:24 +03:00
Roman Golyshev
1177566386 KT-32366: Get rid of ScratchTopPanel in tests
- make `ScratchFile.file` public
- remove obsolete functions from `ScratchTopPanel` and `scratchUtils`
2019-08-23 18:22:24 +03:00
Roman Golyshev
962260941b KT-32366: Add TextEditorWithPreview class from the platform
- this class was updated recently (here: https://github.com/JetBrains/intellij-community/pull/1167) to allow its customization; however, those changes from platform are not available for kotlin plugin yet
2019-08-23 18:22:23 +03:00
Roman Golyshev
54dde777ac KT-32366: Get replace editor with virtual file in ScratchFile
- remove `getOutputHandler` method from `KtScratchFileLanguageProvider`
- now `InlayScratchOutputHandler` is a class, it has reference to the target editor and is (temporarily) attached to the editor
2019-08-23 18:22:23 +03:00
Roman Golyshev
1fc88fc47f KT-32366: Refactor ScratchPanelListener to ScratchFileListener
- it is done to move logical dependency from the UI element (`ScratchTopPanel`) to the model element (`ScratchFile`)
2019-08-23 18:22:23 +03:00
Roman Golyshev
ea3d070c98 KT-32366: Refactor ScratchFileHook to make ScratchFile creation clear
- basically just move functions from `ScratchTopPanel` to `ScratchFileHook`
2019-08-23 18:22:22 +03:00
Roman Golyshev
70e6f738eb KT-32366: Refactor scratchUtils to use mostly ScratchFile
- it is done to remove dependency from the UI component `ScratchTopPanel`
- occasional use of `ScratchTopPanel` is still left (for tests mostly)
2019-08-23 18:22:22 +03:00
Roman Golyshev
6c35c40bb9 KT-32366: Refactor ScratchTopPanel to actions instead of custom UI
- migrate module to the `ScratchPanel` class because it is information that matters to him most of all
- move logic for showing\hiding checkboxes to the related actions
2019-08-23 18:22:22 +03:00
Mikhail Glukhikh
23f662cfe2 FIR: optimize creation of scope by implicit receiver 2019-08-23 17:15:09 +03:00
Mikhail Glukhikh
9c3821ddba FIR: add comments & tests for tower resolver, block some receiver pairs 2019-08-23 17:15:09 +03:00
Mikhail Glukhikh
c9a600c5ce FIR: handle imported members from objects more correctly 2019-08-23 17:15:08 +03:00
Mikhail Glukhikh
a4d89b9829 FIR: handle situations with multiple implicit receivers 2019-08-23 17:15:08 +03:00
Mikhail Glukhikh
5d6a526eec FIR: more accurate handling of dispatch receiver values
This commit fixes resolve priorities (see changed test data),
e.g. top-levels now have less priority than implicit receiver members
2019-08-23 17:15:08 +03:00
Nikolay Igotti
fcb0b1b5eb Add new native targets. (#2538) 2019-08-23 16:11:40 +03:00
Toshiaki Kameyama
64d4cca589 Redundant override: do not report when class has derived property
#KT-32479 Fixed
2019-08-23 14:57:20 +07:00
Toshiaki Kameyama
729ed1a44e Pull Members Up: fix invalid code format on function with comment and another indent
#KT-32426 Fixed
2019-08-23 14:25:49 +07:00
Toshiaki Kameyama
7c2f6ecba7 Redundant curly braces in string template: remove braces for 'this'
#KT-32972 Fixed
2019-08-23 14:19:41 +07:00
Dereck Bridie
8f2a73b734 KT-28471: "Add initializer" quickfix initializes non-null variable with null 2019-08-23 14:15:08 +07:00
Toshiaki Kameyama
c0f896c96a flatMap call could be simplified to flatten(): Fix false positive with Array
#KT-33204 Fixed
2019-08-23 14:12:17 +07:00
Ilya Gorbunov
7ff01b02a9 Make ExperimentalTime annotation documented 2019-08-22 21:29:18 +03:00
Ilya Gorbunov
2c79b1f89e Minor: fix incorrect reference in kdoc 2019-08-22 21:29:18 +03:00
Vyacheslav Gerasimov
daa0d58f4d Build: Update list of proxied repositories 2019-08-22 20:39:28 +03:00
Vyacheslav Gerasimov
1cdc68901a Build: Use kotlinx-metadata-jvm from jcenter instead of bintray 2019-08-22 20:39:28 +03:00
Vyacheslav Gerasimov
96c9efeabb Build: Fix findNonCachedRepositories test
Previously incorrectly scanned buildscript block of script
2019-08-22 20:39:28 +03:00
Vyacheslav Gerasimov
669b6d164c Build: Use cache redirector for buildscript block of :kotlin-reflect 2019-08-22 20:39:28 +03:00
Alexander Udalov
d59f2bcc80 Fix KotlinReflectionInternalError on invoking callBy with defaults in supertypes
There are two parts in this change:

1) Previously, we looked up $default methods with the incorrect
   signature in supertypes. For example in defaultInSuperClass.kt, we'd
   try to find a method foo$default with the signature `(B, String,
   String, int, Object)` in the class A. Now we're modifying the array
   of parameter types on each step if we're looking for a static
   $default method, by assigning its first element to be the containing
   class. This fixes cases when defaults come from a superclass.
2) For interfaces, $default methods are actually located in the
   corresponding DefaultImpls class. Now we look up that class and
   search for the $default method there. Note that this is needed
   because of KT-33430. This fixes cases when defaults come from a
   superinterface.

 #KT-13936 Fixed
2019-08-22 18:04:00 +02:00
Alexander Udalov
cb2e68fece JVM IR: skip temporary variables in InventNamesForLocalClasses 2019-08-22 18:04:00 +02:00
Alexander Udalov
312205f376 Prohibit synchronized methods on interface members
#KT-9310 Fixed
2019-08-22 18:04:00 +02:00
Alexander Udalov
815ff3c860 JVM IR: don't generate ACC_FINAL on DefaultImpls methods
To replicate behavior of old backend
2019-08-22 18:04:00 +02:00
Mikhail Glukhikh
6f785ec881 FIR2IR: fix library annotation call generation 2019-08-22 18:55:10 +03:00
Mikhail Glukhikh
27ccff12c1 FIR: add resolve for delegated super-type
This commit fixes FIR modularized resolve test on whole Kotlin project
(without it we had empty super-type set with delegated super-types)
2019-08-22 18:53:15 +03:00
Igor Yakovlev
a9bc3c19d6 Fix invalid generated Move tests 2019-08-22 17:53:28 +03:00
Ilmir Usmanov
f9506db20a Ignore sources which are not LOADs in refinedIntTypeAnalysis
#KT-33414 Fixed
2019-08-22 16:08:08 +03:00
Dmitriy Novozhilov
4697822b5a [FIR] Fix setting return type for when and try with non applicable candidates 2019-08-22 16:02:56 +03:00
Svyatoslav Kuzmich
6e6ffa12a6 [WASM] Initial infrastructure
- New module ":compiler:backend.wasm"
    - Initial compiler infra (driver, phaser, context)
    - Subset of Wasm AST
    - Skeleton of IR -> Wasm AST
    - Wasm AST -> WAT transformer

- Testing infra

- SpiderMonkey jsshell tool
2019-08-22 15:59:54 +03:00
Svyatoslav Kuzmich
812083ee05 [WASM] Initial runtime library
Add directory libraries/stdlib/wasm as a placeholder for WASM runtime library
Copy built-ins from core/builtins
Add ExcludeFromCodegen annotation for internal needs
2019-08-22 15:59:49 +03:00
Svyatoslav Kuzmich
1891fa1bf1 [JS IR BE] Commonize JS lowerings 2019-08-22 15:59:41 +03:00
Ivan Gavrilovic
7bc739359b Use JDK_8 when stopping Gradle daemons with version below 5.0
Gradle started supporting running on JDK11 only with Gradle 5.0.
This commit sets JAVA_HOME to JDK8 whenever stopping daemon with
version below 5.0
2019-08-22 15:47:45 +03:00
Ivan Gavrilovic
d13e26d67e Add a check that processors from KAPT classpath are not run
This commit adds check that javaslang.match.PatternsProcessor,
which is in kotlin-compiler-embeddable jar, is not run when using
JDK9+.
2019-08-22 15:45:40 +03:00
Ivan Gavrilovic
27a9aa5e2b KT-33056: Fix how parent class loader for KAPT processors is found
When instantiating annotation processors, the class loader where they
are defined needs to have the correct parent class loader set up. In
order to find the parent class loader, we need to find the most specific
class loader that contains javac compiler classes (and does not contain
e.g. KAPT classes). This commit changes how that search is done, and it
simply returns the class loader in which the com.sun.tools.javac.util.Context
is defined, as the is the class we need on the annotation processor
classpath.
2019-08-22 15:45:40 +03:00
Ivan Gavrilovic
f3acd8d10c KT-33028, KT-33050: Fix how kapt invokes javac on JDK 9+
This commit fixes KT-33028 by not setting empty boot classpath when
running on JDK9+. When compiling with -source 8 and below, this allows
classes from java.base module to be available in the boot classpath.

This commit also fixes KT-33050 by passing the source level of Java compile
task in the KAPT javac options. This is important as some annotation processors
are using ProcessingEnvironment.getSourceVersion() in order to decide what
code to generate.

Test: Kapt3IT test added for worker and non-worker invocations
2019-08-22 15:45:40 +03:00
Dmitriy Novozhilov
5846db4eab [FIR] Add symbol to FirFunction and all it's inheritors 2019-08-22 14:14:55 +03:00
Dmitriy Novozhilov
e3e1f3c2aa [FIR] Fix transforming value parameters of anonymous functions 2019-08-22 14:14:55 +03:00
Dmitriy Novozhilov
d841090866 [FIR] Don't analyze properties with implicit types twice
Test `cast.kt` now don't work absolutely correct and implicit type of
  value parameter in lambda is't replaced with error type, but it's
  minor bug
2019-08-22 14:14:55 +03:00
Dmitriy Novozhilov
f1e56c4b3e [FIR] Force resolving all declaration while resolving of body with implicit type 2019-08-22 14:14:55 +03:00
Dmitriy Novozhilov
e374242adf [FIR] Fix propagating expected type for binary operator calls 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
ba7a137e74 [FIR] Add fir node for binary && and || 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
908b6ade1d [FIR] Fix incorrect do-while loop transforming order and IR generating 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
42f171a8d2 [IR] Minor. Extract irBuiltins from IrGeneratorContext to separate interface
It's necessary to using some util functions on IrGeneratorContext in IrToFir
2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
b274c7567e [FIR] Minor. Add transformResult to FirWhenBranch 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
a022f85776 [FIR] Minor. Add @BaseTransformedType to FirWhenBranch 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
f877fe40b3 [FIR] Fix expected type in invoke completion 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
57a2665b00 [FIR] Update tests for previous commit 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
e48959350c [FIR] Infer type of when expressions and try expressions like it is function call 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
741ff958e8 [FIR] Add util function for extracting return arguments from block 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
fe3824d796 [FIR] Introduce FirResolvable
FirResolvable is an interface representates fir node wit calleeReference
It will be useful for infer `try` and `when` expressions as function call
2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
beeba23cf0 [FIR] Minor. Wrap withScopeCleanup with try-finally 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
e944119f71 [FIR] Don't use implicit type as expected type of anonymous function 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
7861396246 [FIR] Add util function for creating functional cone type 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
637fb55a7b [FIR] Add implementation of intersection types to Fir type system 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
1708a34eb8 [FIR] Fix incorrect findCommonIntegerLiteralTypesSuperType dummy implementation 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
e6bf3b3263 [FIR] Render nullability in type renderer, not in fir renderer 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
3e44bc805f [FIR] Return error type from common super type if it present 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
6e2958880b [FIR] Add forgotten replacing arguments in abbreviated type expansion 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov
317e3edba8 [FIR] Add default upper bound to type parameter in fir deserializer 2019-08-22 10:55:07 +03:00
Ilya Chernikov
2fe01f9086 Refactor publishing plugin to lazy tasks API 2019-08-21 20:20:09 +02:00
Ilya Chernikov
315a9d66a0 Refactor more tasks to lazy API 2019-08-21 20:20:08 +02:00
Ilya Chernikov
2ed8fa7624 Convert main task creating helper to lazy API, refactor accordingly 2019-08-21 20:20:08 +02:00
Ilya Chernikov
0f41dc814f Switch many common tasks defined in buildSrc to lazy creation
also refactor some locally defined tasks to the creation avoidance API
2019-08-21 20:20:08 +02:00
Ilya Chernikov
f74c4fa538 Switch all common tasks in the root build script to lazy creation 2019-08-21 20:17:53 +02:00
Ilya Chernikov
5208318f34 Fix dependency resolution during gradle project configuration 2019-08-21 20:17:53 +02:00
Sergey Igushkin
50e758cbb7 Remove the @Inclubating annotation from UnstableApiUsage inspection
Also remove `@Suppress("UnstableApiUsage)"` where it was relevant
2019-08-21 19:42:34 +03:00
Sergey Igushkin
ffd0b438da Don't create the Kapt generate stubs output dir in lazy initializer
Creating a directory in the property getter interferes with Gradle cache
 outputs snapshotting, resulting in build cache being disabled for the
 task with the following info message:

 Caching disabled for task ':app:kaptGenerateStubsKotlin': Gradle does
 not know how file 'build/tmp/kapt3/incrementalData/main' was created
 (output property 'destinationDir'). Task output caching requires exclusive
 access to output paths to guarantee correctness.

 As Gradle automatically creates any @OutputDirectory, we don't need
 to create it at the task initialization phase.
2019-08-21 19:42:34 +03:00
Sergey Igushkin
cbb8bf2deb Extract members from Kotlin tasks, don't iterate over them (KT-31713)
Refactor: move some properties from the Kotlin tasks to the
new task data model, so they can be accessed without forcing the
tasks to instantiate.

Don't iterate over Kotlin tasks of all projects in the IC-related code;
instead, inspect the model.

Issue #KT-31713 Fixed
2019-08-21 19:42:34 +03:00
Mikhail Zarechenskiy
80fa591f10 Fix failing test because of slightly different diagnostics for LV=1.2
There are no `DEBUG_INFO_MISSING_UNRESOLVED` diagnostics for this test
 if one runs it under LV=1.2. These diagnostics are not crucial
 for the test (especially for version 1.2), so use it only with
 the latest stable version

 Plus, reuse test-data to check behavior in new inference
2019-08-21 18:41:13 +03:00
Alexander Udalov
5e3a11db8e JVM IR: remove property accessor name hack in InterfaceDelegationLowering
#KT-28434 Fixed
2019-08-21 15:14:04 +02:00
Alexander Udalov
14a6a06166 JVM IR: do not use GenerationState.typeMapper
The only remaining usages are in IrTypeMapper, MethodSignatureMapper and
in InterfaceDelegationLowering.generateDelegationToDefaultImpl
2019-08-21 15:14:03 +02:00
Alexander Udalov
f64afbf152 JVM IR: reduce usages of IrTypeMapper.kotlinTypeMapper 2019-08-21 15:13:49 +02:00
Alexander Udalov
0c6ab69b52 JVM IR: do not use descriptors in IrTypeMapper.writeFormalTypeParameters 2019-08-21 15:13:49 +02:00
Alexander Udalov
598c6009f2 JVM IR: extract method signature mapping to MethodSignatureMapper 2019-08-21 15:13:47 +02:00
Alexander Udalov
6191fc10f0 JVM IR: introduce IrCallableMethod as a simpler replacement for CallableMethod 2019-08-21 15:10:57 +02:00
Vladimir Dolzhenko
6969717201 Fix performanceTests compilation errors 2019-08-21 10:17:24 +02:00
Burak Eregar
d1cbee44f1 Move refactoring: suggest file name starting with an uppercase letter
Fixed #KT-30342
2019-08-21 00:58:59 +03:00
Ilya Chernikov
8219d9853c Implement configuration for describing only published runtime dependencies...
and fix runtime dependencies for published scripting artifacts
2019-08-20 21:17:56 +02:00
Vladimir Dolzhenko
3d3e86b5fa Added gradle.kts and annotator gradle.kts autocompletion performance benchmark 2019-08-20 15:25:50 +02:00
Alexander Udalov
7c4ed9c29e JVM IR: remove unused code, minor cleanup 2019-08-20 14:16:30 +02:00
Dmitry Gridin
23e79bb32b ScriptDefinitionsManager: safeGetDefinitions shouldn't catch ControlFlowException
#EA-210332 Fixed
2019-08-20 17:08:47 +07:00
Dmitry Gridin
ef4bac1b46 REPL: fix IllegalArgumentException
Reproduce: select `Pause Output`
#EA-209571 Fixed
#EA-210364 Fixed
#KT-33329 Fixed
2019-08-20 17:08:47 +07:00
Dmitry Gridin
f81fb40164 HistoryUpdater: cleanup code 2019-08-20 17:08:47 +07:00
Dmitry Gridin
df438377e8 ReplOutputProcessor: cleanup code 2019-08-20 17:08:47 +07:00
Dmitry Gridin
ab4001a698 KotlinCopyPasteReferenceProcessor: fix KNPE
#EA-210304 Fixed
2019-08-20 17:08:47 +07:00
Dmitry Gridin
693f42f33e KotlinCopyPasteReferenceProcessor: cleanup code 2019-08-20 17:08:47 +07:00
Dmitry Gridin
bd5476082b extractionModel: cleanup code 2019-08-20 17:08:47 +07:00
Dmitry Gridin
fcff9a43b4 extractionModel: fix NPE
#EA-210243 Fixed
2019-08-20 17:08:46 +07:00
Dmitry Gridin
f87e86d4b3 CallableBuilder: fix exception
#EA-134361 Fixed
2019-08-20 17:08:46 +07:00
Dmitry Gridin
76b97c3847 CallableBuilder: cleanup code 2019-08-20 17:08:46 +07:00
Dmitry Gridin
2b90735990 generateUtil: fix PIEAE
#EA-209598 Fixed
#EA-142347 Fixed
2019-08-20 17:08:41 +07:00
Dmitry Gridin
b570f99aae generateUtil: cleanup code 2019-08-20 17:04:00 +07:00
Dmitry Gridin
cf3b92d80e CreateTypeParameterFromUsageFix: fix KNPE for type alias
#KT-33302 Fixed
#EA-120181 Fixed
2019-08-20 17:04:00 +07:00
Dmitry Gridin
932765744a CreateTypeParameterFromUsageFix: cleanup code 2019-08-20 17:03:59 +07:00
Igor Chevdar
8d2ccb7bcd [IR] Taught inliner to work with inline suspend lambdas 2019-08-20 12:52:54 +03:00
pyos
7ff700ff97 JVM_IR: lower calls to @JvmStatic functions from other files.
Note: this currently results in invalid IR (but valid bytecode) if the
@JvmStatic function is imported, because its IR representation is
unlowered and therefore has a dispatch receiver, but the call will not.
2019-08-20 11:39:25 +03:00
Ilya Kirillov
24adc09e2d J2K: Change old/new J2K switch checkbox text from "Use New J2K" to "Use New Java to Kotlin Converter"
Relates to #KT-33371
2019-08-20 11:13:13 +03:00
Alexander Udalov
ad43bc23ea Minor, add test case on SAM conversion over smart cast 2019-08-19 18:09:32 +02:00
Vladimir Dolzhenko
dd0e296af1 Use KotlinExceptionWithAttachments for ToFromOriginalFileMapper and MainFunctionDetector 2019-08-19 17:55:49 +02:00
victor.petukhov
fa29297fb1 Introduce workaround for back-end exception in the test cases parser code 2019-08-19 18:31:48 +03:00
victor.petukhov
9487d291da Fail spec box tests if they have unexpected behaviour and passed 2019-08-19 18:31:48 +03:00
victor.petukhov
d8e5b068d5 Relinking spec tests 2019-08-19 18:31:46 +03:00
victor.petukhov
8465d690f1 Add spec tests for 'Type system' (introduction and 'kotlin.Any' type) 2019-08-19 18:31:45 +03:00
victor.petukhov
f78faeaa3c Add test for consistency check between the Kotlin specification and spec tests 2019-08-19 18:31:44 +03:00
victor.petukhov
4f73e100d0 Add task to generate tests json map (is used for tool 'spec-tests-relinking recommender') 2019-08-19 18:31:43 +03:00
victor.petukhov
0e439263ce Group spec tests and accompanying functionality into to packages: org.jetbrains.kotlin.spec (tests only) and org.jetbrains.kotlin.spec.utils (accompanying functionality) 2019-08-19 18:31:42 +03:00
victor.petukhov
cf692fb257 Implement tests map generator and refactor folder structure to spec tests linking 2019-08-19 18:31:40 +03:00
victor.petukhov
28da325a11 Actualize DFA spec tests 2019-08-19 18:31:39 +03:00
SatoShun
c43df55965 Type parameters are placed before the name of the function 2019-08-19 16:16:51 +03:00
Igor Yakovlev
9c861a111f Fix move refactoring conflict window output
1) Refactoring
2) #KT-32496 Fixed
2019-08-19 13:28:23 +03:00
Igor Yakovlev
ae3f36ebde Change ExtractDeclarationFromCurrentFileIntention applicability range
Fixed #KT-33362
2019-08-19 13:28:23 +03:00
Yanis Batura
e9e3df23fc Fix typos and improve grammar in stdlib readmes (#2527)
* Fix typos in the main ReadMe.md

* Fix typos in the stdlib samples ReadMe.md

Co-Authored-By: ilya-g <ilya.gorbunov@jetbrains.com>
2019-08-16 19:56:56 +03:00
Igor Chevdar
ad8bcda99e [IR] Merged K/N inliner with the common one 2019-08-16 18:32:19 +03:00
Vyacheslav Gerasimov
32153c26a8 Build: Rewrite upload_plugins.gradle in Kotlin 2019-08-16 15:42:18 +03:00
Vyacheslav Gerasimov
af2cd36c3d Build: Rename upload_plugins.gradle -> kts 2019-08-16 15:42:18 +03:00
Ilya Gorbunov
fba22606e6 Introduce erroneous operators ClockMark.minus/compareTo(ClockMark)
To provide a better diagnostic message on their misuse.
2019-08-16 15:29:17 +03:00
Ilya Gorbunov
ac07cb686b Change status of ExperimentalTime API to a more risky one 2019-08-16 15:29:17 +03:00
Ilya Gorbunov
a985402507 Introduce ClockMark.hasPassedNow, hasNotPassedNow functions
Makes it more clear to use them than comparing elapsed with Duration.ZERO.
2019-08-16 15:29:16 +03:00
Ilya Gorbunov
44195d436e Rename: Clock.markNow, ClockMark.elapsedNow
Add "Now" suffix to the names of functions that depend on the current
time moment.
2019-08-16 15:29:16 +03:00
Ilya Gorbunov
a493d46a6e Make effectively private properties actually private to avoid accessors 2019-08-16 15:29:16 +03:00
Ilya Gorbunov
f889d25287 Introduce TestClock.plusAssign(Duration) and hide implementation details
TestClock.plusAssign(Duration) is for advancing TestClock time.
Hide reading value, do not allow to provide initial reading,
fix clock unit to nanoseconds at construction time.
2019-08-16 15:28:45 +03:00
Ilya Gorbunov
4de9361c37 Introduce Duration.isPositive method 2019-08-16 15:25:57 +03:00
Ilya Kirillov
4befca95d6 Add an ability to switch between old and new J2K via settings window
Before that it was possible to do only via registry

#KT-33371 fixed
2019-08-16 09:37:05 +03:00
Shagen Ogandzhanian
3b8da0afe4 Update dukat dependency to 0.0.16 2019-08-16 06:29:11 +03:00
Igor Yakovlev
1aa8e28dd8 Add JvmOverloads to KtLightClassImpl
Added @JvmOverloads annotation to primary constructor for binary compatibility issues
2019-08-15 15:49:14 +03:00
Alexey Tsvetkov
8e6a80bed7 Add test logs specific for IC with JS IR
Incremental inline will be handled during lowerings,
after all klibs are generated
2019-08-15 15:11:52 +03:00
Alexey Tsvetkov
12c209d360 Do not compare output for IC with JS IR BE
Temporary measure until output could be updated incrementally
2019-08-15 15:11:52 +03:00
Alexey Tsvetkov
3366ac4b18 Save incremental data with KLIB compiler 2019-08-15 15:11:52 +03:00
Alexey Tsvetkov
fc49510049 Add tests for IC with JS IR BE 2019-08-15 15:11:52 +03:00
Alexey Tsvetkov
9572800ef7 Add missing dependency 2019-08-15 15:11:52 +03:00
Stanislav Erokhin
b5a407371c Update the year in LICENSE.txt 2019-08-15 13:31:09 +03:00
Mikhail Zarechenskiy
d59b910403 Add tests for obsolete issues
#KT-32207 Obsolete
 #KT-32836 Obsolete
 #KT-32949 Obsolete
 #KT-9384 Obsolete
2019-08-15 13:01:39 +03:00
Mikhail Zarechenskiy
1969ad6e9d [NI] Take into account use-site variance for constraint from LHS of CR
#KT-32851 Fixed
2019-08-15 13:01:38 +03:00
Mikhail Zarechenskiy
0620762b97 Enable new inference explicitly for MPP tests with type refinement 2019-08-15 12:50:19 +03:00
Mikhail Zarechenskiy
735e1ecec1 Disable new inference for IDE analysis by default in releases 2019-08-15 12:50:09 +03:00
Mikhail Zarechenskiy
69942681a3 Refactoring: move versioning.kt file to idea-analysis module 2019-08-15 12:49:54 +03:00
Mikhail Zarechenskiy
50e7ff4097 Refactoring: move isSnapshot function closer to similar ones 2019-08-15 12:49:53 +03:00
Dmitry Gridin
2c0d6ab1a5 [Compatibility] Restore GradleBuildScriptManipulator.addKotlinLibraryToModuleBuildScript(scope, libraryDescriptor)
#KT-33336 Fixed
2019-08-15 15:54:12 +07:00
Abduqodiri Qurbonzoda
63895483fd Fix take method from iterating one extra element (KT-32024) 2019-08-15 01:01:36 +03:00
Abduqodiri Qurbonzoda
01a613dca4 Add tests for floating-point to integral conversion 2019-08-15 00:57:27 +03:00
Abduqodiri Qurbonzoda
432828a2db Clarify floating-point to integral conversion rounding behaviour 2019-08-15 00:57:27 +03:00
Igor Yakovlev
fd5bf33861 Removed asserts for mirror files for java stubs on kt files
The behavior of this part of code is following:
1) We wrap the kotlin light class to the object that wraps the kt files into compiled (!) cls stub (notice, that most of the time it is a single file wrapper)
2) Platform wishes to get the mirror psi of this "compiled" stub work with text of it.
3) Platform request mirror element that asserted to be ok ONLY for multifiles stub.
4) It leads to EA-209577

There is no idea why so, but the exception is high-rated, so this assertion was deleted.

Fixed EA-209577
2019-08-14 20:12:55 +03:00
Vyacheslav Gerasimov
8cfdd140bb Upgrade plugin-repository-rest-client & use token auth
#KT-33338
2019-08-14 19:10:43 +03:00
Georgy Bronnikov
20351b7c1b IR: correct type for a null const argument 2019-08-14 18:26:09 +03:00
Roman Golyshev
e915bc2a69 fix expected output for when statement in scratch files
- the behaviour changed due to KT-33127 fixing
2019-08-14 15:35:38 +03:00
Roman Golyshev
1a0edd37ef KT-31295: fix issue with NewKotlinScriptAction incorrect identity
- this problem leads to the duplication of the `New Kotlin Script` action in the drop-down menu
- ^KT-31295 Fixed
2019-08-14 15:35:38 +03:00
Dmitry Petrov
986654b709 psi2ir: fix unsubstituted type parameters around SAM conversions
Preserve type substitution:
- when obtaining function type for SAM type;
- when generating SAM conversions for SAM adapter arguments;
- for "original" method corresponding to a SAM adapter.
2019-08-14 14:18:42 +03:00
Alexander Udalov
6b208f7c9c JVM IR: support LanguageFeature.UseGetterNameForPropertyAnnotationsMethodOnJvm 2019-08-14 12:34:57 +02:00
Ivan Gavrilovic
0a26742501 Run KAPT non-incrementally if annotation processor classpath changes
Annotation processor classpath for a KAPT run is recorded, and the current
run is compared against the previous one. If those differ, KAPT should
run non-incrementally.

Test: KaptIncrementalWithIsolatingApt.testChangingAnnotationProcessorClasspath
2019-08-14 18:05:04 +09:00
Ivan Gavrilovic
2412b5f992 Delete output when unable to run KAPT incrementally
When comparing previous and current classpath snapshots, and it is not
possible to compute the types that changed, make sure to delete the outputs
before invoking KAPT.

Test: KaptIncrementalWithAggregatingApt.testIncompatibleClasspathChanges
2019-08-14 18:05:04 +09:00
Dmitry Petrov
e4f9314f94 Use ISE instead of NPE in serialization 2019-08-14 11:16:11 +03:00
Dmitry Petrov
a9c961931c JS_IR: Support 'CHECK_NOT_NULL' intrinsic 2019-08-14 11:16:11 +03:00
Dmitry Petrov
7d49b72b79 JVM_IR: Support 'CHECK_NOT_NULL' intrinsic
TODO: migrate to changes related to KT-22275
2019-08-14 11:16:10 +03:00
Dmitry Petrov
7170439517 IR: '!!' is generated as 'CHECK_NOT_NULL' intrinsic
```
fun <T : Any> CHECK_NOT_NULL(x: T?): x =
  if (x != null) x else throw NullPointerException(...)
```

This allows to compile both Kotlin/JVM and Kotlin/JS effectively.
2019-08-14 11:16:10 +03:00
Georgy Bronnikov
b9db4148cc Check whether test is ignored before reporting failure 2019-08-13 19:37:11 +03:00
Vyacheslav Gerasimov
0089de7f7f Build: Workaround dependency cycle in kotlinCompilerPluginClasspath
When bootstrap version is less than from current version dependencies
of `kotlin-scripting-compiler-embeddable` are resolved into projects
which leads to circular dependencies

 #KT-33287
2019-08-13 18:03:04 +03:00
Mikhael Bogdanov
8ff081a596 Don't trigger 'testJvm6ServerRuntime' initialization during configuration phase 2019-08-13 16:35:58 +02:00
Ilya Chernikov
19ce279611 Fix script config saving to file attributes
also make reading from file attribute more robust
2019-08-13 15:40:09 +02:00
Ilya Matveev
949bb9d150 IR: Get rid of descriptors in tailrec calls collection
Issue #KT-33279 fixed
2019-08-13 19:56:46 +07:00
Ilya Matveev
cafe2cdb12 IR: Fix fake-override resolution for fields
Earlier we used a result of a corresponding getter resolution to
obtain a fake overridden field. This approach is incorrect because
the getter resolved may not contain a backing field. This patch
fixes the issue by using the overriddenSymbols property of an
IrField directly.

Issue #KT-33034 fixed
2019-08-13 19:56:45 +07:00
Steven Schäfer
ac667403ef (Un)mute and add tests for vararg codegen 2019-08-13 14:24:55 +02:00
Steven Schäfer
d22814f6da JVM IR: Fix vararg handling in DefaultParameterInjector 2019-08-13 14:24:55 +02:00
Steven Schäfer
1543accf40 JVM IR: Remove vararg handling from ExpressionCodegen 2019-08-13 14:24:55 +02:00
Steven Schäfer
4d8d65abec JVM IR: Remove varargs from CallableReferenceLowering 2019-08-13 14:24:55 +02:00
Steven Schäfer
99f1329c14 JVM IR: Remove varargs from PropertyReferenceLowering 2019-08-13 14:24:55 +02:00
Steven Schäfer
4cef1c4901 JVM IR: Remove varargs from EnumClassLowering 2019-08-13 14:24:55 +02:00
Steven Schäfer
8d9f2f4238 JVM IR: Add a lowering to desugar varargs to arrays 2019-08-13 14:24:55 +02:00
Steven Schäfer
a7b31ba42b Add a utility function to compute type substitutions for call 2019-08-13 14:24:55 +02:00
Steven Schäfer
d61b276ebf JVM IR: Fix types in ArrayGet/Set intrinsics 2019-08-13 14:24:55 +02:00
Toshiaki Kameyama
a1c52f69f2 New J2K: convert Long.parseLong(s) to s.toLong()
#KT-21504 Fixed
2019-08-13 12:37:16 +03:00
Dmitry Savvinov
9290ec34db Provide proper platformSpecficContainer in CompositePlatformConfigurator
Now, call 'configureDefaultCheckers' and 'configureExtensionsAndCheckers'
from all childs configurators, instead of taking just container from
CommonPlatformAnalyzerServices

This is needed because some IDE services tend to re-create containers
(in particular, PerFileAnalysisCache and ResolveElementCache do that to
re-inject new trace) and use usual injection DSL, which, in particular,
takes 'platformSpecificContainer'.

Returning 'common'-conatiner leads to losing all platform-specific checkers.
On the other hand, calling exactly 'configureDefaultCheckers' +
'configureExtensionsAndCheckers' should be correct, because that's how
single-platform 'platformSpecificContainer' is composed (see
PlatformConfiguratorBase), and in 'createContainerForCompositePlatform'
we don't use 'platformSpecificContainer' anyways

^KT-23305 Fixed
2019-08-13 12:12:29 +03:00
Dmitry Savvinov
1b7fa21a83 Minor. Add comments to creation of DelegatingBindingTrace 2019-08-13 12:12:29 +03:00
Sergey Igushkin
5578434629 Fix: No value has been specified for 'binaryResultsDirectory' (KT-33246)
With Gradle 5.5+, set the property `binaryResultsDirectory` that
replaces `binResultsDir`.

Issue #KT-33246 Fixed
2019-08-12 18:23:50 +03:00
Alexander Udalov
01ddac58e1 Add language feature for changed name of property annotations method
#KT-31352 Fixed
2019-08-12 16:48:26 +02:00
Alexander Udalov
ea0142da60 Use JVM name of getter in synthetic method for property annotations
#KT-31352 In Progress
2019-08-12 16:48:25 +02:00
Alexander Udalov
dfea94aef5 Minor, use INTRINSICS_CLASS_NAME constant instead of hardcoded string 2019-08-12 16:09:24 +02:00
Alexander Udalov
b970a57adb Generate version requirement on inline functions since API version 1.4
The old compiler will crash if it tries to inline a function that's
passing a lambda parameter into the new parameter null check method
`Intrinsics.checkNotNullParameter` because that usage is not considered as
inlinable by the old compiler (it only knows about
`Intrinsics.checkParameterIsNotNull`). Therefore we require that these
functions can only be read by compilers of version 1.3.50 or greater.

 #KT-22275 Fixed
2019-08-12 16:09:23 +02:00
Alexander Udalov
e207c96336 Throw NPE instead of TypeCastException since 1.4
#KT-22275 In Progress
2019-08-12 16:09:23 +02:00
Alexander Udalov
2baddb029c Use Intrinsics.checkNotNullParameter to throw NPE in parameter null checks
Similarly to previous commits, this method was unused, so we're changing
its semantics in API version >= 1.4.

 #KT-22275 In Progress
2019-08-12 16:09:23 +02:00
Alexander Udalov
480313210a Use Intrinsics.checkNotNullExpressionValue to throw NPE in Java null checks
Similarly to previous commit, this method was unused since its
introduction before 1.0, so we're changing its semantics to throw NPE
and starting to use it with API version >= 1.4.

 #KT-22275 In Progress
2019-08-12 16:09:23 +02:00
Alexander Udalov
a7c8fdcbe2 Use Intrinsics.checkNotNull and throw NPE in !! operator generation
This method was introduced in c204e8fc67 "just in case" and was never
used. Therefore we're free to change its semantics and use it in all new
generated code (with API version >= 1.4), without even worrying that the
newly used API will leak from inline functions in stdlib when used with
an older API version. Since we agreed to change the type of thrown
exceptions to java.lang.NPE in KT-22275, invoke a new method
throwJavaNpe now which throws that exception instead of KNPE.

Note that the additional method that takes an exception message is still
unused and exists just in case we need to use it in the future. The new
method throwJavaNpe is public also "just in case" we need to invoke it
in the future; currently it's not invoked from the bytecode.

 #KT-22275 In Progress
2019-08-12 16:09:23 +02:00
Igor Chevdar
6106b72283 [IR] Fixed bug with fake override building 2019-08-12 17:07:44 +03:00
Igor Chevdar
ffdf3c361e [K/N libraries] Used fictitious functional interfaces factory 2019-08-12 17:07:44 +03:00
Igor Chevdar
226013353d [IrSerializer] Removed hacks with functional interfaces 2019-08-12 17:07:43 +03:00
Igor Chevdar
00dc335559 [IrSerializer] Preparations for functional interfaces handling 2019-08-12 17:07:43 +03:00
Alexander Udalov
c007f3efb3 Minor, move lazyClosure out of TypeUtils.kt 2019-08-12 14:57:21 +02:00
Alexander Udalov
cb8f70189d Minor, add debug info to assertion in AddContinuationLowering 2019-08-12 14:57:21 +02:00
Dmitry Savvinov
0065236bde Move default implementation of TargetPlatform.platformName to leaf classes
Otherwise, we have a static initialization loop, leading to null-leaks

Removing default interface method indeed disconnects the loop, as per JVM
Specification, "5.5 Initialization".

See KT-33245 for detailed explanations

^KT-33245 Fixed
2019-08-12 13:06:51 +03:00
Sergey Rostov
555e1a35e9 .idea: remove maven project from default config
Currently maven was not support in our JPS build.
You can still import them manually.
2019-08-12 10:58:15 +03:00
Sergey Rostov
ba9c632f15 Gradle, npm: use state file as fake output for :kotlinNpmInstall task
This is required in case when NpmSimpleLinker works (instead of yarn).
NpmSimpleLinker will not produce yarn.lock file, so :kotlinNpmInstall
was always up-to-date. Adding fake state file fixes the problem.

#KT-32874 Fixed
2019-08-12 10:41:16 +03:00
Sergey Rostov
6b5739bd6a Gradle, ProcessedFilesCache: don't report on clashes with for targets with removed source 2019-08-12 10:41:15 +03:00
Abduqodiri Qurbonzoda
84971d2003 Mention union in intersect documentation and vice versa (KT-26212) 2019-08-12 01:15:20 +03:00
Ilmir Usmanov
e88dce3e19 Use CFG to recognize suspension point's end
Previously it was linear scan, failing on unbalanced suspension markers.
Now, I use CFG to find end markers, which are reachable from start
markers. Using CFG allows to walk through suspension point instructions
only, since they form region.
If, for some reason, end marker does not exist (inliner or unreachable
code elimination pass remove unreachable code) or is unreachable,
just ignore the whole suspension point, as before.
 #KT-33172 Fixed
 #KT-28507 Fixed
2019-08-09 21:05:03 +03:00
Alexander Udalov
570d66be46 Support "// !API_VERSION: LATEST" directive in tests
Useful for tests that check behavior which depends on having a recent
API version enabled, and that don't want to depend on a specific fixed
API version (to prevent eventual obsoletion)
2019-08-09 15:47:58 +02:00
Alexander Udalov
13b07e71e8 Set AnalysisFlags.explicitApiVersion in tests with API_VERSION directive
To mimic the case of user passing an explicit "-api-version" flag to
avoid API version being inferred to the version of stdlib in
dependencies by JvmRuntimeVersionsConsistencyChecker
2019-08-09 15:47:09 +02:00
Alexander Udalov
9456763576 Minor, fix debug info when inferring API version 2019-08-09 15:47:09 +02:00
Alexander Udalov
d0385e4e7c Recognize Intrinsics.checkNotNullParameter call on lambdas in inline functions
We're going to start using this method since 1.4 for parameter null
checks, and without this change the compiler would fail if it
encountered a call to such method on a lambda parameter inside an inline
function, since that call is not inlinable.

 #KT-22275 In Progress
2019-08-09 15:47:09 +02:00
Ilya Kirillov
09ab98a4f8 New J2K: Don't fail on captured types & don't use functional interface with captured types
Note: we have to print captured types for lambda parameters.
It is needed for nullability inference as it requires explicit types specification to work.
Later in post-processing we remove explicit type specifications for lambda parameters which have captured types

#KT-33186 fixed
2019-08-09 16:31:58 +03:00
Steven Schäfer
0c3c0989b4 JVM IR: Don't move inaccessible const fields out of interface companions 2019-08-09 15:22:30 +02:00
Yan Zhulanow
3742425547 Move out compiler plugins from the main IDE plugin JAR (KT-31279) 2019-08-09 20:07:28 +09:00
Georgy Bronnikov
310237a8b1 Correct expected test output 2019-08-09 13:09:49 +03:00
Steven Schäfer
73d2ae961c JVM IR: BridgeLowering boxing fixes 2019-08-09 12:14:44 +03:00
Steven Schäfer
6aa8ecd745 JVM IR: Remove bridge construction from CallableReferenceLowering 2019-08-09 12:14:44 +03:00
Ilya Gorbunov
ebb59d51d2 Fix incorrect Double.toLong conversion for infinite values in JS
#KT-33225 Fixed
2019-08-09 11:49:28 +03:00
Dmitriy Novozhilov
8bf61a12df Minor. Remove UNREACHABLE_CODE slice from BindingContext
There was no reading from that slice, so it is redundant
2019-08-09 09:56:37 +03:00
Toshiaki Kameyama
154cf46f7c New J2K: add ReplaceGuardClause inspection to post-processing
#KT-22412 Fixed
2019-08-09 00:43:28 +03:00
Nicolay Mitropolsky
51e007116f KotlinLineMarkerProvider: ignore non-leaf elements when putting gutters (KT-28075, KT-30052, KT-33182)
previously for instance `KtClassBody` could get here as `leaf` and `leaf.parent` will return `KtClass` for it, making gutter for `KtClass` appear twice if origingal identifier and `KtClassBody` got here in different passes (one in "inner" other in "outer")
2019-08-08 16:38:47 +03:00
Dmitriy Novozhilov
c3ea0a1e5b [FIR] Add forgotten visit of annotation for FirAbstractLoop 2019-08-08 15:47:24 +03:00
Mikhael Bogdanov
1eda42cb88 JVM_IR. Generate SMAP information for anonymous classes
#KT-28092 Fixed
2019-08-08 12:02:50 +02:00
Mikhael Bogdanov
a444a40849 JVM_IR. Basic support of 'inlineCallSiteInfo' 2019-08-08 12:02:49 +02:00
Steven Schäfer
f34a08cbbf JVM IR: Convert interface companion fields to static fields. 2019-08-08 12:01:52 +02:00
Yan Zhulanow
e6211c4995 Debugger: Fix the compilation error in as33 bunch 2019-08-08 04:26:10 +09:00
Toshiaki Kameyama
f5c0a30c51 Add intention to replace "Map.getOrDefault"
#KT-21503 Fixed
2019-08-07 17:38:15 +03:00
Mikhail Zarechenskiy
e09ae645b3 Advance bootstrap version to 1.3.60-dev-770
Follow-up of KT-33157.
 This is needed to have proper signatures in stdlib afte the fix (80acc56c10)
2019-08-07 17:29:44 +03:00
Mikhail Zarechenskiy
9f0991f0aa Minor, clean up type approximator a bit 2019-08-07 16:06:45 +03:00
Mikhail Zarechenskiy
04e57f712e [NI] Introduce feature for passing function references with defaults
Relates to KT-8834, we continue reducing differences between old and new
 inference. Note that as for `SamConversionPerArgument`, this feature
 is enabled in the compiler and not in the IDE to avoid breaking code
 for those users that already enabled new inference in the compiler
2019-08-07 15:58:36 +03:00
Mikhail Zarechenskiy
0219b86d06 [NI] Fix poor performance of recursive types approximation
#KT-32407 Fixed
2019-08-07 15:21:16 +03:00
Mikhail Zarechenskiy
5f76918c90 [NI] Use approximator as a component, don't recreate it during resolve 2019-08-07 15:21:15 +03:00
Ilya Chernikov
cddabf140b Implement proper expression generation for the last script line
fixes problem with result fields
#KT-33127 fixed
2019-08-07 11:26:37 +02:00
Sergey Igushkin
ec54246b3a Fix TCServiceMessagesClient not removing an empty line prefix on Windows 2019-08-07 12:20:13 +03:00
Steven Schäfer
471b515adb Avoid getTopLevelClass in firMode 2019-08-07 10:34:43 +02:00
Steven Schäfer
43a27ab58c (Un)mute tests 2019-08-07 10:34:43 +02:00
Steven Schäfer
70aee4f9e2 JVM IR: Handle -Xassertion modes 2019-08-07 10:34:43 +02:00
Steven Schäfer
7b2edc6de8 Extract simple inlining utility from ArrayConstructorLowering 2019-08-07 10:34:43 +02:00
Steven Schäfer
d11344ce2e Add more tests for -Xassertions=jvm corner cases 2019-08-07 10:34:43 +02:00
Sergey Rostov
3e25166832 Gradle, js, karma: require webpack npm dependencies 2019-08-07 09:29:22 +03:00
Sergey Rostov
99762193f9 Gradle, js, npm: proper disambiguation classifier for npm and tools configurations
#KT-32293 Fixed
2019-08-07 09:29:22 +03:00
Sergey Rostov
1dc860f206 Gradle, js, npm: fix targets and compilation listener
#KT-32293 Fixed
2019-08-07 09:29:21 +03:00
Sergey Rostov
87e80317a0 Gradle, js, external declarations: read flags from properties 2019-08-07 09:29:21 +03:00
Jim S
88db93853f Make context available to suppressors
We've found that the BindingContext is necessary for any meaningful suppressor.
This change adds the ability for suppressors to use the BindingContext when available.

Change-Id: I14d8148ef659eca273445bf0638bcdb8c3b21f02
2019-08-07 03:16:24 +03:00
Ilya Kirillov
5151659006 Do not use dummy resolving for light data classes which extend other classes
When using dummy resolving for creating stubs of data classes we do not have overriding information
which is needed to determine whether we need to generate synthetic members or not.
As a result of that, we may have two different versions of member scope: the first one is
resolved by dummy resolving and the second one resolved via an ordinary one.

As light methods depend on the index of them in the class body,
we can have two different methods with the same index
which breaks mapping from dummy resolved methods to normal ones.

This behaviour can be reproduced when having data class which
extends other class with some synthetic members overridden and marked as final
like described in #KT-32969

#KT-32969 fixed
2019-08-06 20:08:43 +03:00
Yan Zhulanow
39e15782b2 Debugger: Fix compatibility with AS 3.3 2019-08-07 01:15:34 +09:00
Yan Zhulanow
01805e8878 Debugger: Fix read action in 'createLineSourcePosition' (KT-33064) 2019-08-07 01:15:34 +09:00
Yan Zhulanow
8211e73f7e Revert "Evaluator: Do not report parsing error on empty block/expression (KT-11938)"
KT-11938 reopened because of KT-32699.

This reverts commit 6686ed2e
2019-08-07 01:15:33 +09:00
Yan Zhulanow
d86bede293 Fix compatibility issue with the 'kotlinttest' plugin 2019-08-07 01:15:33 +09:00
Yan Zhulanow
0a092d6613 Debugger: Fix breakpoint firing in '$suspendImpl' (KT-27645) 2019-08-07 01:15:33 +09:00
Yan Zhulanow
9096d211d3 Debugger, minor: Fix line breakpoint popup (add containing declaration name) 2019-08-07 01:15:33 +09:00
Yan Zhulanow
1f13c4b87b Parcelize: Remove remaining experimental status checks (KT-32096) 2019-08-07 01:15:33 +09:00
Yan Zhulanow
b3941c4ed0 Pill: Fix platform source attachment in compiler modules 2019-08-07 01:15:33 +09:00
Yan Zhulanow
086b151e1f Pill: Fix project build, add kotlin-scripting-jvm-host module 2019-08-07 01:15:32 +09:00
Yan Zhulanow
89c45e9e3f Fix stub loading for crossinline lambdas compiled by older Kotlinc (EA-105730)
Older kotlinc versions (1.1.5?) didn't generate the 'INNERCLASS' attribute for some anonymous classes, e.g. for 'crossinline' lambdas.
An example: 'Timer().schedule(1000) { foo () }'

Normally, stub loader checks if the class is 'ClassFileViewProvider.isInnerClass()', and ignores the class file.
Without the 'INNERCLASS' attribute this check fails. As the stub loaded isn't created to deal with anonymous classes nicely, it fails miserably.
This commit explicitly ignores classes with local visibility.
2019-08-07 01:15:32 +09:00
Yan Zhulanow
cc3f1b3501 Debugger: Fix exception in "Smart step into" for Java method calls (KT-32813) 2019-08-07 01:15:32 +09:00
Yan Zhulanow
79a5375ad1 Debugger: Fix NPE in CFA during evaluation (KT-32830) 2019-08-07 01:15:32 +09:00
Yan Zhulanow
ecce34e02b Debugger: Fix infinite recursion in inline callable searcher (EA-108938) 2019-08-07 01:15:32 +09:00
Yan Zhulanow
ea97926c66 Debugger: Add verbose logging for EA-125569, fix possible issue 2019-08-07 01:15:32 +09:00
Yan Zhulanow
527df35bf3 Debugger: Handle case when we can't calculate the anonymous class name gracefully (EA-141202) 2019-08-07 01:15:31 +09:00
Yan Zhulanow
0f568a395f Debugger: Recognize exceptions from target VM in FUS 2019-08-07 01:15:31 +09:00
Yan Zhulanow
71e8cddaa6 Minor: Fix NI error in KotlinPositionManager 2019-08-07 01:15:31 +09:00
Yan Zhulanow
17c3406097 Debugger: Gracefully handle debugger exceptions we can't do anything reasonable with (EA-128154, EA-139473) 2019-08-07 01:15:31 +09:00
Yan Zhulanow
70745f233f Debugger: Fix reference value evaluation in Java contexts
Before this commit, Kotlin evaluator used the precise value type for variable finding.
As a result, VariableFinder often failed to find such a variable (cause the real one has a super type).
2019-08-07 01:15:31 +09:00
Yan Zhulanow
ed03d6e48e Debugger, minor: Move FrameInfo out of KotlinCodeFragmentFactory 2019-08-07 01:15:30 +09:00
Yan Zhulanow
98b4844f51 Debugger, minor: Reformat KotlinCodeFragmentFactory 2019-08-07 01:15:30 +09:00
Yan Zhulanow
bb3091429f Debugger: Keep a reference to stack trace element (EA-208000) 2019-08-07 01:15:30 +09:00
Yan Zhulanow
a664df8143 Debugger: Unwrap EvaluateExceptions on checking (EA-105847) 2019-08-07 01:15:30 +09:00
Yan Zhulanow
e301ddde9e Pill: Ignore KotlinPlugin artifact in Git 2019-08-07 01:15:30 +09:00
Yan Zhulanow
52a958256d Debugger: Disable exception on 'variable not found' event (EA-138365)
The error message is still visible to the user, so it doesn't make much sense to duplicate it as an exception.
2019-08-07 01:15:30 +09:00
Yan Zhulanow
e0c4a1c6f1 Debugger: Improve error diagnostics in FUS 2019-08-07 01:15:29 +09:00
Yan Zhulanow
a20014a7e6 Reformat eval4j 2019-08-07 01:15:29 +09:00
Yan Zhulanow
eb173893b0 Debugger: Minor, check evaluator preconditions as in Java evaluator 2019-08-07 01:15:29 +09:00
Yan Zhulanow
d6487e89ad Debugger: Prohibit 'suspend fun' calls in evaluated expressions
Currently, it's impossible to call suspend functions in evaluated code fragments (see KT-31701).
This commit officially prohibits such calls, so users will see a semi-friendly error message.
2019-08-07 01:15:29 +09:00
Yan Zhulanow
910133dbfb Debugger: Fix line numbers on String literal 'when' condition checks
Before this commit, line numbers were only available on 'when' clause bodies.
So, if a clause condition check didn't succeed, the entirely clause could be ignored.
2019-08-07 01:15:28 +09:00
Yan Zhulanow
3d3bde5483 Debugger: Do not ignore duplicated locations for line breakpoints 2019-08-07 01:15:28 +09:00
Yan Zhulanow
de361f0b6c Minor: Add 'kotlinc' to the project dictionary 2019-08-07 01:15:28 +09:00
Yan Zhulanow
780c0518e5 Debugger: Disallow breakpoints for @InlineOnly function bodies (KT-32687, KT-24408)
Kotlin compiler strips all debug information for @InlineOnly functions, making them non-debuggable.
This commit disables breakpoints inside @InlineOnly functions to prevent false expectations.
2019-08-07 01:15:28 +09:00
Yan Zhulanow
25fb77e7ad Debugger: Add breakpoint applicability tests
This commit adds a number of tests that check breakpoint placing behavior, and an inline action that work the same way as tests.
2019-08-07 01:15:28 +09:00
Yan Zhulanow
a8d08815a6 Simplify call: Fix false positive in "filter {}" detection (KT-32468)
"Simplify filter {}" conversion changes semantics when the casted type is not a subtype if an initial collection element type.
This commit limits a replacement suggestion to subtype cases.
2019-08-07 01:15:28 +09:00
Yan Zhulanow
b1f132d750 Debugger: Add stepping tests for function breakpoints 2019-08-07 01:15:27 +09:00
Yan Zhulanow
023baf6233 Debugger: Ask for light class generation in background 2019-08-07 01:15:27 +09:00
Yan Zhulanow
129ca7f2d8 Debugger: Fix breakpoint applicability (KT-10984)
Ensure that breakpoints of each type can be placed only on lines where it makes sense to place a breakpoint.

Here is a quick summary of the rules:
1. Method breakpoints are available for functions, property accessors, constructors;
2. Line breakpoints are available on any line with an expression, excluding some cases like 'const' property initializers or annotations;
3. Line breakpoints should be available on a '}' in functions and lambdas;
4. Line breakpoints are not suggested for one-liners;
5. Lambda breakpoints should be shown for single-line lambdas.
2019-08-07 01:15:27 +09:00
Yan Zhulanow
22c18ffaa9 Debugger: Add Kotlin Function breakpoints (KT-22116)
Now it's possible to put a function breakpoint.
In JVM, function breakpoints behave as JVM method breakpoints. Normally, they're triggered twice – once on enter, and once on exit.
2019-08-07 01:15:27 +09:00
Yan Zhulanow
55ea0840b1 Debugger: Keep continuation and spilled variables until the whole trace is processed (EA-208000) 2019-08-07 01:15:27 +09:00
Vyacheslav Gerasimov
89b152809f Build: Make dependencies on builtins compileOnly
for kotlin-annotations-android & kotlin-annotations-jvm, to prevent
builtins from occurring in maven pom compile scope.

 #KT-33140
2019-08-06 18:09:20 +03:00
Mikhail Zarechenskiy
80acc56c10 Don't lost type parameters for members of inline classes in the bytecode
#KT-33157 Fixed
2019-08-06 17:53:08 +03:00
Sergey Igushkin
a874f4f5c3 Don't use addIfNotNull core util in the JS Gradle plugin
The function was placed in a package whose another top-level function
used coroutines. This led to a NCDFE kotlin.coroutines.Continuation
with Gradle versions that bundle Kotlin pre-1.3 stdlib.

Instead, use the existing util function `lowerCamelCaseName` which also
filters nulls.
2019-08-06 16:55:46 +03:00
Mikhael Bogdanov
47bee6a6c5 JVM_IR. Support reified parameters in anonymous object super constructor call 2019-08-06 14:48:16 +02:00
Mikhael Bogdanov
645736f167 JVM_IR. Support anonymous object/lambda reification 2019-08-06 14:48:16 +02:00
Vyacheslav Gerasimov
0571f90762 Build: Add kotlin.build.jar.compression property
Is `true` on teamcity and `false` locally by default

 #KT-32573
2019-08-06 15:40:40 +03:00
Vyacheslav Gerasimov
659c399d30 Build: Add kotlin.build.dependencies.dir property
To specify directory downloaded dependencies stored in

 #KT-30310
2019-08-06 15:40:40 +03:00
Dmitry Petrov
1d0ba4edd4 IR: IrTypeAlias: update testData after rebase on master 2019-08-06 12:42:44 +03:00
Dmitry Petrov
f590d4da9e IR: IrTypeAlias: serialize/deserialize new IR objects
Add uniqId for typealias declarations.
Implement WrappedTypeAliasDescriptor.
2019-08-06 12:42:43 +03:00
Dmitry Petrov
b3525b077c IR: IrTypeAlias: isActual 2019-08-06 12:42:02 +03:00
Dmitry Petrov
2b43b09444 IR: IrTypeAlias: Strip 'typealias' declarations in back-ends 2019-08-06 12:42:02 +03:00
Dmitry Petrov
6abb0ffe28 IR: IrTypeAlias: Update FIR2IR testData
NB a lot of FIR2IR tests actually don't pass, and we don't care much at
the moment.
2019-08-06 12:42:02 +03:00
Dmitry Petrov
48ae76ac28 IR: Introduce IrTypeAlias element 2019-08-06 12:42:02 +03:00
Ilya Matveev
499f9330d2 Gradle: Don't use the deprecated "layout" method for Ivy repos
Issue #KT-30258 fixed
2019-08-06 14:13:27 +07:00
Roman Golyshev
b8bdef0005 Refactoring: introduce isKotlinScratch function 2019-08-06 09:31:17 +03:00
Roman Golyshev
f35ce1e9f6 Refactoring: remove duplicate of kotlin script extension constant 2019-08-06 09:29:45 +03:00
Alexander Udalov
49b534e894 JVM IR: move non-private const properties from multifile part to facade 2019-08-05 21:27:22 +02:00
Alexander Udalov
f01b0f6467 JVM IR: generate correct metadata for multi-file classes 2019-08-05 21:27:21 +02:00
Alexander Udalov
4be0e00071 JVM IR: support multi-file classes
Without the `-Xmultifile-parts-inherit` mode for now.

This is implemented as follows: FileClassLowering collects information
about multifile parts and the corresponding facades, which a later
GenerateMultifileFacades phase uses to generate new IrFile instances and
add it to the module fragment that's being compiled.

Note that GenerateMultifileFacades is in the end of lowering phases
because delegates in the facade should be generated for all additional
functions generated by certain lowerings (default arguments,
JvmOverloads, etc.). If GenerateMultifileFacades was right after
FileClassLowering, they would still be generated, but we'd then process
them in lowerings mentioned above, which would result in duplicated
logic in the bytecode. There's a new bytecode text test which checks
that this doesn't happen for functions with default arguments.
2019-08-05 21:27:21 +02:00
Alexander Udalov
73a671af7c JVM IR: generate tests on incremental compilation 2019-08-05 21:27:21 +02:00
Alexander Udalov
e1fc2c57cb JVM IR: introduce global serialization bindings for convenience
In the old JVM backend, JvmSerializationBindings are created per
ClassBuilder, and special care must be taken to make sure that
JVM-specific metadata ends up in the correct bindings. This is
especially relevant for declarations whose metadata is moved to other
classes away from the place where the original declaration lies, for
example properties moved from companion object to the outer class, or
synthetic methods for annotation properties in interfaces moved to
DefaultImpls, or const properties in multifile parts moved to the
facade.

In the JVM IR backend, this seems not necessary and actually it's
complicated to ensure that we use the correct ClassBuilder for bindings
(see the code simplification in ClassCodegen). Therefore, in case we
don't have an easy way to retrieve the correct ClassBuilder instance, we
now write all JVM-specific metadata to the new _global_ bindings map in
GenerationState, which is used by JvmSerializerExtension as a fallback
if the ClassBuilder's local map has no relevant key.
2019-08-05 21:27:21 +02:00
Alexander Udalov
babbbd0ff6 JVM IR: generate facade class for property accessors from dependencies 2019-08-05 21:27:20 +02:00
Alexander Udalov
28e2fd63ca IR: introduce WrappedProperty{G,S}etterDescriptor
This is needed in order to support wrapped properties properly in
KotlinTypeMapper (see the `is PropertyAccessorDescriptor` call in
`mapFunctionName`) which is still being used when mapping function call
signatures
2019-08-05 21:27:20 +02:00
Alexander Udalov
cfd3d974d1 JVM IR: perform substitution in IrTypeSystemContext.getSubstitutedUnderlyingType 2019-08-05 21:27:20 +02:00
Alexander Udalov
908498a560 JVM IR: deduplicate exception message text in FunctionCodegen
See 37002748c8
2019-08-05 21:27:20 +02:00
Alexander Udalov
5f06c9e86c JVM IR: do not generate generic signature for $delegate field
See ee7bbbf530
2019-08-05 21:27:20 +02:00
Alexander Udalov
45f93521d9 JVM IR: add IrWriteSignatureTestGenerated 2019-08-05 21:27:20 +02:00
Alexander Udalov
26346d88cc JVM IR: take IrFunction in IrTypeMapper.mapFunctionName/mapReturnType 2019-08-05 21:27:20 +02:00
Alexander Udalov
8c1b2a7f20 JVM IR: record DELEGATED_PROPERTIES slice for correct metadata serialization
This is needed in order to get rid of CodegenAnnotatingVisitor in JVM IR
2019-08-05 21:27:19 +02:00
Ilmir Usmanov
d9caeca249 JVM_IR: Copy suspend lambda's attributes 2019-08-05 20:25:31 +03:00
Sergey Igushkin
88e5d2bc70 Fix unrelated tasks being configured at execution time, KT-31666
Replace iteration over all tasks with `.matching { ... }` with `
.configureEach { if (...) ... }`, so that the check iterates
just over those tasks which are triggered to configure from
somewhere else.

Issue #KT-31666 Fixed
2019-08-05 17:08:22 +03:00
Steven Schäfer
9182fe887e Fix inline class handling in DefaultParameterInjector 2019-08-05 16:48:18 +03:00
Steven Schäfer
79f71f61d5 JVM BE: Add more tests for default arguments
- Inline class parameters should not be boxed.
- Empty vararg parameters should not allocate an empty array.
2019-08-05 16:48:18 +03:00
Roman Golyshev
9d7de8e9ec KT-32791: Avoid EDT when acquiring editor for setting line mark in scratches
^KT-32791 Fixed
2019-08-05 16:28:56 +03:00
Mikhael Bogdanov
971d36837a JVM_IR. Don't generate annotations and signature on synthetic methods 2019-08-05 15:00:51 +02:00
Ilya Kirillov
2dabb91a1f J2K, minor: clean copy-paste conversion code 2019-08-05 15:14:28 +03:00
Ilya Kirillov
f1482177b4 Fix NPE in J2K copy-paste handler for invalid offset 2019-08-05 15:14:28 +03:00
Ilya Kirillov
838582c926 Fix "Assertion failed: Write access is allowed inside write-action only" in Kotlin refactoring dialog
#KT-33059 fixed
2019-08-05 15:14:28 +03:00
Ilya Kirillov
b4a0436aba Show occurrences chooser in EDT thread in KotlinIntroduceVariableHandler 2019-08-05 15:14:27 +03:00
Ilya Kirillov
02f2009f2a Do not show "Replace overloaded operator with function call" intention on incomplete expressions
#KT-33115 fixed
2019-08-05 15:14:27 +03:00
Toshiaki Kameyama
892135ae23 Unused symbol: don't report for enum entry when enum builtin function is used
#KT-31133 Fixed
2019-08-05 12:50:28 +03:00
Toshiaki Kameyama
776cccf57c FunctionWithLambdaExpressionBodyInspection: fix ClassCastException for "Remove braces" quick fix
#KT-32580 Fixed
2019-08-05 12:35:23 +03:00
Louis CAD
e5e5e9084e Improve error message (#2505)
Fore the case where a target has been created or configured twice with different presets,
avoid showing "null" inside the error message if existing target has not preset,
and append a point.
2019-08-05 10:35:10 +03:00
Ilya Gorbunov
b2753a22a2 Advance bootstrap to 1.3.60-dev-607 2019-08-04 06:01:56 +03:00
Ilya Gorbunov
103e16c40f kotlin-maven-plugin: avoid adding sourceroots to read-only freeArgs list 2019-08-04 03:15:54 +03:00
Georgy Bronnikov
5d12603d73 JVM_IR: remove unused code 2019-08-04 01:35:05 +03:00
Georgy Bronnikov
ce6e2621cf Unmute working tests 2019-08-04 01:35:05 +03:00
Georgy Bronnikov
f9391ec790 Remove handling of default arguments from codegen 2019-08-04 01:35:05 +03:00
Georgy Bronnikov
4d50086d35 JVM_IR: reorder lowerings
Some lowerings have to come before DefaultParameterInjector.
2019-08-04 01:35:05 +03:00
Georgy Bronnikov
924fa6f9d3 JVM_IR: use DefaultParameterInjector 2019-08-04 01:35:05 +03:00
Dmitry Gridin
52c00ba2a1 Extract JvmStartupActivity class 2019-08-02 19:23:23 +03:00
Dmitry Gridin
77a630ce34 UnsupportedAbiVersionNotificationPanelProvider: fix project leak 2019-08-02 19:19:47 +03:00
Dmitry Gridin
584b42d9f9 Add missing EP for StartupActivity 2019-08-02 19:19:47 +03:00
Dmitry Gridin
832c8e0e20 Fix "Non default constructors for extension class" 2019-08-02 19:19:47 +03:00
Dmitry Gridin
9ea2446ec0 KotlinLanguageInjector: cleanup code 2019-08-02 19:19:47 +03:00
Dmitry Gridin
49aa4aba71 UnsupportedAbiVersionNotificationPanelProvider: cleanup code 2019-08-02 19:19:47 +03:00
Simon Ogorodnik
7c24ad39ea Remove fir:lightTree test on kotlinx.coroutines as it caused problems in IDEA 2019-08-02 17:33:29 +03:00
Ilya Kirillov
be7b228cf6 Fix "Attempt to modify PSI for non-committed document" for some cases
It can be thrown after an action when optimize imports is called
2019-08-02 12:03:59 +03:00
Ilya Kirillov
1981e8b9bf New J2K: Add better error reporting in AST builder 2019-08-02 12:03:59 +03:00
Ilya Kirillov
6b0c1da42c Do not use methods which may show UI dialog in write action in refactorings
#KT-33082 fixed
2019-08-02 12:03:59 +03:00
Ilya Kirillov
474a8850b3 Do not show error message in decompiler in write action
#EA-209667 fixed
2019-08-02 12:03:58 +03:00
Ilya Kirillov
3205b25f80 Fix code completion for the injected Kotlin code
Allow completion of physical files as it is the case for injected Kotlin code.
Also, fix function completion for that case as `document.charsSequence` for injected code document is not dynamically updated as for usual document.
So, we should to do it manually

#KT-31117 fixed
2019-08-02 12:03:58 +03:00
Ilya Kirillov
84498513f6 Do not allow optimize imports for uncommitted document
Optimize imports may be called after executing command, and document can be uncommitted after command is finished. In that case we will get ISE: Attempt to modify PSI for non-committed Document

#EA-209693 fixed
2019-08-02 12:03:58 +03:00
Ilya Kirillov
7b659a73c7 Check if document is writable on converting Java to Kotlin 2019-08-02 12:03:57 +03:00
Ilya Kirillov
0d42d3f0a1 Fix CCE in move-refactoring
It happens when companion object's descriptor doesn't correspond to PSI object declaration

#EA-126981 fixed
2019-08-02 12:03:57 +03:00
Ilya Kirillov
46ff959415 Fix using invalidated PSI element in Remove Braces Intention
#EA-142427 fixed
2019-08-02 12:03:57 +03:00
Ilya Gorbunov
65b0a5f903 Unify withIndex docs wording 2019-08-01 19:55:36 +03:00
Ilya Gorbunov
2e445ebad6 Enable test that uses Array.fill in JS and Native 2019-08-01 19:02:39 +03:00
Ilya Gorbunov
3751a8a797 Common Array.fill for unsigned arrays, improve docs, native impl name
KT-32359
2019-08-01 19:02:39 +03:00
Jake Wharton
1a6069382e Provide Array.fill in common stdlib
KT-32359
2019-08-01 19:02:38 +03:00
Nikolay Krasko
83e422fc3b Workaround copied kotlin element happened to be outside the KtFile
Can be reproduced after revert with
IdeLightClassTestGenerated$Local.testDollarsInNameLocal test.
2019-08-01 18:21:13 +03:00
Nikolay Krasko
5614afed14 Fix over-caching content in light classes for local declarations (KT-32820)
Use combination of OOCB and file tracker for local classes.

#KT-32820 Fixed
2019-08-01 18:16:36 +03:00
Nikolay Krasko
ce3ad8f4da Use kotlin specific OOCB tracker for light classes inner cache
ClassInnerStuffCache from the platform caches everything with platform
OUT_OF_CODE_BLOCK tracker.
2019-08-01 18:16:35 +03:00
Dmitry Savvinov
78ae1a5745 Annotate default interface method with JvmDefault
To keep compatibility with external plugin(s) which inherit their
Java-classes from KotlinProjectConfigurator and make
CompatibilityChecker happy
2019-08-01 17:31:34 +03:00
Vyacheslav Gerasimov
784483e7ac as36: Add required plugins to test runtime
#KT-33063
2019-08-01 17:07:11 +03:00
Vyacheslav Gerasimov
14bd8f4eef as36: Update AS build version to 192.5765565 2019-08-01 17:07:11 +03:00
Vyacheslav Gerasimov
67b84cf35d Use properties bintray.user & bintray.apikey for AS repo 2019-08-01 17:07:11 +03:00
Dmitry Gridin
645bbc93cb KotlinWithGradleConfigurator: support addKotlinLibraryToModuleBuildScript for multiplatform
#KT-27270 Fixed
2019-08-01 16:09:04 +03:00
Dmitry Gridin
c88d4f43d3 ConfigureKotlinInProjectUtils: minor cleanup 2019-08-01 16:09:04 +03:00
Dmitry Gridin
3ea195e1a2 DescriptorRenderedImpl: fix order of val & vararg modifier for actual class
#KT-31921 Fixed
2019-08-01 16:08:45 +03:00
Dmitry Gridin
a2f937e282 DescriptorRender: cleanup code 2019-08-01 16:08:45 +03:00
Toshiaki Kameyama
80b09b9a08 Replace 'if' with 'when': don't remove branch brances
#KT-32650 Fixed
2019-08-01 16:05:06 +03:00
Mikhail Glukhikh
f3b42507d9 Do not search for bad substrings inside compiler/fir/lightTree/testData
This folder is auto-generated and git ignored
2019-08-01 15:14:29 +03:00
Ivan Cilcic
00f880a5a0 Make all necessary refactoring after merge
1) Removed all unnecessary sessions
2) Added delegation converter
3) Moved property accessor initialization to apply block instead of constructor
4) Removed unnecessary AnotationContainer class
2019-08-01 15:14:29 +03:00
Ivan Cilcic
f3a7db2428 Add auto test in gradle (light tree)
Additionally removed benchmarks from auto test because they require manual setting.
Instruction was also added.
2019-08-01 15:14:29 +03:00
Ivan Cilcic
2ca7978544 Remove duplicate code from convertIsExpresion and convertBinaryWithType 2019-08-01 15:14:29 +03:00
Ivan Cilcic
d03b6cc014 Remove extra test methods (light tree) 2019-08-01 15:14:29 +03:00
Ivan Cilcic
250d86b692 Rename "MyKotlinParser" to "KotlinLightParser" 2019-08-01 15:14:28 +03:00
Ivan Cilcic
2e05fe9976 Remove extra method toFirExpression 2019-08-01 15:14:28 +03:00
Ivan Cilcic
f3299c4636 Delete extra files with util methods (raw FIR) 2019-08-01 15:14:28 +03:00
Ivan Cilcic
01daa90f5c Extract bangbang and bindLabel methods (raw FIR) 2019-08-01 15:14:28 +03:00
Ivan Cilcic
c5547a2229 Extract some information to separate Context class 2019-08-01 15:14:28 +03:00
Ivan Cilcic
cad0dbf087 Rewrite RawFirBuilder and its utils to be able to reuse it in LightTree converter 2019-08-01 15:14:27 +03:00
Ivan Cilcic
084bad4c25 Fix bug in import directives converter (light tree to FIR) 2019-08-01 15:14:27 +03:00
Ivan Cilcic
1af7063a47 Made primary constructor wrapper to avoid recreating value parameter instances 2019-08-01 15:14:27 +03:00
Ivan Cilcic
2a60f95a32 Add FIR session argument to LightTree2Fir constructor 2019-08-01 15:14:27 +03:00
Ivan Cilcic
c253ff7953 Write syntactically incorrect constructions processing (light tree to FIR) 2019-08-01 15:14:26 +03:00
Ivan Cilcic
ef535a2d85 Resolve converter errors after merge (light tree to FIR) 2019-08-01 15:14:26 +03:00
Ivan Cilcic
86097bdcce Write method to test data from diagnostic test folder (light tree) 2019-08-01 15:14:26 +03:00
Ivan Cilcic
b5293e7df7 Edit light tree to FIR benchmarks to support off stub mode 2019-08-01 15:14:26 +03:00
Ivan Cilcic
c8c37fd86e Move object literal parsing, rewrite the determination that member is local 2019-08-01 15:14:26 +03:00
Ivan Cilcic
531ee03a92 Write if and when parsing (light tree to FIR) 2019-08-01 15:14:25 +03:00
Ivan Cilcic
b7d57690c5 Write try expression parsing (light tree to FIR) 2019-08-01 15:14:25 +03:00
Ivan Cilcic
a0e79449fd Write throw expression parsing (light tree to FIR) 2019-08-01 15:14:25 +03:00
Ivan Cilcic
a714515527 Write break and continue parsing (light tree to FIR) 2019-08-01 15:14:25 +03:00
Ivan Cilcic
e0a92c5ed5 Write local variable parsing (light tree to FIR) 2019-08-01 15:14:25 +03:00
Ivan Cilcic
c0fdbec358 Write loops parsing (light tree to FIR) 2019-08-01 15:14:24 +03:00
Ivan Cilcic
26290746f3 Write object literal parsing (light tree to FIR) 2019-08-01 15:14:24 +03:00
Ivan Cilcic
8dd72a5cf2 Write lambda expressions and local members parsing (light tree to FIR) 2019-08-01 15:14:24 +03:00
Ivan Cilcic
50573066fe Write double colon suffix parsing (light tree to FIR) 2019-08-01 15:14:24 +03:00
Ivan Cilcic
e15b91ea16 Write arrayOf call parsing (light tree to FIR) 2019-08-01 15:14:24 +03:00
Ivan Cilcic
9d36855cb6 Write type operator call parsing (light tree to FIR) 2019-08-01 15:14:23 +03:00
Ivan Cilcic
e0bebba42e Fix some light tree to FIR converter bugs after testing 2019-08-01 15:14:23 +03:00
Ivan Cilcic
08ab530ef0 Write this and super expression parsing (light tree to FIR) 2019-08-01 15:14:23 +03:00
Ivan Cilcic
a13a043169 Write binary and unary expressions parsing (light tree to FIR) 2019-08-01 15:14:23 +03:00
Ivan Cilcic
be073ce2e6 Reformat LightTree2Fir class to be able to parse block of code 2019-08-01 15:14:23 +03:00
Ivan Cilcic
bfe83d0bfd Write some simple FIR dummy comparator 2019-08-01 15:14:22 +03:00
Ivan Cilcic
5a24c2253a Write annotation's conversion (light tree to FIR) 2019-08-01 15:14:22 +03:00
Ivan Cilcic
8bcea1cf85 Change parseCharacter visibility to be visible from lightTree module 2019-08-01 15:14:22 +03:00
Ivan Cilcic
b0a04b1061 Fix bug in abstract benchmark class (light tree) 2019-08-01 15:14:22 +03:00
Ivan Cilcic
a66adffdcf Create ExpressionsConverter class and took out light tree node handlers 2019-08-01 15:14:21 +03:00
Ivan Cilcic
05757c1ada Write basis for separate testing some of fir nodes 2019-08-01 15:14:21 +03:00
Ivan Cilcic
e9ddbc412c Took out common code of dir walking 2019-08-01 15:14:21 +03:00
Ivan Cilcic
5b5eadeeaa Change method's order in converter according to KotlinParsing class 2019-08-01 15:14:21 +03:00
Ivan Cilcic
840e627f1f Add annotation processing in joinTypeParameters method 2019-08-01 15:14:21 +03:00
Ivan Cilcic
8b1a63b54d Move modifiers enum set to separate file 2019-08-01 15:14:20 +03:00
Ivan Cilcic
7cbd838720 Change AbstractBenchmark code to avoid collisions in files map 2019-08-01 15:14:20 +03:00
Ivan Cilcic
c9d5202971 Add reference to parse value parameters methods in light tree converter 2019-08-01 15:14:20 +03:00
Ivan Cilcic
bbf7263ddc Summarize methods that convert value parameter nodes 2019-08-01 15:14:20 +03:00
Ivan Cilcic
5fc3367c25 Write ClassWrapper class to transmit information to lower FIR nodes
Additionally a number of further optimization in Converter class
2019-08-01 15:14:20 +03:00
Ivan Cilcic
b5d617492a Change modifiers parsing and some minor changes in fir conversion 2019-08-01 15:14:19 +03:00
Ivan Cilcic
05a2b2fac8 Add some minor changes to fix errors after merge in lightTree module 2019-08-01 15:14:19 +03:00
Ivan Cilcic
d0dfcbb2f2 Add simple documentation to convert methods 2019-08-01 15:14:19 +03:00
Ivan Cilcic
311964acea Made some code refactoring to make it more readable 2019-08-01 15:14:19 +03:00
Ivan Cilcic
f07d85eb83 Create benchmark for light tree FIR builder (including coroutines test) 2019-08-01 15:14:19 +03:00
Ivan Cilcic
0a8d0baa59 Write benchmarks for some generated cases 2019-08-01 15:14:18 +03:00
Ivan Cilcic
c47a8e2025 Add JMH for benchmark 2019-08-01 15:14:18 +03:00
Ivan Cilcic
0e8bbab925 Change total kotlin tests architecture 2019-08-01 15:14:18 +03:00
Ivan Cilcic
45faf76b4a Write test to compare FIR from light tree with FIR from PSI 2019-08-01 15:14:18 +03:00
Ivan Cilcic
9dbacb5380 Put the common code into a separate function 2019-08-01 15:14:17 +03:00
Ivan Kylchik
16d7d202d2 Add separated tests for tree generation and fir convertion 2019-08-01 15:14:17 +03:00
Ivan Kylchik
343dcca79d Add some test cases to test performance and tree construction correctness 2019-08-01 15:14:17 +03:00
Ivan Kylchik
d1e87eb90c Implement LightTree to Fir converter for declarations 2019-08-01 15:14:17 +03:00
Ivan Kylchik
5b577b9754 Refactor light tree test compare for better result 2019-08-01 15:14:16 +03:00
Ivan Kylchik
f0a5408eb6 Modify previously added test 2019-08-01 15:14:16 +03:00
Ivan Kylchik
200fe63fca Implement basic class to test light tree builder performance 2019-08-01 15:14:16 +03:00
Dmitriy Novozhilov
14d6f8009d [NI] Update diagnostic messages in testdata 2019-08-01 14:37:54 +03:00
Dmitriy Novozhilov
8107d1515c [NI] Minor. Remove redundant code that was added for debugging 2019-08-01 14:37:49 +03:00
Dmitriy Novozhilov
b6a7d21579 [NI] Fix extracting type variables for flexible types in in captured types
Bug was introduced in b99efb because of lack of tests.
All code in `AbstractTypeCheckerContextForConstraintSystem.extractTypeVariableForSubtype`
  related to IN projection looks suspicious and needs further investigation
2019-08-01 14:37:41 +03:00
Alexander Podkhalyuzin
71a1a0e2f5 Do not highlight annotations as keyword (new default like in Java)
#KT-17993 Fixed
2019-08-01 13:49:03 +03:00
Ilya Gorbunov
695d657ca8 Random.nextLong: use progression properties consistently
Apply inspection suggestion that helps to reduce boxing.
2019-07-31 21:53:16 +03:00
Ilmir Usmanov
06388b885c JVM_IR: Support suspend lambdas with receiver 2019-07-31 21:17:09 +03:00
Toshiaki Kameyama
3742993dea Change to star projection: do not suggest when type paramer is generic type
#KT-30794 Fixed
2019-07-31 20:51:57 +03:00
Mikhail Glukhikh
10e42a55c9 FIR: set PSI elements in JavaSymbolProvider / enhancement scope
Related to KT-24351
2019-07-31 13:24:20 +03:00
Mikhail Glukhikh
0c4134bef4 Remove FirResolvePhase from FirElement hierarchy 2019-07-31 12:55:36 +03:00
Steven Schäfer
efb938a7c8 (Un)mute tests 2019-07-31 11:18:44 +02:00
Steven Schäfer
06274b1339 JVM_IR: Simplify RemoveDeclarationsThatWouldBeInlinedLowering 2019-07-31 11:18:44 +02:00
Steven Schäfer
93d414ac01 JVM_IR: Change CallableReferenceLowering to match the JVM backend
In particular, the JVM backend inlines the bodies of lambdas into the
generated lambda subclasses and stores bound receivers in the receiver
field of CallableReference. Both are required for reflection.
2019-07-31 11:18:44 +02:00
Steven Schäfer
917435a50c Extract IrBody.statements utility function 2019-07-31 11:18:44 +02:00
Steven Schäfer
509d257475 JVM_IR: Fixes to SyntheticAccessorLowering
This commit fixes the handling of accessors for super calls, changes the
naming scheme to avoid accessor name clashes and uses a more robust test
to determine the placement of accessors for protected static members.
2019-07-31 11:18:44 +02:00
Steven Schäfer
173f1fc7d1 Fix statement order in LocalDeclarationsLowering
Previously, the order of IrSetField statements in this lowering was
non-deterministic. This broke the inliner in the JVM backend which
expects statements to be in argument order.
2019-07-31 11:18:44 +02:00
Steven Schäfer
c38fb27676 JVM_IR: Run CallableReferenceLowering before LocalDeclarationsLowering 2019-07-31 11:18:44 +02:00
Steven Schäfer
9816e62d08 JVM_IR: Fix inlining of interface methods 2019-07-31 11:18:44 +02:00
Dmitry Petrov
bdec8b04e8 Minor: trim in RenderIrElementVisitor 2019-07-31 10:37:35 +03:00
Alexey Tsvetkov
efe62c983a Decrease max heap size for test process on Windows
Test processes themselves don't do much
(RAM heavy work is done in Kotlin and Gradle daemons).
The default 1600m max heap size is unreasonably high
for copying test projects and checking output logs.
2019-07-31 04:48:20 +03:00
Alexey Tsvetkov
4db3dcc28f Use short temp dirs names only in gradle integration tests 2019-07-31 04:48:20 +03:00
Alexey Tsvetkov
1a0c6fe8b8 Unify test tasks configuration in gradle tests 2019-07-31 04:48:20 +03:00
Alexey Tsvetkov
847af4456a Remove KotlinGradlePluginJpsParametrizedIT
We've stopped running it on CI some time ago,
does not seem very useful now
2019-07-31 04:48:20 +03:00
Alexey Tsvetkov
54227e15ff Do not set max heap size twice
The parameter is also set in the next statement (`maxHeapSize = "1600m"`)
2019-07-31 04:48:20 +03:00
Ivan Gavrilovic
de5335b17f Fix gradle integration tests on Windows
Android Gradle Plugin 3.0 and 3.1 use aapt that does not handle
long paths on Windows. This commit uses shorter paths for the project
working directory on Windows.

Test: running integration tests on Windows
2019-07-31 04:48:20 +03:00
Ty Smith
e74a00789d Add embeddable artifact for jvm-abi-gen
#KT-28824 Fixed
2019-07-30 20:47:56 +03:00
Alexey Tsvetkov
37042801c4 Fix CompilerDaemonTest#testDaemonJvmOptionsParsing
Forgot to update test data after 560f1483e8 and 317c39f27d

    #KT-33048 Fixed
2019-07-30 20:35:23 +03:00
Alexey Tsvetkov
0a91a663b1 Always keep Serializable#serialVersionUID
It is usually set explicitly for a reason,
so ProGuard should not throw it away.

    #KT-33027 Fixed
2019-07-30 20:20:58 +03:00
Andrey Uskov
a6f50c71bd Fixed import of package prefix in non-MPP projects
#KT-33038 Fixed
2019-07-30 18:43:30 +03:00
Mikhail Glukhikh
eedebcfe4c FIR lazy resolve: fix test data 2019-07-30 17:42:51 +03:00
Mikhail Glukhikh
869e970bfd FIR resolution API: fix handling of expressions inside imports 2019-07-30 16:28:18 +03:00
Mikhail Glukhikh
14e9404afd FIR (raw / resolution API): set correctly elvis/bang-bang bound PSIs 2019-07-30 16:28:18 +03:00
Mikhail Glukhikh
1f771a2407 FIR resolution API: fix handling of expressions inside secondary ctors 2019-07-30 16:28:18 +03:00
Mikhail Glukhikh
2a69efba8a FIR resolution API: fix handling of expressions inside local functions 2019-07-30 16:28:18 +03:00
Mikhail Glukhikh
760fb668bb Introduce FIR resolution API with lazy resolve to use in IDE
Now lazy resolve atomic element is a file (declaration-level resolve)
or a callable declaration (expression-level resolve)

#KT-24351 In Progress
2019-07-30 16:28:17 +03:00
Mikhail Glukhikh
1cd559a626 Remove FirTotalKotlinResolveInIde test with its provider as obsolete 2019-07-30 16:28:17 +03:00
Mikhail Glukhikh
c3a31dcdf5 Optimize FirSession component storage 2019-07-30 16:28:17 +03:00
Mikhail Glukhikh
7529d557fe FIR resolution: introduce FirResolvePhase & FirAbstractPhaseTransformer
The phase determines which transformers were already applied to declaration.
The transformer controls current resolve phase in phasedFir and
performs additional resolve if necessary.
2019-07-30 16:28:17 +03:00
Mikhail Glukhikh
a38b4756b5 FIR tree refactoring: move FirElement.session to FirDeclaration
#KT-30275 Fixed
2019-07-30 16:28:16 +03:00
Dmitriy Novozhilov
98f75669a5 [FIR] Make resolution sequence of CallKind static field 2019-07-30 16:28:16 +03:00
Dmitriy Novozhilov
53404e5dac [FIR] Extract ResolutionStageRunner component
That component is responsible to run all resolution stages on candidate
  and calculating resulting applicability.

This is needed for completion of `when` and `try` as function calls
2019-07-30 16:28:16 +03:00
Dmitriy Novozhilov
8bbb60df25 [FIR] Refactoring. Split CallResolver.kt to several files 2019-07-30 16:28:15 +03:00
Dmitriy Novozhilov
3c7b25b8c9 [FIR] Minor. Cleanup code in ConeTypes.kt 2019-07-30 16:28:15 +03:00
Dmitriy Novozhilov
a226e40e34 [FIR] Refactor FirResolveBodyTransformer
Extract from it components responsible for call completion,
  call resolution and resolution of FQN
2019-07-30 16:28:15 +03:00
Dmitriy Novozhilov
43e7f54fae [FIR] Add string representation for ConeKotlinType
`ConeKotlinType.render` moved from `tree` module to `types` module
2019-07-30 16:28:15 +03:00
Dmitriy Novozhilov
6c26fc1943 [FIR] Don't render Any? upper bounds of type parameters 2019-07-30 16:28:14 +03:00
Dmitriy Novozhilov
7245475196 [FIR] Add DeclaredUpperBoundConstraintPosition to Fir 2019-07-30 16:28:14 +03:00
Dmitriy Novozhilov
d3670d4f5f [FIR] Add Any? as default bound for all type parameters 2019-07-30 16:28:14 +03:00
Dmitriy Novozhilov
8a21785883 [FIR] Add Any? builtin typeref 2019-07-30 16:28:14 +03:00
Dmitriy Novozhilov
2a360272f6 [FIR] Add Any to supertypes of functional types 2019-07-30 16:28:14 +03:00
Dmitriy Novozhilov
71ca1aa608 [Type system] Fix algorithm of folding recursive types
There was a problem when we get type from type projection even if
  it is a star projection what is meaningless. Now we try to fold argument
  only if it's not a star projection
2019-07-30 16:28:13 +03:00
Dmitriy Novozhilov
a453ed50fa [FIR] Fix class cast exception in ConeInferenceContext 2019-07-30 16:28:13 +03:00
Dmitriy Novozhilov
6215662e33 Replace usage of ClassicTCContext with abstract context in NewCSTCalculator 2019-07-30 16:28:13 +03:00
Andrey Uskov
0276a6262f Fix compilation of NewMultiplatformKaptProjectImportingTest in AS 3.3,3.4 2019-07-30 14:34:36 +03:00
Dmitry Savvinov
6177b3e8dc Minor. Add empty file to previously empty directory in test
Otherwise Git doesn't commit empty folder into repository and test fails
later with "invalid directory exception"
2019-07-30 14:19:02 +03:00
pyos
d715344639 psi2ir: precompute sort keys when generating members
On kotlinx.serialization, this improves the performace of the compiler
with -Xuse-ir by about 5% (average of 30 runs after 10 warmup runs:
3096 ms -> 2970 ms, minimum: 3037 ms -> 2884 ms). Flamegraphs for
comparison (careful, huge SVG images):

https://drive.google.com/open?id=1BlIFN4ivSKrXjY6vZ0xkZymwucGc7bSI
https://drive.google.com/open?id=1xIW2IvW7LMCaAe4P2dOGOG8nCcpWI9PW
2019-07-30 12:07:12 +02:00
Vladimir Dolzhenko
2d5a1e19d0 Perform GC between performance test runs, add geometric mean calculation and close stats in the end 2019-07-30 11:59:33 +02:00
Vladimir Dolzhenko
3f9480e1c5 Specify parent disposable in JavaOutsideModuleDetector Vfs listener 2019-07-30 11:59:22 +02:00
Dmitry Savvinov
ddb685a8f9 Add test on nonMPP -> MPP dependency 2019-07-30 12:41:41 +03:00
Dmitry Savvinov
79313037d1 Minor. Merge multiplatformTypeRefinement testdata with multiplatform testdata 2019-07-30 12:41:41 +03:00
Dmitriy Novozhilov
9f90486893 [Misc] Update spec testData according changes in NI 2019-07-30 12:41:41 +03:00
Denis Zharkov
ffaca279bc Minor. Turn TypeBasedStarProjectionImpl into StarProjectionForAbsentTypeParameter
It's needed to avoid abusing of the class
Star projections should be created based on the relevant type parameter
whenever it's possible
2019-07-30 12:41:41 +03:00
Denis Zharkov
579838cb4e Avoid recursive refinement in NewCapturedTypeConstructor
Potentially, it might contain infinite recursive supertypes
And for such cases, we have to perform lazy refinement (one level per request)
2019-07-30 12:41:41 +03:00
Denis Zharkov
a2a1c7e50f Avoid recursive refinement with star projections
Otherwise StackOverflowError or recursion-detection in LockBasedStorageManager
may happen

It's fine to have non-refined type there because it only can affect
content of containing type member scope that should be refined after
being requested
2019-07-30 12:41:41 +03:00
Denis Zharkov
d042eb2cfb Fix type refinement for qualified expressions
Previously, type for "c.a"-receiver in "c.a.platformFun()"
has not been refined because typechecking of "c.a" doesn't go
through common facade org.jetbrains.kotlin.types.expressions.ExpressionTypingServices#getTypeInfo
where the most of expressions are expected to be type checked.

(see org.jetbrains.kotlin.resolve.calls.CallExpressionResolver#getUnsafeSelectorTypeInfo)
2019-07-30 12:41:41 +03:00
Dmitry Savvinov
6695ddd1d5 Change 'hashCode' of 'TypeProjection'
according to bug when there was exception in
`hashCode` call when projection has some `SpecialType`
like `NO_EXPECTED_TYPE`
2019-07-30 12:41:41 +03:00
Dmitry Savvinov
b103f42ca8 Add test on using correct builtins in MPP
Note that Native built-ins are not resolved correctly in this module
(CPointed and similar). This is not a bug, but rather a technical
limitation of the current testing infrastructure: we can't depend on
kotlin-native stdlib in "big-Kotlin" repo, and native stdlib is used as
the only one source of Native built-ins.
2019-07-30 12:41:41 +03:00
Dmitry Savvinov
1fe8e4ba15 Use CompositeResolve in HierarchicalExpectActual tests 2019-07-30 12:41:41 +03:00
Dmitry Savvinov
aaf76a0e46 Enable TypeRefinement in COMPOSITE resolution mode 2019-07-30 12:41:41 +03:00
Dmitry Savvinov
2b4d70fcf0 [Resolve] Rewrite how built-ins are created
Under COMPOSITE mode we don't have a globally known way to create
built-ins, instead, we have to create them on per-module basis.

So, in this commit we:

1. Use builtInsProvider: (ModuleInfo) -> KotlinBuiltIns instead of
precomputed builtIns instance, in order to be able to calculate
builtIns on per-module basis

2. Introduce new entity, called BuiltInsCache, which, roughly
speaking, is a map of form ModuleInfo -> KotlinBuiltIns, to prevent
creation of multiple builtInsInstances
NB. Actually, it's of form BuiltInsCacheKey -> KotlinBuiltIns, because
we shouldn't create new builtIns for each module. Also, currently,
each platform has its own BuiltInsCacheKey implementation, because
parameters by which built-ins are created, are a bit different across
different platforms. Ideally, we should eliminate those differences
and they use one concrete implementation as a key.
2019-07-30 12:41:40 +03:00
Dmitry Savvinov
9f2a03947c [Resolve] Compute dependency on SDK properly
Under COMPOSITE resolution mode (see ResolutionModeComponent) we have
no fixed and globally known SDK, instead, for each module we have to
find SDK it it's transitive dependencies.

Currently, this is necessary in order to create proper JvmBuiltIns,
which need dependency on SDK to be present in immediate dependencies.
2019-07-30 12:41:40 +03:00
Dmitry Savvinov
02c07a4a6c [Resolve] Introduce an ability to get all moduleInfos without filtering by platform
Previously, each ProjectResolutionFacade was tied to the respective
platform, so there were no point in collection moduleInfos for all
possible platforms.

For composite resolution mode, we have to get all modules no matter
what their platform is (because all modules will be analyzed in one
facade), so this commit adds such an ability.
2019-07-30 12:41:40 +03:00
Dmitry Savvinov
f9b8ab3a3a [Resolve] Introduce CompositeResolver
This commit introduces CompositeResolverForModuleFactory, which should
work under so-called "composite resolution mode", where sources of all
all modules are analyzed in one global facade.

This allows to:
- avoid re-analyzation of common sources
- avoid retaining memory for all platforms (which can be very bad as
soon as we'll start distinguishing various flavours of platforms,
especially "flavours" of common platform)
- support running platform-specific checks in common modules (e.g.,
report JVM_PLATFORM_DECLARATION_CLASH if common sources are going to have
it)
- support analysis of shared platform modules, like commonNative

This mode heavily depends on so-called "type refinement" support in the
compiler, which is introduced in other series of commits.

In this commit, CompositeResolver and related codepaths are left unused.
Also, this commit misses several important pieces of logic in
resolvers-setup code, which should be different for CompositeResolver
- computation of 'firstDependency'
- computation of built-ins
- computation of modules owned by facade

They will be covered in the following commits
2019-07-30 12:41:40 +03:00
Dmitry Savvinov
adb0f5eaf9 [Resolve] Introduce CompositeAnalysisSettings
Because we want to support both COMPOSITE and SEPARATE resolution modes
at once, we have to leave 'globalFacadesPerPlatformAndSdk'-map, but in
COMPOSITE mode it should use less parameters for that map, and, in
particular, we shouldn't use Platform and SDK for equality.

This commit introduces separate instance which should be used in
COMPOSITE mode.

COMPOSITE mode itself will be introduced in the following commits.
2019-07-30 12:41:40 +03:00
Dmitry Savvinov
5e95890028 [Resolve] Introduce KotlinMultiplatformAnalysisModeComponent
Introduce a component which tells which resolution mode should be used.

COMPOSITE mode will analyze all sources for all platforms in one facade,
and will use proper support in the frontend instead of
CombinedModuleInfo.

SEPARATE mode is essentially a "legacy" mode, where each platform is
analyzed in separate facade (leading, in particular, to multiple
re-analyzation of common sources)

Facilities for support of COMPOSITE mode will be introduced in the
following commits.

resolution component
2019-07-30 12:41:40 +03:00
Dmitry Savvinov
90cf9daff3 [Resolve] Abstract creation of platform-specific package fragment providers 2019-07-30 12:41:40 +03:00
Dmitry Savvinov
b48218e722 [Resolve] Make ResolversForModule less static
As consequence, remove IdePlatformKindTooling.resolverForModule, because
it became more than just field, and it duplicates similar API in
IdePlatformKindResolution anyways
2019-07-30 12:41:40 +03:00
Dmitry Savvinov
0f56d243cb [Resolve] Support test/production/dependsOn internal-visibility 2019-07-30 12:41:40 +03:00
Dmitry Savvinov
c50eeb3edb Add few tests on internal visibility in MPP 2019-07-30 12:41:40 +03:00
Dmitry Savvinov
43ef0ffa50 [Testing] Support diagnostics filters in MultiModuleIdeResolveTest 2019-07-30 12:41:40 +03:00
Dmitry Savvinov
68c1a7cedd Use stable order for dependsOn and related diagnostics 2019-07-30 12:41:39 +03:00
Dmitry Savvinov
769ccde43b Closure over dependencies in multiPlatformSetup 2019-07-30 12:41:39 +03:00
Dmitry Savvinov
3c2e34ee08 [Misc] Fix bug in multiPlatformSetup
Due to a typo, dependency on fullJdk were added to the wrong module
2019-07-30 12:41:39 +03:00
Dmitry Savvinov
61ec5ed5dd [Misc] Introduce lazyClosure 2019-07-30 12:41:39 +03:00
Dmitry Savvinov
54cdd3bfef [Misc] Refactor Module.cached extension to accept lambda instead of FunctionalInterface 2019-07-30 12:41:39 +03:00
Dmitriy Novozhilov
b477184a3c Fix creating of refined FlexibleType and RawType
There was an issue that `KotlinType.equals` called in `KotlinTypeFactory.flexibleType`
  and `RawType` constructor produced endless recursion of types that wasn't
  computed yet
2019-07-30 12:41:39 +03:00
Denis Zharkov
33a31fb688 [Tesdata fix] Fix test data for multiplatform highlighting test
Once refinement is introduced the behavior becomes correct
2019-07-30 12:41:39 +03:00
Denis Zharkov
d744192e6f [Invariant fix] Fix false positive internal visibility diagnostic
Effectively, this commit allows for common module
to see internal content of all expect-modules

The problem is that when computing the member scope for A (see the test)
we're building a special member scope for CommonAbstract viewed from JVM
and it's effectively has a fake override of actual member from Jvm/ExpectBase.

OverridingUtil checks if it's visible in CommonAbstract and finds that it's not
thus creating a fake_invisible fake override

The latter results in A::foo override being marked as INVISIBLE_MEMBER_OVERRIDE

Probably, the fix might be smarter
(passing a requested module to OverridingUtil::createAndBindFakeOverride)
but allowing using internal member seems to be safe & simple
because it's reasonable to assume there's no cyclic dependencies
between expected/actual modules
2019-07-30 12:41:39 +03:00
Denis Zharkov
d20516779a [Invariant Fix] Avoid using invalid descriptors in RemovePartsFromPropertyFix
org.jetbrains.kotlin.descriptors.InvalidModuleException: Accessing invalid module descriptor <production sources for module light_idea_test_case> is a module[ModuleDescriptorImpl@89f9a78]
	at org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl.assertValid(ModuleDescriptorImpl.kt:51)
	at org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl.getPackage(ModuleDescriptorImpl.kt:70)
	at org.jetbrains.kotlin.descriptors.FindClassInModuleKt.findClassifierAcrossModuleDependencies(findClassInModule.kt:23)
	at org.jetbrains.kotlin.types.KotlinTypeKt.refineDescriptor(KotlinType.kt:185)
	at org.jetbrains.kotlin.descriptors.impl.AbstractClassDescriptor$1$1.invoke(AbstractClassDescriptor.java:50)
	at org.jetbrains.kotlin.descriptors.impl.AbstractClassDescriptor$1$1.invoke(AbstractClassDescriptor.java:47)
	at org.jetbrains.kotlin.types.SimpleTypeImpl.refine(KotlinTypeFactory.kt:210)
	at org.jetbrains.kotlin.types.SimpleTypeImpl.refine(KotlinTypeFactory.kt:182)
	at org.jetbrains.kotlin.types.AbstractTypeConstructor$ModuleViewTypeConstructor.getSupertypes(AbstractTypeConstructor.kt:38)
	at org.jetbrains.kotlin.types.AbstractTypeConstructor$ModuleViewTypeConstructor.getSupertypes(AbstractTypeConstructor.kt:33)
	at org.jetbrains.kotlin.types.TypeUtils.getImmediateSupertypes(TypeUtils.java:230)
	at org.jetbrains.kotlin.types.TypeUtils.collectAllSupertypes(TypeUtils.java:255)
	at org.jetbrains.kotlin.types.TypeUtils.getAllSupertypes(TypeUtils.java:268)
	at org.jetbrains.kotlin.idea.util.TypeUtils.getResolvableApproximations(TypeUtils.kt:128)
	at org.jetbrains.kotlin.idea.util.TypeUtils.getResolvableApproximations$default(TypeUtils.kt:126)
	at org.jetbrains.kotlin.idea.intentions.SpecifyTypeExplicitlyIntention$Companion$createTypeExpressionForTemplate$1.invoke(SpecifyTypeExplicitlyIntention.kt:133)
	at org.jetbrains.kotlin.idea.intentions.SpecifyTypeExplicitlyIntention$Companion.createTypeExpressionForTemplate(SpecifyTypeExplicitlyIntention.kt:149)
	at org.jetbrains.kotlin.idea.intentions.SpecifyTypeExplicitlyIntention$Companion.addTypeAnnotationWithTemplate(SpecifyTypeExplicitlyIntention.kt:234)
	at org.jetbrains.kotlin.idea.intentions.SpecifyTypeExplicitlyIntention$Companion.addTypeAnnotationWithTemplate$default(SpecifyTypeExplicitlyIntention.kt:229)
	at org.jetbrains.kotlin.idea.intentions.SpecifyTypeExplicitlyIntention$Companion.addTypeAnnotation(SpecifyTypeExplicitlyIntention.kt:195)
	at org.jetbrains.kotlin.idea.quickfix.RemovePartsFromPropertyFix.invoke(RemovePartsFromPropertyFix.kt:82)
	at org.jetbrains.kotlin.idea.quickfix.KotlinQuickFixAction.invoke(KotlinQuickFixAction.kt:37)
	at com.intellij.codeInsight.intention.impl.IntentionActionWithTextCaching$MyIntentionAction.invoke(IntentionActionWithTextCaching.java:179)
	at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$invokeIntention$4(ShowIntentionActionsHandler.java

See QF tests like QuickFixTestGenerated$RemoveRedundantInitializer.testSimple
2019-07-30 12:41:39 +03:00
Denis Zharkov
5f10252185 [Invariant fix] Avoid using obsolete desciptors as scope content in change signature
After type refinement was introduced we sometimes may request
some additional data from ModuleDescriptor

But if it's been invalidated after first part of refactoring's been applied
requesting content may fail (see ModuleDescriptorImpl::assertValid)

See the test:
org.jetbrains.kotlin.idea.refactoring.introduce.ExtractionTestGenerated.IntroduceLambdaParameter#testLambdaParamInPrimaryConstructor
2019-07-30 12:41:39 +03:00
Denis Zharkov
01f0589ddf [Invariant Fix] Use the same lock inside single GlobalFacade
Before refinement, order of accessing compiler's entities (supertypes,
descriptors, memberscopes) was always the following:

    sources -> libraries -> SDK (built-ins)

With refinement, it is sometimes possible to inverse this order, e.g.
access sources after libraries or SDK. This mainly happens in the following
scenario:

- we reference some library/SDK class, but do not acquire source-lock
  This might seem a bit weird, but actually it is quite easy to achieve
  as soon as we understand that analysis sources doesn't necessarily
  acquires respective lock, only forcing lazy computations does so.
  E.g., we can just traverse PSI tree and meet some refernce to "Any?" -
  this doesn't involves acquiring source-lock

- we start resolving it, which usually involves acquiring library/SDK-lock
  (e.g., in order to get it supertypes or memberScope)

- because we reference it from the source-module, we may like to refine
  it, in which case we will have to acquire source-lock on refinement
  cache

Obviously, that may lead to deadlocks, so, in this commit we disable
creating granular locks when we work with refinement.

Note that if refinement is disabled (which is the case for all non-MPP
projects), we still create separate locks.
2019-07-30 12:41:39 +03:00
Denis Zharkov
fd4d8176dd [Misc Invariant Fix] Do not use KotlinType::toString in inspections
Because, there's no strict limitations on toString format there
and ModuleViewTypeConstructor#toString violates it
2019-07-30 12:41:38 +03:00
Denis Zharkov
daa27016ca [Invariant Fix] Adjust DataFlowValue::Identifier for refinement
After refinement is introduced it becomes possible to have a different
descriptors instances for effectively the same descriptors

Also, it accidentally fixes KT-25432 because is caused by a different
version of descriptors created for NewCapturedType

^KT-25432 Fixed
2019-07-30 12:41:38 +03:00
Denis Zharkov
21cc93860b [Invariant Fix] Fix KotlinPsiUnifier after types refinement introduction
Refined types with non-trivial substitution may result in different
descriptors instances
See PsiUnifierTestGenerated$Equivalence$Expressions.testArrayAccess
2019-07-30 12:41:38 +03:00
Denis Zharkov
c49791f8bb [Invariant Fix] Fix equality for NewCapturedTypeConstructor after refinement 2019-07-30 12:41:38 +03:00
Denis Zharkov
471134d31e [Invariant Fix] Fix callable equivalence definition in case of refined scopes
Before types refinement has been introduced it was reasonable to assume
that whenever we have two callables in the same declaration
they are actually different

But it become false once types refinement were introduced
and the same declarations may appear as different descriptors' instances
when viewing from different modules

The change does look very fragile because in many cases
source element is NO_SOURCE

At the same time, declaring actually different members
with the same signature is prohibited and may make sense only
in case of source-based members
2019-07-30 12:41:38 +03:00
Denis Zharkov
5c2c7e7776 [Invariant fix] Avoid re-resolving declared descriptors in lazy member scopes
It becomes necessary after scopes/types refinement
Without it being applied the code might fail with slice-rewrite errors

KT-32841
2019-07-30 12:41:38 +03:00
Dmitry Savvinov
ab9ff786d7 [Invariant Fix] Use structural descriptor equivalence in JsNamesClashChecker
It's needed for situation when we have JS module with expect declaration,
so we refine member scope for that expect declaration and try to
compare to function descriptors (e.g. of `equals` function) from
different class descriptors (expect and actual) and report diagnostic
about name clash. So, since we can earn descriptors from type refinement,
they can be not identical but still equals, so with should use structural
equality to comparing them
2019-07-30 12:41:38 +03:00
Dmitriy Novozhilov
9add14a2a1 [API Usage] Add refinement to ConstraintInjector (NI) 2019-07-30 12:41:38 +03:00
Dmitry Savvinov
6c44b6b859 [API Usage] Refine type of lambda's receiver in NI
It's needed because of lambda's receiver is not an expression and
  we can not refine it in usual way in TypingVisitor
2019-07-30 12:41:38 +03:00
Dmitriy Novozhilov
696aea004d [API Usage] Add type refinement for callable references 2019-07-30 12:41:38 +03:00
Denis Zharkov
53334c038f [API Usage] Use refinement in NI 2019-07-30 12:41:37 +03:00
Denis Zharkov
2bf6bd3724 Do not consider descriptors equality as a reason not to refine type
Otherwise, it results in skipping refinement for JobNode when requested
from JVM module while it's necessary because CompletionHandlerBase's content
depends on the module
2019-07-30 12:41:37 +03:00
Denis Zharkov
9c27abde7f [API Usage] Support type refinement from expect class to type aliases
It's necessary when expect class is actualized via typealias
To support it properly, we need to return AbbriviatedType instead of
SimpleTypeImpl, thus scopeFactory is not enough anymore
2019-07-30 12:41:37 +03:00
Dmitry Savvinov
04717b57c9 [API Usage] Support refinement for Java classes' scope
Also, we should skip supertypes refinement for additional
    built-in members scope
2019-07-30 12:41:37 +03:00
Denis Zharkov
b7e011a29b [API Usage] Use type refinements in overrides-related facilities 2019-07-30 12:41:37 +03:00
Denis Zharkov
694f521bfd [API Usage] Refine type for each separate element in ExpressionTypingVisitorDispatcher 2019-07-30 12:41:37 +03:00
Dmitriy Novozhilov
a1b52b2f90 [API Usage] Inject Refiner into KotlinTypeChecker, use it for subtyping 2019-07-30 12:41:37 +03:00
Dmitry Savvinov
9047ddfc2f [API Usage] Refine supertypes when getting content of member scope 2019-07-30 12:41:37 +03:00
Dmitry Savvinov
1d61d75225 [Core API] Introduce KotlinType.refine
The most interesting part happens in SimpleType.refine, other types
either don't implement refinement at all (they return just 'this',
mainly it's some special types, like ErrorType and such) or implement
it trivially via recursion (those are "composite" types)

SimpleType.refine captures so-called refinement factory, which is essentially
an injected callback which tells how to reconstruct the type with new
(refined) memberScope.

We have to inject callback because we express quite different types with
SimpleTypeImpl, and some of them need different refinement logic.
Another possible implementation approach (more invasive one) would be
to extract those types in separate subtypes of KotlinType and implement
'refine' via overrides.

The most meaningful callbacks are injected from
'AbstractClassDescriptor.defaultType' and from 'KotlinTypeFactory'.
2019-07-30 12:41:37 +03:00
Dmitry Savvinov
c12f5f6055 [Core API] Introduce TypeConstructor.refine
This commit introduces TypeConstructor.refine method.

It's implementation can be roughly split in three parts:
- trivial implementations which just return 'this': mostly, it used for
typeConstructors which can not be refined at all (e.g.
IntegerValueTypeConstructor and other special cases of constructors)

- delegating implementations which call 'refine' recursively for
component typeConstructors -- obviously, they are used in composite
typeConstructors (like IntersectionTypeConstructor)

- finally, the most interesting one is in 'AbstractTypeConstructor'
which returns lightweight wrapper called 'ModuleViewTypeConstructor'.
The idea here is to propagate refinement to supertypes without eagerly
computing them all.

VERY IMPORTANT CAVEAT of TypeConstructor.refine is that call to this
method CAN NOT add new supertypes, so returned supertypes are not
entirely "valid". See the KDoc for TypeConstructor.refine for details
2019-07-30 12:41:37 +03:00
Denis Zharkov
c20d565d93 [Core API] Introduce API for getting scopes with refinement
- All refinement-related methods are incapsulated in
ModuleAwareClassDescriptor

- most of classes implement it trivially by retning unchanged scope

- LazyClassDescriptor and DeserializedClassDescriptor have non-trivial
implementations of the refinement-related methods

- General idea is to return new scope which captures refiner and will
later use it to get correct content of itself (currently, refiner is
unused, and will be used for that in later commits)

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

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

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

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

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

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

 Fix [WEB-29329]
2019-07-26 15:05:41 +03:00
Dmitry Gridin
2e0ec3b490 AbstractFindUsagesTest: add read lock 2019-07-26 12:57:29 +03:00
Dmitry Gridin
dbb9b3b6fd AbstractFindUsagesTest: cleanup code 2019-07-26 12:52:02 +03:00
Nikolay Krasko
58f294a757 Fix kotlin compiler tests in 192 (KT-32193)
#KT-32193 Fixed
2019-07-26 12:38:40 +03:00
Georgy Bronnikov
3729c4e770 JVM: simplify choice of wrapped receiver descriptors 2019-07-26 11:57:51 +03:00
Dmitry Gridin
a10e57eaec JavaOutsideModuleDetector: should refresh notification after move
#KT-32967 Fixed
2019-07-26 10:33:54 +03:00
Dmitry Gridin
4c8d0acb5d CreateExpectFix: shouldn't suggest create expect property with lateinit or const modifier
#KT-32705 Fixed
2019-07-26 10:33:28 +03:00
Ilya Chernikov
a858607fac Fix script classpath utility functions that use classpath filtering by "keys"
The problem was that only the first matching classpath entry were used.
The problem was reported by @lion7 on github (67ad3773de (commitcomment-34443927))
2019-07-26 08:55:16 +02:00
Ilya Chernikov
ec3ccf1ba8 Properly handle REPL snippets with exceptions ...
so the REPL remain operational after exception in one of the snippets:
- separately return script class and script instance on evaluation (
  because in case of an exception the class is valid, while the instance
  is not).
- store both the class and the instance in the history
- handle this data accordingly
2019-07-26 08:55:16 +02:00
Ilya Chernikov
288fdc0952 Add a handler for providing evaluation context for scripts
use it on refinement.
also some refactoring on context class and around
2019-07-26 08:55:16 +02:00
Ilya Chernikov
2a5c4a2409 Move caching to after all configuration refinements and ...
move compilation cache setting to the scripting host configuration
The cache implementation can now take into account all external
dependencies that may appear during refinement.
Also change initial refinement location accordingly and rearrange
caching interfaces to make it available in scripting plugin.
2019-07-26 08:55:16 +02:00
Ilya Chernikov
e41bbe9328 Introducing transient properties in scripting API 2019-07-26 08:55:16 +02:00
Ilya Chernikov
5fe843d754 Refactor main-kts build scripts - fix red code in IDEA 2019-07-26 08:55:15 +02:00
Ilya Chernikov
42dde50b6b Implement base zip cache with tests...
plus some relevant fixes and refactorings
2019-07-26 08:55:15 +02:00
Ilya Chernikov
c7eb9e9520 Move caching tests into a dedicated class
plus some tests refactorings
2019-07-26 08:55:15 +02:00
Ilya Chernikov
ef23033936 Add net.jpountz and one.util.streamex to the list of shadowed packages
should fix problem with using REPL infrastructure with Apache Zeppelin
2019-07-26 08:55:15 +02:00
Ilya Chernikov
cefd4a35c5 Fix and test evaluation of scripts with default configurations 2019-07-26 08:55:15 +02:00
Ilya Chernikov
961607673d [minor] Refactor properties collection builder:
add a helper to replace the value only if it is absent or default
rearrange some functions
2019-07-26 08:55:15 +02:00
Ilya Chernikov
0af52f2fa6 Implement composable refinement handlers...
for compilation and evaluation configurations.
Add utilities to apply refinements uniformly.
Also fix one invoke for list values - it was not consistent with
other builders
2019-07-26 08:55:14 +02:00
Ilya Chernikov
65e6d3b0ff [minor] Add a small diagnostics handling utility fun 2019-07-26 08:55:14 +02:00
Ilya Chernikov
0072f8c265 Improve JSR-223 engine diagnostics
also abstract invoke wrapper creation
2019-07-26 08:55:14 +02:00
Ilya Chernikov
b68ab0d968 Add test on repl with implicit receiver 2019-07-26 08:55:14 +02:00
Ilya Chernikov
a13d452cd8 Implement JSR223 host in the main-kts jar
also improve diagnostics on configuration instantiation
2019-07-26 08:55:14 +02:00
Ilya Chernikov
0108a76e99 Extract arguments calculation for base JSR223 engine into an argument 2019-07-26 08:55:13 +02:00
Ilya Chernikov
e8fa139dc8 Move direct properties configuration code into public functions in scripting host jar 2019-07-26 08:55:13 +02:00
Andrey Uskov
89a53fe028 Safe get of registry key in KotlinAndroidGradleMPPModuleDataService 2019-07-26 09:33:56 +03:00
Andrey Uskov
5f2aca5856 Fix NewMultiplatformProjectImportingTest in bunch 183 2019-07-26 09:33:39 +03:00
Victor Petukhov
e25b315319 Introduce -Xpolymorphic-signature compiler flag as more priority than -XXLanguage:+PolymorphicSignature 2019-07-26 09:01:25 +03:00
Victor Petukhov
944ee8fcd5 Introduce -Xinline-classes compiler flag as more priority than -XXLanguage:+InlineClasses 2019-07-26 09:01:25 +03:00
Mikhail Mazurkevich
45644c224e JPS: Add temporary non caching jps storage for 192
This storage available under separate flag. Temporary non caching storage
should be removed after Intellij SDK version update.
2019-07-26 04:57:05 +03:00
Andrey Uskov
584d441587 Fix import when android gradle plugin is involved in IDEA 183
All dependencies on MPP modules are added in KotlinAndroidGradleMPPModuleDataService
including transitive ones. Fixes KT-30510 in IDEA 183 and below
2019-07-26 01:18:29 +03:00
Andrey Uskov
91365d9fad Fix import library dependencies when transitive MPP are involved
Fix import dependencies of java modules on MPP modules when
project was not build before import. Unresolved jar dependencies
are not created any more on import of MPP project.
#KT-28822 Fixed
#KT-29757 Fixed
2019-07-26 01:17:55 +03:00
Andrey Uskov
0b8ad5c6c0 Fixed setting production-on-test flag if project was not build
Make importing production-on-test flag more accurate when
the project to be imported was not previously build
2019-07-26 01:16:56 +03:00
Andrey Uskov
17dec7b389 Add transitive test dependencies on MPP with jvmWithJava on import
Fixed case when production and test source sets depend on MPP module
with jvmWithJava involved and have dependency on the same jar artifact.
2019-07-26 01:16:17 +03:00
Andrey Uskov
86a26f0cca Add jvmWithJava IDE import test 2019-07-26 01:15:32 +03:00
Andrey Uskov
6c0469cee0 Fix importing transitive dependencies on MPP project
Fix importing dependencies of java projects on MPP projects
when external dependency is resolved into file collection dependency
2019-07-26 01:14:45 +03:00
Andrey Uskov
8592396a9a Fix combobox size in facet settings tab (KT-32784)
Size of the select platform combobox fixed in order to fit all elements
#KT-32784 Fixed
2019-07-26 01:14:12 +03:00
Andrey Uskov
9ce9b5945e Fix order of platforms in Facets (KT-32783)
#KT-32783 Fixed
2019-07-26 01:13:42 +03:00
ilgonmic
b8400a16f0 Fix webpack dsl with closure
(cherry picked from commit 795e0eef200bb24b9cba06002b48737c01de02be)
2019-07-25 23:26:42 +03:00
ilgonmic
deb6b7105a Remove duplicated source-map-loader configuring and cleanup kotlin webpack config writer
(cherry picked from commit 681eeaedfb359e85cf98e0e9a7239a0364a5d41c)
2019-07-25 23:26:41 +03:00
Vyacheslav Gerasimov
3b78ef9cb2 as36: Add bunches for AS 3.6 C6 based on 192 platform 2019-07-25 20:50:02 +03:00
Vyacheslav Gerasimov
5c6dedc623 Build: Add repo for prerelease Android Studio 2019-07-25 20:50:02 +03:00
Yan Zhulanow
ccff347ffc Kapt: Attach generated Kotlin sources in 'compilation' mode (KT-32535) 2019-07-26 02:40:32 +09:00
Ivan Gavrilovic
1c63d3aa2f KT-32210: Handle long compiler plugin options
Some of the KAPT compiler plugin options were longer than 0xFFFF bytes in
UTF-8 encoding, causing UTFDataFormatException when serializing them. This
commit avoids that issue by encoding changed files and changed classpath types
one by one instead of joining them to a single string.
2019-07-26 02:40:32 +09:00
Alexey Tsvetkov
4b9a852745 Sort source to output mapping before writing to caches
#KT-32902 Fixed
2019-07-25 20:30:56 +03:00
Alexey Tsvetkov
afa10cc125 Rewrite test of relocatable JPS IC caches
* Caches are compared as files now. It is a more robust approach
than comparing strings with dumped contents. E.g previous test
ignored differences in keys ordering, because dumping caches to string
was added for comparing caches after incremental and non-incremental builds,
which cannot be compared without sorting keys (see KT-32674).
* Calling setUp/tearDown twice within the same test instance was
relatively hacky and fragile. Also it complicated adding new test cases.
2019-07-25 20:30:56 +03:00
Alexey Tsvetkov
98aad3e00c Extract EnableICFixture 2019-07-25 20:30:56 +03:00
Alexey Tsvetkov
a4c62d156f Make lookup storage addAll order independent
Lookup storage output files could differ for projects
with different absolute paths.
This happened because, paths for lookups were
relativized only before writing to the underlying storage.
Storing absolute paths in a hash table could
result in different order of adding files to the lookup storage.
This commit fixes the issue by sorting lookups and files in
LookupStorage#addAll

    #KT-32674 Fixed
2019-07-25 20:30:56 +03:00
Alexey Tsvetkov
57caca4b0e Improve exception message for directories comparison in tests
It was unclear what dirs were compared (e.g when rebuilding and
comparing caches dirs, it's not obvious which dir is "expected" and
which is "actual"). To improve this, compare resulting strings
with the placeholder for a root dir first. If the comparison fails,
then replace the placeholder with an actual directory and call
assertEquals.
2019-07-25 20:30:56 +03:00
Dmitry Gridin
6914a9dd3d KotlinFindUsagesHandler: fix read access (flaky tests) 2019-07-25 19:16:52 +03:00
Alexander Podkhalyuzin
66fdc148be Revert strong references for compiler only
#KT-32521 Fixed
2019-07-25 16:13:47 +03:00
Alexey Tsvetkov
f3112f752d Inherit max metaspace size of client VM for Kotlin compile daemon
#KT-32521 In Progress
    #KT-32950 Fixed
2019-07-25 16:13:47 +03:00
Alexey Tsvetkov
5c99243c10 Substitute kotlin-reflect with kotlin-reflect-api in compile classpath
Currently Kotlin IC can only track changes in "default" jar files by
associating a history of ABI diffs with a source set's jar file.

kotlin-reflect is a non-default fat jar, which causes
non-inremental builds when it gets changed and included in
a compile classpath. To avoid this problem, kotlin-reflect-api
project was added. It is assumed that only kotlin-reflect-api
should be used for compilation.

However, Gradle is known to leak transitive runtime dependencies
to a compile classpath, i.e. when `:b` has a runtime dependency on `:a`,
and `:c` has a compile dependency on `:b`, `:c` also gets `:a`
in its compile classpath.

Before this change kotlin-reflect was leaked to compiler tests's
classpath through kotlin-scripting-compiler-impl.

To work around this issue, and to prevent similar issues from happening,
this change introduces a dependency substitution from kotlin-reflect
to kotlin-reflect-api in all compile classpath configurations.

        #KT-32954 Fixed
2019-07-25 16:09:32 +03:00
Alexey Tsvetkov
33b7745b17 Find only non-default shadow jars in findShadowJarsInClasspath diagnostic
We are interested only in shadow jars that might break the incremental compilation
2019-07-25 16:09:31 +03:00
Alexey Tsvetkov
e91eefe709 Remove unnecessary dependencies on kotlin-compiler-runner 2019-07-25 16:09:31 +03:00
Alexey Tsvetkov
cd641c9047 Set source and target compatibility in buildSrc
If source and target compatibility are not set explicity,
Gradle will assume they are equal to current JVM version.
This may cause unwanted rebuilds, when a build is run on
different JDK versions (it might happen when switching between
CLI and IDE).
2019-07-25 16:03:07 +03:00
Alexey Tsvetkov
a7403b7ee7 Do not fork java compile tasks when current JDK can be used
I see the following improvements:
* `clean dist --parallel` is ~10% faster (from 3:40 to 3:20)
* incremental `dist --parallel` is ~50% faster
(adding public method to org.jetbrains.kotlin.utils.SmartList)

    #KT-32955 Fixed
2019-07-25 16:03:07 +03:00
Alexey Tsvetkov
a372f181d2 Check JDK env vars once during configuration when not syncing
Previous code (callback in `beforeTask`) was added to allow
opening project without setting up all env. variables.
This change simplifies the code and avoids a callback,
while keeping the ability to open the project without
setting up all variables by checking `kotlinBuildProperties.isInIdeaSync`
2019-07-25 16:03:07 +03:00
Alexey Tsvetkov
a20627fa2c Set sourceCompatibility and targetCompatibility for JavaCompile tasks
Currently running build with JAVA_HOME pointing to
any JDK != 1.8 results in errors like

    #KT-30382 Fixed
2019-07-25 16:03:07 +03:00
Ilmir Usmanov
a35d405892 Do not generate accessor if private function is accessed from
coroutines intrinsic lambda.
The logic is if the lambda is crossinline we need to generate the
accessor. However, suspendCoroutine's and
suspendCoroutineUninterceptedOrReturn's parameter, despite being
crossinline, are effectively inline. Thus, we do not need to generate
the accessor.
 #KT-27503 Fixed
2019-07-25 15:25:59 +03:00
Ilmir Usmanov
b3e80e6a14 Look for classfile in implementing modules when building inline function
hyperlinks.
 #KT-32864 Fixed
2019-07-25 15:10:03 +03:00
Ilya Kirillov
58db64a478 J2K: Fix old J2K test data's error messages which has changed due to new inference 2019-07-25 14:34:36 +03:00
Ilya Kirillov
4e5e14046d New J2K: use old J2K for evaluate expression instead of new one
#KT-32693 fixed
2019-07-25 14:34:36 +03:00
Ilya Kirillov
e795e4b73d New J2K: add conversion of binary literals & fix conversion of octal ones
#KT-32835 fixed
2019-07-25 14:34:36 +03:00
Ilya Kirillov
72a09ab59b New J2K: correctly convert number literals with underscores
#KT-32837 fixed
2019-07-25 14:34:35 +03:00
Ilya Kirillov
4ead820395 New J2K: correctly print comments for qualified expression 2019-07-25 14:34:35 +03:00
Ilya Kirillov
2bd5a1f196 New J2K: separate nullability inference from common one & nullability bug fixes
It will be needed for structure mutability inference

#KT-21467 fixed
#KT-32609 fixed
#KT-32572 fixed
#KT-24677 fixed
2019-07-25 14:34:35 +03:00
Ilya Kirillov
d7960caf89 New J2K: move all symbols definitions to symbols package 2019-07-25 14:34:35 +03:00
Ilya Kirillov
f79b282c60 New J2K: add better support of implicit functional interfaces
#KT-32702 fixed
#KT-19327 fixed
2019-07-25 14:34:34 +03:00
Ilya Kirillov
96ca4712a0 New J2K: consider in-context declarations while performing conversion on copy-paste plain text conversion
#KT-32602 fixed
2019-07-25 14:34:34 +03:00
Ilya Kirillov
c865d74965 New J2K: remove unused dependencies from nj2k modules 2019-07-25 14:34:34 +03:00
Ilya Kirillov
1bbdd0bf15 New J2K: remove unused classes 2019-07-25 14:34:34 +03:00
Ilya Kirillov
6e04b1549c New J2K: remove JKVisitor with type parameters 2019-07-25 14:34:33 +03:00
Leonid Startsev
9c8905ccb6 Patch serializable class with addtional annotation
(which contains actual serializer) to make use of it with @AssociatedObjectKey
2019-07-25 14:07:22 +03:00
Leonid Startsev
3896992b12 Fixes for IR serialization plugin
- Do not insert typeParameters into IrConstructor;
- Set correct property symbol to IrField;

- Use upper bound as a class descriptor for type parameters.
This will allow to get upper bound's KClass in polymorphic serialization.
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/490;

- Lazily add all serializer functions.
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/502;

- Don't generate constructor invocation for abstract(sealed) classes deserializer.
Such code is incorrect anyway (you can't create an instance of abstract class) and causes problems in devirtualization when exporting Native libraries.
2019-07-25 14:07:24 +03:00
Leonid Startsev
6494227c64 Change order in SerializableProperties initialization logic
in that way so binding context would be checked only after resolve is triggered (via .getContributed descriptors).
Empty binding context led to some subtle bugs.
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/508
2019-07-25 14:07:22 +03:00
Leonid Startsev
822b4556e3 Rewrite IDE check whether serialization plugin is enabled
In a such way so it wouldn't check for actual JAR file and wouldn't touch filesystem.
Fixes KT-32346
2019-07-25 14:07:22 +03:00
Mikhail Glukhikh
2381aa330a FIR: fix delegate expression consistency tests 2019-07-25 09:46:46 +03:00
Mikhail Glukhikh
d32e5065c5 FIR: implementation of delegateProvider in delegate resolve 2019-07-25 09:46:42 +03:00
Mikhail Glukhikh
213f951da3 FIR: partial implementation of delegate resolve #KT-32217 Fixed 2019-07-25 09:46:34 +03:00
Mikhail Glukhikh
63b7fa70f9 FIR2IR: add extension receiver parameters to functions 2019-07-25 09:46:29 +03:00
Ivan Gavrilovic
be3fe9495c Report non-incremental annotation processors correctly
This commit fixes an issue when all APs would be reported as non-incremental,
even if only a single one is non-incremental. Now, additional declared type
is added that is used to denote processors that are incremental, but have
been forced to run non-incrementally in presence of non-incremental APs.

This means that only APs that do not support incremental annotation processing,
or APs that are dynamic and are non-incremental at runtime will be reported.
2019-07-25 04:57:26 +09:00
Ivan Gavrilovic
ad352355de KT-23880: Enable incremental APT mode with KAPT by default
The feature has been present since 1.3.30 behind a flag. This
commit enables it by default.
2019-07-25 04:57:26 +09:00
Ivan Gavrilovic
a108af76d6 Mark property as output instead of local state when needed
Kapt task incremental annotation processing cache directory
was using @LocalState annotation that was added in Gradle 4.3.
However, minimum supported version is 4.2, so this commit registers
this directory as output of a task for pre 4.3 versions. This is safe
as caching is enabled only for Gradle 4.3+.

Test: verified manually
2019-07-25 04:57:26 +09:00
Ivan Gavrilovic
5a2ff86691 Handle classpath snapshot changes better
Because Kapt Gradle task uses PathSensitivity.NONE for the input representing
the classpath structure, there are cases when paths of the files may change,
but because content is the same, there will be no incremental changes.

Classpath snapshot comparison did not handle this case correctly, but this
commit fixes that. In more details:
- classpath entries with the same path and that are not reported as changed
will have their information loaded from the previous snapshot
- any other entry (changed path or changed content) will be reloaded

Test: ClasspathSnapshotTest
2019-07-25 04:57:26 +09:00
Georgy Bronnikov
f66b475867 Create wrapped receiver descriptors where needed 2019-07-24 20:25:47 +03:00
Roman Artemev
46b98a1e98 [JS BE] Make sourceMap generation more precise
- Don't produce mapping for closing bracket in case of expressionBody
 - Map Kt*Function declaration into corresponding js fun declaration
 - Update test data & add new test
2019-07-24 18:56:40 +03:00
Kirill Shmakov
12a1b0296b Clean up useless code 2019-07-24 18:25:11 +03:00
Nikolay Krasko
d3bc2ec855 Remove internal jdk to fix flaky MavenUpdateConfigurationQuickFixTest 2019-07-24 17:28:01 +03:00
Nikolay Krasko
6176373713 Test data update for JavaWithGroovyInvoke since 183 2019-07-24 17:28:01 +03:00
Nicolay Mitropolsky
5f9660cd33 KtLightParameter introduced as interface 2019-07-24 10:11:45 +03:00
Nicolay Mitropolsky
50158e508a org.jetbrains.kotlin.asJava.elements.LightParameter converted to Kotlin
to avoid clashes in `getMethod` with `KtLightParameter`
2019-07-24 10:11:44 +03:00
Nicolay Mitropolsky
7dcd3849e0 org.jetbrains.kotlin.asJava.elements.LightParameter converted to Kotlin: Rename .java to .kt 2019-07-24 10:11:44 +03:00
Nicolay Mitropolsky
8982a49dcb renaming KtLightParameter to KtLightParameterImpl 2019-07-24 10:11:44 +03:00
Anton Yalyshev
4a20a440a7 Cleanup: remove redundant semicolon 2019-07-24 07:41:58 +03:00
Anton Yalyshev
6d53151256 Add statistics (FUS) collector for IDE Settings. At the moment - New Inference only. 2019-07-24 07:41:58 +03:00
Ilmir Usmanov
56b6b957d1 Generate line numbers for RHS of elvis expression if both LHS and RHS
are at the same line.
 #KT-32689 Fixed
2019-07-23 18:00:44 +03:00
Alexander Udalov
1f36f60f43 JVM IR: remove CrIrType, use class container in callable reference lowerings
This is possible now because after 3a9b94235f, 0423d0f41e and
5341de253f, all top level functions/properties in sources and in
binaries have a corresponding containing facade class
2019-07-23 16:39:38 +02:00
Igor Chevdar
a048a11074 Enabled/disabled some tests for K/N 2019-07-23 19:16:46 +05:00
Igor Chevdar
c4da5cb95c [IR] Added IrType.isKSuspendFunction() 2019-07-23 19:16:46 +05:00
Dmitriy Dolovov
e398804663 Show the actual Kotlin version in error message in nativeLibrariesUtil.kt 2019-07-23 20:54:39 +07:00
Dmitry Gridin
4e2989e884 CreateExpectActualFix: fix package for files with root package from non-root directory
#KT-28746 Fixed
2019-07-23 16:24:43 +03:00
Dmitry Gridin
c76ca988eb KotlinCreateTestIntention: disallow intention for expect classes
#KT-26242 Fixed
2019-07-23 16:24:16 +03:00
Dmitry Gridin
311cfc3806 UnimplementedKotlinInterfaceMemberAnnotator: shouldn't report methods with @JvmStatic
#KT-27208 Fixed
2019-07-23 16:23:04 +03:00
Dmitry Gridin
cf07585b11 UnimplementedKotlinInterfaceMemberAnnotator: cleanup code 2019-07-23 16:23:03 +03:00
Andrey Uskov
ad1b795a69 Disable KaptImportingTest in IDEA 183 and below 2019-07-23 11:43:36 +03:00
Andrey Uskov
6e10126c6f Fix matching file paths under Windows in NewMultiplatformKaptProjectImportingTest 2019-07-23 11:43:16 +03:00
Toshiaki Kameyama
22c5e208a6 ReplaceGuardClause inspection: do not report when 'if' expression is used as expression 2019-07-22 20:49:20 +03:00
Toshiaki Kameyama
a6690e4e35 ReplaceGuardClause inspection: do not remove 'else' branch
#KT-32797 Fixed
2019-07-22 20:49:20 +03:00
Toshiaki Kameyama
a3a3c52c24 ReplaceGuardClause inspection: fix highlight range 2019-07-22 20:49:20 +03:00
Alexander Udalov
35e4295e16 IR: deduplicate code in DeepCopyWithWrappedDescriptors/DeepCopyIrTreeWithDescriptors 2019-07-22 19:47:25 +02:00
Alexander Udalov
96efae2b48 IR: fix endless recursion in IrTypeSystemContext.isMarkedNullable 2019-07-22 19:47:25 +02:00
Nikolay Krasko
72fdb47f13 Fix maven import tests by adding java-ide-customization dependency [KT-32833]
Need java-ide-customization because of JavaAwareModuleTypeManagerImpl
registration. Otherwise there were two instances of JavaModuleType that
were not equal and that prevented facets creating after Maven project
importing.

 #KT-32833 Fixed
2019-07-22 19:13:51 +03:00
Dmitry Gridin
0993fb82fe multiplatformUtil: implementedModules shouldn't ignore android test module
Relates to #KT-30799
2019-07-22 17:56:25 +03:00
Andrey Uskov
8294e5afc2 Increase heap size for gradle importing tests due to memory
leak in the gradle daemon
#KT-32731 Fixed
2019-07-22 16:10:33 +03:00
Andrey Uskov
db743aa6e8 Calculation of supported platforms in AndroidSourceSetDataService fixed
for IDEA versions 183 and below.
A deep copy of MPP model for Android source sets is created
2019-07-22 16:06:03 +03:00
Andrey Uskov
d69fbf1177 Fix serialization of iml files for IDEA 192
#KT-32629 Fixed
2019-07-22 15:53:48 +03:00
Mikhael Bogdanov
74e49d91ca Proper implement 'classForImplicitThis' 2019-07-22 10:35:03 +02:00
Dmitry Gridin
a9f0d1a53b AddOperatorModifierInspection: decrease severity to INFORMATION
#KT-32796 Fixed
2019-07-22 11:17:15 +03:00
Dmitriy Novozhilov
b99efb9a2b [NI] Look for type variables in captured flexible types
#KT-32434 Fixed
2019-07-22 11:08:39 +03:00
Dmitriy Novozhilov
58b4ab35f0 [NI] Fix passing callable references to suspend functions as functional parameter
#KT-32452
2019-07-22 11:06:19 +03:00
Dmitry Petrov
127be9be03 psi2ir: Fix KT-30796 ErrorType for '?:' in OI 2019-07-22 09:46:21 +03:00
Anton Yalyshev
959b720e3f Cleanup: specify description for Gradle Kotlin/Multiplatform wizard 2019-07-21 16:57:54 +03:00
Vladimir Dolzhenko
0f6c381cd7 Fixed a corner case for invalidate package cache for default package
relates to KT-25264
2019-07-19 18:02:20 +02:00
Ilya Chernikov
5ed6573a60 Fix testLazyScriptDefinitionProvider:
The KtUsefulTestCase functionality is not used here but seems causes
the side effects resulting in failing test, probably exactly because
the infrastructure loaded by the KtUsefulTestCase is never called
2019-07-19 16:37:50 +02:00
Ilya Chernikov
853f2a9c3f Fix flaky failures in main-kts IT 2019-07-19 16:37:50 +02:00
Ilya Chernikov
c0804000eb Shorten temp paths used in tests
#KT-32490 fixed
2019-07-19 16:37:50 +02:00
Ilya Chernikov
ee0f55d8e1 Fix gradle IT with scripting discovery
The test is not designed to fail if the definitions are not discovered -
the script files have completely custom extensions and therefore ignored.
So checking for the warning in the build log is enough.
#KT-32697 fixed
2019-07-19 16:37:50 +02:00
Ilya Chernikov
747c488a78 Fix entries closing on saving compiled script to jar:
also adding a short sleep in tests, otherwise in some cases the
classloader was not able to find class in the jar.
Fixes script to jar saving tests on windows
2019-07-19 16:37:49 +02:00
Ilya Chernikov
5b3164ee87 Ignoring resolver tests that failing on TC:
should be rewritten to the new scripting API
Some additional diagnostics improvements are remained for possible
future usage.
2019-07-19 16:37:49 +02:00
Ilya Chernikov
823cb70ba0 Fix script definition matching for REPL console
fixes IdeReplCompletionTestGenerated tests
in addition, fix default ScriptDefinition generation
2019-07-19 16:37:49 +02:00
Ilya Chernikov
425deb42ec Convert paths to unix format before matching with filePathPattern
should also fix testPathPattern5_kts test
2019-07-19 16:37:49 +02:00
Natalia Selezneva
7d6bb023a8 Invalid script dependencies should be removed from fileAttributes to avoid 'all red file highlighting'
^KT-32061 Fixed
2019-07-19 12:45:56 +03:00
Natalia Selezneva
dd437b585b Scratch tests: check output after repl stop because error output is printed only after repl process termination
This should fix flacky tests
2019-07-19 12:45:03 +03:00
Natalia Selezneva
b9968ee1af Do not call onFinish for executor that wasn't started 2019-07-19 12:45:03 +03:00
Natalia Selezneva
2fa7ef2482 Tests, refactoring: replace invokeLater with TransactionGuard to avoid situations that project isDisposed during inlays printing 2019-07-19 12:45:03 +03:00
Natalia Selezneva
ec1bef639f Tests, refactoring: do not search for psi file twice 2019-07-19 12:45:02 +03:00
Natalia Selezneva
fe662fcb2e Provide a mesaage for NPE in scratch tests 2019-07-19 12:45:02 +03:00
Roman Golyshev
a32b1970e6 KT-31295: Disable module selection toolbar for .ws.kts files
^KT-31295 Fixed
2019-07-19 12:45:02 +03:00
Roman Golyshev
e54b43bab1 KT-31295: Enable support for .ws.kts files as for scratch files 2019-07-19 12:45:02 +03:00
Roman Golyshev
232c7fdd0e KT-31295: Add New Kotlin Worksheet action
- creates new kotlin file with `.ws.kts` extension
2019-07-19 12:45:01 +03:00
Natalia Selezneva
f6b03dc02f Add Show Kotlin Gradle DSL Logs Action (KT-31440)
Provide a label for this action in some script diagnostics from gradle dsl resolver
^KT-31440 Fixed
2019-07-19 12:06:09 +03:00
Dmitry Petrov
dd3f8ecaac IR BE Common: Provisional IrFunctionExpression lowering
Transforms IrFunctionExpression elements to local function references,
as it was done before IrFunctionExpression introduction.
2019-07-19 11:36:19 +03:00
Dmitry Petrov
92984b2626 Serialize/deserialize IrFunctionExpression 2019-07-19 11:36:19 +03:00
Dmitry Petrov
ffd9b45ef3 IrFunctionExpression: add 'origin'
This is actually either a LAMBDA or an ANONYMOUS_FUNCTION.
Not quite sure if it's really required, but some tools such as IR-based
decompiler might require this information.
2019-07-19 11:36:19 +03:00
Dmitry Petrov
41b59f9b9a IrFunctionExpression: update fir2ir tests 2019-07-19 11:36:19 +03:00
Dmitry Petrov
ed2b4a8bec Introduce IrFunctionExpression IR element
Use it to represent proper function expressions (lambdas and anonymous
functions).
2019-07-19 11:36:18 +03:00
Vladimir Dolzhenko
022275b781 Do not invalidate package caches on generic events, KT-25264 2019-07-19 09:14:26 +02:00
Nikolay Krasko
3e9765f5bb Don't over-cache own methods list in KtUltraLightClass
The might be code that stores light class references (for example
ChangeMethodSignatureFromUsageFix) and tries to find methods
after invalidating. Internal class caches has an additional assert that
methods obtained are valid and this assert can be violated if the list
of methods was cached before some method invalidation.

This a major problem of current light-classes implementation. Other
places should be checked and fixed as well.

Check test:
QuickFixMultiFileTestGenerated$ChangeSignature$Jk.testJkKeepValOnAddingParameter1

Caused by: java.lang.AssertionError: Element: class org.jetbrains.kotlin.asJava.classes.KtUltraLightMethodForSourceDeclaration #kotlin  because: File language:Language: JAVA != Provider base language:Language: kotlin
invalidated at: no info

Attachments:

	at com.intellij.testFramework.LoggedErrorProcessor.processError(LoggedErrorProcessor.java:61)
	at org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase$setUp$1.processError(KotlinLightCodeInsightFixtureTestCase.kt:84)
	at com.intellij.testFramework.TestLogger.error(TestLogger.java:40)
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:170)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$1(PassExecutorService.java:442)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1166)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:423)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:586)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:86)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:422)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:398)
	at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:164)
	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:218)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:396)
	at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:174)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: com.intellij.psi.PsiInvalidElementAccessException: Element: class org.jetbrains.kotlin.asJava.classes.KtUltraLightMethodForSourceDeclaration #kotlin  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.PsiClassImplUtil$1.add(PsiClassImplUtil.java:380)
	at com.intellij.psi.scope.processor.FilterScopeProcessor.execute(FilterScopeProcessor.java:59)
	at com.intellij.psi.impl.PsiClassImplUtil.processDeclarationsInClassNotCached(PsiClassImplUtil.java:684)
	at com.intellij.psi.impl.PsiClassImplUtil.lambda$createMembersMap$2(PsiClassImplUtil.java:395)
	at com.intellij.util.containers.ConcurrentFactoryMap$2.create(ConcurrentFactoryMap.java:181)
	at com.intellij.util.containers.ConcurrentFactoryMap.get(ConcurrentFactoryMap.java:45)
	at com.intellij.psi.impl.PsiClassImplUtil$MembersMap.get(PsiClassImplUtil.java:357)
	at com.intellij.psi.impl.PsiClassImplUtil$MembersMap.access$000(PsiClassImplUtil.java:349)
	at com.intellij.psi.impl.PsiClassImplUtil.getMap(PsiClassImplUtil.java:207)
	at com.intellij.psi.impl.PsiClassImplUtil.findByMap(PsiClassImplUtil.java:153)
	at com.intellij.psi.impl.PsiClassImplUtil.findMethodsByName(PsiClassImplUtil.java:96)
	at com.intellij.psi.impl.source.ClassInnerStuffCache.findMethodsByName(ClassInnerStuffCache.java:67)
	at org.jetbrains.kotlin.asJava.classes.KtLightClassBase.findMethodsByName(KtLightClassBase.kt:52)
	at com.intellij.codeInsight.daemon.impl.quickfix.ChangeMethodSignatureFromUsageFix.getShortText(ChangeMethodSignatureFromUsageFix.java:94)
	at com.intellij.codeInsight.daemon.impl.quickfix.ChangeMethodSignatureFromUsageFix.isAvailable(ChangeMethodSignatureFromUsageFix.java:152)
	at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.availableFor(ShowIntentionActionsHandler.java:127)
	at com.intellij.codeInsight.intention.impl.CachedIntentions.wrapActionsTo(CachedIntentions.java:183)
	at com.intellij.codeInsight.intention.impl.CachedIntentions.wrapAndUpdateActions(CachedIntentions.java:135)
	at com.intellij.codeInsight.daemon.impl.ShowIntentionsPass.doCollectInformation(ShowIntentionsPass.java:222)
	at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:69)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$1(PassExecutorService.java:430)
	... 15 more
2019-07-18 22:10:20 +03:00
Nikolay Krasko
73356cbb4b Check self before complex equivalence check in light parameter 2019-07-18 22:10:20 +03:00
Nikolay Krasko
484c4ca268 Try to postpone activating decompiler from light element equivalence 2019-07-18 22:10:20 +03:00
Nikolay Krasko
9fd46c105d Reformat and cleanup in asJava/elements 2019-07-18 22:10:20 +03:00
Nikolay Krasko
353ca9752f Better validity check for kotlin light element
There're exceptions from `isWritable` method in light classes caused by
accessing invalid elements.

Override KtLightMemberImpl implementation to avoid activating
decompiler during validity check.
2019-07-18 22:10:20 +03:00
victor.petukhov
60c4eb68ff Add condition for checkNonParenthesizedAnnotationsOnFunctionalType call to except error reporting in stub mode 2019-07-18 17:34:51 +03:00
Igor Chevdar
4bad92d28c Fixed bug in LateinitLowering 2019-07-18 17:08:11 +03:00
Kirill Shmakov
407e5a5270 Use same models in MPP and CIDR 2019-07-18 15:02:17 +03:00
Stanislav Erokhin
2cc6bf31e0 Add link to license folder into README.md 2019-07-18 13:20:55 +03:00
Toshiaki Kameyama
399db0d3c7 Move statement: fix comma placement for argument/parameter
#KT-14756 Fixed
2019-07-18 18:44:40 +09:00
Natalia Selezneva
a2d284c769 ScriptDefinitionsManager shouldn't be ready if definitions aren't initialized yet (KT-32554)
Otherwise this can lead to wrong script definition detection on project opening
^KT-32554 Fixed
2019-07-18 12:30:03 +03:00
Natalia Selezneva
e40cdef257 Scripts: pass script definition as parameter to loader (KT-32554)
This should avoid situation when script definition for file is changed between isApplicable and loadDependencies calls

^KT-32554 Fixed
2019-07-18 12:30:03 +03:00
Natalia Selezneva
763f1e8606 Scripts: check that file is non-script starting script compilation configuration update
Replace FileType check with more precise method isNonScript
2019-07-18 12:30:03 +03:00
Nikolay Krasko
c14f842aa0 Fix dependency between idea core environment and jdom 2019-07-17 23:50:32 +03:00
Nikolay Krasko
20fedb040f Update 192 branch to 2019.2 BETA2 (192.5728.12) 2019-07-17 23:50:32 +03:00
Nikolay Krasko
59c5bcc11c Fix Jsr305HighlightingTest in 192 - don't ask project for not initialized fixture 2019-07-17 23:50:32 +03:00
Nikolay Krasko
9e002b3ff8 Fix inability to instantiate UsefulTestCase because of JdomSerializer
Stack Trace
	  at kotlin.collections.CollectionsKt___CollectionsKt.first(_Collections.kt:184)
	  at com.intellij.configurationStore.XmlSerializer.<clinit>(xmlSerializer.kt:15)
	  at com.intellij.codeInsight.CodeInsightSettings.writeExternal(CodeInsightSettings.java:228)
	  at com.intellij.testFramework.UsefulTestCase.<clinit>(UsefulTestCase.java:104)
	  at com.intellij.testFramework.TestLoggerFactory.log(TestLoggerFactory.java:154)
	  at com.intellij.testFramework.TestLogger.info(TestLogger.java:70)
	  at org.jetbrains.kotlin.scripting.compiler.plugin.definitions.CliScriptDependenciesProvider.calculateRefinedConfiguration(CliScriptDependenciesProvider.kt:45)
	  ...
2019-07-17 23:50:32 +03:00
Alexander Udalov
5341de253f JVM IR: run FileClass & ExpectDeclarationsRemoving phases on whole module
Since we now generate file classes even for IR loaded from dependencies
(see 3a9b94235f) to simplify code in certain lowerings, it makes sense
to do that for all source files together before any meaningful
lowerings. The easiest way to do so is to make FileClassLowering a
module-wide phase.

ExpectDeclarationsRemoveLowering is now also a module-wide phase because
it needs to be run before FileClassLowering (to avoid producing empty
facades for files that only contain `expect` declarations)
2019-07-17 18:15:02 +02:00
Alexander Udalov
e867830eab JVM IR: inline JvmBackend, JvmCodegen 2019-07-17 18:15:02 +02:00
Alexander Udalov
9d639bc9a4 Minor, remove code duplication in WrappedDescriptors 2019-07-17 18:15:01 +02:00
Georgy Bronnikov
0423d0f41e JVM_IR: specify facadeClassGenerator properly in Psi2IrTranslator 2019-07-17 18:15:01 +02:00
Dmitriy Dolovov
1d3b1ed0cb CIDR: Filter aux library order entries that do not represent K/N libraries
Issue #KT-32726 Fixed
2019-07-17 22:37:42 +07:00
Dmitriy Dolovov
10b79816ab Always analyze KTS with JVM platform
Issue #KT-29953
2019-07-17 22:37:37 +07:00
Dmitriy Dolovov
80d2e2ac0d Make [Jvm|Js]IdePlatformKind and [Jvm|Js]IdePlatformKindTooling available in all IDEs
Issue #KT-29953 Fixed
2019-07-17 22:37:31 +07:00
Dmitriy Dolovov
f37c81f1be Dependency on K/N platform-deps is no more required in plugin.xml 2019-07-17 22:37:25 +07:00
victor.petukhov
7ee5583c89 Fix error message for non-parenthesized annotations on functional types 2019-07-17 17:02:46 +03:00
victor.petukhov
6a679d86ab Support non-parenthesized annotations on functional types without receiver
^KT-31734 Fixed
2019-07-17 16:18:15 +03:00
Vadim Brilyantov
60e3787800 Tests for Sealed Class move + Fix invalid move declaration test
MoveDeclarationToSeparateFile.testSealed test was threated to check that the intention is not applicable but it currently is.
2019-07-17 15:53:58 +03:00
Vadim Brilyantov
91d603292c #KT-27389 : Change JavaSourceRoot usages to Kotlin analogs 2019-07-17 15:53:58 +03:00
Vadim Brilyantov
895b49c0b9 Disable default search in comments and strings when renaming 2019-07-17 15:53:58 +03:00
Vadim Brilyantov
145a4b24ca #KT-29622: Support sealed classes with non-nested impls move 2019-07-17 15:53:57 +03:00
Vadim Brilyantov
a16551557c #KT-29622: Support sealed classes with nested impls move 2019-07-17 15:53:57 +03:00
Vyacheslav Gerasimov
a8e0dfabc7 Add -XX:+HeapDumpOnOutOfMemoryError for gradle in import tests
#KT-32643
2019-07-17 15:39:44 +03:00
Alexander Udalov
9595c815f1 JVM IR: invent names for SAM wrapper classes
Similarly to how it's done for callable references. This is needed for
IrTypeMapper to be able to correctly compute the name of the SAM wrapper
IrClass without resorting to the name of the underlying descriptor
(computed in CodegenAnnotatingVisitor)
2019-07-17 13:55:37 +02:00
Alexander Udalov
a15575d546 JVM IR: do not use KotlinTypeMapper in IrTypeMapper.mapType 2019-07-17 13:55:37 +02:00
Alexander Udalov
1e16c0a447 JVM IR: minimize public API of IrTypeMapper 2019-07-17 13:55:37 +02:00
Alexander Udalov
59ce76e9fd JVM IR: do not use misleading names for callable reference classes
The real JVM name is invented in InventNamesForLocalClasses and will be
used by the codegen when generating the actual class
2019-07-17 13:55:36 +02:00
Alexander Udalov
29fa1793d3 JVM IR: add InventNamesForLocalClasses pass 2019-07-17 13:55:36 +02:00
Alexander Udalov
529efff8cb IR: introduce IrAttributeContainer
This is useful to store data that must be kept when the element is
transformed, such as names of local/anonymous classes and
EnclosingMethod values on JVM which are computed before any lowerings.

For now, this is implemented very conservatively: the only field
`attributeOwnerId` which can be used in BackendContext implementation as
a key in the map
2019-07-17 13:55:36 +02:00
Alexander Udalov
d399144b80 Use TypeSystemCommonBackendContext in mapBuiltInType 2019-07-17 13:55:36 +02:00
Alexander Udalov
13bc5f0c47 Use TypeSystemCommonBackendContext in computeExpandedTypeForInlineClass 2019-07-17 13:55:36 +02:00
Alexander Udalov
c27d9c4546 Use TypeSystemCommonBackendContext in KotlinTypeMapper.writeGenericArguments 2019-07-17 13:55:36 +02:00
Alexander Udalov
2585ce0aa7 Introduce TypeSystemCommonBackendContext, use in KotlinTypeMapper.getVarianceForWildcard 2019-07-17 13:55:35 +02:00
Alexander Udalov
0460b2990f Use TypeSystemContext in KotlinTypeMapper.hasNothingInNonContravariantPosition
Thanks to this abstraction, this code will now easily work with
IrType-based TypeSystemContext implementation in the new IR type mapper
2019-07-17 13:55:35 +02:00
Alexander Udalov
1896537091 Minor, extract inline class type mapping to separate file 2019-07-17 13:55:35 +02:00
Alexander Udalov
bd8c09bfb5 JVM IR: move CollectionToArray creation to JvmSymbols
Also simplify it to use IR builder DSL
2019-07-17 13:55:35 +02:00
Alexander Udalov
15e0fd93bd Minor, rename IrBuiltIns.IrTypeMapper -> BuiltInIrTypePair
To avoid name clash with the new IrTypeMapper in JVM backend
2019-07-17 13:55:35 +02:00
Alexander Udalov
f9a1e582b2 Minor, somewhat simplify ClassCodegen construction 2019-07-17 13:55:35 +02:00
Alexander Udalov
edaff968ad Minor optimization in MutableList.transformFlat 2019-07-17 13:55:35 +02:00
Ilya Gorbunov
945e058586 Document return value of removeAll and retainAll with predicate
#KT-32532 Fixed
2019-07-17 14:27:26 +03:00
Dmitry Gridin
7d173ed385 GradleBuildScript: throw exception when trying to change level of language features to disable in multiplatform & fix tests 2019-07-17 12:55:12 +03:00
Dmitry Gridin
0d49ffa831 UpdateConfigurationQuickFixTest: update tests 2019-07-17 12:55:12 +03:00
Dmitry Gridin
cb432acfb7 BuildScriptManipulator: implement new syntax for enable experimental features in MPP
#KT-28295 Fixed
2019-07-17 12:55:12 +03:00
Dmitry Gridin
8887031962 GradleConfiguratorTest: fix configureJvmEAPWithBuildGradleKts test 2019-07-17 12:55:11 +03:00
Dmitry Gridin
46dfff7d82 KotlinBuildScriptManipulator: cleanup code 2019-07-17 12:55:11 +03:00
Dmitry Gridin
b1d1a4b2e1 FeatureSupportIntentionActionsFactory: add the missing branch else 2019-07-17 12:55:11 +03:00
Dmitry Petrov
28215186ca IR serialization: migrate to new generated Java classes structure 2019-07-17 12:00:34 +03:00
Dmitry Petrov
8baa7dfe22 Generated Java classes for Kotlin IR protobuf 2019-07-17 12:00:34 +03:00
Dmitry Petrov
2305bea2b5 Generate IR protobuf classes as multiple Java files
Otherwise KotlinIr.java becomes too big for IDEA to swallow in the
default configuration.
2019-07-17 12:00:34 +03:00
Dmitry Petrov
d6eee37481 GenerateProtoBuf: support java_multiple_files mode 2019-07-17 12:00:34 +03:00
Anton Yalyshev
19dfbfa42c Cleanup: make comments more informative 2019-07-17 10:58:57 +03:00
Anton Yalyshev
1cdcde86e3 Extract adding of sourceSets to subclass, cause superclass is also used in other wizards where this procedure breaks build.gradle
#KT-32105 Fixed
2019-07-17 10:58:39 +03:00
Anton Yalyshev
5b66063650 Add clarifications about single/multi targeting to framework descriptions 2019-07-17 10:58:13 +03:00
Anton Yalyshev
a864715cb8 Refactoring: extract and pull up duplicated code from JVM- and JS- related subclassed 2019-07-17 10:57:22 +03:00
Anton Yalyshev
9d6367a9be Add Kotlin/MPP to Gradle group of New Project Wizards #KT-32105 Fixed 2019-07-17 10:57:04 +03:00
Mikhail Glukhikh
7ccf21c5c8 FIR resolve: fix vararg parameter types 2019-07-17 10:45:07 +03:00
Mikhail Glukhikh
592cf4f4e8 Make FirNamedReferenceWithCandidate not resolved, fix receiver completion
Counting it as resolved provokes a lot of difficult to discover errors
2019-07-17 10:45:06 +03:00
Mikhail Glukhikh
08f44d4f14 FIR resolve: add early protection against cyclic property resolve 2019-07-17 10:45:06 +03:00
Simon Ogorodnik
1222449dc8 FIR resolve: perform inference completion for property access 2019-07-17 10:45:06 +03:00
Mikhail Glukhikh
99680a2ad7 FIR: refactor & simplify invoke resolve a bit 2019-07-17 10:45:06 +03:00
Mikhail Glukhikh
fff954ed3f FIR: skip extra non-valid groups during candidate resolve 2019-07-17 10:45:06 +03:00
Mikhail Glukhikh
b813f22cfe Extract part of utility FIR transformers into TransformUtils 2019-07-17 10:45:05 +03:00
Mikhail Glukhikh
0ac23eef93 Minor (FIR resolve): replace session with fileSession 2019-07-17 10:45:05 +03:00
Simon Ogorodnik
3da11cc85b Use no-op substitutor instead of substitutor with empty map 2019-07-17 10:45:05 +03:00
Mikhail Glukhikh
2d74dac4f2 FIR: set constructor parameter scope correctly for designated transformer 2019-07-17 10:45:05 +03:00
Mikhail Glukhikh
b8c3947827 Measure unresolved function call & qualified access # in FIR bench 2019-07-17 10:45:05 +03:00
Roman Artemev
af45e1c5dc [JS BE] Do not produce source mapping for fake KtElement
Fix [KT-26701], [KT-12935]
2019-07-17 10:21:34 +03:00
Anton Yalyshev
12736edfc1 Revert "Add Kotlin/MPP to Gradle group of New Project Wizards #KT-32105 Fixed"
This reverts commit 6b3117cc
2019-07-16 18:10:49 +03:00
Anton Yalyshev
eb608770e7 Revert "Refactoring: extract and pull up duplicated code from JVM- and JS- related subclassed"
This reverts commit f742e000
2019-07-16 18:10:19 +03:00
Anton Yalyshev
067978e613 Revert "Add clarifications about single/multi targeting to framework descriptions"
This reverts commit 101a3a94
2019-07-16 18:09:47 +03:00
Dmitry Gridin
b1e371a2dd MPP: don't return Main modules from implementedModules for Test modules
#KT-28529 Fixed
#KT-30799 Fixed
2019-07-16 17:08:42 +03:00
Dmitry Gridin
60421c441e IDE: add warn on java files outside java source roots
#KT-28121 Fixed
2019-07-16 17:07:31 +03:00
Dmitry Gridin
4928f3ff57 CreateExpectedFix: fix KNPE from init block
#KT-32639 Fixed
2019-07-16 17:06:36 +03:00
Alexander Udalov
f38e4d618e Support Array::class literal, forbid Array<X>::class on non-JVM
#KT-31230 Fixed
2019-07-16 15:57:26 +02:00
Alexander Udalov
8103f0ba60 Fix compilation in AbstractAndroidBytecodeShapeTest.kt 2019-07-16 15:51:30 +02:00
Mikhael Bogdanov
496765f41e Support target templates in bytecode tests
Avoid test data duplication
2019-07-16 14:08:27 +02:00
Mark Punzalan
de1e27c584 Make all progression headers inclusive, and decrement last for
last-exclusive progressions (i.e., "until" progressions and loop over
array indices).

This change makes it possible to correctly implement the handling of
"step" progressions. Computing the last element of a stepped progression
requires that the last is inclusive.

Also invert the while loop (into if + do-while) that is used when
lowering for-loops over progressions that cannot overflow. This keeps
the performance characteristics closer to the ForLoopsLowering in
kotlin-native, since the goal is to converge to this shared version.

Also used IrType instead of KotlinType, where possible.

 https://github.com/JetBrains/kotlin/pull/2390
 https://github.com/JetBrains/kotlin/pull/2305
2019-07-16 14:08:21 +02:00
Vladimir Dolzhenko
39f6416757 Show progress on remove unused imports, KT-30748 2019-07-16 13:06:59 +02:00
Ilya Chernikov
cfab89385f Do not override path calculation in light virtual files in tests:
seems unnecessary anymore and breaks some script testing logic
2019-07-16 12:20:21 +02:00
Andrey Uskov
0c1d8e29b9 Fix creation of empty source sets in tests 2019-07-16 13:08:20 +03:00
Andrey Uskov
1336f65535 Improve diagnostics in importing tests and fix android test 2019-07-16 13:07:46 +03:00
Andrey Uskov
afd2af01cd NewMultiplatformProjectImportingTest - bunched 2019-07-16 13:06:53 +03:00
Jake Wharton
4386518c4d Add intrinsic for ULong/UInt.toString on Java 8+
Unfortunately this cannot currently be done for the extension overload which accepts a radix due to behavior difference with regard to invalid radix values.
2019-07-16 11:15:19 +02:00
Ilya Kirillov
b7917978b8 New J2K: correctly create AST for Java call of Kotlin data class derived members
#KT-32604 fixed
2019-07-16 11:56:08 +03:00
Ilya Kirillov
d29d7fb257 New J2K: do not resolve unary expressions method symbols
As we already have its type and may fail on unresolved declaration

#KT-32603 fixed
2019-07-16 11:55:04 +03:00
Ilya Kirillov
84872e064f New J2K: use test data for nj2k conversion tests from nj2k tests data instead of old one 2019-07-16 11:55:04 +03:00
Anton Yalyshev
101a3a9420 Add clarifications about single/multi targeting to framework descriptions 2019-07-16 11:04:52 +03:00
Anton Yalyshev
f742e000f8 Refactoring: extract and pull up duplicated code from JVM- and JS- related subclassed 2019-07-16 11:03:51 +03:00
Anton Yalyshev
6b3117cc2c Add Kotlin/MPP to Gradle group of New Project Wizards #KT-32105 Fixed 2019-07-16 11:03:51 +03:00
Ilya Gorbunov
5e8192bf74 Make kotlin-test-js integration test tasks incremental
Define their inputs and outputs, so they are run only
when js files in build/node-modules change. These don't include external
libraries node-modules
2019-07-15 19:41:44 +03:00
Alexander Udalov
385366384c Psi2ir: ignore unresolved annotations
Note that the test is an exact copy of an existing test
missingDependencyNestedAnnotation, but with -Xuse-ir
2019-07-15 18:40:00 +02:00
scache
9062f4229b QuickDoc: Show sample code containing type parameters correctly
#KT-20777 Fixed
2019-07-15 19:36:24 +03:00
Ilya Chernikov
2ef575d94e Fix nullability in the instrumenter, avoid exceptions on tests setup 2019-07-15 16:37:06 +02:00
Ivan Gavrilovic
4caddd2c1c KT-31291: Wrap ASM version in a method to avoid having it inlined
This commit adds a method to get the value of org.jetbrains.org.objectweb.asm.Oopcodes.API_VERSION.
In general, this should not be a problem, but some Gradle plugins package
Jetbrains ASM version. At runtime, their version may be loaded which may be
different than the one this code was compiled against.
2019-07-15 16:53:04 +09:00
Ivan Gavrilovic
6619106af2 Improve incremental KAPT logging
This commit improves incremental KAPT logging. It reports processor
stats using their actual names. Also, warning is printed if incremental
annotation processing is requested, but not all APs are incremental
2019-07-15 16:53:04 +09:00
Ivan Gavrilovic
5cab6fd6cf KAPT: Mark incremental cache as LocalState
Use @LocalState to mark incremental annotation processing cache directory.
This is to make sure this is not stored in the build cache as it contains
absolute paths and cannot be shared between machines.
2019-07-15 16:53:04 +09:00
Ivan Gavrilovic
251d8ccd97 KT-31840: Fix caching for incremental annotation processing
Artifact transform that uses ASM to analyze KAPT classpath stored absolute
paths in the output artifact. This resulted in remote build cache misses.

This commit changes how analysis is stored. Actual analysis file is the
output of the transform, and there is not need to use a marker file any more.
Output does not store the classpath entry absolute path. Instead, it uses
task action incremental information to find analysis outputs that changed.

Additionally, class that handles analysis snapshot comparison has been
simplified, and lazy loading of the structural information is handled in
a more straightforward way.
2019-07-15 16:53:03 +09:00
Dmitry Petrov
6963424dfc psi2ir: Empty 'if' branches have type 'kotlin.Unit' 2019-07-15 08:58:04 +03:00
Mikhael Bogdanov
0774f800a0 Split android box tests by flavours 2019-07-15 07:31:35 +02:00
nikita.movshin
7c77565bb8 Add changelog for 1.3.41 2019-07-13 14:44:40 +03:00
Sergey Rostov
aee1dd2379 Gradle, test runner: fix failed test (typo) 2019-07-12 21:44:05 +03:00
Sergey Rostov
abb1a9892b Gradle, webpack: use only archivesBaseName as outputFileName 2019-07-12 21:40:26 +03:00
Sergey Rostov
6658c1da2f IDE, Wizards, JS for browser: create index.html in resources
For gradle build scripts only

#KT-31953
2019-07-12 21:40:26 +03:00
Ilya Gorbunov
4fc942c5e9 KT-16602: Improve mutable sorting samples, fix sample references 2019-07-12 21:34:54 +03:00
Dat Trieu
38d26b1d92 KT-16602: Provide samples for sorting API usage 2019-07-12 21:32:03 +03:00
keijumt
3f5d64e635 Add sample of hashMapOf 2019-07-12 17:10:15 +03:00
Igor Yakovlev
cd6abcd4c9 Expect modifier definitions is not exposed by UL-classes 2019-07-12 16:33:52 +03:00
Igor Yakovlev
0602a6da72 Fix invalid FakeJvmFieldConstant inspection for UL classes
Test MultiFileInspectionTestGenerated.testFakeJvmFieldConstant_FakeJvmFieldConstant now correctly works with ultra-light annotation classes.
2019-07-12 16:33:52 +03:00
Igor Yakovlev
a9aa60491e Fix UL-classes test renders and test data 2019-07-12 16:33:51 +03:00
Igor Yakovlev
4b1226e3d7 Set correct nullability and Companion support to annotations 2019-07-12 16:33:51 +03:00
Igor Yakovlev
eea469939e Kotlin meta-annotation converter for UL-annotations 2019-07-12 16:33:51 +03:00
Igor Yakovlev
afe784e79e Add UL-annotations support 2019-07-12 16:33:51 +03:00
Natalia Selezneva
4fed624942 Append for commit: switch ScriptReportSink to new scripting API
Commit hash e4d0c2cb0e
2019-07-12 16:24:57 +03:00
Natalia Selezneva
63767b4dca Performance: do not check file type for scripts with standard extension 2019-07-12 16:24:57 +03:00
Pavel Semyonov
2577dfa06a docs: added KDoc for Comparator, fixed KDoc for comparison binarySearch() 2019-07-12 16:08:37 +03:00
Alexander Gorshenev
09b3b2e5b7 Enable adroid_arm64 on mingw hosts 2019-07-12 16:06:32 +03:00
Dmitry Gridin
fc45948da6 CreateActualFix: should create source root directory if it doesn't exist
#KT-27555 Fixed
2019-07-12 15:51:30 +03:00
Dmitry Gridin
f310bd3324 RemoveRedundantQualifierNameInspection: apply on idea module 2019-07-12 15:51:12 +03:00
Dmitry Gridin
229b8cb6a3 RemoveRedundantQualifierNameInspection: shouldn't analysis import and package directives 2019-07-12 15:51:12 +03:00
Dmitry Gridin
694c231689 RemoveRedundantQualifierNameInspection: fix false negative for java constructor
#KT-32506 Fixed
2019-07-12 15:51:12 +03:00
Ilya Chernikov
bd50454a73 Change default for script displayName parameter to empty, generate name from base class in definition 2019-07-12 13:44:09 +03:00
Ilya Chernikov
0cc40440fb Implement filePathPattern in the script configuration with handling
also
- tests
- extending kdoc for the definitions
2019-07-12 13:44:09 +03:00
Sergey Rostov
dface77b5c NodeJS Test runner: update build time dependencies 2019-07-12 12:47:21 +03:00
Sergey Rostov
38ff228bc8 Gradle, Tests runner: handle case when test runtime exits abnormally
In this case we should close all test nodes with failures and gracefully
close all other enclosing nodes.

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

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

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

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

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

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

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

Issue #KT-32204 Fixed
2019-07-10 19:36:57 +03:00
Nikolay Krasko
0da55e8284 Unregister custom logger after use in AbstractGradleMultiplatformWizardTest 2019-07-10 17:52:29 +03:00
Max Medvedev
5d35bebacd Keyword completion: use proper prefix matcher for keyword completion
fixes #KT-32519
2019-07-10 15:54:44 +03:00
Mikhail Glukhikh
ee37a0aa9f Inline callable: keep all usages inside annotation entries
#KT-24596 Fixed
2019-07-10 15:10:52 +03:00
Mikhail Glukhikh
eb00af6b96 CFG: mark annotation arguments as "used as expressions" #KT-24596 Fixed
NB: only classes / function / properties annotations are considered here,
not including local declarations and other annotations
2019-07-10 15:10:52 +03:00
Mikhail Glukhikh
b24b8bfb28 BindingContextUtils: fix warnings 2019-07-10 15:10:51 +03:00
Mikhail Glukhikh
b97f187cf6 ControlFlowInformationProvider: fix warnings 2019-07-10 15:10:51 +03:00
Mikhail Glukhikh
5e94f537ef Refactoring: use isUsedAsExpression instead of USED_AS_EXPRESSION slice 2019-07-10 15:10:51 +03:00
Mikhail Glukhikh
5afa5de1d7 ReplaceWith: don't keep class literal & callable reference in inlining
#KT-30197 Fixed
2019-07-10 15:10:51 +03:00
Mikhail Glukhikh
615aa265f5 Inline: do more precise check before adding this@Labeled #KT-30762 Fixed 2019-07-10 15:10:51 +03:00
Dmitry Gridin
6605e0dfc0 Update test 'moveMultipleFIlesWithImplicitPrefix' 2019-07-10 14:09:37 +03:00
Dmitry Gridin
d2b8535548 Move/copy refactoring: add base support of implicit package prefix
#KT-29720 Fixed
2019-07-10 14:09:37 +03:00
Dmitry Gridin
7c547d8c5a Minor: clean up copy refactoring 2019-07-10 14:09:37 +03:00
Dmitry Gridin
1a9abaeb2a Clean up move refactoring 2019-07-10 14:09:37 +03:00
Dmitry Gridin
beba1d82fc ReplaceJavaStaticMethodWithKotlinAnalogInspection: add CommentSaver for case with transform to extension 2019-07-10 14:09:37 +03:00
Dmitry Gridin
56d2961cd9 ReplaceJavaStaticMethodWithKotlinAnalogInspection: add more tests 2019-07-10 14:09:37 +03:00
Dmitry Gridin
82bf21f195 ReplaceJavaStaticMethodWithKotlinAnalogInspection: rename isApplicable(call, context) to isApplicableInContext 2019-07-10 14:09:37 +03:00
Dmitry Gridin
71c0b3caa0 ReplaceJavaStaticMethodWithKotlinAnalogInspection: clean up comments 2019-07-10 14:09:36 +03:00
Dmitry Gridin
8314dbffd5 ReplaceJavaStaticMethodWithKotlinAnalogInspection: introduce Transformation for extension with non-null arguments 2019-07-10 14:09:36 +03:00
Dmitry Gridin
8b8858b223 ReplaceJavaStaticMethodWithKotlinAnalogInspection: introduce Transformation for extension with non-null receiver 2019-07-10 14:09:36 +03:00
Dmitry Gridin
d47a7234bb ReplaceJavaStaticMethodWithKotlinAnalogInspection: apply inspection on idea module 2019-07-10 14:09:36 +03:00
Dmitry Gridin
026949a758 ReplaceJavaStaticMethodWithKotlinAnalogInspection: remove non-implemented cases 2019-07-10 14:09:36 +03:00
Dmitry Gridin
632158cd52 ReplaceJavaStaticMethodWithKotlinAnalogInspection: simplify Transform for default action 2019-07-10 14:09:36 +03:00
Dmitry Gridin
3aa2401f19 ReplaceJavaStaticMethodWithKotlinAnalogInspection: introduce Transform interface
#KT-32454 Fixed
2019-07-10 14:09:36 +03:00
Dmitry Gridin
835532c206 ReplaceJavaStaticMethodWithKotlinAnalogInspection: move to move to inspections.jdk2k subpackage 2019-07-10 14:09:36 +03:00
Dmitry Gridin
b2a60795da ReplaceJavaStaticMethodWithKotlinAnalogInspection: add more cases for Arrays
#KT-32512 Fixed
#KT-30124 Fixed
2019-07-10 14:09:35 +03:00
Dmitry Gridin
24caca1882 ReplaceJavaStaticMethodWithKotlinAnalogInspection: fix false positive for 'Arrays.copyOf'
#KT-32477
2019-07-10 14:09:35 +03:00
Sergey Rostov
4a8dbeda1b Gradle, webpack: add conventional archive properties
#KT-31890 Fixed
#KT-32209 Fixed
2019-07-10 13:26:56 +03:00
Sergey Rostov
b6ca323a5e Gradle, karma, webpack: add required dependencies 2019-07-10 13:26:55 +03:00
Sergey Rostov
8b622955fe Gradle, js, minor: fix typos, formatting and imports 2019-07-10 13:26:55 +03:00
Sergey Rostov
b68582656e Gradle, DtsResolver: use canonical path to avoid files duplication 2019-07-10 13:26:55 +03:00
Sergey Rostov
80068c0a40 Gradle, js: fix task annotations 2019-07-10 13:26:55 +03:00
Sergey Rostov
3c606c27a1 Gradle, js: support generating kotlin external declarations from .d.ts
#KT-31703 Fixed
2019-07-10 13:26:55 +03:00
Sergey Rostov
2fb4d23f1e Gradle, js, KotlinProjectNpmResolution: index by compilation 2019-07-10 13:26:54 +03:00
Sergey Rostov
7332290ece Gradle, js, NpmDependency: getDependenciesRecursively 2019-07-10 13:26:54 +03:00
Sergey Rostov
50e07330f4 Gradle, js, resolver, requireInstalled: close resolving if kotlinNpmResolve is up-to-date 2019-07-10 13:26:54 +03:00
Sergey Rostov
1860097c08 Gradle, js, npm resolver: support custom package json entries, index files and extensions 2019-07-10 13:26:54 +03:00
Sergey Rostov
88fa396d26 Gradle, js, resolver: don't skip reading lock file while skipping package manager execution 2019-07-10 13:26:54 +03:00
Sergey Rostov
d1789b07ad Gradle, js, yarn: store resolved version and integrity hash to NpmDependency 2019-07-10 13:26:54 +03:00
Sergey Rostov
d051748e2b Gradle, js, npm: support scopes 2019-07-10 13:26:54 +03:00
Sergey Rostov
5e6c76a6e7 Gradle, execWithProgress: report description as first progress 2019-07-10 13:26:53 +03:00
Sergey Rostov
638554ba1c Gradle, JS, resolver: don't add files that are not existed, add kjsm files 2019-07-10 13:26:53 +03:00
Sergey Rostov
bcf894aba3 Gradle, JS, resolver: return null if npm dependency being resolved before kotlinNpmInstall 2019-07-10 13:26:53 +03:00
Sergey Rostov
8b0dffe182 Gradle, JS, compilation resolver: close dependent compilation resolver when it's packageJson task is up-to-date 2019-07-10 13:26:53 +03:00
Sergey Rostov
3658ad785f Gradle, JS, NpmResolutionManager: cleanup and document states 2019-07-10 13:26:53 +03:00
Sergey Rostov
327d75dc5d Gradle, JS: Extract NpmResolutionManager 2019-07-10 13:26:53 +03:00
Sergey Rostov
982f08ce7a Gradle, JS: replace NodeJs plugin and extension with NpmResolver plugin 2019-07-10 13:26:52 +03:00
Sergey Rostov
2f90742809 Gradle, JS: rework nodejs extensions and plugins
Get rid of Project.nodeJs
2019-07-10 13:26:52 +03:00
Sergey Rostov
24f08a614e Gradle, GradleNodeModulesCache: use new ProcessedFilesCache API 2019-07-10 13:26:52 +03:00
Sergey Rostov
fd2d99e205 Gradle, ProcessedFilesCache: use file as target type (not string)
recompute removed target directories
2019-07-10 13:26:52 +03:00
Sergey Rostov
9679403831 Gradle, ProcessedFilesCache: optimize serialization
JSON kept for debugability
2019-07-10 13:26:52 +03:00
Sergey Rostov
dff48b251d Gradle, JS: rework extension registering and resolver phasing
This allows to resolve projects lazily.

#KT-32393 Fixed
#KT-31565
#KT-32015
#KT-31917
2019-07-10 13:26:52 +03:00
Sergey Rostov
f4dcc18baf Gradle, JS: rework NpmResolver
Now resolving works per compilation, so transitive dependency between
 compilations in same project can be resolved (KT-31917).

Resolving gradle configurations now occurs in separate
per-project `KotlinPackageJsonTask`s. Global install called in
`KotlinNpmInstallTask`. Tasks inputs configured, so tasks now
reported as UP-TO-DATE if nothing was changed.

#KT-31565 Fixed
#KT-32015 Fixed
#KT-31917 Fixed
2019-07-10 13:26:51 +03:00
Ilya Kirillov
196e3f968e New J2K: fix generating nj2k tests bunch files 2019-07-10 13:21:53 +03:00
Ilya Kirillov
cabc26184b New J2K: convert single Java static import statements 2019-07-10 13:19:23 +03:00
Ilya Kirillov
b18350e9c8 New J2K: fix ExceptionInInitializerError in JKJavaPrimitiveTypeImpl 2019-07-10 13:19:23 +03:00
Ilya Kirillov
f0dd21790a New J2K: add plain text copy-paste conversion test for new J2K 2019-07-10 13:18:36 +03:00
Ilya Kirillov
041677ab1b New J2K: force use old j2k for all not file/copy-paste conversions 2019-07-10 13:16:54 +03:00
Ilya Kirillov
8f69cca2b3 New J2K: enable new J2K by default 2019-07-10 13:16:53 +03:00
Ilya Kirillov
ba3927b580 New J2K: add default null value to property with type parameter type when it is implicit in Java
#KT-32436 fixed
2019-07-10 13:16:53 +03:00
Ilya Kirillov
9d6338afb2 New J2K: do not fail conversion if some of post-processings throws exception 2019-07-10 13:16:53 +03:00
Ilya Kirillov
a9865e5d7b New J2K: check for element validity before applying fix in diagnostic-based post processings 2019-07-10 13:16:53 +03:00
Ilya Kirillov
236f62be2a New J2K, minor: refactor code builder 2019-07-10 13:16:52 +03:00
Ilya Kirillov
934425e86a New J2K: rearrange and optimize some post-processings 2019-07-10 13:16:52 +03:00
Ilya Kirillov
370f113b78 New J2K: run add/remove modifiers post-processings only single time && do not call resolve in them for some corner cases 2019-07-10 13:16:52 +03:00
Ilya Kirillov
3e04bfb156 New J2K: do not print modifiers which are going to be removed in postprocessing 2019-07-10 13:16:52 +03:00
Natalia Selezneva
0b7b16162d 182: scripts, pass File finding script definition instead of File.name 2019-07-10 12:05:17 +03:00
Roman Artemev
6ab46204cb [JS IR BE] Properly handle primary constructors
- force primary constructor to be created by codegen
 - make sure initializer is invoked once in primary constructor
 - make one of coroutine constructor primary
 - remove hack from codegen
2019-07-10 10:39:11 +03:00
Roman Artemev
a112345418 [JS IR BE] Fix builtin constructor lowering
- Do not touch delegation construction call
2019-07-10 10:39:11 +03:00
Roman Artemev
131158df65 [JS IR BE] Refact MultipleCatchLowering
- catch dynamic type instead of common super type over all catch blocks
2019-07-10 10:39:11 +03:00
Roman Artemev
1605dc3251 [JS IR BE] Remove unused classifier symbol from IrTypeOperatorCall builder 2019-07-10 10:39:10 +03:00
Nicolay Mitropolsky
69c4db82d4 Uast: IdeaKotlinUastResolveProviderService analyze as BodyResolveMode.PARTIAL_WITH_CFA
it is required for `isUsedAsResultOfLambda` in `KotlinULambdaExpression`
2019-07-10 10:33:10 +03:00
Dmitry Gridin
fda5692fc6 RemoveCurlyBracesFromTemplateInspection: add heuristic to change severity
Change severity to INFORMATION if a variable hasn't whitespace around & add an option to return the old behavior
 #KT-31717 Fixed
2019-07-10 10:28:45 +03:00
Natalia Selezneva
e4d0c2cb0e Scripts: switch ScriptReportSink to new scripting API
Use ScriptDiagnostic instead of ScripReport
2019-07-10 10:10:21 +03:00
Natalia Selezneva
bd0f947222 Refactor script reports: introduce getter, check that report are changed inside attach method 2019-07-10 10:10:21 +03:00
Natalia Selezneva
68b45ce1dc FromFileAttributeScriptDependenciesLoader should be applicable when there are scriptCompilationConfiguration file attribute 2019-07-10 10:10:20 +03:00
Natalia Selezneva
923e89db69 Provide toString method for ScriptCompilationConfigurationWrapper
This is needed for debug and logging proposes
2019-07-10 10:10:20 +03:00
Natalia Selezneva
7215e03a47 Scripts: rewrite search without usage of legacy script definition 2019-07-10 10:10:20 +03:00
Natalia Selezneva
4853190752 Scratch: should always have default script definition 2019-07-10 10:10:20 +03:00
Natalia Selezneva
b0c9339dee Scripts: search for script definition using PsiFile instead of file name 2019-07-10 10:10:07 +03:00
Natalia Selezneva
fbe965be9d Scripts: pass File finding script definition instead of File.name 2019-07-10 10:08:19 +03:00
Vladimir Dolzhenko
ac4df86fa6 Fix performance test compilation 2019-07-10 09:44:11 +03:00
Andrey Uskov
9da630a1ac Fix compilation of KotlinMPPGradleProjectResolver in bunch 192 2019-07-10 02:07:37 +03:00
Vladimir Dolzhenko
3c41db654a Fix performance test compilation for 192 2019-07-09 20:49:21 +03:00
Ilya Gorbunov
7d14fb756d Make Duration storageUnit inline val to avoid state initialization
Avoid state initialization in JS and Native
2019-07-09 20:39:28 +03:00
Alexander Udalov
f7fc5d2ffa Fix codegen for JvmOverloads with more than 32 parameters
Use DefaultCallArgs to handle mask list construction correctly

 #KT-31070 Fixed
2019-07-09 19:31:59 +02:00
Andrey Uskov
40633768bc Implement dependency deduplication in order to reduce memory
consumption during import process
2019-07-09 20:14:07 +03:00
Andrey Uskov
09c2b2800c Migrate collections to arrays for memory optimisation
during import process
2019-07-09 20:13:44 +03:00
Andrey Uskov
f6f072693a Fully disable editing target platforms for HMPP modules. Show
java target platform version in Facets
2019-07-09 20:13:17 +03:00
Andrey Uskov
c98ad923bd Import list of pure kotlin source roots from gradle
in facet settings for inspections
#KT-32300 Fixed
2019-07-09 20:12:55 +03:00
Andrey Uskov
2665fff373 Import package prefix from MPP projects 2019-07-09 20:12:13 +03:00
Andrey Uskov
2b6f566d58 Import package prefix from gradle
#KT-19693 Fixed
2019-07-09 20:11:48 +03:00
Vladimir Dolzhenko
dbec626a49 Fix performance test compilation for 182 2019-07-09 19:43:18 +03:00
Vyacheslav Gerasimov
ffb65b2655 Build: Fix kotlinBuildProperties, should always proguard on teamcity 2019-07-09 19:19:58 +03:00
Vyacheslav Gerasimov
8605ad6630 Build: Upgrade gradle to 5.5 2019-07-09 19:19:27 +03:00
Alexander Udalov
a6be6f4986 Use Class.forName instead of ClassLoader.loadClass in reflection
This fixes an issue in constructing annotation instances with array
class elements. For some reason, behavior of `ClassLoader.loadClass`
differs from `Class.forName` in handling arrays, namely:

* `loadClass("[Ltest.Foo;")` returns null
* `Class.forName("[Ltest.Foo;")` returns class for array of test.Foo

Overall, there doesn't seem to be any way to load an array class with
`CLassLoader.loadClass`.

We pass initialize=false to forName because this is the behavior of
ClassLoader.loadClass: it doesn't perform class initialization (e.g.
<clinit> is not executed).

 #KT-31318 Fixed
2019-07-09 18:14:45 +02:00
Vladimir Dolzhenko
72d74ff888 Add build gradle kts performance tests 2019-07-09 17:27:33 +03:00
Sergey Igushkin
c292380aff Improve Kotlin/Native disabled targets warning, KT-29693
* Group all disabled targets from all subprojects in a single warning
* Make the warning optional, suggest disabling it with a Gradle property

Issue #KT-29693 Fixed
2019-07-09 16:01:18 +03:00
Alexander Udalov
dabb7bb496 Fix new inference CLI tests on Windows 2019-07-09 11:52:54 +02:00
Mikhael Bogdanov
b82c32a807 Use default target for android tests 2019-07-09 09:46:34 +02:00
Roman Artemev
d4fb76c1da [JS IR BE] Fix overriding property of Throwable 2019-07-09 10:40:01 +03:00
Roman Artemev
d9c6d38715 [JS IR BE] Fix private members lowering
- visit over file instead of class
2019-07-09 10:40:01 +03:00
Ilya Gorbunov
7573fcde53 Demote new experimental capitalize overloads in overload resolution
Revert "Fix method reference ambiguity in test after introducing 'capitalize' overload"
This reverts commit fe9bd9ee
2019-07-09 03:39:25 +03:00
Ilya Gorbunov
686bcb830e Bit query and bit rotation functions for UInt, ULong, UShort, UByte
#KT-12749
2019-07-08 19:09:32 +03:00
Ilya Gorbunov
39bdf34b9f Use common implementation of fastLog2 based on countLeadingZeroBits 2019-07-08 19:09:32 +03:00
Ilya Gorbunov
f8724654a1 Bit query and bit rotation functions for Int, Long, Short, Byte
#KT-12749
2019-07-08 19:09:32 +03:00
Ilya Gorbunov
32fc131d62 Rename jvm actuals from Numbers to NumbersJVM
Rename multifile facade to from MathKt to NumbersKt to avoid confusion
with kotlin.math.MathKt
2019-07-08 19:09:32 +03:00
Steven Schäfer
da8fb3a195 JVM_IR: Respect -Xno-param-assertions 2019-07-08 17:48:33 +02:00
Steven Schäfer
dd20b74030 Split GenerateNotNullAssertionsTests into standard box and bytecode tests 2019-07-08 17:48:33 +02:00
Simon Ogorodnik
dfd0042a5b Do not create single element list if only one candidate 2019-07-08 16:59:50 +03:00
Mikhail Glukhikh
f434248cb7 FIR property getter: take return type from property even if it's error 2019-07-08 16:59:45 +03:00
Mikhail Glukhikh
d96c66adac FIR: partially implement invoke resolution 2019-07-08 16:59:37 +03:00
Toshiaki Kameyama
2ca0056cd0 ReplaceGuardClause inspection: check contracts availability 2019-07-08 16:36:19 +03:00
Toshiaki Kameyama
8cbcb66197 ReplaceGuardClause inspection: don't report when argument is not String 2019-07-08 16:36:18 +03:00
Toshiaki Kameyama
90b0ea73dc Add inspection for check/require/checkNotNull/requireNotNull
#KT-30640 Fixed
#KT-22412 Fixed
2019-07-08 16:36:18 +03:00
Toshiaki Kameyama
64780293d3 "Redundant visibility modifier" inspection: don't report for property getter
#KT-32347 Fixed
2019-07-08 16:14:35 +03:00
Ilya Chernikov
a96a938f87 Fix creating of the script definition from legacy template
adding classpath needed to load template and related class to the
appropriate host configuration
fixes tests
2019-07-08 13:20:06 +02:00
Dmitry Gridin
d3810bfcae Add operator modifier by inspection on idea module 2019-07-08 13:03:22 +03:00
Dmitry Gridin
795dcfa8ff Minor: clean up some quickfixes & refactorings 2019-07-08 13:03:22 +03:00
Yan Zhulanow
9ba7907b81 Fix compatibility issues with third-party plugins
This commit fixes compatibility with these plugins:
1. com.wuhao.code.check:1.4.5
2. net.lagerwey.cucumber-kotlin:1.1.1
3. cat.helm.clean:0.1.1-SNAPSHOT
4. no.tornado.tornadofx.idea:1.7.17.2
5. com.gmail.blueboxware.libgdxplugin:1.20
2019-07-08 16:25:20 +09:00
Yan Zhulanow
36e1149e51 Light classes: Fix getTextOffset() and getTextRange() for property accessors
Before this commit, getTextOffset() and getTextRange() coming from the super class, returned numbers for the property, not for its accessor. This commit fixes the inconsistency.
2019-07-08 16:25:20 +09:00
Yan Zhulanow
7078302e6c Light classes: Fix getTextOffset() for identifiers
Before this commit, getTextOffset() and getTextRange() implementations were inconsistent.
2019-07-08 16:25:19 +09:00
Yan Zhulanow
0f4085066f Debugger: Do not assume we are inside the class body when in '}' (KT-15259) 2019-07-08 16:25:19 +09:00
Yan Zhulanow
a8efb349ed Debugger, minor: Remove debugger labels in dispatch receivers
In anonymous classes/lambdas the debug name becomes something like 'this@<anonymous>' that doesn't make much sense to the user.
It's more correct to show just 'this'.
2019-07-08 16:25:19 +09:00
Yan Zhulanow
8f20f0b963 Debugger: Do not calculate default source file if an alternative one is available 2019-07-08 16:25:19 +09:00
Yan Zhulanow
d45bbaabcd Debugger: Fix missing NOPs in optimized Unit.INSTANCE calls (KT-31702) 2019-07-08 16:25:19 +09:00
Ivan Gavrilovic
f60bf5cb97 KT-31127: register only generated Java sources to AGP
When adding generated Java sources to AGP using Variant API,
add only Java sources. This was already done in
a6ae4494167c9d4cca23995457c59fb2daedad39 for Java projects, and this
commit fixes the same issue for Android projects.

Test: Kapt3Android33IT.testKotlinProcessorUsingFiler
2019-07-08 16:25:18 +09:00
Jiaxiang Chen
2c102ecd57 Replicate old backend's naming logic for captured receiver parameter and extension receiver parameters.
Context for determine if a value parameter is captured from outer
context is not directly available after lowering, hence introduce a new
IrDeclarationOrigin for captured receiver parameter to avoid duplicate
calculation.
2019-07-08 16:25:18 +09:00
Yan Zhulanow
9760c156a4 Debugger: Fix breakpoints on if/loops with constant conditions (KT-14421) 2019-07-08 16:25:18 +09:00
Yan Zhulanow
6fc801afd2 Debugger: Make calls to LocalVariableProxyImpl.type lazy
Avoid unnecessary calls to getType() in variables and fields.
2019-07-08 16:25:18 +09:00
Yan Zhulanow
91565076e2 Debugger: Fix property accessor evaluation in scripts (KT-23526) 2019-07-08 16:25:18 +09:00
Yan Zhulanow
6686ed2e38 Evaluator: Do not report parsing error on empty block/expression (KT-11938) 2019-07-08 16:25:18 +09:00
Yan Zhulanow
6d7d524b9b Debugger: Fix 'expect fun' evaluation from common code (KT-26742) 2019-07-08 16:25:17 +09:00
Yan Zhulanow
873f4a1b08 Debugger: Accept empty code fragment contexts (KT-19556) 2019-07-08 16:25:17 +09:00
Yan Zhulanow
188ed82081 Debugger: Handle closure receivers came from outer callables properly (KT-31709) 2019-07-08 16:25:17 +09:00
Yan Zhulanow
577f32740e Debugger: Fix isDumb contract in evaluator (KT-31510) 2019-07-08 16:25:17 +09:00
Yan Zhulanow
c2f0286183 Debugger: Prefer the closest captured values 2019-07-08 16:25:17 +09:00
Yan Zhulanow
4fe6431b0f Debugger: Disable value rendering in watches by default (KT-19084) 2019-07-08 16:25:16 +09:00
Yan Zhulanow
0f3d85716c Debugger: Fix test, synthetic this variable is now hidden in Kotlin variables mode 2019-07-08 16:25:16 +09:00
Yan Zhulanow
1eab78124a Debugger: Fix private member priority test 2019-07-08 16:25:16 +09:00
Yan Zhulanow
54f78a2920 Debugger: Remove debugger-related hacks in resolution
Candidate ordering should be the same in ordinary Kotlin code and in evaluated expressions.
With the invention of 'foo_field' syntax, there is no need to do these nasty things any more.
2019-07-08 16:25:16 +09:00
Yan Zhulanow
b4f515a436 Debugger: Support Kotlin variables for inlined lambdas inside inline functions (KT-31418) 2019-07-08 16:25:16 +09:00
Yan Zhulanow
afa0bec6f6 Debugger: Change the inline depth calculation heuristics, fix debugging for inlined lambdas (KT-30919) 2019-07-08 16:25:16 +09:00
Yan Zhulanow
9c9d2b5ad4 Minor: Rename constant to match its meaning 2019-07-08 16:25:16 +09:00
Yan Zhulanow
5777592024 Debugger: Support captured values (KT-30740) 2019-07-08 16:25:15 +09:00
Yan Zhulanow
f16459df32 Pill: Support 'runtimeOnly' dependency configuration 2019-07-08 16:25:15 +09:00
Mikhail Zarechenskiy
6eefea6715 Add tests for obsolete issues
#KT-32395 Obsolete (fixed in 42a5c488)
 #KT-32388 Obsolete (fixed in f3e4c9cd)
 #KT-32271 Obsolete (fixed in 60a0cf1)
2019-07-06 10:06:04 +03:00
Svyatoslav Kuzmich
675f01ee80 [JS IR BE] Set Throwable subtype name in extendThrowable function 2019-07-05 19:31:23 +03:00
Leonid Startsev
4379780ff8 Fixed extra argument in function call after rebase 2019-07-05 18:48:51 +03:00
Leonid Startsev
80ddac64e0 Add serializers for primitive arrays to default types list 2019-07-05 18:14:34 +03:00
Ilya Chernikov
cfceeb1e8c Implement direct bindings to script properties mapping in the JSR-223 implementation
fix infrastructure and codegen parts
2019-07-05 17:02:10 +02:00
Ilya Chernikov
4940f64265 Refactor scripting infrastructure - convert usages to the new entities 2019-07-05 17:02:10 +02:00
Ilya Chernikov
80ada5113e Fix flaky test 2019-07-05 17:02:10 +02:00
Alexander Udalov
37002748c8 Do not wrap and display cause's message in compiler exceptions
In case the wrapped exception message contains some long text (bytecode,
IR, etc.), it could be displayed several times in the same stack trace,
which significantly worsened the experience of parsing such stack traces
2019-07-05 15:55:01 +02:00
Dmitry Gridin
430aed6559 Minor: clean up code 2019-07-05 19:28:02 +07:00
Toshiaki Kameyama
1f89c0f730 "Convert to sealed class" intention: don't suggest when no "class" keyword
#KT-32365 Fixed
2019-07-05 19:28:02 +07:00
Toshiaki Kameyama
9786564d75 "Remove argument name" intention: remove array literal brackets for annotation vararg argument
#KT-32318 Fixed
2019-07-05 19:18:40 +07:00
Juan Chen
d33d1913cb Not throw exception when cidr has been registered already
This is to avoid failures from some Android Studio tests depending on cidr.
2019-07-05 12:57:48 +03:00
Toshiaki Kameyama
9f6e88d571 Formatter: format around safe cast operator as? (KT-32324)
#KT-32324 Fixed
2019-07-05 12:57:48 +03:00
Toshiaki Kameyama
44e9090931 Formatter: format between type reference and 'by' keyword (KT-32277)
#KT-32277 Fixed
2019-07-05 12:57:47 +03:00
Nikolay Krasko
0b8f35c04d Revert "Register mock injection language manager in compiler"
This reverts commit 674badc6

Since idea 192.5587.17 idea has own InjectedLanguageManager registration
and fails because of duplicate.

org.junit.ComparisonFailure: exception: org.picocontainer.defaults.DuplicateComponentKeyRegistrationException: Key com.intellij.lang.injection.InjectedLanguageManager duplicated
	at com.intellij.util.pico.DefaultPicoContainer.registerComponent(DefaultPicoContainer.java:123)
	at com.intellij.util.pico.DefaultPicoContainer.registerComponentInstance(DefaultPicoContainer.java:331)
	at com.intellij.mock.MockComponentManager.registerService(MockComponentManager.java:89)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$ProjectEnvironment.registerJavaPsiFacade(KotlinCoreEnvironment.kt:162)
	at com.intellij.core.JavaCoreProjectEnvironment.<init>(JavaCoreProjectEnvironment.java:55)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreProjectEnvironment.<init>(KotlinCoreProjectEnvironment.kt:27)
	...
2019-07-05 09:08:15 +03:00
Dmitry Gridin
f9b53da0fa Attempt to fix some inspection tests 2019-07-05 13:02:52 +07:00
Roman Artemev
8a569cc698 [JS IR BE] Do not create $default stub for external function and any its fake override 2019-07-04 22:59:12 +03:00
Roman Artemev
28a108a205 [JS IR BE] Visit callable reference members in private member lowering 2019-07-04 22:59:12 +03:00
Roman Artemev
b4c68025a7 [JS IR BE] Improve error reporting 2019-07-04 22:59:12 +03:00
Vyacheslav Karpukhin
940c9e5604 192: build against IDEA 192.5587.17 2019-07-04 20:23:58 +02:00
Svyatoslav Kuzmich
a2625c7bc8 [JS IR BE] Don't render null messages in Throwable
Set message property to 'undefined' to make Error.prototype.toString
skip it
2019-07-04 18:33:23 +03:00
Svyatoslav Kuzmich
94aebd0101 [JS IR BE] Proper support for String and Any constructors
Remove workarounds from codegen
2019-07-04 17:03:47 +03:00
Roman Artemev
d7cb3e05ef [JS IR BE] Replace 32bit default String.hashcode with 64bit cityhash for UniqID
Split uniqID space into two part 63 bit each.
2019-07-04 12:49:30 +03:00
26257 changed files with 756727 additions and 320360 deletions

14
.bunch
View File

@@ -1,7 +1,9 @@
191
193
201
192
183
182_183
as33_182_183
as34_183
as35
191_192
183_191_192
as34_183_191_192
as35_191_192
as36_192
as40

5
.gitignore vendored
View File

@@ -26,6 +26,7 @@ build/
.idea/libraries/Gradle*.xml
.idea/libraries/Maven*.xml
.idea/artifacts/PILL_*.xml
.idea/artifacts/KotlinPlugin.xml
.idea/modules
.idea/runConfigurations/JPS_*.xml
.idea/runConfigurations/PILL_*.xml
@@ -47,8 +48,10 @@ build/
.idea/artifacts/kotlin_main_kts_jar.xml
.idea/artifacts/kotlin_compiler_client_embeddable_jar.xml
.idea/artifacts/kotlin_reflect_jar.xml
.idea/jarRepositories.xml
kotlin-ultimate/
node_modules/
.rpt2_cache/
libraries/tools/kotlin-test-nodejs-runner/lib/
libraries/tools/kotlin-test-js-runner/lib/
libraries/tools/kotlin-source-map-loader/lib/
local.properties

View File

@@ -1,6 +1,7 @@
<component name="ProjectDictionaryState">
<dictionary name="4u7">
<words>
<w>bintray</w>
<w>cidr</w>
<w>foldable</w>
<w>instrumentator</w>

View File

@@ -1,6 +1,11 @@
<component name="ProjectDictionaryState">
<dictionary name="dmitriy.dolovov">
<words>
<w>commonization</w>
<w>commonize</w>
<w>commonized</w>
<w>commonizer</w>
<w>commonizers</w>
<w>konan</w>
</words>
</dictionary>

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

@@ -0,0 +1,7 @@
<component name="ProjectDictionaryState">
<dictionary name="sergey.igushkin">
<words>
<w>klib</w>
</words>
</dictionary>
</component>

9
.idea/dictionaries/skuzmich.xml generated Normal file
View File

@@ -0,0 +1,9 @@
<component name="ProjectDictionaryState">
<dictionary name="skuzmich">
<words>
<w>anyref</w>
<w>ushr</w>
<w>wasm</w>
</words>
</dictionary>
</component>

View File

@@ -7,8 +7,11 @@
<w>hacky</w>
<w>impls</w>
<w>kapt</w>
<w>kotlinc</w>
<w>mutators</w>
<w>parceler</w>
<w>repl</w>
<w>testdata</w>
<w>uast</w>
<w>unbox</w>
<w>unboxed</w>

View File

@@ -99,21 +99,9 @@
<option name="problems">
<list>
<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.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>
@@ -267,7 +255,7 @@
<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="sinceBuildString" value="183.3284" />
<option name="untilBuildString" value="192.SNAPSHOT" />
</inspection_tool>
<inspection_tool class="MisspelledCompareTo" enabled="true" level="WARNING" enabled_by_default="true" />
@@ -436,6 +424,21 @@
<inspection_tool class="UnnecessaryLabelOnContinueStatement" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="UnnecessaryQualifierForThis" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="UnnecessaryUnboxing" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="UnstableApiUsage" enabled="true" level="WARNING" enabled_by_default="true">
<option name="unstableApiAnnotations">
<set>
<option value="com.google.common.annotations.Beta" />
<option value="io.reactivex.annotations.Beta" />
<option value="io.reactivex.annotations.Experimental" />
<option value="org.apache.http.annotation.Beta" />
<option value="org.jetbrains.annotations.ApiStatus.Experimental" />
<option value="org.jetbrains.annotations.ApiStatus.Internal" />
<option value="org.jetbrains.annotations.ApiStatus.ScheduledForRemoval" />
<option value="rx.annotations.Beta" />
<option value="rx.annotations.Experimental" />
</set>
</option>
</inspection_tool>
<inspection_tool class="UseOfPropertiesAsHashtable" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="UtilityClassWithPublicConstructor" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="VolatileLongOrDoubleField" enabled="true" level="WARNING" enabled_by_default="true" />

39
.idea/misc.xml generated
View File

@@ -12,46 +12,19 @@
<item index="2" class="java.lang.String" itemvalue="org.gradle.api.tasks.options.Option" />
</list>
</component>
<component name="FacetAutodetectingManager">
<autodetection-disabled>
<facet-type id="Python">
<modules>
<module name="Jet" />
</modules>
</facet-type>
</autodetection-disabled>
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="IdProvider" IDEtalkID="71A301FF1940049D6D82F12C40F1E1D5" />
<component name="JavadocGenerationManager">
<option name="OUTPUT_DIRECTORY" />
<option name="OPTION_SCOPE" value="protected" />
<option name="OPTION_HIERARCHY" value="true" />
<option name="OPTION_NAVIGATOR" value="true" />
<option name="OPTION_INDEX" value="true" />
<option name="OPTION_SEPARATE_INDEX" value="true" />
<option name="OPTION_DOCUMENT_TAG_USE" value="false" />
<option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
<option name="OPTION_DOCUMENT_TAG_VERSION" value="false" />
<option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" />
<option name="OPTION_DEPRECATED_LIST" value="true" />
<option name="OTHER_OPTIONS" value="" />
<option name="HEAP_SIZE" />
<option name="LOCALE" />
<option name="OPEN_IN_BROWSER" value="true" />
</component>
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/libraries/pom.xml" />
</list>
</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">
<list size="11">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
@@ -61,12 +34,14 @@
<item index="6" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
<item index="9" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
<item index="10" class="java.lang.String" itemvalue="com.android.annotations.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="9">
<list size="11">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="javax.validation.constraints.NotNull" />
@@ -76,6 +51,8 @@
<item index="6" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
<item index="9" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
<item index="10" class="java.lang.String" itemvalue="com.android.annotations.NonNull" />
</list>
</value>
</option>

6
.idea/vcs.xml generated
View File

@@ -1,5 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CommitMessageInspectionProfile">
<profile version="1.0">
<inspection_tool class="GrazieCommit" enabled="true" level="TYPO" enabled_by_default="true" />
<inspection_tool class="GrazieCommit" enabled="true" level="TYPO" enabled_by_default="true" />
</profile>
</component>
<component name="IssueNavigationConfiguration">
<option name="links">
<list>

File diff suppressed because it is too large Load Diff

View File

@@ -98,13 +98,13 @@ Development for some particular platform is possible after 'switching' that can
```sh
cd kotlin-project-dir
# switching to IntelliJ Idea 2018.2
bunch switch . 182
# switching to IntelliJ Idea 2019.1
bunch switch 191
```
## <a name="working-in-idea"></a> Working with the project in IntelliJ IDEA
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).
Working with the Kotlin project requires at least IntelliJ IDEA 2019.1. You can download IntelliJ IDEA 2019.1 [here](https://www.jetbrains.com/idea/download).
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.
@@ -113,7 +113,7 @@ 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 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".
At this time, you can use the latest released 1.3.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".
### Compiling and running
@@ -135,6 +135,9 @@ includeBuild('/path/to/kotlin') {
}
```
# License
Kotlin is distributed under the terms of the Apache License (Version 2.0). See [license folder](license/README.md) for details.
# Contributing
Please be sure to review Kotlin's [contributing guidelines](docs/contributing.md) to learn how to help the project.

View File

@@ -0,0 +1,82 @@
import kotlinx.benchmark.gradle.benchmark
val benchmarks_version = "0.2.0-dev-7"
buildscript {
val benchmarks_version = "0.2.0-dev-7"
repositories {
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlinx")
maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev")
} else {
maven("https://dl.bintray.com/kotlin/kotlinx")
maven("https://dl.bintray.com/kotlin/kotlin-dev")
}
}
dependencies {
classpath("org.jetbrains.kotlinx:kotlinx.benchmark.gradle:$benchmarks_version")
}
}
apply(plugin = "kotlinx.benchmark")
plugins {
java
kotlin("jvm")
}
repositories {
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlinx")
maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev")
} else {
maven("https://dl.bintray.com/kotlin/kotlinx")
maven("https://dl.bintray.com/kotlin/kotlin-dev")
}
}
dependencies {
compile(kotlinStdlib())
compile(project(":compiler:frontend"))
compile(project(":compiler:cli"))
compile(intellijCoreDep()) { includeJars("intellij-core") }
compile(jpsStandalone()) { includeJars("jps-model") }
Platform[192].orHigher {
compile(intellijPluginDep("java"))
}
compile(intellijDep()) { includeIntellijCoreJarDependencies(project) }
compile("org.jetbrains.kotlinx:kotlinx.benchmark.runtime-jvm:$benchmarks_version")
}
sourceSets {
"main" { projectDefault() }
}
benchmark {
configurations {
named("main") {
warmups = 10
iterations = 10
iterationTime = 1
iterationTimeUnit = "sec"
param("size", 1000)
}
register("fir") {
warmups = 10
iterations = 10
iterationTime = 1
iterationTimeUnit = "sec"
param("isIR", true)
param("size", 1000)
include("CommonCallsBenchmark")
//include("InferenceBaselineCallsBenchmark")
}
}
targets {
register("main")
}
}

View File

@@ -0,0 +1,19 @@
/*
* 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.benchmarks
import org.openjdk.jmh.annotations.Param
import org.openjdk.jmh.annotations.Scope
import org.openjdk.jmh.annotations.State
@State(Scope.Benchmark)
abstract class AbstractInferenceBenchmark : AbstractSimpleFileBenchmark() {
@Param("true", "false")
private var useNI: Boolean = false
override val useNewInference: Boolean
get() = useNI
}

View File

@@ -0,0 +1,213 @@
/*
* 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.benchmarks
import com.intellij.openapi.Disposable
import com.intellij.openapi.extensions.Extensions
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.CharsetToolkit
import com.intellij.psi.PsiElementFinder
import com.intellij.psi.PsiFileFactory
import com.intellij.psi.impl.PsiFileFactoryImpl
import com.intellij.psi.search.GlobalSearchScope
import com.intellij.testFramework.LightVirtualFile
import org.jetbrains.kotlin.analyzer.ModuleInfo
import org.jetbrains.kotlin.asJava.finder.JavaElementFinder
import org.jetbrains.kotlin.builtins.jvm.JvmBuiltIns
import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.cli.jvm.compiler.*
import org.jetbrains.kotlin.cli.jvm.config.addJvmClasspathRoot
import org.jetbrains.kotlin.config.*
import org.jetbrains.kotlin.context.SimpleGlobalContext
import org.jetbrains.kotlin.context.withModule
import org.jetbrains.kotlin.context.withProject
import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl
import org.jetbrains.kotlin.diagnostics.Severity
import org.jetbrains.kotlin.fir.FirSession
import org.jetbrains.kotlin.fir.builder.RawFirBuilder
import org.jetbrains.kotlin.fir.java.FirJavaModuleBasedSession
import org.jetbrains.kotlin.fir.java.FirLibrarySession
import org.jetbrains.kotlin.fir.java.FirProjectSessionProvider
import org.jetbrains.kotlin.fir.resolve.firProvider
import org.jetbrains.kotlin.fir.resolve.impl.FirProviderImpl
import org.jetbrains.kotlin.fir.resolve.transformers.FirTotalResolveTransformer
import org.jetbrains.kotlin.idea.KotlinLanguage
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.platform.TargetPlatform
import org.jetbrains.kotlin.platform.jvm.JvmPlatforms
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.resolve.PlatformDependentAnalyzerServices
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatformAnalyzerServices
import org.jetbrains.kotlin.storage.ExceptionTracker
import org.jetbrains.kotlin.storage.LockBasedStorageManager
import org.jetbrains.kotlin.storage.StorageManager
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.io.File
private fun createFile(shortName: String, text: String, project: Project): KtFile {
val virtualFile = object : LightVirtualFile(shortName, KotlinLanguage.INSTANCE, text) {
override fun getPath(): String {
//TODO: patch LightVirtualFile
return "/" + name
}
}
virtualFile.charset = CharsetToolkit.UTF8_CHARSET
val factory = PsiFileFactory.getInstance(project) as PsiFileFactoryImpl
return factory.trySetupPsiForFile(virtualFile, KotlinLanguage.INSTANCE, true, false) as KtFile
}
private val JDK_PATH = File("${System.getProperty("java.home")!!}/lib/rt.jar")
private val RUNTIME_JAR = File(System.getProperty("kotlin.runtime.path") ?: "dist/kotlinc/lib/kotlin-runtime.jar")
private val LANGUAGE_FEATURE_SETTINGS =
LanguageVersionSettingsImpl(
LanguageVersion.KOTLIN_1_3, ApiVersion.KOTLIN_1_3,
specificFeatures = mapOf(LanguageFeature.NewInference to LanguageFeature.State.ENABLED)
)
private fun newConfiguration(useNewInference: Boolean): CompilerConfiguration {
val configuration = CompilerConfiguration()
configuration.put(CommonConfigurationKeys.MODULE_NAME, "benchmark")
configuration.put(CLIConfigurationKeys.INTELLIJ_PLUGIN_ROOT, "../idea/resources")
configuration.addJvmClasspathRoot(JDK_PATH)
configuration.addJvmClasspathRoot(RUNTIME_JAR)
configuration.put(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE)
val newInferenceState = if (useNewInference) LanguageFeature.State.ENABLED else LanguageFeature.State.DISABLED
configuration.languageVersionSettings = LanguageVersionSettingsImpl(
LanguageVersion.KOTLIN_1_3, ApiVersion.KOTLIN_1_3,
specificFeatures = mapOf(
LanguageFeature.NewInference to newInferenceState
)
)
return configuration
}
@State(Scope.Benchmark)
abstract class AbstractSimpleFileBenchmark {
private var myDisposable: Disposable = Disposable { }
private lateinit var env: KotlinCoreEnvironment
private lateinit var file: KtFile
@Param("true", "false")
protected var isIR: Boolean = false
protected open val useNewInference get() = isIR
@Setup(Level.Trial)
fun setUp() {
if (isIR && !useNewInference) error("Invalid configuration")
env = KotlinCoreEnvironment.createForTests(
myDisposable,
newConfiguration(useNewInference),
EnvironmentConfigFiles.JVM_CONFIG_FILES
)
if (isIR) {
Extensions.getArea(env.project)
.getExtensionPoint(PsiElementFinder.EP_NAME)
.unregisterExtension(JavaElementFinder::class.java)
}
file = createFile(
"test.kt",
buildText(),
env.project
)
}
protected fun analyzeGreenFile(bh: Blackhole) {
if (isIR) {
analyzeGreenFileIr(bh)
} else {
analyzeGreenFileFrontend(bh)
}
}
private fun analyzeGreenFileFrontend(bh: Blackhole) {
val tracker = ExceptionTracker()
val storageManager: StorageManager =
LockBasedStorageManager.createWithExceptionHandling("benchmarks", tracker)
val context = SimpleGlobalContext(storageManager, tracker)
val module =
ModuleDescriptorImpl(
Name.special("<benchmark>"), storageManager,
JvmBuiltIns(storageManager, JvmBuiltIns.Kind.FROM_DEPENDENCIES)
)
val moduleContext = context.withProject(env.project).withModule(module)
val result = TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(
moduleContext.project,
listOf(file),
NoScopeRecordCliBindingTrace(),
env.configuration,
{ scope -> JvmPackagePartProvider(LANGUAGE_FEATURE_SETTINGS, scope) }
)
assert(result.bindingContext.diagnostics.none { it.severity == Severity.ERROR })
bh.consume(result.shouldGenerateCode)
}
private fun analyzeGreenFileIr(bh: Blackhole) {
val scope = GlobalSearchScope.filesScope(env.project, listOf(file.virtualFile))
.uniteWith(TopDownAnalyzerFacadeForJVM.AllJavaSourcesInProjectScope(env.project))
val session = createSession(env, scope)
val builder = RawFirBuilder(session, stubMode = false)
val totalTransformer = FirTotalResolveTransformer()
val firFile = builder.buildFirFile(file).also((session.firProvider as FirProviderImpl)::recordFile)
for (transformer in totalTransformer.transformers) {
transformer.transformFile(firFile, null)
}
bh.consume(firFile.hashCode())
}
protected abstract fun buildText(): String
}
fun createSession(
environment: KotlinCoreEnvironment,
sourceScope: GlobalSearchScope,
librariesScope: GlobalSearchScope = GlobalSearchScope.notScope(sourceScope)
): FirSession {
val moduleInfo = FirTestModuleInfo()
val project = environment.project
val provider = FirProjectSessionProvider(project)
return FirJavaModuleBasedSession(moduleInfo, provider, sourceScope).also {
createSessionForDependencies(provider, moduleInfo, librariesScope, environment)
}
}
private fun createSessionForDependencies(
provider: FirProjectSessionProvider,
moduleInfo: FirTestModuleInfo,
librariesScope: GlobalSearchScope,
environment: KotlinCoreEnvironment
) {
val dependenciesInfo = FirTestModuleInfo()
moduleInfo.dependencies.add(dependenciesInfo)
FirLibrarySession.create(
dependenciesInfo, provider, librariesScope, environment.project,
environment.createPackagePartProvider(librariesScope)
)
}
class FirTestModuleInfo(
override val name: Name = Name.identifier("TestModule"),
val dependencies: MutableList<ModuleInfo> = mutableListOf(),
override val platform: TargetPlatform = JvmPlatforms.unspecifiedJvmPlatform,
override val analyzerServices: PlatformDependentAnalyzerServices = JvmPlatformAnalyzerServices
) : ModuleInfo {
override fun dependencies(): List<ModuleInfo> = dependencies
}

View File

@@ -0,0 +1,33 @@
/*
* 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.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class CommonCallsBenchmark : AbstractSimpleFileBenchmark(){
@Param("1", "10", "100", "1000", "3000", "5000", "7000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun foo(): Int = 1
|
|fun bar() {
|${(1..size).joinToString("\n") { " foo()" }}
|}
""".trimMargin()
}

View File

@@ -0,0 +1,42 @@
/*
* 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.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class ComplexDataFlowBenchmark : AbstractSimpleFileBenchmark(){
@Param("1", "100", "1000", "3000", "5000", "7000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|
|fun bar(x: Any?) {
| var y = x
|${(1..size).joinToString("\n") {
"""
|if (x is String) {
| y = x
|}
|y = 1
""".trimMargin()
}}
|}
""".trimMargin()
}

View File

@@ -0,0 +1,47 @@
/*
* 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.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class ControlFlowOperators : AbstractSimpleFileBenchmark(){
@Param("1", "100", "1000", "3000", "5000", "7000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|var isTrue = true
|var s = ""
|fun bar() {
|${(1..size).joinToString("\n") {
"""
|var x$it: String
|
|when (s) {
| "A" -> { x$it = "1" }
| "B" -> { x$it = "2" }
| else -> { x$it = "3" }
|}
|
|while (isTrue) {
| x$it.hashCode()
|}
""".trimMargin()
}}
|}
""".trimMargin()
}

View File

@@ -0,0 +1,33 @@
/*
* 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.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class InferenceBaselineCallsBenchmark : AbstractSimpleFileBenchmark() {
@Param("1", "10", "100", "1000", "5000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun foo(x: Int): Int = 1
|fun expectsInt(x: Int) {}
|fun bar(v: Int) {
|${(1..size).map { " expectsInt(foo(v))" }.joinToString("\n")}
|}
""".trimMargin()
}

View File

@@ -0,0 +1,33 @@
/*
* 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.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class InferenceExplicitArgumentsCallsBenchmark : AbstractInferenceBenchmark() {
@Param("1", "10", "100", "1000", "5000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun <T> foo(x: T): Int = 1
|fun expectsInt(x: Int) {}
|fun bar(v: Int) {
|${(1..size).map { " expectsInt(foo<Int>(v))" }.joinToString("\n")}
|}
""".trimMargin()
}

View File

@@ -0,0 +1,33 @@
/*
* 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.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class InferenceForInApplicableCandidate : AbstractInferenceBenchmark() {
@Param("1", "10", "100", "1000", "5000", "10000")
private var size: Int = 1
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun <T : Comparable<T>> foo(x: MutableList<T>) {}
|fun <T> foo(x: MutableList<T>, y: (T, T) -> Int) {}
|fun bar(x: MutableList<Any>) {
|${(1..size).joinToString("\n") { " foo(x) { a, b -> 1 }" }}
|}
""".trimMargin()
}

View File

@@ -0,0 +1,33 @@
/*
* 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.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class InferenceFromArgumentCallsBenchmark : AbstractInferenceBenchmark() {
@Param("1", "10", "100", "1000", "5000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun <T> foo(x: T): Int = 1
|fun expectsInt(x: Int) {}
|fun bar(v: Int) {
|${(1..size).map { " expectsInt(foo(v))" }.joinToString("\n")}
|}
""".trimMargin()
}

View File

@@ -0,0 +1,33 @@
/*
* 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.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class InferenceFromReturnTypeCallsBenchmark : AbstractInferenceBenchmark() {
@Param("1", "10", "100", "1000", "5000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun <T> foo(x: Int): T = null!!
|fun expectsInt(x: Int) {}
|fun bar(v: Int) {
|${(1..size).map { " expectsInt(foo(v))" }.joinToString("\n")}
|}
""".trimMargin()
}

View File

@@ -0,0 +1,33 @@
/*
* 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.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class IntArrayPlusBenchmark : AbstractSimpleFileBenchmark() {
@Param("1", "10", "100", "1000", "3000", "5000", "7000", "10000")
private var size: Int = 0
@Benchmark
//@Fork(jvmArgsAppend = ["-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"])
fun benchmark(bh: Blackhole) {
if (!isIR) error("Doesn't make sense to run it on old frontend on buildserver")
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun bar(x: IntArray, y: IntArray) {
|${(1..size).joinToString("\n") { " x + y" }}
|}
""".trimMargin()
}

View File

@@ -0,0 +1,31 @@
/*
* 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.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class ManyValsBenchmark : AbstractSimpleFileBenchmark(){
@Param("1", "100", "1000", "3000", "5000", "7000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun bar() {
|${(1..size).joinToString("\n") { " val x$it: Int = 1" }}
|}
""".trimMargin()
}

View File

@@ -0,0 +1,31 @@
/*
* 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.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class ManyVarsBenchmark : AbstractSimpleFileBenchmark(){
@Param("1", "100", "1000", "3000", "5000", "7000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun bar() {
|${(1..size).joinToString("\n") { " var x$it: Int = 1" }}
|}
""".trimMargin()
}

View File

@@ -0,0 +1,35 @@
/*
* 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.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class SimpleDataFlowBenchmark : AbstractSimpleFileBenchmark(){
@Param("1", "100", "1000", "3000", "5000", "7000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun foo(x: Int): Int = 1
|var x = 1
|fun bar(v: Int) {
|${(1..size).joinToString("\n") { " x = foo(v)" }}
|}
""".trimMargin()
}

View File

@@ -13,6 +13,7 @@ dependencies {
compileOnly(project(":compiler:frontend.java"))
compileOnly(project(":js:js.serializer"))
compileOnly(project(":js:js.frontend"))
compileOnly(project(":kotlin-util-klib-metadata"))
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
compileOnly(intellijDep()) { includeJars("asm-all", "trove4j", "util", rootProject = rootProject) }
compileOnly(project(":kotlin-reflect-api"))
@@ -22,8 +23,9 @@ dependencies {
testCompile(commonDep("junit:junit"))
testCompile(protobufFull())
testCompile(kotlinStdlib())
testCompileOnly(intellijDep()) { includeJars("openapi") }
Platform[193].orLower {
testCompileOnly(intellijDep()) { includeJars("openapi", rootProject = rootProject) }
}
testRuntime(project(":kotlin-reflect"))
}

File diff suppressed because it is too large Load Diff

View File

@@ -22,9 +22,11 @@ import org.jetbrains.kotlin.utils.sure
import java.io.File
open class GeneratedFile(
val sourceFiles: Collection<File>,
sourceFiles: Collection<File>,
val outputFile: File
)
) {
val sourceFiles = sourceFiles.sortedBy { it.path }
}
class GeneratedJvmClass (
sourceFiles: Collection<File>,

View File

@@ -18,6 +18,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.IrTranslationResultValue
import org.jetbrains.kotlin.incremental.js.TranslationResultValue
import org.jetbrains.kotlin.incremental.storage.*
import org.jetbrains.kotlin.metadata.ProtoBuf
@@ -28,6 +29,7 @@ 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.SerializerExtensionProtocol
import org.jetbrains.kotlin.serialization.deserialization.getClassId
import org.jetbrains.kotlin.serialization.js.JsSerializerProtocol
import java.io.DataInput
@@ -36,10 +38,12 @@ import java.io.File
open class IncrementalJsCache(
cachesDir: File,
pathConverter: FileToPathConverter
pathConverter: FileToPathConverter,
serializerProtocol: SerializerExtensionProtocol
) : AbstractIncrementalCache<FqName>(cachesDir, pathConverter) {
companion object {
private const val TRANSLATION_RESULT_MAP = "translation-result"
private const val IR_TRANSLATION_RESULT_MAP = "ir-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"
@@ -47,9 +51,12 @@ open class IncrementalJsCache(
fun hasHeaderFile(cachesDir: File) = File(cachesDir, HEADER_FILE_NAME).exists()
}
private val protoData = ProtoDataProvider(serializerProtocol)
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, pathConverter))
private val translationResults = registerMap(TranslationResultMap(TRANSLATION_RESULT_MAP.storageFile, pathConverter, protoData))
private val irTranslationResults = registerMap(IrTranslationResultMap(IR_TRANSLATION_RESULT_MAP.storageFile, pathConverter))
private val inlineFunctions = registerMap(InlineFunctionsMap(INLINE_FUNCTIONS.storageFile, pathConverter))
private val packageMetadata = registerMap(PackageMetadataMap(PACKAGE_META_FILE.storageFile))
@@ -83,8 +90,8 @@ open class IncrementalJsCache(
dirtySources.remove(srcFile)
val (binaryMetadata, binaryAst, inlineData) = data
val oldProtoMap = translationResults[srcFile]?.metadata?.let { getProtoData(srcFile, it) } ?: emptyMap()
val newProtoMap = getProtoData(srcFile, binaryMetadata)
val oldProtoMap = translationResults[srcFile]?.metadata?.let { protoData(srcFile, it) } ?: emptyMap()
val newProtoMap = protoData(srcFile, binaryMetadata)
for ((classId, protoData) in newProtoMap) {
registerOutputForFile(srcFile, classId.asSingleFqName())
@@ -108,6 +115,11 @@ open class IncrementalJsCache(
for ((packageName, metadata) in incrementalResults.packageMetadata) {
packageMetadata.put(packageName, metadata)
}
for ((srcFile, irData) in incrementalResults.irFileData) {
val (fileData, symbols, types, strings, declarations, bodies, fqn) = irData
irTranslationResults.put(srcFile, fileData, symbols, types, strings, declarations, bodies, fqn)
}
}
private fun registerOutputForFile(srcFile: File, name: FqName) {
@@ -118,6 +130,7 @@ open class IncrementalJsCache(
override fun clearCacheForRemovedClasses(changesCollector: ChangesCollector) {
dirtySources.forEach {
translationResults.remove(it, changesCollector)
irTranslationResults.remove(it)
inlineFunctions.remove(it)
}
removeAllFromClassStorage(dirtyOutputClassesMap.getDirtyOutputClasses(), changesCollector)
@@ -140,6 +153,16 @@ open class IncrementalJsCache(
put(fqNameString, packageMetadata[fqNameString]!!)
}
}
fun nonDirtyIrParts(): Map<File, IrTranslationResultValue> =
hashMapOf<File, IrTranslationResultValue>().apply {
for (file in irTranslationResults.keys()) {
if (file !in dirtySources) {
put(file, irTranslationResults[file]!!)
}
}
}
}
private object TranslationResultValueExternalizer : DataExternalizer<TranslationResultValue> {
@@ -173,7 +196,8 @@ private object TranslationResultValueExternalizer : DataExternalizer<Translation
private class TranslationResultMap(
storageFile: File,
private val pathConverter: FileToPathConverter
private val pathConverter: FileToPathConverter,
private val protoData: ProtoDataProvider
) :
BasicStringMap<TranslationResultValue>(storageFile, TranslationResultValueExternalizer) {
override fun dumpValue(value: TranslationResultValue): String =
@@ -193,7 +217,7 @@ private class TranslationResultMap(
fun remove(sourceFile: File, changesCollector: ChangesCollector) {
val path = pathConverter.toPath(sourceFile)
val protoBytes = storage[path]!!.metadata
val protoMap = getProtoData(sourceFile, protoBytes)
val protoMap = protoData(sourceFile, protoBytes)
for ((_, protoData) in protoMap) {
changesCollector.collectProtoChanges(oldData = protoData, newData = null)
@@ -202,6 +226,104 @@ private class TranslationResultMap(
}
}
private object IrTranslationResultValueExternalizer : DataExternalizer<IrTranslationResultValue> {
override fun save(output: DataOutput, value: IrTranslationResultValue) {
output.writeArray(value.fileData)
output.writeArray(value.symbols)
output.writeArray(value.types)
output.writeArray(value.strings)
output.writeArray(value.declarations)
output.writeArray(value.bodies)
output.writeArray(value.fqn)
}
private fun DataOutput.writeArray(array: ByteArray) {
writeInt(array.size)
write(array)
}
private fun DataInput.readArray(): ByteArray {
val dataSize = readInt()
val filedata = ByteArray(dataSize)
readFully(filedata)
return filedata
}
override fun read(input: DataInput): IrTranslationResultValue {
val fileData = input.readArray()
val symbols = input.readArray()
val types = input.readArray()
val strings = input.readArray()
val declarations = input.readArray()
val bodies = input.readArray()
val fqn = input.readArray()
return IrTranslationResultValue(fileData, symbols, types, strings, declarations, bodies, fqn)
}
}
private class IrTranslationResultMap(
storageFile: File,
private val pathConverter: FileToPathConverter
) :
BasicStringMap<IrTranslationResultValue>(storageFile, IrTranslationResultValueExternalizer) {
override fun dumpValue(value: IrTranslationResultValue): String =
"Filedata: ${value.fileData.md5()}, " +
"Symbols: ${value.symbols.md5()}, " +
"Types: ${value.types.md5()}, " +
"Strings: ${value.strings.md5()}, " +
"Declarations: ${value.declarations.md5()}, " +
"Bodies: ${value.bodies.md5()}"
fun put(
sourceFile: File,
newFiledata: ByteArray,
newSymbols: ByteArray,
newTypes: ByteArray,
newStrings: ByteArray,
newDeclarations: ByteArray,
newBodies: ByteArray,
fqn: ByteArray
) {
storage[pathConverter.toPath(sourceFile)] =
IrTranslationResultValue(newFiledata, newSymbols, newTypes, newStrings, newDeclarations, newBodies, fqn)
}
operator fun get(sourceFile: File): IrTranslationResultValue? =
storage[pathConverter.toPath(sourceFile)]
fun keys(): Collection<File> =
storage.keys.map { pathConverter.toFile(it) }
fun remove(sourceFile: File) {
val path = pathConverter.toPath(sourceFile)
storage.remove(path)
}
}
private class ProtoDataProvider(private val serializerProtocol: SerializerExtensionProtocol) {
operator fun invoke(sourceFile: File, metadata: ByteArray): Map<ClassId, ProtoData> {
val classes = hashMapOf<ClassId, ProtoData>()
val proto = ProtoBuf.PackageFragment.parseFrom(metadata, serializerProtocol.extensionRegistry)
val nameResolver = NameResolverImpl(proto.strings, proto.qualifiedNames)
proto.class_List.forEach {
val classId = nameResolver.getClassId(it.fqName)
classes[classId] = ClassProtoData(it, nameResolver)
}
proto.`package`.apply {
val packageNameId = getExtensionOrNull(serializerProtocol.packageFqName)
val packageFqName = packageNameId?.let { FqName(nameResolver.getPackageFqName(it)) } ?: FqName.ROOT
val packagePartClassId = ClassId(packageFqName, Name.identifier(sourceFile.nameWithoutExtension.capitalize() + "Kt"))
classes[packagePartClassId] = PackagePartProtoData(this, nameResolver, packageFqName)
}
return classes
}
}
// TODO: remove this method once AbstractJsProtoComparisonTest is fixed
fun getProtoData(sourceFile: File, metadata: ByteArray): Map<ClassId, ProtoData> {
val classes = hashMapOf<ClassId, ProtoData>()
val proto = ProtoBuf.PackageFragment.parseFrom(metadata, JsSerializerProtocol.extensionRegistry)

View File

@@ -55,10 +55,13 @@ class JavaClassesSerializerExtension : KotlinSerializerExtensionBase(BuiltInSeri
}
}
override fun serializeFunction(descriptor: FunctionDescriptor,
proto: ProtoBuf.Function.Builder,
childSerializer: DescriptorSerializer) {
super.serializeFunction(descriptor, proto, childSerializer)
override fun serializeFunction(
descriptor: FunctionDescriptor,
proto: ProtoBuf.Function.Builder,
versionRequirementTable: MutableVersionRequirementTable?,
childSerializer: DescriptorSerializer
) {
super.serializeFunction(descriptor, proto, versionRequirementTable, childSerializer)
if (descriptor.visibility == JavaVisibilities.PACKAGE_VISIBILITY) {
proto.setExtension(JavaClassProtoBuf.isPackagePrivateMethod, true)
}

View File

@@ -75,12 +75,13 @@ open class LookupStorage(
}
@Synchronized
fun addAll(lookups: Set<Map.Entry<LookupSymbol, Collection<String>>>, allPaths: Set<String>) {
val pathToId = allPaths.keysToMap { addFileIfNeeded(File(it)) }
fun addAll(lookups: MultiMap<LookupSymbol, String>, allPaths: Set<String>) {
val pathToId = allPaths.sorted().keysToMap { addFileIfNeeded(File(it)) }
for ((lookupSymbol, paths) in lookups) {
for (lookupSymbol in lookups.keySet().sorted()) {
val key = LookupSymbolKey(lookupSymbol.name, lookupSymbol.scope)
val fileIds = paths.mapTo(HashSet<Int>()) { pathToId[it]!! }
val paths = lookups[lookupSymbol]!!
val fileIds = paths.mapTo(TreeSet()) { pathToId[it]!! }
fileIds.addAll(lookupMap[key] ?: emptySet())
lookupMap[key] = fileIds
}
@@ -227,4 +228,11 @@ class LookupTrackerImpl(private val delegate: LookupTracker) : LookupTracker {
}
}
data class LookupSymbol(val name: String, val scope: String)
data class LookupSymbol(val name: String, val scope: String) : Comparable<LookupSymbol> {
override fun compareTo(other: LookupSymbol): Int {
val scopeCompare = scope.compareTo(other.scope)
if (scopeCompare != 0) return scopeCompare
return name.compareTo(other.name)
}
}

View File

@@ -30,6 +30,7 @@ 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 org.jetbrains.kotlin.utils.keysToMap
import java.io.File
import java.util.*
import kotlin.collections.HashSet
@@ -126,7 +127,7 @@ fun LookupStorage.update(
removeLookupsFrom(filesToCompile.asSequence() + removedFiles.asSequence())
addAll(lookupTracker.lookups.entrySet(), lookupTracker.pathInterner.values)
addAll(lookupTracker.lookups, lookupTracker.pathInterner.values)
}
data class DirtyData(

View File

@@ -21,4 +21,7 @@ class IncrementalDataProviderFromCache(private val cache: IncrementalJsCache) :
override val packageMetadata: Map<String, ByteArray>
get() = cache.packageMetadata()
override val serializedIrFiles: Map<File, IrTranslationResultValue>
get() = cache.nonDirtyIrParts()
}

View File

@@ -30,9 +30,9 @@ import org.jetbrains.kotlin.serialization.deserialization.ProtoEnumFlags
import java.util.*
data class Difference(
val isClassAffected: Boolean = false,
val areSubclassesAffected: Boolean = false,
val changedMembersNames: Set<String> = emptySet()
val isClassAffected: Boolean = false,
val areSubclassesAffected: Boolean = false,
val changedMembersNames: Set<String> = emptySet()
)
sealed class ProtoData
@@ -49,14 +49,17 @@ fun ProtoMapValue.toProtoData(packageFqName: FqName): ProtoData =
}
internal val MessageLite.isPrivate: Boolean
get() = Visibilities.isPrivate(ProtoEnumFlags.visibility(
get() = Visibilities.isPrivate(
ProtoEnumFlags.visibility(
when (this) {
is ProtoBuf.Constructor -> Flags.VISIBILITY.get(flags)
is ProtoBuf.Function -> Flags.VISIBILITY.get(flags)
is ProtoBuf.Property -> Flags.VISIBILITY.get(flags)
is ProtoBuf.TypeAlias -> Flags.VISIBILITY.get(flags)
else -> error("Unknown message: $this")
}))
}
)
)
private fun MessageLite.name(nameResolver: NameResolver): String {
return when (this) {
@@ -79,9 +82,21 @@ abstract class DifferenceCalculator {
val result = hashSetOf<String>()
val oldMap =
oldList.groupBy { it.getHashCode({ compareObject.oldGetIndexOfString(it) }, { compareObject.oldGetIndexOfClassId(it) }) }
oldList.groupBy {
it.getHashCode(
compareObject::oldGetIndexOfString,
compareObject::oldGetIndexOfClassId,
compareObject::oldGetTypeById
)
}
val newMap =
newList.groupBy { it.getHashCode({ compareObject.newGetIndexOfString(it) }, { compareObject.newGetIndexOfClassId(it) }) }
newList.groupBy {
it.getHashCode(
compareObject::newGetIndexOfString,
compareObject::newGetIndexOfClassId,
compareObject::newGetTypeById
)
}
val hashes = oldMap.keys + newMap.keys
for (hash in hashes) {
@@ -100,8 +115,8 @@ abstract class DifferenceCalculator {
}
private fun calcDifferenceForEqualHashes(
oldList: List<MessageLite>,
newList: List<MessageLite>
oldList: List<MessageLite>,
newList: List<MessageLite>
): Collection<String> {
val result = hashSetOf<String>()
val newSet = HashSet(newList)
@@ -110,8 +125,7 @@ abstract class DifferenceCalculator {
val newMember = newSet.firstOrNull { compareObject.checkEquals(oldMember, it) }
if (newMember != null) {
newSet.remove(newMember)
}
else {
} else {
result.add(oldMember.name(compareObject.oldNameResolver))
}
}
@@ -124,20 +138,20 @@ abstract class DifferenceCalculator {
}
protected fun calcDifferenceForNames(
oldList: List<Int>,
newList: List<Int>
oldList: List<Int>,
newList: List<Int>
): Collection<String> {
val oldNames = oldList.map { compareObject.oldNameResolver.getString(it) }.toSet()
val newNames = newList.map { compareObject.newNameResolver.getString(it) }.toSet()
return oldNames.union(newNames) - oldNames.intersect(newNames)
}
private fun MessageLite.getHashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int): Int {
private fun MessageLite.getHashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) -> Int, typeTable: (Int) -> ProtoBuf.Type): Int {
return when (this) {
is ProtoBuf.Constructor -> hashCode(stringIndexes, fqNameIndexes)
is ProtoBuf.Function -> hashCode(stringIndexes, fqNameIndexes)
is ProtoBuf.Property -> hashCode(stringIndexes, fqNameIndexes)
is ProtoBuf.TypeAlias -> hashCode(stringIndexes, fqNameIndexes)
is ProtoBuf.Constructor -> hashCode(stringIndexes, fqNameIndexes, typeTable)
is ProtoBuf.Function -> hashCode(stringIndexes, fqNameIndexes, typeTable)
is ProtoBuf.Property -> hashCode(stringIndexes, fqNameIndexes, typeTable)
is ProtoBuf.TypeAlias -> hashCode(stringIndexes, fqNameIndexes, typeTable)
else -> error("Unknown message: $this")
}
}
@@ -154,10 +168,15 @@ abstract class DifferenceCalculator {
}
class DifferenceCalculatorForClass(
private val oldData: ClassProtoData,
private val newData: ClassProtoData
private val oldData: ClassProtoData,
private val newData: ClassProtoData
) : DifferenceCalculator() {
override val compareObject = ProtoCompareGenerated(oldData.nameResolver, newData.nameResolver)
override val compareObject = ProtoCompareGenerated(
oldNameResolver = oldData.nameResolver,
newNameResolver = newData.nameResolver,
oldTypeTable = oldData.proto.typeTableOrNull,
newTypeTable = newData.proto.typeTableOrNull
)
override fun difference(): Difference {
val (oldProto, oldNameResolver) = oldData
@@ -220,11 +239,8 @@ class DifferenceCalculatorForClass(
// when (x as Base) { is Impl -> ... }
areSubclassesAffected = true
}
ProtoBufClassKind.TYPE_TABLE -> {
// TODO
}
ProtoCompareGenerated.ProtoBufClassKind.VERSION_REQUIREMENT_LIST,
ProtoCompareGenerated.ProtoBufClassKind.VERSION_REQUIREMENT_TABLE -> {
ProtoBufClassKind.VERSION_REQUIREMENT_LIST,
ProtoBufClassKind.VERSION_REQUIREMENT_TABLE -> {
// TODO
}
ProtoBufClassKind.FLAGS,
@@ -238,7 +254,7 @@ class DifferenceCalculatorForClass(
}
ProtoBufClassKind.JVM_EXT_CLASS_MODULE_NAME,
ProtoBufClassKind.JS_EXT_CLASS_CONTAINING_FILE_ID -> {
// TODO
// TODO
}
ProtoBufClassKind.JVM_EXT_CLASS_LOCAL_VARIABLE_LIST -> {
// Not affected, local variables are not accessible outside of a file
@@ -250,9 +266,13 @@ class DifferenceCalculatorForClass(
ProtoBufClassKind.BUILT_INS_EXT_CLASS_ANNOTATION_LIST -> {
isClassAffected = true
}
ProtoCompareGenerated.ProtoBufClassKind.JVM_EXT_ANONYMOUS_OBJECT_ORIGIN_NAME -> {
ProtoBufClassKind.JVM_EXT_ANONYMOUS_OBJECT_ORIGIN_NAME -> {
// Not affected, this extension is not used in the compiler
}
ProtoBufClassKind.KLIB_EXT_CLASS_ANNOTATION_LIST -> {
isClassAffected = true
areSubclassesAffected = true
}
}
}
@@ -261,10 +281,15 @@ class DifferenceCalculatorForClass(
}
class DifferenceCalculatorForPackageFacade(
private val oldData: PackagePartProtoData,
private val newData: PackagePartProtoData
private val oldData: PackagePartProtoData,
private val newData: PackagePartProtoData
) : DifferenceCalculator() {
override val compareObject = ProtoCompareGenerated(oldData.nameResolver, newData.nameResolver)
override val compareObject = ProtoCompareGenerated(
oldNameResolver = oldData.nameResolver,
newNameResolver = newData.nameResolver,
oldTypeTable = oldData.proto.typeTableOrNull,
newTypeTable = newData.proto.typeTableOrNull
)
override fun difference(): Difference {
val oldProto = oldData.proto
@@ -289,10 +314,9 @@ class DifferenceCalculatorForPackageFacade(
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Package::getPropertyList))
ProtoBufPackageKind.TYPE_ALIAS_LIST ->
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Package::getTypeAliasList))
ProtoBufPackageKind.TYPE_TABLE,
ProtoBufPackageKind.VERSION_REQUIREMENT_TABLE,
ProtoBufPackageKind.JVM_EXT_PACKAGE_MODULE_NAME,
ProtoBufPackageKind.JS_EXT_PACKAGE_FQ_NAME-> {
ProtoBufPackageKind.JS_EXT_PACKAGE_FQ_NAME -> {
// TODO
}
ProtoBufPackageKind.JVM_EXT_PACKAGE_LOCAL_VARIABLE_LIST -> {
@@ -301,6 +325,9 @@ class DifferenceCalculatorForPackageFacade(
ProtoBufPackageKind.BUILT_INS_EXT_PACKAGE_FQ_NAME -> {
// Not affected
}
ProtoBufPackageKind.KLIB_EXT_PACKAGE_FQ_NAME -> {
// Not affected
}
}
}
@@ -310,3 +337,9 @@ class DifferenceCalculatorForPackageFacade(
private val ProtoBuf.Class.isSealed: Boolean
get() = ProtoBuf.Modality.SEALED == Flags.MODALITY.get(flags)
val ProtoBuf.Class.typeTableOrNull: ProtoBuf.TypeTable?
get() = if (hasTypeTable()) typeTable else null
val ProtoBuf.Package.typeTableOrNull: ProtoBuf.TypeTable?
get() = if (hasTypeTable()) typeTable else null

View File

@@ -24,11 +24,20 @@ import org.jetbrains.kotlin.utils.Printer
import java.io.File
abstract class BasicMap<K : Comparable<K>, V>(
storageFile: File,
internal val storageFile: File,
keyDescriptor: KeyDescriptor<K>,
valueExternalizer: DataExternalizer<V>
) {
protected val storage = LazyStorage(storageFile, keyDescriptor, valueExternalizer)
protected val storage: LazyStorage<K, V>
private val nonCachingStorage = System.getProperty("kotlin.jps.non.caching.storage")?.toBoolean() ?: false
init {
storage = if (nonCachingStorage) {
NonCachingLazyStorage(storageFile, keyDescriptor, valueExternalizer)
} else {
CachingLazyStorage(storageFile, keyDescriptor, valueExternalizer)
}
}
fun clean() {
storage.clean()

View File

@@ -0,0 +1,81 @@
/*
* 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.storage
import com.intellij.util.io.DataExternalizer
import com.intellij.util.io.EnumeratorStringDescriptor
import com.intellij.util.io.KeyDescriptor
import org.jetbrains.annotations.TestOnly
import org.jetbrains.kotlin.utils.Printer
import java.io.File
abstract class BasicMap<K : Comparable<K>, V>(
internal val storageFile: File,
keyDescriptor: KeyDescriptor<K>,
valueExternalizer: DataExternalizer<V>
) {
protected val storage = LazyStorage(storageFile, keyDescriptor, valueExternalizer)
fun clean() {
storage.clean()
}
fun flush(memoryCachesOnly: Boolean) {
storage.flush(memoryCachesOnly)
}
fun close() {
storage.close()
}
@TestOnly
fun dump(): String {
return with(StringBuilder()) {
with(Printer(this)) {
println(this@BasicMap::class.java.simpleName)
pushIndent()
for (key in storage.keys.sorted()) {
println("${dumpKey(key)} -> ${dumpValue(storage[key]!!)}")
}
popIndent()
}
this
}.toString()
}
@TestOnly
protected abstract fun dumpKey(key: K): String
@TestOnly
protected abstract fun dumpValue(value: V): String
}
abstract class BasicStringMap<V>(
storageFile: File,
keyDescriptor: KeyDescriptor<String>,
valueExternalizer: DataExternalizer<V>
) : BasicMap<String, V>(storageFile, keyDescriptor, valueExternalizer) {
constructor(
storageFile: File,
valueExternalizer: DataExternalizer<V>
) : this(storageFile, EnumeratorStringDescriptor.INSTANCE, valueExternalizer)
override fun dumpKey(key: String): String = key
}

View File

@@ -18,6 +18,7 @@ package org.jetbrains.kotlin.incremental.storage
import org.jetbrains.annotations.TestOnly
import java.io.File
import java.io.IOException
open class BasicMapsOwner(val cachesDir: File) {
private val maps = arrayListOf<BasicMap<*, *>>()
@@ -35,16 +36,35 @@ open class BasicMapsOwner(val cachesDir: File) {
}
open fun clean() {
maps.forEach { it.clean() }
forEachMapSafe("clean", BasicMap<*, *>::clean)
}
open fun close() {
maps.forEach { it.close() }
forEachMapSafe("close", BasicMap<*, *>::close)
}
open fun flush(memoryCachesOnly: Boolean) {
maps.forEach { it.flush(memoryCachesOnly) }
forEachMapSafe("flush") { it.flush(memoryCachesOnly) }
}
@TestOnly fun dump(): String = maps.joinToString("\n\n") { it.dump() }
private fun forEachMapSafe(actionName: String, action: (BasicMap<*, *>) -> Unit) {
val actionExceptions = LinkedHashMap<String, Exception>()
maps.forEach {
try {
action(it)
} catch (e: Exception) {
actionExceptions[it.storageFile.name] = e
}
}
if (actionExceptions.isNotEmpty()) {
val desc = "Could not $actionName incremental caches in $cachesDir: ${actionExceptions.keys.joinToString(", ")}"
val allIOExceptions = actionExceptions.all { it is IOException }
val ex = if (allIOExceptions) IOException(desc) else Exception(desc)
actionExceptions.forEach { (_, e) -> ex.addSuppressed(e) }
throw ex
}
}
@TestOnly
fun dump(): String = maps.joinToString("\n\n") { it.dump() }
}

View File

@@ -0,0 +1,107 @@
/*
* 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.storage
import com.intellij.util.io.DataExternalizer
import com.intellij.util.io.KeyDescriptor
import com.intellij.util.io.PersistentHashMap
import java.io.File
/**
* It's lazy in a sense that PersistentHashMap is created only on write
*/
class CachingLazyStorage<K, V>(
private val storageFile: File,
private val keyDescriptor: KeyDescriptor<K>,
private val valueExternalizer: DataExternalizer<V>
) : LazyStorage<K, V> {
@Volatile
private var storage: PersistentHashMap<K, V>? = null
@Synchronized
private fun getStorageIfExists(): PersistentHashMap<K, V>? {
if (storage != null) return storage
if (storageFile.exists()) {
storage = createMap()
return storage
}
return null
}
@Synchronized
private fun getStorageOrCreateNew(): PersistentHashMap<K, V> {
if (storage == null) {
storage = createMap()
}
return storage!!
}
override val keys: Collection<K>
get() = getStorageIfExists()?.allKeysWithExistingMapping ?: listOf()
override operator fun contains(key: K): Boolean =
getStorageIfExists()?.containsMapping(key) ?: false
override operator fun get(key: K): V? =
getStorageIfExists()?.get(key)
override operator fun set(key: K, value: V) {
getStorageOrCreateNew().put(key, value)
}
override fun remove(key: K) {
getStorageIfExists()?.remove(key)
}
override fun append(key: K, value: V) {
getStorageOrCreateNew().appendData(key, { valueExternalizer.save(it, value) })
}
@Synchronized
override fun clean() {
try {
storage?.close()
} finally {
PersistentHashMap.deleteFilesStartingWith(storageFile)
storage = null
}
}
@Synchronized
override fun flush(memoryCachesOnly: Boolean) {
val existingStorage = storage ?: return
if (memoryCachesOnly) {
if (existingStorage.isDirty) {
existingStorage.dropMemoryCaches()
}
} else {
existingStorage.force()
}
}
@Synchronized
override fun close() {
storage?.close()
}
private fun createMap(): PersistentHashMap<K, V> = PersistentHashMap(storageFile, keyDescriptor, valueExternalizer)
}

View File

@@ -26,7 +26,7 @@ internal open class ClassOneToManyMap(
override fun dumpValue(value: Collection<String>): String = value.dumpCollection()
fun add(key: FqName, value: FqName) {
storage.append(key.asString(), value.asString())
storage.append(key.asString(), listOf(value.asString()))
}
operator fun get(key: FqName): Collection<FqName> =

View File

@@ -0,0 +1,55 @@
/*
* 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.storage
import org.jetbrains.kotlin.incremental.dumpCollection
import org.jetbrains.kotlin.name.FqName
import java.io.File
internal open class ClassOneToManyMap(
storageFile: File
) : BasicStringMap<Collection<String>>(storageFile, StringCollectionExternalizer) {
override fun dumpValue(value: Collection<String>): String = value.dumpCollection()
fun add(key: FqName, value: FqName) {
storage.append(key.asString(), value.asString())
}
operator fun get(key: FqName): Collection<FqName> =
storage[key.asString()]?.map(::FqName) ?: setOf()
operator fun set(key: FqName, values: Collection<FqName>) {
if (values.isEmpty()) {
remove(key)
return
}
storage[key.asString()] = values.map(FqName::asString)
}
fun remove(key: FqName) {
storage.remove(key.asString())
}
fun removeValues(key: FqName, removed: Set<FqName>) {
val notRemoved = this[key].filter { it !in removed }
this[key] = notRemoved
}
}
internal class SubtypesMap(storageFile: File) : ClassOneToManyMap(storageFile)
internal class SupertypesMap(storageFile: File) : ClassOneToManyMap(storageFile)

View File

@@ -16,107 +16,14 @@
package org.jetbrains.kotlin.incremental.storage
import com.intellij.util.io.DataExternalizer
import com.intellij.util.io.IOUtil
import com.intellij.util.io.KeyDescriptor
import com.intellij.util.io.PersistentHashMap
import java.io.DataOutput
import java.io.File
import java.io.IOException
/**
* It's lazy in a sense that PersistentHashMap is created only on write
*/
class LazyStorage<K, V>(
private val storageFile: File,
private val keyDescriptor: KeyDescriptor<K>,
private val valueExternalizer: DataExternalizer<V>
) {
@Volatile
private var storage: PersistentHashMap<K, V>? = null
@Synchronized
private fun getStorageIfExists(): PersistentHashMap<K, V>? {
if (storage != null) return storage
if (storageFile.exists()) {
storage = createMap()
return storage
}
return null
}
@Synchronized
private fun getStorageOrCreateNew(): PersistentHashMap<K, V> {
if (storage == null) {
storage = createMap()
}
return storage!!
}
interface LazyStorage<K, V> {
val keys: Collection<K>
get() = getStorageIfExists()?.allKeysWithExistingMapping ?: listOf()
operator fun contains(key: K): Boolean =
getStorageIfExists()?.containsMapping(key) ?: false
operator fun get(key: K): V? =
getStorageIfExists()?.get(key)
operator fun set(key: K, value: V) {
getStorageOrCreateNew().put(key, value)
}
fun remove(key: K) {
getStorageIfExists()?.remove(key)
}
fun append(key: K, value: String) {
append(key) { out -> IOUtil.writeUTF(out, value) }
}
fun append(key: K, value: Int) {
append(key) { out -> out.writeInt(value) }
}
@Synchronized
fun clean() {
try {
storage?.close()
}
catch (ignored: Throwable) {
}
PersistentHashMap.deleteFilesStartingWith(storageFile)
storage = null
}
@Synchronized
fun flush(memoryCachesOnly: Boolean) {
val existingStorage = storage ?: return
if (memoryCachesOnly) {
if (existingStorage.isDirty) {
existingStorage.dropMemoryCaches()
}
}
else {
existingStorage.force()
}
}
@Synchronized
fun close() {
storage?.close()
}
private fun createMap(): PersistentHashMap<K, V> =
PersistentHashMap(storageFile, keyDescriptor, valueExternalizer)
private fun append(key: K, append: (DataOutput)->Unit) {
getStorageOrCreateNew().appendData(key, append)
}
}
operator fun contains(key: K): Boolean
operator fun get(key: K): V?
operator fun set(key: K, value: V)
fun remove(key: K)
fun append(key: K, value: V)
fun clean()
fun flush(memoryCachesOnly: Boolean)
fun close()
}

View File

@@ -0,0 +1,122 @@
/*
* 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.storage
import com.intellij.util.io.DataExternalizer
import com.intellij.util.io.IOUtil
import com.intellij.util.io.KeyDescriptor
import com.intellij.util.io.PersistentHashMap
import java.io.DataOutput
import java.io.File
import java.io.IOException
/**
* It's lazy in a sense that PersistentHashMap is created only on write
*/
class LazyStorage<K, V>(
private val storageFile: File,
private val keyDescriptor: KeyDescriptor<K>,
private val valueExternalizer: DataExternalizer<V>
) {
@Volatile
private var storage: PersistentHashMap<K, V>? = null
@Synchronized
private fun getStorageIfExists(): PersistentHashMap<K, V>? {
if (storage != null) return storage
if (storageFile.exists()) {
storage = createMap()
return storage
}
return null
}
@Synchronized
private fun getStorageOrCreateNew(): PersistentHashMap<K, V> {
if (storage == null) {
storage = createMap()
}
return storage!!
}
val keys: Collection<K>
get() = getStorageIfExists()?.allKeysWithExistingMapping ?: listOf()
operator fun contains(key: K): Boolean =
getStorageIfExists()?.containsMapping(key) ?: false
operator fun get(key: K): V? =
getStorageIfExists()?.get(key)
operator fun set(key: K, value: V) {
getStorageOrCreateNew().put(key, value)
}
fun remove(key: K) {
getStorageIfExists()?.remove(key)
}
fun append(key: K, value: String) {
append(key) { out -> IOUtil.writeUTF(out, value) }
}
fun append(key: K, value: Int) {
append(key) { out -> out.writeInt(value) }
}
@Synchronized
fun clean() {
try {
storage?.close()
}
catch (ignored: Throwable) {
}
PersistentHashMap.deleteFilesStartingWith(storageFile)
storage = null
}
@Synchronized
fun flush(memoryCachesOnly: Boolean) {
val existingStorage = storage ?: return
if (memoryCachesOnly) {
if (existingStorage.isDirty) {
existingStorage.dropMemoryCaches()
}
}
else {
existingStorage.force()
}
}
@Synchronized
fun close() {
storage?.close()
}
private fun createMap(): PersistentHashMap<K, V> =
PersistentHashMap(storageFile, keyDescriptor, valueExternalizer)
private fun append(key: K, append: (DataOutput)->Unit) {
getStorageOrCreateNew().appendData(key, append)
}
}

View File

@@ -24,7 +24,7 @@ internal class LookupMap(storage: File) : BasicMap<LookupSymbolKey, Collection<I
override fun dumpValue(value: Collection<Int>): String = value.toString()
fun add(name: String, scope: String, fileId: Int) {
storage.append(LookupSymbolKey(name, scope), fileId)
storage.append(LookupSymbolKey(name, scope), listOf(fileId))
}
operator fun get(key: LookupSymbolKey): Collection<Int>? = storage[key]

View File

@@ -0,0 +1,42 @@
/*
* 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.storage
import java.io.File
internal class LookupMap(storage: File) : BasicMap<LookupSymbolKey, Collection<Int>>(storage, LookupSymbolKeyDescriptor, IntCollectionExternalizer) {
override fun dumpKey(key: LookupSymbolKey): String = key.toString()
override fun dumpValue(value: Collection<Int>): String = value.toString()
fun add(name: String, scope: String, fileId: Int) {
storage.append(LookupSymbolKey(name, scope), fileId)
}
operator fun get(key: LookupSymbolKey): Collection<Int>? = storage[key]
operator fun set(key: LookupSymbolKey, fileIds: Set<Int>) {
storage[key] = fileIds
}
fun remove(key: LookupSymbolKey) {
storage.remove(key)
}
val keys: Collection<LookupSymbolKey>
get() = storage.keys
}

View File

@@ -0,0 +1,106 @@
/*
* 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.storage
import com.intellij.util.io.DataExternalizer
import com.intellij.util.io.KeyDescriptor
import com.intellij.util.io.JpsPersistentHashMap
import java.io.File
class NonCachingLazyStorage<K, V>(
private val storageFile: File,
private val keyDescriptor: KeyDescriptor<K>,
private val valueExternalizer: DataExternalizer<V>
) : LazyStorage<K, V> {
@Volatile
private var storage: JpsPersistentHashMap<K, V>? = null
@Synchronized
private fun getStorageIfExists(): JpsPersistentHashMap<K, V>? {
if (storage != null) return storage
if (storageFile.exists()) {
storage = createMap()
return storage
}
return null
}
@Synchronized
private fun getStorageOrCreateNew(): JpsPersistentHashMap<K, V> {
if (storage == null) {
storage = createMap()
}
return storage!!
}
override val keys: Collection<K>
get() = getStorageIfExists()?.allKeysWithExistingMapping ?: listOf()
override operator fun contains(key: K): Boolean =
getStorageIfExists()?.containsMapping(key) ?: false
override operator fun get(key: K): V? =
getStorageIfExists()?.get(key)
override operator fun set(key: K, value: V) {
getStorageOrCreateNew().put(key, value)
}
override fun remove(key: K) {
getStorageIfExists()?.remove(key)
}
override fun append(key: K, value: V) {
getStorageOrCreateNew().appendDataWithoutCache(key, value)
}
@Synchronized
override fun clean() {
try {
storage?.close()
} catch (ignored: Throwable) {
}
JpsPersistentHashMap.deleteFilesStartingWith(storageFile)
storage = null
}
@Synchronized
override fun flush(memoryCachesOnly: Boolean) {
val existingStorage = storage ?: return
if (memoryCachesOnly) {
if (existingStorage.isDirty) {
existingStorage.dropMemoryCaches()
}
} else {
existingStorage.force()
}
}
@Synchronized
override fun close() {
storage?.close()
}
private fun createMap(): JpsPersistentHashMap<K, V> =
JpsPersistentHashMap(storageFile, keyDescriptor, valueExternalizer)
}

View File

@@ -0,0 +1,106 @@
/*
* 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.storage
import com.intellij.util.io.DataExternalizer
import com.intellij.util.io.KeyDescriptor
import com.intellij.util.io.PersistentHashMap
import java.io.File
class NonCachingLazyStorage<K, V>(
private val storageFile: File,
private val keyDescriptor: KeyDescriptor<K>,
private val valueExternalizer: DataExternalizer<V>
) : LazyStorage<K, V> {
@Volatile
private var storage: PersistentHashMap<K, V>? = null
@Synchronized
private fun getStorageIfExists(): PersistentHashMap<K, V>? {
if (storage != null) return storage
if (storageFile.exists()) {
storage = createMap()
return storage
}
return null
}
@Synchronized
private fun getStorageOrCreateNew(): PersistentHashMap<K, V> {
if (storage == null) {
storage = createMap()
}
return storage!!
}
override val keys: Collection<K>
get() = getStorageIfExists()?.allKeysWithExistingMapping ?: listOf()
override operator fun contains(key: K): Boolean =
getStorageIfExists()?.containsMapping(key) ?: false
override operator fun get(key: K): V? =
getStorageIfExists()?.get(key)
override operator fun set(key: K, value: V) {
getStorageOrCreateNew().put(key, value)
}
override fun remove(key: K) {
getStorageIfExists()?.remove(key)
}
override fun append(key: K, value: V) {
getStorageOrCreateNew().appendData(key) { dataOutput -> valueExternalizer.save(dataOutput, value) }
}
@Synchronized
override fun clean() {
try {
storage?.close()
} catch (ignored: Throwable) {
}
PersistentHashMap.deleteFilesStartingWith(storageFile)
storage = null
}
@Synchronized
override fun flush(memoryCachesOnly: Boolean) {
val existingStorage = storage ?: return
if (memoryCachesOnly) {
if (existingStorage.isDirty) {
existingStorage.dropMemoryCaches()
}
} else {
existingStorage.force()
}
}
@Synchronized
override fun close() {
storage?.close()
}
private fun createMap(): PersistentHashMap<K, V> =
PersistentHashMap(storageFile, keyDescriptor, valueExternalizer)
}

View File

@@ -0,0 +1,34 @@
/*
* 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
open class RelativeFileToPathConverter(baseDirFile: File?) : FileToPathConverter {
private val baseDirPath = baseDirFile?.canonicalFile?.invariantSeparatorsPath
override fun toPath(file: File): String {
val path = file.canonicalFile.invariantSeparatorsPath
return when {
baseDirPath != null && path.startsWith(baseDirPath) ->
PROJECT_DIR_PLACEHOLDER + path.substring(baseDirPath.length)
else -> path
}
}
override fun toFile(path: String): File =
when {
path.startsWith(PROJECT_DIR_PLACEHOLDER) -> {
val basePath = baseDirPath ?: error("Could not get project root dir")
File(basePath + path.substring(PROJECT_DIR_PLACEHOLDER.length))
}
else -> File(path)
}
private companion object {
private const val PROJECT_DIR_PLACEHOLDER = "${'$'}PROJECT_DIR$"
}
}

View File

@@ -41,7 +41,7 @@ internal abstract class AbstractSourceToOutputMap<Name>(
}
fun add(sourceFile: File, className: Name) {
storage.append(pathConverter.toPath(sourceFile), nameTransformer.asString(className))
storage.append(pathConverter.toPath(sourceFile), listOf(nameTransformer.asString(className)))
}
fun contains(sourceFile: File): Boolean =

View File

@@ -0,0 +1,62 @@
/*
* Copyright 2010-2017 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.storage
import org.jetbrains.kotlin.incremental.dumpCollection
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
import java.io.File
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 pathConverter: FileToPathConverter
) : BasicStringMap<Collection<String>>(storageFile, PathStringDescriptor, StringCollectionExternalizer) {
fun clearOutputsForSource(sourceFile: File) {
remove(pathConverter.toPath(sourceFile))
}
fun add(sourceFile: File, className: Name) {
storage.append(pathConverter.toPath(sourceFile), nameTransformer.asString(className))
}
fun contains(sourceFile: File): Boolean =
pathConverter.toPath(sourceFile) in storage
operator fun get(sourceFile: File): Collection<Name> =
storage[pathConverter.toPath(sourceFile)].orEmpty().map(nameTransformer::asName)
fun getFqNames(sourceFile: File): Collection<FqName> =
storage[pathConverter.toPath(sourceFile)].orEmpty().map(nameTransformer::asFqName)
override fun dumpValue(value: Collection<String>) =
value.dumpCollection()
private fun remove(path: String) {
storage.remove(path)
}
}

View File

@@ -0,0 +1,90 @@
/*
* 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 com.intellij.util.containers.MultiMap
import org.jetbrains.kotlin.TestWithWorkingDir
import org.jetbrains.kotlin.incremental.LookupStorage
import org.jetbrains.kotlin.incremental.LookupSymbol
import org.jetbrains.kotlin.incremental.testingUtils.assertEqualDirectories
import org.junit.Test
import java.io.File
class RelocatableCachesTest : TestWithWorkingDir() {
@Test
fun testLookupStorageAddAllReversedFiles() {
val originalRoot = workingDir.resolve("original")
fillLookupStorage(originalRoot, reverseFiles = false, reverseLookups = false)
val reversedFilesOrderRoot = workingDir.resolve("reversedFiles")
fillLookupStorage(reversedFilesOrderRoot, reverseFiles = true, reverseLookups = false)
assertEqualDirectories(originalRoot, reversedFilesOrderRoot, forgiveExtraFiles = false)
}
@Test
fun testLookupStorageAddAllReversedLookups() {
val originalRoot = workingDir.resolve("original")
fillLookupStorage(originalRoot, reverseFiles = false, reverseLookups = false)
val reversedLookupsOrderRoot = workingDir.resolve("reversedLookups")
fillLookupStorage(reversedLookupsOrderRoot, reverseFiles = false, reverseLookups = true)
assertEqualDirectories(originalRoot, reversedLookupsOrderRoot, forgiveExtraFiles = false)
}
@Test
fun testLookupStorageAddAllReversedFilesReversedLookups() {
val originalRoot = workingDir.resolve("original")
fillLookupStorage(originalRoot, reverseFiles = false, reverseLookups = false)
val reversedFilesReversedLookupsOrderRoot = workingDir.resolve("reversedFilesReversedLookupsOrderRoot")
fillLookupStorage(reversedFilesReversedLookupsOrderRoot, reverseFiles = true, reverseLookups = true)
assertEqualDirectories(originalRoot, reversedFilesReversedLookupsOrderRoot, forgiveExtraFiles = false)
}
/**
* Fills lookup storage in [projectRoot] with N fq-names,
* where i_th fq-name myscope_i.MyClass_i has lookups for previous fq-names (from 0 to i-1)
*/
private fun fillLookupStorage(projectRoot: File, reverseFiles: Boolean, reverseLookups: Boolean) {
val storageRoot = projectRoot.storageRoot
val fileToPathConverter = RelativeFileToPathConverter(projectRoot)
val lookupStorage = LookupStorage(storageRoot, fileToPathConverter)
val files = LinkedHashSet<String>()
val symbols = LinkedHashSet<LookupSymbol>()
val lookups = MultiMap.createOrderedSet<LookupSymbol, String>()
for (i in 0..10) {
val newSymbol = LookupSymbol(name = "MyClass_$i", scope = "myscope_$i")
val newSourcePath = projectRoot.resolve("src/${newSymbol.asRelativePath()}").canonicalFile.invariantSeparatorsPath
symbols.add(newSymbol)
for (lookedUpSymbol in symbols) {
lookups.putValue(lookedUpSymbol, newSourcePath)
}
files.add(newSourcePath)
}
val filesToAdd = if (reverseFiles) files.reversedSet() else files
val lookupsToAdd = if (reverseLookups) lookups.reversedMultiMap() else lookups
lookupStorage.addAll(lookupsToAdd, filesToAdd)
lookupStorage.flush(memoryCachesOnly = false)
}
private val File.storageRoot: File
get() = resolve("storage")
private fun <K, V> MultiMap<K, V>.reversedMultiMap(): MultiMap<K, V> {
val newMap = MultiMap.createOrderedSet<K, V>()
for ((key, values) in entrySet().reversedSet()) {
newMap.putValues(key, values.reversed())
}
return newMap
}
private fun <T> Set<T>.reversedSet(): LinkedHashSet<T> =
reversed().toCollection(LinkedHashSet(size))
private fun LookupSymbol.asRelativePath(): String =
if (scope.isBlank()) name else scope.replace('.', '/') + '/' + name
}

View File

@@ -19,12 +19,14 @@ package org.jetbrains.kotlin.incremental.testingUtils
import java.io.File
data class BuildLogFinder(
private val isDataContainerBuildLogEnabled: Boolean = false,
private val isGradleEnabled: Boolean = false,
private val isJsEnabled: Boolean = false
private val isDataContainerBuildLogEnabled: Boolean = false,
private val isGradleEnabled: Boolean = false,
private val isJsEnabled: Boolean = false,
private val isJsIrEnabled: Boolean = false // TODO rename as it is used for metadata-only test
) {
companion object {
private const val JS_LOG = "js-build.log"
private const val JS_IR_LOG = "js-ir-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"
@@ -38,6 +40,7 @@ data class BuildLogFinder(
val names = dir.list() ?: arrayOf()
val files = names.filter { File(dir, it).isFile }.toSet()
val matchedName = when {
isJsIrEnabled && JS_IR_LOG in files -> JS_IR_LOG
isJsEnabled && JS_LOG in files -> JS_LOG
isGradleEnabled && GRADLE_LOG in files -> GRADLE_LOG
isJsEnabled && JS_JPS_LOG in files -> JS_JPS_LOG

View File

@@ -17,7 +17,6 @@
package org.jetbrains.kotlin.incremental.testingUtils
import com.intellij.openapi.util.io.FileUtil
import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream
import org.jetbrains.kotlin.incremental.LocalFileKotlinClass
import org.jetbrains.kotlin.js.parser.sourcemaps.SourceMapError
import org.jetbrains.kotlin.js.parser.sourcemaps.SourceMapParser
@@ -37,6 +36,7 @@ import org.jetbrains.org.objectweb.asm.ClassReader
import org.jetbrains.org.objectweb.asm.util.TraceClassVisitor
import org.junit.Assert
import org.junit.Assert.assertNotNull
import org.junit.ComparisonFailure
import java.io.*
import java.util.*
import java.util.zip.CRC32
@@ -72,7 +72,15 @@ fun assertEqualDirectories(expected: File, actual: File, forgiveExtraFiles: Bool
}
}
Assert.assertEquals(expectedString, actualString)
if (expectedString != actualString) {
val message: String? = null
throw ComparisonFailure(
message,
expectedString.replaceFirst(DIR_ROOT_PLACEHOLDER, expected.canonicalPath),
actualString.replaceFirst(DIR_ROOT_PLACEHOLDER, actual.canonicalPath)
)
}
}
private fun File.checksumString(): String {
@@ -81,6 +89,8 @@ private fun File.checksumString(): String {
return java.lang.Long.toHexString(crc32.value)
}
private const val DIR_ROOT_PLACEHOLDER = "<DIR_ROOT_PLACEHOLDER>"
private fun getDirectoryString(dir: File, interestingPaths: List<String>): String {
val buf = StringBuilder()
val p = Printer(buf)
@@ -109,7 +119,7 @@ private fun getDirectoryString(dir: File, interestingPaths: List<String>): Strin
}
p.println(".")
p.println(DIR_ROOT_PLACEHOLDER)
addDirContent(dir)
for (path in interestingPaths) {

View File

@@ -11,6 +11,8 @@ public final class DebugExtOptionsProtoBuf {
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.fqNameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.stringIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipMessageInComparison);
}
public static final int SKIP_IN_COMPARISON_FIELD_NUMBER = 50000;
/**
@@ -56,6 +58,28 @@ public final class DebugExtOptionsProtoBuf {
.newFileScopedGeneratedExtension(
java.lang.Boolean.class,
null);
public static final int TYPE_ID_IN_TABLE_FIELD_NUMBER = 50004;
/**
* <code>extend .google.protobuf.FieldOptions { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.protobuf.DescriptorProtos.FieldOptions,
java.lang.Boolean> typeIdInTable = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
java.lang.Boolean.class,
null);
public static final int SKIP_MESSAGE_IN_COMPARISON_FIELD_NUMBER = 50100;
/**
* <code>extend .google.protobuf.MessageOptions { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.protobuf.DescriptorProtos.MessageOptions,
java.lang.Boolean> skipMessageInComparison = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
java.lang.Boolean.class,
null);
public static org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor
getDescriptor() {
@@ -73,8 +97,11 @@ public final class DebugExtOptionsProtoBuf {
"rotobuf.FieldOptions\030\321\206\003 \001(\010:<\n\023fq_name_" +
"id_in_table\022\035.google.protobuf.FieldOptio" +
"ns\030\322\206\003 \001(\010:;\n\022string_id_in_table\022\035.googl" +
"e.protobuf.FieldOptions\030\323\206\003 \001(\010B\031B\027Debug" +
"ExtOptionsProtoBuf"
"e.protobuf.FieldOptions\030\323\206\003 \001(\010:9\n\020type_" +
"id_in_table\022\035.google.protobuf.FieldOptio",
"ns\030\324\206\003 \001(\010:E\n\032skip_message_in_comparison" +
"\022\037.google.protobuf.MessageOptions\030\264\207\003 \001(" +
"\010B\031B\027DebugExtOptionsProtoBuf"
};
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
@@ -93,6 +120,8 @@ public final class DebugExtOptionsProtoBuf {
nameIdInTable.internalInit(descriptor.getExtensions().get(1));
fqNameIdInTable.internalInit(descriptor.getExtensions().get(2));
stringIdInTable.internalInit(descriptor.getExtensions().get(3));
typeIdInTable.internalInit(descriptor.getExtensions().get(4));
skipMessageInComparison.internalInit(descriptor.getExtensions().get(5));
org.jetbrains.kotlin.protobuf.DescriptorProtos.getDescriptor();
}

View File

@@ -34302,192 +34302,194 @@ public final class DebugProtoBuf {
java.lang.String[] descriptorData = {
"\n&core/metadata/src/metadata.debug.proto" +
"\022\035org.jetbrains.kotlin.metadata\032)core/me" +
"tadata/src/ext_options.debug.proto\"\035\n\013St" +
"ringTable\022\016\n\006string\030\001 \003(\t\"\276\002\n\022QualifiedN" +
"ameTable\022W\n\016qualified_name\030\001 \003(\0132?.org.j" +
"etbrains.kotlin.metadata.QualifiedNameTa" +
"ble.QualifiedName\032\316\001\n\rQualifiedName\022!\n\025p" +
"arent_qualified_name\030\001 \001(\005:\002-1\022\022\n\nshort_" +
"name\030\002 \002(\005\022[\n\004kind\030\003 \001(\0162D.org.jetbrains" +
".kotlin.metadata.QualifiedNameTable.Qual",
"ifiedName.Kind:\007PACKAGE\")\n\004Kind\022\t\n\005CLASS" +
"\020\000\022\013\n\007PACKAGE\020\001\022\t\n\005LOCAL\020\002\"\226\006\n\nAnnotatio" +
"n\022\020\n\002id\030\001 \002(\005B\004\220\265\030\001\022D\n\010argument\030\002 \003(\01322." +
"org.jetbrains.kotlin.metadata.Annotation" +
".Argument\032\257\005\n\010Argument\022\025\n\007name_id\030\001 \002(\005B" +
"\004\210\265\030\001\022G\n\005value\030\002 \002(\01328.org.jetbrains.kot" +
"lin.metadata.Annotation.Argument.Value\032\302" +
"\004\n\005Value\022K\n\004type\030\001 \001(\0162=.org.jetbrains.k" +
"otlin.metadata.Annotation.Argument.Value" +
".Type\022\021\n\tint_value\030\002 \001(\022\022\023\n\013float_value\030",
"\003 \001(\002\022\024\n\014double_value\030\004 \001(\001\022\032\n\014string_va" +
"lue\030\005 \001(\005B\004\230\265\030\001\022\026\n\010class_id\030\006 \001(\005B\004\220\265\030\001\022" +
"\033\n\renum_value_id\030\007 \001(\005B\004\210\265\030\001\022=\n\nannotati" +
"on\030\010 \001(\0132).org.jetbrains.kotlin.metadata" +
".Annotation\022O\n\rarray_element\030\t \003(\01328.org" +
"tadata/src/ext_options.debug.proto\"#\n\013St" +
"ringTable\022\016\n\006string\030\001 \003(\t:\004\240\273\030\001\"\304\002\n\022Qual" +
"ifiedNameTable\022W\n\016qualified_name\030\001 \003(\0132?" +
".org.jetbrains.kotlin.metadata.Qualified" +
"NameTable.QualifiedName\032\316\001\n\rQualifiedNam" +
"e\022!\n\025parent_qualified_name\030\001 \001(\005:\002-1\022\022\n\n" +
"short_name\030\002 \002(\005\022[\n\004kind\030\003 \001(\0162D.org.jet" +
"brains.kotlin.metadata.QualifiedNameTabl",
"e.QualifiedName.Kind:\007PACKAGE\")\n\004Kind\022\t\n" +
"\005CLASS\020\000\022\013\n\007PACKAGE\020\001\022\t\n\005LOCAL\020\002:\004\240\273\030\001\"\226" +
"\006\n\nAnnotation\022\020\n\002id\030\001 \002(\005B\004\220\265\030\001\022D\n\010argum" +
"ent\030\002 \003(\01322.org.jetbrains.kotlin.metadat" +
"a.Annotation.Argument\032\257\005\n\010Argument\022\025\n\007na" +
"me_id\030\001 \002(\005B\004\210\265\030\001\022G\n\005value\030\002 \002(\01328.org.j" +
"etbrains.kotlin.metadata.Annotation.Argu" +
"ment.Value\032\302\004\n\005Value\022K\n\004type\030\001 \001(\0162=.org" +
".jetbrains.kotlin.metadata.Annotation.Ar" +
"gument.Value\022 \n\025array_dimension_count\030\013 " +
"\001(\005:\0010\022\020\n\005flags\030\n \001(\005:\0010\"\230\001\n\004Type\022\010\n\004BYT" +
"E\020\000\022\010\n\004CHAR\020\001\022\t\n\005SHORT\020\002\022\007\n\003INT\020\003\022\010\n\004LON" +
"G\020\004\022\t\n\005FLOAT\020\005\022\n\n\006DOUBLE\020\006\022\013\n\007BOOLEAN\020\007\022",
"\n\n\006STRING\020\010\022\t\n\005CLASS\020\t\022\010\n\004ENUM\020\n\022\016\n\nANNO" +
"TATION\020\013\022\t\n\005ARRAY\020\014\"\373\005\n\004Type\022>\n\010argument" +
"\030\002 \003(\0132,.org.jetbrains.kotlin.metadata.T" +
"ype.Argument\022\027\n\010nullable\030\003 \001(\010:\005false\022+\n" +
"\035flexible_type_capabilities_id\030\004 \001(\005B\004\230\265" +
"\030\001\022A\n\024flexible_upper_bound\030\005 \001(\0132#.org.j" +
"etbrains.kotlin.metadata.Type\022\037\n\027flexibl" +
"e_upper_bound_id\030\010 \001(\005\022\030\n\nclass_name\030\006 \001" +
"(\005B\004\220\265\030\001\022\026\n\016type_parameter\030\007 \001(\005\022!\n\023type" +
"_parameter_name\030\t \001(\005B\004\210\265\030\001\022\035\n\017type_alia",
"s_name\030\014 \001(\005B\004\220\265\030\001\0227\n\nouter_type\030\n \001(\0132#" +
".org.jetbrains.kotlin.metadata.Type\022\025\n\ro" +
"uter_type_id\030\013 \001(\005\022=\n\020abbreviated_type\030\r" +
"gument.Value.Type\022\021\n\tint_value\030\002 \001(\022\022\023\n\013",
"float_value\030\003 \001(\002\022\024\n\014double_value\030\004 \001(\001\022" +
"\032\n\014string_value\030\005 \001(\005B\004\230\265\030\001\022\026\n\010class_id\030" +
"\006 \001(\005B\004\220\265\030\001\022\033\n\renum_value_id\030\007 \001(\005B\004\210\265\030\001" +
"\022=\n\nannotation\030\010 \001(\0132).org.jetbrains.kot" +
"lin.metadata.Annotation\022O\n\rarray_element" +
"\030\t \003(\01328.org.jetbrains.kotlin.metadata.A" +
"nnotation.Argument.Value\022 \n\025array_dimens" +
"ion_count\030\013 \001(\005:\0010\022\020\n\005flags\030\n \001(\005:\0010\"\230\001\n" +
"\004Type\022\010\n\004BYTE\020\000\022\010\n\004CHAR\020\001\022\t\n\005SHORT\020\002\022\007\n\003" +
"INT\020\003\022\010\n\004LONG\020\004\022\t\n\005FLOAT\020\005\022\n\n\006DOUBLE\020\006\022\013",
"\n\007BOOLEAN\020\007\022\n\n\006STRING\020\010\022\t\n\005CLASS\020\t\022\010\n\004EN" +
"UM\020\n\022\016\n\nANNOTATION\020\013\022\t\n\005ARRAY\020\014\"\223\006\n\004Type" +
"\022>\n\010argument\030\002 \003(\0132,.org.jetbrains.kotli" +
"n.metadata.Type.Argument\022\027\n\010nullable\030\003 \001" +
"(\010:\005false\022+\n\035flexible_type_capabilities_" +
"id\030\004 \001(\005B\004\230\265\030\001\022A\n\024flexible_upper_bound\030\005" +
" \001(\0132#.org.jetbrains.kotlin.metadata.Typ" +
"e\022\033\n\023abbreviated_type_id\030\016 \001(\005\022\r\n\005flags\030" +
"\001 \001(\005\032\322\001\n\010Argument\022P\n\nprojection\030\001 \001(\01627" +
".org.jetbrains.kotlin.metadata.Type.Argu" +
"ment.Projection:\003INV\0221\n\004type\030\002 \001(\0132#.org" +
".jetbrains.kotlin.metadata.Type\022\017\n\007type_" +
"id\030\003 \001(\005\"0\n\nProjection\022\006\n\002IN\020\000\022\007\n\003OUT\020\001\022",
"\007\n\003INV\020\002\022\010\n\004STAR\020\003*\005\010d\020\310\001\"\230\002\n\rTypeParame" +
"ter\022\n\n\002id\030\001 \002(\005\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\022\026\n\007r" +
"eified\030\003 \001(\010:\005false\022L\n\010variance\030\004 \001(\01625." +
"org.jetbrains.kotlin.metadata.TypeParame" +
"ter.Variance:\003INV\0228\n\013upper_bound\030\005 \003(\0132#" +
".org.jetbrains.kotlin.metadata.Type\022\032\n\016u" +
"pper_bound_id\030\006 \003(\005B\002\020\001\"$\n\010Variance\022\006\n\002I" +
"N\020\000\022\007\n\003OUT\020\001\022\007\n\003INV\020\002*\005\010d\020\350\007\"\244\007\n\005Class\022\020" +
"\n\005flags\030\001 \001(\005:\0016\022\025\n\007fq_name\030\003 \002(\005B\004\220\265\030\001\022" +
"#\n\025companion_object_name\030\004 \001(\005B\004\210\265\030\001\022D\n\016",
"e\022%\n\027flexible_upper_bound_id\030\010 \001(\005B\004\240\265\030\001" +
"\022\030\n\nclass_name\030\006 \001(\005B\004\220\265\030\001\022\026\n\016type_param" +
"eter\030\007 \001(\005\022!\n\023type_parameter_name\030\t \001(\005B",
"\004\210\265\030\001\022\035\n\017type_alias_name\030\014 \001(\005B\004\220\265\030\001\0227\n\n" +
"outer_type\030\n \001(\0132#.org.jetbrains.kotlin." +
"metadata.Type\022\033\n\router_type_id\030\013 \001(\005B\004\240\265" +
"\030\001\022=\n\020abbreviated_type\030\r \001(\0132#.org.jetbr" +
"ains.kotlin.metadata.Type\022!\n\023abbreviated" +
"_type_id\030\016 \001(\005B\004\240\265\030\001\022\r\n\005flags\030\001 \001(\005\032\330\001\n\010" +
"Argument\022P\n\nprojection\030\001 \001(\01627.org.jetbr" +
"ains.kotlin.metadata.Type.Argument.Proje" +
"ction:\003INV\0221\n\004type\030\002 \001(\0132#.org.jetbrains" +
".kotlin.metadata.Type\022\025\n\007type_id\030\003 \001(\005B\004",
"\240\265\030\001\"0\n\nProjection\022\006\n\002IN\020\000\022\007\n\003OUT\020\001\022\007\n\003I" +
"NV\020\002\022\010\n\004STAR\020\003*\005\010d\020\310\001\"\234\002\n\rTypeParameter\022" +
"\n\n\002id\030\001 \002(\005\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\022\026\n\007reifi" +
"ed\030\003 \001(\010:\005false\022L\n\010variance\030\004 \001(\01625.org." +
"jetbrains.kotlin.metadata.TypeParameter." +
"Variance:\003INV\0228\n\013upper_bound\030\005 \003(\0132#.org" +
".jetbrains.kotlin.metadata.Type\022\036\n\016upper" +
"_bound_id\030\006 \003(\005B\006\020\001\240\265\030\001\"$\n\010Variance\022\006\n\002I" +
"N\020\000\022\007\n\003OUT\020\001\022\007\n\003INV\020\002*\005\010d\020\350\007\"\250\007\n\005Class\022\020" +
"\n\005flags\030\001 \001(\005:\0016\022\025\n\007fq_name\030\003 \002(\005B\004\220\265\030\001\022",
"#\n\025companion_object_name\030\004 \001(\005B\004\210\265\030\001\022D\n\016" +
"type_parameter\030\005 \003(\0132,.org.jetbrains.kot" +
"lin.metadata.TypeParameter\0226\n\tsupertype\030" +
"\006 \003(\0132#.org.jetbrains.kotlin.metadata.Ty" +
"pe\022\030\n\014supertype_id\030\002 \003(\005B\002\020\001\022!\n\021nested_c" +
"lass_name\030\007 \003(\005B\006\020\001\210\265\030\001\022?\n\013constructor\030\010" +
" \003(\0132*.org.jetbrains.kotlin.metadata.Con" +
"structor\0229\n\010function\030\t \003(\0132\'.org.jetbrai" +
"ns.kotlin.metadata.Function\0229\n\010property\030" +
"\n \003(\0132\'.org.jetbrains.kotlin.metadata.Pr" +
"operty\022<\n\ntype_alias\030\013 \003(\0132(.org.jetbrai",
"ns.kotlin.metadata.TypeAlias\022<\n\nenum_ent" +
"ry\030\r \003(\0132(.org.jetbrains.kotlin.metadata" +
".EnumEntry\022\'\n\027sealed_subclass_fq_name\030\020 " +
"\003(\005B\006\020\001\220\265\030\001\022<\n\ntype_table\030\036 \001(\0132(.org.je" +
"tbrains.kotlin.metadata.TypeTable\022\033\n\023ver" +
"sion_requirement\030\037 \003(\005\022Y\n\031version_requir" +
"ement_table\030 \001(\01326.org.jetbrains.kotlin" +
".metadata.VersionRequirementTable\"x\n\004Kin" +
"d\022\t\n\005CLASS\020\000\022\r\n\tINTERFACE\020\001\022\016\n\nENUM_CLAS" +
"S\020\002\022\016\n\nENUM_ENTRY\020\003\022\024\n\020ANNOTATION_CLASS\020",
"\004\022\n\n\006OBJECT\020\005\022\024\n\020COMPANION_OBJECT\020\006*\006\010d\020" +
"\270\224\001\"\335\002\n\007Package\0229\n\010function\030\003 \003(\0132\'.org." +
"jetbrains.kotlin.metadata.Function\0229\n\010pr" +
"operty\030\004 \003(\0132\'.org.jetbrains.kotlin.meta" +
"data.Property\022<\n\ntype_alias\030\005 \003(\0132(.org." +
"jetbrains.kotlin.metadata.TypeAlias\022<\n\nt" +
"pe\022\034\n\014supertype_id\030\002 \003(\005B\006\020\001\240\265\030\001\022!\n\021nest" +
"ed_class_name\030\007 \003(\005B\006\020\001\210\265\030\001\022?\n\013construct" +
"or\030\010 \003(\0132*.org.jetbrains.kotlin.metadata" +
".Constructor\0229\n\010function\030\t \003(\0132\'.org.jet" +
"brains.kotlin.metadata.Function\0229\n\010prope" +
"rty\030\n \003(\0132\'.org.jetbrains.kotlin.metadat",
"a.Property\022<\n\ntype_alias\030\013 \003(\0132(.org.jet" +
"brains.kotlin.metadata.TypeAlias\022<\n\nenum" +
"_entry\030\r \003(\0132(.org.jetbrains.kotlin.meta" +
"data.EnumEntry\022\'\n\027sealed_subclass_fq_nam" +
"e\030\020 \003(\005B\006\020\001\220\265\030\001\022<\n\ntype_table\030\036 \001(\0132(.or" +
"g.jetbrains.kotlin.metadata.TypeTable\022\033\n" +
"\023version_requirement\030\037 \003(\005\022Y\n\031version_re" +
"quirement_table\030 \001(\01326.org.jetbrains.ko" +
"tlin.metadata.VersionRequirementTable\"x\n" +
"\004Kind\022\t\n\005CLASS\020\000\022\r\n\tINTERFACE\020\001\022\016\n\nENUM_",
"CLASS\020\002\022\016\n\nENUM_ENTRY\020\003\022\024\n\020ANNOTATION_CL" +
"ASS\020\004\022\n\n\006OBJECT\020\005\022\024\n\020COMPANION_OBJECT\020\006*" +
"\006\010d\020\270\224\001\"\335\002\n\007Package\0229\n\010function\030\003 \003(\0132\'." +
"org.jetbrains.kotlin.metadata.Function\0229" +
"\n\010property\030\004 \003(\0132\'.org.jetbrains.kotlin." +
"metadata.Property\022<\n\ntype_alias\030\005 \003(\0132(." +
"org.jetbrains.kotlin.metadata.TypeAlias\022" +
"<\n\ntype_table\030\036 \001(\0132(.org.jetbrains.kotl" +
"in.metadata.TypeTable\022Y\n\031version_require" +
"ment_table\030 \001(\01326.org.jetbrains.kotlin.",
"metadata.VersionRequirementTable*\005\010d\020\310\001\"" +
"`\n\tTypeTable\0221\n\004type\030\001 \003(\0132#.org.jetbrai" +
"ns.kotlin.metadata.Type\022\032\n\016first_nullabl" +
"e\030\002 \001(\005:\002-1:\004\240\273\030\001\"\214\001\n\013Constructor\022\020\n\005fla" +
"gs\030\001 \001(\005:\0016\022F\n\017value_parameter\030\002 \003(\0132-.o" +
"rg.jetbrains.kotlin.metadata.ValueParame" +
"ter\022\033\n\023version_requirement\030\037 \003(\005*\006\010d\020\270\224\001" +
"\"\246\004\n\010Function\022\020\n\005flags\030\t \001(\005:\0016\022\024\n\told_f" +
"lags\030\001 \001(\005:\0016\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\0228\n\013ret" +
"urn_type\030\003 \001(\0132#.org.jetbrains.kotlin.me",
"tadata.Type\022\034\n\016return_type_id\030\007 \001(\005B\004\240\265\030" +
"\001\022D\n\016type_parameter\030\004 \003(\0132,.org.jetbrain" +
"s.kotlin.metadata.TypeParameter\022:\n\rrecei" +
"ver_type\030\005 \001(\0132#.org.jetbrains.kotlin.me" +
"tadata.Type\022\036\n\020receiver_type_id\030\010 \001(\005B\004\240" +
"\265\030\001\022F\n\017value_parameter\030\006 \003(\0132-.org.jetbr" +
"ains.kotlin.metadata.ValueParameter\022<\n\nt" +
"ype_table\030\036 \001(\0132(.org.jetbrains.kotlin.m" +
"etadata.TypeTable\022Y\n\031version_requirement" +
"_table\030 \001(\01326.org.jetbrains.kotlin.meta" +
"data.VersionRequirementTable*\005\010d\020\310\001\"Z\n\tT",
"ypeTable\0221\n\004type\030\001 \003(\0132#.org.jetbrains.k" +
"otlin.metadata.Type\022\032\n\016first_nullable\030\002 " +
"\001(\005:\002-1\"\214\001\n\013Constructor\022\020\n\005flags\030\001 \001(\005:\001" +
"6\022F\n\017value_parameter\030\002 \003(\0132-.org.jetbrai" +
"ns.kotlin.metadata.ValueParameter\022\033\n\023ver" +
"sion_requirement\030\037 \003(\005*\006\010d\020\270\224\001\"\232\004\n\010Funct" +
"ion\022\020\n\005flags\030\t \001(\005:\0016\022\024\n\told_flags\030\001 \001(\005" +
":\0016\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\0228\n\013return_type\030\003" +
"etadata.TypeTable\022\033\n\023version_requirement" +
"\030\037 \003(\005\0229\n\010contract\030 \001(\0132\'.org.jetbrains",
".kotlin.metadata.Contract*\006\010d\020\270\224\001\"\345\003\n\010Pr" +
"operty\022\022\n\005flags\030\013 \001(\005:\003518\022\027\n\told_flags\030" +
"\001 \001(\005:\0042054\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\0228\n\013retur" +
"n_type\030\003 \001(\0132#.org.jetbrains.kotlin.meta" +
"data.Type\022\034\n\016return_type_id\030\t \001(\005B\004\240\265\030\001\022" +
"D\n\016type_parameter\030\004 \003(\0132,.org.jetbrains." +
"kotlin.metadata.TypeParameter\022:\n\rreceive" +
"r_type\030\005 \001(\0132#.org.jetbrains.kotlin.meta" +
"data.Type\022\036\n\020receiver_type_id\030\n \001(\005B\004\240\265\030" +
"\001\022M\n\026setter_value_parameter\030\006 \001(\0132-.org.",
"jetbrains.kotlin.metadata.ValueParameter" +
"\022\024\n\014getter_flags\030\007 \001(\005\022\024\n\014setter_flags\030\010" +
" \001(\005\022\033\n\023version_requirement\030\037 \003(\005*\006\010d\020\270\224" +
"\001\"\357\001\n\016ValueParameter\022\020\n\005flags\030\001 \001(\005:\0010\022\022" +
"\n\004name\030\002 \002(\005B\004\210\265\030\001\0221\n\004type\030\003 \001(\0132#.org.j" +
"etbrains.kotlin.metadata.Type\022\025\n\007type_id" +
"\030\005 \001(\005B\004\240\265\030\001\022@\n\023vararg_element_type\030\004 \001(" +
"\0132#.org.jetbrains.kotlin.metadata.Type\022$" +
"\n\026vararg_element_type_id\030\006 \001(\005B\004\240\265\030\001*\005\010d" +
"\020\310\001\"\226\003\n\tTypeAlias\022\020\n\005flags\030\001 \001(\005:\0016\022\022\n\004n",
"ame\030\002 \002(\005B\004\210\265\030\001\022D\n\016type_parameter\030\003 \003(\0132" +
",.org.jetbrains.kotlin.metadata.TypePara" +
"meter\022<\n\017underlying_type\030\004 \001(\0132#.org.jet" +
"brains.kotlin.metadata.Type\022 \n\022underlyin" +
"g_type_id\030\005 \001(\005B\004\240\265\030\001\022:\n\rexpanded_type\030\006" +
" \001(\0132#.org.jetbrains.kotlin.metadata.Typ" +
"e\022\026\n\016return_type_id\030\007 \001(\005\022D\n\016type_parame",
"ter\030\004 \003(\0132,.org.jetbrains.kotlin.metadat" +
"a.TypeParameter\022:\n\rreceiver_type\030\005 \001(\0132#" +
".org.jetbrains.kotlin.metadata.Type\022\030\n\020r" +
"eceiver_type_id\030\010 \001(\005\022F\n\017value_parameter" +
"\030\006 \003(\0132-.org.jetbrains.kotlin.metadata.V" +
"alueParameter\022<\n\ntype_table\030\036 \001(\0132(.org." +
"jetbrains.kotlin.metadata.TypeTable\022\033\n\023v" +
"ersion_requirement\030\037 \003(\005\0229\n\010contract\030 \001" +
"(\0132\'.org.jetbrains.kotlin.metadata.Contr" +
"act*\006\010d\020\270\224\001\"\331\003\n\010Property\022\022\n\005flags\030\013 \001(\005:",
"\003518\022\027\n\told_flags\030\001 \001(\005:\0042054\022\022\n\004name\030\002 " +
"\002(\005B\004\210\265\030\001\0228\n\013return_type\030\003 \001(\0132#.org.jet" +
"brains.kotlin.metadata.Type\022\026\n\016return_ty" +
"pe_id\030\t \001(\005\022D\n\016type_parameter\030\004 \003(\0132,.or" +
"g.jetbrains.kotlin.metadata.TypeParamete" +
"r\022:\n\rreceiver_type\030\005 \001(\0132#.org.jetbrains" +
".kotlin.metadata.Type\022\030\n\020receiver_type_i" +
"d\030\n \001(\005\022M\n\026setter_value_parameter\030\006 \001(\0132" +
"-.org.jetbrains.kotlin.metadata.ValuePar" +
"ameter\022\024\n\014getter_flags\030\007 \001(\005\022\024\n\014setter_f",
"lags\030\010 \001(\005\022\033\n\023version_requirement\030\037 \003(\005*" +
"\006\010d\020\270\224\001\"\343\001\n\016ValueParameter\022\020\n\005flags\030\001 \001(" +
"\005:\0010\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\0221\n\004type\030\003 \001(\0132#" +
".org.jetbrains.kotlin.metadata.Type\022\017\n\007t" +
"ype_id\030\005 \001(\005\022@\n\023vararg_element_type\030\004 \001(" +
"\0132#.org.jetbrains.kotlin.metadata.Type\022\036" +
"\n\026vararg_element_type_id\030\006 \001(\005*\005\010d\020\310\001\"\212\003" +
"\n\tTypeAlias\022\020\n\005flags\030\001 \001(\005:\0016\022\022\n\004name\030\002 " +
"\002(\005B\004\210\265\030\001\022D\n\016type_parameter\030\003 \003(\0132,.org." +
"jetbrains.kotlin.metadata.TypeParameter\022",
"<\n\017underlying_type\030\004 \001(\0132#.org.jetbrains" +
".kotlin.metadata.Type\022\032\n\022underlying_type" +
"_id\030\005 \001(\005\022:\n\rexpanded_type\030\006 \001(\0132#.org.j" +
"etbrains.kotlin.metadata.Type\022\030\n\020expande" +
"d_type_id\030\007 \001(\005\022=\n\nannotation\030\010 \003(\0132).or" +
"g.jetbrains.kotlin.metadata.Annotation\022\033" +
"\n\023version_requirement\030\037 \003(\005*\005\010d\020\310\001\"&\n\tEn" +
"umEntry\022\022\n\004name\030\001 \001(\005B\004\210\265\030\001*\005\010d\020\310\001\"\225\003\n\022V" +
"ersionRequirement\022\017\n\007version\030\001 \001(\005\022\024\n\014ve" +
"rsion_full\030\002 \001(\005\022M\n\005level\030\003 \001(\01627.org.je",
"tbrains.kotlin.metadata.VersionRequireme" +
"nt.Level:\005ERROR\022\022\n\nerror_code\030\004 \001(\005\022\025\n\007m" +
"essage\030\005 \001(\005B\004\230\265\030\001\022e\n\014version_kind\030\006 \001(\016" +
"2=.org.jetbrains.kotlin.metadata.Version" +
"Requirement.VersionKind:\020LANGUAGE_VERSIO" +
"N\"+\n\005Level\022\013\n\007WARNING\020\000\022\t\n\005ERROR\020\001\022\n\n\006HI" +
"DDEN\020\002\"J\n\013VersionKind\022\024\n\020LANGUAGE_VERSIO" +
"N\020\000\022\024\n\020COMPILER_VERSION\020\001\022\017\n\013API_VERSION" +
"\020\002\"a\n\027VersionRequirementTable\022F\n\013require" +
"ment\030\001 \003(\01321.org.jetbrains.kotlin.metada",
"ta.VersionRequirement\"\217\002\n\017PackageFragmen" +
"t\022;\n\007strings\030\001 \001(\0132*.org.jetbrains.kotli" +
"n.metadata.StringTable\022J\n\017qualified_name" +
"s\030\002 \001(\01321.org.jetbrains.kotlin.metadata." +
"QualifiedNameTable\0227\n\007package\030\003 \001(\0132&.or" +
"g.jetbrains.kotlin.metadata.Package\0223\n\005c" +
"lass\030\004 \003(\0132$.org.jetbrains.kotlin.metada" +
"ta.Class*\005\010d\020\310\001\"A\n\010Contract\0225\n\006effect\030\001 " +
"\003(\0132%.org.jetbrains.kotlin.metadata.Effe" +
"ct\"\306\003\n\006Effect\022E\n\013effect_type\030\001 \001(\01620.org",
".jetbrains.kotlin.metadata.Effect.Effect" +
"Type\022N\n\033effect_constructor_argument\030\002 \003(" +
"\0132).org.jetbrains.kotlin.metadata.Expres" +
"sion\022S\n conclusion_of_conditional_effect" +
"\030\003 \001(\0132).org.jetbrains.kotlin.metadata.E" +
"xpression\022B\n\004kind\030\004 \001(\01624.org.jetbrains." +
"kotlin.metadata.Effect.InvocationKind\"C\n" +
"\nEffectType\022\024\n\020RETURNS_CONSTANT\020\000\022\t\n\005CAL" +
"LS\020\001\022\024\n\020RETURNS_NOT_NULL\020\002\"G\n\016Invocation" +
"Kind\022\020\n\014AT_MOST_ONCE\020\000\022\020\n\014EXACTLY_ONCE\020\001",
"\022\021\n\rAT_LEAST_ONCE\020\002\"\237\003\n\nExpression\022\020\n\005fl" +
"ags\030\001 \001(\005:\0010\022!\n\031value_parameter_referenc" +
"e\030\002 \001(\005\022O\n\016constant_value\030\003 \001(\01627.org.je" +
"tbrains.kotlin.metadata.Expression.Const" +
"antValue\022=\n\020is_instance_type\030\004 \001(\0132#.org" +
".jetbrains.kotlin.metadata.Type\022\033\n\023is_in" +
"stance_type_id\030\005 \001(\005\022?\n\014and_argument\030\006 \003" +
"(\0132).org.jetbrains.kotlin.metadata.Expre" +
"ssion\022>\n\013or_argument\030\007 \003(\0132).org.jetbrai" +
"ns.kotlin.metadata.Expression\".\n\rConstan",
"tValue\022\010\n\004TRUE\020\000\022\t\n\005FALSE\020\001\022\010\n\004NULL\020\002*9\n" +
"\010Modality\022\t\n\005FINAL\020\000\022\010\n\004OPEN\020\001\022\014\n\010ABSTRA" +
"CT\020\002\022\n\n\006SEALED\020\003*b\n\nVisibility\022\014\n\010INTERN" +
"AL\020\000\022\013\n\007PRIVATE\020\001\022\r\n\tPROTECTED\020\002\022\n\n\006PUBL" +
"IC\020\003\022\023\n\017PRIVATE_TO_THIS\020\004\022\t\n\005LOCAL\020\005*Q\n\n" +
"MemberKind\022\017\n\013DECLARATION\020\000\022\021\n\rFAKE_OVER" +
"RIDE\020\001\022\016\n\nDELEGATION\020\002\022\017\n\013SYNTHESIZED\020\003B" +
"\017B\rDebugProtoBuf"
"e\022\036\n\020expanded_type_id\030\007 \001(\005B\004\240\265\030\001\022=\n\nann" +
"otation\030\010 \003(\0132).org.jetbrains.kotlin.met" +
"adata.Annotation\022\033\n\023version_requirement\030" +
"\037 \003(\005*\005\010d\020\310\001\"&\n\tEnumEntry\022\022\n\004name\030\001 \001(\005B",
"\004\210\265\030\001*\005\010d\020\310\001\"\225\003\n\022VersionRequirement\022\017\n\007v" +
"ersion\030\001 \001(\005\022\024\n\014version_full\030\002 \001(\005\022M\n\005le" +
"vel\030\003 \001(\01627.org.jetbrains.kotlin.metadat" +
"a.VersionRequirement.Level:\005ERROR\022\022\n\nerr" +
"or_code\030\004 \001(\005\022\025\n\007message\030\005 \001(\005B\004\230\265\030\001\022e\n\014" +
"version_kind\030\006 \001(\0162=.org.jetbrains.kotli" +
"n.metadata.VersionRequirement.VersionKin" +
"d:\020LANGUAGE_VERSION\"+\n\005Level\022\013\n\007WARNING\020" +
"\000\022\t\n\005ERROR\020\001\022\n\n\006HIDDEN\020\002\"J\n\013VersionKind\022" +
"\024\n\020LANGUAGE_VERSION\020\000\022\024\n\020COMPILER_VERSIO",
"N\020\001\022\017\n\013API_VERSION\020\002\"a\n\027VersionRequireme" +
"ntTable\022F\n\013requirement\030\001 \003(\01321.org.jetbr" +
"ains.kotlin.metadata.VersionRequirement\"" +
"\217\002\n\017PackageFragment\022;\n\007strings\030\001 \001(\0132*.o" +
"rg.jetbrains.kotlin.metadata.StringTable" +
"\022J\n\017qualified_names\030\002 \001(\01321.org.jetbrain" +
"s.kotlin.metadata.QualifiedNameTable\0227\n\007" +
"package\030\003 \001(\0132&.org.jetbrains.kotlin.met" +
"adata.Package\0223\n\005class\030\004 \003(\0132$.org.jetbr" +
"ains.kotlin.metadata.Class*\005\010d\020\310\001\"A\n\010Con",
"tract\0225\n\006effect\030\001 \003(\0132%.org.jetbrains.ko" +
"tlin.metadata.Effect\"\306\003\n\006Effect\022E\n\013effec" +
"t_type\030\001 \001(\01620.org.jetbrains.kotlin.meta" +
"data.Effect.EffectType\022N\n\033effect_constru" +
"ctor_argument\030\002 \003(\0132).org.jetbrains.kotl" +
"in.metadata.Expression\022S\n conclusion_of_" +
"conditional_effect\030\003 \001(\0132).org.jetbrains" +
".kotlin.metadata.Expression\022B\n\004kind\030\004 \001(" +
"\01624.org.jetbrains.kotlin.metadata.Effect" +
".InvocationKind\"C\n\nEffectType\022\024\n\020RETURNS",
"_CONSTANT\020\000\022\t\n\005CALLS\020\001\022\024\n\020RETURNS_NOT_NU" +
"LL\020\002\"G\n\016InvocationKind\022\020\n\014AT_MOST_ONCE\020\000" +
"\022\020\n\014EXACTLY_ONCE\020\001\022\021\n\rAT_LEAST_ONCE\020\002\"\245\003" +
"\n\nExpression\022\020\n\005flags\030\001 \001(\005:\0010\022!\n\031value_" +
"parameter_reference\030\002 \001(\005\022O\n\016constant_va" +
"lue\030\003 \001(\01627.org.jetbrains.kotlin.metadat" +
"a.Expression.ConstantValue\022=\n\020is_instanc" +
"e_type\030\004 \001(\0132#.org.jetbrains.kotlin.meta" +
"data.Type\022!\n\023is_instance_type_id\030\005 \001(\005B\004" +
"\240\265\030\001\022?\n\014and_argument\030\006 \003(\0132).org.jetbrai",
"ns.kotlin.metadata.Expression\022>\n\013or_argu" +
"ment\030\007 \003(\0132).org.jetbrains.kotlin.metada" +
"ta.Expression\".\n\rConstantValue\022\010\n\004TRUE\020\000" +
"\022\t\n\005FALSE\020\001\022\010\n\004NULL\020\002*9\n\010Modality\022\t\n\005FIN" +
"AL\020\000\022\010\n\004OPEN\020\001\022\014\n\010ABSTRACT\020\002\022\n\n\006SEALED\020\003" +
"*b\n\nVisibility\022\014\n\010INTERNAL\020\000\022\013\n\007PRIVATE\020" +
"\001\022\r\n\tPROTECTED\020\002\022\n\n\006PUBLIC\020\003\022\023\n\017PRIVATE_" +
"TO_THIS\020\004\022\t\n\005LOCAL\020\005*Q\n\nMemberKind\022\017\n\013DE" +
"CLARATION\020\000\022\021\n\rFAKE_OVERRIDE\020\001\022\016\n\nDELEGA" +
"TION\020\002\022\017\n\013SYNTHESIZED\020\003B\017B\rDebugProtoBuf"
};
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
@@ -34648,26 +34650,44 @@ public final class DebugProtoBuf {
new java.lang.String[] { "Flags", "ValueParameterReference", "ConstantValue", "IsInstanceType", "IsInstanceTypeId", "AndArgument", "OrArgument", });
org.jetbrains.kotlin.protobuf.ExtensionRegistry registry =
org.jetbrains.kotlin.protobuf.ExtensionRegistry.newInstance();
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipMessageInComparison);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipMessageInComparison);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.fqNameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.stringIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.fqNameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.stringIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.fqNameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.fqNameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.fqNameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.fqNameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipMessageInComparison);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.stringIdInTable);
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor
.internalUpdateFileDescriptor(descriptor, registry);
org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.getDescriptor();

View File

@@ -3,18 +3,16 @@ import org.gradle.plugins.ide.idea.model.IdeaModel
import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import proguard.gradle.ProGuardTask
import org.gradle.kotlin.dsl.*
buildscript {
extra["defaultSnapshotVersion"] = "1.3-SNAPSHOT"
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
// when updating please also update JPS artifacts configuration: https://jetbrains.quip.com/zzGUAYSJ6gv3/JPS-Build-update-bootstrap
kotlinBootstrapFrom(BootstrapOption.TeamCity("1.3.50-dev-526", onlySuccessBootstrap = false))
kotlinBootstrapFrom(BootstrapOption.BintrayBootstrap("1.3.70-eap-145", cacheRedirectorEnabled))
repositories {
bootstrapKotlinRepo?.let(::maven)
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/plugins.gradle.org/m2")
} else {
@@ -38,7 +36,6 @@ buildscript {
}
plugins {
`build-scan`
idea
id("jps-compatible")
id("org.jetbrains.gradle.plugin.idea-ext")
@@ -53,10 +50,7 @@ pill {
)
}
buildScan {
setTermsOfServiceUrl("https://gradle.com/terms-of-service")
setTermsOfServiceAgree("yes")
}
val isTeamcityBuild = project.kotlinBuildProperties.isTeamcityBuild
val configuredJdks: List<JdkId> =
getConfiguredJdks().also {
@@ -115,37 +109,31 @@ 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")
if (isTeamcityBuild) {
extra["JDK_16"] = jdkPath("1.6")
extra["JDK_17"] = jdkPath("1.7")
} else {
extra["JDK_16"] = jdkPath("1.6", "1.8")
extra["JDK_17"] = jdkPath("1.7", "1.8")
}
extra["JDK_18"] = jdkPath("1.8")
extra["JDK_9"] = jdkPath("9")
extra["JDK_10"] = jdkPath("10")
extra["JDK_11"] = jdkPath("11")
gradle.taskGraph.beforeTask() {
// allow opening the project without setting up all env variables (see KT-26413)
if (!kotlinBuildProperties.isInIdeaSync) {
checkJDK()
}
var jdkChecked: Boolean = false
fun checkJDK() {
if (jdkChecked) {
return
val missingEnvVars = JdkMajorVersion.values()
.filter { it.isMandatory() && extra[it.name] == jdkNotFoundConst }
.mapTo(ArrayList()) { it.name }
if (missingEnvVars.isNotEmpty()) {
throw GradleException("Required environment variables are missing: ${missingEnvVars.joinToString()}")
}
val unpresentJdks = JdkMajorVersion.values()
.filter { it.isMandatory() }
.map { it.name }
.filter { extra[it] == jdkNotFoundConst }
.toList()
if (unpresentJdks.isNotEmpty()) {
throw GradleException("Please set environment variable" +
(if (unpresentJdks.size > 1) "s" else "") +
": " + unpresentJdks.joinToString() +
" to point to corresponding JDK installation.")
}
jdkChecked = true
}
rootProject.apply {
@@ -155,7 +143,7 @@ rootProject.apply {
from(rootProject.file("gradle/jps.gradle.kts"))
}
IdeVersionConfigurator.setCurrentIde(this)
IdeVersionConfigurator.setCurrentIde(project)
extra["versions.protobuf"] = "2.6.1"
extra["versions.javax.inject"] = "1"
@@ -177,15 +165,15 @@ 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.completion-ranking-kotlin"] = "0.0.2"
// NOTE: please, also change KTOR_NAME in pathUtil.kt and all versions in corresponding jar names in daemon tests.
extra["versions.ktor-network"] = "1.0.1"
if (!project.hasProperty("versions.kotlin-native")) {
extra["versions.kotlin-native"] = "1.3.50-dev-11052"
extra["versions.kotlin-native"] = "1.3.72"
}
val isTeamcityBuild = project.kotlinBuildProperties.isTeamcityBuild
val intellijUltimateEnabled by extra(project.kotlinBuildProperties.intellijUltimateEnabled)
val effectSystemEnabled by extra(project.getBooleanProperty("kotlin.compiler.effectSystemEnabled") ?: false)
val newInferenceEnabled by extra(project.getBooleanProperty("kotlin.compiler.newInferenceEnabled") ?: false)
@@ -201,11 +189,11 @@ extra["IntellijCoreDependencies"] =
"jdom",
"jna",
"log4j",
"picocontainer",
if (Platform[201].orHigher()) null else "picocontainer",
"snappy-in-java",
"streamex",
"trove4j"
)
).filterNotNull()
extra["compilerModules"] = arrayOf(
@@ -223,10 +211,13 @@ extra["compilerModules"] = arrayOf(
":compiler:ir.backend.common",
":compiler:backend.jvm",
":compiler:backend.js",
":compiler:backend.wasm",
":compiler:ir.serialization.common",
":compiler:ir.serialization.js",
":compiler:ir.serialization.jvm",
":kotlin-util-io",
":kotlin-util-klib",
":kotlin-util-klib-metadata",
":compiler:backend-common",
":compiler:backend",
":compiler:plugin-api",
@@ -246,6 +237,7 @@ extra["compilerModules"] = arrayOf(
":core:metadata.jvm",
":core:descriptors",
":core:descriptors.jvm",
":core:descriptors.runtime",
":core:deserialization",
":core:util.runtime",
":core:type-system",
@@ -253,6 +245,7 @@ extra["compilerModules"] = arrayOf(
":compiler:fir:resolve",
":compiler:fir:tree",
":compiler:fir:psi2fir",
":compiler:fir:lightTree",
":compiler:fir:fir2ir",
":compiler:fir:java"
)
@@ -261,9 +254,7 @@ val coreLibProjects = listOfNotNull(
":kotlin-stdlib",
":kotlin-stdlib-common",
":kotlin-stdlib-js",
// 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-js-ir",
":kotlin-stdlib-jdk7",
":kotlin-stdlib-jdk8",
":kotlin-test:kotlin-test-common",
@@ -271,7 +262,7 @@ val coreLibProjects = listOfNotNull(
":kotlin-test:kotlin-test-junit",
":kotlin-test:kotlin-test-junit5",
":kotlin-test:kotlin-test-testng",
":kotlin-test:kotlin-test-js",
":kotlin-test:kotlin-test-js".takeIf { !kotlinBuildProperties.isInJpsBuildIdeaSync },
":kotlin-reflect"
)
@@ -335,6 +326,7 @@ allprojects {
maven(intellijRepo)
maven("https://dl.bintray.com/kotlin/ktor")
maven("https://kotlin.bintray.com/kotlin-dependencies")
maven("https://jetbrains.bintray.com/intellij-third-party-dependencies")
bootstrapKotlinRepo?.let(::maven)
internalKotlinRepo?.let(::maven)
}
@@ -342,10 +334,10 @@ allprojects {
configureJvmProject(javaHome!!, jvmTarget!!)
val commonCompilerArgs = listOfNotNull(
"-Xallow-kotlin-package",
"-Xuse-experimental=kotlin.Experimental",
"-Xread-deserialized-contracts",
"-Xjvm-default=compatibility",
"-Xprogressive".takeIf { hasProperty("test.progressive.mode") } // TODO: change to "-progressive" after bootstrap
"-progressive".takeIf { hasProperty("test.progressive.mode") }
)
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
@@ -374,11 +366,13 @@ allprojects {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
task("listArchives") { listConfigurationContents("archives") }
tasks {
register("listArchives") { listConfigurationContents("archives") }
task("listRuntimeJar") { listConfigurationContents("runtimeJar") }
register("listRuntimeJar") { listConfigurationContents("runtimeJar") }
task("listDistJar") { listConfigurationContents("distJar") }
register("listDistJar") { listConfigurationContents("distJar") }
}
afterEvaluate {
if (javaHome != defaultJavaHome || jvmTarget != defaultJvmTarget) {
@@ -396,10 +390,12 @@ allprojects {
} catch (_: UnknownDomainObjectException) {
null
}?.let { javaConvention ->
task("printCompileClasspath") { doFirst { javaConvention.sourceSets["main"].compileClasspath.printClassPath("compile") } }
task("printRuntimeClasspath") { doFirst { javaConvention.sourceSets["main"].runtimeClasspath.printClassPath("runtime") } }
task("printTestCompileClasspath") { doFirst { javaConvention.sourceSets["test"].compileClasspath.printClassPath("test compile") } }
task("printTestRuntimeClasspath") { doFirst { javaConvention.sourceSets["test"].runtimeClasspath.printClassPath("test runtime") } }
tasks {
register("printCompileClasspath") { doFirst { javaConvention.sourceSets["main"].compileClasspath.printClassPath("compile") } }
register("printRuntimeClasspath") { doFirst { javaConvention.sourceSets["main"].runtimeClasspath.printClassPath("runtime") } }
register("printTestCompileClasspath") { doFirst { javaConvention.sourceSets["test"].compileClasspath.printClassPath("test compile") } }
register("printTestRuntimeClasspath") { doFirst { javaConvention.sourceSets["test"].runtimeClasspath.printClassPath("test runtime") } }
}
}
run configureCompilerClasspath@{
@@ -407,6 +403,9 @@ allprojects {
configurations.findByName("kotlinCompilerClasspath")?.let {
dependencies.add(it.name, files(bootstrapCompilerClasspath))
}
configurations.findByName("kotlinCompilerPluginClasspath")
?.exclude("org.jetbrains.kotlin", "kotlin-scripting-compiler-embeddable")
}
// Aggregate task for build related checks
@@ -427,13 +426,13 @@ gradle.taskGraph.whenReady {
}
} 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
}
}
}
allTasks.filterIsInstance<org.gradle.jvm.tasks.Jar>().forEach { task ->
task.entryCompression = if (kotlinBuildProperties.jarCompression)
ZipEntryCompression.DEFLATED
else
ZipEntryCompression.STORED
}
}
@@ -453,29 +452,29 @@ val ideaPlugin by task<Task> {
}
tasks {
create("clean") {
register("clean") {
doLast {
delete("$buildDir/repo")
delete(distDir)
}
}
create("cleanupArtifacts") {
register("cleanupArtifacts") {
doLast {
delete(artifactsDir)
}
}
listOf("clean", "assemble", "install", "dist").forEach { taskName ->
create("coreLibs${taskName.capitalize()}") {
register("coreLibs${taskName.capitalize()}") {
coreLibProjects.forEach { projectName -> dependsOn("$projectName:$taskName") }
}
}
create("coreLibsTest") {
register("coreLibsTest") {
(coreLibProjects + listOf(
":kotlin-stdlib:samples",
":kotlin-test:kotlin-test-js:kotlin-test-js-it",
":kotlin-test:kotlin-test-js:kotlin-test-js-it".takeIf { !kotlinBuildProperties.isInJpsBuildIdeaSync },
":kotlinx-metadata-jvm",
":tools:binary-compatibility-validator"
)).forEach {
@@ -483,17 +482,17 @@ tasks {
}
}
create("gradlePluginTest") {
register("gradlePluginTest") {
gradlePluginProjects.forEach {
dependsOn("$it:check")
}
}
create("gradlePluginIntegrationTest") {
register("gradlePluginIntegrationTest") {
dependsOn(":kotlin-gradle-plugin-integration-tests:check")
}
create("jvmCompilerTest") {
register("jvmCompilerTest") {
dependsOn("dist")
dependsOn(
":compiler:test",
@@ -504,77 +503,109 @@ tasks {
dependsOn(":plugins:jvm-abi-gen:test")
}
create("jsCompilerTest") {
register("jvmCompilerIntegrationTest") {
dependsOn(
":kotlin-compiler-embeddable:test",
":kotlin-compiler-client-embeddable:test"
)
}
register("jsCompilerTest") {
dependsOn(":js:js.tests:test")
dependsOn(":js:js.tests:runMocha")
}
create("firCompilerTest") {
register("wasmCompilerTest") {
dependsOn(":js:js.tests:wasmTest")
}
register("firCompilerTest") {
dependsOn(":compiler:fir:psi2fir:test")
dependsOn(":compiler:fir:resolve:test")
dependsOn(":compiler:fir:fir2ir:test")
dependsOn(":compiler:fir:lightTree:test")
}
register("compilerFrontendVisualizerTest") {
dependsOn("compiler:visualizer:test")
}
create("scriptingTest") {
register("scriptingTest") {
dependsOn("dist")
dependsOn(":kotlin-script-util:test")
dependsOn(":kotlin-scripting-compiler:test")
dependsOn(":kotlin-scripting-common:test")
dependsOn(":kotlin-scripting-jvm:test")
dependsOn(":kotlin-scripting-jvm-host-test:test")
dependsOn(":kotlin-scripting-dependencies:test")
dependsOn(":kotlin-scripting-dependencies-maven:test")
dependsOn(":kotlin-scripting-jsr223-test:test")
dependsOn(":kotlin-scripting-jvm-host-test:embeddableTest")
// see comments on the task in kotlin-scripting-jvm-host-test
// dependsOn(":kotlin-scripting-jvm-host-test:embeddableTest")
dependsOn(":kotlin-scripting-jsr223-test:embeddableTest")
dependsOn(":kotlin-main-kts-test:test")
}
create("compilerTest") {
register("compilerTest") {
dependsOn("jvmCompilerTest")
dependsOn("jsCompilerTest")
dependsOn("wasmCompilerTest")
dependsOn("firCompilerTest")
dependsOn("scriptingTest")
dependsOn(":kotlin-build-common:test")
dependsOn(":compiler:incremental-compilation-impl:test")
dependsOn(":core:descriptors.runtime:test")
dependsOn("jvmCompilerIntegrationTest")
}
create("toolsTest") {
register("toolsTest") {
dependsOn(":tools:kotlinp:test")
}
create("examplesTest") {
register("examplesTest") {
dependsOn("dist")
(project(":examples").subprojects + project(":kotlin-gradle-subplugin-example")).forEach { p ->
dependsOn("${p.path}:check")
}
}
create("distTest") {
register("distTest") {
dependsOn("compilerTest")
dependsOn("toolsTest")
dependsOn("gradlePluginTest")
dependsOn("examplesTest")
}
create("specTest") {
register("specTest") {
dependsOn("dist")
dependsOn(":compiler:tests-spec:test")
}
create("androidCodegenTest") {
register("androidCodegenTest") {
dependsOn(":compiler:android-tests:test")
}
create("jps-tests") {
register("jps-tests") {
dependsOn("dist")
dependsOn(":jps-plugin:test")
}
create("idea-plugin-main-tests") {
register("konan-tests") {
dependsOn("dist")
dependsOn(
":kotlin-native:kotlin-native-library-reader:test",
":kotlin-native:commonizer:test"
)
}
register("idea-plugin-main-tests") {
dependsOn("dist")
dependsOn(":idea:test")
}
create("idea-plugin-additional-tests") {
register("idea-plugin-additional-tests") {
dependsOn("dist")
dependsOn(
":idea:idea-gradle:test",
@@ -585,19 +616,29 @@ tasks {
":idea:jvm-debugger:jvm-debugger-core:test",
":idea:jvm-debugger:jvm-debugger-evaluation:test",
":idea:jvm-debugger:jvm-debugger-sequence:test",
":idea:jvm-debugger:eval4j:test"
":idea:jvm-debugger:eval4j:test",
":idea:scripting-support:test"
)
}
create("idea-plugin-tests") {
register("idea-new-project-wizard-tests") {
dependsOn("dist")
dependsOn(
":libraries:tools:new-project-wizard:test",
":libraries:tools:new-project-wizard:new-project-wizard-cli:test"
)
}
register("idea-plugin-tests") {
dependsOn("dist")
dependsOn(
"idea-plugin-main-tests",
"idea-plugin-additional-tests"
"idea-plugin-additional-tests",
"idea-new-project-wizard-tests"
)
}
create("android-ide-tests") {
register("android-ide-tests") {
dependsOn("dist")
dependsOn(
":plugins:android-extensions-ide:test",
@@ -606,7 +647,7 @@ tasks {
)
}
create("plugins-tests") {
register("plugins-tests") {
dependsOn("dist")
dependsOn(
":kotlin-annotation-processing:test",
@@ -617,15 +658,17 @@ tasks {
":plugins:uast-kotlin:test",
":kotlin-annotation-processing-gradle:test",
":kotlinx-serialization-compiler-plugin:test",
":kotlinx-serialization-ide-plugin:test"
":kotlinx-serialization-ide-plugin:test",
":idea:jvm-debugger:jvm-debugger-test:test"
)
}
create("ideaPluginTest") {
register("ideaPluginTest") {
dependsOn(
"idea-plugin-tests",
"jps-tests",
"konan-tests",
"plugins-tests",
"android-ide-tests",
":generators:test"
@@ -633,13 +676,13 @@ tasks {
}
create("test") {
register("test") {
doLast {
throw GradleException("Don't use directly, use aggregate tasks *-check instead")
}
}
create("check") {
register("check") {
dependsOn("test")
}
}
@@ -723,17 +766,27 @@ configure<IdeaModel> {
}
}
fun jdkPath(version: String): String {
fun jdkPathOrNull(version: String): String? {
val jdkName = "JDK_${version.replace(".", "")}"
val jdkMajorVersion = JdkMajorVersion.valueOf(jdkName)
return configuredJdks.find { it.majorVersion == jdkMajorVersion }?.homeDir?.canonicalPath ?: jdkNotFoundConst
return configuredJdks.find { it.majorVersion == jdkMajorVersion }?.homeDir?.canonicalPath
}
fun jdkPath(version: String, vararg replacementVersions: String): String {
return jdkPathOrNull(version) ?: run {
replacementVersions.asSequence().map { jdkPathOrNull(it) }.find { it != null }
} ?: jdkNotFoundConst
}
fun Project.configureJvmProject(javaHome: String, javaVersion: String) {
val currentJavaHome = File(System.getProperty("java.home")!!).canonicalPath
val shouldFork = !currentJavaHome.startsWith(File(javaHome).canonicalPath)
tasks.withType<JavaCompile> {
if (name != "compileJava9Java") {
options.isFork = true
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
options.isFork = shouldFork
options.forkOptions.javaHome = file(javaHome)
options.compilerArgs.add("-proc:none")
options.encoding = "UTF-8"
@@ -749,42 +802,81 @@ fun Project.configureJvmProject(javaHome: String, javaVersion: String) {
tasks.withType<Test> {
executable = File(javaHome, "bin/java").canonicalPath
}
plugins.withId("java-base") {
configureShadowJarSubstitutionInCompileClasspath()
}
}
tasks.create("findShadowJarsInClasspath").doLast {
fun Collection<File>.printSorted(indent: String = " ") {
sortedBy { it.path }.forEach { println(indent + it.relativeTo(rootProject.projectDir)) }
fun Project.configureShadowJarSubstitutionInCompileClasspath() {
val substitutionMap = mapOf(":kotlin-reflect" to ":kotlin-reflect-api")
fun configureSubstitution(substitution: DependencySubstitution) {
val requestedProject = (substitution.requested as? ProjectComponentSelector)?.projectPath ?: return
val replacementProject = substitutionMap[requestedProject] ?: return
substitution.useTarget(project(replacementProject), "Non-default shadow jars should not be used in compile classpath")
}
val shadowJars = hashSetOf<File>()
for (project in rootProject.allprojects) {
for (task in project.tasks) {
when (task) {
is ShadowJar -> {
shadowJars.add(fileFrom(task.archivePath))
}
is ProGuardTask -> {
shadowJars.addAll(task.outputs.files.toList())
}
sourceSets.all {
for (configName in listOf(compileOnlyConfigurationName, compileClasspathConfigurationName)) {
configurations.getByName(configName).resolutionStrategy.dependencySubstitution {
all(::configureSubstitution)
}
}
}
}
println("Shadow jars:")
shadowJars.printSorted()
tasks.register("findShadowJarsInClasspath") {
doLast {
fun Collection<File>.printSorted(indent: String = " ") {
sortedBy { it.path }.forEach { println(indent + it.relativeTo(rootProject.projectDir)) }
}
fun Project.checkConfig(configName: String) {
val config = configurations.findByName(configName) ?: return
val shadowJarsInConfig = config.resolvedConfiguration.files.filter { it in shadowJars }
if (shadowJarsInConfig.isNotEmpty()) {
println()
println("Project $project contains shadow jars in configuration '$configName':")
shadowJarsInConfig.printSorted()
val mainJars = hashSetOf<File>()
val shadowJars = hashSetOf<File>()
for (project in rootProject.allprojects) {
project.withJavaPlugin {
project.sourceSets.forEach { sourceSet ->
val jarTask = project.tasks.findByPath(sourceSet.jarTaskName) as? Jar
jarTask?.outputFile?.let { mainJars.add(it) }
}
}
for (task in project.tasks) {
when (task) {
is ShadowJar -> {
shadowJars.add(fileFrom(task.outputFile))
}
is ProGuardTask -> {
shadowJars.addAll(task.outputs.files.toList())
}
}
}
}
shadowJars.removeAll(mainJars)
println("Shadow jars that might break incremental compilation:")
shadowJars.printSorted()
fun Project.checkConfig(configName: String) {
val config = configurations.findByName(configName) ?: return
val shadowJarsInConfig = config.resolvedConfiguration.files.filter { it in shadowJars }
if (shadowJarsInConfig.isNotEmpty()) {
println()
println("Project $project contains shadow jars in configuration '$configName':")
shadowJarsInConfig.printSorted()
}
}
for (project in rootProject.allprojects) {
project.sourceSetsOrNull?.forEach { sourceSet ->
project.checkConfig(sourceSet.compileClasspathConfigurationName)
}
}
}
for (project in rootProject.allprojects) {
project.checkConfig("compileClasspath")
project.checkConfig("testCompileClasspath")
}
}
val Jar.outputFile: File
get() = archiveFile.get().asFile
val Project.sourceSetsOrNull: SourceSetContainer?
get() = convention.findPlugin(JavaPluginConvention::class.java)?.sourceSets

View File

@@ -1,5 +1,3 @@
import java.util.Properties
extra["versions.shadow"] = "4.0.3"
extra["versions.native-platform"] = "0.14"
@@ -12,8 +10,10 @@ buildscript {
repositories {
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com")
maven("https://cache-redirector.jetbrains.com/kotlin.bintray.com/kotlin-dependencies")
} else {
jcenter()
maven("https://kotlin.bintray.com/kotlin-dependencies")
}
buildSrcKotlinRepo?.let {
@@ -22,6 +22,7 @@ buildscript {
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.6")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$buildSrcKotlinVersion")
classpath("org.jetbrains.kotlin:kotlin-sam-with-receiver:$buildSrcKotlinVersion")
}
@@ -66,10 +67,8 @@ rootProject.apply {
from(rootProject.file("../gradle/versions.gradle.kts"))
}
val flags = LocalBuildProperties(project)
val isTeamcityBuild = flags.isTeamcityBuild
val intellijUltimateEnabled by extra(flags.intellijUltimateEnabled)
val isTeamcityBuild = kotlinBuildProperties.isTeamcityBuild
val intellijUltimateEnabled by extra(kotlinBuildProperties.intellijUltimateEnabled)
val intellijSeparateSdks by extra(project.getBooleanProperty("intellijSeparateSdks") ?: false)
val verifyDependencyOutput by extra( getBooleanProperty("kotlin.build.dependency.output.verification") ?: isTeamcityBuild)
@@ -83,9 +82,10 @@ extra["versions.androidDxSources"] = "5.0.0_r2"
extra["customDepsOrg"] = "kotlin.build"
repositories {
maven("https://jetbrains.bintray.com/intellij-third-party-dependencies/")
maven("https://plugins.gradle.org/m2/")
jcenter()
maven("https://jetbrains.bintray.com/intellij-third-party-dependencies/")
maven("https://kotlin.bintray.com/kotlin-dependencies")
gradlePluginPortal()
extra["buildSrcKotlinRepo"]?.let {
maven(url = it)
@@ -93,16 +93,18 @@ repositories {
}
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")
implementation(kotlin("stdlib", embeddedKotlinVersion))
implementation("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.6")
compile("com.github.jengelman.gradle.plugins:shadow:${property("versions.shadow")}")
compile("org.jetbrains.intellij.deps:asm-all:7.0.1")
implementation("net.rubygrapefruit:native-platform:${property("versions.native-platform")}")
implementation("net.rubygrapefruit:native-platform-windows-amd64:${property("versions.native-platform")}")
implementation("net.rubygrapefruit:native-platform-windows-i386:${property("versions.native-platform")}")
implementation("com.jakewharton.dex:dex-method-list:3.0.0")
compile("gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:0.5")
implementation("com.github.jengelman.gradle.plugins:shadow:${property("versions.shadow")}")
implementation("org.jetbrains.intellij.deps:asm-all:7.0.1")
implementation("gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:0.5")
}
samWithReceiver {
@@ -112,6 +114,11 @@ samWithReceiver {
fun Project.`samWithReceiver`(configure: org.jetbrains.kotlin.samWithReceiver.gradle.SamWithReceiverExtension.() -> Unit): Unit =
extensions.configure("samWithReceiver", configure)
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks["build"].dependsOn(":prepare-deps:build")
allprojects {
@@ -121,30 +128,3 @@ allprojects {
apply(from = "$rootDir/../gradle/cacheRedirector.gradle.kts")
}
}
// TODO: hide these classes in special gradle plugin for kotlin-ultimate which will support local.properties
class LocalBuildPropertiesProvider(private val project: Project) {
private val localProperties: Properties = Properties()
val rootProjectDir: File = project.rootProject.rootDir.parentFile
init {
rootProjectDir.resolve("local.properties").takeIf { it.isFile }?.let {
it.reader().use(localProperties::load)
}
}
fun getString(name: String): String? = project.findProperty(name)?.toString() ?: localProperties[name]?.toString()
fun getBoolean(name: String): Boolean = getString(name)?.toBoolean() == true
}
class LocalBuildProperties(project: Project) {
val propertiesProvider = LocalBuildPropertiesProvider(project)
val isTeamcityBuild = propertiesProvider.getString("teamcity") != null || System.getenv("TEAMCITY_VERSION") != null
val intellijUltimateEnabled =
(propertiesProvider.getBoolean("intellijUltimateEnabled") || isTeamcityBuild)
&& propertiesProvider.rootProjectDir.resolve("kotlin-ultimate").exists()
}

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

@@ -65,6 +65,23 @@ repositories {
artifact()
}
}
ivy {
url = URI("https://dl.bintray.com/kotlin/as/")
patternLayout {
artifact("[artifact]-[revision]-$androidStudioOs.[ext]")
}
credentials {
username = System.getenv("AS_BINTRAY_USER_NAME") ?: findProperty("bintray.user") as String?
password = System.getenv("AS_BINTRAY_API_KEY") ?: findProperty("bintray.apikey") as String?
}
metadataSources {
artifact()
}
}
}
maven("https://www.jetbrains.com/intellij-repository/$intellijReleaseType")
@@ -87,14 +104,18 @@ val nodeJSPlugin by configurations.creating
*/
val intellijRuntimeAnnotations = "intellij-runtime-annotations"
val customDepsRepoDir = rootProject.rootDir.parentFile.resolve("dependencies/repo")
val dependenciesDir = (findProperty("kotlin.build.dependencies.dir") as String?)?.let(::File)
?: rootProject.rootDir.parentFile.resolve("dependencies")
val customDepsRepoDir = dependenciesDir.resolve("repo")
val customDepsOrg: String by rootProject.extra
val customDepsRevision = intellijVersion
val repoDir = File(customDepsRepoDir, customDepsOrg)
dependencies {
if (androidStudioRelease != null) {
val extension = if (androidStudioOs == "linux" && androidStudioRelease.startsWith("3.5"))
val extension = if (androidStudioOs == "linux")
"tar.gz"
else
"zip"
@@ -123,7 +144,7 @@ dependencies {
val makeIntellijCore = buildIvyRepositoryTask(intellijCore, customDepsOrg, customDepsRepoDir)
val makeIntellijAnnotations by tasks.creating(Copy::class.java) {
val makeIntellijAnnotations by tasks.registering(Copy::class) {
dependsOn(makeIntellijCore)
from(repoDir.resolve("intellij-core/$intellijVersion/artifacts/annotations.jar"))
@@ -200,7 +221,7 @@ tasks.named("build") {
}
// Task to delete legacy repo locations
tasks.create("cleanLegacy", Delete::class.java) {
tasks.register<Delete>("cleanLegacy") {
delete("$projectDir/android-dx")
delete("$projectDir/intellij-sdk")
}

View File

@@ -11,54 +11,42 @@ pluginManagement {
}
}
buildscript {
repositories {
if (cacheRedirectorEnabled == 'true') {
maven { url "https://cache-redirector.jetbrains.com/kotlin.bintray.com/kotlin-dependencies" }
} else {
maven { url "https://kotlin.bintray.com/kotlin-dependencies" }
}
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.6")
}
}
def buildProperties = BuildPropertiesKt.getKotlinBuildPropertiesForSettings(settings)
BuildCacheKt.setupBuildCache(settings)
include "prepare-deps"
def flags = new LocalBuildProperties(settings as Settings)
if (flags.includeCidrPlugins) {
if (buildProperties.includeCidrPlugins) {
logger.info("Including CIDR plugins in buildSrc/settings.gradle")
include ":prepare-deps:kotlin-native-platform-deps"
project(":prepare-deps:kotlin-native-platform-deps").projectDir = file("${flags.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/kotlin-native-platform-deps")
project(":prepare-deps:kotlin-native-platform-deps").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/kotlin-native-platform-deps")
} else {
logger.info("NOT including CIDR plugins in buildSrc/settings.gradle")
}
class LocalBuildPropertiesProvider {
private Settings settings
private Properties localProperties = new Properties()
File rootProjectDir
LocalBuildPropertiesProvider(Settings settings) {
this.settings = settings
this.rootProjectDir = settings.rootProject.projectDir.parentFile
File propertiesFile = new File(rootProjectDir, 'local.properties')
if (propertiesFile.isFile()) {
propertiesFile.withInputStream { localProperties.load(it) }
}
}
String getString(String name) {
if (settings.hasProperty(name)) {
return settings[name]?.toString()
} else {
return localProperties[name]?.toString()
}
}
Boolean getBoolean(String name) {
return Boolean.parseBoolean(getString(name))
}
}
class LocalBuildProperties {
LocalBuildPropertiesProvider propertiesProvider
boolean includeCidrPlugins
LocalBuildProperties(Settings settings) {
propertiesProvider = new LocalBuildPropertiesProvider(settings)
includeCidrPlugins = propertiesProvider.getBoolean('cidrPluginsEnabled') && new File(propertiesProvider.rootProjectDir, 'kotlin-ultimate').exists()
}
if (buildProperties.includeUltimate) {
logger.info("Including extension for IJ Ultimate in buildSrc/settings.gradle")
include ":prepare-deps:lldb-frontend"
include ":prepare-deps:native-debug-plugin"
project(":prepare-deps:lldb-frontend").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/lldb-frontend")
project(":prepare-deps:native-debug-plugin").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/native-debug-plugin")
} else {
logger.info("Not including extension for IJ Ultimate in buildSrc/settings.gradle")
}

View File

@@ -2,18 +2,24 @@
import org.gradle.api.Project
import org.gradle.kotlin.dsl.*
import java.net.URI
var Project.bootstrapKotlinVersion: String
get() = this.property("bootstrapKotlinVersion") as String
private set(value) { this.extra["bootstrapKotlinVersion"] = value }
private set(value) {
this.extra["bootstrapKotlinVersion"] = value
}
var Project.bootstrapKotlinRepo: String?
get() = this.property("bootstrapKotlinRepo") as String?
private set(value) { this.extra["bootstrapKotlinRepo"] = value }
private set(value) {
this.extra["bootstrapKotlinRepo"] = value
}
val Project.internalKotlinRepo: String?
get() = bootstrapKotlinRepo?.replace("artifacts/content/maven/", "artifacts/content/internal/repo")
get() = "https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_KotlinPublic_Compiler),number:$bootstrapKotlinVersion," +
"branch:default:any/artifacts/content/internal/repo"
fun Project.kotlinBootstrapFrom(defaultSource: BootstrapOption) {
val customVersion = project.findProperty("bootstrap.kotlin.version") as String?
@@ -23,8 +29,16 @@ fun Project.kotlinBootstrapFrom(defaultSource: BootstrapOption) {
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, teamCityBuild, projectExtId = teamCityProject, onlySuccessBootstrap = false)
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,
teamCityBuild,
projectExtId = teamCityProject,
onlySuccessBootstrap = false
)
customVersion != null -> BootstrapOption.Custom(kotlinVersion = customVersion, repo = customRepo)
else -> defaultSource
}
@@ -40,15 +54,23 @@ sealed class BootstrapOption {
*
* If [repo] is not specified the default buildscript and project repositories are used
*/
open class Custom(val kotlinVersion: String, val repo: String?) : BootstrapOption() {
open class Custom(val kotlinVersion: String, val repo: String?, val cacheRedirector: Boolean = false) : BootstrapOption() {
override fun applyToProject(project: Project) {
project.bootstrapKotlinVersion = kotlinVersion
project.bootstrapKotlinRepo = repo
project.bootstrapKotlinRepo = if (cacheRedirector)
repo?.let { URI(it) }?.let { "https://cache-redirector.jetbrains.com/${it.host}/${it.path}" }
else
repo
}
}
/** Get bootstrap from kotlin-dev bintray repo, where bootstraps are published */
class BintrayDev(kotlinVersion: String) : Custom(kotlinVersion, "https://dl.bintray.com/kotlin/kotlin-dev")
/** Get bootstrap from kotlin-dev bintray repo */
class BintrayDev(kotlinVersion: String, cacheRedirector: Boolean = false) :
Custom(kotlinVersion, "https://dl.bintray.com/kotlin/kotlin-dev", cacheRedirector)
/** Get bootstrap from kotlin-bootstrap bintray repo, where bootstraps are published */
class BintrayBootstrap(kotlinVersion: String, cacheRedirector: Boolean = false) :
Custom(kotlinVersion, "https://dl.bintray.com/kotlin/kotlin-bootstrap", cacheRedirector)
/** Get bootstrap from teamcity maven artifacts of the specified build configuration
*
@@ -57,10 +79,17 @@ sealed class BootstrapOption {
* [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 buildNumber: String? = null, 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,
val teamcityUrl: String = "https://teamcity.jetbrains.com"
) : 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:${buildNumber ?: kotlinVersion},$query/artifacts/content/maven/"
project.bootstrapKotlinRepo = "$teamcityUrl/guestAuth/app/rest/builds/buildType:(id:${projectExtId
?: "Kotlin_dev_Compiler"}),number:${buildNumber ?: kotlinVersion},$query/artifacts/content/maven/"
project.bootstrapKotlinVersion = kotlinVersion
}
}

View File

@@ -10,13 +10,13 @@ import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.SourceSet
import org.gradle.api.tasks.SourceSetContainer
import org.gradle.api.tasks.SourceSetOutput
import org.gradle.kotlin.dsl.creating
import org.gradle.kotlin.dsl.extra
import org.gradle.kotlin.dsl.the
import org.gradle.kotlin.dsl.*
import java.io.File
import java.util.concurrent.Callable
inline fun <reified T : Task> Project.task(noinline configuration: T.() -> Unit) = tasks.creating(T::class, configuration)
inline fun <reified T : Task> Project.task(noinline configuration: T.() -> Unit) = tasks.registering(T::class, configuration)
inline fun <reified T : Task> Project.eagerTask(noinline configuration: T.() -> Unit) = tasks.creating(T::class, configuration)
fun Project.callGroovy(name: String, vararg args: Any?): Any? {
return (property(name) as Closure<*>).call(*args)
@@ -67,3 +67,5 @@ fun Project.getBooleanProperty(name: String): Boolean? = this.findProperty(name)
inline fun CopySourceSpec.from(crossinline filesProvider: () -> Any?): CopySourceSpec = from(Callable { filesProvider() })
fun Project.javaPluginConvention(): JavaPluginConvention = the()
fun Project.findJavaPluginConvention(): JavaPluginConvention? = convention.findByType() ?: convention.findPlugin()

View File

@@ -26,7 +26,7 @@ fun CompatibilityPredicate.or(other: CompatibilityPredicate): CompatibilityPredi
}
enum class Platform : CompatibilityPredicate {
P181, P182, P183, P191, P192;
P183, P191, P192, P193, P201;
val version: Int = name.drop(1).toInt()
@@ -41,16 +41,16 @@ enum class Platform : CompatibilityPredicate {
}
enum class Ide(val platform: Platform) : CompatibilityPredicate {
IJ181(Platform.P181),
IJ182(Platform.P182),
IJ183(Platform.P183),
IJ191(Platform.P191),
IJ192(Platform.P192),
IJ193(Platform.P193),
IJ201(Platform.P201),
AS32(Platform.P181),
AS33(Platform.P182),
AS34(Platform.P183),
AS35(Platform.P183);
AS35(Platform.P183),
AS36(Platform.P192),
AS40(Platform.P193);
val kind = Kind.values().first { it.shortName == name.take(2) }
val version = name.dropWhile { !it.isDigit() }.toInt()

View File

@@ -1,6 +1,7 @@
import org.gradle.api.Project
import org.gradle.api.tasks.JavaExec
import org.gradle.jvm.tasks.Jar
import org.gradle.kotlin.dsl.creating
import org.gradle.kotlin.dsl.task
/*
@@ -8,7 +9,8 @@ import org.gradle.kotlin.dsl.task
* 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> {
// creating class eagerly here: using register causes problems due to quite complicated relationships between these tasks
fun Project.smartJavaExec(configure: JavaExec.() -> Unit) = tasks.creating(JavaExec::class) {
configure()
passClasspathInJar()
}

View File

@@ -8,17 +8,12 @@ import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.ConfigurationContainer
import org.gradle.api.artifacts.component.ProjectComponentIdentifier
import org.gradle.api.file.DuplicatesStrategy
import org.gradle.api.file.SourceDirectorySet
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.TaskProvider
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
private const val MAGIC_DO_NOT_CHANGE_TEST_JAR_TASK_NAME = "testJar"
@@ -52,11 +47,11 @@ fun Project.removeArtifacts(configuration: Configuration, task: Task) {
}
fun Project.noDefaultJar() {
tasks.findByName("jar")?.let { defaultJarTask ->
defaultJarTask.enabled = false
defaultJarTask.actions = emptyList()
tasks.named("jar").configure {
enabled = false
actions = emptyList()
configurations.forEach { cfg ->
removeArtifacts(cfg, defaultJarTask)
removeArtifacts(cfg, this)
}
}
}
@@ -69,12 +64,11 @@ fun Project.runtimeJarArtifactBy(task: Task, artifactRef: Any, body: Configurabl
}
}
fun <T : Jar> Project.runtimeJar(task: T, body: T.() -> Unit = {}): T {
extra["runtimeJarTask"] = task
tasks.findByName("jar")?.let { defaultJarTask ->
removeArtifacts(configurations.getOrCreate("archives"), defaultJarTask)
fun <T : Jar> Project.runtimeJar(task: TaskProvider<T>, body: T.() -> Unit = {}): TaskProvider<T> {
tasks.named<Jar>("jar").configure {
removeArtifacts(configurations.getOrCreate("archives"), this)
}
return task.apply {
task.configure {
configurations.findByName("embedded")?.let { embedded ->
dependsOn(embedded)
from {
@@ -86,9 +80,10 @@ fun <T : Jar> Project.runtimeJar(task: T, body: T.() -> Unit = {}): T {
body()
project.runtimeJarArtifactBy(this, this)
}
return task
}
fun Project.runtimeJar(body: Jar.() -> Unit = {}): Jar = runtimeJar(getOrCreateTask("jar", body), { })
fun Project.runtimeJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> = runtimeJar(getOrCreateTask("jar", body), { })
fun Project.sourcesJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> {
val task = tasks.register<Jar>("sourcesJar") {
@@ -103,7 +98,12 @@ fun Project.sourcesJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> {
.resolvedArtifacts
.map { it.id.componentIdentifier }
.filterIsInstance<ProjectComponentIdentifier>()
.map { project(it.projectPath).mainSourceSet.allSource }
.mapNotNull {
project(it.projectPath)
.findJavaPluginConvention()
?.mainSourceSet
?.allSource
}
})
}
@@ -116,15 +116,19 @@ fun Project.sourcesJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> {
return task
}
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)
fun Project.javadocJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> {
val javadocTask = getOrCreateTask<Jar>("javadocJar") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set("javadoc")
tasks.findByName("javadoc")?.let { it as Javadoc }?.takeIf { it.enabled }?.let {
dependsOn(it)
from(it.destinationDir)
}
body()
}
body()
project.addArtifact("archives", this, this)
addArtifact("archives", javadocTask)
return javadocTask
}
@@ -151,11 +155,6 @@ fun Project.publish(body: Upload.() -> Unit = {}): Upload {
}
}
private fun Project.runtimeJarTaskIfExists(): Task? =
if (extra.has("runtimeJarTask")) extra["runtimeJarTask"] as Task
else tasks.findByName("jar")
fun ConfigurationContainer.getOrCreate(name: String): Configuration = findByName(name) ?: create(name)
fun Jar.setupPublicJar(baseName: String, classifier: String = "") {

View File

@@ -1,115 +0,0 @@
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, default: Boolean = false): Boolean =
(this[key]?.toString()?.toBoolean() ?: default) == 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 && getBoolean("kotlin.build.java9", true)
val useBootstrapStdlib: Boolean
get() = isInJpsBuildIdeaSync || getBoolean("kotlin.build.useBootstrapStdlib", false)
val kotlinUltimateExists: Boolean = propertiesProvider.rootProjectDir.resolve("kotlin-ultimate").exists()
val includeCidrPlugins: Boolean = kotlinUltimateExists && getBoolean("cidrPluginsEnabled")
val isTeamcityBuild: Boolean = getBoolean("teamcity") || System.getenv("TEAMCITY_VERSION") != null
val intellijUltimateEnabled: Boolean
get() {
val explicitlyEnabled = getBoolean("intellijUltimateEnabled")
if (!kotlinUltimateExists && explicitlyEnabled) {
error("intellijUltimateEnabled property is set, while kotlin-ultimate repository is not provided")
}
return kotlinUltimateExists && (explicitlyEnabled || isTeamcityBuild)
}
val postProcessing: Boolean get() = isTeamcityBuild || getBoolean("kotlin.build.postprocessing", true)
val relocation: Boolean get() = postProcessing
val proguard: Boolean get() = postProcessing && getBoolean("kotlin.build.proguard")
val jsIrDist: Boolean get() = getBoolean("kotlin.stdlib.js.ir.dist")
}
private const val extensionName = "kotlinBuildProperties"
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

@@ -8,6 +8,7 @@ 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.file.FileCollection
import org.gradle.api.tasks.AbstractCopyTask
import org.gradle.kotlin.dsl.extra
import org.gradle.kotlin.dsl.project
@@ -128,7 +129,9 @@ fun Project.firstFromJavaHomeThatExists(vararg paths: String, jdkHome: File = Fi
logger.warn("Cannot find file by paths: ${paths.toList()} in $jdkHome")
}
fun Project.toolsJar(jdkHome: File = File(this.property("JDK_18") as String)): File? =
fun Project.toolsJar(): FileCollection = files(toolsJarFile() ?: error("tools.jar is not found!"))
fun Project.toolsJarFile(jdkHome: File = File(this.property("JDK_18") as String)): File? =
firstFromJavaHomeThatExists("lib/tools.jar", jdkHome = jdkHome)
val compilerManifestClassPath

View File

@@ -3,8 +3,8 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.Project
import org.gradle.api.file.DuplicatesStrategy
import org.gradle.api.tasks.TaskProvider
import org.gradle.jvm.tasks.Jar
import org.gradle.kotlin.dsl.task
import org.gradle.kotlin.dsl.*
import java.io.File
@@ -19,7 +19,9 @@ val packagesToRelocate =
"org.picocontainer",
"org.jline",
"org.fusesource",
"kotlinx.coroutines")
"kotlinx.coroutines",
"net.jpountz",
"one.util.streamex")
// The shaded compiler "dummy" is used to rewrite dependencies in projects that are used with the embeddable compiler
// on the runtime and use some shaded dependencies from the compiler
@@ -57,12 +59,12 @@ private fun ShadowJar.configureEmbeddableCompilerRelocation(withJavaxInject: Boo
}
}
private fun Project.compilerShadowJar(taskName: String, body: ShadowJar.() -> Unit): Jar {
private fun Project.compilerShadowJar(taskName: String, body: ShadowJar.() -> Unit): TaskProvider<out ShadowJar> {
val compilerJar = configurations.getOrCreate("compilerJar")
dependencies.add(compilerJar.name, dependencies.project(":kotlin-compiler", configuration = "runtimeJar"))
return task<ShadowJar>(taskName) {
return tasks.register<ShadowJar>(taskName) {
destinationDir = File(buildDir, "libs")
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
from(compilerJar)
@@ -70,31 +72,39 @@ private fun Project.compilerShadowJar(taskName: String, body: ShadowJar.() -> Un
}
}
fun Project.embeddableCompiler(taskName: String = "embeddable", body: ShadowJar.() -> Unit = {}): Jar =
compilerShadowJar(taskName) {
configureEmbeddableCompilerRelocation()
body()
}
fun Project.embeddableCompiler(taskName: String = "embeddable", body: ShadowJar.() -> Unit = {}): TaskProvider<out ShadowJar> =
compilerShadowJar(taskName) {
configureEmbeddableCompilerRelocation()
body()
}
fun Project.compilerDummyForDependenciesRewriting(taskName: String = "compilerDummy", body: ShadowJar.() -> Unit = {}): Jar =
compilerShadowJar(taskName) {
exclude(packagesToExcludeFromDummy)
body()
}
fun Project.compilerDummyForDependenciesRewriting(
taskName: String = "compilerDummy", body: ShadowJar.() -> Unit = {}
): TaskProvider<out Jar> =
compilerShadowJar(taskName) {
exclude(packagesToExcludeFromDummy)
body()
}
const val COMPILER_DUMMY_JAR_CONFIGURATION_NAME = "compilerDummyJar"
fun Project.compilerDummyJar(task: Jar, body: Jar.() -> Unit = {}) {
task.body()
addArtifact(COMPILER_DUMMY_JAR_CONFIGURATION_NAME, task, task)
fun Project.compilerDummyJar(task: TaskProvider<out Jar>, body: Jar.() -> Unit = {}) {
task.configure(body)
task.configure {
addArtifact(COMPILER_DUMMY_JAR_CONFIGURATION_NAME, this, this)
}
}
fun Project.embeddableCompilerDummyForDependenciesRewriting(taskName: String = "embeddable", body: Jar.() -> Unit = {}): Jar {
fun Project.embeddableCompilerDummyForDependenciesRewriting(
taskName: String = "embeddable", body: Jar.() -> Unit = {}
): TaskProvider<ShadowJar> {
val compilerDummyJar = configurations.getOrCreate("compilerDummyJar")
dependencies.add(compilerDummyJar.name,
dependencies.project(":kotlin-compiler-embeddable", configuration = COMPILER_DUMMY_JAR_CONFIGURATION_NAME))
dependencies.add(
compilerDummyJar.name,
dependencies.project(":kotlin-compiler-embeddable", configuration = COMPILER_DUMMY_JAR_CONFIGURATION_NAME)
)
return task<ShadowJar>(taskName) {
return tasks.register<ShadowJar>(taskName) {
destinationDir = File(buildDir, "libs")
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
from(compilerDummyJar)
@@ -103,14 +113,16 @@ fun Project.embeddableCompilerDummyForDependenciesRewriting(taskName: String = "
}
}
fun Project.rewriteDepsToShadedJar(originalJarTask: Jar, shadowJarTask: Jar, body: Jar.() -> Unit = {}): Jar {
originalJarTask.apply {
fun Project.rewriteDepsToShadedJar(
originalJarTask: TaskProvider<out Jar>, shadowJarTask: TaskProvider<out Jar>, body: Jar.() -> Unit = {}
): TaskProvider<out Jar> {
originalJarTask.configure {
classifier = "original"
}
val compilerDummyJarFile by lazy { configurations.getAt("compilerDummyJar").singleFile }
return shadowJarTask.apply {
shadowJarTask.configure {
dependsOn(originalJarTask)
from(originalJarTask)// { include("**") }
@@ -121,7 +133,11 @@ fun Project.rewriteDepsToShadedJar(originalJarTask: Jar, shadowJarTask: Jar, bod
classifier = ""
body()
}
return shadowJarTask
}
fun Project.rewriteDepsToShadedCompiler(originalJarTask: Jar, body: Jar.() -> Unit = {}): Jar =
rewriteDepsToShadedJar(originalJarTask, embeddableCompilerDummyForDependenciesRewriting(), body)
fun Project.rewriteDepsToShadedCompiler(originalJarTask: TaskProvider<out Jar>, body: Jar.() -> Unit = {}): TaskProvider<out Jar> =
rewriteDepsToShadedJar(originalJarTask, embeddableCompilerDummyForDependenciesRewriting(), body)
fun Project.rewriteDefaultJarDepsToShadedCompiler(body: Jar.() -> Unit = {}): TaskProvider<out Jar> =
rewriteDepsToShadedJar(tasks.named<Jar>("jar"), embeddableCompilerDummyForDependenciesRewriting(), body)

View File

@@ -44,10 +44,29 @@ fun Project.configureFormInstrumentation() {
// classes from the "friendly directory" to the compile classpath.
val testCompile = tasks.findByName("compileTestKotlin") as AbstractCompile?
testCompile?.doFirst {
val originalClassesDirs = files((mainSourceSet as ExtensionAware).extra.get("classesDirsCopy"))
testCompile.classpath = (testCompile.classpath
- mainSourceSet.output.classesDirs
+ files((mainSourceSet as ExtensionAware).extra.get("classesDirsCopy")))
+ originalClassesDirs)
// Since Kotlin 1.3.60, the friend paths available to the test compile task are calculated as the main source set's
// output.classesDirs. Since the classesDirs are excluded from the classpath (replaced by the originalClassesDirs),
// in order to be able to access the internals of 'main', tests need to receive the original classes dirs as a
// -Xfriend-paths compiler argument as well.
fun addFreeCompilerArgs(kotlinCompileTask: AbstractCompile, vararg args: String) {
val getKotlinOptions = kotlinCompileTask::class.java.getMethod("getKotlinOptions")
val kotlinOptions = getKotlinOptions(kotlinCompileTask)
val getFreeCompilerArgs = kotlinOptions::class.java.getMethod("getFreeCompilerArgs")
val freeCompilerArgs = getFreeCompilerArgs(kotlinOptions) as List<*>
val setFreeCompilerArgs = kotlinOptions::class.java.getMethod("setFreeCompilerArgs", List::class.java)
setFreeCompilerArgs(kotlinOptions, freeCompilerArgs + args)
}
addFreeCompilerArgs(testCompile, "-Xfriend-paths=" + originalClassesDirs.joinToString(",") { it.absolutePath })
}
}
val instrumentationClasspathCfg = configurations.create("instrumentationClasspath")
@@ -68,16 +87,15 @@ fun Project.configureFormInstrumentation() {
val instrumentedClassesDir = File(project.buildDir, "classes/${sourceSetParam.name}-instrumented")
(sourceSetParam.output.classesDirs as ConfigurableFileCollection).setFrom(instrumentedClassesDir)
val instrumentTask =
project.tasks.create(sourceSetParam.getTaskName("instrument", "classes"), IntelliJInstrumentCodeTask::class.java)
instrumentTask.apply {
dependsOn(sourceSetParam.classesTaskName).onlyIf { !classesDirsCopy.isEmpty }
sourceSet = sourceSetParam
instrumentationClasspath = instrumentationClasspathCfg
originalClassesDirs = classesDirsCopy
output = instrumentedClassesDir
}
project.tasks.register(sourceSetParam.getTaskName("instrument", "classes"), IntelliJInstrumentCodeTask::class.java) {
dependsOn(sourceSetParam.classesTaskName).onlyIf { !classesDirsCopy.isEmpty }
sourceSet = sourceSetParam
instrumentationClasspath = instrumentationClasspathCfg
originalClassesDirs = classesDirsCopy
output = instrumentedClassesDir
outputs.dir(instrumentedClassesDir)
}
instrumentTask.outputs.dir(instrumentedClassesDir)
// Ensure that our task is invoked when the source set is built
sourceSetParam.compiledBy(instrumentTask)
@Suppress("UNUSED_EXPRESSION")
@@ -93,17 +111,21 @@ open class IntelliJInstrumentCodeTask : ConventionTask() {
private const val LOADER_REF = "java2.loader"
}
var sourceSet: SourceSet? = null
@Classpath
var instrumentationClasspath: Configuration? = null
@Input
@InputFiles
@PathSensitive(PathSensitivity.RELATIVE)
var originalClassesDirs: FileCollection? = null
@get:Input
var instrumentNotNull: Boolean = false
@Internal
var sourceSet: SourceSet? = null
@get:InputFiles
@get:PathSensitive(PathSensitivity.RELATIVE)
val sourceDirs: FileCollection
get() = project.files(sourceSet!!.allSource.srcDirs.filter { !sourceSet!!.resources.contains(it) && it.exists() })

View File

@@ -4,6 +4,7 @@ import net.rubygrapefruit.platform.Native
import net.rubygrapefruit.platform.WindowsRegistry
import org.gradle.api.GradleException
import org.gradle.api.Project
import java.nio.file.Paths
import java.io.File
import net.rubygrapefruit.platform.WindowsRegistry.Key.HKEY_LOCAL_MACHINE
import org.gradle.internal.os.OperatingSystem
@@ -25,7 +26,7 @@ fun Project.getConfiguredJdks(): List<JdkId> {
?: System.getenv(jdkMajorVersion.name)
?: jdkAlternativeVarNames[jdkMajorVersion]?.mapNotNull { System.getenv(it) }?.firstOrNull()
?: continue
val explicitJdk = File(explicitJdkEnvVal)
val explicitJdk = Paths.get(explicitJdkEnvVal).toRealPath().toFile()
if (!explicitJdk.isDirectory) {
throw GradleException("Invalid environment value $jdkMajorVersion: $explicitJdkEnvVal, expecting JDK home path")
}

View File

@@ -23,10 +23,16 @@ import org.gradle.api.artifacts.ModuleDependency
import org.gradle.api.artifacts.dsl.RepositoryHandler
import org.gradle.api.artifacts.repositories.IvyArtifactRepository
import org.gradle.api.tasks.JavaExec
import org.gradle.kotlin.dsl.*
import org.gradle.api.tasks.TaskProvider
import org.gradle.kotlin.dsl.DependencyHandlerScope
import org.gradle.kotlin.dsl.extra
import org.gradle.kotlin.dsl.register
import java.io.File
private fun Project.kotlinBuildLocalRepoDir() = File("${project.rootDir.absoluteFile}/dependencies/repo")
private fun Project.kotlinBuildLocalDependenciesDir(): File =
(findProperty("kotlin.build.dependencies.dir") as String?)?.let(::File) ?: project.rootDir.absoluteFile.resolve("dependencies")
private fun Project.kotlinBuildLocalRepoDir(): File = kotlinBuildLocalDependenciesDir().resolve("repo")
private fun Project.ideModuleName() = when (IdeVersionConfigurator.currentIde.kind) {
Ide.Kind.AndroidStudio -> "android-studio-ide"
@@ -151,9 +157,9 @@ fun DependencyHandlerScope.excludeInAndroidStudio(rootProject: Project, block: D
}
}
fun Project.runIdeTask(name: String, ideaPluginDir: File, ideaSandboxDir: File, body: JavaExec.() -> Unit): JavaExec {
fun Project.runIdeTask(name: String, ideaPluginDir: File, ideaSandboxDir: File, body: JavaExec.() -> Unit): TaskProvider<JavaExec> {
return task<JavaExec>(name) {
return tasks.register<JavaExec>(name) {
val ideaSandboxConfigDir = File(ideaSandboxDir, "config")
classpath = mainSourceSet.runtimeClasspath
@@ -167,6 +173,7 @@ fun Project.runIdeTask(name: String, ideaPluginDir: File, ideaSandboxDir: File,
"-XX:ReservedCodeCacheSize=240m",
"-XX:+HeapDumpOnOutOfMemoryError",
"-ea",
"-Didea.platform.prefix=Idea",
"-Didea.debug.mode=true",
"-Didea.system.path=$ideaSandboxDir",
"-Didea.config.path=$ideaSandboxConfigDir",

View File

@@ -129,15 +129,14 @@ fun parse(project: Project, libraries: List<PLibrary>, context: ParserContext):
('idea' module has 'intellij-core' as transitive dependency, and we really need to get rid of it.)
*/
private val CONFIGURATION_MAPPING = mapOf(
listOf("runtime") to Scope.RUNTIME,
listOf("compile", "embedded") to Scope.COMPILE,
listOf("compileOnly") to Scope.PROVIDED
listOf("runtimeClasspath") to Scope.RUNTIME,
listOf("compileClasspath", "compileOnly") to Scope.PROVIDED,
listOf("embedded") to Scope.COMPILE
)
private val TEST_CONFIGURATION_MAPPING = mapOf(
listOf("runtime", "testRuntime") to Scope.RUNTIME,
listOf("compile", "testCompile") to Scope.COMPILE,
listOf("compileOnly", "testCompileOnly") to Scope.PROVIDED,
listOf("runtimeClasspath", "testRuntimeClasspath") to Scope.RUNTIME,
listOf("compileClasspath", "testCompileClasspath", "compileOnly", "testCompileOnly") to Scope.PROVIDED,
listOf("jpsTest") to Scope.TEST
)

View File

@@ -98,6 +98,7 @@ class JpsCompatiblePlugin : Plugin<Project> {
private lateinit var platformVersion: String
private lateinit var platformBaseNumber: String
private lateinit var platformDir: File
private lateinit var intellijCoreDir: File
private var isAndroidStudioPlatform: Boolean = false
private fun initEnvironment(project: Project) {
@@ -107,6 +108,7 @@ class JpsCompatiblePlugin : Plugin<Project> {
?: platformVersion.substringBefore("-", "").takeIf { it.isNotEmpty() }
?: error("Invalid platform version: $platformVersion")
platformDir = IntellijRootUtils.getIntellijRootDir(project)
intellijCoreDir = File(platformDir.parentFile.parentFile.parentFile, "intellij-core")
isAndroidStudioPlatform = project.extensions.extraProperties.has("versions.androidStudioRelease")
}
@@ -229,6 +231,7 @@ class JpsCompatiblePlugin : Plugin<Project> {
val platformDirProjectRelative = "\$PROJECT_DIR\$/" + platformDir.toRelativeString(projectDir)
val runManagerComponent = rootElement.getOrCreateChild("component", "name" to "RunManager")
val junitConfiguration = runManagerComponent.getOrCreateChild(
"configuration",
"default" to "true",
@@ -236,7 +239,14 @@ class JpsCompatiblePlugin : Plugin<Project> {
"factoryName" to "JUnit"
)
junitConfiguration.apply {
val kotlinJunitConfiguration = runManagerComponent.getOrCreateChild(
"configuration",
"default" to "true",
"type" to "KotlinJUnit",
"factoryName" to "Kotlin JUnit"
)
fun Element.applyJUnitTemplate() {
getOrCreateChild("option", "name" to "WORKING_DIRECTORY").setAttribute("value", "file://\$PROJECT_DIR\$")
getOrCreateChild("option", "name" to "VM_PARAMETERS").also { vmParams ->
var options = vmParams.getAttributeValue("value", "")
@@ -249,18 +259,12 @@ class JpsCompatiblePlugin : Plugin<Project> {
options = if (value == null) optionsWithoutNewValue else (optionsWithoutNewValue + listOf("-D$name=$value"))
}
val robolectricClasspath = project.rootProject
.project(":plugins:android-extensions-compiler")
.configurations.getByName("robolectricClasspath")
.files.joinToString(File.pathSeparator)
if (options.none { it == "-ea" }) {
options += "-ea"
}
addOrReplaceOptionValue("idea.home.path", platformDirProjectRelative)
addOrReplaceOptionValue("ideaSdk.androidPlugin.path", platformDirProjectRelative + "/plugins/android/lib")
addOrReplaceOptionValue("robolectric.classpath", robolectricClasspath)
addOrReplaceOptionValue("use.jps", "true")
addOrReplaceOptionValue("kotlinVersion", project.rootProject.extra["kotlinVersion"].toString())
@@ -279,6 +283,9 @@ class JpsCompatiblePlugin : Plugin<Project> {
}
}
junitConfiguration.applyJUnitTemplate()
kotlinJunitConfiguration.applyJUnitTemplate()
val output = XMLOutputter().also {
it.format = Format.getPrettyFormat().apply {
setEscapeStrategy { Verifier.isHighSurrogate(it) || it == '"' }
@@ -300,7 +307,7 @@ class JpsCompatiblePlugin : Plugin<Project> {
private fun attachPlatformSources(library: PLibrary): PLibrary {
val platformSourcesJar = File(platformDir, "../../../sources/intellij-$platformVersion-sources.jar")
if (library.classes.any { it.startsWith(platformDir) }) {
if (library.classes.any { it.startsWith(platformDir) || it.startsWith(intellijCoreDir) }) {
return library.attachSource(platformSourcesJar)
}

View File

@@ -4,9 +4,10 @@ import org.codehaus.groovy.runtime.InvokerHelper
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.Dependency
import org.gradle.api.artifacts.maven.Conf2ScopeMappingContainer
import org.gradle.api.artifacts.maven.MavenDeployment
import org.gradle.api.artifacts.maven.MavenResolver
import org.gradle.api.plugins.MavenPluginConvention
import org.gradle.api.plugins.MavenRepositoryHandlerConvention
import org.gradle.api.publication.maven.internal.deployer.MavenRemoteRepository
import org.gradle.api.tasks.Upload
@@ -30,6 +31,12 @@ open class PublishedKotlinModule : Plugin<Project> {
plugins.apply("maven")
val publishedRuntime by configurations.creating {
the<MavenPluginConvention>()
.conf2ScopeMappings
.addMapping(0, this, Conf2ScopeMappingContainer.RUNTIME)
}
if (!project.hasProperty("prebuiltJar")) {
plugins.apply("signing")
@@ -41,7 +48,7 @@ open class PublishedKotlinModule : Plugin<Project> {
sign(configurations["archives"])
}
(tasks.getByName("signArchives") as Sign).apply {
tasks.named<Sign>("signArchives").configure {
enabled = signingRequired
}
}
@@ -98,9 +105,9 @@ open class PublishedKotlinModule : Plugin<Project> {
}
}
val preparePublication = project.rootProject.tasks.getByName("preparePublication")
tasks.named<Upload>("uploadArchives").configure {
val uploadArchives = (tasks.getByName("uploadArchives") as Upload).apply {
val preparePublication = project.rootProject.tasks.named("preparePublication").get()
dependsOn(preparePublication)
@@ -152,8 +159,8 @@ open class PublishedKotlinModule : Plugin<Project> {
}
}
tasks.create("publish") {
dependsOn(uploadArchives)
tasks.register("publish") {
dependsOn(tasks.named("uploadArchives"))
}
}
}

View File

@@ -0,0 +1,25 @@
import org.gradle.api.Action
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.NamedDomainObjectProvider
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.Dependency
import org.gradle.api.artifacts.ExternalModuleDependency
import org.gradle.api.artifacts.dsl.DependencyHandler
import org.gradle.kotlin.dsl.accessors.runtime.addDependencyTo
/*
* 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.
*/
val NamedDomainObjectContainer<Configuration>.publishedRuntime: NamedDomainObjectProvider<Configuration> get() = named("publishedRuntime")
fun DependencyHandler.publishedRuntime(dependencyNotation: Any): Dependency? =
add("publishedRuntime", dependencyNotation)
fun DependencyHandler.publishedRuntime(
dependencyNotation: String,
dependencyConfiguration: Action<ExternalModuleDependency>
): ExternalModuleDependency =
addDependencyTo(this, "publishedRuntime", dependencyNotation, dependencyConfiguration)

View File

@@ -1,4 +1,5 @@
import org.gradle.api.Project
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.SourceSet
import org.gradle.api.tasks.SourceSetContainer
@@ -37,7 +38,13 @@ val Project.sourceSets: SourceSetContainer
get() = javaPluginConvention().sourceSets
val Project.mainSourceSet: SourceSet
get() = sourceSets.getByName("main")
get() = javaPluginConvention().mainSourceSet
val Project.testSourceSet: SourceSet
get() = javaPluginConvention().testSourceSet
val JavaPluginConvention.mainSourceSet: SourceSet
get() = sourceSets.getByName("main")
val JavaPluginConvention.testSourceSet: SourceSet
get() = sourceSets.getByName("test")

View File

@@ -21,19 +21,24 @@
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.internal.tasks.testing.filter.DefaultTestFilter
import org.gradle.api.tasks.TaskProvider
import org.gradle.api.tasks.testing.Test
import org.gradle.kotlin.dsl.extra
import org.gradle.kotlin.dsl.project
import org.gradle.kotlin.dsl.task
import java.io.File
import java.lang.Character.isLowerCase
import java.lang.Character.isUpperCase
import java.nio.file.Files
import java.nio.file.Path
fun Project.projectTest(taskName: String = "test", parallel: Boolean = false, body: Test.() -> Unit = {}): Test = getOrCreateTask(taskName) {
fun Project.projectTest(
taskName: String = "test",
parallel: Boolean = false,
shortenTempRootName: Boolean = false,
body: Test.() -> Unit = {}
): TaskProvider<Test> = getOrCreateTask(taskName) {
doFirst {
val commandLineIncludePatterns = (filter as? DefaultTestFilter)?.commandLineIncludePatterns ?: emptySet()
val commandLineIncludePatterns = (filter as? DefaultTestFilter)?.commandLineIncludePatterns ?: mutableSetOf()
val patterns = filter.includePatterns + commandLineIncludePatterns
if (patterns.isEmpty() || patterns.any { '*' in it }) return@doFirst
patterns.forEach { pattern ->
@@ -87,7 +92,6 @@ fun Project.projectTest(taskName: String = "test", parallel: Boolean = false, bo
jvmArgs(
"-ea",
"-XX:+HeapDumpOnOutOfMemoryError",
"-Xmx1600m",
"-XX:+UseCodeCacheFlushing",
"-XX:ReservedCodeCacheSize=128m",
"-Djna.nosys=true"
@@ -96,6 +100,7 @@ fun Project.projectTest(taskName: String = "test", parallel: Boolean = false, bo
maxHeapSize = "1600m"
systemProperty("idea.is.unit.test", "true")
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
systemProperty("java.awt.headless", "true")
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
environment("PROJECT_CLASSES_DIRS", testSourceSet.output.classesDirs.asPath)
environment("PROJECT_BUILD_DIR", buildDir)
@@ -111,7 +116,8 @@ fun Project.projectTest(taskName: String = "test", parallel: Boolean = false, bo
(teamcity?.get("teamcity.build.tempDir") as? String)
?: System.getProperty("java.io.tmpdir")
systemTempRoot.let {
subProjectTempRoot = Files.createTempDirectory(File(systemTempRoot).toPath(), project.name + "Project_" + taskName + "_")
val prefix = (project.name + "Project_" + taskName + "_").takeUnless { shortenTempRootName }
subProjectTempRoot = Files.createTempDirectory(File(systemTempRoot).toPath(), prefix)
systemProperty("java.io.tmpdir", subProjectTempRoot.toString())
}
}
@@ -129,15 +135,16 @@ fun Project.projectTest(taskName: String = "test", parallel: Boolean = false, bo
if (parallel) {
maxParallelForks =
project.findProperty("kotlin.test.maxParallelForks")?.toString()?.toInt()
?: Math.max(Runtime.getRuntime().availableProcessors() / 2, 1)
?: Math.max(Runtime.getRuntime().availableProcessors() / if (kotlinBuildProperties.isTeamcityBuild) 2 else 4, 1)
}
body()
}
private inline fun String.isFirstChar(f: (Char) -> Boolean) = isNotEmpty() && f(first())
inline fun <reified T : Task> Project.getOrCreateTask(taskName: String, body: T.() -> Unit): T =
(tasks.findByName(taskName)?.let { it as T } ?: task<T>(taskName)).apply { body() }
inline fun <reified T : Task> Project.getOrCreateTask(taskName: String, noinline body: T.() -> Unit): TaskProvider<T> =
if (tasks.names.contains(taskName)) tasks.named(taskName, T::class.java).apply { configure(body) }
else tasks.register(taskName, T::class.java, body)
object TaskUtils {
fun useAndroidSdk(task: Task) {

View File

@@ -0,0 +1,41 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[Pill] IDEA Ultimate" type="Application" factoryName="Application" singleton="true">
<log_file alias="idea.log" path="$PROJECT_DIR$/ideaSDK/system-idea/log/idea.log" />
<option name="MAIN_CLASS_NAME" value="com.intellij.idea.Main" />
<module name="kotlin-ultimate.ultimate.ultimate-runner" />
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=240m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=$PROJECT_DIR$/local/ideaSandbox -Didea.config.path=$PROJECT_DIR$/local/ideaSandbox/config -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin $ADDITIONAL_IDEA_ARGS$" />
<option name="WORKING_DIRECTORY" value="file://$IDEA_HOME_PATH$" />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="JavaRebel">
<option name="bootstrapPath" />
<option name="jrebelArgs" value="" />
<option name="loggingEnabled" value="false" />
<option name="useBootstrapDefaults" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="JavaRebel Debug">
<option name="bootstrapPath" />
<option name="debugPort" value="" />
<option name="jrebelArgs" value="" />
<option name="loggingEnabled" value="false" />
<option name="transport" value="0" />
<option name="useBootstrapDefaults" value="true" />
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Profile " />
<ConfigurationWrapper RunnerId="Run" />
<method>
<option name="BuildArtifacts" enabled="true">
<artifact name="KotlinPlugin" />
</option>
</method>
</configuration>
</component>

View File

@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<excludeFromCompile>
<directory url="file://$PROJECT_DIR$/gen" includeSubdirectories="true" />
</excludeFromCompile>
</component>
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/android-module.iml" filepath="$PROJECT_DIR$/android_module.iml" />
</modules>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="Android_SDK" project-jdk-type="Android SDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@@ -5,9 +5,8 @@ buildscript {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
@@ -31,7 +30,6 @@ android {
versionName "1.0"
testApplicationId "org.jetbrains.kotlin.android.tests.gradle"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
debug {
@@ -62,6 +60,19 @@ android {
resultsDir = "build/test/results"
}
flavorDimensions "box"
productFlavors {
ktest0 {
dimension "box"
}
ktest1 {
dimension "box"
}
}
}
task jarTestFolders() {
@@ -81,7 +92,8 @@ tasks.withType(JavaCompile) {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation 'junit:junit:4.12'
implementation 'com.android.support:multidex:1.0.3'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation fileTree(dir: 'libs/test', include: ['*.jar'])
ktest0Implementation fileTree(dir: 'libs/test', include: ['libtest0.jar'])
ktest1Implementation fileTree(dir: 'libs/test', include: ['libtest1.jar'])
}

View File

@@ -1,14 +0,0 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}\tools\proguard\proguard-android.txt:proguard-project.txt
# Project target.
target=android-16

View File

@@ -4,8 +4,6 @@ plugins {
id("jps-compatible")
}
jvmTarget = "1.6"
dependencies {
compile(project(":compiler:util"))
compile(project(":compiler:cli"))
@@ -15,7 +13,10 @@ dependencies {
compile(project(":kotlin-reflect"))
compile(projectTests(":compiler:tests-common"))
compile(commonDep("junit:junit"))
compileOnly(intellijDep()) { includeJars("openapi") }
Platform[193].orLower {
compileOnly(intellijDep()) { includeJars("openapi") }
}
testCompile(project(":compiler:incremental-compilation-impl"))
testCompile(project(":core:descriptors"))
@@ -23,7 +24,11 @@ dependencies {
testCompile(project(":compiler:frontend.java"))
testCompile(projectTests(":jps-plugin"))
testCompile(commonDep("junit:junit"))
testCompile(intellijDep()) { includeJars("openapi", "util", "idea", "idea_rt", "groovy-all", rootProject = rootProject) }
Platform[193].orLower {
testCompile(intellijDep()) { includeJars("openapi", rootProject = rootProject) }
}
testCompile(intellijDep()) { includeJars("util", "idea", "idea_rt", "groovy-all", rootProject = rootProject) }
Platform[191].orLower {
testCompile(intellijDep()) { includeJars("jps-builders") }
}
@@ -55,3 +60,8 @@ projectTest {
workingDir = rootDir
}
val generateTests by generator("org.jetbrains.kotlin.android.tests.CodegenTestsOnAndroidGenerator")
generateTests.workingDir = rootDir
generateTests.dependsOn(rootProject.tasks.named("dist"))

View File

@@ -30,6 +30,7 @@ import java.io.File
import java.io.IOException
import javax.xml.parsers.DocumentBuilderFactory
import javax.xml.parsers.ParserConfigurationException
import kotlin.test.assertTrue
class CodegenTestsOnAndroidRunner private constructor(private val pathManager: PathManager) {
@@ -59,7 +60,7 @@ class CodegenTestsOnAndroidRunner private constructor(private val pathManager: P
rootSuite.addTest(this)
}
renameReport()
renameFlavorFolder()
enableD8(true)
runTestsOnEmulator(gradleRunner, TestSuite("D8")).apply {
(0 until this.countTestCases()).forEach {
@@ -95,22 +96,27 @@ class CodegenTestsOnAndroidRunner private constructor(private val pathManager: P
}
private fun processReport(suite: TestSuite, resultOutput: String) {
val reportFolder = reportFolder()
val reportFolder = File(flavorFolder())
try {
val testCases = parseSingleReportInFolder(reportFolder)
testCases.forEach { aCase -> suite.addTest(aCase) }
Assert.assertNotEquals("There is no test results in report", 0, testCases.size.toLong())
val folders = reportFolder.listFiles()
assertTrue(folders != null && folders.isNotEmpty(), "No folders in ${reportFolder.path}")
folders.forEach {
assertTrue("${it.path} is not directory") { it.isDirectory }
val testCases = parseSingleReportInFolder(it)
testCases.forEach { aCase -> suite.addTest(aCase) }
Assert.assertNotEquals("There is no test results in report", 0, testCases.size.toLong())
}
} catch (e: Exception) {
throw RuntimeException("Can't parse test results in $reportFolder\n$resultOutput", e)
}
}
private fun renameReport() {
val reportFolder = File(reportFolder())
private fun renameFlavorFolder() {
val reportFolder = File(flavorFolder())
reportFolder.renameTo(File(reportFolder.parentFile, reportFolder.name + "_dex"))
}
private fun reportFolder() = pathManager.tmpFolder + "/build/test/results/connected/"
private fun flavorFolder() = pathManager.tmpFolder + "/build/test/results/connected/flavors"
private fun runTestsOnEmulator(gradleRunner: GradleRunner, suite: TestSuite): TestSuite {
val platformPrefixProperty = System.setProperty(PlatformUtils.PLATFORM_PREFIX_KEY, "Idea")
@@ -153,11 +159,10 @@ class CodegenTestsOnAndroidRunner private constructor(private val pathManager: P
}
@Throws(IOException::class, SAXException::class, ParserConfigurationException::class)
private fun parseSingleReportInFolder(reportFolder: String): List<TestCase> {
val folder = File(reportFolder)
private fun parseSingleReportInFolder(folder: File): List<TestCase> {
val files = folder.listFiles()!!
assert(files.size == 1) {
"Expecting one file but ${files.size}: ${files.joinToString { it.name }}"
"Expecting one file but ${files.size}: ${files.joinToString { it.name }} in ${folder.path}"
}
val reportFile = files[0]

View File

@@ -60,10 +60,6 @@ public class PathManager {
return tmpFolder + "/libs/libtest" + index;
}
public String getLibsFolderInAndroidTestedModuleTmpFolder() {
return tmpFolder + "/tested-module/libs";
}
public String getLibsFolderInAndroidTmpFolder() {
return tmpFolder + "/libs";
}

View File

@@ -43,7 +43,7 @@ public class SDKDownloader {
private static final String SDK_TOOLS = "4333796"; //"26.1.1";
public static final String BUILD_TOOLS = "28.0.3";
private static final int ANDROID_VERSION = 19;
public static final String GRADLE_VERSION = "4.6";
public static final String GRADLE_VERSION = "5.1.1";
public static final String EMULATOR_TOOLS_VERSION = "5264690"; //"28.0.23";

View File

@@ -70,8 +70,7 @@ public class GradleRunner {
System.out.println("Starting tests...");
GeneralCommandLine test = generateCommandLine("connectedAndroidTest");
test.addParameters("--stacktrace");
//To avoid problem with discovering tests on Android in multidex build
test.addParameters("-Pandroid.testInstrumentationRunnerArguments.class=org.jetbrains.kotlin.android.tests.CodegenTestCaseOnAndroid");
test.addParameters("--continue"); //run all flavors even if any fail
return RunUtils.execute(test).getOutput();
}

View File

@@ -157,7 +157,7 @@ public class RunUtils {
}
catch (NumberFormatException e) {
timeout = 30;
System.err.println("Timeout system property should be a number");
System.err.println("Timeout system property should be a number: " + timeoutAsString);
}
handler.waitFor(timeout * 60 * 1000);
@@ -165,7 +165,7 @@ public class RunUtils {
System.out.println("Output before handler.isProcessTerminated() " + settings.commandLine);
System.out.println(stdOut);
System.err.println(stdErr);
return new RunResult(false, "Timeout exception: execution was terminated after ~20 min.");
return new RunResult(false, "Timeout exception: execution was terminated after ~" + timeout + " min.");
}
}
else {

View File

@@ -41,7 +41,7 @@ public class AndroidJpsBuildTestCase extends BaseKotlinJpsBuildTestCase {
}
@Override
protected void runTest() throws Throwable {
protected void runTest() {
doTest();
}

View File

@@ -19,14 +19,11 @@ package org.jetbrains.kotlin.android.tests;
import com.google.common.io.Files;
import com.intellij.openapi.util.io.FileUtil;
import junit.framework.TestSuite;
import kotlin.io.FilesKt;
import org.jetbrains.annotations.NotNull;
import org.junit.runner.RunWith;
import org.junit.runners.AllTests;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
@RunWith(AllTests.class)
public class AndroidRunner {
@@ -47,9 +44,6 @@ public class AndroidRunner {
public static TestSuite suite() throws Throwable {
PathManager pathManager = getPathManager();
FileUtil.copyDir(new File(pathManager.getAndroidModuleRoot()), new File(pathManager.getTmpFolder()));
writeAndroidSkdToLocalProperties();
CodegenTestsOnAndroidGenerator.generate(pathManager);
System.out.println("Run tests on android...");
@@ -65,12 +59,4 @@ public class AndroidRunner {
FileUtil.delete(new File(pathManager.getTmpFolder()));
}
private static void writeAndroidSkdToLocalProperties() throws IOException {
String sdkRoot = FilesKt.getInvariantSeparatorsPath(new File(pathManager.getAndroidSdkRoot()));
System.out.println("Writing android sdk to local.properties: " + sdkRoot);
File file = new File(pathManager.getTmpFolder() + "/local.properties");
try (FileWriter fw = new FileWriter(file)) {
fw.write("sdk.dir=" + sdkRoot);
}
}
}

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