Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3e60841

Browse files
tamasvajkigfoo
authored andcommitted
Extract ::class expressions
1 parent f04eb6b commit 3e60841

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,16 @@ class KotlinFileExtractor(val logger: FileLogger, val tw: FileTrapWriter, val fi
761761
tw.writeWhen_branch_else(bId)
762762
}
763763
}
764-
} else -> {
764+
}
765+
is IrGetClass -> {
766+
val id = tw.getFreshIdLabel<DbGetclassexpr>()
767+
val locId = tw.getLocation(e)
768+
val typeId = useType(e.type)
769+
tw.writeExprs_getclassexpr(id, typeId, parent, idx)
770+
tw.writeHasLocation(id, locId)
771+
extractExpression(e.argument, callable, id, 0)
772+
}
773+
else -> {
765774
logger.warnElement(Severity.ErrorSevere, "Unrecognised IrExpression: " + e.javaClass, e)
766775
}
767776
}

java/ql/lib/config/semmlecode.dbscheme

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,7 @@ case @expr.kind of
654654
| 73 = @switchexpr
655655
| 74 = @errorexpr
656656
| 75 = @whenexpr
657+
| 76 = @getclassexpr
657658
;
658659

659660
/** Holds if this `when` expression was written as an `if` expression. */
@@ -1046,4 +1047,4 @@ ktCommentSectionSubjectNames(
10461047
ktCommentOwner(
10471048
int id: @ktcomment ref,
10481049
int owner: @top ref
1049-
)
1050+
)

0 commit comments

Comments
 (0)