FIR: Rewrite visibility checking

Unbound it from implicit receiver stack as it only needs scope structure/declaration nestedness
Semantics for protected has been changed in a way it works in old FE

NB: We should report additional diagnostic in case of CallCompanionProtectedNonStatic.fir.kt
(see KT-38814)
This commit is contained in:
Denis Zharkov
2020-05-06 16:10:32 +03:00
parent 825cdd3841
commit 687a58843f
9 changed files with 75 additions and 55 deletions
@@ -3,12 +3,12 @@ open class MyBase protected constructor() {
}
typealias MyAlias = MyBase
class MyDerived1 : <!INAPPLICABLE_CANDIDATE!>MyAlias<!>()
class MyDerived1 : MyAlias()
class MyDerived1a : MyBase()
class MyDerived2 : <!INAPPLICABLE_CANDIDATE!>MyAlias<!>(null)
class MyDerived2 : MyAlias(null)
class MyDerived2a : MyBase(null)
class MyDerived3 : MyAlias {
constructor(x: Nothing?) : <!INAPPLICABLE_CANDIDATE!>super<!>(x)
}
constructor(x: Nothing?) : super(x)
}