mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
Kotlin: Add paramTypes test
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
| superChain.kt:1:1:1:33 | SuperChain1 | 0 | superChain.kt:1:24:1:25 | T1 |
|
||||
| superChain.kt:1:1:1:33 | SuperChain1 | 1 | superChain.kt:1:28:1:29 | T2 |
|
||||
| superChain.kt:1:1:1:33 | SuperChain1<T3,String> | 0 | superChain.kt:2:24:2:25 | T3 |
|
||||
| superChain.kt:1:1:1:33 | SuperChain1<T3,String> | 1 | file://<external>/String.class:0:0:0:0 | String |
|
||||
| superChain.kt:2:1:2:60 | SuperChain2 | 0 | superChain.kt:2:24:2:25 | T3 |
|
||||
| superChain.kt:2:1:2:60 | SuperChain2 | 1 | superChain.kt:2:28:2:29 | T4 |
|
||||
| superChain.kt:2:1:2:60 | SuperChain2<T5,String> | 0 | superChain.kt:3:24:3:25 | T5 |
|
||||
| superChain.kt:2:1:2:60 | SuperChain2<T5,String> | 1 | file://<external>/String.class:0:0:0:0 | String |
|
||||
| superChain.kt:3:1:3:60 | SuperChain3 | 0 | superChain.kt:3:24:3:25 | T5 |
|
||||
| superChain.kt:3:1:3:60 | SuperChain3 | 1 | superChain.kt:3:28:3:29 | T6 |
|
||||
17
java/ql/test/kotlin/library-tests/classes/paramTypes.ql
Normal file
17
java/ql/test/kotlin/library-tests/classes/paramTypes.ql
Normal file
@@ -0,0 +1,17 @@
|
||||
import java
|
||||
|
||||
// Stop external filepaths from appearing in the results
|
||||
class ClassLocation extends Class {
|
||||
override predicate hasLocationInfo(string path, int sl, int sc, int el, int ec) {
|
||||
exists(string fullPath |
|
||||
super.hasLocationInfo(fullPath, sl, sc, el, ec) |
|
||||
if exists(this.getFile().getRelativePath())
|
||||
then path = fullPath
|
||||
else path = fullPath.regexpReplaceAll(".*/", "<external>/"))
|
||||
}
|
||||
}
|
||||
|
||||
from ParameterizedClass c, int i
|
||||
where c.getSourceDeclaration().fromSource()
|
||||
select c, i, c.getTypeArgument(i)
|
||||
|
||||
Reference in New Issue
Block a user