[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
Vendored
+4
-4
@@ -10,8 +10,8 @@
|
||||
expect open class C1()
|
||||
expect interface I1
|
||||
|
||||
open <!MANY_IMPL_MEMBER_NOT_IMPLEMENTED!>class Common1_1<!> : C1(), I1
|
||||
open <!MANY_IMPL_MEMBER_NOT_IMPLEMENTED!>class Common1_2<!> : I1, C1()
|
||||
open <!CANNOT_INFER_VISIBILITY, MANY_IMPL_MEMBER_NOT_IMPLEMENTED!>class Common1_1<!> : C1(), I1
|
||||
open <!CANNOT_INFER_VISIBILITY, MANY_IMPL_MEMBER_NOT_IMPLEMENTED!>class Common1_2<!> : I1, C1()
|
||||
|
||||
expect open class Expect1_1 : C1, I1
|
||||
expect open class Expect1_2 : I1, C1
|
||||
@@ -37,8 +37,8 @@ actual interface I1 {
|
||||
fun f() {}
|
||||
}
|
||||
|
||||
actual open <!MANY_IMPL_MEMBER_NOT_IMPLEMENTED!>class Expect1_1<!> : C1(), I1
|
||||
actual open <!MANY_IMPL_MEMBER_NOT_IMPLEMENTED!>class Expect1_2<!> : I1, C1()
|
||||
actual open <!CANNOT_INFER_VISIBILITY, MANY_IMPL_MEMBER_NOT_IMPLEMENTED!>class Expect1_1<!> : C1(), I1
|
||||
actual open <!CANNOT_INFER_VISIBILITY, MANY_IMPL_MEMBER_NOT_IMPLEMENTED!>class Expect1_2<!> : I1, C1()
|
||||
|
||||
|
||||
actual abstract class C2 actual constructor() {
|
||||
|
||||
Vendored
+2
-2
@@ -11,9 +11,9 @@
|
||||
expect interface S1
|
||||
expect interface S2
|
||||
|
||||
open <!MANY_INTERFACES_MEMBER_NOT_IMPLEMENTED!>class A<!> : S1, S2
|
||||
open <!CANNOT_INFER_VISIBILITY, MANY_INTERFACES_MEMBER_NOT_IMPLEMENTED!>class A<!> : S1, S2
|
||||
|
||||
class B : A()
|
||||
<!CANNOT_INFER_VISIBILITY!>class B<!> : A()
|
||||
|
||||
// MODULE: jvm()()(common)
|
||||
// TARGET_PLATFORM: JVM
|
||||
|
||||
Reference in New Issue
Block a user