Skip to content

Commit 540a2a6

Browse files
committed
Don't create stub trap files for anonymous or local classes, or unexpected kinds of top-level declaration
1 parent 08e3431 commit 540a2a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ open class KotlinFileExtractor(
9292

9393
file.declarations.forEach {
9494
extractDeclaration(it, extractPrivateMembers = true, extractFunctionBodies = true)
95-
if (it !is IrClass) {
95+
if (it is IrProperty || it is IrField || it is IrFunction) {
9696
externalClassExtractor.noteElementExtractedFromSource(it, getTrapFileSignature(it))
9797
}
9898
}
@@ -523,7 +523,7 @@ open class KotlinFileExtractor(
523523

524524
linesOfCode?.linesOfCodeInDeclaration(c, id)
525525

526-
if (extractFunctionBodies)
526+
if (extractFunctionBodies && !c.isAnonymousObject && !c.isLocal)
527527
externalClassExtractor.noteElementExtractedFromSource(c)
528528

529529
return id

0 commit comments

Comments
 (0)