[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`.
This commit is contained in:
committed by
Space Team
parent
053eb07692
commit
76ed5453b3
+17
@@ -0,0 +1,17 @@
|
||||
package d
|
||||
|
||||
interface A {
|
||||
fun foo() = 1
|
||||
}
|
||||
|
||||
interface B {
|
||||
fun foo() = 2
|
||||
}
|
||||
|
||||
open <!CANNOT_INFER_VISIBILITY, MANY_INTERFACES_MEMBER_NOT_IMPLEMENTED!>class C<!> : A, B {}
|
||||
|
||||
interface E {
|
||||
fun foo(): Int
|
||||
}
|
||||
|
||||
<!CANNOT_INFER_VISIBILITY!>class D<!> : C() {}
|
||||
Reference in New Issue
Block a user