Commit Graph

110 Commits

Author SHA1 Message Date
Anastasia.Nekrasova 97ef2de6e3 [K2] OPT_IN_USAGE_ERROR is absent when calling the enum primary constructor
^KT-63459
2023-11-23 13:16:05 +00:00
Anastasia.Nekrasova c6d391c632 [K2] OPT_IN_MARKER_CAN_ONLY_BE_USED_AS_ANNOTATION_OR_ARGUMENT_IN_OPT_IN on an annotation import
Only tests added

^KT-59582
2023-11-23 13:14:42 +00:00
Mikhail Glukhikh a2dc4f155f K2: drop obsolete TODO about multiple WasExperimental
In certain situations like constructor calls, it's possible
to have different WasExperimental/SinceKotlin pairs associated
with one use-site, e.g. a constructor call is associated both
with a constructor declaration and a class declaration.
However, looks like it make no sense to handle this situation
in FirSinceKotlinHelpers, because FirOptInUsageBaseChecker already
handles them.

#KT-59825 Fixed
2023-11-15 09:36:06 +00:00
Anastasia.Nekrasova 93ebd83ecd [K2] Disappeared OPT_IN_MARKER_CAN_ONLY_BE_USED_AS_ANNOTATION_OR_ARGUMENT_IN_OPT_IN (4)
Added checking usages of markers as qualifiers in properties and function calls.

^KT-59998
2023-11-07 13:12:46 +00:00
Anastasia.Nekrasova 72d69e16c4 [K2] Disappeared OPT_IN_MARKER_CAN_ONLY_BE_USED_AS_ANNOTATION_OR_ARGUMENT_IN_OPT_IN (3)
Added checking usages of markers as qualifiers in imports.

^KT-59998
2023-11-07 13:12:46 +00:00
Anastasia.Nekrasova 97f09acc92 [K2] Disappeared OPT_IN_MARKER_CAN_ONLY_BE_USED_AS_ANNOTATION_OR_ARGUMENT_IN_OPT_IN (2)
Added checking usages of markers as qualifiers.

KT-59998
2023-11-07 13:12:46 +00:00
Anastasia.Nekrasova 445ed7abc9 [K2] Disappeared OPT_IN_MARKER_CAN_ONLY_BE_USED_AS_ANNOTATION_OR_ARGUMENT_IN_OPT_IN (1)
Added error propagation for the type-aliased type.

^KT-59998
2023-11-07 13:12:46 +00:00
Dmitrii Gridin 2f8026f335 [LL FIR] add missed diagnostic tests for scripts
^KT-62840
^KT-62841
^KT-62861
2023-10-24 19:32:54 +00:00
Alejandro Serrano Mena b231e69cd3 Remove unneeded K1/K2 split in test 2023-10-18 12:34:58 +00:00
Alejandro Serrano Mena b9b15cba08 [K2] Warn about deprecation and opt-in markers for overrides of Any
^KT-62620 Fixed

Include opt-in markers in the diagnostics
2023-10-18 12:34:58 +00:00
Anastasia.Nekrasova 9ad4cf4c55 [K2] Disappeared OPT_IN_USAGE_ERROR for a data class property during the destructuring declaration
^KT-62450
2023-10-17 21:27:13 +00:00
Anastasia.Nekrasova 4c9ad970ff [K2] Violation of OPT_IN_USAGE_ERROR non-propagating opt-in rules for typealias
^KT-62451
2023-10-12 09:03:39 +00:00
Anastasia.Nekrasova 6d446abe12 [K2] Disappeared OPT_IN_USAGE_ERROR for typealias
^KT-62451
2023-10-12 09:03:39 +00:00
Kirill Rakhman 411210b520 [RAW FIR] Use range as source of desugared loop-related statements 2023-08-31 10:19:33 +00:00
Stanislav Ruban e6d5df18b8 [tests] Add new (and refactor existing) tests for @SubclassOptInRequired
KT-54617
2023-05-23 12:33:51 +00:00
Dmitrii Gridin 72def186a3 [LL FIR] rework transformers, so transformers resolve only a specific set of declarations
The change is needed for the parallel resolution (^KT-55750), so we can resolve the declaration
under a lock that is specific to this declaration.
Previously, if LL FIR was resolving some FirClass, LL FIR  resolved all its children too, and it had no control over what parts of the FIR tree were modified.
The same applied to the designation path, sometimes the classes on the designation path
might be unexpectedly (and without lock) modified.

This commit introduces LLFirResolveTarget, which specifies which exact declarations should be resolved during the lazy resolution of the declaration.
All elements outside the declarations specified for resolve in LLFirResolveTarget, should not be modified.

The logic of lazy transformers is the following:
- Go to target declaration collecting all scopes from the file and containing classes
- Resolve only declarations that are specified by the LLFirResolveTarget, performing the resolve under a separate lock for each declaration

^KT-56543
^KT-57619 Fixed
2023-04-19 20:12:38 +00:00
Dmitrii Gridin 9a4a3d1f49 [LL FIR] introduce test with reversed resolve order
^KT-56543

Merge-request: KT-MR-9299
Merged-by: Dmitrii Gridin <dmitry.gridin@jetbrains.com>
2023-03-22 17:34:07 +00:00
Kirill Rakhman fbc0796ed2 [FIR] Accept opt-in annotations on primary ctor params of properties
For backward compatibility with K1.

KT-56177
2023-02-28 10:19:20 +00:00
Kirill Rakhman 9dda5e4fcd [Test] Remove redundant FIR_DISABLE_LAZY_RESOLVE_CHECKS directives
KT-56177
2023-02-28 10:19:18 +00:00
Kirill Rakhman eee66ab43f [FIR] Remove duplicate annotations from primary ctor params/properties
If an annotation doesn't specify an explicit use-site target,
previously it was added to both, the primary constructor value parameter
and the property in the FIR. Then, in FIR2IR, only the "correct" one was
added to the IR. Move up the deduplication logic into the frontend.

^KT-56177 Fixed
2023-02-28 10:19:17 +00:00
Ilya Kirillov 1bbcae5ed2 [FIR] fix resolve contract violation from scopes
We cannot call lazy resolve to STATUS phase from scopes as scopes may be accessed on a STATUS phase or earlier

^KT-54890
^KTIJ-23587 fixed
2023-01-13 21:32:51 +00:00
Kirill Rakhman 69f2e8826a FIR: fix a bunch of issues after DiagnosticsReporter refactoring related to reporting diagnostic on null source 2023-01-11 08:30:36 +00:00
Steven Schäfer 6af616d3c3 FIR: make declarations marked with 'override' implicitly open
#KT-52236 Fixed
2022-12-14 21:46:41 +00:00
Ilya Kirillov 644d1bf0d0 [FIR] ignore tests which fail because of resolve contracts violation 2022-12-12 16:21:07 +00:00
Mikhail Glukhikh 3e22f6c052 K2 opt-in: fix reporting of WasExperimental-bound errors 2022-11-23 12:00:08 +00:00
Mikhail Glukhikh f62bdb0e3d K1 opt-in: fix message/behavior for future error with WasExperimental 2022-11-23 12:00:08 +00:00
Mikhail Glukhikh 8ddc535caf Opt-in: forbid/deprecate constructor call with default arguments under marker
#KT-55074 Fixed
2022-11-23 12:00:07 +00:00
Mikhail Glukhikh b92ce68f32 K2 opt-in: restore marker annotation check for constructors 2022-11-23 12:00:07 +00:00
Mikhail Glukhikh a77750a257 K2 opt-in: drop redundant recursive check for overridables 2022-11-23 12:00:06 +00:00
Mikhail Glukhikh 73cb4d1a6e K2 opt-in: don't take sub./int. override parent classes into account
#KT-54823 Fixed
2022-11-23 12:00:04 +00:00
Vsevolod Tolstopyatov 22e26d0756 Move EnumEntries LVS to 1.9
* Also cleanup tests to avoid using obsolete WITH_RUNTIME
2022-08-12 09:35:32 +00:00
Mikhail Glukhikh 81e1131441 SubclassOptInRequired: add extra test about inheritance and superseding 2022-08-11 14:05:09 +00:00
Mikhail Glukhikh 80a9f22052 Add applicability checks & tests for SubclassOptInRequired 2022-08-11 14:05:09 +00:00
Mikhail Glukhikh 76aaecbdf0 Add/fix extra cases for #KT-41886 Fixed 2022-08-11 14:05:08 +00:00
Mikhail Glukhikh 7d3368da58 K2: report errors related to SubClassOptInRequired annotation
Related to KT-41886
2022-08-11 14:05:08 +00:00
Mikhail Glukhikh c67c5cad27 K1: report errors related to SubClassOptInRequired annotation
Related to KT-41886
2022-08-11 14:05:07 +00:00
Mikhail Glukhikh 6fc27c22f4 K1:report warning on OptIn usages inside SAM constructor #KT-47708 Fixed 2022-06-02 15:36:58 +00:00
Mikhail Glukhikh 6f17a8713c Fix KT-47708 in FIR by transferring SAM annotations to synthetic constr. 2022-05-24 12:29:28 +00:00
Mikhail Glukhikh 9bd6a9c069 FIR: handle 'SinceKotlin' as a special kind of deprecated
#KT-51850 Fixed
2022-04-06 12:51:20 +00:00
Mikhail Glukhikh 04e8e1b2ad Move file annotation resolve a bit earlier #KT-51499 Fixed 2022-04-04 12:51:34 +00:00
Mikhail Glukhikh 899dc401c8 Add test for KT-51499 (occurs in FE10, already fixed in FIR) 2022-04-04 12:51:33 +00:00
Mikhail Glukhikh 53d6ac24e5 Switch kotlin version to 1.7
* Change 1.6 to 1.7 constants
* Fix SAFE_CALL_WILL_CHANGE_NULLABILITY for testData
* Change EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_WARNING to EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR
* Change NON_EXHAUSTIVE_WHEN_STATEMENT to NO_ELSE_IN_WHEN
* Fix testData for SafeCallsAreAlwaysNullable
* Change T -> T & Any in test dumps
* Change INVALID_CHARACTERS_NATIVE_WARNING -> INVALID_CHARACTERS_NATIVE_ERROR
* TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_WARNING -> TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR
2022-02-25 11:46:27 +00:00
Mikhail Glukhikh c2f43dd98e Revert OPT_IN_MARKER_ON_OVERRIDE limitation #KT-48890 Fixed 2022-01-28 13:40:35 +00:00
Mikhail Glukhikh 7243d30869 Split property use-site targets during FIR building 2021-10-12 16:22:58 +03:00
Mikhail Glukhikh d3662b48a2 FIR: fix OPT_IN_MARKER_ON_WRONG_TARGET (setter via parameter case)
This commit fixes FIR bootstrap compilation
2021-09-30 14:58:14 +03:00
Mikhail Glukhikh 212c3e8d51 FIR: fix OPT_IN_MARKER_ON_WRONG_TARGET for constructor properties 2021-09-29 19:39:28 +03:00
Mikhail Glukhikh e9bff861dd FIR: report OPT_IN_MARKER_ON_OVERRIDE diagnostic
This diagnostic works in accordance with KT-45844 and KT-49002
2021-09-29 19:39:27 +03:00
Mikhail Glukhikh ac3b738d9b FIR: report OPT_IN_OVERRIDE(_ERROR) diagnostics 2021-09-29 19:39:25 +03:00
Mikhail Glukhikh 056f74a23b FE 1.0: allow OptIn marker on override if base class is marked
#KT-49002 Fixed
2021-09-29 19:39:24 +03:00
Mikhail Glukhikh a76aee9b69 FIR: spread OptIn markers to children except fake override case
This commit implements KT-49001 for FIR
2021-09-29 19:39:23 +03:00