Commit Graph

101162 Commits

Author SHA1 Message Date
Alexander Udalov 41cb2ce3d8 K/N: enable -Xlambdas=class for :kotlin-native:Interop:Indexer
`staticCFunction` is used a few times in this module, and it uses
kotlin-reflect to inspect the lambda parameter, which is only possible
for class-generated lambdas.

This is needed to enable indy lambdas in the project.
2023-05-12 14:01:30 +00:00
Dmitriy Dolovov 42a8b28337 [Native][tests] Don't track used memory when running in TeamCity 2023-05-12 13:58:18 +00:00
Dmitriy Dolovov 6f249ab615 [Native][tests] Minor. Fix condition for generating intermediate build dir 2023-05-12 13:58:18 +00:00
Dmitriy Dolovov bb5c1eea90 [Native][tests] Minor. Use "default" module name in AbstractNativeObjCExportTest 2023-05-12 13:58:18 +00:00
Dmitriy Dolovov 82984d782a [Native][tests] Unify work with build directories across BB & Simple tests
* Drop 'SimpleTestDirectories' in favor of 'Binaries'
* Make 'Binaries' lazy
2023-05-12 13:58:18 +00:00
Dmitriy Dolovov f7848133a6 [Native][tests] Fix generated framework log file name
$frameworkName.log -> $frameworkName.framework.log
2023-05-12 13:58:18 +00:00
Nikita Bobko 9a65dcb664 MUST_BE_INITIALIZED: take into account containingDeclaration's modality
^KT-58587 Fixed
Review: https://jetbrains.team/p/kt/reviews/10136

This commit is important in scope of KT-57553. It makes the migration
more smooth.

Other related tests:
- testUninitializedOrReassignedVariables
- testAugmentedAssignmentInInitializer
2023-05-12 13:48:49 +00:00
Dmitrii Gridin 4807a714ec [CODEOWNERS] introduce owner for light classes 2023-05-12 13:41:29 +00:00
Pavel Kargashinsky 603e30965b [MPP] Mute ExternalAndroidTargetPrototypeSmokeTest on Windows. 2023-05-12 13:26:40 +00:00
Pavel Kargashinsky 4b6ed128a2 [MPP] Use android.sdk from kotlin/dependencies for functionalTests 2023-05-12 13:26:40 +00:00
Alexander.Likhachev 877438b1f3 Remove LV/AV customization for the compiler CLI modules
The customization was added for compatibility with Gradle. That isn't a problem anymore, as we don't use it from KGP and soon we will eliminate the direct dependency on kotlin-compiler from KGP.
2023-05-12 12:59:39 +00:00
Alexander.Likhachev 44d9a2136b Bump language version for Gradle plugins' dependencies to 1.5
#KT-58569 Fixed
2023-05-12 12:59:39 +00:00
Bogdan Mukvich 3de59e3f17 Fix kotlinx-atomicfu-runtime sonatype publication
^KT-56400
2023-05-12 12:54:52 +00:00
Dmitrii Gridin 1d974b1ef7 [LL FIR] LLFirSuperTypeTargetResolver: propagate looped types more accurately
'forceSkipResolvedClasses' is wrong here, because nested class (`CC`)
won't be marked as cycle but the outer is.
Instead of this, we should check
canHaveLoopInSupertypesHierarchy recursively

```kotlin
open class C : <!CYCLIC_INHERITANCE_HIERARCHY!>D<!>() {
    open class CC
}
open class D : <!CYCLIC_INHERITANCE_HIERARCHY!>C.CC<!>()
```

Also, this commit adds an optimization to avoid hierarchy search
for non-source classes (forceSkipResolvedClasses was introduced for this before)
2023-05-12 11:36:43 +00:00
Yahor Berdnikau 2b27fe4e65 [Gradle] Fix moduleName is not possible to set in MPP project
^KT-57959 Fixed
2023-05-12 10:50:38 +00:00
Mads Ager a5157aa239 [FIR] Render attributes on function types.
Only render if there are non-compiler attributes to reduce
noise from extension function types.
2023-05-12 10:49:43 +00:00
Mads Ager 089928ba2b [K2] Support legacy serialization for custom function type extensions.
For Compose libraries, it is important that libraries built with
K2 in version 2.0 can be read and used by a version 1.9 K1
compiler. That is not possible if custom function types are
in the metadata.

^KT-58456 Fixed
2023-05-12 10:49:43 +00:00
Mads Ager fb476612af Add LANGUAGE_VERSION test directive. 2023-05-12 10:49:42 +00:00
Pavel Mikhailovskii 7ac5233a32 KT-54804 [SLC] Generate synthetic functions for annotations on properties in light classes 2023-05-12 09:39:37 +00:00
Yahor Berdnikau 111243f215 Restore shadowing compiler plugins into related maven plugins
This is required for backward compatibility for older versions of
Kotlin/IDEA plugin.

^KT-58530 Fixed
2023-05-12 09:31:41 +00:00
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