Skip to content

Commit 58cb544

Browse files
committed
Add cross-check to getValueParameterLabel
1 parent 5e2c607 commit 58cb544

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,9 @@ open class KotlinUsesExtractor(
15901590
fun getValueParameterLabel(vp: IrValueParameter, parent: Label<out DbCallable>?): String {
15911591
val declarationParent = vp.parent
15921592
val overriddenParentAttributes = (declarationParent as? IrFunction)?.let {
1593-
if (this is KotlinFileExtractor)
1593+
// Note the check 'vp.fileOrNull?.path == this.filePath' should never actually do anything, since references
1594+
// to a value parameter should always come from within the same .kt file.
1595+
if (this is KotlinFileExtractor && vp.fileOrNull?.path == this.filePath)
15941596
this.declarationStack.findOverriddenAttributes(it)
15951597
else
15961598
null

0 commit comments

Comments
 (0)