diff --git a/java/kotlin-extractor/src/main/kotlin/KotlinUsesExtractor.kt b/java/kotlin-extractor/src/main/kotlin/KotlinUsesExtractor.kt index fd9ec136104..613c973f3c3 100644 --- a/java/kotlin-extractor/src/main/kotlin/KotlinUsesExtractor.kt +++ b/java/kotlin-extractor/src/main/kotlin/KotlinUsesExtractor.kt @@ -1281,6 +1281,7 @@ open class KotlinUsesExtractor( } // Look for an exact type match... javaClass.declarations.findSubType { decl -> + !decl.isFakeOverride && decl.name.asString() == jvmName && decl.valueParameters.size == f.valueParameters.size && decl.valueParameters.zip(f.valueParameters).all { p -> erase(p.first.type).classifierOrNull == erase(p.second.type).classifierOrNull } diff --git a/java/ql/test/kotlin/library-tests/call-int-to-char/CONSISTENCY/javaEquivalent.expected b/java/ql/test/kotlin/library-tests/call-int-to-char/CONSISTENCY/javaEquivalent.expected new file mode 100644 index 00000000000..02fc2a94b39 --- /dev/null +++ b/java/ql/test/kotlin/library-tests/call-int-to-char/CONSISTENCY/javaEquivalent.expected @@ -0,0 +1 @@ +| file://:0:0:0:0 | Couldn't find a Java equivalent function to kotlin.Int.toChar in java.lang.Integer | diff --git a/java/ql/test/kotlin/library-tests/call-int-to-char/test.expected b/java/ql/test/kotlin/library-tests/call-int-to-char/test.expected new file mode 100644 index 00000000000..c3ee02d7bd6 --- /dev/null +++ b/java/ql/test/kotlin/library-tests/call-int-to-char/test.expected @@ -0,0 +1 @@ +| test.kt:1:19:1:26 | toChar(...) | diff --git a/java/ql/test/kotlin/library-tests/call-int-to-char/test.kt b/java/ql/test/kotlin/library-tests/call-int-to-char/test.kt new file mode 100644 index 00000000000..d602aeb0992 --- /dev/null +++ b/java/ql/test/kotlin/library-tests/call-int-to-char/test.kt @@ -0,0 +1 @@ +fun f(x: Int) = x.toChar() diff --git a/java/ql/test/kotlin/library-tests/call-int-to-char/test.ql b/java/ql/test/kotlin/library-tests/call-int-to-char/test.ql new file mode 100644 index 00000000000..ab60ba2525d --- /dev/null +++ b/java/ql/test/kotlin/library-tests/call-int-to-char/test.ql @@ -0,0 +1,4 @@ +import java + +from MethodAccess ma +select ma