File tree Expand file tree Collapse file tree 7 files changed +72
-6
lines changed
java/ql/test/kotlin/library-tests/java_and_kotlin Expand file tree Collapse file tree 7 files changed +72
-6
lines changed Original file line number Diff line number Diff line change
1
+ package kotlin .coroutines ;
2
+
3
+ // This is a stub for the Kotlin Continuation interface.
4
+ public interface Continuation <T > { }
Original file line number Diff line number Diff line change
1
+ import kotlin .coroutines .Continuation ;
2
+
1
3
public class Java {
2
4
void javaFun () {
3
5
new Kotlin ().kotlinFun ();
4
6
}
7
+
8
+ public class Djava extends Base {
9
+ @ Override
10
+ public String fn0 (int x ) {
11
+ return super .fn0 (x );
12
+ }
13
+
14
+ @ Override
15
+ public Object fn1 (int x , Continuation <? super String > $completion ) {
16
+ return super .fn1 (x , $completion );
17
+ }
18
+ }
5
19
}
Original file line number Diff line number Diff line change @@ -3,3 +3,13 @@ public class Kotlin {
3
3
// TODO: Java().javaFun();
4
4
}
5
5
}
6
+
7
+ open class Base {
8
+ open fun fn0 (x : Int ) : String = " "
9
+ open suspend fun fn1 (x : Int ) : String = " "
10
+ }
11
+
12
+ class Dkotlin : Base () {
13
+ override fun fn0 (x : Int ): String = super .fn0(x)
14
+ override suspend fun fn1 (x : Int ): String = super .fn1(x)
15
+ }
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ methods
2
+ | Java.java:4:7:4:13 | javaFun | javaFun() |
3
+ | Java.java:10:17:10:19 | fn0 | fn0(int) |
4
+ | Java.java:15:17:15:19 | fn1 | fn1(int,kotlin.coroutines.Continuation) |
5
+ | Kotlin.kt:2:2:4:2 | kotlinFun | kotlinFun() |
6
+ | Kotlin.kt:8:10:8:38 | fn0 | fn0(int) |
7
+ | Kotlin.kt:9:18:9:46 | fn1 | fn1(int) |
8
+ | Kotlin.kt:13:14:13:51 | fn0 | fn0(int) |
9
+ | Kotlin.kt:14:22:14:59 | fn1 | fn1(int) |
10
+ overrides
11
+ | Java.java:10:17:10:19 | fn0 | Kotlin.kt:8:10:8:38 | fn0 |
12
+ | Java.java:15:17:15:19 | fn1 | java_and_kotlin.testproj/test.class.files/Base.class:0:0:0:0 | fn1 |
13
+ | Kotlin.kt:13:14:13:51 | fn0 | Kotlin.kt:8:10:8:38 | fn0 |
14
+ | Kotlin.kt:14:22:14:59 | fn1 | Kotlin.kt:9:18:9:46 | fn1 |
15
+ signature_mismatch
16
+ | Kotlin.kt:9:18:9:46 | fn1 | fn1(int) |
17
+ | java_and_kotlin.testproj/test.class.files/Base.class:0:0:0:0 | fn1 | fn1(int,kotlin.coroutines.Continuation) |
18
+ #select
19
+ | Java.java:5:3:5:26 | kotlinFun(...) | Kotlin.kt:2:2:4:2 | kotlinFun |
20
+ | Java.java:11:11:11:22 | fn0(...) | Kotlin.kt:8:10:8:38 | fn0 |
21
+ | Java.java:16:11:16:35 | fn1(...) | java_and_kotlin.testproj/test.class.files/Base.class:0:0:0:0 | fn1 |
22
+ | Kotlin.kt:13:46:13:51 | fn0(...) | Kotlin.kt:8:10:8:38 | fn0 |
23
+ | Kotlin.kt:14:54:14:59 | fn1(...) | Kotlin.kt:9:18:9:46 | fn1 |
Original file line number Diff line number Diff line change
1
+ import java
2
+
3
+ from MethodAccess ma , Method m
4
+ where m = ma .getMethod ( )
5
+ select ma , m
6
+
7
+ query predicate methods ( Method m , string sig ) {
8
+ m .fromSource ( ) and
9
+ m .getSignature ( ) = sig
10
+ }
11
+
12
+ query predicate overrides ( Method m1 , Method m2 ) {
13
+ m1 .fromSource ( ) and
14
+ m1 .overrides ( m2 )
15
+ }
16
+
17
+ query predicate signature_mismatch ( Method m , string sig ) {
18
+ m .getDeclaringType ( ) .getQualifiedName ( ) = "Base" and
19
+ m .getName ( ) = "fn1" and
20
+ m .getSignature ( ) = sig
21
+ }
You can’t perform that action at this time.
0 commit comments