Commit Graph

104566 Commits

Author SHA1 Message Date
Sergej Jaskiewicz 14e23a7d84 [K/N] Cache FqNames computed from ClassIds in KonanMangler 2023-09-13 14:25:13 +00:00
Sergej Jaskiewicz 904f8706ee [K/N] Don't use reflection in irText tests for obtaining manglers
See KT-61248
2023-09-13 14:25:12 +00:00
Sergej Jaskiewicz 9eba17d631 [K/N] Move Native-specific mangle constants to more suitable places
They shouldn't be mixed with target-independent constants.
2023-09-13 14:25:12 +00:00
Sergej Jaskiewicz 08a9e7eae9 [IR] Outline the main logic in annotation-related helpers
Prefer smaller inline functions, because otherwise if they become
hot spots, they will complicate performance analysis, and actually
might make everything slower because of low inlining threshold in
HotSpot.
2023-09-13 14:25:11 +00:00
Sergej Jaskiewicz 157ab48fde [K/N] Delete unused methods in ObjCInterop.kt 2023-09-13 14:25:11 +00:00
Sergej Jaskiewicz e3b5dc509c [K/N] De-duplicate code for mangling objc interop function names
Extract the duplicated functionality to the
`ObjCFunctionNameMangleComputer` class.
2023-09-13 14:25:11 +00:00
Sergej Jaskiewicz 0fd4f10f6c [K/N] Avoid magic strings in KonanMangler 2023-09-13 14:25:10 +00:00
Sergej Jaskiewicz ddfd94b3b2 [K/N] Move KonanMangler to a new common module
^KT-61248 Fixed
2023-09-13 14:25:10 +00:00
Sergej Jaskiewicz d1127f1a31 [K/N] Move IR-related ObjC interop helpers to a new common module
This is a step towards KT-61248. We need those helpers to be available
in non-Native-specific code.
2023-09-13 14:25:09 +00:00
Sergej Jaskiewicz 5cb252fe49 [descriptors] Move DeclarationDescriptor#findPackage helper to core
There is nothing serialization-specific about this function
2023-09-13 14:25:09 +00:00
Sergej Jaskiewicz dff2d2ed60 [descriptors] Move some annotation-related utilities to the core module
- AnnotationDescriptor#argumentValue is not frontend-specific
- AnnotationDescriptor#getAnnotationStringValue is not Native-specific

We are going to need these functions in the IR code, so it makes
sense to factor them out to the core module.
2023-09-13 14:25:08 +00:00
Sergej Jaskiewicz 56cb0bf071 [utils] Move atMostOne to core/util.runtime
There is nothing backend-specific about this helper function.
2023-09-13 14:25:08 +00:00
Nikolay Lunyak fa600a58ac [FIR] Fix analysis of FirScript contents
Running the
`FirScriptCodegenTestGenerated.testSecondLevelFunction` test results
in "Expected is `FirResolvedDeclarationStatus`, but was
`FirDeclarationStatusImpl`. This is similar to the
`FirIdeNormalAnalysisSourceModuleCodeFragmentCollectDiagnosticsTestGenerated.testLocalFunction`
test, but that one was fixed by `9514f8f8`.
Looks like the situation here is the same,
it's just `FirScript` that needs to be
fixed.

The changed regarding the approximation is needed to avoid exposing
the anonymous type in
`FirScriptLazyDeclarationResolveTestGenerated.testDelegatesScript`.

The difference in the
`ScriptInBlockModificationTestGenerated.testRawContractScript`
test appeared because previously
the contract used to be
`FirRawContractDescription`, but
it now resolves to
`FirEmptyContractDescription`.
2023-09-13 14:11:42 +00:00
Nikolay Lunyak a1cb6258bc [FIR] Stop using .fir when checking conflicts
Use the symbols API in the declarations presenter and
conflicts helpers.
2023-09-13 14:11:42 +00:00
Nikolay Lunyak 942bff8a03 [FIR] Take constructors from scopes when checking conflicts
^KT-61243 Fixed
2023-09-13 14:11:41 +00:00
Nikolay Lunyak f719436d1f [FIR] Report top-level conflicts between TA constructors and funs
^KT-59880
2023-09-13 14:11:41 +00:00
Nikolay Lunyak 01d4f25363 [FIR] Move TypeAliasConstructorsSubstitutingScope
It will be needed in the next commit
to check for conflicting declarations
2023-09-13 14:11:41 +00:00
Vladimir Sukharev c4201101ac [K/N] K2/MPP: Move stdlib to the head of dependency list.
^KT-61645 Fixed

Merge-request: KT-MR-12079
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-09-13 13:56:21 +00:00
Alexander.Likhachev fbeed67931 [Gradle] Mark KotlinTopLevelExtension.useCompilerVersion as experimental
#KT-61895 Fixed
2023-09-13 13:32:33 +00:00
Alexander Udalov f9712597e1 IR: support IrExternalOverridabilityCondition in IrOverrideChecker
The code is analogous to OverridingUtil and
ExternalOverridabilityCondition.
2023-09-13 15:04:53 +02:00
Alexander Udalov 86eb79e095 IR: extract IrOverrideChecker to separate file 2023-09-13 15:03:41 +02:00
Alexander Udalov 57c1df7875 IR: extract FakeOverrideBuilderStrategy to separate file 2023-09-13 15:01:52 +02:00
Alexander Udalov 0afee8685a IR: remove unused parameter of IrOverridingUtil.isOverridableBy
The value of checkReturnType is false at all call sites.
2023-09-13 15:01:52 +02:00
Alexander Udalov 94e1c0e9fe Tests: fix unmute check for fake override rebuilder tests
Assertion thrown in `check` was wrapped into something and ignored at
the call site, for some reason. So the "Looks like this test can be
unmuted..." error was never happening for this test.
2023-09-13 15:01:52 +02:00
Alexander Udalov 21d56d04d6 Tests: reclassify some failures in fake override rebuilder tests
See issues for more information: KT-61751, KT-61804, KT-61805, KT-61370.
2023-09-13 15:01:52 +02:00
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