Commit Graph

108848 Commits

Author SHA1 Message Date
Dmitrii Gridin c0f4f7fefd [LL FIR] AbstractFirLazyBodiesCalculatorTest: add ability to suppress test
We have inconsistency in lazy body calculator, but only tests are
affected, because in the production we recreated bodies anyway

^KT-62840
2024-02-14 16:16:01 +00:00
Dmitrii Gridin 256d83b005 [LL FIR] support lazy resolve of <destruct> script declaration
But support for entries still is not implemented yet

^KT-62840
2024-02-14 16:16:01 +00:00
Dmitrii Gridin 792af849df [LL FIR] add getOrBuildFir test on destructuring declaration annotation
It doesn't resolve the property as it is treated as a local one

^KT-62840
2024-02-14 16:16:01 +00:00
Dmitrii Gridin 9ca0bdcb80 [FIR] make script destructuring declaration initializer lazy expression
This change is required to properly support such declarations in lazy
resolution mode as we usually replaced initializers with lazy
expressions during the body calculation phase

^KT-62840
2024-02-14 16:16:01 +00:00
Dmitrii Gridin 898c8c002e [LL FIR] add lazy body calculation tests for scripts
After KT-65344 we can effectively calculate lazy bodies in scripts,
so we can safely add the test

^KT-62840
2024-02-14 16:16:01 +00:00
cristiangarcia f77c08a821 Fail fast, and with a descriptive error, if both configuration-cache and native are enabled
Required for KTI-1553
2024-02-14 14:45:15 +00:00
Vladimir Dolzhenko 95ea711659 Fix PsiLiteral#getReferences
#KTIJ-28769


Merge-request: KT-MR-14391
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2024-02-14 13:39:50 +00:00
aleksandrina-streltsova 89681e0a47 [Analysis API] override equals in KtFirReceiverParameterSymbol
KTIJ-28786
2024-02-14 13:25:47 +00:00
Sergey.Shanshin 9a8ebd5c21 [KxSerialization] Cover all combinations of language and serialization features with tests for enums
Resolves https://github.com/Kotlin/kotlinx.serialization/issues/2324


Merge-request: KT-MR-13775
Merged-by: Sergei Shanshin <Sergey.Shanshin@jetbrains.com>
2024-02-14 13:15:01 +00:00
Kirill Rakhman e39af4583e [FIR] Report deprecation on synthetic property calls on super receivers
#KT-65438 Fixed
2024-02-14 13:13:01 +00:00
Kirill Rakhman 35e9170af1 [FIR] Rename hidden methods around HiddenEverywhereBesideSuperCalls and add documentation. 2024-02-14 13:13:01 +00:00
Kirill Rakhman e8cbd8a1cd [FIR] Report OVERRIDE_DEPRECATION for overrides of HIDDEN_IN_DECLARING_CLASS_ONLY
#KT-65438 Fixed
2024-02-14 13:13:01 +00:00
Kirill Rakhman 24367e0ad8 [FIR] Implement isHiddenEverywhereBesideSuperCalls logic for constructors
#KT-61448 Fixed
2024-02-14 13:13:01 +00:00
Kirill Rakhman 2f49272c42 [FIR] Create fake hidden versions of List.getFirst/getLast in JDK < 21
... so that overrides are marked as deprecated regardless of the JDK.

#KT-65440 Fixed
2024-02-14 13:13:01 +00:00
Kirill Rakhman c6b2675089 [FIR] Implement deprecation for calls to overrides of hidden
#KT-65438
2024-02-14 13:13:00 +00:00
Kirill Rakhman e16f80c578 [FIR] Prevent duplicate full stop in DEPRECATION messages 2024-02-14 13:13:00 +00:00
Kirill Rakhman fc6d25e50f [FIR] By default, only hide members from mapped scope but not overrides
This affects methods like List.getFirst/getLast where it was decided
to keep them hidden but to make them visible on overrides like
ArrayList or LinkedList.
The goal is to prevent a breaking change since some implementations
like LinkedList had this method before JDK 21.

#KT-65438
2024-02-14 13:13:00 +00:00
Vladimir Sukharev fbe8db4b45 [K/N][Tests] Migrate test override_konan_properties0 and add testDriverVersion
^KT-61259
2024-02-14 12:16:23 +00:00
Vladimir Sukharev 9ef051dbc5 [K/N][Tests] Migrate test override_konan_properties0
^KT-61259
2024-02-14 12:16:22 +00:00
Vladimir Sukharev d8a90f55a8 [K/N][Tests] Migrate driver test llvm_variant_dev
^KT-61259
2024-02-14 12:16:22 +00:00
Vladimir Sukharev 3ad8fed5a3 [K/N][Tests] Migrate test embedStaticLibraries.kt
^KT-61259
2024-02-14 11:56:59 +00:00
Pavel Kunyavskiy 6e8a7d4662 [ObjCInterop] Implement @ObjCSignatureOverride
This annotation leads to conflicting overloads error supression,
in case where several function with the same argument types,
but different argument names are inherited from ObjC class.

We need to implement it in both K1 and K2 to make the IDE experience
better.
But the annotation itself wouldn't be available in K1.

    ^KT-61323
2024-02-14 11:44:01 +00:00
Pavel Kunyavskiy 77eee0d3fc [K/N] Fix platform libraries in K1 native diagnostic tests
K1 setup for diagnostic tests was not able to use
platform libraries. This is required for ObjCSignatureOverride
testing.

We need to test it in both K2 and K1 to make IDE experience better.
2024-02-14 11:44:01 +00:00
Pavel Kunyavskiy d100a07981 [K/N] Move ObjCOverridabilityCondition to proper module
It was not active in diagnostic tests otherwise.
2024-02-14 11:44:01 +00:00
Alexander Udalov 41c6cca689 IR: minor, remove unnecessary isFromJava check
This is an addition to b72effab98. For JVM, this code is not supposed
to affect anything, and for non-JVM, declarations from Java are not
possible.
2024-02-14 11:27:09 +00:00
Artem Olkov 16b985b36e Support for Unsigned Types in swift export #KT-65668 fixed
Merge-request: KT-MR-14300
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-02-14 11:10:51 +00:00
Nikolay Lunyak fa5ae18980 [FIR] Fix a typo in a test data file name
^KT-65337
2024-02-14 09:57:13 +00:00
Nikolay Lunyak fdb2b714c9 [FIR] Remove redundant INITIALIZER_TYPE_MISMATCH introduced earlier 2024-02-14 09:57:12 +00:00
Nikolay Lunyak 389f02b016 [FIR] Let FirErrorExpression have a working type if possible
^KT-65337 Fixed
2024-02-14 09:57:12 +00:00
Nikolay Lunyak 7f42596935 [FIR] Reproduce KT-65337
^KT-65337
2024-02-14 09:57:12 +00:00
Mikhail Glukhikh 6ed7c041b4 K1/K2: add various tests for context receiver tower resolve priority
Related to KT-64531, KT-64488
#KT-64531 As Designed
2024-02-14 09:55:51 +00:00
Kirill Rakhman e88865e4c7 [FIR] Fix methods with erased parameters missing from raw collection scope
#KT-65448 Fixed
2024-02-14 09:55:24 +00:00
Kirill Rakhman 931480b12d [FIR2IR] Fix nullability of converted raw types
#KT-65298 Fixed
2024-02-14 09:55:24 +00:00
Vladimir Sukharev 3b4ca56f74 [K/N][Tests] Migrate test platform_zlib.kt
^KT-61259
2024-02-14 09:55:06 +00:00
Vladimir Sukharev 06a89a0061 [K/N][Tests] Migrate test withSpaces.kt
^KT-61259
2024-02-13 22:14:30 +00:00
Vladimir Sukharev 2bb9b936ac [K/N][Tests] Small cleanup 2024-02-13 22:14:30 +00:00
Vladimir Sukharev 34af80943c [K/N][Tests] Remove obsolete cppInterop tests
^KT-61259
2024-02-13 21:48:40 +00:00
Alexander Udalov b72effab98 IR: remove isFromJava check from isOverridableMemberOrAccessor
This is needed because in case a static member is inherited via a Kotlin
class (class C in the newly added test), its origin becomes
FAKE_OVERRIDE which is technically not Java anymore. After this change,
we'll build fake overrides for static members from superclasses
regardless of whether they come from Java or Kotlin.

Also, move the previous logic of
isOverridableFunction/isOverridableProperty to the only call site at
IdSignatureFactory.

 #KT-65589 Fixed
2024-02-13 21:03:33 +00:00
Dmitriy Dolovov 03418c11c3 [kotlinp] Change the package name in :tools:kotlinp-jvm subproject
Change the package name for all *.kt files inside
the :tools:kotlinp-jvm subproject from "org.jetbrains.kotlin.kotlinp"
to "org.jetbrains.kotlin.kotlinp.jvm"

^KT-62340
2024-02-13 21:01:08 +00:00
Dmitriy Dolovov d30efdb001 [kotlinp] Split :tools:kotlinp into "common" and "jvm" subprojects
The "common" subproject keeps only backend-neutral logic and depends
only on :kotlinx-metadata library. It takes the name of the former
project - :tools:kotlinp

The "jvm" subproject depends on the "common" one and also depends
on :kotlinx-metadata-jvm. It gets the new name - :tools:kotlinp-jvm

There is a lot of touched files in this commit. The majority of them
is just moved files (tests, test data, etc).

Only the following files were actually modified:
  .space/CODEOWNERS
  build.gradle.kts
  libraries/tools/abi-comparator/build.gradle.kts
  libraries/tools/kotlinp/build.gradle.kts
  libraries/tools/kotlinp/jvm/build.gradle.kts
  plugins/kapt3/kapt3-compiler/build.gradle.kts
  settings.gradle

 ^KT-62340
2024-02-13 21:01:08 +00:00
Dmitriy Dolovov eec76865a7 [kotlinp] Refactor to separate common part from JVM-specific part
This refactoring includes the following:
1. Separate backend-neutral part of the metadata printer `Kotlinp`
   from the part that accesses JVM-specifics: `JvmKotlinp`.
2. Introduce `org.jetbrains.kotlin.kotlinp.Printer`: The component
   that renders both individual `Km*` nodes and the whole metadata
   tree, and does so with the proper indentation.

^KT-62340
2024-02-13 21:01:08 +00:00
Dmitriy Dolovov d769328311 [kotlinp] Minor. Remove unnecessary -opt-in=kotlin.RequiresOptIn
This opt-in is no more required in :tools:kotlinp

^KT-62340
2024-02-13 21:01:08 +00:00
cristiangarcia e876a42e3d checkRepositories is not configuration cache compatible
Required for KTI-1553
2024-02-13 19:29:47 +00:00
Pavel Kunyavskiy 7e3e9aafa4 [IR] Add kdoc for IrExternalPackageFragment 2024-02-13 17:30:53 +00:00
Marco Pennekamp b24c75d04c [LL] Fix computeIfAbsent contract violation during dangling file session creation
- To avoid recursive updates, we can create sessions which cannot be
  created in isolation outside `computeIfAbsent`. Note that this is the
  current behavior of the default implementation of
  `ConcurrentMap.computeIfAbsent`, which will be replaced soon with
  the stricter behavior of `CleanableSoftValueCache` (see KT-61222).

^KT-65683 fixed
2024-02-13 17:14:20 +00:00
Dmitrii Gridin 2e2e592cc3 [Analysis API] CliTestModuleCompiler: support LANGUAGE_VERSION directive
^KT-64884
2024-02-13 16:07:17 +00:00
Dmitrii Gridin a567793d10 [LL FIR] add workaround for deserialization of data classes
To correctly process old metadata without properly sorted properties

^KT-64884 Fixed
2024-02-13 16:07:17 +00:00
Dmitrii Gridin faebef171d [Analysis API] add regression tests for data class copy arguments usage
This issue is not reproducible against the K2 compiler

^KT-64884
2024-02-13 16:07:17 +00:00
Vladimir Dolzhenko ad119a707c Fix equals/hashCode for LC fake files
#KTIJ-28770 Fixed


Merge-request: KT-MR-14341
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2024-02-13 15:47:09 +00:00
Dmitrii Gridin ab328e76d4 [LL FIR] FirDesignation: update KDoc for collectDesignationWithOptionalFile
^KT-65344
2024-02-13 14:58:31 +00:00