Commit Graph

100763 Commits

Author SHA1 Message Date
Nataliya.Valtman ea264cb5b5 Add kotlin-build-statistics embedded dependency for JPS
#KT-58314: Fixed
2023-04-28 09:22:00 +00:00
Nikolay Krasko 3caa1d1349 Refactoring: fix usages of @TestOnly ExtensionsArea.registerExtensionPoint 2023-04-28 08:25:19 +00:00
Nikolay Krasko 6e18b75c73 [213] Do not remove deprecated ExtensionsArea.registerExtensionPoint
The method is proved to be used in klint project
https://github.com/pinterest/ktlint/blob/c5a81e0d4198fa5cb2cac69967080e01e365b837/ktlint-rule-engine/src/main/kotlin/com/pinterest/ktlint/rule/engine/internal/KotlinPsiFileFactory.kt#L121

There is an issue about the remove: https://github.com/pinterest/ktlint/issues/1981

KTI-1114
2023-04-28 08:25:19 +00:00
Alexander Shabalin cd93100148 [K/N] Fix sleeping in RWSpinLockTest ^KT-56233 2023-04-27 16:49:30 +00:00
Alexander Shabalin e6c0f32477 [K/N] Fixing ConcurrentMarkAndSweepTest ^KT-56233 2023-04-27 16:49:30 +00:00
Sebastian Sellmair 4e74f7e57c Enable new mpp dependency resolution
KT-58319
2023-04-27 18:38:45 +02:00
Yahor Berdnikau 982a4fbda0 Print in the console report showing amount of tasks used K2
^KT-57736 Fixed
2023-04-27 14:32:47 +00:00
Dmitrii Krasnov 847544d99c Removed jfrog repository from kapt integration tests
#KT-58022
2023-04-27 14:19:22 +00:00
Gleb Lukianets 242ca73d83 rrn/rd/KT-55578 User-provided hints for linker errors
[K/N] KT-55578 Show customized user suggestions on linkage errors

Merge-request: KT-MR-9636
Merged-by: Gleb Lukianets <Gleb.Lukianets@jetbrains.com>
2023-04-27 14:14:43 +00:00
Andrei Klunnyi 1e0115aef8 KT-57468 Kotlin assignment plugin: operation name cannot be found
The problem results in broken import quick fix and import optimizer on
the IDE side [1].

`AssignResolutionAltererExtension` introduced a possibility to override
 resolution of assignment statements. The inconsistency though is
 that `KtSimpleNameReference.getResolvesByNames` doesn't return a name
 for the overridden `=`. Kotlin as a language doesn't support this [2].

This commit eliminates the drawback above:
1. It fixes the name `assign` the `=` can be resolved to [3].
   This eliminates the need to search for the name, bypassing the
   plugins.
2. `KtSimpleNameReference.getResolvesByNames` returns `assign` among
   other names in case it deals with binary `=` and assignment is
   resolved.
3. `KtCompilerPluginsProvider` was extended to check plugins' presence.
   K1 implementation added.

----------------------------------------------------------------
[1]: https://youtrack.jetbrains.com/issue/KTIJ-24390
[2]: OperatorConventions.getNameForOperationSymbol
     https://kotlinlang.org/docs/operator-overloading.html#augmented-assignments
[3]: OperatorConventions#ASSIGN_METHOD + AssignmentPluginNames
2023-04-27 14:05:02 +00:00
Andrei Klunnyi 4c1a66b7d6 KT-57468 Kotlin assignment plugin: publish K2 & CLI artefacts
This commit effectively proceeds with the fix [1] but now in the context
of [2]. It includes jars from the assignment compiler plugin.

----------------------------------------------------------------------
[1]: https://youtrack.jetbrains.com/issue/KTIJ-24438
[2]: https://youtrack.jetbrains.com/issue/KTIJ-24390
2023-04-27 14:05:02 +00:00
Kirill Rakhman bd9f36ad01 [FIR] Move type parameter scope above member and static scopes in tower
This fixes a false positive TYPE_PARAMETER_IS_NOT_AN_EXPRESSION when
a type parameter and some member, static or companion declaration have
the same name and referred to inside a class.

#KT-58028 Fixed
2023-04-27 13:59:13 +00:00
Dmitriy Novozhilov 7958a9debd [FIR2IR] Correctly generate delegating constructor call for secondary constructors in enums
^KT-56927 Fxied
2023-04-27 13:35:14 +00:00
Kirill Rakhman a818c543a9 [FIR] Verify diagnostic messages don't reference non-existent parameters 2023-04-27 12:54:31 +00:00
aleksandrina-streltsova c956b4aeae [Analysis API FIR] Use stable module name when mangling internal name
^KTIJ-25046
2023-04-27 12:36:20 +00:00
Bogdan Mukvich a7396d8c10 Make gradle integration proguard test JDK 11 compatible 2023-04-27 12:25:21 +00:00
Bogdan Mukvich 0299d2c9e2 Use JDK 8 as JAVA_HOME for android tests
* android sdk tools binaries run in a child process relies on JAVA_HOME
* old android sdk tools can run only under JDK 8, requiring javax libs
2023-04-27 12:25:21 +00:00
Bogdan Mukvich b0d964ec8b Use JDK 8 as JAVA_HOME for kapt tests
* kapt tests launch scripts in a child process relied on JAVA_HOME
* tests fail under JDK 11 due to illegal reflexive access
2023-04-27 12:25:20 +00:00
Bogdan Mukvich e7989eecf5 Add function to get toolchain JDK home location 2023-04-27 12:25:20 +00:00
Mikhail Glukhikh 08c22c388c K2: change logic of result type search in ILT case
Related to KT-57487, KT-57703
2023-04-27 12:19:38 +00:00
Mikhail Glukhikh 27c4a7b7ef FE: add new tests around unresolved integer literals
Related to KT-57487, KT-57703
2023-04-27 12:19:38 +00:00
Mikhail Glukhikh 70c5978add K2: Approximate ILT in vararg expressions properly #KT-57487 Fixed 2023-04-27 12:19:38 +00:00
Anna Kozlova dead2c8be8 [LL] stubBased provider: deserialize fir from stubs build from decompiled text
if the compiled code is opened in the editor,
1. it's decompiled
2. stub is build over decompiled text
3. this stub replaces the stub built from classes.

This process leads to missed information in resulted FIR, e.g. half correct classId.
On the other side, this FIR is used only for this opened editor.
2023-04-27 11:37:29 +00:00
Anna Kozlova 2a47e89706 [LL] use provided sources to skip search for declaration phase 2023-04-27 11:37:29 +00:00
Anna Kozlova a41f7dc25d [cls] save parameter name for functional types in stub
to make it available for deserialized Fir
2023-04-27 11:37:28 +00:00
Anna Kozlova d59d66e876 [AA, LL] use stubs to build deserialized Fir elements in IDE
^KTIJ-24638

Notice on `DebugSymbolRenderer`:
stub based deserializer sets source directly,
but it's available in IDE mode only.
Thus, standalone and IDE tests have different results.
In order to avoid this, sources for compiled code are explicitly ignored

Notice on distinct callables:
for a file which belong to multiple libraries, decompiled code would be build per library.
In order to avoid ambiguity errors for members in that file,
we need to distinct provided elements by origins
failed test from IJ repo:
 FirReferenceResolveWithCrossLibTestGenerated#testSetWithTypeParameters
2023-04-27 11:37:28 +00:00
Anna Kozlova 96c15f6c71 [cls] include generated equals/hashCode/toString method in stubs
to avoid heavy computation of super functions
2023-04-27 11:37:27 +00:00
Anna Kozlova e28e8ad7b8 [AA] recognize library module by roots
merging `LLFirSelectingCombinedSymbolProvider.selectFirstElementInClasspathOrder`
relies on the fact that a candidate belongs to exactly one module.
This can be not true for libraries, attached to multiple modules.
 In that case we need to accept "wrong module" to retrieve correct provider
2023-04-27 11:37:27 +00:00
Anna Kozlova d491fd2f70 [LL] don't include kotlin classes in combined java provider
do not resolve annotations when short name doesn't match
2023-04-27 11:37:27 +00:00
Anna Kozlova 6ba4e37696 [psi] don't load ast for compiled code
deserialized parameters do not contain real default values anyway
2023-04-27 11:37:26 +00:00
Anna Kozlova 1f4e4f94a7 [FIR] varargs: do not leak source of value parameter to the call site
when source for compiled fir elements is set, it leaks e.g. to diagnostics,
which is then filtered

see `TestsWithStdLib.Experimental.testImplicitUsages`
2023-04-27 11:37:26 +00:00
Anna Kozlova e94946d8df [FIR] extract data class copy function generation 2023-04-27 11:37:25 +00:00
Anna Kozlova 3f6432cdc9 [FIR] setup origin for generated enum functions 2023-04-27 11:37:25 +00:00
Alexander Udalov 68b94b07b8 Fir2Ir: more precise calculation of enum class modality
Use the same condition as in the already existing `createIrEnumEntry`
function (and as in psi2ir): enum class should be final unless there's
an enum entry with any declaration other than its constructor.

 #KT-57216
2023-04-27 11:02:22 +00:00
aleksandrina-streltsova 2cc3b542fd [Analysis API FIR] Initialize properties of KtCallableSignature lazily 2023-04-27 10:59:30 +00:00
aleksandrina-streltsova 2eab9fc00f [AA] Fix incorrect nullability for KtType created from stub type
^KTIJ-24992 Fixed
2023-04-27 10:59:30 +00:00
aleksandrina-streltsova 1d905aa20c [Analysis API] Render type aliases with fully expanded types
^KTIJ-24989
2023-04-27 10:59:30 +00:00
aleksandrina-streltsova 3c8531aad8 [Analysis API] Allow obtaining original for fake declaration/file
It is required to remove dependency on low-level API from completion
2023-04-27 10:59:29 +00:00
Kirill Rakhman 6d3b911dfc [K2/Native] Configure metadata compilation mode
This fixes access to internal declarations in common source sets from
intermediate source sets that are compiled to metadata.

#KT-58219 Fixed
2023-04-27 10:49:53 +00:00
Dmitrii Krasnov aea8670c12 migrated NativeLibraryDslIT and NativeLibraryDslWithCocoapodsIT to junit 5 and gradle TestKit
#KT-51553
2023-04-27 10:40:32 +00:00
Sebastian Sellmair 9f17f6621b [Gradle] Adjust Kotlin2JsCompileArgumentsTest and KotlinCompileArgumentsTest
... after ensuring DependencyClasspath is not resolved
by CompilerArgumentAware

^KTIJ-24724 Verification Pending
2023-04-27 09:17:05 +00:00
akerimsenol 502c3c29cc Omit dependency classpath from compiler args
This is in the context of the following issue:
https://youtrack.jetbrains.com/issue/KTIJ-24724
2023-04-27 09:17:05 +00:00
Mikhail Glukhikh abb58f1380 K2: unmute the test related to KT-48675 2023-04-27 09:16:44 +00:00
Ilya Chernikov a045a0a81c FIR: use default getter in serializer if fir contains none
since we generate the default getter in this case in
Fir2IrDeclarationStorage.createIrProperty, so the serialized metadata
should follow the same behavior.
#KT-57373 fixed
2023-04-27 09:14:20 +00:00
Dmitriy Novozhilov 913b55174d [FIR] Correctly determine primary constructor parameters scope for class initialization section
^KT-58135 Fixed
2023-04-27 09:11:31 +00:00
Anna Kozlova 7ee648a4f5 [cls] include annotation arguments in cls stubs
^ KTIJ-24666
this would allow to build fir based on stubs,
do not keep ProtoBuf in memory and
search in decompiled code by stubs
2023-04-26 21:43:15 +02:00
Anna Kozlova f0af7c4228 [cls] include property constant initializer in stubs
^KTIJ-24667
this would allow building FirElements from stubs
2023-04-26 21:43:15 +02:00
Anna Kozlova 70ef87354f [psi] KtValueArgumentName: use stub when possible 2023-04-26 21:43:15 +02:00
Anna Kozlova 171e9db1f8 [psi] don't search for property initializer in decompiled code
it's not included in decompiled text, so can't be found anyway
2023-04-26 21:43:14 +02:00
Anna Kozlova b558d5fc9c [cls] include default parameter value in stubs
this stub would allow building FirElement from stubs,
as well as search signatures in compiled code without loading decompiled text
2023-04-26 21:43:14 +02:00