Commit Graph

106612 Commits

Author SHA1 Message Date
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
Stanislav Ruban 80462efe7e [tests] BI (1P&1TV/1TIO): add additional test data for contexts of source-sink feeds
single builder parameter
single postponed type variable
single origin of type information

relevant issues:
KT-63816
2023-11-30 06:26:59 +00:00
Alexander Kuznetsov 0f65ba4843 [evaluator] consider arguments of super-calls
Code generation for the intrinsic `jvmDebuggerInvokeSpecialIntrinsic`
includes dispatch receiver, but ignores arguments
passed to a super-call. This change passes arguments in the IR
representation in an array, and during the codegen the array is
unpacked and the bytecode is generated for the elements,
right before generating the actual `INVOKESPECIAL`.

#KT-63848 fixed


Merge-request: KT-MR-13270
Merged-by: Alexander Kuznetsov <Aleksander.Kuznetsov@jetbrains.com>
2023-11-29 23:28:44 +00:00
Dmitrii Gridin f3b3dcee9e [LL FIR] LLFirLazyResolver: more generic checks and cleanup
We should use more common classes which it is possible to potentially
not miss any changes in the future

^KT-63681
2023-11-29 19:52:29 +00:00
Ivan Kylchik 8039e38519 [JVM_IR] Override visitInlinedFunctionBlock in ExpressionCodegen 2023-11-29 18:14:02 +00:00
Ivan Kylchik 1125891a13 [K2] Properly report diagnostics on const properties with Java usages
#KT-63752
#KT-59894
#KT-61920 Fixed
2023-11-29 16:33:18 +00:00
Ivan Kylchik 9f64edb31e [FIR] Add hasConstantInitializer field in FirField class
This field is required to be able to analyze Java fields
without triggering lazy const evaluation.

#KT-59894
#KT-61920
2023-11-29 16:33:17 +00:00
Alexander Shabalin 6ca8f546fe [K/N][tests] Migrate console runtime tests to new testing infra ^KT-61259 2023-11-29 16:22:28 +00:00
Alexander Shabalin 2abf9bccba [K/N][tests] Close stdin after piping all the data ^KT-61259 2023-11-29 16:22:28 +00:00
Alexander Shabalin 97a86e0ee3 [K/N][tests] Add global TEST_KIND override ^KT-61259 2023-11-29 16:22:28 +00:00
Dmitriy Novozhilov e75b29032f Advance bootstrap to 2.0.0-dev-9013 2023-11-29 15:14:14 +00:00
Denis.Zharkov bb548e3df4 K2: Fix exception for PropertyDelegateProvider + lazy case
^KT-63646 Fixed
2023-11-29 15:10:36 +00:00
Sergej Jaskiewicz 11d203d0a7 [IR] Add a kDoc for IrStringConcatenation 2023-11-29 14:52:04 +00:00
Sergej Jaskiewicz 2f98b4310a [IR] Add a kDoc for IrAnonymousInitializer 2023-11-29 14:52:04 +00:00
Sergej Jaskiewicz de502301ed [IR] Add a kDoc for IrRawFunctionReference 2023-11-29 14:52:04 +00:00
Sergey Bogolepov fea73ae64a [Swift Export] Minor tests fixes and adjustments 2023-11-29 14:04:00 +00:00
Sergey Bogolepov 5eeb82bb6f [Swift Export] Update sir-compiler-bridge to use SIR
Now that SIR has finally landed in the repository, we can remove
unnecessary entities from the bridge generator.
2023-11-29 14:03:59 +00:00
Artem Olkov a040954f68 rrn/rd/KT-63270-swift-printer
KT-63270: add swift printing capabilities to SIR

Co-authored-by: Artem Olkov <artem.olkov@jetbrains.com>
Co-authored-by: Sergej Jaskiewicz <jaskiewiczs@icloud.com>


Merge-request: KT-MR-13191
Merged-by: Gleb Lukianets <Gleb.Lukianets@jetbrains.com>
2023-11-29 14:03:59 +00:00
Brian Norman f9933adf5e [FIR] Substitute parameter bounds when checking EXPANSIVE_INHERITANCE
^KT-63649 Fixed
2023-11-29 13:35:00 +00:00
Evgenii Mazhukin 3f8505a090 [IC] Smoke tests for KMP IC, part 1.5
Refactorings: rework testData to better reflect usages of declarations,
clean up internal test methods.

Merge-request: KT-MR-13232
Merged-by: Evgenii Mazhukin <evgenii.mazhukin@jetbrains.com>
2023-11-29 13:28:26 +00:00
Ivan Kylchik 35cf9cb0c4 [Project] Drop Generate Compiler Tests in favor of Generate All Tests
`Generate Compiler Tests` configuration is not working properly
because it doesn't include analysis api test generator. It was decided
to keep only one generate configuration for tests.
2023-11-29 11:50:01 +00:00
Ilya Goncharov 08e3cb300a [JS] Migrate tests onto IR compiler with outputDir API instead of outputFile
^KT-61117 fixed
2023-11-29 11:21:56 +00:00
Yahor Berdnikau e50f6e6bca [Gradle] Add '@JvmStatic' annotation to companion methods in Kotlin types
This should improve usability in groovy scripts.

^KT-63601 Fixed
2023-11-29 10:24:23 +00:00