Commit Graph

139 Commits

Author SHA1 Message Date
Nikita Bobko 4f3ecedbca [FE] Stop ignoring ABSTRACT_MEMBER_NOT_IMPLEMENTED for expect classes
^KT-59739 Fixed
Review: https://jetbrains.team/p/kt/reviews/11038/timeline
2023-07-24 09:15:11 +00:00
Mikhail Glukhikh c350280e64 K2: fix enhancement building for Java methods with type parameters
Before this commit, we copied each type parameter during method
enhancement, while not copying the symbol. This led to symbol clashes
in MPP scenarios and various other problems.

Now we create a fully-functional type parameter copy in enhancement
and perform a substitution of old type parameters with new ones
in receiver type, value parameter types, return type,
and type parameter upper bounds.

#KT-59766 Fixed
#KT-59738 Fixed
2023-07-14 16:17:49 +00:00
Kirill Rakhman b68962018c [FIR] Remove incompatible from expect actual matching if compatible exists
This fixes an issue with checking for default values in call resolution
(see FirDefaultParametersResolver) where it is expected that the map
only contains a single compatible entry.

#KT-59613 Fixed
2023-07-05 08:51:01 +00:00
Vladimir Sukharev 09a0905ffc [Test] Convert IGNORE: NATIVE directives in rest of tests
^KT-59057 Fixed

Merge-request: KT-MR-10794
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-26 07:44:12 +00:00
Svyatoslav Kuzmich a3e2d2804c [Wasm] Update testData after adding K2 and new test infra support.
- Actualize muted K2 tests
- Actualize muted K1 tests with module systems because legacy Wasm test
  infra had no respect for "// MODULE: ..." test directives
2023-06-25 10:20:40 +02:00
Dmitriy Novozhilov 1b24b95cde [FIR] Check for subtyping during actualization of supertypes of expect class
^KT-59356 Fixed
2023-06-22 07:05:31 +00:00
Dmitriy Novozhilov d972b78627 [FIR] Allow actualization of expect classes by classes with wider visibility
^KT-59355 Fixed
2023-06-19 11:09:32 +00:00
Vladimir Sukharev 217550d10e [K/N] Enable passed MPP K1/N tests
^KT-59057

Merge-request: KT-MR-10526
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-16 07:45:01 +00:00
Dmitriy Novozhilov c64310a833 [Test] Update tests according to KT-58544
There are some cases for fake-override actualization which become
  prohibited in the new expect/actual model, so few tests start to fail,
  despite the fact that they are checking entirely different things
2023-06-10 07:33:29 +00:00
Dmitriy Novozhilov ba41e8ec38 [IR] Use common expect/actual matching algorithm in IR actualizer
^KT-58578 Fixed
2023-06-10 07:33:29 +00:00
Pavel Kunyavskiy 733ca5a358 [K/N] Unmute tests already working on native
Also, add issue references for some tests
2023-06-06 14:29:21 +00:00
Ivan Kochurkin 432c781ff7 [K2, MPP] Fix actualization of fake overrides (fixes a set of bugs in coroutines / ktor)
Split MissingFakeOverridesAdder on FakeOverridesActualizer and ActualFakeOverridesAdder

^KT-57984 Fixed
^KT-58003 Fixed
^KT-58124 Fixed
^KT-57833 Fixed
^KT-58153 Fixed
2023-05-24 14:54:51 +00:00
Vladimir Sukharev fde8909e6f [K2/N] IntegerLiteralType coercion only to unsigned integer types
^KT-57484 Fixed

Merge-request: KT-MR-10270
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-05-24 07:56:14 +00:00
Vladimir Sukharev bbe1e708f9 [K2/N] Rewrite mpp tests from old native infra to new
^KT-58543

Merge-request: KT-MR-10065
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-05-16 08:41:39 +00:00
Pavel Punegov 3d65907b8c [K/N][test] Ignore test in Native K1
This test doesn't work with K1 in Native

Merge-request: KT-MR-9934
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-05-04 08:50:42 +00:00
Dmitriy Novozhilov e9c8be3b64 [FIR] Don't generated fake-overrides for private declarations of actualized super classes
^KT-58252 Fixed
2023-05-02 10:24:53 +00:00
Dmitriy Novozhilov 15dfe6c750 [FIR2IR] Use signature instead of FIR as a key for fake-override storage
This is needed to correctly handle the case, when we have the same java
  class in common and platform module. In this scenario we have two
  different classes on frontend (because symbol providers are not shared)
  and completely different enhanced function in scopes of those classes,
  but exactly one IrClass for those classes, which is cached during
  conversion of common module together with cache of its fake overrides.
  So using FirDeclaration as a key to FO cache leads to the problem, when
  we can not find cached value for platform module, because it has different
  fir declarations for the same real decalration

^KT-58030 Fixed
2023-04-28 13:08:19 +00:00
Ivan Kochurkin b72dcf8b37 [K2, MPP] Fix actualization of nullability-based overloads
^KT-58043 Fixed
2023-04-20 17:22:45 +00:00
Svyatoslav Scherbina 54c07f5ebb Ignore K2 expectPropertyAsDefaultArgument.kt test for K1/Native
It is not supposed to work with K1 on Native due to test infrastructure
limitations, and actually fails in one of the compilation modes in
nightly tests.
2023-04-18 10:43:51 +00:00
Ivan Kochurkin beaeb405d2 [K2, MPP] Build expect-actual map for type parameters from functions
^KT-57181 Fixed
2023-04-17 19:55:35 +00:00
Ivan Kochurkin b7bb9c317f [K2, MPP] Introduce FunctionDefaultParametersActualizerVisitor and use it in FunctionDefaultParametersActualizer
^KT-57263 Fixed
2023-04-17 19:55:34 +00:00
Ivan Kochurkin 9a09565cf6 [K2, MPP] Handle overloaded properties
^KT-57532 Fixed
2023-04-12 20:43:57 +00:00
Vladimir Sukharev 351588f0a7 [K2/N] Enable some fixed MPP tests
Merge-request: KT-MR-9364
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-03-28 16:49:57 +00:00
Kirill Rakhman 32cc28c6cf [FIR] Skip expect-actual rules check when overriding non-expect member
Overriding equals, hashCode, toString and any other member that is not
expect does not require satisfying the rules of expect-actual matching.

#KT-57381 Fixed
2023-03-28 16:21:33 +00:00
Kirill Rakhman ee78c31174 [FIR2IR] Fix generation of Any method call on expect receiver
#KT-57583 Fixed
2023-03-28 12:47:42 +00:00
Vladimir Sukharev b375307aa6 KT-57349: Disable target-wide tests for K1/Native
Merge-request: KT-MR-9353
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-03-27 13:32:18 +00:00
Ivan Kochurkin c14dcfce4f [K2, MPP, JS] Fix a compiler crash on transitive common dependencies
^KT-57431 Fixed
2023-03-24 14:48:28 +00:00
Ivan Kochurkin 4e67d82cd3 [K2, MPP] Make MPP tests from k2/basic target-wide
^KT-57349
2023-03-24 14:48:27 +00:00
Ivan Kochurkin ee73e4774b [K2, MPP] Remove redundant expect declarations from klib metadata
^KT-57250 Fixed

Introduce flat Fir2IrActualizedResult

It contains output from Fir2Ir and IrActualizer
2023-03-24 14:48:26 +00:00
Ivan Kochurkin ce7af9ff2b [K2, MPP] Support arguments with expect types in actual functions 2023-03-22 01:28:18 +00:00
Vladimir Sukharev 5bd0a1a0ba Disable some tests due to open issues and incompatibility with K1/MPP
Merge-request: KT-MR-9206
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-03-15 06:55:27 +00:00
Nikolay Krasko 57934a6870 Revert "Revert "[K2/N] KT-57026, KT-57208: Adjust Native & JS test infrastructures for MPP testing""
This reverts commit c0c692844e.
2023-03-10 14:24:49 +01:00
Nikolay Krasko c0c692844e Revert "[K2/N] KT-57026, KT-57208: Adjust Native & JS test infrastructures for MPP testing"
This reverts commit 6964121c15.
2023-03-10 13:14:10 +00:00
Vladimir Sukharev 6964121c15 [K2/N] KT-57026, KT-57208: Adjust Native & JS test infrastructures for MPP testing
Merge-request: KT-MR-9081
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-03-09 18:56:30 +00:00
Nikolay Lunyak bcfafc601e Add EnumEntries to minimal-stdlib-for-tests
This change allows to revert adding `WITH_STDLIB` directive
to tests which happened at `a9343aeb`.

Co-authored-by: Alexander Udalov <Alexander.Udalov@jetbrains.com>
2023-03-02 10:23:38 +00:00
Ivan Kochurkin ee53c5780f [FIR] Extract K2 MPP test data to the separated directory 2023-03-01 22:10:11 +00:00
Ivan Kochurkin f1fef62f76 [FIR] Consider default values from expect function during serialization
It's not possible to unmute some tests for K2 because it causes testData structure changing

If change testData, NATIVE doesn't work even with `IGNORE_BACKEND`
2023-03-01 22:10:07 +00:00
Ivan Kochurkin d87619e06e [FIR & IR] Support of default values for arguments in expect functions
Add FirActualDeclarationChecker that checks expect/actual return types

^KT-56331 Fixed, ^KT-56334 Fixed
2023-03-01 22:10:07 +00:00
Ilmir Usmanov bfa2937fb8 FIR2IR: Do not add fake override if the member is overridden
#KT-56398 Fixed
2023-02-21 17:18:01 +01:00
Dmitriy Novozhilov 30ea4b6b53 [FIR2IR] Adapt IrActualizer to HMPP modules
Previously it collected actual declaration only from platform module
2023-02-17 11:08:51 +00:00
Nikolay Lunyak a9343aeb7d [FIR] KT-55840: Ensure everything actually works
This inconsistency is present due to not using the `// WITH_STDLIB`
in the above tests. When K1 creates the enum, it tries to generate
`entries()`, and for that it tries to load `kotlin.enums.EnumEntries`,
but this is actually an unresolved reference. K1 silently swallows it,
and proceeds.

The reason K2 doesn't fail is that in order to generate `entries()` it
simply creates the necessary `ConeClassLikeType` with the desired
`classId` instead of loading the whole `ClassDescriptor`.

The reason we can still observe `$ENTRIES` and `$entries` in K1
is because they are generated during the JVM codegen, and it
only checks if the `EnumEntries` language feature is supported. It
doesn't check if the `entries` property has really existed in IR
(by this time it's expected to have already been lowered to the
`get-entries` function - that's why "has ... existed").

The reason why the codegen doesn't fail when working with
`kotlin.enums.EnumEntries` is because it creates its
own `IrClassSymbol`.

^KT-55840 Fixed

Merge-request: KT-MR-8727
Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>
2023-02-10 16:57:51 +00:00
Ivan Kochurkin 12a083af25 [FIR2IR] Consider isExpect flag for generated synthetic functions
It's actual for value classes

^KT-51969 Fixed
2023-02-08 17:21:34 +00:00
Ivan Kochurkin 4374ca390a [IR] Extend enumEntryNameCall.kt test sample to check enum entries actualization 2023-02-08 17:21:34 +00:00
Ivan Kochurkin 241f457943 [IR] Use full name for expect/actual functions linking, simplify code
Don't put type parameters to expect-actual map since it's useless

^KT-56329 Fixed
2023-02-08 17:21:34 +00:00
Ivan Kochurkin d401ff7b09 [FIR & IR] Implement JS MPP test infrastructure
^KT-55295 Fixed
2023-02-07 14:16:29 +00:00
Ivan Kochurkin c89770c450 [IR] Consider extension receivers during expect functions actualization
^KT-56199 Fixed
2023-02-01 11:42:45 +00:00
Ivan Kochurkin e601b01be2 [FIR2IR] Use single IrBuiltInsOverFir for all MPP source modules
^KT-56229 Fixed
2023-02-01 11:42:45 +00:00
Marco Pennekamp 9a693fa967 [FIR] Update backend tests with actual/expect in same module
- The fix for KT-55570 caused some backend tests to fail, because errors
  are now correctly reported for simple classes and actual/expect in
  the same module is not supported in FIR. See KT-55177.
- The commit also adds separate tests for K2. Unfortunately, these have
  to be disabled for K1 because K1 then reports "expect without actual"
  errors.
2023-01-30 17:17:58 +00:00
Artem Kobzar 71486a321c [K/JS] Add support of compilation with ES-classes 2023-01-17 18:14:17 +00:00
Ivan Kochurkin 8936220876 [IR] Implement IR actualizer and use it for K2 test and CLI scenario
Implement calculateExpectActualMap for Fir2IrComponents

^KT-51753 Fixed
2023-01-13 12:55:58 +00:00