Add test case for local variable in anonymous init

Also fix another instance of the same issue in extractLocalTypeDeclStmt
This commit is contained in:
Tony Torralba
2022-03-23 17:19:50 +01:00
committed by Ian Lynagh
parent 1926bef050
commit f8ad93a530
9 changed files with 59 additions and 1 deletions

View File

@@ -328,8 +328,9 @@ open class KotlinFileExtractor(
}
private fun extractLocalTypeDeclStmt(c: IrClass, callable: Label<out DbCallable>, parent: Label<out DbStmtparent>, idx: Int) {
val extractStaticInit = c.declarations.none { it is IrAnonymousInitializer }
@Suppress("UNCHECKED_CAST")
val id = extractClassSource(c, true, true) as Label<out DbClass>
val id = extractClassSource(c, true, extractStaticInit) as Label<out DbClass>
extractLocalTypeDeclStmt(id, c, callable, parent, idx)
}