Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 547b60d

Browse files
committed
Kotlin: Add paramTypes test
1 parent d5b4931 commit 547b60d

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
| superChain.kt:1:1:1:33 | SuperChain1 | 0 | superChain.kt:1:24:1:25 | T1 |
2+
| superChain.kt:1:1:1:33 | SuperChain1 | 1 | superChain.kt:1:28:1:29 | T2 |
3+
| superChain.kt:1:1:1:33 | SuperChain1<T3,String> | 0 | superChain.kt:2:24:2:25 | T3 |
4+
| superChain.kt:1:1:1:33 | SuperChain1<T3,String> | 1 | file://<external>/String.class:0:0:0:0 | String |
5+
| superChain.kt:2:1:2:60 | SuperChain2 | 0 | superChain.kt:2:24:2:25 | T3 |
6+
| superChain.kt:2:1:2:60 | SuperChain2 | 1 | superChain.kt:2:28:2:29 | T4 |
7+
| superChain.kt:2:1:2:60 | SuperChain2<T5,String> | 0 | superChain.kt:3:24:3:25 | T5 |
8+
| superChain.kt:2:1:2:60 | SuperChain2<T5,String> | 1 | file://<external>/String.class:0:0:0:0 | String |
9+
| superChain.kt:3:1:3:60 | SuperChain3 | 0 | superChain.kt:3:24:3:25 | T5 |
10+
| superChain.kt:3:1:3:60 | SuperChain3 | 1 | superChain.kt:3:28:3:29 | T6 |
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import java
2+
3+
// Stop external filepaths from appearing in the results
4+
class ClassLocation extends Class {
5+
override predicate hasLocationInfo(string path, int sl, int sc, int el, int ec) {
6+
exists(string fullPath |
7+
super.hasLocationInfo(fullPath, sl, sc, el, ec) |
8+
if exists(this.getFile().getRelativePath())
9+
then path = fullPath
10+
else path = fullPath.regexpReplaceAll(".*/", "<external>/"))
11+
}
12+
}
13+
14+
from ParameterizedClass c, int i
15+
where c.getSourceDeclaration().fromSource()
16+
select c, i, c.getTypeArgument(i)
17+

0 commit comments

Comments
 (0)