Commit Graph

101126 Commits

Author SHA1 Message Date
Ilya Kirillov 89dbc4daec [Analysis API] tests: add possibility to avoid FqName for Kt psi classes in ExpressionMarkerProvider 2023-05-11 20:44:31 +02:00
Ilya Kirillov 176f77c0ef [Analysis API] tests: add possibility to specify LOOK_UP_FOR_ELEMENT_OF_TYPE for all tests 2023-05-11 20:44:31 +02:00
mvicsokolova 0d7625a262 Atomicfu-runtime: changed kotlin.js.compiler option to IR
Fixes KT-56400

Merge-request: KT-MR-10103
Merged-by: Maria Sokolova <maria.sokolova@jetbrains.com>
2023-05-11 18:12:24 +00:00
Igor Chevdar fe1d7c2f52 [K/N][tests] Fixed some of lldb tests 2023-05-11 16:56:40 +00:00
Dmitrii Gridin 25506d3be6 [LL FIR] add more lazy resolve tests on status phase
^KT-56551
2023-05-11 17:38:59 +02:00
Hung Nguyen 0b09be73c6 New IC: Detect changes to class annotations
Both the new and old incremental compilation (IC) analysis rely on
Kotlin class metadata to detect a change.

However, Kotlin metadata currently doesn't contain info about
annotations (KT-57919), so the IC will not be able to detect a change
to them.

With this commit, we'll fix the new IC such that it can detect a change
to class annotations by not relying only on metadata.

We currently scope this fix to the new IC (cross-module analysis) first.
We'll fix this issue for within-module analysis later.

Performance: There seems to be no performance impact from this change.
Snapshotting the 400MB ideaIC-2022.1.4/app.jar takes 4.1s before and
after this change.

Test: Added ClasspathChangesComputerTest.testChangedAnnotations
^KT-58289: Fixed
2023-05-11 15:24:05 +00:00
Kirill Rakhman 993925f656 [FIR] Ignore private properties in accessor override check
JavaClassUseSiteMemberScope won't return a Java method getFoo if there
is an inherited Kotlin property foo in scope because calling this method
would effectively call the property accessor which is not possible in
Kotlin.
This commit excludes private properties from this consideration because
no accessor methods are generated for them, and so calling a Java method
getFoo is ok.

#KT-58577 Fixed
2023-05-11 15:22:42 +00:00
Denis.Zharkov 442844f165 K2: Fix false-positive overload ambiguity after smart cast
Mostly, the change is just mirroring the same logic from K1
OverloadingConflictResolver

^KT-58524 Fixed
2023-05-11 15:01:37 +00:00
Denis.Zharkov efdecc63cb K2: Make filterOutOverridden helper satisfying its contracts
It's obviously expected that all overridden, not only direct ones
are considered

While it likely changes the behavior and some tests are expected to be
changed, original intention was to fix the behavior for other usages
(see later commits) and the part with tests are postponed with KT-58636

^KT-58636 Related
2023-05-11 15:01:37 +00:00
Sebastian Sellmair 85059ced93 [Gradle] Split KotlinPluginLifecycle and KotlinPluginLifecycleImpl
^KT-58255 Verification Pending
2023-05-11 14:13:10 +00:00
Sebastian Sellmair 7910e0d32c [Gradle] KotlinPluginLifecycle: Demote .enqueue to implementation
As .launch shall be the only entry point for running code
within the context of the KotlinPluginLifecycle

^KT-58255 Verification Pending
2023-05-11 14:13:10 +00:00
Sebastian Sellmair b53bf4b148 [Gradle][Minor] runLifecycleAwareTest: Prefer re-throwing AssertionError
^KT-58255 Verification Pending
2023-05-11 14:13:10 +00:00
Sebastian Sellmair 0ab0788763 [Gradle] Lifecycle: Remove LifecycleAwareProperty
Replaced by just keeping the 'awaitFinalValue()' function

^KT-58255 Verification Pending
2023-05-11 14:13:10 +00:00
Dmitrii Gridin 09dbae5eca [LL FIR] add more restrictions to getNonLocalContainingOrThisDeclaration
^KTIJ-25437
KT-MR-10036
2023-05-11 16:09:02 +02:00
Alexander Udalov ff65324172 JVM: use a safer version of fileParent for Java declarations
Java declarations do not have a file parent, their outer element is
IrExternalPackageFragment.

The test did not fail in K1 only by accident, because there's an extra
IrTypeOperatorCall on the property reference's dispatch receiver, which
automatically makes it non-inlinable. In K2, it's IrGetField, so we were
trying to compute if its dispatch receiver is inlinable and for that we
tried to get its fileParent, which resulted in exception if it comes
from Java.

Also refactor PropertyReferenceDelegationTransformer.canInline a bit.

 #KT-57955 Fixed
2023-05-11 13:17:34 +00:00
Kirill Rakhman e2dafdb5b9 [Native/Tests] Add explicit import for SharedImmutable
This fixes an overload resolution ambiguity in K2.

#KT-56272
2023-05-11 13:10:34 +00:00
Simon Ogorodnik 471be7405a FIR. Remove effectively unused parameter to resolveArgumentExpression
The only place where it was used was revised input type logic for lambda
analysis, and it turns out the only significant information it carries
is the presence of expected type ref, which is in fact equal to such of
an expectedType argument
2023-05-11 12:56:55 +00:00
Artem Kobzar 669efc781d [K/JS] Import @JsModule declarations without asterisk 2023-05-11 12:39:57 +00:00
Alexander Korepanov 1920bbde07 [K/JS] Enable partial linkage tests 2023-05-11 12:37:01 +00:00
Artem Kobzar 302623c388 [K/JS] Skip static members in fake overrides generating ^KT-58396 Fixed 2023-05-11 12:32:21 +00:00
Mikhail Glukhikh 134284e496 FE: add test for KT-58055 2023-05-11 12:19:40 +00:00
Sebastian Sellmair 42109725ed [Gradle] Implement AndroidSourceSetLayoutV1SourceSetsNotFoundErrorTest
... to cover KT-58488
2023-05-11 12:05:13 +00:00
Sebastian Sellmair 484863d8c6 [Gradle] Implement AndroidSourceSetLayoutV1SourceSetsNotFoundChecker...
... in order to provide better guidance for projects
migrating to Multiplatform/SourceSetLayout v2 which will suffer from
`UnknownDomainObjectException` when requesting old Android source sets
like

```
sourceSets.getByName("androidTest") // renamed to androidUnitTest
sourceSets.getByName("androidAndroidTest") // renamed to androidInstrumentedTest
```

^KT-58488 Verification Pending
2023-05-11 12:05:13 +00:00
Pavel Mikhailovskii 25c0725da9 [SLC] Treat error class types as not-nullable 2023-05-11 11:48:45 +00:00
Yahor Berdnikau bdad2e5c88 [Gradle] Fix Kotlin native compilation exposed compiler options type
^KT-57815 Fixed
2023-05-11 10:51:40 +00:00
Yahor Berdnikau cc9325eb5b [Gradle] Stop using flow control to locate Gradle task
^KT-57052 Fixed
2023-05-11 10:39:53 +00:00
Dmitrii Gridin 9a267176f5 [FIR] move deprecation calculation to COMPILER_REQUIRED_ANNOTATIONS phase
Also, this change adds SinceKotlin and Java.Deprecated to this phase
It fixes some problems with API_NOT_AVAILABLE, so now it is closer to K1

^KT-57648 Fixed
^KT-55723 Fixed
2023-05-11 10:31:52 +00:00
Dmitrii Gridin add47aa041 [FIR] provide correct origin and source to default backing field
Now it is aligned with default accessors
Covered by
analysis/analysis-api/testData/symbols/symbolByReference/accessorField.kt
test

^KT-57648
^KT-55723
2023-05-11 10:31:52 +00:00
Vladimir Dolzhenko ae4b0c6fe1 Drop KtStubElementTypes#FILE
It has been marked as deprecated for a while and targeted to be deleted in 1.9.0

#KT-53781

Merge-request: KT-MR-10082
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2023-05-11 09:56:55 +00:00
Igor Chevdar 2f24c6df80 [K/N] Added isSubtype intrinsic 2023-05-11 09:30:18 +00:00
Igor Chevdar 67b65ec56a [K/N] Reformat 2023-05-11 09:30:18 +00:00
Igor Chevdar 96c142569d [K/N] Slight devirtualization improvement
Make devirtualization not by an actual receiver type but rather
by an actual virtual method implementation (which sometimes can be better)
2023-05-11 09:30:18 +00:00
Vsevolod Tolstopyatov 5b474bc5d3 Stabilize EnumEntries stdlib signature
* Also, mention implementation details of EnumEntries to enable safe uses of a 'EnumEntries' as a set
* Fix testdata for opt-in marker in enum entries

^KT-58548 fixed

Merge-request: KT-MR-10037
Merged-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
2023-05-11 09:18:44 +00:00
Ilmir Usmanov aec78ab2d8 Minor. Add regression test for KT-42696
#KT-42696 Fixed
2023-05-11 11:15:06 +02:00
Mikhail Glukhikh 9011af1008 K2: perform IOT approximation in completion properly #KT-58520 Fixed 2023-05-11 09:12:26 +00:00
Mikhail Glukhikh 8bc72cb2e5 K2: reproduce KT-58520 in FIR2IR (K2 fails with exception) 2023-05-11 09:12:26 +00:00
Ivan Kylchik d83f6a40fb [K2] Revert commit Pass FirFile to metadata serialization
We will ignore this for now. It is quite painful to bring `FirFile`
in all necessary places.

#KT-57812
2023-05-11 08:22:14 +00:00
Ivan Kylchik 0a5883d867 [IR] Add explicit error in IR type transformer for member access expr
We must generate transform method for `IrMemberAccessExpression` by
hand because of specifics of working with `typeArguments`. But we
also must consider the case that in future we can add new fields in
this element. If it happens, we will see error message.

#KT-57812
2023-05-11 08:22:13 +00:00
Ivan Kylchik 961d8a4905 [IR] Rewrite transformer generator to write explicit return type
#KT-57812
2023-05-11 08:22:13 +00:00
Ivan Kylchik d75d182b26 [K2] Slightly reformat code 2023-05-11 08:22:13 +00:00
Ivan Kylchik 951e30b683 [K2] Pass FirFile to metadata serialization
This is needed to extract correct const value from `ConstValueProvider`.

#KT-57812
2023-05-11 08:22:13 +00:00
Ivan Kylchik d26e3871ba [K2] Support interpretation of values in type annotations
#KT-57812
2023-05-11 08:22:13 +00:00
Ivan Kylchik 846ad95c9e [K2] Return from toConstantValue only if expected type match
There was a bug with early return from `toConstantValue`
method when we found any const value in `ConstValueProvider`.
Actually we should return only if expected type match. This error can
occur if annotation and constant inside it are fakes and
have the same offset.

#KT-57812
2023-05-11 08:22:13 +00:00
Ivan Kylchik 01749a910b [IR] Add new visitor IrTypeVisitorVoid that can traverse IR types
#KT-57812
2023-05-11 08:22:13 +00:00
Ivan Kylchik 55cac9caa6 [IR] Separate IrConstTransformer into two distinct classes
The first one `IrConstExpressionTransformer` is responsible for
transforming ordinary expressions and the second one
`IrConstAnnotationTransformer` is responsible for annotations.

#KT-57812
2023-05-11 08:22:13 +00:00
Yahor Berdnikau ccbca7a019 [Gradle] Move pm20 interfaces from plugin/api into plugin codebase
^KT-58619 Fixed
2023-05-10 23:27:14 +02:00
Yahor Berdnikau ac2d00916c Fix toolchain does not configure project level jvm target convention
Now JDK toolchain configures project level compiler options jvm target
convention and does not override convention for task.

For use case when toolchain is configured via task DSL jvm target
convention overrides project level convention.

^KT-57393 Fixed
2023-05-10 20:54:03 +00:00
Dmitrii Gridin aa5261395e [LL FIR] allow parallel resolve for non-jumping phases
^KT-56550 Fixed
2023-05-10 17:17:46 +00:00
Dmitrii Gridin 7f778eafa5 [LL FIR] add missing declarations transformations for COMPILER_REQUIRED_ANNOTATIONS phase
The transformed does nothing previously

^KT-56550
2023-05-10 17:17:46 +00:00
Dmitrii Gridin 231c59bd2c [LL FIR] drop redundant lazy annotations calculation from ANNOTATIONS_ARGUMENTS_MAPPING phase
They must be calculated on the previous ARGUMENTS_OF_ANNOTATIONS phase

^KT-56550
2023-05-10 17:17:46 +00:00