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

Skip to content

Commit 2cc5f3e

Browse files
smowtonigfoo
authored andcommitted
kt_*_types tables: cite correct Kotlin classid for arrays
1 parent b926521 commit 2cc5f3e

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -517,19 +517,19 @@ class X {
517517
}
518518
val javaSignature = "an array" // TODO: Wrong
519519
val javaResult = TypeResult(id, javaSignature)
520-
val aClassId = makeClass("kotlin", "Array") // TODO: Wrong
520+
val kotlinClassName = getUnquotedClassLabel(s.classifier.owner as IrClass, s.arguments)
521521
val kotlinResult = if (s.hasQuestionMark) {
522522
val kotlinSignature = "$javaSignature?" // TODO: Wrong
523-
val kotlinLabel = "@\"kt_type;nullable;array\"" // TODO: Wrong
523+
val kotlinLabel = "@\"kt_type;nullable;${kotlinClassName}\""
524524
val kotlinId: Label<DbKt_nullable_type> = tw.getLabelFor(kotlinLabel, {
525-
tw.writeKt_nullable_types(it, aClassId)
525+
tw.writeKt_nullable_types(it, id)
526526
})
527527
TypeResult(kotlinId, kotlinSignature)
528528
} else {
529529
val kotlinSignature = "$javaSignature" // TODO: Wrong
530-
val kotlinLabel = "@\"kt_type;notnull;array\"" // TODO: Wrong
530+
val kotlinLabel = "@\"kt_type;notnull;${kotlinClassName}\"" // TODO: Wrong
531531
val kotlinId: Label<DbKt_notnull_type> = tw.getLabelFor(kotlinLabel, {
532-
tw.writeKt_notnull_types(it, aClassId)
532+
tw.writeKt_notnull_types(it, id)
533533
})
534534
TypeResult(kotlinId, kotlinSignature)
535535
}

java/ql/lib/config/semmlecode.dbscheme

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,12 +328,12 @@ class_companion_object(
328328

329329
kt_nullable_types(
330330
unique int id: @kt_nullable_type,
331-
int classid: @classorinterface ref
331+
int classid: @reftype ref
332332
)
333333

334334
kt_notnull_types(
335335
unique int id: @kt_notnull_type,
336-
int classid: @classorinterface ref
336+
int classid: @reftype ref
337337
)
338338

339339
kt_type_alias(

0 commit comments

Comments
 (0)