Commit Graph

45609 Commits

Author SHA1 Message Date
Dmitriy Dolovov 78a962f6d2 [KLIB] Deprecate -Xexpect-actual-linker CLI argument
This argument has been finally superseded by `-Xmetadata-klib`.

^KT-61136
2023-10-02 16:21:17 +00:00
Roman Efremov 81fd9a679d [FIR] Prohibit expect class members with default values actualized
...by fake-override.
It is error without deprecation cycle because `expect` and `actual`
classes are still in Beta and expected impact of change is negligible.

^KT-62036 Fixed
2023-10-02 15:50:37 +00:00
Roman Efremov 02680442a0 [Test] Add tests for expect class default arguments which actualized
...by fake-override.

^KT-62036
2023-10-02 15:50:37 +00:00
Roman Efremov 7ad23aeb73 [Test] Drop forgotten TODO
^KT-62036
2023-10-02 15:50:37 +00:00
Roman Efremov 16ffdb6cb7 [FIR] Refactor: extract checker of DEFAULT_ARGUMENTS_IN_EXPECT_WITH_ACTUAL_TYPEALIAS
...to separate object. This is to simplify overloaded with logic
`FirExpectActualDeclarationChecker`.

^KT-62036
2023-10-02 15:50:37 +00:00
Roman Efremov 2d51bb233d [FIR] Refactor: extract function which returns single compatible expect
...symbol for actual symbol. It will be reused in next commit.

^KT-62036
2023-10-02 15:50:37 +00:00
Alexander Udalov 9943c7078c JVM: add more flags to JvmBackendConfig
And use them instead of CompilerConfiguration, to reduce dependencies of
backend on the whole compiler (as opposed to just backend)
configuration.
2023-10-02 14:58:24 +00:00
Alexander Udalov 72b5123fc8 JVM: reduce usages of GenerationState in favor of JvmBackendConfig
To help in decoupling JVM IR from the old JVM backend.
2023-10-02 14:58:23 +00:00
Egor Kulikov c3010dd599 [FIR] Fix NPE on empty throws
^KT-60325 fixed
2023-10-02 14:37:00 +00:00
Vladimir Sukharev 3894e719b3 [FIR] Fix disappeared CANNOT_ALL_UNDER_IMPORT_FROM_SINGLETON
^KT-59965 Fixed
2023-10-02 11:59:33 +00:00
Alexander Udalov 5ff15f6847 CLI tests: fix incorrect order of replacing versions
The change 9de6df6104 caused tests `requireKotlinCompilerVersion{,K2}`
to fail once the compiler version was changed to 2.0.0-dev-*. The reason
is that when patch version is 0, compiler version is equal to the
language version (which is itself always equal to JvmMetadataVersion).
So if we're replacing JvmMetadataVersion first, we end up with
`$ABI_VERSION$-dev-...` in the output, which is incorrect.
2023-10-02 08:59:12 +00:00
Artem Kobzar 857c07fa25 [K/JS] Fix corutines build for 1.9.20
This reverts commit f0d6471a8bcbdfc52ddc840a6383032ef86976d1.
2023-09-28 15:15:04 +02:00
Pavel Kunyavskiy 1a36a06a07 [IR] Drop unused inter-module dependency
^KT-61934
2023-09-24 16:11:49 +00:00
Pavel Kunyavskiy 03914e353f [IR] Rename classes after refactoring
^KT-61934
2023-09-24 16:11:49 +00:00
Pavel Kunyavskiy ed7e458828 [IR] Don't use linker fake override builder in Ir actualizer
Now, it uses fake override builder from in Fir2IrComponents.
It would also allow using it in lazy classes in the future.

^KT-61934
2023-09-24 16:11:49 +00:00
Pavel Kunyavskiy 9fd057d7c3 [IR] Simplify usage of IrOverrideUtil
It had some copy-pasted code for counting current file on each use-site.
Now it's encapsulated in strategy.

KT-61934
2023-09-24 16:11:49 +00:00
Pavel Kunyavskiy 2b8b6a2b21 [IR] Split FakeOverrideBuilder to two parts
Now there is separate class encapsulating logic about how to build
fakeOverrides and one encapsulating logic of which classes
do need building fake overrides.

This also allows to untie strange inheritance dependencies.

^KT-61934
2023-09-24 16:11:49 +00:00
Pavel Kunyavskiy fcca73e900 [IR] Simplify IrOverridingUtil
Previously, it had some internal state that was saved between calls
and needed to be cleared.

This state was eliminated, which makes invariants clearer and using
easier.

^KT-61934
2023-09-24 11:58:16 +02:00
Alexander Korepanov 0f4c550ee0 [JS IR] Add JS BE diagnostic tests
Add tests for:
 - EXPORTING_JS_NAME_CLASH
 - EXPORTING_JS_NAME_CLASH_ES

^KT-61710
2023-09-23 19:49:17 +02:00
Alexander Korepanov 522952db1f [JS IR] Run diagnostics by IR before the klib serialization
Implement an infrastructure for checking IR before JS klib serialization.
Implement the EXPORTING_JS_NAME_CLASH and EXPORTING_JS_NAME_CLASH_ES checks.

^KT-61710 Fixed
2023-09-23 19:49:17 +02:00
Alexander Korepanov 13bd627bfa [Common tests] Use RootDiagnosticRendererFactory for checking messages
The patch allows checking all diagnostings with checkFullDiagnosticRender().
It is required for the JS BE diagnostic tests.
2023-09-23 19:48:51 +02:00
Alexander Korepanov a7458f18a9 [Common tests] Support RENDER_ALL_DIAGNOSTICS_FULL_TEXT in JS BE tests
Move the checkFullDiagnosticRender() function from
the JvmBackendDiagnosticsHandler class so it can be reused
in the JsBackendDiagnosticsHandler class.
2023-09-23 19:48:50 +02:00
Igor Yakovlev 758484a01f [Wasm] Fix generation optimised when expression with Nothing type
Fixed #KT-62147
2023-09-23 10:18:30 +02:00
Johan Bay 64e601bea0 Extract IdSignature serializer from IrFileSerializer
^KT-61642
2023-09-22 22:30:25 +00:00
Johan Bay a041e51ff2 Rename IdSignatureSerializer to IdSignatureFactory
^KT-61642
2023-09-22 22:30:24 +00:00
Alejandro Serrano Mena b1551c67e0 KT-59504 [FIR] Check _ on destructuring declarations
Previously the checker was ignoring them, leading to missing diagnostics

^KT-59504 Fixed
2023-09-22 21:46:09 +00:00
Sergej Jaskiewicz 59129501cb [FIR/IR generator] Remove unused properties of Type 2023-09-22 19:46:14 +00:00
Sergej Jaskiewicz 3a5e69d651 [FIR/IR generator] Inherit TypeRef from Importable
This is the first step to replace the usages of `Importable`
in the FIR generator with `TypeRef`.

This is a step towards commonizing the code generator between
FIR and IR: KT-61970
2023-09-22 19:46:14 +00:00
Sergej Jaskiewicz d86161bccb [FIR generator] Remove Type#firType property as it has no effect 2023-09-22 19:46:14 +00:00
Sergej Jaskiewicz a995c522f7 [IR generator] Factor out TypeRef to common module
This is a step towards commonizing the code generator between
FIR and IR: KT-61970
2023-09-22 19:46:14 +00:00
Sergej Jaskiewicz d5394db185 [FIR generator] Factor out AbstractElement to common module
This is a step towards commonizing the code generator between
FIR and IR: KT-61970
2023-09-22 19:46:14 +00:00
Sergej Jaskiewicz 977e316489 [FIR generator] Factor out TypeArgument to common module
This is a step towards commonizing the code generator between
FIR and IR: KT-61970
2023-09-22 19:46:14 +00:00
Kirill Rakhman fbf68a5bcc [FIR] Narrow down range of NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER
This uses the same approach as
INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION where we use a visitor
to find a call to a symbol that contains the type variable in question.

#KT-56140 Fixed
2023-09-22 13:49:59 +00:00
Mikhail Glukhikh ae19cd91bf K2: fix "private to this" determination logic in accordance with K1
#KT-61844 Fixed
2023-09-22 12:23:46 +00:00
Mikhail Glukhikh b9302869d5 K2: reproduce KT-61844 2023-09-22 12:23:46 +00:00
Ilya Chernikov 141333bdcd K2: Update extension receiver after checking in CheckExtensionReceiver
fixes receiver selection when the candidate has more that one possible
extension receiver
#KT-62129 fixed
2023-09-22 11:33:46 +00:00
Vladimir Sukharev 56eedfebee [FIR] K2: Fix disappeared diagnostic UNDERSCORE_USAGE_WITHOUT_BACKTICKS on types
^KT-59985 Fixed

Merge-request: KT-MR-12282
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-09-22 11:18:19 +00:00
Ilya Kirillov 80f86a3527 [FIR] Render flexible types as A..B instead of cryptic ft<A, B>` in diagnostic messages
^KT-62032 fixed
2023-09-22 10:48:31 +00:00
Ilya Kirillov 252c59a8a3 [FIR] Render k2-specific flexible types in a more compact way in diagnostic messages
^KT-62031 fixed
2023-09-22 10:48:31 +00:00
Ilya Kirillov e2252f5e6b [FIR] add testcase for KT-62031 2023-09-22 10:48:31 +00:00
Ilya Kirillov d98da87278 [FIR] Render dot-separated FQNs instead of slash-separated ones in diagnostics
^KT-62030 fixed
2023-09-22 10:48:31 +00:00
Vladimir Sukharev 42af684ab7 [FIR] Fix disappeared ILLEGAL_ESCAPE
^KT-59950 Fixed
2023-09-22 08:38:50 +00:00
Vladimir Sukharev 70ea0de2db [FIR] Fix some disappeared AMBIGUOUS_ANONYMOUS_TYPE_INFERRED
^KT-59932

Merge-request: KT-MR-12312
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-09-22 07:47:12 +00:00
Brian Norman e6669b51d4 [FIR] Check standalone companion object qualifiers are visible 2023-09-21 22:33:50 +00:00
Mikhail Glukhikh 2603077db9 Move independent pre-release tests to K2 group to avoid duplication
Without this commit these tests are run twice without any reason for it.
Related to KT-62058
2023-09-21 20:09:25 +00:00
Mikhail Glukhikh 156097fe17 Restore KotlinCompilerVersion.IS_PRE_RELEASE
This commit is a slightly modified revert of 4f29c113.
IS_PRE_RELEASE allows to make LATEST_STABLE version behave as
experimental when this flag is set to true.
The general goal is to prepare fix of KT-62058; after this commit
one can do it by changing IS_PRE_RELEASE flag to true.
The fix of KT-62058 is planned to be done during bootstrapping.
This preparation and the future fix are parts of umbrella KT-61951.
2023-09-21 20:09:25 +00:00
Mikhail Glukhikh 488049174c FP tests: take 'skipPrereleaseCheck' from module configuration
Before this commit we skipped this check for every module,
but now we skip it only if we need it
2023-09-21 15:01:21 +00:00
Hung Nguyen 0d04b8783c [IC] Handle custom source set located outside project directory
To support build cache relocatability, we need to convert absolute paths
into relative paths before storing them in IC caches.

Before this commit, we computed relative paths based on the (root)
project directory and FAIL if some source files are located outside the
project directory.

With this commit, we will NOT FAIL in that case. This means relative
paths may start with "../". It's not "clean", but it can work.

Test: New test in BuildCacheRelocationIT
^KT-61852 Fixed
2023-09-21 14:39:52 +00:00
Kirill Rakhman ff812197a8 [Test] Update test data after changes to FIR rendering 2023-09-21 14:02:21 +00:00
Vladimir Sukharev d7adc0ce32 [FIR] Fix K2: Introduced AMBIGUOUS_ANONYMOUS_TYPE_INFERRED 2023-09-21 13:46:00 +00:00