Commit Graph

90413 Commits

Author SHA1 Message Date
Yan Zhulanow f2825d56f4 [CHERRY PICKED FROM IJ] Fix compatibility issues with 2020.2
GitOrigin-RevId: a6c350b66e593dbbc9b0d8baa4728b28b65db5c6
Original commit: https://github.com/JetBrains/intellij-community/commit/084a0c5d16fce153c5bd73a8d9761ce47e2e182e
2022-01-12 15:10:43 +01:00
Nikita Bobko 3033cf0a03 [CHERRY PICKED FROM IJ] kotlin-ide migration: Normalization commit
This commit is consequence of not accurate migration to kotlin-ide repo.
These changes appeared as a result of split of big chunk of first
commits in kotlin-ide repo. I don't know where from changes in this
commit come from.

It could be changes of "bunch switch" commit. Or changes of other
accidentally squashed commits

GitOrigin-RevId: 6d1e18c36e02a4ad228fe7ddc5bd056e98e1be36
Original commit: https://github.com/JetBrains/intellij-community/commit/c490f5864de6ef36964aa4ee34cdf7b3f35db384
2022-01-12 15:10:43 +01:00
Yan Zhulanow 3a21275306 [CHERRY PICKED FROM IJ] Remove as36 bunch
GitOrigin-RevId: 65d06150b5f4cd4d94a28ab8066e4441a8145c02
Original commit: https://github.com/JetBrains/intellij-community/commit/6f91376c537c1790b652a039f43911d75c1ce41f
2022-01-12 15:10:42 +01:00
Nikita Bobko c06fc28930 Remove as42 bunch from JPS plugin 2022-01-12 15:10:42 +01:00
Nikita Bobko d9a752f823 Remove as41 bunch 2022-01-12 15:10:41 +01:00
Yan Zhulanow 17e336ea44 [CHERRY PICKED FROM IJ] Move the withIC() function to the test itself
GitOrigin-RevId: 196571333c115c1f24eebc048dbfcca5c2189dfa
Original commit: https://github.com/JetBrains/intellij-community/commit/1a521c2ee63b3e777b1f955b2f4cb91c28a158be
2022-01-12 15:10:41 +01:00
Dmitry Gridin 46cad3efe0 [CHERRY PICKED FROM IJ] [jps] convert KotlinBuilderService to Kotlin
GitOrigin-RevId: e0bf79e6e00f5c6826c1338bcf99e50e536c9f52
Original commit: https://github.com/JetBrains/intellij-community/commit/948a7546bf9eafadab9a46f45189101e9f960b9b
2022-01-12 15:10:40 +01:00
Dmitry Gridin af17b2d412 [CHERRY PICKED FROM IJ] Rename .java to .kt
GitOrigin-RevId: c8b1b3c8d3a58b6858041235d6bb7bfa541e3a6c
Original commit: https://github.com/JetBrains/intellij-community/commit/23fbf46777007e8515591a5d65516d26e9812239
2022-01-12 15:10:40 +01:00
Dmitry Gridin f66b2b2899 [CHERRY PICKED FROM IJ] [jps] convert SettingConstants to Kotlin
GitOrigin-RevId: 664d09dd6abbf39624013cd1009f662efe7f4c0e
Original commit: https://github.com/JetBrains/intellij-community/commit/42811eb72492032ed25dd52cd7aa25511b4bdf90
2022-01-12 15:10:40 +01:00
Dmitry Gridin 2f67e58d64 [CHERRY PICKED FROM IJ] Rename .java to .kt
GitOrigin-RevId: 2d4e1a1b6e31f591b2ef420fe248605da4cdfd5a
Original commit: https://github.com/JetBrains/intellij-community/commit/b328bd7b76f3d73769274fadecf0e58bbe778613
2022-01-12 15:10:39 +01:00
Dmitry Gridin 5141524603 [CHERRY PICKED FROM IJ] [jps] convert KotlinCommonJpsModelSerializerExtension to Kotlin
GitOrigin-RevId: 437f6d66690434a9853d544015d93b17448f8f7c
Original commit: https://github.com/JetBrains/intellij-community/commit/2b8032aafcf561c7d834bb857eb5b3d32eff8317
2022-01-12 15:10:39 +01:00
Dmitry Gridin f62b39f0e4 [CHERRY PICKED FROM IJ] Rename .java to .kt
GitOrigin-RevId: e7d264797023a87cbbea90746bcf2959220bf046
Original commit: https://github.com/JetBrains/intellij-community/commit/f8c480074ada550f0cf4c36373218eee9fb2bfff
2022-01-12 15:10:38 +01:00
Dmitry Gridin f74f613bc1 [CHERRY PICKED FROM IJ] [jps] convert CompilerRunnerConstants to Kotlin
GitOrigin-RevId: 72575637ea72a14f25bdf9b25ae44255a9c40018
Original commit: https://github.com/JetBrains/intellij-community/commit/8ac14f4734d1c6d60f5b3874bacf54224abcf757
2022-01-12 15:10:38 +01:00
Dmitry Gridin f801bce8a9 [CHERRY PICKED FROM IJ] Rename .java to .kt
GitOrigin-RevId: 801635ed9cd9824365ee2b7969c6f822c7e37869
Original commit: https://github.com/JetBrains/intellij-community/commit/5f0b44bd74a8cc346f1536e310d84e3d70d2e73a
2022-01-12 15:10:37 +01:00
Nikita Bobko 5d91e54f41 Merge Kotlin JPS plugin
Kotlin JPS plugin existed in Kotlin repo before but was migrated to
intellij-community together with entire Kotlin plugin.
Now I return Kotlin JPS plugin back because it turned out that it's
easier to develop JPS in KT release cycle. Also I need to
unbundle Kotlin JPS plugin in scope of KTIJ-11633
2022-01-12 15:10:21 +01:00
Nikita Bobko db7472a376 Rename: jps-plugin -> jps/jps-plugin 2022-01-12 15:09:45 +01:00
Alexander Shabalin d8f99d8974 [K/N] Avoid global dtors in suspension and logging
^KT-50713

Merge-request: KT-MR-5426
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-01-12 13:28:43 +00:00
Sergey Igushkin eddf8c9e72 KT-50736: Fix the implementation of whenEvaluated
Re-implement `whenEvaluated` using a constant number of calls to
`withPlugin` per project.

The approach with `plugins.all { ... }` introduced by the fix
of KT-50509 had an issue with Android plugins applied last in the build:
in those cases that implementation didn't dispatch the actions after
Android and instead fired them earlier in `afterEvaluate`, because
`hasPlugin` doesn't return true in the callback when that exact plugin
is applied.

This change preserves the performance similar to that of the previous
implementation.

Issue #KT-50736

Merge-request: KT-MR-5418
2022-01-12 13:13:56 +00:00
Dmitriy Dolovov e6a2785118 Bump Kotlin/Native version to 1.7.0-dev-528
Related to #KT-50591
2022-01-12 16:05:32 +03:00
Victor Petukhov 1f1b5256b0 Postpone type enhancement improvements till 1.7 due to some found broken cases unmarked by warnings before
^KT-49378 Fixed
2022-01-12 15:58:50 +03:00
Andrey Uskov 2adc851f1b Don't use global state for keeping incremental compilation state
Previously IC state was stored in System properties. As result parallel
compilation might cause incorrect state of IC, what led to corruption
of kotlin_module files. Now IC state is stored via CompilerArguments
and CompilerConfiguration
#KT-46038 Fixed
2022-01-12 13:37:46 +03:00
Dmitriy Dolovov 99300bd885 [IR] IrModuleDeserializerKind API cleanup
Related to #KT-50591
2022-01-12 11:05:12 +03:00
Roman Golyshev 54cca88279 KT-50728 Enforce receiver type resolve
When stdlib is represented as a source dependency (which seems to be the
case in the `kotlin` project), it will be resolved lazily for the IDE.
Same thing can happen if someone decides to "extend" the stdlib
by declaring their declaration in the `kotlin` package

In both of those cases, we need to make sure that receiver type is fully
resolved before trying to get a `coneType` from it

N.B. To make resolve tests work, I've added a separate folder
`withAllowedKotlinPackage` to the `testData`, because in the default
test setup it is not allowed to extend the `kotlin` package by user's
definitions

^KT-50728 Fixed
2022-01-11 22:23:57 +00:00
Sergey Igushkin 3ac472ceb3 Fix Android unit test tasks not running in allTests
The Android unit test tasks were not created by the Kotlin Gradle
plugin, so the plugin didn't add the
tadk dependencies to its aggregating
`allTests` task.

Issue #KT-38456
Issue #KT-44227
2022-01-11 22:15:14 +00:00
Dmitriy Dolovov 8ea6221932 Minor: Update comment 2022-01-11 22:05:01 +03:00
Dmitriy Dolovov 716ca3c319 [IR] Do best effort explaining IR linker issue to the user if computation of the detailed IR linker error message failed due to unexpected error
Related to #KT-50591
2022-01-11 21:53:12 +03:00
Dmitriy Dolovov cb5a052227 [IR] Distinguish IrModuleDeserializers with and w/o underlying KLIBs
Fixes #KT-50591
2022-01-11 21:53:06 +03:00
Jinseong Jeon 7ff468d9e3 FIR LC: populate only const property on multi-file facade 2022-01-11 21:30:54 +03:00
Denis.Zharkov 0da24ff4e2 FIR: Fix smartcast case after equals on class from different module
^KT-50534 Relates
2022-01-11 20:45:56 +03:00
Denis.Zharkov a33d9df0cd NI: Support forking inference with heuristics
Mostly, it only affects FIR

It partially allows to consider several variance of constraints like
A<Int> & A<T> <: A<X_var> that are mostly brought by smart casts

^KT-49542 Fixed
^KT-50489 Relates
2022-01-11 20:45:55 +03:00
Denis.Zharkov 62673c7e1b NI: Do not use asConstraintSystemCompleterContext before completion 2022-01-11 20:45:54 +03:00
Denis.Zharkov 1d258635a2 NI: Get rid of confusing asConstraintSystemCompletionContext
NB: there is a different asConstraintSystemCompleterContext that might have side effects
2022-01-11 20:45:53 +03:00
Denis.Zharkov 47d74a16f2 NI: Get rid of redundant asPostponedArgumentsAnalyzerContext calls 2022-01-11 20:45:53 +03:00
Hung Nguyen 8d298bd25c Fixed possible hanging of metrics collection in KGP
#KT-50719 Fixed
2022-01-11 19:15:42 +03:00
Victor Petukhov 455b3143e7 [FE 1.0] Introduce builder inference stub types checker which may report more precise and clear errors due to resolution ambiguity
^KT-49828 Fixed
2022-01-11 18:34:47 +03:00
Victor Petukhov dcc42d66c3 [FE 1.0] Fix formatting in StubTypesBasedInferenceSession 2022-01-11 18:34:46 +03:00
Victor Petukhov 4dc9b291e5 [FE 1.0] Store builder inference session in the corresponding lambda argument 2022-01-11 18:34:46 +03:00
Victor Petukhov 74f294d849 [FE 1.0] Store constraint system in call resolution result instead of constraint storage 2022-01-11 18:34:45 +03:00
Victor Petukhov cedd98148c [FE 1.0] Rename the remaining coroutine inference stuff into builder inference 2022-01-11 18:34:45 +03:00
Victor Petukhov 27ed4a7dc2 [FE 1.0] Rename DelegatedPropertyInferenceSession to DelegateInferenceSession 2022-01-11 18:34:44 +03:00
Victor Petukhov ab207ca58f [FE 1.0] Rename ManyCandidatesResolver to StubTypesBasedInferenceSession 2022-01-11 18:34:43 +03:00
Victor Petukhov c1d3f7e5b4 [FE 1.0] Rename ambiguity's parameter from descriptors to resolvedCalls 2022-01-11 18:34:42 +03:00
Victor Petukhov 8e2b90b5db [FE 1.0] Don't report CAST_NEVER_SUCCEEDS on stub types
^KT-49829 Fixed
2022-01-11 18:34:41 +03:00
Victor Petukhov 37d163d417 [FE 1.0] Don't lose diagnostics during lambda analysis at the overload resolution by return type stage
^KT-49658 Fixed
2022-01-11 18:07:05 +03:00
vmishenev 7820b268fb KT-50111 Add a new analysis flag eagerResolveOfLightClasses 2022-01-11 17:33:47 +03:00
Roman Golyshev 5964d8c566 KTIJ-20618 FIR IDE: Enforce resolved type bounds in ConeTypeContext.kt
When lazy resolve is involved, type bounds can be in an unresolved
state (e.g. `FirUserTypeRef` instead of `FirResolvedTypeRef`). To
enforce the resolve, we use `resolvedTypeBounds` where it might be
important

^KTIJ-20618 Fixed
2022-01-11 13:56:17 +00:00
Denis.Zharkov a63351f5d1 FIR: Simplify ConeTypeContext.captureArguments 2022-01-11 16:27:06 +03:00
Denis.Zharkov 9be4f818f4 FIR: Weaken some UPPER_BOUND_VIOLATED restrictions
See test data at starProjectionInsteadOutCaptured.kt

^KT-49412 Fixed
^KT-50230 Relates
^KT-48044 Fixed
2022-01-11 16:27:06 +03:00
Denis.Zharkov 814f4803b7 FIR: Refactor extracting type arguments from FirTypeRef
Extract them all instead of re-iterating for each argument
2022-01-11 16:27:05 +03:00
Denis.Zharkov 1a9c389b0e FIR: Refactor ConeSubstitutorByMap
Add explicit equals and cached hashCode instead of implicit ones from data class
2022-01-11 16:27:04 +03:00