Commit Graph

45634 Commits

Author SHA1 Message Date
Mikhail Glukhikh 52010e38e3 Temporarily mute failing tests around IS_PRE_RELEASE (related to KT-62058)
These tests should be fixed by bootstrapping
2023-10-05 09:58:29 +00:00
Mikhail Glukhikh 9bb1a0a31d LV 2.0: set KotlinCompilerVersion.IS_PRE_RELEASE to true
#KT-62058 Fixed
2023-10-05 09:58:29 +00:00
Nikolay Lunyak cca04bbcc2 [FIR] Check test text for all alongside tests
For some reason the practice is to configure the K2
diagnostics tests as "alongside" and instruct K1
tests to ensure there are no unexpected differences
in the sources. But someone may still forget there is
something that they need to configure in the K1 runners.
2023-10-05 08:46:54 +00:00
Brian Norman 365ce2a6a5 [FIR] Implement checker for missing dependency supertypes
#KT-60778 Fixed
2023-10-04 21:57:43 +00:00
Vladimir Sukharev cd4c241fa3 [K/N] Run irText tests for K2/Native
^KT-58240
2023-10-04 18:20:05 +00:00
Stanislav Erokhin 0cfa721585 [KMP] Remove experimental from -Xmulti-platform flag
#KT-61686
2023-10-04 18:19:35 +00:00
Vladimir Sukharev 03442e1cee [FIR] Implement FirGenericArrayClassLiteralSupport platform feature
^KT-59931 Fixed
2023-10-04 14:45:23 +00:00
Vladimir Sukharev 9ab6353032 [FIR] Fix some Disappeared CLASS_LITERAL_LHS_NOT_A_CLASS
^KT-59931
2023-10-04 14:45:23 +00:00
Artem Kobzar eef57f216c [K/JS] Rework main function call to support it in per-file 2023-10-04 12:13:20 +00:00
Roman Efremov faae5f9b38 [IR] Fix annotation arguments comparison when expression is expect enum
...actualized via typealias. This caused false-positive report of
`ACTUAL_ANNOTATION_CONFLICTING_DEFAULT_ARGUMENT_VALUE`.
In such case it's incorrect to compare signatures, because classes have
different `ClassId`s. Instead, classes could be compared using
`areCompatibleExpectActualTypes` which actualizes both types, and
then enum value names compared.

^KT-62104
^KT-59940
2023-10-04 11:38:15 +00:00
Roman Efremov 67a46eba9c [FIR2IR] Fix default value conversion in annotation classes
This fixes failing test
`FirOldFrontendMPPDiagnosticsWithPsiTestGenerated.DefaultArguments.testAnnotationsViaActualTypeAlias2`.

It started to fail after commit 4e08cafc78
"[FIR2IR] Get rid of IrSymbol.owner usages in Fir2IrLazyClass"
where in Fir2IrLazyClass `declarationStorage.getIrConstructorSymbol`
was changed to `declarationStorage.getOrCreateIrConstructor`.

Before change, value parameters were initialized in
`Fir2IrLazyConstructor#valueParameters` where
`forcedDefaultValueConversion` was passed.
After the change parameters via
`Fir2IrCallableDeclarationsGenerator.declareParameters` where
`forcedDefaultValueConversion` is not passed to method.

^KT-62104 Fixed
2023-10-04 11:38:15 +00:00
Roman Efremov 705b2e87fd Revert "[K2] Temporary mute ACTUAL_ANNOTATION_CONFLICTING_DEFAULT_ARGUMENT_VALUE"
This reverts commit b232dbf484.
2023-10-04 11:38:15 +00:00
Mikhail Glukhikh 8bd792792f K2: consider backing fields of vars as smartcast unstable
#KT-61974 Fixed
2023-10-04 10:12:57 +00:00
Mikhail Glukhikh 8e577e101e K2: reproduce KT-61974 2023-10-04 10:12:57 +00:00
Ivan Kochurkin 319fb967ec [FIR] Add TYPE_ARGUMENTS_FOR_OUTER_CLASS_WHEN_NESTED_REFERENCED diagnostics
Report TYPE_ARGUMENTS_FOR_OUTER_CLASS_WHEN_NESTED_REFERENCED instead of
WRONG_NUMBER_OF_TYPE_ARGUMENTS where it's appropriate

^KT-59393 Fixed

Simplify FirTypeResolverImpl
2023-10-03 19:49:56 +00:00
Ivan Kochurkin 8d27af5b0d [FIR] Fix reporting of TYPE_ARGUMENTS_NOT_ALLOWED instead of WRONG_NUMBER_OF_TYPE_ARGUMENTS 2023-10-03 19:49:56 +00:00
Ivan Kochurkin 42e5e43302 [FIR] Refactor FirTypeResolverImpl.resolveUserType
Fix IndexOutOfBoundsException on an attempt to cast an element

to inner class with type parameter

^KT-60921 Fixed
2023-10-03 19:49:56 +00:00
Ivan Kochurkin 5cd9afbf73 [FIR] Don't use @OptIn(LookupTagInternals::class) in DeclarationUtils 2023-10-03 19:49:56 +00:00
Alexander Udalov 41f736a665 IR: remove dependency of IrTypeSubstitutor on IrBuiltIns
It was only used in one place incorrectly anyway.
2023-10-03 10:18:54 +00:00
Alejandro Serrano Mena c2dfe415f3 [Test] Operator ambiguity check with 'set'
When using `x[y] += z` the spec mandates attempting all possible combinations.

^KT-62138 Fixed
2023-10-03 08:23:29 +00:00
Mikhail Glukhikh 9cf1d36e5e K2: don't use outer class type parameters during nested class TP resolve
Before this commit, we allowed access to outer class type parameters
during resolve of type parameter bounds of a nested class.
In fact, outer type parameters are accessible in this situation
only if it's an inner class (or a local class).
This commit forbids such a usage. In the earlier fix of KT-57209
the same was done for regular type reference resolve.

#KT-61459 Fixed
#KT-61959 Fixed
2023-10-03 06:34:02 +00:00
Mikhail Glukhikh cdc197c723 K2: reproduce KT-61959 2023-10-03 06:34:01 +00:00
Mikhail Glukhikh 92470484bf K2: reproduce KT-61459 2023-10-03 06:34:01 +00:00
Alejandro Serrano Mena 310e89f100 [FIR] Report type-aliased 'Nothing' as return type
This warning was issued in K1, but lost in K2

^KT-59420 Fixed
^KT-59429 Fixed
2023-10-03 06:22:35 +00:00
Dmitriy Dolovov e8853fd40b [IR] Drop obsolete o.j.k.backend.common.serialization.signature.IdSignatureSerializer
It has been renamed to IdSignatureFactory. We have to keep
IdSignatureSerializer as a typealias for a while to keep the source
compatibility with the Compose compiler plugin.
2023-10-02 22:37:54 +00:00
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