Commit Graph

879 Commits

Author SHA1 Message Date
Kirill Rakhman 2df1e9dde6 [FIR] Implement warnings for java nullability type mismatch on override
#KT-56989
2023-11-15 08:43:55 +00:00
Kirill Rakhman a6fdeeb7df [FIR] Implement warnings for java nullability type mismatch
#KT-56989
2023-11-15 08:43:55 +00:00
Kirill Rakhman 2613a337ae [FIR] Improve symbol rendering in *_NOT_IMPLEMENTED diagnostics 2023-10-27 13:27:35 +00:00
Nikolay Lunyak fedadfb8db [FIR] Show ARGUMENTS_MAPPING_ERROR diagnostics along with INAPPLICABLE
K1 reports `ARGUMENT_TYPE_MISMATCH`
and `TOO_MANY_ARGUMENTS` together, and
one way to do it in K2 is to say that
their kinds of inapplicability difference
is not relevant to the user.

Note that K1 doesn't do such filtering,
so this change "makes K2 closer to K1",
but still different.

^KT-62541 Fixed

fixup! [FIR] Show ARGUMENTS_MAPPING_ERROR diagnostics along with INAPPLICABLE
2023-10-19 09:27:45 +00:00
Mikhail Glukhikh 0fb4c9b4fe FIR2IR: generate specific sources for property accessors
Related to KT-60111
2023-10-13 15:42:58 +00:00
Nikolay Lunyak 41c3f98419 [FIR] Make resolution of classes in FirProvider more reasonable.
See the `privateInFile.fir.kt` test.
Type mismatches are simply confusing.

`inheritorOfExpectSealedClass.out`
reports unresolved reference probably
because now it resolves into the expect
declaration, rather than the actual one.
K1 doesn't report UNRESOLVED_REFERENCE
in this case. But this is red code
anyway. And this behavior still
depends on the order in which the compiler
receives both the declarations.

^KT-59927
^KT-62567
2023-10-13 11:56:54 +00:00
Brian Norman 365ce2a6a5 [FIR] Implement checker for missing dependency supertypes
#KT-60778 Fixed
2023-10-04 21:57:43 +00:00
Stanislav Erokhin 0cfa721585 [KMP] Remove experimental from -Xmulti-platform flag
#KT-61686
2023-10-04 18:19:35 +00:00
Dmitriy Dolovov 78a962f6d2 [KLIB] Deprecate -Xexpect-actual-linker CLI argument
This argument has been finally superseded by `-Xmetadata-klib`.

^KT-61136
2023-10-02 16:21:17 +00:00
Ilya Kirillov d98da87278 [FIR] Render dot-separated FQNs instead of slash-separated ones in diagnostics
^KT-62030 fixed
2023-09-22 10:48:31 +00:00
Kirill Rakhman 4e1dfcd2a8 [FIR] Improve readability of rendered types in diagnostics
#KT-61824 Fixed
#KT-61688 Fixed
2023-09-21 07:18:19 +00:00
Kirill Rakhman e996760e7e [FIR] Fix rendering of SUSPENSION_POINT_INSIDE_CRITICAL_SECTION
#KT-61826 Fixed
2023-09-21 07:18:19 +00:00
Kirill Rakhman ed4386a962 [FIR] Fix rendering of NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS 2023-09-21 07:18:19 +00:00
Dmitriy Dolovov 848c88b1a5 [KLIB] Lift up -Xmetadata-klib CLI key from Native to Common args
This is a precondition for obsoleting and finally removing
`-Xexpect-actual-linker` CLI key, which became useless since
the removal of ExpectActualTable.

^KT-61136
2023-09-20 22:26:36 +00:00
Mikhail Glukhikh 3e1f4c11dc LV 2.0: drop a duplicating CLI test 2023-09-19 15:46:30 +00:00
Mikhail Glukhikh 198aa675cc LV 2.0: add "not existing source path" test which uses K2 2023-09-19 15:46:30 +00:00
Mikhail Glukhikh e4b70e7788 LV 2.0: update some CLI tests with warnings to use DIVISION_BY_ZERO warning 2023-09-19 15:46:30 +00:00
Mikhail Glukhikh e5906a8a3a LV 2.0: remove CLI tests covering quite obsolete legacy 2023-09-19 15:46:30 +00:00
Ivan Kochurkin 30899e4bbf Remove CLI tests that become duplicated/unneeded after switching to 2.0 2023-09-19 15:46:30 +00:00
Mikhail Glukhikh 796b9287e2 LV 2.0: fix diagnostic text in CliTestGenerated$Jvm.testWrongAbiVersion 2023-09-19 15:46:29 +00:00
Ilya Chernikov 3dc1b26d83 Fix cli testdata for changed diagnostics in K2 2023-09-19 15:46:28 +00:00
Ilya Chernikov effb2f801d Fix cli testdata for the newly added warning suppression tests 2023-09-19 15:46:28 +00:00
Denis.Zharkov ea0d0097ba Fix testSelfUpperBoundInference test in LV 2.0 branch
The test starts failing after switching to 2.0 because we don't support
TypeInferenceOnCallsWithSelfTypes though it's planned (see KT-59012).

This particular test was introduced in 1.5.x (see KT-48026) to check
if the flag -Xself-upper-bound-inference actually enables
the feature TypeInferenceOnCallsWithSelfTypes.

While the feature is enabled by default since 1.6, it doesn't make sense
to have it with earlier versions.
Another solution would be removing it at all, but that might require
removing related code as well (as we would have some dead code in CLI
arguments processing).

^KT-60885 Fixed
2023-09-19 15:46:28 +00:00
Ilya Chernikov 9fed50c03b LV20: fix CliTestGenerated testdata for changed K2 error reporting 2023-09-19 15:46:28 +00:00
Ilya Chernikov e7ff1d4cd9 LV20: mute noStdLib test for K2 until the issue is resolved
K2 do not track builtins properly to provide appropriate
diagnostics yet
related to #KT-61033
2023-09-19 15:46:27 +00:00
Mikhail Glukhikh 101166c8a7 K2/CLI tests in LV 2.0: drop warnings related to KT-56989 2023-09-19 15:46:27 +00:00
Mikhail Glukhikh 2a8b655294 Update tests after switching to LV 2.0
Related to KT-59171
2023-09-19 15:46:27 +00:00
Alexander Udalov fd68b9f49c CLI: add -Xuse-ir-fake-override-builder
To be able to test IR fake override builder (KT-61514) outside of
compiler tests.
2023-09-13 15:01:52 +02:00
Nikita Bobko 2127b2ce68 expect/actual classes: experimental -> Beta
KT-61573
^KT-61712 Fixed
Review: https://jetbrains.team/p/kt/reviews/12044/files

It's a follow up commit

According our guidelines, it must be in Beta
https://kotlinlang.org/docs/components-stability.html#stability-of-subcomponents

And the whole multiplatform was in Beta, so we can't make part of the
multiplatform to have lower stability level
2023-09-11 13:57:28 +00:00
Anton Bannykh 002cd011d4 [JS] add CLI test for KT-60531 2023-09-07 08:21:34 +00:00
Nikita Bobko 01fc708a0f Mark expect/actual classifiers as experimental
^KT-61573 Fixed
Review: https://jetbrains.team/p/kt/reviews/11969/timeline

Tests:
- MultiPlatformIntegrationTestGenerated
- CliTestGenerated
- MultiPlatformIntegrationTestGenerated
- DiagnosticTestGenerated.Multiplatform
- FirLightTreeOldFrontendDiagnosticsTestGenerated

Also add -Xexpect-actual-classes flag to all necessary ./libraries/* modules
Otherwise compilation of those modules failes because of `-Werror`
2023-09-04 12:21:37 +00:00
Mikhail Glukhikh 6144ae7a6f Run CLI tests around EnumEntries not enabled with LV 1.9 2023-08-25 08:57:53 +00:00
Kirill Rakhman d0cc86f52c [Tests] Update test data after changes to FIR diagnostic messages 2023-08-21 16:28:48 +00:00
Kirill Rakhman 969c716c76 [FIR] Implement flag for disabling warning on error suppression
#KT-61129
2023-08-18 13:29:20 +00:00
Kirill Rakhman 09f895efe6 [FIR] Implement VERSION_REQUIREMENT_DEPRECATION diagnostics 2023-08-08 09:28:08 +00:00
Svyatoslav Kuzmich 47ade4530c [Wasm] Add compiler flag to disable exception handling proposal
Fail with unreachable instead of throwing an exception

Merge-request: KT-MR-11481
Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com>
2023-08-07 16:19:29 +00:00
Ilya Gorbunov 69a87efdd9 js.tests: change paths to kotlin-stdlib-js.klib
Change the expected klib name of stdlib

KT-56106
2023-08-03 14:47:20 +00:00
Alexander Udalov d4b5599373 Add JVM target bytecode version 21
Unfortunately, there are still problems with running JVM backend tests
with JVM target 21 because:

1) The D8 version that we use does not support bytecode version 21, and
   updating to a newer version requires to change JVM target of compiler
   tests to 11. This will be addressed separately when we enable JVM 21
   in tests-different-jdk.
2) Some tests are failing because of KT-60659 and KT-60770:
   - builtinStubMethods/bridgesForStubs/emptyStringListAdd.kt
   - jdk/stream.kt
   - regressions/kt528.kt

 #KT-60662 Fixed
2023-08-03 08:43:22 +00:00
Alexander Udalov 965946d3ef K2: report JVM backend errors in the same way in PSI as LT
Do not try to find PSI element, but always use the IR element offsets
instead. This greatly simplifies test data because we don't need to have
custom PSI- and LT- based diagnostic ranges in every test, and K1/K2
behavior also is mostly the same.

The exact offset ranges are not as important for backend diagnostics, so
it's better to have K2+PSI and K2+LT behaving the same.
2023-07-29 23:06:23 +00:00
Ilya Goncharov 1f9af4b452 [Gradle, JS] Fix cli tests for ir
KT-60495
2023-07-26 12:51:37 +00:00
Mikhail Glukhikh 95bf63d6cb K2: introduce OptIn language version checker
#KT-60598 Fixed
2023-07-24 12:50:38 +00:00
Mikhail Glukhikh 17da09bf17 K2: add ConeKotlinType argument for NULL_FOR_NONNULL_TYPE 2023-07-13 09:07:39 +00:00
Mikhail Glukhikh 9d9d7880af K2: render types in quotes in diagnostic messages 2023-07-13 09:07:39 +00:00
Igor Yakovlev 750653e4b3 [Wasm] Add kotlin wasm wasi mode compiler flag 2023-07-07 15:23:18 +00:00
Pavel Mikhailovskii 083f54aceb [KAPT4] Create basic infrastructure for KAPT4 2023-07-07 11:09:16 +00:00
Ilya Goncharov 148d8c9246 [Gradle, JS] Migrate JS cli tests to ir backend 2023-07-05 07:10:06 +00:00
Ivan Kylchik fba0bd79ad [K2] Don't crash compiler if receiver on property wasn't evaluated
Compilation crash must be handled separately in
`convertToConstantValues` method because we still want successfully
compile common code. All constants will be evaluated later on
fir2ir phase.

#KT-59362 Fixed
2023-06-27 08:51:39 +00:00
Artem Kobzar 64158a8a2f [K/JS] Add file-to-file compilation ^KT-6168 Fixed 2023-06-22 18:23:45 +00:00
Alexander Udalov 530f533c84 K2 CLI: minor, remove misleading warning
Light tree is used by default now, so it's no longer far from being
production-ready.
2023-06-21 14:16:43 +00:00
Kirill Rakhman 6a073e0b17 [FIR] Fix duplicate spaces in FirPartialModifierRenderer 2023-06-21 08:36:46 +00:00