FIR: Refine visibility check for private methods defined in a class

- use-site should be contained within the class that owns callee symbol
- class-representative of dispatch receiver value
should be exactly the same as a container class of a callee (not its subtype)
This commit is contained in:
Denis.Zharkov
2022-05-27 16:02:31 +03:00
committed by teamcity
parent ddb140cc51
commit ccc32b4e3b
6 changed files with 61 additions and 57 deletions
@@ -0,0 +1,11 @@
// SKIP_TXT
abstract class A {
fun foo(b: B) {
b.<!INVISIBLE_REFERENCE!>prv<!>()
}
private fun prv() {}
}
abstract class B : A()
@@ -0,0 +1,11 @@
// SKIP_TXT
abstract class A {
fun foo(b: B) {
b.<!INVISIBLE_MEMBER!>prv<!>()
}
private fun prv() {}
}
abstract class B : A()