Commit Graph

102050 Commits

Author SHA1 Message Date
Vladimir Dolzhenko 05652e7d8d Improve exception handling and reporting
#KT-59445
2023-06-22 14:14:18 +00:00
Ilya Goncharov d865202bd5 [Wasm] Inline _importModule
^KT-59556 fixed
2023-06-22 13:56:47 +00:00
Pavel Punegov 1ad0a662fd [K/N] XCTest support: Make compiler produce bundles
XCTest test binary is a bundle plug-in that is similar to a framework.
This is a part of ^KT-58928

Merge-request: KT-MR-10662
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-06-22 13:23:17 +00:00
Anna Kozlova 92bcf3b2d5 [psi] packageCache: avoid pair as a key
supposedly, when search for package is performed,
it's performed multiple times with different names
but for the same scope.
In this situation, extracting scope from key brings a lot of memory.
For IJ, it reduces load from 7Mb -> 4Mb
2023-06-22 12:52:03 +00:00
Anna Kozlova abdc44c18a [LL] support search for decompiled fir for type parameters
^ KTIJ-25976
2023-06-22 12:51:44 +00:00
aleksandrina-streltsova d439bdd49f Move ClassId for IntrinsicConstEvaluation to StandardClassIds
^KTIJ-19863
2023-06-22 12:33:52 +00:00
aleksandrina-streltsova 3477d35168 [AA] Provide expected type for annotation entry argument
^KTIJ-19863
2023-06-22 12:33:51 +00:00
Mikhail Glukhikh fa6b1e24f9 FE: perform IOT approximation after resolution & inference
#KT-54917 Fixed
2023-06-22 12:29:11 +00:00
Mikhail Glukhikh 7884d9a61e K2: reproduce KT-54917 2023-06-22 12:29:11 +00:00
Ilya Goncharov 1c89a7e400 [JS] Remove legacy and output prefix-postfix tests 2023-06-22 12:25:24 +00:00
Ilya Goncharov 1465abcfed [JS] Source map to IR 2023-06-22 12:25:24 +00:00
Ilya Goncharov 5783693039 [JS] Remove js legacy codegen 2023-06-22 12:25:24 +00:00
Ilya Goncharov e7e6fba81f [JS] Fix JS legacy incremental 2023-06-22 12:25:24 +00:00
vladislav.grechko 38e9dfc823 Evaluate apiVersionIsAtLeast on compile time while IR-inlining
IR inliner should evaluate `apiVersionIsAtLeast` on compile-time (except
cases of inlining to inline functions from kotlin runtime) just as
bytecode inliner does.

^KT-59291: Fixed
2023-06-22 11:55:04 +00:00
Nikolay Lunyak f4f9f1f8f8 [Tests] Remove temporary directories check from finalize
This implementation of `finalize()` is incorrect. See: https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/lang/Object.html#finalize()

> If an uncaught exception is thrown by the finalize method, the exception is ignored and finalization of that object terminates.

> If a subclass overrides finalize it must invoke the superclass finalizer explicitly.

Instead of providing help by highlighting the tests that forget to clear the temporary directories, this `finalize()` causes OOM.

Merge-request: KT-MR-10756
Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>
2023-06-22 11:43:21 +00:00
Dmitrii Krasnov 0e51a00871 Migrated CommonizerIT to new test dsl (junit 5 and gradle test kit) 2023-06-22 10:35:56 +00:00
Dmitrii Gridin b22769919e [LL FIR] LLFirProvider: do not return unrelated FirFile for synthetic declarations
We do not expect to get a FirFile that is not associated with our requested element

^KT-59505
2023-06-22 10:22:37 +00:00
Dmitrii Gridin 34a871e0b0 [LL FIR] LLFirProvider: move backing field check to helper function
^KT-59505
2023-06-22 10:22:37 +00:00
Dmitrii Gridin f74d4494aa [LL FIR] fix designation path for synthetic declarations
A designation path for synthetic declarations like fake override
or member delegate contained the wrong FirFile, because it
was provided by the original declaration that is wrong.
So we should pick up the file from our path, because it shouldn't be
synthetic

^KT-59505 Fixed
2023-06-22 10:22:37 +00:00
Vladimir Sukharev a3758bf70b [K2/N] Mute failed test
^KT-58863

Merge-request: KT-MR-10762
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-22 10:01:01 +00:00
Jinseong Jeon 799aadfacf AA: add an option to create Application env for production v.s. test mode
...and use production mode by default for AA standalone

^KT-59511 Fixed
2023-06-22 11:32:29 +02:00
Pavel Mikhailovskii 134b02c754 KT-59563 [SLC] Fix type erasure in $annotations methods of extension properties 2023-06-22 09:06:12 +00:00
Vladimir Sukharev 3d60ed8874 [Test] Convert IGNORE: NATIVE directives in box tests from A to C
^KT-59057

Merge-request: KT-MR-10747
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-22 08:39:20 +00:00
Ilya Goncharov 2da0e622c0 [Gradle, JS] Add FIR variant of incremental multiproject test
^KT-56933 fixed
2023-06-22 08:21:00 +00:00
Dmitriy Dolovov 2e43fa7cd0 [PL][tests] Adapt tests for K/N to the conditions when static cache is used w/o lazy IR 2023-06-22 08:10:11 +00:00
Igor Chevdar 5f3dad14a2 [K/N] Make -Xlazy-ir-for-caches disabled by default 2023-06-22 08:10:11 +00:00
Igor Chevdar cc9dd48c09 [K/N] Support non-LazyIR for cached libraries
Use the same lazy deserialization mechanism (inline function bodies, class fields)
for both LazyIR and usual IR
2023-06-22 08:10:11 +00:00
Kirill Rakhman 6318da0f02 [FIR] Remove or replace whole expressions in FIR diagnostic messages
FIR expressions rendered by FirRenderer don't look very nice in error
messages anyway, and additionally, they can become arbitrarily large,
so we shouldn't use them in messages.

#KT-59449 Fixed
2023-06-22 08:02:07 +00:00
Dmitriy Novozhilov 0f0f0d604f [FIR] Expand typealiases before checking type of class literal 2023-06-22 07:09:15 +00:00
Dmitriy Novozhilov 6c7eb0167c [FIR] Report errors about type arguments on resolved qualifiers
^KT-56186 Fixed
^KT-56187 Fixed
^KT-59553
2023-06-22 07:09:15 +00:00
Dmitriy Novozhilov 1b24b95cde [FIR] Check for subtyping during actualization of supertypes of expect class
^KT-59356 Fixed
2023-06-22 07:05:31 +00:00
Roman Golyshev ac92c129bf KT-59093 [Analysis API] Remove unnecessary resolveCall overloads from KtCallResolverMixIn
^KT-58161 Fixed
2023-06-21 20:40:22 +00:00
Roman Golyshev 50c93b0228 KT-59093 [Analysis API] Make all resolveCall overloads nullable
Instead of returning an error which does not mean anything specific,
it's easier just to return `null`
2023-06-21 20:40:22 +00:00
Roman Golyshev c81b22e7de KT-59093 [Analysis API] Remove error logging from KtFirCallResolver
There are too many possible error cases when code resolution cannot
properly resolve a call. Since in external mode `Logger.error` calls
lead to visible IDE errors, we want to avoid that

^KT-59093 Fixed
2023-06-21 20:40:21 +00:00
Bart van Helvert 807df9a120 [AA] Properly render type arguments in short name renderer
Render type arguments for short names without nested qualifier.
2023-06-21 18:51:57 +00:00
Roman Golyshev 26dbeb9b6f KTIJ-25530 [Analysis API] Add missing test cases for Java statics
Can be done now because KT-58980 is fixed
2023-06-21 18:37:09 +00:00
Mikhail Glukhikh 4b7ab54d95 FE: fix test data after commit clash 2023-06-21 19:25:14 +02:00
Svyatoslav Scherbina 41247e8cef Native: workaround KT-59552 in filecheck_single_tls_load test
After recent changes (0cfb801) println got inlined into the checked
function. As a result, the test became affected by KT-59552.

Fix the test by moving println out of the checked function.
2023-06-21 15:49:53 +00:00
Alexander Udalov 13baf43ae3 K2: fix NSME on toChar for subclasses of Number
Code in `ReplaceNumberToCharCallSitesLowering` relies on `Number.toChar`
being declared in IR as non-abstract. Otherwise the
`resolveFakeOverride` call there doesn't work, and the lowering can't
rewrite the call to `toInt().toChar()`, and we end up with a call to the
missing method `Number.toChar` in the bytecode.

 #KT-57217 Fixed
2023-06-21 14:58:02 +00:00
Vsevolod Tolstopyatov 175cf5e833 KT-53327 replace Enum.values() with Enum.entries in CharCategory
Also, replace it in stdlib tests where appropriate and disable already unsupported legacy JS tests


^KT-53327 fixed

Co-authored-by: Artem Kobzar <Artem.Kobzar@jetbrains.com>

Merge-request: KT-MR-10632
Merged-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
2023-06-21 14:40:16 +00:00
Kirill Rakhman c867a4b52f [FIR] Don't expand typealiases when checking for DeprecatedSinceKotlin
During serialization, this can lead to a cycle resulting in a Stack
Overflow.

#KT-58356 Fixed
2023-06-21 14:35:43 +00:00
Alexander Udalov da884bd554 Minor, add error message to linker exception
(cherry picked from commit 04048d57ab912823504e9f57ddbc3a5f06b6af7c)
2023-06-21 14:24:28 +00:00
Alexander Udalov 530f533c84 K2 CLI: minor, remove misleading warning
Light tree is used by default now, so it's no longer far from being
production-ready.
2023-06-21 14:16:43 +00:00
Alexander Udalov 8653992ffc K2 CLI: wrap module name into angle brackets
This is not a user-visible change, so no issue is created and no tests
are added.

K1 uses angle brackets, and it will be very convenient to have the same
module names in K1 and K2, in particular to compare IR dumps where
almost everything is the same (up to a certain point) except the module
name.
2023-06-21 14:16:42 +00:00
Artem Daugel-Dauge b6847d0835 [Gradle] Support configuration cache in Xcode/CocoaPods tasks with Gradle 8.1
This commit moves invocation of `xcodebuild` from configuration to execution time. This also fixes the problem with Xcode version being cached inside the daemon.

^KT-59252 Verification Pending
2023-06-21 13:31:38 +00:00
Mikhail Glukhikh 78f4d399d4 FE: add test to ensure Java entries static field is resolved normally 2023-06-21 13:08:01 +00:00
Mikhail Glukhikh 905e1dcd3b K2: introduce prioritized enum entries resolve by a 2.1 feature
Related to KT-48872
2023-06-21 13:08:01 +00:00
Mikhail Glukhikh b92f1e2036 K2: de-prioritize access to Enum.entries properly #KT-57954 Fixed 2023-06-21 13:08:00 +00:00
Mikhail Glukhikh 978d52d05b K2: render additionally *s for static references
This commit allows to distinguish static VS non-static things
inside FIR_DUMP, e.g. static synthetic Enum.entries with
enum entry Enum.entries
2023-06-21 13:08:00 +00:00
Mikhail Glukhikh 70899d492d K2: reproduce KT-57954 and reorganize tests around enum entries warnings
In particular, here we add FIR_DUMP to all enum entries tests with
some deprecation diagnostics and the feature on, and remove all txt-files
2023-06-21 13:08:00 +00:00