JVM IR: Use package visibility for fields of captured variables

This commit is contained in:
Steven Schäfer
2020-08-28 12:28:19 +02:00
committed by Alexander Udalov
parent 443269af0a
commit 02e78bcd76
13 changed files with 11 additions and 26 deletions
@@ -129,10 +129,7 @@ internal val localDeclarationsPhase = makeIrFilePhase(
declaration.visibility
override fun forCapturedField(value: IrValueSymbol): Visibility =
if (value is IrValueParameterSymbol && value.owner.isCrossinline)
JavaVisibilities.PACKAGE_VISIBILITY // avoid requiring a synthetic accessor for it
else
Visibilities.PRIVATE
JavaVisibilities.PACKAGE_VISIBILITY // avoid requiring a synthetic accessor for it
private fun scopedVisibility(inInlineFunctionScope: Boolean): Visibility =
if (inInlineFunctionScope) Visibilities.PUBLIC else JavaVisibilities.PACKAGE_VISIBILITY