[JVM IR] Use names of local functions in names of local classes.
This undoes changes in https://github.com/JetBrains/kotlin/commit/fbe66c3496d082d2d487b2c39673f0cd4ac5b70a which broke calculation of the simple name of local classes in reflection (the enclosing method was not a substring of the name of the local class).
This commit is contained in:
committed by
Alexander Udalov
parent
70b304e6e4
commit
36c4df6d99
-6
@@ -108,12 +108,6 @@ class InventNamesForLocalClasses(private val context: JvmBackendContext) : FileL
|
||||
localFunctionNames[(declaration as IrFunction).symbol] = name
|
||||
}
|
||||
}
|
||||
declaration is IrFunction && declaration.parent !is IrClass -> {
|
||||
// In the old backend, only names of non-local functions are stored in names of anonymous classes. All other names
|
||||
// are replaced with indices. For example, a local class `L` in a top-level function `f` will have the name `...$f$L`,
|
||||
// but inside a local function `g` (which is in `f`) it will have the name `...$f$1$L` (_not_ `...$f$g$L`).
|
||||
inventName(null, data)
|
||||
}
|
||||
enclosingName != null -> "$enclosingName$$simpleName"
|
||||
else -> simpleName
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user