Commit Graph

109329 Commits

Author SHA1 Message Date
Sebastian Sellmair 1912ffded6 [ObjCExport] Implement ObjCExportTypeTranslationTest
^KT-65167
2024-01-26 08:19:05 +01:00
Sebastian Sellmair de4380cd4e [CODEOWNERS] 'objcexport-header-generator' Share ownership between K/N and KiF teams 2024-01-26 07:01:58 +00:00
Simon Ogorodnik 3f4d2e93c6 K2. Minor. Rename CFG ConstExpressionNode to LiteralExpressionNode
^KT-64314
2024-01-25 23:05:15 +00:00
Simon Ogorodnik 53e89a9722 K2. Minor. Rename FirConstExpression to FirLiteralExpression
FirConstExpression is usually confused with "constant" calculations,
while in fact, it just denotes a simple literal expression
and `1 + 1` isn't represented by a FirConstExpression.

^KT-64314 Fixed
2024-01-25 23:05:15 +00:00
Kirill Rakhman 213967e25c [Tests] Fix incorrect code in tests 2024-01-25 15:55:19 +00:00
Kirill Rakhman b509d8efc2 [FIR] Replace Enum.values() with entries call 2024-01-25 15:55:19 +00:00
Dmitriy Novozhilov 3fba3b703e [FIR] Update call-sites which are interested in annotation arguments
After the previous commit, enum entry access to the annotation may be
  presented by two different nodes

^KT-64975
2024-01-25 15:55:19 +00:00
Dmitriy Novozhilov a4e8be8687 [FIR] Deserialize enum entries access in annotations into FirEnumEntryDeserializedAccessExpression
^KT-64975 Fixed
^KT-62900
2024-01-25 15:55:19 +00:00
Dmitriy Novozhilov 150ff1172e [FIR] Add session parameter to all "element --> reference" utilities
`FirDeserializedEnumAccessExpression` requires session to build proper
  reference, so it's important to have it in all utilities, which may
  pass this element as input

^KT-64975
2024-01-25 15:55:19 +00:00
Dmitriy Novozhilov bd9cb2b7e0 [FIR] Refactor val FirElement.calleeReference utility
1. Convert it to `toReference()` function to make it consistent with other
   similar utilities
2. Provide the proper implementation

^KT-64975
2024-01-25 15:55:19 +00:00
Dmitriy Novozhilov 36958d585f [FIR] Move reference-related utils from :fir:tree to :fir:semantics
This is needed to gain access to providers functionality in those
  utilities, which is important for support of FirDeserializedEnumAccessExpression
  node (see later commits)

^KT-64975
2024-01-25 15:55:19 +00:00
Svyatoslav Scherbina 2e5a9b1416 [K/N] Make cinterop include unused Objective-C forward declarations
Previously, when an Objective-C library had an unused Objective-C
forward declaration (`@class` or `@protocol`), cinterop tool didn't
include it into the resulting klib at all.

This led to a subtle bug (KT-64105). One Obj-C library has unused
Obj-C forward declaration, and another one depends on the first and
uses this forward declaration, e.g. as a function result type.
When building the first cinterop klib, this forward declaration is not
added to `includedForwardDeclarations` in the klib manifest (the
compiler uses this property to decide whether to synthesize the
corresponding class).
When building the second cinterop klib, the forward declaration is not
added to its manifest either, because it is located in the dependency
(and therefore should've been included there).
As a result, the forward declaration is included nowhere, and any
attempt to use it in Kotlin fails, including calling the function from
the second lib.

This commit fixes this bug by including even unused Objective-C forward
declarations, which is consistent with any other kind of declarations
and seems more natural.

^KT-64105 Fixed
2024-01-25 14:06:10 +00:00
Svyatoslav Scherbina 59142b3051 [K/N][tests] Fix using objcnames package in grouped tests
Native test infra groups individual tests into compilations, so it
renames packages, patching package and import directives, to avoid
clashes.
This doesn't include "standard" packages. They are distinguished by a
predicate defined in the test infra. This predicate didn't include
`objcnames.*` -- synthetic package provided by the compiler.
As a result, tests importing from `objcnames.*` got those import
directives patched, which was unexpected and could make tests fail.

This commit fixes the problem, making `objnames.*` recognized as
a "standard" package.
2024-01-25 14:06:10 +00:00
Svyatoslav Scherbina ffb0b063a8 [K/N][tests] Support dependencies for cinterop modules
When building cinterop klibs, cinterop tool can accept dependencies,
which affects the way it processes the native library.
The test infrastructure allowed to specify cinterop module dependencies,
but didn't actually pass them to the tool.
This commit fixes that.
2024-01-25 14:06:10 +00:00
Anastasiia Spaseeva 945f602b91 Revert "[Wasm] Support lazy associated object initialisation"
This reverts commit 552ee1ee38.
2024-01-25 14:11:56 +01:00
Vladimir Tagakov 91002eacda jvm-abi-gen: Remove data class copy fun from ABI along with constructor
#KT-64591 Fixed
2024-01-25 12:03:47 +00:00
Dmitrii Krasnov 692cc64d2a [Gradle IT] Fixed shouldDownloadKotlinNativeWithExistingKlibDir test
^KT-65248
2024-01-25 12:03:04 +00:00
cristiangarcia c53ac2e91f Update Proguard to 7.4.1 2024-01-25 11:36:31 +00:00
Denis.Zharkov 5db1bb921b Temporary comment out some parts of a slow diagnostic test
K2 version runs like for 15s.

It became slow after PCLA (KT-59791) was implemented,
and the reasons for that is the presence of a lot of interconnected TV
which leads to O(NUMBER_OF_CONSTRAINTS*NUMBER_OF_VARIABLES)
asymptotic during constraint incorporation.

The test itself in any way doesn't represent some common BI use case,
so it seems reasonable to mute it temporary.

^KT-65005 Related
2024-01-25 11:11:36 +00:00
Evgeniy.Zhelenskiy dc578b1c5f [FIR] Exclude class type arguments checks for type parameters from outer functions
#KT-63577
2024-01-25 11:04:25 +00:00
Alexander Shabalin ff76837d35 [K/N] Disable stress test with state checker ^KT-65261 2024-01-25 10:12:48 +00:00
Pavel Kunyavskiy 5e25707648 [Fir2IR] Don't compute overriddenSymbols if ir builder is enabled
Ir builder would recompute them anyway, while computation
can lead to triggering computations in lazy classes too early,
which is incorrect.

^KT-65116
2024-01-25 09:22:07 +00:00
Kirill Rakhman 2f4860886a [FE] Add todos
#KT-65228
2024-01-25 08:27:47 +00:00
Kirill Rakhman 45f5672b50 [FE] Reuse result of approximate calls in approximation of captured type
#KTIJ-28549 Fixed
2024-01-25 08:27:47 +00:00
Nikolay Lunyak 8fcf91d8ef [FIR] Mute tests related to KT-65268
They have been muted on TC for some time
already, and Nikolay Krasko asked to
mute them through code.

^KT-65268
^KT-64548
2024-01-24 22:29:51 +00:00
Yan Zhulanow c8af3381d6 [Stubs] Fix stub inconsistency on unnamed setter parameters
If an unused setter parameter was replaced with an underscore ('_'),
it had a special name in the stub ('<anonymous parameter 0>'). The text
version of the stub inserted it as is, leading to an extra
'PsiErrorElement'.

^KTIJ-28194 Fixed
2024-01-24 18:41:42 +00:00
Igor Yakovlev 552ee1ee38 [Wasm] Support lazy associated object initialisation
Fix #KT-63939
2024-01-24 16:24:44 +00:00
Brian Norman e7c1de1356 [FIR] Return statements need to forward postponed lambdas DFA edges
When there is a return statement within a lambda, and the return
statement contains a lambda, data-flow information from the inner lambda
is not being passed correctly to the surrounding lambda. This is because
return statements which had a lambda target would drop all postponed
lambda exits, but should instead forward those exits to the surrounding
lambda exit.

^KT-59729 Fixed
^KT-64268 Fixed
2024-01-24 16:20:38 +00:00
Igor Yakovlev 6b83eb282b [Wasm] Regenerate wasm tests 2024-01-24 15:41:38 +00:00
Igor Yakovlev 4a49261f8c [Wasm/WASI] Implement Wasm WASI box test for K2
Fix #KT-64449
2024-01-24 15:41:38 +00:00
Igor Yakovlev a5dd71ac93 [Wasm] Generate wat in tests if compiler key is set 2024-01-24 15:41:38 +00:00
Igor Yakovlev 3e9b2573c5 [Wasm/std] Fix invalid sign for FP rem operator
Fixed #KT-64829
2024-01-24 15:40:48 +00:00
Ilya Gorbunov a15e88ba1e [build] Pass/override JDK_1_8 env variable to maven exec tasks
While other JDKs can be used in the maven build,
only JDK_1_8 is required for 'install' and 'deploy' goals without tests.

Provide this path from the corresponding toolchain discovered by Gradle.
2024-01-24 15:37:29 +00:00
Dmitrii Krasnov 6e763f5c41 [Gradle] Fixed downloading konan when .konan/klib exists
^KT-65222 Fixed
^KT-65248 Verification Pending

Merge-request: KT-MR-14048
Merged-by: Dmitrii Krasnov <Dmitrii.Krasnov@jetbrains.com>
2024-01-24 14:19:57 +00:00
Ilya Goncharov d1664c6791 Not capture Gradle script reference in installTsDependencies on execution phase 2024-01-24 13:57:19 +00:00
Alexander Shabalin ab503d0aff [K/N] More debug output in HostExecutor for Windows ^KT-65113 2024-01-24 13:53:29 +00:00
Alexander Shabalin 5ee726558f [K/N] Workaround waitFor in HostExecutor for Windows ^KT-65113 2024-01-24 13:53:29 +00:00
Yahor Berdnikau 0258e71bd5 [Gradle] Set max Gradle version in tests to 8.4
^KT-62639 Verification Pending
2024-01-24 13:36:39 +00:00
Yahor Berdnikau 27dc0a55fd [Gradle] Add Gradle 8.6-rc-2 version
^KT-62639 In Progress
2024-01-24 13:36:39 +00:00
Yahor Berdnikau a6b5fd1e54 [Gradle] Update AGP test versions
^KT-62639 In Progress
2024-01-24 13:36:39 +00:00
Denis.Zharkov 7b82ca8b6f K2: Fix false-positive on delegated constructor call of outer class
See callingOuterGenericClassConstructorWithSelfTypes.kt
Previously, for A<B>(""), we used substituted constructor
where `X` was substituted with `B` (or `A<X>.B`).

But when resolving the call for constructor, we use `X`
as a type variable of the call, thus in some positions
we used `X` as TV (Xv in the comments) and somewhere `X` as a type
parameter, thus leading to contradictions (see clarifying comment).

The idea of the fix is simply repeating of the regular (not delegated)
constructor call resolution:
- We substitute only type parameters of outer class
- All the declared parameters of the callee are being checked
through regular resolution & inference mechanisms.

NB: Diagnostic only being reported on arguments because there
when we add `String <: Any` constraint it fails due to existing
contradiction in the CS.

Without the argument/parameter the error is just being lost, but that's
a different story (seeKT-65224).

^KT-64841 Fixed
2024-01-24 12:51:22 +00:00
Denis.Zharkov 81d559ad7f K2: Add test data for KT-64841 showing its current state 2024-01-24 12:51:22 +00:00
Nikolay Lunyak 3024ec3da3 [FIR] Add // FIR_DUMP to some implicit invoke tests
Although these dumps don't really show if
something is a `FirFunctionCall` or a
`FirImplicitInvokeCall`, they do show what
goes into the receiver, and what are value
arguments.
2024-01-24 12:49:57 +00:00
Nikolay Lunyak 9b786d35f8 [FIR] Fix NO_RECEIVER_ALLOWED
If we do create an implicit invoke call, and
then put the receiver into the argument list,
we should mark it.
2024-01-24 12:49:56 +00:00
Nikolay Lunyak eb11901d43 [FIR] Add some corner case tests for KT-64891
Note that there are some that K2
correctly supports, while K1 fails.

^KT-64891
2024-01-24 12:49:56 +00:00
Nikolay Lunyak 3a36a786d4 [FIR] Properly generate implicit invoke calls for a.(b)()
^KT-64891 Fixed
2024-01-24 12:49:55 +00:00
Nikolay Lunyak 8e6e447d6d [FIR] Reproduce KT-64891
^KT-64891
2024-01-24 12:49:55 +00:00
Anton Bannykh 245409dede [JS] Support custom Promise declarations for kotlin.test @AfterTest
^KT-63359 fixed


Merge-request: KT-MR-14001
Merged-by: Anton Bannykh <Anton.Bannykh@jetbrains.com>
2024-01-24 12:43:51 +00:00
Ilya Goncharov 9a74a5fcdd [Gradle, Wasm] Compatible wasm distribution task with configuration cache
^KT-64851 fixed
2024-01-24 11:55:33 +00:00
Alexander Zakharenko f502edd1de [K/N] Debug output for flaky test
Compiler output for testReleaseCompilerAgainstPreReleaseLibrary added

^KT-64822
2024-01-24 11:43:21 +00:00