[PL] Fix: Remove annotations containing unlinked arguments
Both explicitly specified and default argument expressions are considered. In case an argument expression is considered as 'unlinked' the whole annotation is removed from the declaration. An appropriate compiler warning logged for each such case.
This commit is contained in:
committed by
Space Team
parent
6e8283a6fe
commit
706a4e9919
@@ -33,3 +33,11 @@ open class Container {
|
||||
// @PublishedApi internal open fun newOpenInternalPAFunction() = "Container.newOpenInternalPAFunction.v1"
|
||||
// private fun newPrivateFunction() = "Container.newPrivateFunction.v1"
|
||||
}
|
||||
|
||||
private fun privateTopLevelFun() = "privateTopLevelFun.v1"
|
||||
fun publicTopLevelFunWithPrivateDefaultArgument(value: String = privateTopLevelFun()) = "publicTopLevelFunWithPrivateDefaultArgument.v1($value)"
|
||||
|
||||
object TopLevel {
|
||||
private fun privateNestedFun() = "privateNestedFun.v1"
|
||||
fun publicNestedFunWithPrivateDefaultArgument(value: String = privateNestedFun()) = "publicNestedFunWithPrivateDefaultArgument.v1($value)"
|
||||
}
|
||||
|
||||
@@ -33,3 +33,11 @@ open class Container {
|
||||
@PublishedApi internal open fun newOpenInternalPAFunction() = "Container.newOpenInternalPAFunction.v2"
|
||||
private fun newPrivateFunction() = "Container.newPrivateFunction.v2"
|
||||
}
|
||||
|
||||
private fun privateTopLevelFun() = "privateTopLevelFun.v2"
|
||||
fun publicTopLevelFunWithPrivateDefaultArgument(value: String = privateTopLevelFun()) = "publicTopLevelFunWithPrivateDefaultArgument.v2($value)"
|
||||
|
||||
object TopLevel {
|
||||
private fun privateNestedFun() = "privateNestedFun.v2"
|
||||
fun publicNestedFunWithPrivateDefaultArgument(value: String = privateNestedFun()) = "publicNestedFunWithPrivateDefaultArgument.v2($value)"
|
||||
}
|
||||
|
||||
@@ -46,6 +46,9 @@ fun box() = abiTest {
|
||||
success("ContainerImpl.newInternalPAFunction") { ci.newInternalPAFunctionAccess() }
|
||||
success("ContainerImpl.newOpenInternalPAFunction") { ci.newOpenInternalPAFunctionAccess() }
|
||||
success("ContainerImpl.newPrivateFunction") { ci.newPrivateFunctionAccess() }
|
||||
|
||||
success("publicTopLevelFunWithPrivateDefaultArgument.v2(privateTopLevelFun.v2)") { publicTopLevelFunWithPrivateDefaultArgument() }
|
||||
success("publicNestedFunWithPrivateDefaultArgument.v2(privateNestedFun.v2)") { TopLevel.publicNestedFunWithPrivateDefaultArgument() }
|
||||
}
|
||||
|
||||
// Shortcuts:
|
||||
|
||||
Reference in New Issue
Block a user