Commit Graph

18887 Commits

Author SHA1 Message Date
Denis.Zharkov 72b0372927 K2: Allow PCLA inference when a value parameter has a TV type
^KT-64877 Fixed
2024-01-11 10:32:12 +00:00
Denis.Zharkov b2ca19da73 K2: Adjust test data after correcting source for it
While reporting a diagnostic there seems to be correct because the
parameter type is ConeErrorType, the former fact is a bug
in PCLA that should be fixed soon
2024-01-11 10:32:12 +00:00
Denis.Zharkov e359db4111 K2: Set proper source for implicit it/receiver parameter
Previously, error types on those implicit parameters were being lost.

Changed test data is only partly here
(only parts that are considered to be correct).

Other ones (new green-to-red changes) should belong to the next commit
and will be fixed soon (as a part of PCLA).
2024-01-11 10:32:12 +00:00
Vladimir Sukharev b78455093e [K/N][Tests] Adapt test single_tls_load.kt to optional inline of EnterFrame 2024-01-10 23:31:00 +00:00
Vladimir Sukharev 86c88c0c77 [K/N][Tests] Ignore alwaysDisable test which fails without caches
^KT-64868
2024-01-10 23:31:00 +00:00
Vladimir Sukharev fee2a20a55 [K/N][Tests] Support test directive ASSERTIONS_MODE
^KT-64844 Fixed
2024-01-10 23:31:00 +00:00
Vladimir Sukharev 809d652bdf [K/N][Tests] Change assertions and runtime assertions modes to default, when optimizationMode=OPT
^KT-64844 Fixed
2024-01-10 23:31:00 +00:00
Dmitrii Gridin cf290a73fc [Analysis API] migrate AbstractSymbolLightClassesTestBase to doTestByMainModuleAndOptionalMainFile
^KT-64805
2024-01-10 22:07:03 +00:00
Denis.Zharkov 7e4d9d9f64 K2: Add new tests for PCLA implementation
Many of them have been found & minimized at FP tests/user projects

^KT-59791 Fixed
2024-01-10 14:56:31 +00:00
Denis.Zharkov 90feeab076 K2: Temporary mute controversial K2 IDE test after PCLA implementation
^KT-59791 In Progress
2024-01-10 14:56:30 +00:00
Denis.Zharkov 8365eb54dd K2: Adjust test data after PCLA implementation [multiLambdaRestriction]
^KT-59791 In Progress
2024-01-10 14:56:30 +00:00
Denis.Zharkov b9019d3de1 K2: Adjust test data after PCLA implementation [red-to-green]
^KT-59791 In Progress
2024-01-10 14:56:30 +00:00
Denis.Zharkov 8459465177 K2: Adjust test data after PCLA implementation [green-to-red, controversial]
^KT-59791 In Progress
2024-01-10 14:56:30 +00:00
Denis.Zharkov f945dce4c8 K2: Adjust test data after PCLA implementation [green-to-red]
^KT-59791 In Progress
2024-01-10 14:56:30 +00:00
Denis.Zharkov 6052e24626 K2: Adjust test data after PCLA implementation [red-to-red]
^KT-59791 In Progress
2024-01-10 14:56:30 +00:00
strangepleasures bb8ff9e299 KT-62584 Fix generation of type arguments for local classes
Merge-request: KT-MR-13684
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2024-01-10 14:20:09 +00:00
Alexander Udalov dd5fffebf2 JVM: do not generate assertion message for captured fields
#KT-64615 Fixed
2024-01-10 11:10:08 +00:00
Alexander Udalov f01e633f8b JVM: do not put public field access into a single expression block
It affects the `is IrGetField` check in
TypeOperatorLowering.computeNotNullAssertionText, which leads to missing
NPE messages when accessing backing fields of public properties.

 #KT-64615
2024-01-10 11:10:08 +00:00
Nikita Bobko 013b5e3780 [IR] Fix missing AMBIGUOUS_ACTUALS
^KT-59938 Fixed
Review: https://jetbrains.team/p/kt/reviews/13760

After this patch:

    > The /compiler/testData/diagnostics/tests/multiplatform/topLevelFun/conflictingImplDeclarations.kt test:

    Fixed

    > The /compiler/testData/diagnostics/tests/multiplatform/headerClass/expectDeclarationWithWeakIncompatibilities.kt test:

    Declarations are in the same module. `PACKAGE_OR_CLASSIFIER_REDECLARATION` is reported anyway

    > The /compiler/testData/diagnostics/tests/multiplatform/java/varPropertyAgainstJavaGetterAndNonFinalField.kt test:

    Expect-actual matcher doesn't match fields in K2 https://youtrack.jetbrains.com/issue/KT-63667 => green code

    > The /compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPrivateFieldAndPublicMethod.kt test:

    Expect-actual matcher doesn't match fields in K2 https://youtrack.jetbrains.com/issue/KT-63667 => green code

    > The /compiler/testData/diagnostics/tests/multiplatform/java/implicitJavaActualization_multipleActuals.kt test:

    K2 doesn't have implicit Java actualization. And PACKAGE_OR_CLASSIFIER_REDECLARATION is reported anyway

    > The /compiler/testData/diagnostics/tests/multiplatform/java/propertyAgainstJavaPublicFieldAndPublicGetter.kt test:

    Expect-actual matcher doesn't match fields in K2 https://youtrack.jetbrains.com/issue/KT-63667 => green code

    > The /compiler/testData/diagnostics/tests/multiplatform/actualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker/injectContextReceiverOverload.kt test:

    Context receivers are not supported in expect-actual matcher. https://youtrack.jetbrains.com/issue/KT-61447
    And K2 reports another error right now anyway
2024-01-10 08:08:42 +00:00
Stanislav Ruban 13b3987aab Prepare test data for removal of separate test configurations for JDK 21
^KT-58765

Now that JDK 21 was released as stable, we can remove separate test
configurations for testing the compiler with JDK 21 and reintegrate
the corresponding test data into standard test configurations.
2024-01-09 18:45:58 +00:00
Denis.Zharkov f831e11b4a Minor. Refine type parameters' naming in diagnostic test data
Using different names is more convenient for debugging
2024-01-09 18:03:05 +00:00
Pavel Kunyavskiy 9374cacdd6 [IrActualizer] Don't actualize expect types
This was never semantically correct, but was not important
before KT-63644, as they were immediately dropped after that anyway.

After KT-63644, they were used to compute fake overrides inside them,
which were later matched against actual class, which can
produce false-positive matching errors.

^KT-64835
2024-01-09 17:53:06 +00:00
Alexander Udalov 70cfd34a7b Tests: minor, change test mute reason to KT-64432 2024-01-09 16:19:14 +00:00
Vladimir Sukharev 943306f8fe [K/N][Tests] Restore inline modifier in t59.kt test
^KT-61259
2024-01-09 14:17:47 +00:00
Vladimir Sukharev 7eb239c282 [K/N][Tests] Move objCActionFqName to NativeStandardInteropNames
^KT-61259
2024-01-09 14:17:47 +00:00
Vladimir Sukharev 28ee61c57d [K/N] Add diagnostic directives to test sources
^KT-61564
2024-01-09 14:17:47 +00:00
Vladimir Sukharev dbba6d09ff [K/N] Implement FirNativeObjCOverrideInitChecker
^KT-61564
2024-01-09 14:17:47 +00:00
Vladimir Sukharev c5aed2b094 [K/N] Implement FirNativeObjCOutletChecker and FirNativeObjCActionChecker
^KT-61564
2024-01-09 14:17:47 +00:00
Vladimir Sukharev 08bc0a6bd0 [K/N] Adjust moved special backend checks tests
^KT-61564
2024-01-09 14:17:47 +00:00
Vladimir Sukharev 8f12bf6cc8 [K/N] Move special backend checks test sources to diagnostic tests folder
^KT-61564
2024-01-09 14:17:47 +00:00
Vladimir Sukharev 3d0a91bf3c [K/N][tests] Ignore test redundant_safepoints.kt under linux_x64
^KT-64844
2024-01-09 13:42:18 +00:00
Dmitriy Dolovov dcf1c7e61d [KLIB] API 4 ABI: Fail with adequate errors on non-existing/malformed KLIBs
^KT-64395
2024-01-09 13:10:24 +00:00
Nikolay Lunyak dd85a81d45 [FIR] Add a minimized alternative for orOperatorWithConstant.kt
It was decided to leave this code as is, because supporting
it would probably require introducing Implication-statements,
but this is not a good-enough use-case for such work.
2024-01-09 10:47:14 +00:00
Nikolay Lunyak f52648af5f [FIR] Support CHECK_TYPE in K2 JS tests
^KT-60056
2024-01-09 10:47:13 +00:00
Nikolay Lunyak 69fba8d33b [FIR] Make captureFromTypeParameterUpperBoundIfNeeded smarter
Before this change `ARGUMENT_TYPE_MISMATCH` would complain that
`Y` "is not a subtype of" `Inv<Y>`, because the function would only
check immediate bounds of the type parameter `Y`. `chosenSupertype`
would be `X`, not `Inv<out kotlin/String>`.

^KT-60056
2024-01-09 10:47:13 +00:00
Nikolay Lunyak 5e1e8e8f61 [FIR] Highlight the weirdness of one test
The thing is, in a box test there is a proper
`UNRESOLVED_REFERENCE` on `M2().a.m2()` in K1 as well,
but it's not present in diagnostic tests. And also,
there's no error in the Kotlin IntelliJ plugin when
viewing such code.

It looks dangerous, but since this code is about
classes with identical fqNames, and since nothing
sus is really compiled, we can probably ignore this
problem. It's unlikely that it impacts much.
2024-01-09 10:47:13 +00:00
Nikolay Lunyak e4781d8508 [FIR] Fix FP UNRESOLVED_REFERENCE on implicit invoke() after a safe call
`invoke()` function of functional types is always defined
in such a way that its explicit receiver comes as the first
value parameter. Extension-function types contain the very
same `invoke` function, they just additionally have the
`@ExtensionFunctionType` annotation.

In the related test there is such an `invoke` function and
in the presented call its explicit receiver is the anonymous
function `fun Int.() = 1` itself. So the safe-checked `1`

^KT-60056
2024-01-09 10:47:13 +00:00
Nikolay Lunyak 502b422b6b [FIR] Ensure KT-62814 is not reproducible
^KT-62814 Obsolete
2024-01-09 10:44:35 +00:00
Alexander Udalov d08c9ba222 JVM IR: transform fake override properties in SAM adapters
Replace every property with its getter and setter. This is needed
because later on, JVM backend assumes that all properties have been
lowered (by JvmPropertiesLowering) to this state.

 #KT-64116 Fixed
2024-01-08 21:31:13 +00:00
Mikhail Glukhikh c2d031254c K2/MPP: add test confirming proper work of KT-62024
#KT-62024 Obsolete
2024-01-08 17:16:22 +00:00
Kirill Rakhman 50bfd19959 [FIR] Remove usage of FirSamResolver in call conflict resolution
#KT-63703 Fixed
2024-01-08 15:31:08 +00:00
Alexander Korepanov b33798d65a [FIR2IR] Set proper offsets for generated data class members
^KT-64435 Fixed
2024-01-08 12:38:37 +00:00
Alexander Korepanov 6556acabba [JS FIR] Enable FIR JS stepping tests
^KT-64422 Fixed
2024-01-08 12:38:37 +00:00
Vladimir Sukharev 35e5b0613d [K/N] Migrate filecheck test redundant_safepoints to new infra
^KT-62157
2024-01-08 08:59:24 +00:00
Mikhail Glukhikh 050d74a22e FE: fix PlainJavaClassifierType.isRaw (take inner classes into account)
#KT-64090 Fixed
2024-01-08 08:33:03 +00:00
Mikhail Glukhikh d5b784805b K2: add tests for KT-58579 and for KT-64090 reproduction 2024-01-08 08:33:03 +00:00
Pavel Kunyavskiy f45d92eebc [K/N, K/JS, K/WASM] Enable FakeOverrideRebuilder by default
While not beeing final solution, this is closer to what
we want to have in the end. Enabling on non-JVM targets
would help better testing.

Enabling in JVM is now not possible yet, as some of the bugs are
not fixed yet (check KT-61360 for details)

^KT-62476
2024-01-08 07:46:07 +00:00
Pavel Kunyavskiy c6e32571d6 [FakeOverrideBuilder] Workaround KT-64743
Because of KT-64743 there is unexpanded type-alias in a place we don't
expect it to occur. To workaround this, we just expand typialiases in
one more place.

^KT-64743
2024-01-08 07:46:07 +00:00
Ivan Kochurkin 1f0fb5a1a8 [FIR] Check for ConeErrorType in doUnify to prevent endless recursion
^KT-64625 Fixed
2024-01-05 19:21:10 +00:00
Artem Kobzar 567433cc12 [K/Wasm, K/JS] Unmute explicit backing fields tests 2024-01-05 17:27:31 +00:00