Commit Graph

108264 Commits

Author SHA1 Message Date
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
Artem Kobzar 8d1a90c23c [K/JS] Support essential Kotlin collections (List, MutableList, Set, MutableSet, Map, MutableMap) for exporting into JS
^KT-34995 Fixed
^KT-44871 Fixed
2024-01-24 11:14:46 +00:00
Dmitriy Novozhilov b71797383f [Test] Add CLI tests for platform checkers in MPP
^KT-58881
2024-01-24 10:45:00 +02:00
Dmitriy Novozhilov e8f5e35a86 [FIR] Consider expect declarations in defaults arguments inheritance checker
Actual functions cannot declare default values for parameters
Corresponding expect function should be checked instead
2024-01-24 10:45:00 +02:00
Dmitriy Novozhilov 2982f548d4 [Test] Update testdata of MPP diagnostic tests after previous changes
Related issues: KT-58845, KT-58881, KT-64187
2024-01-24 10:45:00 +02:00
Dmitriy Novozhilov 1de8a1dda6 [Test] Correcly collect diagnostics in AA tests
One of the previous commits moved calculation of diagnostics from
  FirAnalyzerFacadeinto the separate test service, so it should be altered
  in AA tests too
2024-01-24 10:45:00 +02:00
Dmitriy Novozhilov cb3f41f669 [Test] Don't override manually registered services during test configuration
There are two ways of test service registration:
- manual call to `useAdditionalServices` in abstract test runner
- using of `additionalServices` property in one of test entity (e.g. in handler)

Services are registered in the same order (manual first, automatic second)

This led to the situation that if there was registered more specific
  implementation of the service in the test configuration, it will be
  overridden with regular implementation from handler, which is fixed
  by this commit
2024-01-24 10:45:00 +02:00
Dmitriy Novozhilov 990da9fa1a [FIR] Part 5. Introduce paired common checkers for expect classes
There are some cases when we want to run some platform checker not from
  platform session but from common session. All such cases appear when
  we check some `expect` class

```kotlin
// MODULE: common
expect interface A
expect class B : A

class C : A

// MODULE: platform()()(common)
actual interface A {
    fun foo()
}

actual class B : A {
    override fun foo() {}
}
```

In this example we want to report "abstract foo not implemented" on
  class `C`, but we don't want to report it on `expect class B` (as
  its supertype is always `expect A`, never `actual A`)

So to cover such cases some platform checkers were split into two parts:
- `Regular`, which is platform checkers and runs for everything except
  expect declaration
- `ForExpectClass`, which is common checkers and runs only for expect
  declarations

^KT-58881 Fixed
^KT-58881 Fixed
^KT-64187 Fixed
2024-01-24 10:45:00 +02:00
Dmitriy Novozhilov f5d8113de3 [FIR] Part 4. Setup running platform checkers in Analysis API
^KT-58881
2024-01-24 10:45:00 +02:00
Dmitriy Novozhilov ed874262e3 [FIR] Part 3. Setup running platform checkers in CLI
^KT-58881
2024-01-24 10:45:00 +02:00
Dmitriy Novozhilov c4e4776c5e [FIR] Part 2. Setup running platform checkers in tests
^KT-58881
2024-01-24 10:45:00 +02:00
Dmitriy Novozhilov 727d2f46f8 [FIR] Part 1. Group checkers by the MPP kind
This commit introduces MppChecker kind, which represents the new property
  of checkers
- `MppCheckerKind.Common` means that this checker should run from the same
  session to which corresponding declaration belongs
- `MppCheckerKind.Platform` means that in case of MPP compilation this
  checker should run with session of leaf platform module for sources
  of all modules

An example of a platform checker is a checker that checks class scopes
  and reports ABSTRACT_NOT_IMPLEMENTED and similar diagnostics. If some
  regular class in the common module contains expect supertypes, the
  checker should consider the actualization of those supertypes to get
  a complete type scope

^KT-58881
2024-01-24 10:44:59 +02:00
Dmitriy Novozhilov ff063f553e [FIR] Make session part of the key of declared scope cache
In the following commits, there will be a need to retrieve the scope of
  the same class from different sessions, so we need to consider the
  session as part of the key along with class symbol
2024-01-24 10:44:59 +02:00
Dmitriy Novozhilov 77547c0312 [Test] Add more diagnostic tests for cases with expect class in supertypes
Related issues: KT-58845, KT-58881, KT-64187
2024-01-24 10:44:59 +02:00
Dmitriy Novozhilov ed04cca62b [Test] Move some MPP diagnostic tests into a dedicated folder
All those tests check different diagnostics on class scopes
2024-01-24 10:44:59 +02:00
Mikhail Glukhikh 51093a4764 K1/K2: add a group of BB test around primitives in Java
Related to KT-62554, KT-63242
2024-01-24 08:39:18 +00:00