Commit Graph

41 Commits

Author SHA1 Message Date
Nikolay Lunyak 76ed5453b3 [FIR] Report all Visibilities.Unknown in FirOverrideChecker
Check all members for `Visibility.Unknown`,
otherwise we miss them when they come
from supertypes. This is the reason why
the FP intellij build failed with a
cryptic stacktrace instead of a
human-readable diagnostic.

Also, do report the diagnostic at all
cases of `Visibilities.Unknown`. Turns
out, there are no "simple to reason
about" situations here :(

Also, an interesting detail:
`retrieveDirectOverriddenOf` returns an
empty list for intersection overrides.
But this doesn't seem to break anything...

Replacing `CANNOT_INFER_VISIBILITY`'s
type `KtDeclaration` with
`PsiNameIdentifierOwner` and the related
changes in `PositioningStrategies`
were needed to prevent an exception saying that
`PsiClassImpl` is not a subtype of
`KtDeclaration`.
2024-02-21 20:24:13 +00:00
Kirill Rakhman f231338cd6 [FIR] Render list of symbols with linebreaks as separators
#KT-61823 Fixed
2024-02-21 12:25:22 +00:00
Nikolay Lunyak 3b5fff5473 [FIR] Don't copy VP default values for fake overrides
In general, overrides should not
contain default values, and it's
better to make fake overrides be close
to proper overrides as much as
possible. It will be important when
we begin running `FirOverrideChecker`
for fake overrides.

^KT-63879 Fixed
^KT-65534
2024-02-15 16:10:13 +00:00
Kirill Rakhman 1626057f75 [FIR] Improve rendering of override related diagnostics
Render symbols completely and add containing declaration.
2024-01-31 11:16:50 +00:00
Kirill Rakhman 8f3f72d9c9 [FIR] Use correct type renderer in symbol rendering for diagnostics
#KT-62815 Fixed
2024-01-02 15:17:02 +00:00
Kirill Rakhman 81517a3d29 [FIR] Set targets of annotation classes in FirJavaElementFinder
#KT-60504 Fixed
2023-12-07 18:29:45 +00:00
Kirill Rakhman 2613a337ae [FIR] Improve symbol rendering in *_NOT_IMPLEMENTED diagnostics 2023-10-27 13:27:35 +00:00
Nikolay Lunyak bc2eb546b4 [FIR] Report conflicts for data class generated members
^KT-59880
2023-10-11 08:54:09 +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
Nikolay Lunyak 8755cf75ac [FIR] Improve the messages of the multiple defaults diagnostics
Mention the base functions where the default
values come from.
2023-09-21 07:48:30 +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
Nikolay Lunyak 3f1bf6112f [FIR] Report MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES
Reporting it for `VIRTUAL_MEMBER_HIDDEN`
is ok, because `VIRTUAL_MEMBER_HIDDEN`
has always been an error, so we are
allowed to treat these as overrides
implicitly.

^KT-59408 Fixed
^KT-59419 Fixed
^KT-57076 Fixed
2023-08-28 10:57:40 +00:00
Nikolay Lunyak dc9ed5656e [FIR] Revert FirMultipleDefaultsInheritedFromSupertypesChecker
It's possible to write a fix that
would prevent false positives with
this checker, but the core
intuition behind it is invalid.

This checker assumes that it's
enough to only check direct
overriddens, while in reality
even simple `Source` override
functions are not allowed to
contain default values, so they
can't be used to make judgements
about them.

^KT-59408 Open
^KT-59408 Open

^KT-61095 Fixed
^KT-61165 Fixed
^KT-61029 Fixed
2023-08-17 13:55:19 +00:00
Nikolay Lunyak 61448531cb [FIR] Support MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES
^KT-59408 Fixed
2023-08-04 11:20:39 +00:00
Dmitrii Gridin 4366164b65 [FIR] ConeAttributes: fix plus method
The 'plus' method was actually creating a new 'ConeAttributes' with
only one new attribute due to a typo inside 'buildList'

^KT-60451
^KT-60504
2023-07-19 10:40:03 +00:00
Mikhail Glukhikh c839cd3c11 K2: don't use debugging type renderer in error messages 2023-07-13 09:07:39 +00:00
Nikolay Lunyak f644eb7988 [FIR JS] Implement FirJsExportDeclarationChecker 2023-03-29 08:51:48 +03: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
Ilya Kirillov 644d1bf0d0 [FIR] ignore tests which fail because of resolve contracts violation 2022-12-12 16:21:07 +00:00
Jinseong Jeon a2da690afd Test: add java source files as JavaSourceRoot
so that those can be properly populated in SingleJavaRootsIndex
2022-06-16 22:14:17 +02:00
Mikhail Glukhikh 3f8734f694 FIR: determine synthetic accessor modality more precisely
Related to KT-47542
2021-08-24 12:32:30 +03:00
Mikhail Glukhikh bbb76aae3f Provide more precise check for ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED
#KT-47542 Fixed
2021-08-24 12:32:30 +03:00
Andrey Zinovyev b44785c24e [FIR] NOTHING_TO_OVERRIDE diagnostic 2021-07-08 18:13:47 +03:00
Andrey Zinovyev 3f7d050f8f [FIR] Implement CONFLICTING_INHERITED_MEMBERS diagnostic 2021-07-08 18:13:44 +03:00
Denis.Zharkov ddbdfafa79 Remove OI/NI attributes from test data 2021-05-25 13:28:27 +03:00
Denis.Zharkov 2ecba6ac39 Remove WITH_NEW_INFERENCE directive from all tests
This directive anyway does not make test run twice with OI, and with NI
It only once run the test with specific settings (// LANGUAGE)
and ignores irrelevant (OI or NI tags)
2021-05-25 13:28:26 +03:00
Ivan Kochurkin ad9b962536 [FIR] Fix tests (ARGUMENT_TYPE_MISMATCH instead of INCOMPATIBLE_CANDIDATE) 2021-04-12 23:49:55 +03:00
Tianyu Geng 761a0a7d0d FIR checkers: report specific errors instead of INAPPLICABLE_CANDIDATE
Specifically, the report the following 4 errors.

* NON_VARARG_SPREAD
* ARGUMENT_PASSED_TWICE
* TOO_MANY_ARGUMENTS
* NO_VALUE_FOR_PARAMETER

Also added/updated the following position strategies.
* NAME_OF_NAMED_ARGUMENT
* VALUE_ARGUMENTS
2021-04-02 14:36:14 +03:00
Mikhail Glukhikh 566dc434cc FIR: introduce MANY_*_MEMBER_NOT_IMPLEMENTED diagnostic 2021-04-02 10:24:20 +03:00
Dmitriy Novozhilov cd890d5833 [Test] Disable UNUSED_* diagnostics in tests which are not belong to contolFlowAnalysis suite 2021-03-29 16:12:29 +03:00
Dmitriy Novozhilov 85949b387e [Test] Explicitly enable UNUSED_* diagnostics in tests which are not belong to contolFlowAnalysis suite 2021-03-29 16:12:28 +03:00
Tianyu Geng e1c80ac75c FIR checker: introduce NO_(GET|SET)_METHOD
Besides introducing new diagnostics, this commit unifies source usages
for array accesses in PSI & LT.
2021-03-24 16:25:01 +03:00
Mikhail Glukhikh 9ce8420491 FIR: introduce not implemented checker 2021-03-24 16:07:25 +03:00
Jinseong Jeon 3a07ca4c64 FIR checker: add diagnostic VAR_OVERRIDDEN_BY_VAL 2021-02-03 12:07:36 +03:00
Dmitriy Novozhilov e6b5cb5216 [TD] Update diagnostics test data due to new test runners
Update includes:
- Changing syntax of `OI/`NI` tags from `<!NI;TAG!>` to `<!TAG{NI}!>`
- Fix some incorrect directives
- Change order of diagnostics in some places
- Remove ignored diagnostics from FIR test data (previously `DIAGNOSTICS` didn't work)
- Update FIR dumps in some places and add `FIR_IDENTICAL` if needed
- Replace all JAVAC_SKIP with SKIP_JAVAC directive
2020-12-16 19:52:25 +03:00
Mikhail Glukhikh 4605a65f41 [FIR] Good test data fixes (around captured types) 2020-09-14 17:56:39 +03:00
Nick 61e21dadec [FIR] Add 3 type mismatch diagnostics 2020-08-24 11:06:12 +03:00
FenstonSingel b7d8e879a6 [FIR] Support 4 diagnostics for pairs of modifiers
In particular, this commit includes:
* Attempt to abstract access to FirSourceElement via FirModifier
* Add more visit functions to DeclarationCheckersDiagnosticComponent
* Add messages+factories for 4 modifier-related errors and warnings
* Introduce FirModifierChecker
2020-03-27 12:34:29 +03:00
Dmitriy Novozhilov 2536fa0cd5 [FIR-TEST] Add new testdata generated after changes in previous commit 2019-12-12 16:11:46 +03:00
Pavel Kirpichenkov 87b88a738e [Minor] Update test data for NI 2019-10-25 19:37:06 +03:00
Pavel Kirpichenkov b7e5d9faae Update annotation rendering in diagnostics
Disable annotation rendering in default type and descriptor renderers.
Preserve annotations in Android and Serialization plugins.
Update error texts in ide tests.
Nullability annotations in Java descriptors are rendered with context-dependent renderer.

#KT-20258 Fixed
2019-10-04 11:18:45 +03:00