Commit Graph

101142 Commits

Author SHA1 Message Date
Yahor Berdnikau eef7c3e834 Publish serialization plugin as kotlin-serialization-compiler-plugin
With this change it will have consistent naming with other compiler plugins.

'-embeddable' was also renamed.

'dist' should contain two identical jar files:
- 'serialization-compiler-plugin.jar'
- 'kotlinx-serialization-compiler-plugin.jar'

^KT-58530 In Progress
2023-05-12 09:31:41 +00:00
Troels Bjerre Lund bc7b1094c3 K/N custom-alloc: Fix GC stats for NextFitPage ^KT-55364
Swept and kept objects in NextFitPages are double counted; first in
GCApi::SweepObject and then again inside NextFitPage::Sweep. This fix
removes the latter.


Co-authored-by: Troels Lund <troels@google.com>

Merge-request: KOTLIN-MR-691
Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
2023-05-12 09:24:16 +00:00
Mikhail Glukhikh 36d6e6dd06 K2: prevent infinite recursion in findJavaSuperClass #KT-55078 Fixed 2023-05-12 08:24:13 +00:00
Sebastian Sellmair 352fd5356e [Gradle] Document IllegalStateException thrown in ExternalKotlinTargetDescriptor {}
KT-58601
2023-05-12 08:14:47 +00:00
Sebastian Sellmair ca2a5a8ebf [Gradle] Remove .configure property from External.*Descriptors
KT-58601
2023-05-12 08:14:47 +00:00
Sebastian Sellmair 74fd66202b [Gradle] Remove unnecessary Deprecated ExternalKotlinTargetApis
KT-58601
2023-05-12 08:14:46 +00:00
Sebastian Sellmair d9f572bc0b [Gradle] Remove old ExternalTargetApiExtensions
KT-58601
2023-05-12 08:14:46 +00:00
Sebastian Sellmair f588b06ca5 [Gradle] Remove .configure duplication in ExternalKotlinTargetDescriptorBuilder
KT-58601
2023-05-12 08:14:46 +00:00
Sebastian Sellmair e1e2c04044 [Gradle] Replace IdeMultiplatformImport.*Level enums with simpler IdeMultiplatformImport.Priority
KT-58601
2023-05-12 08:14:46 +00:00
Sebastian Sellmair d4e1321c65 [Gradle] Add documentation on IdeMultiplatformImport.serialize
KT-58601
2023-05-12 08:14:46 +00:00
Sebastian Sellmair 82ac61e306 [Gradle] Remove IdeDependencyResolver and IdeDependencyTransformer .plus methods
KT-58601
2023-05-12 08:14:46 +00:00
Sebastian Sellmair 68814ccd67 [Gradle] IdeDependencyResolver.WithBuildDependencies: Add example to doc
KT-58601
2023-05-12 08:14:46 +00:00
Sebastian Sellmair ca38f3192c [Gradle] IdeAdditionalArtifactResolver, IdeDependencyResolver: Replace object Empty with companion val empty
... to remove the type from the API surface.

KT-58601
2023-05-12 08:14:46 +00:00
Sebastian Sellmair df8b098cc0 [Gradle] Document IdeAdditionalArtifactResolver.resolve...
... providing the contract of the function as well as further clarifying
on the term 'additional artifact'

KT-58601
2023-05-12 08:14:46 +00:00
Egor Kulikov 34db304ef7 [FIR] Init packageFqName when calculating lazy arguments of anotations
^KT-58584 fixed

Merge-request: KT-MR-10113
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
2023-05-11 22:00:09 +00:00
Ilya Kirillov 4c69f2fbcb [Analysis API] fix "Unexpected class FirTypeProjectionWithVarianceImpl" exception
from KtFirExpressionTypeProvider.getKtExpressionType

^KTIJ-23432 fixed
2023-05-11 20:44:31 +02:00
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