Commit Graph

106634 Commits

Author SHA1 Message Date
Yahor Berdnikau cb64234192 [Gradle] Fix test data using deprecated conventions
^KT-63369 Fixed
2023-12-01 17:19:20 +00:00
Yahor Berdnikau c847d427d8 [Gradle] Fix test data not including test framework dependency
^KT-63368 Fixed
2023-12-01 17:19:20 +00:00
Evgenii Mazhukin befa921fd9 [IC] Multi-module incremental compilation smoke tests for KMP
Part 2. Main multi-module KMP smoke tests for incremental compilation

^KT-56963 Fixed
^KT-63876 Fixed

Merge-request: KT-MR-13193
Merged-by: Evgenii Mazhukin <evgenii.mazhukin@jetbrains.com>
2023-12-01 15:46:51 +00:00
Pavel Kirpichenkov c4fe7e4453 [Raw FIR] don't add an implicit Any super reference to kotlin/Any itself
KTIJ-27966
2023-12-01 14:56:01 +00:00
Marco Pennekamp d7190af72d [AA] FE10 compiler facility: Remove old backend support
- Old backend support is not needed in `KtFe10CompilerFacility` anymore,
  because it has been removed for the bytecode tool window, which was
  the only user. The old backend is slated to be removed entirely.

^KTIJ-24522
2023-12-01 13:22:55 +00:00
Vyacheslav Gerasimov cf3f63ad33 Build: Set Gradle daemon -Xmx to 2200m 2023-12-01 13:37:26 +01:00
Alexander Shabalin 340103098f [K/N][tests] Migrate entry point runtime tests to new testing infra ^KT-61259 2023-12-01 12:07:25 +00:00
Alexander Shabalin 0ab0607bbf [K/N][tests] Allow specifying program args in new test infra ^KT-61259 2023-12-01 12:07:25 +00:00
Sergej Jaskiewicz f46a14522f [FIR generator] Remove unused notNull property 2023-12-01 12:06:06 +00:00
Sergej Jaskiewicz f3016e1dcb [FIR generator] Avoid FIR-specific code in AbstractBuilderPrinter 2023-12-01 12:06:06 +00:00
Sergej Jaskiewicz cae4a9930b [FIR generator] Extract the Builder class to a common module
We want to use it to generate builder classes for other
trees, just like we already do with elements (see `AbstractElement` and
`AbsractImplementation`).
2023-12-01 12:06:06 +00:00
Sergej Jaskiewicz 91b5a71f1a [FIR generator] Extract the Implementation class to a common module
We want to use it to generate implementation classes for other
trees, just like we already do with elements (see `AbstractElement`).
2023-12-01 12:06:06 +00:00
Anastasia.Nekrasova 85cff98a38 [K2] Disappeared UNSUPPORTED
Prohibit Array<Nothing>

^KT-59881
2023-12-01 12:05:12 +00:00
Ivan Kylchik 73a0b4eaf2 [JVM_IR] Don't use irPluginContext at all when compiling code fragment
This is an extended version of the fix in
57d912a5d4. We don't want to use any
plugins in code fragment compilation, but we still get them through
`project` because they are registered in IDEA. So we just fully
exclude `irPluginContext`.

#KT-63695 Fixed
2023-12-01 11:22:21 +00:00
Mikhail Glukhikh 814bf1b80d K2: add TODO issues for ResolutionStages.kt (KT-63958, KT-63959) 2023-12-01 10:54:29 +00:00
Mikhail Glukhikh b317777796 K2: temporarily mute some Native tests around builder inference (KT-63932)
Related to KT-59369
2023-12-01 10:54:29 +00:00
Mikhail Glukhikh 526bc1744a K2: implement BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION
#KT-59390 Fixed
2023-12-01 10:54:29 +00:00
Simon Ogorodnik 299d279915 K2: Don't report BUILDER_INFERENCE_STUB_RECEIVER for members of Any
This commit actually does two things:
- Adds Any scope to stub type
- Makes CheckDispatchReceiver treat stub types
as non-null for the unsafe call check to make such candidates viable

Related to KT-59369
2023-12-01 10:54:29 +00:00
Mikhail Glukhikh 0ed6256bcc K2: implement BUILDER_INFERENCE_STUB_RECEIVER
#KT-59369 Fixed
2023-12-01 10:54:29 +00:00
Nikolay Krasko 5e5e5b8b9f Revert "[FIR] Remove the redundant isFunctionType check"
This reverts commit 1f97c268e1.
2023-12-01 11:27:39 +01:00
Ivan Kylchik 2b6845c032 [JVM_IR] Optimize properties delegated to const val
We can omit `get` call to delegated property and inline
constant value directly. If we are not going to
do that, we can get a runtime exception because
all usages of const property will be inlined and the property
itself will be dropped.

#KT-63567 Fixed
#KT-63580 Fixed
2023-11-30 14:27:36 +00:00
Nikita Nazarov 1f97c268e1 [FIR] Remove the redundant isFunctionType check
^KT-63865 fixed
2023-11-30 14:17:01 +00:00
Artem Kobzar 98186ec283 [K/JS] Add ES6 typescript tests + fix a few bugs for it 2023-11-30 13:37:06 +00:00
Anastasia.Nekrasova c569fc170b [K2] Disappeared UNSUPPORTED
Prohibit DelegationBy specifier when no primary constructor

^KT-59881
2023-11-30 13:22:39 +00:00
Anastasia.Nekrasova 23bed574c1 [K2] Disappeared UNSUPPORTED
Prohibit annotations for parameters in function type

^KT-59881
2023-11-30 13:17:55 +00:00
marat.akhin f0f06ccf2e [tests] Add tests for conflicting overloads + hidden between open/final 2023-11-30 13:07:23 +00:00
marat.akhin 83abbe8a78 [tests] Add missing .txt for conflicting overloads with hidden tests 2023-11-30 13:07:23 +00:00
marat.akhin 0bc79fe69d [K2] Make CONFLICTING_OVERLOADS + HIDDEN ignore work only for finals
When fixing KT-22004, the analysis was incomplete, the details are
available at KT-63540. This change restricts the ignore of conflicting
overloads on hidden callables only for final ones.

^KT-63540 Fixed
2023-11-30 13:07:23 +00:00
Anton Lakotka e4e4af4d3d [Code Owners] Make Stanislav.Erokhin owner of commonizer
After Kotlin Multiplatform disband commonizer doesn't have proper
owner. Stanislav.Erokhin will handle it further.
2023-11-30 12:25:52 +00:00
Anton Lakotka 1479362203 [Code Owners] Remove Kotlin Multiplatform
Kotlin Multiplatform team was disbanded in Space. All owned code
is migrated to Kotlin Build Tools or Kotlin Apple Ecosystem teams.
2023-11-30 12:25:52 +00:00
Aleksei.Glushko 7eccfe969c [K/N] Runtime reference accessors
Encapsulate reference-access-related logic,
    such as GC barriers and tsan workarounds
    inside (Direct)RefAccessor classes.
2023-11-30 11:04:21 +00:00
Aleksei.Glushko 24becdad7e [K/N] Backport std::atomic_ref from C++20 2023-11-30 11:04:21 +00:00
Alexander Udalov fc7de5ab97 IR: check type parameter bounds equality in overrides
The code is exactly the same as in K1's
`OverridingUtil.areTypeParametersEquivalent`.

 #KT-63442 Fixed
2023-11-30 11:04:02 +00:00
Kirill Rakhman 560c1cacf3 [FIR] Fix capturing of flexible types during resolution
Previously, because we didn't handle flexible types properly in
prepareCapturedType, projections inside flexible types would only be
captured during subtyping with captureStatus=FOR_SUBTYPING
which would lead to the constraint type being wrongly approximated
(see ConstraintInjector.TypeCheckerStateForConstraintInjector
.addNewIncorporatedConstraint).

Fixing the capturing produced two kinds of false positive diagnostics:

1. In ConstraintInjector.TypeCheckerStateForConstraintInjector
.addNewIncorporatedConstraint we would get two instances of cone types
that are structurally equal and containing the same captured type.
However, because we only skipped subtyping if the types were
referentially equal, we would get a contradiction here.
The fix was to use structural equality instead, which should be okay
as the captured type instances are the same.

2. Reified type variables were inferred to captured types because
flexible arrays with captured upper bounds
(Array<Foo>..Array<Captured(out Foo)>?) were not properly approximated.

#KT-62609 Fixed
2023-11-30 08:54:26 +00:00
Kirill Rakhman ed4941d9f9 [FIR] Make return type of ConeTypeContext.captureFromExpression more precise 2023-11-30 08:54:26 +00:00
Kirill Rakhman 934253878b [Tests] Add regression test for KT-63564
#KT-63564 Fixed
2023-11-30 08:39:05 +00:00
Kirill Rakhman 674c56827f [FIR] Remove unnecessary SAM sonversion in java nullability checker
#KT-62847
2023-11-30 08:39:05 +00:00
Kirill Rakhman b857c28ab3 [FIR2IR] Fix cast insertion for SAM conversion
The rule is: no cast is required iff the argument type is a
non-reflection function type and a subtype of the expected
function type.
We approximate the cone types using the FIR2IR specific config
to account for intersection types, captured types, etc.

#KT-63345 Fixed
#KT-63510
#KT-62865
2023-11-30 08:39:05 +00:00
Kirill Rakhman dd1d36816b [FIR] Insert SAM conversion expressions during completion
#KT-62847 Fixed
2023-11-30 08:39:04 +00:00
Kirill Rakhman 0b28e770b2 [FIR] Introduce new FIR node for SAM conversion
#KT-62847
2023-11-30 08:39:03 +00:00
Kirill Rakhman ebb6f4c70f [FIR] Add parameter flattenArrays to FirExpression.unwrapAndFlattenArgument 2023-11-30 08:39:03 +00:00
Kirill Rakhman 28a14ebd42 [FIR] Fix typo 2023-11-30 08:39:03 +00:00
Kirill Rakhman bad33d81a3 [Test] Ignore carriage returns when comparing file contents in AbstractFirIdenticalChecker 2023-11-30 08:39:03 +00:00
Dmitriy Dolovov 3d57e83d8a IR: Fix tests which failure caused only by the changed IR dump format 2023-11-30 08:32:35 +00:00
Dmitriy Dolovov 16d1e85932 IR text tests: Stable blank lines between declarations in class
Rework rendering of kt-like dump and signatures dump in order to avoid
unstable blank line between declarations of the same level:
1. No blank line for the first declaration inside the member scope of
the class.
2. Always a single blank line between each two subsequent declarations
inside the member scope of the class.
2023-11-30 08:32:35 +00:00
Dmitriy Dolovov 4532f52898 IR text tests: Unmute enum class-related tests
Making enum class-related tests unmuted requires implementing
a special "compatibility" mode for IR tree dumper to filter out
fake override declarations leaking from java.enum.Enum and
kotlin.Enum (JVM-only) classes.
2023-11-30 08:32:35 +00:00
Dmitriy Dolovov fd96ee1d0b IR text tests: Remove useless IGNORE_BACKEND*: JS_IR_ES6 directive 2023-11-30 08:32:35 +00:00
Dmitriy Dolovov e0e50e183e IR text tests: Add test with the implementation of a private interface 2023-11-30 08:32:35 +00:00
Dmitriy Dolovov 02604060ae IR text tests: Don't dump signatures for local declarations
1. Local declarations don't participate in IR-linkage, because they
can be referenced only inside the same body -> can be dropped
from IR text tests.

2. Mangled names for private declarations computed by descriptors/fir
are actually not used anywhere (they are recomputed by IR
immediately before serialization of IR). But sometimes such
mangled names diverge between K1 and K2 -> don't check them, but
always check mangled names computed by IR even for private
declarations.

3. Also: Drop DUMP_LOCAL_DECLARATION_SIGNATURES test directive.

^KT-57428 Obsolete
^KT-57430 Obsolete
^KT-57434 Obsolete
^KT-57778 Obsolete
^KT-57775 Obsolete
2023-11-30 08:32:35 +00:00
Stanislav Ruban 514ae0c813 [tests] builder inference test-set: regenerate diagnostic & codegen tests 2023-11-30 06:27:00 +00:00