[IR] Fix for per-file caches support in K/N
This commit is contained in:
+2
-2
@@ -915,7 +915,7 @@ class LocalDeclarationsLowering(
|
||||
}
|
||||
|
||||
private fun collectLocalDeclarations() {
|
||||
val enclosingFile by lazy { container.file }
|
||||
val enclosingPackageFragment = container.getPackageFragment()
|
||||
val enclosingClass = run {
|
||||
var currentParent = container as? IrClass ?: container.parent
|
||||
while (currentParent is IrDeclaration && currentParent !is IrClass) {
|
||||
@@ -956,7 +956,7 @@ class LocalDeclarationsLowering(
|
||||
val enclosingScope = data.currentClass
|
||||
?: enclosingClass?.scopeWithCounter
|
||||
// File is required for K/N because file declarations are not split by classes.
|
||||
?: enclosingFile.scopeWithCounter
|
||||
?: enclosingPackageFragment.scopeWithCounter
|
||||
val index =
|
||||
if (declaration.name.isSpecial || declaration.name in enclosingScope.usedLocalFunctionNames)
|
||||
enclosingScope.counter++
|
||||
|
||||
Reference in New Issue
Block a user