Commit Graph

104541 Commits

Author SHA1 Message Date
Alexander Udalov b650f0ce8e IR: slightly refactor FakeOverrideRebuilder
Deduplicate some code, improve assertion messages, fix grammar in
comments.
2023-09-13 15:01:52 +02:00
Alexander Udalov fd68b9f49c CLI: add -Xuse-ir-fake-override-builder
To be able to test IR fake override builder (KT-61514) outside of
compiler tests.
2023-09-13 15:01:52 +02:00
Alexander Udalov d528faa0fe Minor, add toString to OverrideCompatibilityInfo 2023-09-13 15:01:52 +02:00
Vladimir Sukharev 024fd9e21a [FIR JS] Don't raise diagnostic PROPERTY_AS_OPERATOR for dynamic types.
^KT-60043 Fixed


Merge-request: KT-MR-12161
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-09-13 12:58:15 +00:00
Dmitrii Gridin 8d5787db12 [Analysis API FIR] KtFirValueParameterSymbol: fix expection
Effectively, it restores the fix from 2f8a64fff2

^KT-61422 Fixed
2023-09-13 12:56:57 +00:00
Ivan Kylchik 1843eeb16b [FIR] Drop visualizer module
This module was created to compare type resolve in K1 and K2. But
overall, these tests contain a lot of bugs, and it is quite hard
to use it.
2023-09-13 12:55:14 +00:00
Ivan Kylchik 2cd504b675 [FIR] Drop old TODO from LightTreeRawFirDeclarationBuilder
There is no description and no information that we suppose
to fix.
2023-09-13 12:55:13 +00:00
Kirill Rakhman ce65d3c7b8 [FIR] Set source on callee reference of implicit invoke receiver
This fixes an IllegalArgumentException when a diagnostic was reported on
it because no source was set.

#KT-61829 Fixed
2023-09-13 12:20:57 +00:00
Alexander Korepanov a224f9db34 [JS Tests] Regenerate tests 2023-09-13 12:19:15 +00:00
Alexander Korepanov be4f6beddb [JS Tests] Prepare JS tests for testing backend diagnostics
- Introducing a backend diagnostic handler.
 - Moving JS diagnostic tests from test-common to
   js.test to avoid circular module dependencies.

^KT-61886 Fixed
2023-09-13 12:19:15 +00:00
Konstantin Tskhovrebov b672ba8eaf KTIJ-25563: Add upToDateWhen condition to CInterop task outputs 2023-09-13 12:18:06 +00:00
Alexander Shabalin 503c1a2eb6 [K/N] Fix kt53261_noinline_NonNullNativePtr.kt with K2 2023-09-13 12:15:57 +00:00
Vladimir Dolzhenko d8c80b0270 Fix parameters matching for suspend functions
#KT-61894 Fixed
2023-09-13 11:59:02 +00:00
Ivan Kochurkin 8e0c2af176 [FIR] Fix overload resolution ambiguity between expect and non-expect in native
^KT-61778 Fixed
2023-09-13 11:44:22 +00:00
Ivan Kochurkin 57357d1995 [FIR] Simplify filterOutActualizedExpectCandidates 2023-09-13 11:44:22 +00:00
Mikhail Glukhikh ffd77850ef K2: add proper catch parameter annotation targeting
In this commit we begin counting a catch parameter as
both a local variable and a value parameter for the purpose
of annotation targeting.

#KT-61691 Fixed
2023-09-13 11:27:14 +00:00
Mikhail Glukhikh 91aa679214 K2: reproduce KT-61691 2023-09-13 11:27:14 +00:00
Nikolay Lunyak aacfc31c90 [FIR] Resolve the continuation type inside createSuspendView()
Normally such types are resolved during enhancement,
but creating the suspend view happens before
enhancement, so the type may have not been resolved.

^KT-59915 Fixed
2023-09-13 11:18:06 +00:00
Nikolay Lunyak 1467e743fd [FIR] Fix incorrect Java code in the test data
There's no point in eliminating K2 differences
between red code.

^KT-59915
2023-09-13 11:18:06 +00:00
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