mirror of
https://github.com/github/codeql.git
synced 2026-03-27 17:58:17 +01:00
Kotlin: Run java-interface-redeclares-tostring on all platforms
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
public interface Test {
|
||||
String toString();
|
||||
int hashCode();
|
||||
boolean equals(Object other);
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
| equals | Test |
|
||||
| hashCode | Test |
|
||||
| toString | Test |
|
||||
| toString | java.lang.CharSequence |
|
||||
@@ -0,0 +1,5 @@
|
||||
from create_database_utils import *
|
||||
|
||||
os.mkdir('bin')
|
||||
runSuccessfully(["javac", "Test.java", "-d", "bin"])
|
||||
run_codeql_database_create(["kotlinc user.kt -cp bin"], lang="java")
|
||||
@@ -0,0 +1,7 @@
|
||||
import java
|
||||
|
||||
from Method m
|
||||
where
|
||||
m.getDeclaringType().getName() = ["Test", "CharSequence"] and
|
||||
m.getName() = ["toString", "equals", "hashCode"]
|
||||
select m.getName(), m.getDeclaringType().getQualifiedName()
|
||||
@@ -0,0 +1 @@
|
||||
fun f(t: Test, cs: CharSequence) = t.toString() + cs.toString() + t.equals(1) + t.hashCode()
|
||||
Reference in New Issue
Block a user