Commit Graph

8267 Commits

Author SHA1 Message Date
Abduqodiri Qurbonzoda 295fdc36ce Enum.valueOf throws inconsistent exception across multiple platforms #KT-35116 2023-06-16 22:18:20 +00:00
Abduqodiri Qurbonzoda d6867917c9 Enum entry hashCode() should return identity hash code #KT-59223 2023-06-16 22:18:20 +00:00
Vladimir Sukharev 05e22e56d3 [K/N] Mark rest of reflection related tests as jvm-only
^KT-59057

Merge-request: KT-MR-10570
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-16 11:50:03 +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
Vladimir Sukharev 1e05cb308c [K/N] Convert and enable some tests using System.out?.println()
^KT-59057

Merge-request: KT-MR-10546
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-15 20:00:27 +00:00
Vladimir Sukharev 67b00f86b7 [K/N] Remove "IGNORE_BACKEND: NATIVE" from tests already ignored due to incompatible language setting found in test
^KT-59057

Merge-request: KT-MR-10587
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-15 19:58:04 +00:00
vladislav.grechko 457837a255 Fix function invocation mangling rule
Mangle invocations of functions with value classes in signature which
override (directly or indirectly) a method declared in Kotlin code.
Otherwise, NoSuchMethodError is being thrown.

^KT-55945: Fixed
2023-06-15 09:34:21 +00:00
Ivan Kylchik dd264cff50 [IR] Split const folding into necessary one and for optimizations only
In this commit we have a lot of change in test data. This was caused
by the way where we evaluate constants. We split constant evaluation
into two distinct parts: only necessary evaluations for `fir2ir`
(like const val and annotations) and optimizations for lowering.
Now we don't do all constant evaluation on `fir2ir`, but IR
dump is executed after this phase, so test data changed.

#KT-58923
2023-06-14 19:02:39 +00:00
Ivan Kylchik 8067df3c94 [IR] Combine IrInterpreterNameCheck with common one
This way we achieve faster compilation time. We want to traverse
IR tree as little as possible. If we add new checker than the time
to evaluate constants basically doubles.

#KT-58923
2023-06-14 19:02:39 +00:00
Ivan Kylchik ec4cf40f6f [IR] Allow to fold IrGetField expressions
#KT-58923
2023-06-14 19:02:38 +00:00
vladislav.grechko b8b8b7fd3a [JVM_IR] Move variables out of IrInlinedFunctionBlock on MFVC lowering
Variables in `IrInlinedFunctionBlock` declared before the composite
blocks with arguments evaluation may lead to error on codegen while
processing `IrInlinedFunctionBlock`.

^KT-58779: Fixed
2023-06-14 17:34:14 +00:00
vladislav.grechko 4f1d181c88 [JVM_IR] Set correct origin for new variables on MFVC flattening.
Preserve information that variable is temporary while flattening.
Otherwise, unnecessary bytecode for them might be generated.
2023-06-14 17:34:14 +00:00
Alexander Korepanov fc898c7620 [JS IR] Use type upper bounds for calculating function signatures
^KT-59239 Fixed
2023-06-14 14:57:15 +00:00
Abduqodiri Qurbonzoda fd4d4f516f Fix data class hashcode generation
It considers Boolean hashCode equal to 1/0 for true/false,
which is different from actual hashCode of the Boolean type.
2023-06-14 08:19:47 +00:00
Abduqodiri Qurbonzoda 36924775c8 Add a compiler box test for Boolean.hashCode() 2023-06-14 08:19:47 +00:00
Mikhail Glukhikh 668157eb41 FirClassAnySynthesizedMemberScope.kt: make it a declared member scope
Related to KT-54844, KT-58926
2023-06-14 07:09:16 +00:00
Pavel Kunyavskiy f67f8c393b K2: Added test for data class metadata
#KT-57622 Fixed
2023-06-14 07:09:16 +00:00
Mikhail Glukhikh f48142a6e6 FIR2IR: fix binding of data class generated members
Related to KT-54844
#KT-54952 Fixed
#KT-54887 Fixed
2023-06-14 07:09:15 +00:00
Mikhail Glukhikh 2a825f8df1 K2: implement FirClassAnySynthesizedMemberScope #KT-54844 Fixed 2023-06-14 07:09:15 +00:00
Mikhail Glukhikh c898b264ba FIR2IR: fix receiver of value classes method references
This commit fixes the receiver of these method in FIR2IR code
by removing a particular hack.
However, as the consequence of it 2 black box tests become broken in K2.
The reason is KT-54952 which is not yet fixed

Related to KT-54887
2023-06-14 07:09:15 +00:00
Alexander Udalov 82af3dd6ae Tests: fix paths of Java sources in codegen tests
To help them run on the old infrastructure, which light analysis tests
are still using.
2023-06-13 17:48:23 +00:00
Alexander Udalov 23fb96378e Tests: remove duplicate LANGUAGE test directives
To help them run on the old infrastructure, which light analysis tests
are still using.
2023-06-13 17:48:23 +00:00
Alexander Udalov be4df35867 Tests: add FILE directives to some multimodule tests
To help them run on the old infrastructure, which light analysis tests
are still using.
2023-06-13 17:48:23 +00:00
Alexander Udalov 70e9245867 Revert "tmp: implement a hack to fix LA test"
This reverts commit 0387ce0365.

This change was not needed because the 'IGNORE_BACKEND_K1: JVM'
directive makes the test generated as ignored, in this case it is the
method named `ignoreSignedToUnsignedConversions` which is not even
recognized as a test.
2023-06-13 16:19:53 +00:00
vladislav.grechko d600d768a6 Do not assert existence of metadata for local delegated properties
Local delegated property may origin from a body of inlined function.
In that case, they contain no metatada - which is ok, as the original
local delegated properties contain it and will be serialized.

^KT-58780: Fixed
2023-06-13 10:04:28 +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
Dmitriy Novozhilov 6409bf2fe8 [FIR] Store expressions of receivers inside candidates instead of ReceiverValue
This is needed because of mutable nature of receiver values: implicit
  receiver values can be modified because of smartcasts, but in candidate
  we need to store snapshot of receiver in the form it was at the beginning
  of the resolution

^KT-58823 Fixed
2023-06-09 22:51:31 +00:00
Dmitriy Novozhilov c55ddab1bf [Test] Reproduce KT-58823 2023-06-09 22:51:31 +00:00
Alexander Udalov b992e698e4 Minor, add regression test for KT-58772
#KT-58772
2023-06-08 15:42:27 +00:00
Alexander Udalov ccf4a6813c Minor, move kt57353 test to a subfolder 2023-06-08 15:42:27 +00:00
Vladimir Sukharev 7aea0af307 [K/N] Enable passed tests for K1/N in involvesInterpreter
^KT-59057

Merge-request: KT-MR-10524
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-08 14:13:54 +00:00
Ivan Kylchik f74fd947b3 [JVM_IR] Don't add synthetic accessor when processing function reference
The issue appeared after code refactoring. Originally we didn't
save generated accessor for symbols in `IrFunctionReference`. These
symbols will be processed in their own turn.

#KT-59079 Fixed
2023-06-08 11:13:50 +00:00
Pavel Kunyavskiy 456783436c [K/N] Fix cast to NativePtr mis-compilation
^KT-59022
2023-06-08 10:40:29 +00:00
Denis.Zharkov c474c54903 FIR2IR: Fix IAE for case of local override of a method with defaults
It was happening because for MyClass.foo we didn't set overriddenSymbols
properly because in ClassMemberGenerator.convertFunctionContent we
used incorrect containingFirClass that was pointing to anonymous class
instead of MyClass.

^KT-58902 Fixed
2023-06-08 08:04:03 +00:00
Pavel Kunyavskiy 15e5adf2b5 Mark reflection related tests as jvm-only 2023-06-07 14:59:38 +00:00
Nikolay Lunyak 97adb01600 [FIR Native] Don't add Cloneable supertype when it's not present
^KT-58549 Fixed
2023-06-07 13:03:02 +00:00
Ilmir Usmanov 95662234d0 JVM: Support instantiation of annotations with vararg parameters
when they are instantiated without argument.
 #KT-59033 Fixed
2023-06-06 17:27:52 +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
Alexander Udalov b8785fbd90 K2: do not support disabling NoSourceCodeInNotNullAssertionExceptions
Disabling of this language feature (see KT-57570) was not supported in
the (default) light tree mode, and after this change it will not be
supported in the PSI mode as well. This makes the behavior more
consistent and allows us to remove the directive
IGNORE_BACKEND_K2_LIGHT_TREE in the future (KT-56757).
2023-06-06 10:06:39 +00:00
Sergej Jaskiewicz f2031ae642 [IR] Don't print multifile/synthetic facade class names in irText tests
This only applies to JVM and fq-names in declaration references
in IR dumps.

This enables us to run more irText tests on platforms other than JVM
(see KT-58605).
2023-06-05 10:40:17 +00:00
Pavel Kunyavskiy f2520a9cb7 [K/N] Rework is checks and as casts codegeneration
^KT-58707
^KT-59022
2023-06-05 08:56:17 +00:00
Artem Kobzar bfd57fd2df [K/JS, K/Wasm] Optimize simple objects declaration and usage ^Fixed KT-58797 2023-06-02 14:23:40 +00:00
Sergej Jaskiewicz 56b729f181 [test] Fix failing IR dump test 2023-06-01 13:22:01 +00:00
Nikita Bobko 4be7ac930b Update KClass.isData KDoc to include info about data objects
^KT-58985 Fixed
Review: https://jetbrains.team/p/kt/reviews/10385

`isData` returns `true` for `data object`s even if kotlin-reflect
version is old (1.2.0), so it looks like we got correct `KClass.isData`
behaviour for "free". That's why this behaviour was never covered with
tests.

This commit updates the documentation and covers the behaviour described
in the KDoc with tests.
2023-06-01 12:09:15 +00:00
Roman Efremov d2eb4a0abf [FE] Prohibit default arguments in expect declarations actualized via typealias
Cases when default argument inhertied from super class are allowed.

Some tests for default arguments already exist and can be found in
`testData/diagnostics/tests/multiplatform/defaultArguments`, for example
`annotationsViaActualTypeAlias.kt`.

^KT-57614 Fixed

Merge-request: KT-MR-10356
Merged-by: Roman Efremov <Roman.Efremov@jetbrains.com>
2023-05-31 13:14:37 +00:00
Igor Yakovlev 78b72efd32 [Wasm] Make Arrays' constructors with size and lambda inline
Fixed #KT-58746
2023-05-31 10:46:24 +00:00
Ilmir Usmanov d7fd2471b8 JVM IR: Remove remains of 1.2 coroutines from tests
Remove CoroutineAdapter and LANGUAGE: +ReleaseContinuation,
which are meaninless now.
Update the tests accordingly.
2023-05-31 05:56:18 +00:00
Sergej Jaskiewicz fd76a34277 [IR] Don't print flags in declaration references in irText tests
This doesn't reduce the quality of tests, because the flags are still
printed for declarations themselves. We only omit them in references.

However, this makes the tests more compatible with non-JVM backends
(see KT-58605), because flags of referenced stdlib declarations may
differ among target platforms.
2023-05-30 17:26:30 +00:00
Kirill Rakhman 793e3552e7 [FIR] Add tests for K2-only suspend operators get/set/contains
#KT-57169
2023-05-30 16:48:53 +00:00