Commit Graph

101022 Commits

Author SHA1 Message Date
Kirill Rakhman 9187bbb710 [FIR] Fix typo 2023-05-09 13:36:33 +00:00
Kirill Rakhman 93ee4d7ce7 [FIR] Refactor DiagnosticKind.Syntax into ConeSyntaxDiagnostic
#KT-58469
2023-05-09 13:36:33 +00:00
Roman Golyshev 7a9021aa6b [AA FIR] KT-58503 Do not use resolvedStatus for visibility yet
It's done to avoid lazy resolve contract violation errors. See KT-58572
2023-05-09 13:20:17 +00:00
Roman Golyshev 105611679e [AA FIR] KT-58503 Use resolvedStatus to access visibility and modality of a class
Compiler plugins (AllOpen, for example) can modify the status of a
declaration, including visibility and modality. If we observe them
without enforcing STATUS resolve, we risk to see incorrect information,
which in turn can lead to false negatives/positives in
inspections/intentions.

Add test for light classes. See KT-58503 description for the explanation
how the initial problem was influencing Spring inspections from intellij
repository.

^KT-58503 Fixed
2023-05-09 13:20:16 +00:00
Alexander Udalov c06ec84bb1 JVM: fix type mapping of big arity suspend function types
The code in IrTypeMapper was incorrectly translated from
KotlinTypeMapper during the development of JVM IR. The
`classDescriptor.hasBigArity` condition in KotlinTypeMapper was checking
if the class represents a function or a suspend function with big arity,
and the suspend function part was lost during conversion.

This resulted in incorrect generic signature being generated, which led
to malformed type exceptions from reflection, and compilation errors
from kapt stub generation.

Also, change a comment in irCodegenUtils to avoid confusion of numbered
function types (kotlin.jvm.functions.Function1, ...) with the big-arity
type kotlin.jvm.functions.FunctionN.

 #KT-58375 Fixed
2023-05-09 12:57:07 +00:00
Artem Daugel-Dauge f659b63aef [Tests] Add missing experimental cinterop optins (after KT-57728) in various Gradle IT 2023-05-09 12:47:32 +00:00
Artem Daugel-Dauge dadb3673ba Bump Kotlin/Native version to 1.9.20-dev-810 2023-05-09 12:47:32 +00:00
Alexander Udalov 45bf70c9f9 Minor, add debug stepping test for KT-44745 2023-05-09 12:44:47 +00:00
Nataliya.Valtman 59f9d0afd9 Fix FusStatisticsIT test 2023-05-09 12:33:36 +00:00
Sergey.Shanshin c9bde57e44 [KxSerialization] Fix NPE if sealed class has self-referencing property
Fixes Kotlin/kotlinx.serialization#2294

If the serializable class contains itself as a property, and its serializer is not an object (for example, for a sealed class), in this case there is a race in the initialization of the serializer and child serializers.

To avoid this the serialization class should not cache its own serializer as a child.

Merge-request: KT-MR-10019
Merged-by: Sergey Shanshin <Sergey.Shanshin@jetbrains.com>
2023-05-09 09:59:11 +00:00
Pavel Punegov 5a95d919c7 [K/N] Add kotlinx.cinterop.ExperimentalForeignApi opt-ins
Add more opt-ins in Samples, tests and Benchmarks.
This is a follow-up to KT-MR-9788 

Merge-request: KT-MR-9997
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-05-09 09:39:40 +00:00
Ilya Goncharov 14653799b5 [Gradle, JS] Depends umbrella packageJson task onto publicPackageJson task 2023-05-09 09:29:35 +00:00
Mikhail Glukhikh 0906258d03 K2: handle suspend anonymous functions properly in various compiler parts
#KT-58332 Fixed
2023-05-09 09:19:38 +00:00
Mikhail Glukhikh aec0def5ca FE: add test for KT-58332 (K2 fails with ARGUMENT_TYPE_MISMATCH) 2023-05-09 09:19:37 +00:00
Pavel Kunyavskiy 11e1bcca1d [K/N] Avoid using deprecated functions in data class generated methods
^KT-58267
2023-05-09 09:18:42 +00:00
Pavel Kunyavskiy 2f3947d8e5 [K/N] Unmute some actually passing tests 2023-05-09 09:15:41 +00:00
Bogdan Mukvich d78e30a5f5 Generate SBOM for kotlin-compiler.zip 2023-05-09 08:46:07 +00:00
Bogdan Mukvich 60b2dffeb3 Ignore SBOM in reproducible build 2023-05-09 08:46:07 +00:00
Bogdan Mukvich dccb7a221c Add SBOM plugin and configuration 2023-05-09 08:46:06 +00:00
Bogdan Mukvich 5ac255f4dc Add JDK 11 to kotlin build env 2023-05-09 08:35:07 +00:00
Dmitriy Novozhilov af60681705 [FIR] Save declarations in metadata in source order
^KT-54792 Fixed
^KT-54801
^KT-54800
2023-05-09 07:36:32 +00:00
Dmitriy Novozhilov b359a5538c [FIR] Get rid of FirSerializerExtension.customClassMembersProducer
This service was needed in FE 1.0 because of different scope structure
  for Java classes, but seems like it has no sense for FIR
2023-05-09 07:36:32 +00:00
Anna Kozlova cf6a06fd14 [LL] [cls] don't access index to retrieve fir for given ktElement
also don't check name pattern, because
given ktElement proves that corresponding package contains something
2023-05-09 07:36:11 +00:00
Anna Kozlova e47561e70b [FIR tests] do not distinguish builtins & library origins
fir which is retrieved by LL symbol providers based on stubs,
receives builtin origin when found in kotlin_builtins

pure compiler providers found the same fir declarations in stdlib
and thus receive Library origin

to avoid splitting the testdata, let's ignore the difference
2023-05-09 07:36:11 +00:00
Anna Kozlova 89a03a74e4 [FIR] make use of FirFromMissingDependenciesNamedReference
during java annotations mapping in IDE, kotlin classes are not available,
thus FirFromMissingDependenciesNamedReference is created

Corresponding test in IJ repo:
K2HighlightingMetaInfoTestGenerated.Uncategorized#testJavaTypes
2023-05-09 07:36:10 +00:00
Anna Kozlova 366c67a668 extract StandartNames.NAME constant 2023-05-09 07:36:10 +00:00
Anna Kozlova 92b6a77431 [LL] [cls] remove search for sources for decompiled FIR
stub based deserializer provides sources during initialization,
no need to search afterward
2023-05-09 07:36:10 +00:00
Anna Kozlova 5ca052f87b [LL] [cls] use stubBased symbol provider for builtins
this gives the following benefits:
1. no protobuf in memory, all data is already present in stubs
2. given that symbol provider for libraries is already stub based,
we can get rid of complicated code to find source psi by deserialized fir
3. it's also possible to reduce number of index access,
when fir is requested for given ktElement
2023-05-09 07:36:09 +00:00
Sebastian Sellmair c2970c4dda [Gradle] Add initial samples into KotlinPluginLifecycleSample
KT-58275
2023-05-09 07:32:38 +00:00
Sebastian Sellmair c05b86dc7c [Gradle] KotlinPluginLifecycle: Do not enter AfterBuildscriptEvaluate stage on failures
KT-58275
2023-05-09 07:32:38 +00:00
Sebastian Sellmair b437c3e0e9 [Gradle] KotlinPluginLifecycle: Rename .configured to .configurationResult
^KT-58255 Verification Pending
2023-05-09 07:32:38 +00:00
Sebastian Sellmair 08055b6188 [Gradle] KGP Diagnostics: Update KotlinGradleProjectChecker documentation
KT-58275
2023-05-09 07:32:38 +00:00
Sebastian Sellmair 287c431bc4 [Gradle] KGP Diagnostics: Run diagnostics launched & schedule report once Project is configured
KT-58275
2023-05-09 07:32:38 +00:00
Sebastian Sellmair d170897dbf [Gradle] Introduce Project.configured: Future<ProjectConfigurationResult> API
KT-58275
2023-05-09 07:32:38 +00:00
Sebastian Sellmair f616fffeb0 [Gradle] KotlinPluginLifecycle: Detect failure and abort further configuration
KT-58275
2023-05-09 07:32:37 +00:00
Sebastian Sellmair 8e9c3a21c0 [Gradle] Ensure Kotlin Plugin Lifecycle is started before in Plugin.apply
This should enable the lifecycle to still get into the
first 'afterEvaluate' based phase, even when an exception was thrown
in apply

KT-58275
2023-05-09 07:32:37 +00:00
Dmitrii Krasnov 375ff5ed2c migrated AppleFrameworkIT to junit5 and gradle TestKit
#KT-51553 In Progress

Merge-request: KT-MR-9856
Merged-by: Dmitrii Krasnov <Dmitrii.Krasnov@jetbrains.com>
2023-05-09 07:17:14 +00:00
Igor Chevdar b6030b3517 [K/N] Devirtualization: virtual calls from external world fix
The fix deals with the situation where a virtual function potentially from
the external world (because of the receiver) returns a final type (if it isn't final,
then it's conservatively assumed that no devirtualization could be done on it).

 #KT-57791 Fixed
2023-05-09 05:25:11 +00:00
Igor Chevdar 197cba35eb [K/N] Added couple of reproducers for KT-57791 2023-05-09 05:25:11 +00:00
Anna Kozlova c46a95aad7 [Light classes] do not write explicit options for IDE
those options are configured explicitly by test
2023-05-08 20:30:24 +00:00
Yahor Berdnikau 0790fef161 Fix explicit api mode in commonizer
^KT-57653
2023-05-08 19:43:43 +00:00
Yahor Berdnikau d57623891d Fix explicit api issues in analysis modules
Explicit api mode was not working due to the bug.

^KT-57653
2023-05-08 19:43:43 +00:00
Yahor Berdnikau 1860683a71 Fix explicit api issues in kotlin-build-tools-api
Explicit api mode was not working due to the bug.

^KT-57653
2023-05-08 19:43:43 +00:00
Yahor Berdnikau 2ea65bd658 Fix explicitApiMode could be overwritten by freeCompilerArgs
Now tasks has a separate task input for 'explicitApiMode' which is
passed to Kotlin compiler via arg, rather than free compiler args.

^KT-57653 Fixed
2023-05-08 19:43:43 +00:00
Dmitrii Gridin d3043b6f1c [LL FIR] do not treat declarations from object literal as non-local
^KTIJ-25437 Fixed
2023-05-08 16:08:26 +00:00
Mikhail Zarechenskiy 6d7dc45ce6 K1: Add test for compatibility check of Enum.entries
Basically, the test checks that adding Enum.entries feature doesn't
break the existing code where it clashes with the user-defined "entries"
declaration; it's better to have a black-box test to be sure
that the compiler doesn't invoke something different at runtime

 The test covers KT-53153 and KT-56587

Merge-request: KT-MR-9798
Merged-by: Michail Zarečenskij <Mikhail.Zarechenskiy@jetbrains.com>
2023-05-08 15:35:25 +00:00
Dmitrii Gridin 25f2c513f6 [LL FIR] drop global phase lock for super types phase
^KT-56551
2023-05-08 14:42:10 +00:00
Dmitrii Gridin 13dc4c8014 [LL FIR] split LLFirLockProvider on read and write API
^KT-56550
2023-05-08 14:42:10 +00:00
Nikolay Lunyak 76df0f9ad1 [FIR] KT-48870: Allow resolution to InaccessibleImplicitReceiverValue
^KT-48870 Fixed
2023-05-08 14:25:54 +00:00
Mikhail Glukhikh f472f68dc5 SymbolTable: replace assert with require in createOwnerSafe
Related to KT-57049
2023-05-08 13:32:18 +00:00