Commit Graph

97564 Commits

Author SHA1 Message Date
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
Alexander Udalov 539f1b32a6 Minor, somewhat deduplicate code in ClassFileToSourceStubConverter 2023-01-12 02:13:08 +01:00
Nicklas Ansman Giertz 3c69a0493e KAPT: Fix error types for receivers and property setters in stubs
When using correct error types and there is a property setter or
receiver for an unknown type then the parameter type would be `Object` instead
of the error type.

This fixes KT-46965 and KT-46966
2023-01-12 02:13:08 +01:00
Nicklas Ansman Giertz dd051c1556 KAPT: Preserve the order of annotations in the stubs
Previously the annotations were included in reverse order. With this
change they are kept in the same order as in the source file.

This changes the test case for KT-23427 but that issue seems to relate
to annotation arguments that are missing, not the order of repeatable
annotations.

This fixes KT-51087
2023-01-11 22:01:22 +01:00
Stanislav Erokhin 6f5ffeb6bb [Gradle][MPP] Fix test after K/N targets deprecation 2023-01-11 17:52:29 +00:00
Stanislav Erokhin dd95256b24 [Gradle][MPP] Add console warning about deprecated K/N targets 2023-01-11 17:52:28 +00:00
Stanislav Erokhin 37ab139139 [Gradle][MPP] Deprecate several K/N targets 2023-01-11 17:52:28 +00:00
Nikolay Krasko 3d4af8e1ab Remove mentioning of maven.zip in 1.8.0 instruction
KTI-1091
2023-01-11 16:46:08 +00:00
Anton Bannykh 3f57c9b107 JS IR: use ByteBuffer for faster js ast deserialization 2023-01-11 15:56:58 +00:00
Anton Bannykh 698be0fddd JS IR: custom JS AST serialization 2023-01-11 15:56:57 +00:00
Ivan Kochurkin 978f937fa9 [FIR Serialization] Fix serialization of generated nested classifiers
^KT-55759 Fixed
2023-01-11 16:07:02 +01:00
Aleksei.Cherepanov c120b185af Regenerate and mute JPS+K2 Tests
#KT-55195 Related
2023-01-11 15:35:16 +01:00
Alexander.Likhachev 32b98135a9 [Gradle] Remove redundant thread-safety in BuildStatisticsWithKtorIT 2023-01-11 14:19:34 +00:00
Alexander.Likhachev 25004a4842 [Gradle] Fix failures in reporting were saved effectively statically 2023-01-11 14:19:34 +00:00
Alexander.Likhachev 3f3d6fc74e [Gradle] Remove unused http reporting code 2023-01-11 14:19:33 +00:00
Alexander.Likhachev 5fd17fb233 [Gradle] Try to adjust port finding logic to fix tests flakiness 2023-01-11 14:19:33 +00:00
Alexander.Likhachev bef34e9cbf [Gradle] Add test for KT-55323 2023-01-11 14:19:33 +00:00
Alexander.Likhachev ded0bb760f [Gradle] Await for ktor initialization in BuildStatisticsWithKtorIT 2023-01-11 14:19:32 +00:00
Alexander.Likhachev 4f9adf894a [Gradle] Add ability to opt-out from reporting compiler arguments
#KT-55323 Fixed
2023-01-11 14:19:32 +00:00
Igor Chevdar ebaa09a710 [K/N][gradle] Fixed some gradle integration tests 2023-01-11 14:13:05 +00:00
Igor Chevdar 84d9afafd2 [gradle] Gradle property to switch between caching orchestration machineries
This is needed only for the translation period between old (Gradle) machinery
and the one (implemented directly in the K/N compiler)
2023-01-11 14:13:05 +00:00
Igor Chevdar 9aa287257b [K/N] Refactored a bit configuration setup 2023-01-11 14:13:04 +00:00
Igor Chevdar ae56f2686a [K/N][tests] Extracted common utility functions 2023-01-11 14:13:03 +00:00
Igor Chevdar 758e9ea9ae [K/N][tests] Added a couple of tests on caches 2023-01-11 14:13:03 +00:00
Igor Chevdar 342236491a [K/N] Supported different runtime options for caches 2023-01-11 14:13:02 +00:00
Igor Chevdar 73e10b17c6 [K/N][gradle] Set klib version from gradle 2023-01-11 14:13:02 +00:00
Igor Chevdar 9c86532eb0 [K/N] Implemented cache orchestration machinery in the compiler 2023-01-11 14:13:01 +00:00