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

Skip to content

Commit 50c2d10

Browse files
committed
Kotlin: Improve the supertypes test
Note the line | file://<external>/superChain.kt:2:1:2:60 | SuperChain2<T5,String> | file://<external>/superChain.kt:1:1:1:33 | SuperChain1<T3,String> | is currently wrong; the supertype of SuperChain2<T5,String> should be SuperChain1<T5,String>.
1 parent c05aa7b commit 50c2d10

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +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> |
2426
| superChain.kt:1:1:1:33 | SuperChain1 | file://<external>/Object.class:0:0:0:0 | Object |
2527
| superChain.kt:2:1:2:60 | SuperChain2 | file://<external>/superChain.kt:1:1:1:33 | SuperChain1<T3,String> |
2628
| superChain.kt:3:1:3:60 | SuperChain3 | file://<external>/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
@@ -12,7 +12,7 @@ class ClassLocation extends Class {
1212
}
1313

1414
from Class c, Type superType
15-
where c.fromSource() and
15+
where c.getSourceDeclaration().fromSource() and
1616
superType = c.getASupertype()
1717
select c, superType
1818

0 commit comments

Comments
 (0)