Commit Graph

104522 Commits

Author SHA1 Message Date
Nikolay Lunyak 34cb9aa659 [FIR] Don't miss VIRTUAL_MEMBER_HIDDEN
^KT-59925 Fixed
2023-09-13 11:14:45 +00:00
Vladimir Sukharev bab00255dc [K/N, Tests] Add diagnostic tests for SUPER_CALL_WITH_DEFAULT_PARAMETERS
^KT-61572


Merge-request: KT-MR-11941
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-09-13 11:10:25 +00:00
Alexander Korepanov f07028959d [FIR JS] Add more tests for JS_NAME_CLASH diagnostic
^KT-61862 Related
2023-09-13 10:54:57 +00:00
Alexander Korepanov 98fdaeb9a7 [FIR JS] Fix the false report of JS_NAME_CLASH on external generic class
^KT-61862 Fixed
2023-09-13 10:54:57 +00:00
Timofey Solonin 9e7d9f3b53 Use llbuild.framework bundled with the internal toolchain
^KT-61369
2023-09-13 10:12:51 +00:00
Iaroslav Postovalov fd2954a8d3 Move DummyDelegate to :compiler:util
Deleted DummyDelegate from a pair of usages across the project, and
moved it to :compiler:util module to avoid further duplicates
2023-09-13 09:51:13 +00:00
Artem Kobzar 2578bfefd5 [K/JS] Add useEsClasses to list of compiler arguments that invalidate IC cache ^KT-61795 Fixed 2023-09-13 09:50:24 +00:00
Dmitrii Gridin 274d7ba47d [FIR] FirAbstractBodyResolveTransformerDispatcher: refactor code
Extract transformation logic into expressionTransformation,
declarationTransformation and controlFlowStatementsTransformation.
This simplifies logic (we do not need to write ?: each time) and
adds an one-place enter-point for transformations which can be used
by LL FIR later.

^KT-56551
2023-09-13 09:17:19 +00:00
Igor Chevdar 9d2d75313b [K/N][tests] Added a test for anonymous object in a top level inline fun 2023-09-13 09:18:26 +03:00
Igor Chevdar b66a6fcc08 [K/N][IR] Moved local declarations names invention down the pipeline 2023-09-13 09:18:26 +03:00
Igor Chevdar ac760cbbfb [K/N][tests] Refactored a bit test
arguments of assertEquals are (expected, actual), not vice versa
2023-09-13 09:18:26 +03:00
Igor Chevdar 93dea12efe [IR] Supported top level local classes in names inventor
Such classes might appear after local objects extraction from inline bodies
2023-09-13 09:18:20 +03:00
strangepleasures 52b0ea65d2 [KAPT4] KT-61761 Prevent Kapt from reporting unsupported plugin in K2/PSI
Also:
- remove the redundant KaptOptions.USE_K2
- prevent registration of Kapt4AnalysisHandlerExtension in K1
2023-09-12 16:58:38 +00:00
strangepleasures 6475942ced [KAPT4] A temporary workaround for KT-60482 2023-09-12 16:58:13 +00:00
Artem Kobzar 7bc521ab92 [K/JS] Reset exceptionState inside coroutines with a finally block ^KT-58685 Fixed 2023-09-12 15:18:16 +00:00
aleksandrina-streltsova 752ea6fd98 [AA] Add tests for scope context for position
KTIJ-27007
2023-09-12 14:44:23 +00:00
Dmitriy Novozhilov 6d00dcf972 [FIR] Strip comments in Fir2IrAnnotationsFromPluginRegistrar
Fir2IrAnnotationsFromPluginRegistrar stores elements using start and end
  offsets from IR elements, which strip comments from the start offset.
  So it's also needed to strip it from FIR source to keep the consistency

^KT-61872 Fixed
2023-09-12 13:21:05 +00:00
Dmitriy Novozhilov 1f49266c4b [Test] Reproduce KT-61872 2023-09-12 13:21:05 +00:00
Dmitriy Novozhilov 49071374b4 [FIR] Look for annotations generated by backend based on declaration-site session
Test dump for klib does not correlate to real case (CLI compilation of
  JS or Native), because for some reason KLib facade in MPP scenario
  uses session/module of each specific file, instand of session for
  leaf platform module
In CLI scenario only one session is used, so annotations are generated
  properly

^KT-61833 Fixed
2023-09-12 13:21:05 +00:00
Yan Zhulanow 9514f8f873 [LL API] Fix analysis of functions inside code fragments
FirDeclarationsResolveTransformer.transformSimpleFunction() performs
proper local function analysis only if the parent is properly set.

^KTIJ-26608 Fixed
2023-09-12 13:08:49 +00:00
Alexander Udalov 909f32ed54 Build: pass -Xexpect-actual-classes to some libraries compile tasks
To suppress the warning introduced in KT-61573.
2023-09-12 11:24:29 +00:00
Kirill Rakhman d9da3973bb [FIR] Remove redundant overloads of allowsToHaveFakeOverride 2023-09-12 10:46:46 +00:00
Kirill Rakhman 2bc25d4f6e [FIR] Properly check for visibility in FirTypeIntersectionScopeContext
This fixes a false positive OVERRIDING_FINAL_MEMBER caused by a
package-private member in a different package being added to the
list of overridden symbols. However, in Java, package-private members
from different packages are effectively like private members in that
they cannot be overridden.

#KT-61696 Fixed
2023-09-12 10:46:46 +00:00
Alexander Udalov d16f33cf5b JVM IR: do not collect all dependency modules in IDE
Collecting all modules takes a lot of time in Evaluate Expression in
IDE, and it's useless because we then invoke JvmIrLinker to load module
headers, but that linker is discarded in the IDE (see `val irProviders`
below).

 #IDEA-329915
2023-09-12 09:11:44 +00:00
Yan Zhulanow 11096325c8 [LL API] Fix 'this' capturing inside property accessors
^KTIJ-26726 Fixed
2023-09-12 08:47:28 +00:00
Anastasia.Nekrasova eab6e9bb36 Added tests for all code samples from KT-60523, except 2.3.
Test for 2.3 sample must be added in the context of KT-61792.
2023-09-12 07:03:20 +00:00
Roman Efremov 2dae7ce6c1 [LT2FIR] Fix missing "expect" modifier on members of nested classes
For members of nested classes inside expect class
`classWrapper.hasExpect()` would be false, because it only reflects
modifiers of nested class itself and not aware of "expect" modifier
inherited from the parent class.
Fix is done in same way in PSI2FIR, see
`PsiRawFirBuilder.Visitor.toFirProperty`.

This fix now makes it possible to add test for functionality from
previous commit.

Review: KT-MR-12107

^KT-61784
2023-09-11 21:29:02 +00:00
Roman Efremov c6d7f15070 [FE] Fix checker of DEFAULT_ARGUMENTS_IN_EXPECT_WITH_ACTUAL_TYPEALIAS
...not reporting on companion object members as well as other
nested classes.

Annotation classes are accepted because this is how it already worked,
see other tests, for example `annotationsViaActualTypeAlias.kt`.

Test for nested annotation classes will be added in subsequent commit,
because it currently will fail in test
`TreeCompareTest.testCompareDiagnostics` because light-tree2fir
produces different tree due to a bug when converting properties
from expect primary constructor. See subsequent commit for a fix.

Review: KT-MR-12107

^KT-61784
2023-09-11 21:29:02 +00:00
Vladimir Sukharev e0e2a57e3d [K/N] Add filecheck tests for atomic intrinsics
https://youtrack.jetbrains.com/issue/KT-60514/Add-llvm-filecheck-tests-for-atomic-intrinsics

Merge-request: KT-MR-12067
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-09-11 21:28:34 +00:00
Igor Chevdar 1ff7841ac7 [K/N][IR] Renamed PreInlineLowering to TypeOfLowering 2023-09-11 18:16:25 +00:00
Igor Chevdar 8f3b9694f7 [K/N] Extracted asserts removal to a separate lowering 2023-09-11 18:16:25 +00:00
Igor Chevdar e8ca45378b [K/N] Moved couple of phases down the pipeline 2023-09-11 16:31:22 +00:00
Dmitrii Gridin ecb808992d [SLC] add more tests on vararg
^KT-61422
2023-09-11 15:47:47 +00:00
Dmitrii Gridin 3a577e1c31 [Analysis API] add more tests for vararg parameters
^KT-61422
2023-09-11 15:47:47 +00:00
Dmitrii Gridin f1e5a9b223 [FIR builder] create error types for vararg parameters correctly
Otherwise, such types are treated as resolved, but anyway
requires transformation on type phase.
Also, this commit drops the redundant duplicated transformation of
typeReference from primary constructor property generator

^KT-61422
2023-09-11 15:47:47 +00:00
Dmitrii Gridin c0c1966555 [FIR builder] add test for vararg parameter without type
^KT-61422
2023-09-11 15:47:47 +00:00
Kirill Rakhman 2566dabfce [FIR] Report INVISIBLE_REFERENCE on the first unresolved qualifier
#KT-61719 Fixed
2023-09-11 14:23:55 +00:00
Nikita Bobko 2127b2ce68 expect/actual classes: experimental -> Beta
KT-61573
^KT-61712 Fixed
Review: https://jetbrains.team/p/kt/reviews/12044/files

It's a follow up commit

According our guidelines, it must be in Beta
https://kotlinlang.org/docs/components-stability.html#stability-of-subcomponents

And the whole multiplatform was in Beta, so we can't make part of the
multiplatform to have lower stability level
2023-09-11 13:57:28 +00:00
Svyatoslav Scherbina 0cd91d9286 Native: fix filecheck_signext_zeroext_objc_export and enable it back
Previously filecheck_signext_zeroext_objc_export test was disabled
after making one-stage compilation mode implemented through two-stage
mode (KT-59245).

That change made the compiler sort the methods, and filecheck patterns
didn't match that order after that.

This commit fixes the test by adding sorted prefixes to method names,
so sorting alphabetically them doesn't really change the order.
2023-09-11 13:49:36 +00:00
Svyatoslav Scherbina f77f83e741 Native: fix support for cross-target filecheck tests
There was a minor mistake in the build script configuration, leading to
a missing task dependency when running the tests with
`-Pkotlin.native.home=`.

More specifically, the build script was checking if the cross-dist for
the main tests target (`-PtestTarget=`) is in place, but instead it
should have checked if the cross-dist for the test cross-target
(`test.targetName`) is in place.

This commit fixes the check, and thus adds the missing task dependency.
2023-09-11 13:49:35 +00:00
Ivan Kylchik 5d88a1f1c3 [Native] Rename Lowerings to NativeLoweringPhases
This is done to unify the way how we name file
that contains lowerings in different backends.
2023-09-11 10:04:50 +00:00
Ivan Kylchik 386d69018d [JVM] Rename JvmLower to JvmLoweringPhases
This is done to unify the way how we name file
that contains lowerings in different backends.
2023-09-11 10:04:50 +00:00
Kirill Rakhman 16ae83bde0 [FIR] Fix Java sealed class inheritors
This fixes NO_ELSE_IN_WHEN diagnostics when using java sealed
classes in an exhaustive when.

#KT-58216 Fixed
2023-09-11 07:37:37 +00:00
Aleksei.Glushko 6405a174e2 [K/N] Do not CAS when marking newly allocated object
Merge-request: KT-MR-12038
Merged-by: Alexey Glushko <aleksei.glushko@jetbrains.com>
2023-09-09 12:42:54 +00:00
Alexander Shabalin 2f22b0a6b0 [K/N] Migrate runtime/atomics tests to new testing infra ^KT-61259 2023-09-09 07:25:35 +00:00
Abduqodiri Qurbonzoda ba374bb45c Optimize hex formatting and parsing implementation #KT-58218
Merge-request: KT-MR-11702
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2023-09-08 22:40:56 +00:00
Alexander Shabalin eb0a301a8f [K/N] Update CallsChecker list 2023-09-08 17:13:00 +00:00
Alexander Shabalin 6b6da5b08f [K/N] In executors make sure child process does not leak. 2023-09-08 16:22:52 +00:00
Mikhail Glukhikh 20cb075e56 K2: fix calculating property reference type in delegated setter
This commit is an accidentally forgotten part of the KT-61045 fix
#KT-61720 Fixed
2023-09-08 15:35:10 +00:00
Dmitry Savvinov 5736201e3a [K1, MPP] Implement hack for KTIJ-24195
Force-refine typealiases if their expansion isn't visible in the
refiner's module

^KTIJ-24195
2023-09-08 15:31:22 +00:00