Commit Graph

101963 Commits

Author SHA1 Message Date
Mikhail Glukhikh 668684ca13 K2: correct FirJavaField usages taking imported variant into account
Related to KT-59140
2023-06-20 14:13:21 +00:00
Mikhail Glukhikh 8983e3a218 K2: correctly set importedFromObjectOrStaticData for fields
#KT-59140 Fixed
#KT-58980 Fixed
2023-06-20 14:13:21 +00:00
Mikhail Glukhikh 18206210cf K2: reproduce KT-59140 2023-06-20 14:13:21 +00:00
Sergej Jaskiewicz c2fde1a915 [IR] Reorder parameters in IrFactory#createEnumEntry
This is to prepare for IrFactory auto-generation (KT-59308).
2023-06-20 14:12:58 +00:00
Sebastian Sellmair 685eee38ac [Gradle] GranularMetadataTransformation: Collect moduleIds in ProjectData for non Kotlin Projects
^KT-59446 Verification Pending
2023-06-20 13:55:09 +00:00
Sebastian Sellmair d3d6cdcef7 [Gradle] Implement Future<T>.map(transform)
^KT-59446 In Progress
2023-06-20 13:55:09 +00:00
Sebastian Sellmair ec46c82a13 [Gradle] Implement KT59446TransformationOnTransitiveJavaDependencyTest
^KT-59446 In Progress
2023-06-20 13:55:09 +00:00
Sebastian Sellmair d7facce71f [Gradle] KotlinPluginLifecycle: Implement .toString for better diagnostics
^KT-59446 In Progress
2023-06-20 13:55:09 +00:00
Nikolay Lunyak 46ea908daf [Tests] Ensure the temporary directories are cleared
This change may prevent OOMs. Context:
https://jetbrains.slack.com/archives/C4U955N6B/p1685000899030279
2023-06-20 13:28:23 +00:00
Artem Kobzar 039b5fca7a [K/JS] Use declared upper-bound types for parameters inside inlined functions body, instead of the provided types 2023-06-20 12:01:28 +00:00
Kirill Rakhman aa4ebe1991 [FIR2IR] Fix NPE on missing built-ins when using old stdlib
Specifically, this code was throwing when trying to get the symbol for
IntrinsicConstEvaluation which is only available since 1.7.

#KT-59151 Fixed
2023-06-20 11:52:21 +00:00
Artem Kobzar 66bdb9ce79 [K/JS] Fix private constructor delegating inside single class with ES6 mode ^KT-59335 Fixed 2023-06-20 11:07:08 +00:00
Pavel Mikhailovskii 79dbacb621 [SLC] Keep default constructor parameters' values 2023-06-20 11:00:18 +00:00
Roman Golyshev bccd7bc04a KTIJ-25341 [Analysis API] Visit component calls in import optimizer
N.B. K2 does not require resolved `componentX` functions for the
placeholder variables (`_`), see KT-59504

^KTIJ-25341 Fixed
2023-06-20 10:12:57 +00:00
Alexander Shabalin db2475f41e [K/N] Make STMS use separate threads for GC and finalizers.
Moves GC into a separate thread, and finalizers processing into yet
another thread. This makes STMS more similar to CMS.
2023-06-20 10:08:25 +00:00
Alexander Shabalin 6996e03bc9 [K/N] Build new MM only for targets with threads
Targets without threads are disabled already.
2023-06-20 10:08:25 +00:00
Pavel Kunyavskiy 12455451fc [K/N] Call class static initializer in constructors
^KT-59058
2023-06-20 08:41:11 +00:00
Alexander Shabalin c40bf720d9 [OWNERS] Add Sergey to K/N runtime .mm files owners 2023-06-20 07:21:44 +00:00
Alexander Shabalin a594b6e914 [OWNERS] Replace Pavel with Aleksei in K/N runtime owners 2023-06-20 07:21:44 +00:00
Mikhail Glukhikh d8a20f1975 K2: don't generate Java overridden synthetics for Kotlin get/sets
#KT-59038 Fixed
2023-06-20 07:07:10 +00:00
Igor Chevdar 9e39b7ef87 [K/N] Don't try to stack-alloc arrays of negative size
#KT-59501 Fixed
2023-06-20 06:20:52 +00:00
Igor Chevdar 95bef03d3e [K/N][tests] Added a reproducer for KT-59501 2023-06-20 06:20:52 +00:00
Leonid Startsev 3933242340 Deprecate KmModule.annotations because it is unused and always empty.
It used to store state of `-Xexperimental` Kotlin compilation flag,
but this feature was removed long ago.

#KT-59366 Fixed
2023-06-19 17:54:18 +00:00
Leonid Startsev b919a12274 Restructure KotlinClass(Module)Metadata.write/read:
- Write now returns result (Metadata or ByteArray) directly without re-wrapping it;
- annotationData/bytes is private to avoid unsoundness if external client corrupts it;
- .toXxx() do not throw exceptions anymore and deprecated. Exceptions are thrown only from read/write;
- Instead of toXxx(), properties like .kmClass should be used instead. They're initialized eagerly and return a view without copying.
- KotlinClassMetadata.Unknown is now a data object, as no useful information is exposed

#KT-59365 Fixed
2023-06-19 17:54:18 +00:00
Egor Kulikov 5bb4f469ef [FIR] Do not throw exception on unexpected FIR for constants
^KTIJ-23263 fixed

Merge-request: KT-MR-10699
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
2023-06-19 17:45:31 +00:00
vladislav.grechko e4f1c10bc1 [JVM_IR] Do not compile-time evaluate apiVersionIsAtLeast in stdlib
Function `apiVersionIsAtLeast` was introduced to be able to have
different inline function content inlined to user code call sites
depending on their api version settings. Thus, it should not be
compile-time evaluated when being called in the body of inline stdlib
function.

^KT-59452: Fixed
2023-06-19 16:24:57 +00:00
Roman Golyshev adab552928 KTIJ-25530 [Analysis API] Correctly collect references to implicitly dispatched callables in Import Optimizer
N.B. There is a case which is not covered ATM due to the bug in the
compiler, see KT-58980

^KTIJ-25530 Fixed
2023-06-19 16:02:09 +00:00
Mikhail Zarechenskiy 060f3fa7c4 Extract diagnostics about class literals with empty LHS
^KT-59152
2023-06-19 15:21:32 +00:00
Mikhail Zarechenskiy 1153238fd7 Extract diagnostics about references to variables to a separate one
Note that I've left in FIR everything as is to avoid non-trivial
refactoring that is required right now to report more specific diagnostics

 ^KT-59152
2023-06-19 15:21:32 +00:00
Mikhail Zarechenskiy 9cf40f8c2f Extract diagnostics about 'suspend test' to a separate one
^KT-59152
2023-06-19 15:21:32 +00:00
Mikhail Zarechenskiy 2dfdd8dcf6 Extract diagnostics about 'sealed fun interface' to a separate one
^KT-59152
2023-06-19 15:21:32 +00:00
Mikhail Zarechenskiy d772126f2c Extract diagnostics about 'sealed when' to a separate one
^KT-59152
2023-06-19 15:21:32 +00:00
Mikhail Zarechenskiy c613b312f9 Refactoring: inline single-used method, move checker closer to the usage 2023-06-19 15:21:32 +00:00
Mikhail Zarechenskiy ab7ae75f66 Remove unused method
Note that `yield` was allowed since 1.7.0: KT-27750
2023-06-19 15:21:32 +00:00
Mikhail Zarechenskiy 1df4893a43 Extract diagnostics about an unsupported case of inheritance from Java
^KT-59152
2023-06-19 15:21:32 +00:00
Svyatoslav Scherbina de78f52bc9 Bump Kotlin/Native version to 1.9.20-dev-4192 2023-06-19 13:45:28 +00:00
Evgeniy.Zhelenskiy 2d920df507 [IR] Fix KT-59346, KT-55993
#KT-59346
#KT-55993
2023-06-19 12:36:08 +00:00
Abduqodiri Qurbonzoda e802ee05a7 [K/N] Do not override equals/hashCode for AbstractMutableMap.values collection 2023-06-19 11:41:10 +00:00
Abduqodiri Qurbonzoda 6015e12db8 [K/N] Remove redundant AbstractMutableMap.SimpleEntry 2023-06-19 11:41:10 +00:00
Abduqodiri Qurbonzoda 3be613ced8 [K/N] Use iterator in AbstractMutableList.indexOf/lastIndexOf
Instead of access by index. To avoid performance issues
when the subclass `get(index)` has non-constant time complexity.
It also aligns behavior with JVM.
2023-06-19 11:41:10 +00:00
Abduqodiri Qurbonzoda 60cafc6623 Document the exceptions Iterator throws 2023-06-19 11:41:10 +00:00
Abduqodiri Qurbonzoda 4ae19b2b44 [K/N] Deprecate SharedImmutable annotation #KT-57837
As a part of efforts to stabilize Native stdlib.
2023-06-19 11:35:32 +00:00
Abduqodiri Qurbonzoda 0cfb80144a [K/N] Throwable.printStackTrace() should print to the stderr output
Aligns with the JVM behavior.

As a part of efforts to stabilize Native stdlib.
2023-06-19 11:30:13 +00:00
Dmitriy Novozhilov d972b78627 [FIR] Allow actualization of expect classes by classes with wider visibility
^KT-59355 Fixed
2023-06-19 11:09:32 +00:00
Anna Kozlova 583aad2350 [LL] spare some memory on lists
By default, a list with a single element would have capacity of 10;
in big numbers, it might be a lot of wasted memory.
2023-06-19 10:33:12 +00:00
Ilya Goncharov 0afe712f07 [Gradle, JS] Test on changing of synced files since 7.6 Gradle 2023-06-19 09:14:27 +00:00
Dmitrii Krasnov a5c72925a0 Fixed testSyncFrameworkMultipleArchitecturesWithCustomName
#KT-51553 In Progress
2023-06-19 10:43:46 +02:00
Brian Norman 8ac59592ed [FIR] Add DFA implications when one side of an Elvis operator is null
When one side of an Elvis operator can only be `null`, and the entire
Elvis operator expression cannot be `null`, this implies that the
opposite side of the Elvis operator cannot be `null`. Add such
implications to the Elvis exit node of the DFA. This helps smart-casting
of variables used within long Elvis operator chains.

#KT-49249 Fixed
2023-06-19 08:17:47 +00:00
Nikolay Lunyak 110cc79ddd [FIR] Improve debugging of diagnostic ranges
`UNREACHABLE_CODE` is weird.
If we look into its
positioning strategy,
we'll see that this diagnostic
attempts to split the source
of its element into multiple ranges.
This is bad, because such smaller
ranges can easily overlap with other
diagnostics in such a way that
they are no longer hierarchical.
See the
`compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/3.kt` test
for an example of this behavior
(allow reporting `UNREACHABLE_CODE`
first). The problem will appear at
the condition of `case_7`.
2023-06-19 07:40:16 +00:00
Nikolay Lunyak 7541732752 [FIR] Fix TEST SPEC tests
Ensure the test data contents for both the frontends
are identical. This is needed for proper analysis of
K2-differences.
2023-06-19 07:40:15 +00:00