Commit Graph

101619 Commits

Author SHA1 Message Date
Evgeniy.Zhelenskiy c1ac580031 [IR] Fix MFVC fields not yet moved from their companions
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2023-05-12 18:36:49 +00:00
Roman Golyshev 90a0b34bf7 [AA FIR] KT-58503 Use resolvedStatus to access modality only in case of Status Transformers present
ATM unconditional `resolvedStatus` call in `modality` causes a
performance degradation in our completion tests

Since `resolvedStatus` is called to make sure that all the
status-transforming compiler plugins had finished their job, it doesn't
make sense to call `resolvedStatus` if there are no such compiler
plugins registered

N.B. After KT-56551 is fixed, this optimization might become obsolete
and can be removed if proved so
2023-05-12 16:22:48 +00:00
Leonid Startsev c4255f9a9e [K2] Instantiation of annotations having default values for properties
This commit adds missing pieces for the puzzle:

Annotation instantiation feature uses IrProperty's initializer to instantiate
properties from other modules that have default values which weren't
specified on call site.

To support this feature properly, Fir2IrVisitor should fill LazyIrProperty's
backing field initializer with information from Fir.

To get this information into Fir, FirMemberDeserializer should be able to read
it from KotlinJvmBinaryClass with AnnotationLoaderVisitorImpl. (klibs are unsupported for now)

There's a catch with enum entries references: we can't access session.SymbolProvider to resolve it
because we're still at the deserialization stage, and it can cause StackOverflow if enum is nested in the
same class (see RequiresOptIn.Level). To mitigate this, a new FirEnumEntryDeserializedAccessExpression is produced
instead; it is later replaced with the correct reference in the Fir2IrVisitor.

^KT-58137 Fixed

Also add test to loadJava folder with annotations default values that
verifies metadata loading
2023-05-12 16:08:02 +00:00
Alexander Udalov d757847ed6 JVM: enable -Xlambdas=class for some backend tests
These tests are checking the specifics of the class-generated lambdas.
2023-05-12 15:21:00 +00:00
Nikolay Lunyak 834ba397ad [FIR] KT-58284: Prevent missing diagnostics on for loops
^KT-58284 Fixed
2023-05-12 14:47:24 +00:00
Dmitrii Krasnov 606ffa7273 fixed test, which started to fail on WINDOWS env after test migration 2023-05-12 14:35:37 +00:00
Ivan Kochurkin d06d3ff467 [FIR2IR] Consider isExpect value of super members during fake-overrides generating
It's important for FIR2IR and IrActualizer

Because `isExpect` is a part of signature, and it's considered during actualization
2023-05-12 14:03:15 +00:00
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