Commit Graph

3 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
Mikhail Glukhikh e42c1be354 K2: use intersection scope override checker also in intersection scope
In more details, we use either platform override checker (if we came
from platform) or the combined intersection scope override checker
at this place. Also this commit fixes various places around
JavaOverrideChecker, allowing to apply it in intersection override
checker properly:
- don't consider return types in this place
- apply JavaOverrideChecker if at least one candidate is from Java
- compare type primitivity closer to K1 logic

#KT-62554 Fixed
Partially fixes KT-63242
2024-01-24 08:39:18 +00:00
Mikhail Glukhikh 676e350b6f K1/K2: add test to confirm behavior of KT-63243 2023-12-13 17:43:45 +00:00