Commit Graph

101619 Commits

Author SHA1 Message Date
Anna Kozlova 1d5c080dd8 [AA] calculate ktType based on symbols when possible
then, for compiled code deserialized fir would be used instead of building
decompiled text and consequence building and resolving of raw fir;

type for ktTypeReference from compiled code is called e.g., by UAST inspections
when they check annotations of the called function parameters
2023-05-31 06:26:28 +00:00
Ilmir Usmanov d7fd2471b8 JVM IR: Remove remains of 1.2 coroutines from tests
Remove CoroutineAdapter and LANGUAGE: +ReleaseContinuation,
which are meaninless now.
Update the tests accordingly.
2023-05-31 05:56:18 +00:00
Vladimir Sukharev ebc4cf7f96 [K/N] Normalize klib paths for KonanLibraryImpl
^KT-58979 Fixed

Merge-request: KT-MR-10372
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-05-31 04:53:58 +00:00
Ilya Gorbunov e11ebcadb4 Test refactor: extract big duration adjustment to a separate test 2023-05-31 04:45:15 +00:00
Ilya Gorbunov f8f3862f0c Make TimeMark adjustment test more stable 2023-05-31 04:45:15 +00:00
Sergej Jaskiewicz fd76a34277 [IR] Don't print flags in declaration references in irText tests
This doesn't reduce the quality of tests, because the flags are still
printed for declarations themselves. We only omit them in references.

However, this makes the tests more compatible with non-JVM backends
(see KT-58605), because flags of referenced stdlib declarations may
differ among target platforms.
2023-05-30 17:26:30 +00:00
Anna Kozlova b8e868caf6 [decompiler] navigate to containing class for fake object descriptors
^ KTIJ-25661
2023-05-30 17:23:54 +00:00
Kirill Rakhman 793e3552e7 [FIR] Add tests for K2-only suspend operators get/set/contains
#KT-57169
2023-05-30 16:48:53 +00:00
Kirill Rakhman ca022cf4dc [FIR] Forbid suspend operator get/setValue and provideDelegate
#KT-58989 Fixed
2023-05-30 16:48:53 +00:00
Alexander Shabalin aea8bac7d2 [K/N] Do not compile for deprecated targets and legacy MM
^KT-56533
^KT-58853
2023-05-30 16:44:58 +00:00
Kirill Rakhman d1ce55cbd2 [FIR2IR] Fix infinite loop between annotation and annotation parameter
When an annotation constructor value parameter is annotated with the
very same annotation, FIR2IR went in an infinite loop when trying
to generate it.
To fix this, the constructor is added to the Fir2IrDeclarationStorage
cache before generating the value parameters.
To accommodate for the missing parameters, the value arguments count
is determined using the FIR.
2023-05-30 15:53:12 +00:00
Ivan Kylchik fc75402f65 [IR] Add test to specify new logic of enum initialization with name call
#KT-58948
#KT-57538
2023-05-30 15:28:04 +00:00
Alexander Udalov 60016d3e5b Remove obsolete compiler flag -Xuse-ir 2023-05-30 14:46:09 +00:00
Alexander Udalov 2951e0b955 Rename/remove some compileKotlinAgainstCustomBinaries tests
"oldJvm*" tests are no longer testing the old JVM backend, so remove
that prefix from them. Also, remove the test "firAgainstOldJvm" because
it is now checking something that cannot NOT work.
2023-05-30 14:46:09 +00:00
Alexander Udalov bb4bb58453 Remove tests on -Xuse-ir compiler flag
This flag is going to be removed because old backend is not supported
anymore, therefore there's no need to test it.
2023-05-30 14:46:09 +00:00
Leonid Startsev 22096cec3c Make changelog for kotlinx-metadata-jvm 0.6.1 release
Note: actual release is done from 1.8.20 branch (commit 0043ae4390c8555b03428a014b660f395b924695)
2023-05-30 14:27:45 +02:00
Kirill Rakhman bc602b3827 [FIR] Reproduce #KT-58939 2023-05-30 11:59:57 +00:00
Kirill Rakhman cf2ef443f4 [FIR] Introduce a feature flag for context-sensitive enum resolution
The feature was previously enabled unconditionally in K2 which
triggered a bug when an enum has an entry with the same name as itself.

#KT-58897 Fixed
#KT-52774
2023-05-30 11:59:56 +00:00
Yahor Berdnikau 4b643480d6 [Gradle] Fix spelling errors in tryK2 report
^KT-58869 Fixed
2023-05-30 11:24:16 +00:00
Denis.Zharkov a9352abb93 K2: Optimize JvmMappedScope.processFunctionsByName for final classes 2023-05-30 10:44:41 +00:00
Denis.Zharkov 6683e229b4 K2: Simplify JvmMappedScope-related code a bit
JvmMappedScope.Signatures became mostly irrelevant and only
"useful" for checking if we really need to have the scope mapped

Now, the check is rewritten according to K1 semantics

^KT-57694 Fixed
2023-05-30 10:44:41 +00:00
Denis.Zharkov 6b1d9c4d56 K2: Adjust how additional built-in constructors from JDK are handled
This change is both makes code more consistent with K1 version
and fixes some issues introduced by previous changes

Before this fix, the test
FirPsiOldFrontendDiagnosticsTestGenerated$Tests$Modifiers$Const.testKCallable_after
was failing

^KT-57694 In Progress
2023-05-30 10:44:41 +00:00
Denis.Zharkov e4480a1c52 K2: Refine mapping of primitive arrays to JVM descriptor
Earlier, it wasn't really important but after the previous commit
when JvmMappedScope semantics has been changed, we erroneously
started loading `toCharArray` as a member to String because
its jvmDescriptor was computed to "toCharArray()Lkotlin/CharArray",
while hardcoded information that prevents it from loading expect
"toCharArray()[C" there.

^KT-57694 In progress
2023-05-30 10:44:41 +00:00
Denis.Zharkov 2e5b783cc6 K2: Refine how JDK members are mapped to built-in classes
Previously, the semantic was more-or-less correct for most of the cases
but some corner one, like `sort` in MutableList didn't work properly.

Namely, `sort` should be marked there in a way to forbid to call it
everywhere beside super-calls.
Also, overriding it should be allowed.

Mostly, the logic was re-written to K2 model from K1-related
JvmBuiltInsCustomizer.

^KT-57694 In progress
^KT-57269 Fixed
2023-05-30 10:44:41 +00:00
Dmitriy Dolovov 161fe1d2ca [IR] Don't produce gaps for skipped IR declarations during serialization 2023-05-30 10:14:08 +00:00
Kirill Rakhman a4c9a4f150 [FIR] Use optimized stdlib version of reversed list 2023-05-30 09:22:50 +00:00
Alexander Korepanov 8066f1b7d2 [JS IR] Do not copy interface method if base class inherits it
^KT-58599 Fixed
2023-05-30 08:22:43 +00:00
Kirill Rakhman 9ca9fc9c68 [FIR2IR] Set type arguments on annotation calls
#KT-58553 Fixed
2023-05-30 07:58:03 +00:00
Brian Norman 8091aebbc7 [FIR] Create checker for simple enum entries with missing overrides
Complex enum entries (those with bodies) with missing overrides
are covered by an existing checker that checks all types of classes. But
simple enum entries (those without bodies) were not covered and require
a separate checker for missing overrides.

#KT-58637 Fixed
2023-05-29 16:34:44 +00:00
Vladimir Sukharev 5bf51318eb [K2/N] Exit compilation on errors at first stage
^KT-56855

Merge-request: KT-MR-10344
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-05-29 10:38:28 +00:00
Sergej Jaskiewicz 28ead4118c [test] Unmute a couple of irText tests that no longer fail on K2 2023-05-29 09:24:43 +00:00
Igor Chevdar d9b0f2a75c [K/N] Refactored RedundantCoercionsCleaner
#KT-58654 Fixed
2023-05-29 06:13:09 +00:00
Igor Chevdar 1ae0350ca5 [K/N][tests] Added some file-check tests on KT-58654 2023-05-29 06:13:09 +00:00
Dmitrii Gridin 870527a4a3 [LL FIR] fix testData
The test was introduced in 4b1dc4eee6 and conflicts with 0ac02be534

^KT-56551
2023-05-27 16:17:33 +02:00
Anna Kozlova faedea6aea [psi] get type text based on provided stubs 2023-05-27 12:22:23 +00:00
Anna Kozlova 71844f81f4 [psi] decompiled code doesn't have function bodies
otherwise AST for decompiled code would be loaded by findChildByClass call

^ KTIJ-25047
2023-05-27 12:22:23 +00:00
Anna Kozlova 360e7d6156 [psi] decompiled code doesn't have documentation
otherwise AST for decompiled code would be loaded by allChildren call

^ KTIJ-25047
2023-05-27 12:22:23 +00:00
Dmitrii Gridin 72f30d78d6 [LL FIR] cache import scopes during compiler required annotations phase
In LL FIR file is always already resolved to import phase, so we can
cache the result

^KT-56551
2023-05-27 08:47:13 +00:00
Dmitrii Gridin dabc4e34ff [LL FIR] drop global lock from compiler required annotations phase
^KT-56551
2023-05-27 08:47:13 +00:00
Dmitrii Gridin 8f82649529 [LL FIR] rewrite compiler required annotations transformer to avoid lazy resolve under locks
^KT-56551
2023-05-27 08:47:13 +00:00
Dmitrii Gridin 4b1dc4eee6 [LL FIR] add more lazy resolve tests on compiler required annotations
^KT-56551
2023-05-27 08:47:13 +00:00
Dmitrii Gridin 8d151df252 [FIR] COMPILER_REQUIRED_ANNOTATIONS phase: drop redundant transformation of super type refs
We should transform only top-level annotations. Nested/type annotations
we can ignore

^KT-56551
2023-05-27 08:47:13 +00:00
Dmitriy Novozhilov d8b542c68d [Test] Allow testcases with number 0 in spec test
There was a hidden bug which was uncovered by KT-58936
2023-05-26 18:26:45 +03:00
Dmitriy Novozhilov 0c34b20e3d Advance bootstrap to 1.9.20-dev-2357 2023-05-26 18:26:44 +03:00
Vladimir Dolzhenko 984ab0a4b9 Revert "Drop KtStubElementTypes#FILE"
This reverts commit ae4b0c6fe1.
2023-05-26 15:13:25 +00:00
Alexander Shabalin 4ddc94bc8d [Gradle][MPP] DEPRECATE_ERROR for deprecated targets in tests ^KT-58822 2023-05-26 14:47:45 +00:00
Alexander Shabalin 1ef198ead4 [Gradle][MPP] Promote several K/N targets deprecation level to error 2023-05-26 14:47:45 +00:00
Vladimir Sukharev 1b1cfd45a0 [K2/N] Turn off IR verification for failed test interop_objc_smoke
This reverts commit 62901e22ec.

^KT-57716

Merge-request: KT-MR-10351
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-05-26 14:11:16 +00:00
Dmitriy Dolovov a01a6b64ad [PL] Fix: Don't use locations in compiler messages
^KT-58837
2023-05-26 14:03:33 +00:00
Yahor Berdnikau 9f12dae117 [repo] fix KGP pom has multiple dependencies on KGP-api 2023-05-26 13:20:41 +00:00