Kotlin: Tweak superTypes test to give better locations

This commit is contained in:
Ian Lynagh
2021-11-25 15:21:03 +00:00
parent 50c2d10777
commit d5b4931b7f
2 changed files with 5 additions and 5 deletions

View File

@@ -21,8 +21,8 @@
| classes.kt:81:16:81:38 | new Interface1(...) { ... } | classes.kt:59:1:59:23 | Interface1 |
| classes.kt:85:16:85:25 | new Object(...) { ... } | file://<external>/Object.class:0:0:0:0 | Object |
| classes.kt:89:16:89:44 | new Interface3<Integer>(...) { ... } | classes.kt:61:1:61:26 | Interface3<Integer> |
| file://<external>/superChain.kt:1:1:1:33 | SuperChain1<T3,String> | file://<external>/Object.class:0:0:0:0 | Object |
| file://<external>/superChain.kt:2:1:2:60 | SuperChain2<T5,String> | file://<external>/superChain.kt:1:1:1:33 | SuperChain1<T3,String> |
| superChain.kt:1:1:1:33 | SuperChain1 | file://<external>/Object.class:0:0:0:0 | Object |
| superChain.kt:2:1:2:60 | SuperChain2 | file://<external>/superChain.kt:1:1:1:33 | SuperChain1<T3,String> |
| superChain.kt:3:1:3:60 | SuperChain3 | file://<external>/superChain.kt:2:1:2:60 | SuperChain2<T5,String> |
| superChain.kt:1:1:1:33 | SuperChain1<T3,String> | file://<external>/Object.class:0:0:0:0 | Object |
| superChain.kt:2:1:2:60 | SuperChain2 | superChain.kt:1:1:1:33 | SuperChain1<T3,String> |
| superChain.kt:2:1:2:60 | SuperChain2<T5,String> | superChain.kt:1:1:1:33 | SuperChain1<T3,String> |
| superChain.kt:3:1:3:60 | SuperChain3 | superChain.kt:2:1:2:60 | SuperChain2<T5,String> |

View File

@@ -5,7 +5,7 @@ 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 this.fromSource()
if exists(this.getFile().getRelativePath())
then path = fullPath
else path = fullPath.regexpReplaceAll(".*/", "<external>/"))
}