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

Skip to content

Commit d5b4931

Browse files
committed
Kotlin: Tweak superTypes test to give better locations
1 parent 50c2d10 commit d5b4931

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

java/ql/test/kotlin/library-tests/classes/superTypes.expected

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
| classes.kt:81:16:81:38 | new Interface1(...) { ... } | classes.kt:59:1:59:23 | Interface1 |
2222
| classes.kt:85:16:85:25 | new Object(...) { ... } | file://<external>/Object.class:0:0:0:0 | Object |
2323
| classes.kt:89:16:89:44 | new Interface3<Integer>(...) { ... } | classes.kt:61:1:61:26 | Interface3<Integer> |
24-
| file://<external>/superChain.kt:1:1:1:33 | SuperChain1<T3,String> | file://<external>/Object.class:0:0:0:0 | Object |
25-
| file://<external>/superChain.kt:2:1:2:60 | SuperChain2<T5,String> | file://<external>/superChain.kt:1:1:1:33 | SuperChain1<T3,String> |
2624
| superChain.kt:1:1:1:33 | SuperChain1 | file://<external>/Object.class:0:0:0:0 | Object |
27-
| superChain.kt:2:1:2:60 | SuperChain2 | file://<external>/superChain.kt:1:1:1:33 | SuperChain1<T3,String> |
28-
| superChain.kt:3:1:3:60 | SuperChain3 | file://<external>/superChain.kt:2:1:2:60 | SuperChain2<T5,String> |
25+
| superChain.kt:1:1:1:33 | SuperChain1<T3,String> | file://<external>/Object.class:0:0:0:0 | Object |
26+
| superChain.kt:2:1:2:60 | SuperChain2 | superChain.kt:1:1:1:33 | SuperChain1<T3,String> |
27+
| superChain.kt:2:1:2:60 | SuperChain2<T5,String> | superChain.kt:1:1:1:33 | SuperChain1<T3,String> |
28+
| superChain.kt:3:1:3:60 | SuperChain3 | superChain.kt:2:1:2:60 | SuperChain2<T5,String> |

java/ql/test/kotlin/library-tests/classes/superTypes.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class ClassLocation extends Class {
55
override predicate hasLocationInfo(string path, int sl, int sc, int el, int ec) {
66
exists(string fullPath |
77
super.hasLocationInfo(fullPath, sl, sc, el, ec) |
8-
if this.fromSource()
8+
if exists(this.getFile().getRelativePath())
99
then path = fullPath
1010
else path = fullPath.regexpReplaceAll(".*/", "<external>/"))
1111
}

0 commit comments

Comments
 (0)