[IR][tests] Add cases to visibility-related tests where a visibility of an open callable in super class is narrowed

^KT-53608
This commit is contained in:
Dmitriy Dolovov
2022-09-15 10:43:23 +02:00
parent 15cf2bab98
commit ec4b85b111
8 changed files with 153 additions and 0 deletions
@@ -8,4 +8,18 @@ class ContainerImpl : Container() {
fun protectedToPublicFunctionAccess() = protectedToPublicFunction()
fun protectedToInternalFunctionAccess() = protectedToInternalFunction()
fun protectedToPrivateFunctionAccess() = protectedToPrivateFunction()
// Overridden functions with changed visibility:
override fun publicToProtectedOverriddenFunction() = "ContainerImpl.publicToProtectedOverriddenFunction"
override fun publicToInternalOverriddenFunction() = "ContainerImpl.publicToInternalOverriddenFunction"
override fun publicToPrivateOverriddenFunction() = "ContainerImpl.publicToPrivateOverriddenFunction"
override fun protectedToPublicOverriddenFunction() = "ContainerImpl.protectedToPublicOverriddenFunction"
override fun protectedToInternalOverriddenFunction() = "ContainerImpl.protectedToInternalOverriddenFunction"
override fun protectedToPrivateOverriddenFunction() = "ContainerImpl.protectedToPrivateOverriddenFunction"
// As far as protected members can't be accessed outside of the class hierarchy, we need special accessors.
fun protectedToPublicOverriddenFunctionAccess() = protectedToPublicOverriddenFunction()
fun protectedToInternalOverriddenFunctionAccess() = protectedToInternalOverriddenFunction()
fun protectedToPrivateOverriddenFunctionAccess() = protectedToPrivateOverriddenFunction()
}