mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
Add test for return type of <clinit> methods
This commit is contained in:
committed by
Chris Smowton
parent
b0ee557a51
commit
de003fd122
@@ -0,0 +1 @@
|
||||
| clinit.kt:0:0:0:0 | <clinit> | file:///usr/local/Cellar/kotlin/1.6.20/libexec/lib/kotlin-stdlib.jar/kotlin/Unit.class:0:0:0:0 | Unit |
|
||||
3
java/ql/test/kotlin/library-tests/methods/clinit.kt
Normal file
3
java/ql/test/kotlin/library-tests/methods/clinit.kt
Normal file
@@ -0,0 +1,3 @@
|
||||
package foo.bar
|
||||
|
||||
var topLevelInt: Int = 0
|
||||
5
java/ql/test/kotlin/library-tests/methods/clinit.ql
Normal file
5
java/ql/test/kotlin/library-tests/methods/clinit.ql
Normal file
@@ -0,0 +1,5 @@
|
||||
import java
|
||||
|
||||
from Method m
|
||||
where m.getName() = "<clinit>"
|
||||
select m, m.getReturnType()
|
||||
@@ -1,3 +1,17 @@
|
||||
| clinit.kt:3:1:3:24 | ...=... | AssignExpr |
|
||||
| clinit.kt:3:1:3:24 | ...=... | KtInitializerAssignExpr |
|
||||
| clinit.kt:3:1:3:24 | <set-?> | VarAccess |
|
||||
| clinit.kt:3:1:3:24 | ClinitKt | TypeAccess |
|
||||
| clinit.kt:3:1:3:24 | ClinitKt | TypeAccess |
|
||||
| clinit.kt:3:1:3:24 | ClinitKt | TypeAccess |
|
||||
| clinit.kt:3:1:3:24 | ClinitKt.topLevelInt | VarAccess |
|
||||
| clinit.kt:3:1:3:24 | ClinitKt.topLevelInt | VarAccess |
|
||||
| clinit.kt:3:1:3:24 | ClinitKt.topLevelInt | VarAccess |
|
||||
| clinit.kt:3:1:3:24 | Unit | TypeAccess |
|
||||
| clinit.kt:3:1:3:24 | int | TypeAccess |
|
||||
| clinit.kt:3:1:3:24 | int | TypeAccess |
|
||||
| clinit.kt:3:1:3:24 | int | TypeAccess |
|
||||
| clinit.kt:3:24:3:24 | 0 | IntegerLiteral |
|
||||
| methods2.kt:4:1:5:1 | Unit | TypeAccess |
|
||||
| methods2.kt:4:26:4:31 | int | TypeAccess |
|
||||
| methods2.kt:4:34:4:39 | int | TypeAccess |
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
methods
|
||||
| clinit.kt:0:0:0:0 | ClinitKt | clinit.kt:0:0:0:0 | <clinit> | <clinit>() | |
|
||||
| clinit.kt:0:0:0:0 | ClinitKt | clinit.kt:3:1:3:24 | getTopLevelInt | getTopLevelInt() | public, static |
|
||||
| clinit.kt:0:0:0:0 | ClinitKt | clinit.kt:3:1:3:24 | setTopLevelInt | setTopLevelInt(int) | public, static |
|
||||
| methods2.kt:0:0:0:0 | Methods2Kt | methods2.kt:4:1:5:1 | fooBarTopLevelMethod | fooBarTopLevelMethod(int,int) | public, static |
|
||||
| methods2.kt:7:1:10:1 | Class2 | methods2.kt:8:5:9:5 | fooBarClassMethod | fooBarClassMethod(int,int) | public |
|
||||
| methods3.kt:0:0:0:0 | Methods3Kt | methods3.kt:3:1:3:42 | fooBarTopLevelMethodExt | fooBarTopLevelMethodExt(int,int) | public, static |
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
| clinit.kt:3:1:3:24 | setTopLevelInt | clinit.kt:3:1:3:24 | <set-?> | 0 |
|
||||
| methods2.kt:4:1:5:1 | fooBarTopLevelMethod | methods2.kt:4:26:4:31 | x | 0 |
|
||||
| methods2.kt:4:1:5:1 | fooBarTopLevelMethod | methods2.kt:4:34:4:39 | y | 1 |
|
||||
| methods2.kt:8:5:9:5 | fooBarClassMethod | methods2.kt:8:27:8:32 | x | 0 |
|
||||
|
||||
Reference in New Issue
Block a user