mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Kotlin: Add a test for type equivalences
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
| type_equivalences.kt:4:1:4:65 | fooUnit | file://:0:0:0:0 | void | 0 | type_equivalences.kt:4:13:4:19 | x | file://:0:0:0:0 | void |
|
||||
| type_equivalences.kt:4:1:4:65 | fooUnit | file://:0:0:0:0 | void | 1 | type_equivalences.kt:4:22:4:33 | y | type_equivalences.kt:2:1:2:15 | Par<Void> |
|
||||
| type_equivalences.kt:5:1:5:65 | fooVoid | file:///modules/java.base/java/lang/Void.class:0:0:0:0 | Void | 0 | type_equivalences.kt:5:13:5:19 | x | file:///modules/java.base/java/lang/Void.class:0:0:0:0 | Void |
|
||||
| type_equivalences.kt:5:1:5:65 | fooVoid | file:///modules/java.base/java/lang/Void.class:0:0:0:0 | Void | 1 | type_equivalences.kt:5:22:5:33 | y | type_equivalences.kt:2:1:2:15 | Par<Void> |
|
||||
| type_equivalences.kt:6:1:6:80 | fooNothing | file:///modules/java.base/java/lang/Void.class:0:0:0:0 | Void | 0 | type_equivalences.kt:6:16:6:25 | x | file:///modules/java.base/java/lang/Void.class:0:0:0:0 | Void |
|
||||
| type_equivalences.kt:6:1:6:80 | fooNothing | file:///modules/java.base/java/lang/Void.class:0:0:0:0 | Void | 1 | type_equivalences.kt:6:28:6:42 | y | type_equivalences.kt:2:1:2:15 | Par<Void> |
|
||||
| type_equivalences.kt:7:1:7:60 | fooInt | file://:0:0:0:0 | int | 0 | type_equivalences.kt:7:12:7:17 | x | file://:0:0:0:0 | int |
|
||||
| type_equivalences.kt:7:1:7:60 | fooInt | file://:0:0:0:0 | int | 1 | type_equivalences.kt:7:20:7:30 | y | type_equivalences.kt:2:1:2:15 | Par<Integer> |
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
class Par<T> {}
|
||||
|
||||
fun fooUnit(x: Unit, y: Par<Unit>): Unit { return fooUnit(x, y) }
|
||||
fun fooVoid(x: Void, y: Par<Void>): Void { return fooVoid(x, y) }
|
||||
fun fooNothing(x: Nothing, y: Par<Nothing>): Nothing { return fooNothing(x, y) }
|
||||
fun fooInt(x: Int, y: Par<Int>): Int { return fooInt(x, y) }
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import java
|
||||
|
||||
from Method m, int i, Parameter p
|
||||
where m.getName().matches("foo%")
|
||||
and p = m.getParameter(i)
|
||||
select m, m.getReturnType(), i, p, p.getType()
|
||||
|
||||
Reference in New Issue
Block a user