File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
java/kotlin-extractor/src/main/kotlin Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package com.github.codeql
22
33import com.github.codeql.utils.*
44import com.github.codeql.utils.versions.codeQlWithHasQuestionMark
5+ import com.github.codeql.utils.versions.getKotlinType
56import com.github.codeql.utils.versions.isRawType
67import com.semmle.extractor.java.OdasaOutput
78import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
@@ -671,7 +672,7 @@ open class KotlinUsesExtractor(
671672 javaClass : IrClass ,
672673 kotlinPackageName : String , kotlinClassName : String ): TypeResults {
673674 // Note the use of `hasEnhancedNullability` here covers cases like `@NotNull Integer`, which must be extracted as `Integer` not `int`.
674- val javaResult = if ((context == TypeContext .RETURN || (context == TypeContext .OTHER && otherIsPrimitive)) && ! s.isNullable() && s.kotlinType ?.hasEnhancedNullability() != true && primitiveName != null ) {
675+ val javaResult = if ((context == TypeContext .RETURN || (context == TypeContext .OTHER && otherIsPrimitive)) && ! s.isNullable() && getKotlinType(s) ?.hasEnhancedNullability() != true && primitiveName != null ) {
675676 val label: Label <DbPrimitive > = tw.getLabelFor(" @\" type;$primitiveName \" " , {
676677 tw.writePrimitives(it, primitiveName)
677678 })
Original file line number Diff line number Diff line change 1+ package com.github.codeql.utils.versions
2+
3+ import org.jetbrains.kotlin.ir.types.IrSimpleType
4+ import org.jetbrains.kotlin.ir.types.impl.IrTypeBase
5+
6+ fun getKotlinType (s : IrSimpleType ) = (s as ? IrTypeBase )?.kotlinType
Original file line number Diff line number Diff line change 1+ package com.github.codeql.utils.versions
2+
3+ import org.jetbrains.kotlin.ir.types.IrSimpleType
4+
5+ fun getKotlinType (s : IrSimpleType ) = s.kotlinType
You can’t perform that action at this time.
0 commit comments