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
2
2
3
3
import com.github.codeql.utils.*
4
4
import com.github.codeql.utils.versions.codeQlWithHasQuestionMark
5
+ import com.github.codeql.utils.versions.getKotlinType
5
6
import com.github.codeql.utils.versions.isRawType
6
7
import com.semmle.extractor.java.OdasaOutput
7
8
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
@@ -671,7 +672,7 @@ open class KotlinUsesExtractor(
671
672
javaClass : IrClass ,
672
673
kotlinPackageName : String , kotlinClassName : String ): TypeResults {
673
674
// 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 ) {
675
676
val label: Label <DbPrimitive > = tw.getLabelFor(" @\" type;$primitiveName \" " , {
676
677
tw.writePrimitives(it, primitiveName)
677
678
})
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