diff --git a/compiler/testData/klibABI/changeFunctionVisibility/main/m.kt b/compiler/testData/klibABI/changeFunctionVisibility/main/m.kt index 01430df37cb..ba2b082fba5 100644 --- a/compiler/testData/klibABI/changeFunctionVisibility/main/m.kt +++ b/compiler/testData/klibABI/changeFunctionVisibility/main/m.kt @@ -1,29 +1,33 @@ import abitestutils.abiTest fun box() = abiTest { - val c = ContainerImpl() + val c = Container() + val ci = ContainerImpl() expectSuccess("publicToInternalTopLevelFunction.v2") { publicToInternalTopLevelFunction() } expectFailure(prefixed("function publicToPrivateTopLevelFunction can not be called")) { publicToPrivateTopLevelFunction() } expectSuccess("Container.publicToProtectedFunction.v2") { c.publicToProtectedFunction() } + expectSuccess("Container.publicToProtectedFunction.v2") { ci.publicToProtectedFunction() } expectFailure(prefixed("function publicToInternalFunction can not be called")) { c.publicToInternalFunction() } + expectFailure(prefixed("function publicToInternalFunction can not be called")) { ci.publicToInternalFunction() } expectFailure(prefixed("function publicToPrivateFunction can not be called")) { c.publicToPrivateFunction() } - expectSuccess("Container.publicToProtectedFunction.v2") { c.publicToProtectedFunctionAccess() } - expectFailure(prefixed("function publicToInternalFunction can not be called")) { c.publicToInternalFunctionAccess() } - expectFailure(prefixed("function publicToPrivateFunction can not be called")) { c.publicToPrivateFunctionAccess() } - expectSuccess("Container.protectedToPublicFunction.v2") { c.protectedToPublicFunctionAccess() } - expectFailure(prefixed("function protectedToInternalFunction can not be called")) { c.protectedToInternalFunctionAccess() } - expectFailure(prefixed("function protectedToPrivateFunction can not be called")) { c.protectedToPrivateFunctionAccess() } - expectSuccess("ContainerImpl.publicToProtectedOverriddenFunction") { c.publicToProtectedOverriddenFunction() } - expectSuccess("ContainerImpl.publicToInternalOverriddenFunction") { c.publicToInternalOverriddenFunction() } - expectSuccess("ContainerImpl.publicToPrivateOverriddenFunction") { c.publicToPrivateOverriddenFunction() } - expectSuccess("ContainerImpl.protectedToPublicOverriddenFunction") { c.protectedToPublicOverriddenFunctionAccess() } - expectSuccess("ContainerImpl.protectedToInternalOverriddenFunction") { c.protectedToInternalOverriddenFunctionAccess() } - expectSuccess("ContainerImpl.protectedToPrivateOverriddenFunction") { c.protectedToPrivateOverriddenFunctionAccess() } - expectSuccess("ContainerImpl.newPublicFunction") { c.newPublicFunction() } - expectSuccess("ContainerImpl.newOpenPublicFunction") { c.newOpenPublicFunction() } - expectSuccess("ContainerImpl.newProtectedFunction") { c.newProtectedFunctionAccess() } - expectSuccess("ContainerImpl.newOpenProtectedFunction") { c.newOpenProtectedFunctionAccess() } - expectSuccess("ContainerImpl.newInternalFunction") { c.newInternalFunctionAccess() } - expectSuccess("ContainerImpl.newOpenInternalFunction") { c.newOpenInternalFunctionAccess() } - expectSuccess("ContainerImpl.newPrivateFunction") { c.newPrivateFunctionAccess() } + expectFailure(prefixed("function publicToPrivateFunction can not be called")) { ci.publicToPrivateFunction() } + expectSuccess("Container.publicToProtectedFunction.v2") { ci.publicToProtectedFunctionAccess() } + expectFailure(prefixed("function publicToInternalFunction can not be called")) { ci.publicToInternalFunctionAccess() } + expectFailure(prefixed("function publicToPrivateFunction can not be called")) { ci.publicToPrivateFunctionAccess() } + expectSuccess("Container.protectedToPublicFunction.v2") { ci.protectedToPublicFunctionAccess() } + expectFailure(prefixed("function protectedToInternalFunction can not be called")) { ci.protectedToInternalFunctionAccess() } + expectFailure(prefixed("function protectedToPrivateFunction can not be called")) { ci.protectedToPrivateFunctionAccess() } + expectSuccess("ContainerImpl.publicToProtectedOverriddenFunction") { ci.publicToProtectedOverriddenFunction() } + expectSuccess("ContainerImpl.publicToInternalOverriddenFunction") { ci.publicToInternalOverriddenFunction() } + expectSuccess("ContainerImpl.publicToPrivateOverriddenFunction") { ci.publicToPrivateOverriddenFunction() } + expectSuccess("ContainerImpl.protectedToPublicOverriddenFunction") { ci.protectedToPublicOverriddenFunctionAccess() } + expectSuccess("ContainerImpl.protectedToInternalOverriddenFunction") { ci.protectedToInternalOverriddenFunctionAccess() } + expectSuccess("ContainerImpl.protectedToPrivateOverriddenFunction") { ci.protectedToPrivateOverriddenFunctionAccess() } + expectSuccess("ContainerImpl.newPublicFunction") { ci.newPublicFunction() } + expectSuccess("ContainerImpl.newOpenPublicFunction") { ci.newOpenPublicFunction() } + expectSuccess("ContainerImpl.newProtectedFunction") { ci.newProtectedFunctionAccess() } + expectSuccess("ContainerImpl.newOpenProtectedFunction") { ci.newOpenProtectedFunctionAccess() } + expectSuccess("ContainerImpl.newInternalFunction") { ci.newInternalFunctionAccess() } + expectSuccess("ContainerImpl.newOpenInternalFunction") { ci.newOpenInternalFunctionAccess() } + expectSuccess("ContainerImpl.newPrivateFunction") { ci.newPrivateFunctionAccess() } } diff --git a/compiler/testData/klibABI/changePropertyVisibility/main/m.kt b/compiler/testData/klibABI/changePropertyVisibility/main/m.kt index 4e8049c79a2..0c548071e87 100644 --- a/compiler/testData/klibABI/changePropertyVisibility/main/m.kt +++ b/compiler/testData/klibABI/changePropertyVisibility/main/m.kt @@ -1,75 +1,82 @@ import abitestutils.abiTest fun box() = abiTest { - val c = ContainerImpl() + val c = Container() + val ci = ContainerImpl() expectSuccess("publicToInternalTopLevelProperty1.v2") { publicToInternalTopLevelProperty1 } expectSuccess("publicToInternalTopLevelProperty2.v2") { publicToInternalTopLevelProperty2 } expectFailure(prefixed("property accessor publicToPrivateTopLevelProperty1. can not be called")) { publicToPrivateTopLevelProperty1 } expectFailure(prefixed("property accessor publicToPrivateTopLevelProperty2. can not be called")) { publicToPrivateTopLevelProperty2 } expectSuccess("Container.publicToProtectedProperty1.v2") { c.publicToProtectedProperty1 } + expectSuccess("Container.publicToProtectedProperty1.v2") { ci.publicToProtectedProperty1 } expectSuccess("Container.publicToProtectedProperty2.v2") { c.publicToProtectedProperty2 } + expectSuccess("Container.publicToProtectedProperty2.v2") { ci.publicToProtectedProperty2 } expectFailure(prefixed("property accessor publicToInternalProperty1. can not be called")) { c.publicToInternalProperty1 } + expectFailure(prefixed("property accessor publicToInternalProperty1. can not be called")) { ci.publicToInternalProperty1 } expectFailure(prefixed("property accessor publicToInternalProperty2. can not be called")) { c.publicToInternalProperty2 } + expectFailure(prefixed("property accessor publicToInternalProperty2. can not be called")) { ci.publicToInternalProperty2 } expectFailure(prefixed("property accessor publicToPrivateProperty1. can not be called")) { c.publicToPrivateProperty1 } + expectFailure(prefixed("property accessor publicToPrivateProperty1. can not be called")) { ci.publicToPrivateProperty1 } expectFailure(prefixed("property accessor publicToPrivateProperty2. can not be called")) { c.publicToPrivateProperty2 } - expectSuccess("Container.publicToProtectedProperty1.v2") { c.publicToProtectedProperty1Access() } - expectSuccess("Container.publicToProtectedProperty2.v2") { c.publicToProtectedProperty2Access() } - expectFailure(prefixed("property accessor publicToInternalProperty1. can not be called")) { c.publicToInternalProperty1Access() } - expectFailure(prefixed("property accessor publicToInternalProperty2. can not be called")) { c.publicToInternalProperty2Access() } - expectFailure(prefixed("property accessor publicToPrivateProperty1. can not be called")) { c.publicToPrivateProperty1Access() } - expectFailure(prefixed("property accessor publicToPrivateProperty2. can not be called")) { c.publicToPrivateProperty2Access() } - expectSuccess("Container.protectedToPublicProperty1.v2") { c.protectedToPublicProperty1Access() } - expectSuccess("Container.protectedToPublicProperty2.v2") { c.protectedToPublicProperty2Access() } - expectFailure(prefixed("property accessor protectedToInternalProperty1. can not be called")) { c.protectedToInternalProperty1Access() } - expectFailure(prefixed("property accessor protectedToInternalProperty2. can not be called")) { c.protectedToInternalProperty2Access() } - expectFailure(prefixed("property accessor protectedToPrivateProperty1. can not be called")) { c.protectedToPrivateProperty1Access() } - expectFailure(prefixed("property accessor protectedToPrivateProperty2. can not be called")) { c.protectedToPrivateProperty2Access() } - expectSuccess("ContainerImpl.publicToProtectedOverriddenProperty1") { c.publicToProtectedOverriddenProperty1 } - expectSuccess("ContainerImpl.publicToProtectedOverriddenProperty2") { c.publicToProtectedOverriddenProperty2 } - expectSuccess("ContainerImpl.publicToProtectedOverriddenProperty3") { c.publicToProtectedOverriddenProperty3 } - expectSuccess("ContainerImpl.publicToProtectedOverriddenProperty4") { c.publicToProtectedOverriddenProperty4 } - expectSuccess("ContainerImpl.publicToInternalOverriddenProperty1") { c.publicToInternalOverriddenProperty1 } - expectSuccess("ContainerImpl.publicToInternalOverriddenProperty2") { c.publicToInternalOverriddenProperty2 } - expectSuccess("ContainerImpl.publicToInternalOverriddenProperty3") { c.publicToInternalOverriddenProperty3 } - expectSuccess("ContainerImpl.publicToInternalOverriddenProperty4") { c.publicToInternalOverriddenProperty4 } - expectSuccess("ContainerImpl.publicToPrivateOverriddenProperty1") { c.publicToPrivateOverriddenProperty1 } - expectSuccess("ContainerImpl.publicToPrivateOverriddenProperty2") { c.publicToPrivateOverriddenProperty2 } - expectSuccess("ContainerImpl.publicToPrivateOverriddenProperty3") { c.publicToPrivateOverriddenProperty3 } - expectSuccess("ContainerImpl.publicToPrivateOverriddenProperty4") { c.publicToPrivateOverriddenProperty4 } - expectSuccess("ContainerImpl.protectedToPublicOverriddenProperty1") { c.protectedToPublicOverriddenProperty1Access() } - expectSuccess("ContainerImpl.protectedToPublicOverriddenProperty2") { c.protectedToPublicOverriddenProperty2Access() } - expectSuccess("ContainerImpl.protectedToPublicOverriddenProperty3") { c.protectedToPublicOverriddenProperty3Access() } - expectSuccess("ContainerImpl.protectedToPublicOverriddenProperty4") { c.protectedToPublicOverriddenProperty4Access() } - expectSuccess("ContainerImpl.protectedToInternalOverriddenProperty1") { c.protectedToInternalOverriddenProperty1Access() } - expectSuccess("ContainerImpl.protectedToInternalOverriddenProperty2") { c.protectedToInternalOverriddenProperty2Access() } - expectSuccess("ContainerImpl.protectedToInternalOverriddenProperty3") { c.protectedToInternalOverriddenProperty3Access() } - expectSuccess("ContainerImpl.protectedToInternalOverriddenProperty4") { c.protectedToInternalOverriddenProperty4Access() } - expectSuccess("ContainerImpl.protectedToPrivateOverriddenProperty1") { c.protectedToPrivateOverriddenProperty1Access() } - expectSuccess("ContainerImpl.protectedToPrivateOverriddenProperty2") { c.protectedToPrivateOverriddenProperty2Access() } - expectSuccess("ContainerImpl.protectedToPrivateOverriddenProperty3") { c.protectedToPrivateOverriddenProperty3Access() } - expectSuccess("ContainerImpl.protectedToPrivateOverriddenProperty4") { c.protectedToPrivateOverriddenProperty4Access() } - expectSuccess("ContainerImpl.newPublicProperty1") { c.newPublicProperty1 } - expectSuccess("ContainerImpl.newPublicProperty2") { c.newPublicProperty2 } - expectSuccess("ContainerImpl.newPublicProperty3") { c.newPublicProperty3 } - expectSuccess("ContainerImpl.newPublicProperty4") { c.newPublicProperty4 } - expectSuccess("ContainerImpl.newProtectedProperty1") { c.newProtectedProperty1Access() } - expectSuccess("ContainerImpl.newProtectedProperty2") { c.newProtectedProperty2Access() } - expectSuccess("ContainerImpl.newProtectedProperty3") { c.newProtectedProperty3Access() } - expectSuccess("ContainerImpl.newProtectedProperty4") { c.newProtectedProperty4Access() } - expectSuccess("ContainerImpl.newOpenProtectedProperty1") { c.newOpenProtectedProperty1Access() } - expectSuccess("ContainerImpl.newOpenProtectedProperty2") { c.newOpenProtectedProperty2Access() } - expectSuccess("ContainerImpl.newOpenProtectedProperty3") { c.newOpenProtectedProperty3Access() } - expectSuccess("ContainerImpl.newOpenProtectedProperty4") { c.newOpenProtectedProperty4Access() } - expectSuccess("ContainerImpl.newInternalProperty1") { c.newInternalProperty1Access() } - expectSuccess("ContainerImpl.newInternalProperty2") { c.newInternalProperty2Access() } - expectSuccess("ContainerImpl.newInternalProperty3") { c.newInternalProperty3Access() } - expectSuccess("ContainerImpl.newInternalProperty4") { c.newInternalProperty4Access() } - expectSuccess("ContainerImpl.newOpenInternalProperty1") { c.newOpenInternalProperty1Access() } - expectSuccess("ContainerImpl.newOpenInternalProperty2") { c.newOpenInternalProperty2Access() } - expectSuccess("ContainerImpl.newOpenInternalProperty3") { c.newOpenInternalProperty3Access() } - expectSuccess("ContainerImpl.newOpenInternalProperty4") { c.newOpenInternalProperty4Access() } - expectSuccess("ContainerImpl.newPrivateProperty1") { c.newPrivateProperty1Access() } - expectSuccess("ContainerImpl.newPrivateProperty2") { c.newPrivateProperty2Access() } - expectSuccess("ContainerImpl.newPrivateProperty3") { c.newPrivateProperty3Access() } - expectSuccess("ContainerImpl.newPrivateProperty4") { c.newPrivateProperty4Access() } + expectFailure(prefixed("property accessor publicToPrivateProperty2. can not be called")) { ci.publicToPrivateProperty2 } + expectSuccess("Container.publicToProtectedProperty1.v2") { ci.publicToProtectedProperty1Access() } + expectSuccess("Container.publicToProtectedProperty2.v2") { ci.publicToProtectedProperty2Access() } + expectFailure(prefixed("property accessor publicToInternalProperty1. can not be called")) { ci.publicToInternalProperty1Access() } + expectFailure(prefixed("property accessor publicToInternalProperty2. can not be called")) { ci.publicToInternalProperty2Access() } + expectFailure(prefixed("property accessor publicToPrivateProperty1. can not be called")) { ci.publicToPrivateProperty1Access() } + expectFailure(prefixed("property accessor publicToPrivateProperty2. can not be called")) { ci.publicToPrivateProperty2Access() } + expectSuccess("Container.protectedToPublicProperty1.v2") { ci.protectedToPublicProperty1Access() } + expectSuccess("Container.protectedToPublicProperty2.v2") { ci.protectedToPublicProperty2Access() } + expectFailure(prefixed("property accessor protectedToInternalProperty1. can not be called")) { ci.protectedToInternalProperty1Access() } + expectFailure(prefixed("property accessor protectedToInternalProperty2. can not be called")) { ci.protectedToInternalProperty2Access() } + expectFailure(prefixed("property accessor protectedToPrivateProperty1. can not be called")) { ci.protectedToPrivateProperty1Access() } + expectFailure(prefixed("property accessor protectedToPrivateProperty2. can not be called")) { ci.protectedToPrivateProperty2Access() } + expectSuccess("ContainerImpl.publicToProtectedOverriddenProperty1") { ci.publicToProtectedOverriddenProperty1 } + expectSuccess("ContainerImpl.publicToProtectedOverriddenProperty2") { ci.publicToProtectedOverriddenProperty2 } + expectSuccess("ContainerImpl.publicToProtectedOverriddenProperty3") { ci.publicToProtectedOverriddenProperty3 } + expectSuccess("ContainerImpl.publicToProtectedOverriddenProperty4") { ci.publicToProtectedOverriddenProperty4 } + expectSuccess("ContainerImpl.publicToInternalOverriddenProperty1") { ci.publicToInternalOverriddenProperty1 } + expectSuccess("ContainerImpl.publicToInternalOverriddenProperty2") { ci.publicToInternalOverriddenProperty2 } + expectSuccess("ContainerImpl.publicToInternalOverriddenProperty3") { ci.publicToInternalOverriddenProperty3 } + expectSuccess("ContainerImpl.publicToInternalOverriddenProperty4") { ci.publicToInternalOverriddenProperty4 } + expectSuccess("ContainerImpl.publicToPrivateOverriddenProperty1") { ci.publicToPrivateOverriddenProperty1 } + expectSuccess("ContainerImpl.publicToPrivateOverriddenProperty2") { ci.publicToPrivateOverriddenProperty2 } + expectSuccess("ContainerImpl.publicToPrivateOverriddenProperty3") { ci.publicToPrivateOverriddenProperty3 } + expectSuccess("ContainerImpl.publicToPrivateOverriddenProperty4") { ci.publicToPrivateOverriddenProperty4 } + expectSuccess("ContainerImpl.protectedToPublicOverriddenProperty1") { ci.protectedToPublicOverriddenProperty1Access() } + expectSuccess("ContainerImpl.protectedToPublicOverriddenProperty2") { ci.protectedToPublicOverriddenProperty2Access() } + expectSuccess("ContainerImpl.protectedToPublicOverriddenProperty3") { ci.protectedToPublicOverriddenProperty3Access() } + expectSuccess("ContainerImpl.protectedToPublicOverriddenProperty4") { ci.protectedToPublicOverriddenProperty4Access() } + expectSuccess("ContainerImpl.protectedToInternalOverriddenProperty1") { ci.protectedToInternalOverriddenProperty1Access() } + expectSuccess("ContainerImpl.protectedToInternalOverriddenProperty2") { ci.protectedToInternalOverriddenProperty2Access() } + expectSuccess("ContainerImpl.protectedToInternalOverriddenProperty3") { ci.protectedToInternalOverriddenProperty3Access() } + expectSuccess("ContainerImpl.protectedToInternalOverriddenProperty4") { ci.protectedToInternalOverriddenProperty4Access() } + expectSuccess("ContainerImpl.protectedToPrivateOverriddenProperty1") { ci.protectedToPrivateOverriddenProperty1Access() } + expectSuccess("ContainerImpl.protectedToPrivateOverriddenProperty2") { ci.protectedToPrivateOverriddenProperty2Access() } + expectSuccess("ContainerImpl.protectedToPrivateOverriddenProperty3") { ci.protectedToPrivateOverriddenProperty3Access() } + expectSuccess("ContainerImpl.protectedToPrivateOverriddenProperty4") { ci.protectedToPrivateOverriddenProperty4Access() } + expectSuccess("ContainerImpl.newPublicProperty1") { ci.newPublicProperty1 } + expectSuccess("ContainerImpl.newPublicProperty2") { ci.newPublicProperty2 } + expectSuccess("ContainerImpl.newPublicProperty3") { ci.newPublicProperty3 } + expectSuccess("ContainerImpl.newPublicProperty4") { ci.newPublicProperty4 } + expectSuccess("ContainerImpl.newProtectedProperty1") { ci.newProtectedProperty1Access() } + expectSuccess("ContainerImpl.newProtectedProperty2") { ci.newProtectedProperty2Access() } + expectSuccess("ContainerImpl.newProtectedProperty3") { ci.newProtectedProperty3Access() } + expectSuccess("ContainerImpl.newProtectedProperty4") { ci.newProtectedProperty4Access() } + expectSuccess("ContainerImpl.newOpenProtectedProperty1") { ci.newOpenProtectedProperty1Access() } + expectSuccess("ContainerImpl.newOpenProtectedProperty2") { ci.newOpenProtectedProperty2Access() } + expectSuccess("ContainerImpl.newOpenProtectedProperty3") { ci.newOpenProtectedProperty3Access() } + expectSuccess("ContainerImpl.newOpenProtectedProperty4") { ci.newOpenProtectedProperty4Access() } + expectSuccess("ContainerImpl.newInternalProperty1") { ci.newInternalProperty1Access() } + expectSuccess("ContainerImpl.newInternalProperty2") { ci.newInternalProperty2Access() } + expectSuccess("ContainerImpl.newInternalProperty3") { ci.newInternalProperty3Access() } + expectSuccess("ContainerImpl.newInternalProperty4") { ci.newInternalProperty4Access() } + expectSuccess("ContainerImpl.newOpenInternalProperty1") { ci.newOpenInternalProperty1Access() } + expectSuccess("ContainerImpl.newOpenInternalProperty2") { ci.newOpenInternalProperty2Access() } + expectSuccess("ContainerImpl.newOpenInternalProperty3") { ci.newOpenInternalProperty3Access() } + expectSuccess("ContainerImpl.newOpenInternalProperty4") { ci.newOpenInternalProperty4Access() } + expectSuccess("ContainerImpl.newPrivateProperty1") { ci.newPrivateProperty1Access() } + expectSuccess("ContainerImpl.newPrivateProperty2") { ci.newPrivateProperty2Access() } + expectSuccess("ContainerImpl.newPrivateProperty3") { ci.newPrivateProperty3Access() } + expectSuccess("ContainerImpl.newPrivateProperty4") { ci.newPrivateProperty4Access() } }