Commit Graph

97590 Commits

Author SHA1 Message Date
Alexander Udalov 549bfb2d9e Kapt+JVM_IR: generate annotation property initializers
#KT-55490 Fixed
2023-01-13 02:38:40 +01:00
Alexander Udalov 1a5aedd27a Kapt+JVM_IR: unignore some tests 2023-01-13 02:38:39 +01:00
Pavel Mikhailovskii 38a56ba8e8 KT-55308, KT-55769 Sort InnerClasses entries. Add DONT_SORT_DECLARATIONS directive 2023-01-13 01:07:10 +00:00
Hung Nguyen 63a0660cc3 IC: Close caches before falling back to non-incremental compile
Previously, we didn't close caches if incremental compilation failed.
The assumption was that we would fall back to non-incremental
compilation, where it shouldn't matter whether caches were closed or not
as non-incremental compilation should be able to recover from a
corrupted state of the caches.

However, this choice might have caused issues such as KT-55709 where
non-incremental compilation fails after fallback.

In this commit, we will now always close the caches before falling back,
just to be safe.

TODO:
  1. We'll need to verify whether not closing the caches was the actual
     cause of KT-55709, and that this commit fixes it.
  2. Even if this commit fixes the issue, we'll need to see why
     non-incremental compilation fails to recover from unclosed caches
     (it would remain unsafe if that was not addressed).

^KT-55709 In progress (see TODO #1 above)
2023-01-13 00:00:42 +01:00
Artem Kobzar 7156200953 [K/JS] serialize enum entries as a byte instead of int 2023-01-12 21:15:01 +00:00
Igor Chevdar df778b8a6e [K/N] Pass transitive dependencies for forked caching compilation 2023-01-12 19:59:37 +00:00
Pavel Mikhailovskii e2618ca9d3 Delete accidentally added code 2023-01-12 20:50:11 +01:00
Artem Daugel-Dauge 1216c39865 Supress Gradle warnings for some macos tests as a workaround for KT-55751
Merge-request: KT-MR-8277
Merged-by: Artem Daugel-Dauge <Artem.Daugel-Dauge@jetbrains.com>
2023-01-12 19:47:21 +00:00
Svyatoslav Scherbina ed9f5497fb Native: remove unused code 2023-01-12 17:52:11 +00:00
Svyatoslav Scherbina d096641ddb K2: fix cinterop signature computation in Native 2023-01-12 17:52:10 +00:00
Svyatoslav Scherbina b7c336217f K2: fix accept() impl for IrBasedPropertyAccessorDescriptor
Otherwise IdSignatureDescriptor computes wrong signatures for such
descriptors.
2023-01-12 17:52:10 +00:00
Dmitriy Novozhilov 1984a1615e [Serialization] Use new DSL for generating declarations 2023-01-12 17:45:41 +00:00
Dmitriy Novozhilov 5fedb2f72d [Parcelize] Use new DSL for generating declarations 2023-01-12 17:45:41 +00:00
Dmitriy Novozhilov 3744878b6d [FIR Plugin prototype] Use new DSL for generating declarations 2023-01-12 17:45:40 +00:00
Dmitriy Novozhilov 42db0b14f0 [FIR] Move all type construction utilities into one file 2023-01-12 17:45:40 +00:00
Dmitriy Novozhilov ce8489a8a5 [FIR] Add ability to create accessor to declaration attribute on symbol 2023-01-12 17:45:40 +00:00
Dmitriy Novozhilov 185e57e601 [FIR] Introduce builders API for generating declarations in compiler plugins
^KT-53096 Fixed
2023-01-12 17:45:39 +00:00
Dmitriy Novozhilov 6783621eb0 [FIR] Change API for generating nested classes from plugins
`FirDeclarationGenerationExtension.generateClassLikeDeclaration` was split
  into two functions: one for generating top level classes, and one for
  nested classes. Such change reduces verbosity and error-proness of
  this extension and also allows to smoothly run plugins on local classes

^KT-55248 Fixed
2023-01-12 17:45:39 +00:00
Dmitriy Novozhilov faa96ec7c0 [AA LC] Don't create light methods if value class is present in signature
^KT-55788

Test `parameter_jvmInline.kt` is removed because now members with value
  classes are not included in light classes and don't have PSI representation
2023-01-12 17:45:10 +00:00
Dmitriy Novozhilov 16b72d3e54 [AA] Unwrap type aliases in annotation arguments
^KT-55782 Fixed
2023-01-12 17:45:10 +00:00
Dmitriy Novozhilov 34af013913 [AA LC] Add test for modifiers of delegate fields 2023-01-12 17:45:09 +00:00
Dmitriy Novozhilov 95f5848e6c [AA LC] Save unresolved qualifier name in arguments of annotations 2023-01-12 17:45:09 +00:00
Dmitriy Novozhilov ed867af01d [AA LC] Expand aliases of type arguments during conversion to KtType
^KT-55781
2023-01-12 17:45:09 +00:00
Dmitriy Novozhilov 36ae901b19 [AA LC] Map unresolved types according to aliased imports 2023-01-12 17:45:08 +00:00
Dmitriy Novozhilov d5a76a1b3b [AA LC] Keep original qualifier while translating error cone types to Psi types 2023-01-12 17:45:08 +00:00
Dmitriy Novozhilov a3b9f15ecc [AA LC] Create proper Psi types for types with errors inside 2023-01-12 17:45:08 +00:00
Dmitriy Novozhilov 3a536bb32f [AA LC] Approximate anonymous type to single supertype if possible
^KT-55780 Fixed
^KT-55778 Fixed
2023-01-12 17:45:07 +00:00
Dmitriy Novozhilov 935b4f2feb [AA LC] Add workaround for jvmDefaults compatibility 2023-01-12 17:45:07 +00:00
Dmitriy Novozhilov d7cd2b72b0 [AA LC] Add test for strange JVM identifiers 2023-01-12 17:45:07 +00:00
Dmitriy Novozhilov e7148daad2 [FIR] Properly substitute arguments of error types 2023-01-12 17:45:06 +00:00
Dmitriy Novozhilov edbf199f84 [FIR] Remove redundant lookupTag from AbstractConeSubstitutor.substituteArgument 2023-01-12 17:45:06 +00:00
Dmitriy Novozhilov bd26c29229 [FIR] Resolve arguments of error types during type resolution 2023-01-12 17:45:06 +00:00
Dmitriy Novozhilov bc93556dbb [FIR] Allow FirElementSerializer.packagePartProto accept multiple files
This is needed for cases when there are multiple files with same name
 and `@JvmMultifileClass` annotation
2023-01-12 17:45:05 +00:00
Nicklas Ansman Giertz 22ab43838b KAPT: Skip importing java.lang.System in the stubs
This fixes KT-43117
2023-01-12 18:01:10 +01:00
Denis.Zharkov b009ee3744 Add @SinceKotlin and KDoc for ContextFunctionTypeParams
Initially, it was added accidentally as part of e3f987459c
and missed all out processes.

Adding @SinceKotlin("1.7") after the annotation has already been
published before is not really a problem, because it only may be used
with an experimental `-Xcontext-receivers` flag, thus it doesn't have
to be a part of our regular backward compatibility routine.

^KT-55226 Fixed
2023-01-12 16:53:48 +00:00
Sergej Jaskiewicz 4a2a77d9b9 [K/N] Make classes generated from λs that use generic parameters generic
Previously, a function reference that used generic parameters from its
outer scope was lowered into a top-level non-generic subclass of
`FunctionN`, with `FunctionN` type arguments referencing type parameters
not present in the scope anymore. This sometimes resulted in generating
malformed mangled names.

From now on the generated subclass of `FunctionN` is generic. The needed
type arguments are passed upon instantiation, when the relevant generic
parameters are present in the scope.
2023-01-12 15:32:50 +00:00
Nikolay Lunyak 0e1350f464 [FIR] Ensure NO_COMPANION_OBJECT is reported for typealiases
^KT-55733 Fixed
^KT-55186 Fixed
2023-01-12 13:51:11 +00:00
Pavel Kirpichenkov 609f417a13 Don't add Android compileOnly dependencies from associated compilations
KT-55697
2023-01-12 13:43:31 +00:00
Pavel Kirpichenkov 7fbd6b6452 Add test for compileOnly dependencies in Android
KT-55697
2023-01-12 13:43:31 +00:00
Jinseong Jeon 2dca2b4827 AA FE1.0: Fix StackOverflowError during resolution to a function w/ recursive type parameter
^KT-55825 Fixed
2023-01-12 19:48:21 +09:00
Justin Paupore 0c516f8483 [AA-FE1.0] Flatten spread arguments in annotations.
This requires plumbing a Fe10AnalysisContext through to the
KtFe10AnnotationsList, so that the context's module descriptor and
KotlinBuiltIns instance can be used to look up types correctly.

This eliminates the difference between the FIR and FE1.0 AA
implementations with regards to annotation spread argument handling.
2023-01-12 19:48:21 +09:00
Justin Paupore 212baf580c [AA-FIR] Fix handling of Java annotation parameters.
This changes FirAnnotationValueConverter to no longer rely on PSI
information when projecting annotation parameter information to AA.
For annotations defined in Java, including many meta-annotations, PSI
information is not available for the annotation. This caused those
annotation values to be projected as KtUnsupportedAnnotationValue.

Instead of using PSI information, this changes
FirAnnotationValueConverter to use the tree structure instead. Spread
and named parameter arguments are spliced into the parameter list of
their surrounding vararg calls, meaning that callers see the expected
structure. (See the varargSpreadParameter.kt test file for an example.)
2023-01-12 19:48:21 +09:00
Justin Paupore fbcde11b04 [AA] Add meta-annotation test for analysis API.
This test ensures that annotations on other annotations are properly
handled, even if those annotations are defined in Java rather than in
Kotlin.

Note that this functionality only works on FIR, and currently has bugs
that mean the result is an error type. Follow-on changes will fix the
error-type bug, and restore proper functionality for FIR.
2023-01-12 19:48:21 +09:00
Justin Paupore 686551d1eb [AA] Add support for printing meta-annotations in annotation tests.
This functionality will be used in follow-on commits.
2023-01-12 19:48:21 +09:00
Pavel Punegov a90983ca6a [K/N][test] Sync PsiFactory creation
CoreApplicationEnvironment.registerApplicationDynamicExtensionPoint should be
guarded to ensure registration won't happen concurrently

Merge-request: KT-MR-8251
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-01-12 10:39:43 +00:00
Yahor Berdnikau 37f3b7e816 Limit test versions in KotlinAndroidMppIT.testAndroidWithNewMppApp
Due to https://youtrack.jetbrains.com/issue/KT-51940/HMPP-resolves-configurations-during-configuration
2023-01-12 09:49:34 +00:00
Yahor Berdnikau e29bfffb6a Set max supported AGP version to 7.3 2023-01-12 09:49:34 +00:00
Yahor Berdnikau cd6f57eb86 Add AGP 8.0 to test versions 2023-01-12 09:49:33 +00:00
Yahor Berdnikau 90366dc914 Bump Kotlin stable version in tests to 1.6.21 2023-01-12 09:49:33 +00:00
Yahor Berdnikau fde17e60d3 Bump Gradle 8 version in tests to 8.0-rc1 2023-01-12 09:49:33 +00:00