Commit Graph

18033 Commits

Author SHA1 Message Date
strangepleasures cf01d2970f [SLC] [KAPT] KT-61916 Fix generation of annotations in annotation arguments 2023-09-14 13:21:07 +00:00
Artem Kobzar 878452bd2b [K/JS] Implement file merging for clashed file during per-file compilation 2023-09-14 13:14:15 +00:00
Kirill Rakhman f0112040fc [FIR AA] Unmute passing test 2023-09-14 10:03:02 +00:00
Ivan Kylchik ede6eb0b34 [IR] Print exception's class in error message from interpreter 2023-09-14 08:47:06 +00:00
Ivan Kylchik 2df5b48474 [IR] Report error from IR interpreter on field recursive initialization
#KT-59890
#KT-61802 Fixed
2023-09-14 08:47:06 +00:00
Dmitrii Gridin 31b36ee766 [LL FIR] introduce lazyResolveRecursively API
FirFile after KT-56683 has its own phases and resolution logic,
so we should have a separate API for lazy resolution for FirFile and for
the entire file

^KT-61296 Fixed
2023-09-13 20:26:50 +00:00
Timofey Solonin 53584cdd49 Don't emit CAST_NEVER_SUCCEEDS when casting to a forward declaration type
^KT-58929
2023-09-13 17:49:12 +00:00
Timofey Solonin 28f90b3ea8 Add CAST_NEVER_SUCCEEDS diagnostic to forwardDeclarations.kt
Add safe as casts to forwardDeclarations.kt

^KT-58929
2023-09-13 17:49:12 +00:00
Nikolay Lunyak f719436d1f [FIR] Report top-level conflicts between TA constructors and funs
^KT-59880
2023-09-13 14:11:41 +00:00
Alexander Udalov 21d56d04d6 Tests: reclassify some failures in fake override rebuilder tests
See issues for more information: KT-61751, KT-61804, KT-61805, KT-61370.
2023-09-13 15:01:52 +02: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
Vladimir Sukharev 024fd9e21a [FIR JS] Don't raise diagnostic PROPERTY_AS_OPERATOR for dynamic types.
^KT-60043 Fixed


Merge-request: KT-MR-12161
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-09-13 12:58:15 +00:00
Alexander Korepanov be4f6beddb [JS Tests] Prepare JS tests for testing backend diagnostics
- Introducing a backend diagnostic handler.
 - Moving JS diagnostic tests from test-common to
   js.test to avoid circular module dependencies.

^KT-61886 Fixed
2023-09-13 12:19:15 +00:00
Mikhail Glukhikh ffd77850ef K2: add proper catch parameter annotation targeting
In this commit we begin counting a catch parameter as
both a local variable and a value parameter for the purpose
of annotation targeting.

#KT-61691 Fixed
2023-09-13 11:27:14 +00:00
Mikhail Glukhikh 91aa679214 K2: reproduce KT-61691 2023-09-13 11:27:14 +00:00
Nikolay Lunyak aacfc31c90 [FIR] Resolve the continuation type inside createSuspendView()
Normally such types are resolved during enhancement,
but creating the suspend view happens before
enhancement, so the type may have not been resolved.

^KT-59915 Fixed
2023-09-13 11:18:06 +00:00
Nikolay Lunyak 1467e743fd [FIR] Fix incorrect Java code in the test data
There's no point in eliminating K2 differences
between red code.

^KT-59915
2023-09-13 11:18:06 +00:00
Nikolay Lunyak 34cb9aa659 [FIR] Don't miss VIRTUAL_MEMBER_HIDDEN
^KT-59925 Fixed
2023-09-13 11:14:45 +00:00
Vladimir Sukharev bab00255dc [K/N, Tests] Add diagnostic tests for SUPER_CALL_WITH_DEFAULT_PARAMETERS
^KT-61572


Merge-request: KT-MR-11941
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-09-13 11:10:25 +00:00
Alexander Korepanov f07028959d [FIR JS] Add more tests for JS_NAME_CLASH diagnostic
^KT-61862 Related
2023-09-13 10:54:57 +00:00
Artem Kobzar 7bc521ab92 [K/JS] Reset exceptionState inside coroutines with a finally block ^KT-58685 Fixed 2023-09-12 15:18:16 +00:00
Kirill Rakhman 2bc25d4f6e [FIR] Properly check for visibility in FirTypeIntersectionScopeContext
This fixes a false positive OVERRIDING_FINAL_MEMBER caused by a
package-private member in a different package being added to the
list of overridden symbols. However, in Java, package-private members
from different packages are effectively like private members in that
they cannot be overridden.

#KT-61696 Fixed
2023-09-12 10:46:46 +00:00
Anastasia.Nekrasova eab6e9bb36 Added tests for all code samples from KT-60523, except 2.3.
Test for 2.3 sample must be added in the context of KT-61792.
2023-09-12 07:03:20 +00:00
Roman Efremov 2dae7ce6c1 [LT2FIR] Fix missing "expect" modifier on members of nested classes
For members of nested classes inside expect class
`classWrapper.hasExpect()` would be false, because it only reflects
modifiers of nested class itself and not aware of "expect" modifier
inherited from the parent class.
Fix is done in same way in PSI2FIR, see
`PsiRawFirBuilder.Visitor.toFirProperty`.

This fix now makes it possible to add test for functionality from
previous commit.

Review: KT-MR-12107

^KT-61784
2023-09-11 21:29:02 +00:00
Roman Efremov c6d7f15070 [FE] Fix checker of DEFAULT_ARGUMENTS_IN_EXPECT_WITH_ACTUAL_TYPEALIAS
...not reporting on companion object members as well as other
nested classes.

Annotation classes are accepted because this is how it already worked,
see other tests, for example `annotationsViaActualTypeAlias.kt`.

Test for nested annotation classes will be added in subsequent commit,
because it currently will fail in test
`TreeCompareTest.testCompareDiagnostics` because light-tree2fir
produces different tree due to a bug when converting properties
from expect primary constructor. See subsequent commit for a fix.

Review: KT-MR-12107

^KT-61784
2023-09-11 21:29:02 +00:00
Vladimir Sukharev e0e2a57e3d [K/N] Add filecheck tests for atomic intrinsics
https://youtrack.jetbrains.com/issue/KT-60514/Add-llvm-filecheck-tests-for-atomic-intrinsics

Merge-request: KT-MR-12067
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-09-11 21:28:34 +00:00
Dmitrii Gridin ecb808992d [SLC] add more tests on vararg
^KT-61422
2023-09-11 15:47:47 +00:00
Kirill Rakhman 2566dabfce [FIR] Report INVISIBLE_REFERENCE on the first unresolved qualifier
#KT-61719 Fixed
2023-09-11 14:23:55 +00: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
Kirill Rakhman 16ae83bde0 [FIR] Fix Java sealed class inheritors
This fixes NO_ELSE_IN_WHEN diagnostics when using java sealed
classes in an exhaustive when.

#KT-58216 Fixed
2023-09-11 07:37:37 +00:00
Mikhail Glukhikh 20cb075e56 K2: fix calculating property reference type in delegated setter
This commit is an accidentally forgotten part of the KT-61045 fix
#KT-61720 Fixed
2023-09-08 15:35:10 +00:00
Vladimir Sukharev 3e2c662b6b [FIR] Add testcases to throw class with unresolved parent.
^KT-60048 Fixed
2023-09-08 11:40:35 +00:00
Vladimir Sukharev 69b2e2c0ba [FIR] Don't diagnose MISSING_EXCEPTION_IN_THROWS_ON_SUSPEND in presence of unresolved class
^KT-60048 Fixed
2023-09-08 11:40:35 +00:00
Nikita Bobko 3c73331821 KMP: Put "prohibit actual typealias to special annotations" under the flag
^KT-61668 Fixed

Review: https://jetbrains.team/p/kt/reviews/12062/timeline
2023-09-08 10:51:43 +00:00
Nikita Bobko e742d43ee0 KMP: Put "prohibit expect/actual tailrec/external" under the flag
^KT-61668 Fixed

Review: https://jetbrains.team/p/kt/reviews/12062/timeline
2023-09-08 10:51:43 +00:00
Nikita Bobko 172c04c96a KMP: Put "prohibit expect actual OptIn annotations" under the flag
^KT-61668 Fixed

Review: https://jetbrains.team/p/kt/reviews/12062/timeline
2023-09-08 10:51:43 +00:00
Nikita Bobko 0922833b46 KMP: Put "prohbit actual typealias to Nothing and Nullable" under the flag
^KT-61668 Fixed

Review: https://jetbrains.team/p/kt/reviews/12062/timeline
2023-09-08 10:51:42 +00:00
Nikita Bobko 141bc9cac9 KMP: Put "prohbit actual typealias if expect has default params" under the flag
^KT-61668 Fixed

Review: https://jetbrains.team/p/kt/reviews/12062/timeline
2023-09-08 10:51:42 +00:00
Nikita Bobko 6868c95263 KMP: Put "prohbit expect/actual different annotations" under the flag
^KT-61668 Fixed

Review: https://jetbrains.team/p/kt/reviews/12062/timeline
2023-09-08 10:51:42 +00:00
Nikita Bobko 3a0c4d1087 KMP: Put "prohbit implicit Java actualization" under the flag
^KT-61668 Fixed

Review: https://jetbrains.team/p/kt/reviews/12062/timeline
2023-09-08 10:51:42 +00:00
Nikita Bobko 7667b36aa0 KMP: Put "prohibit member scope mismatch for non-final expect" under the flag
^KT-61668 Fixed

Review: https://jetbrains.team/p/kt/reviews/12062/timeline
2023-09-08 10:51:42 +00:00
Alexander Korepanov ea9e2eb41a [FIR JS] Add more tests for JS_NAME_CLASH and JS_FAKE_NAME_CLASH
^KT-59425 Related
^KT-59370 Related
2023-09-08 09:55:25 +00:00
Alexander Korepanov 6bb939c6cb [FIR JS] Support JS_NAME_CLASH and JS_FAKE_NAME_CLASH diagnostics
^KT-59425 Fixed
^KT-59370 Fixed
2023-09-08 09:55:25 +00:00
Kirill Rakhman 9a2307ad44 [FIR] Fix expression types in java annotations
#KT-61518 Fixed
2023-09-08 07:40:30 +00:00
Denis.Zharkov 034671ad78 K2: Update substituted member candidate if it contains type variables
See the comment at updateSubstitutedMemberIfReceiverContainsTypeVariable

It became necessary after delegate inference is rewritten, since before
that happened, stub types were being left there and FIR2IR handled
them accidentally properly because stub types are equal to anything.

But that wasn't really correct even there because stub types are not
intended to leak out of the FIR

^KT-61060
2023-09-08 07:11:48 +00:00
Denis.Zharkov 033ff38fef K2: Adjust diagnostic test data after delegate inference is rewritten
In all tests, some red-code diagnostics have changed insignificantly
to some other combination or red-code diagnostics

^KT-61060 Related
2023-09-08 07:11:48 +00:00
Denis.Zharkov a02cb16fb2 K2: Rewrite delegate inference
The main idea is getting rid of stub types and using just type variables
See more detailed description at docs/fir/delegated_property_inference.md

The problem with stub types is that they need really special treatment
in many places, and on the other hand, there are no clear contracts on
how they should work (that regularly leads to bugs like KT-59529)

^KT-61060 Fixed
^KT-61075 Fixed
^KT-61077 Fixed
^KT-59529 Fixed
^KT-61633 Related
^KT-61618 Related
^KT-61740 Related
^KT-59107 Related
^KT-61747 Related
^KT-61077 Related
^KT-61781 Related
2023-09-08 07:11:48 +00:00
Nikolay Lunyak f434228244 [FIR] Fix false positive POSITIONED_VALUE_ARGUMENT_FOR_JAVA_ANNOTATION
The original Java checker has an early return in
case of `resultingDescriptor !is JavaClassConstructorDescriptor`.
It fires if the descriptor is
`TypeAliasConstructorDescriptor`, thus further
diagnostics are not reported.
2023-09-07 13:48:22 +00:00
strangepleasures 88453a05f1 KT-53551 KT-52213 KT-58476 Fix handling of suspend functional types with context receivers 2023-09-07 12:40:01 +00:00
Anton Bannykh 002cd011d4 [JS] add CLI test for KT-60531 2023-09-07 08:21:34 +00:00