Commit Graph

454 Commits

Author SHA1 Message Date
Chris Smowton
ea9aa59627 Add test 2022-05-19 11:55:31 +01:00
Chris Smowton
8a90ddefbb Accept test changes
These are mainly moving the source locations and type specialisations in SAM-converted methods.
2022-05-19 11:55:31 +01:00
Chris Smowton
ada31f3075 Distinguish result type parameter names
This makes debugging a little easier.
2022-05-19 11:55:31 +01:00
Tamás Vajk
3b07fe70a1 Merge pull request #9174 from tamasvajk/kotlin-fix-isUnspecialised
Kotlin: Fix parent class lookup from field initializers in `isUnspecialised`
2022-05-17 10:48:52 +02:00
Marcono1234
4e1a73f4d9 Java: Rename FloatingPointLiteral to FloatLiteral
"Floating point" refers to both `double` and `float`, and is also used by
the JLS in this way. Therefore the old CodeQL class name for `float` literals
was misleading.
2022-05-16 22:06:04 +02:00
Tamas Vajk
8ebdaf1fc2 Kotlin: Fix parent class lookup from field initializers 2022-05-16 12:14:28 +02:00
Tamas Vajk
de133e80a9 Kotlin: add diagnostic test for 'Unexpected specialised instance of generic anonymous class' 2022-05-16 12:13:33 +02:00
Tamás Vajk
f7d2b2767c Merge pull request #9151 from tamasvajk/kotlin-comments-variables-1
Kotlin: Handle variables as comment owners
2022-05-16 09:32:19 +02:00
Chris Smowton
305ddb2169 Accept test changes 2022-05-13 17:44:26 +01:00
Chris Smowton
fbdd5a13c5 Autoformat 2022-05-13 17:40:58 +01:00
Chris Smowton
c76a774e35 Accept test changes 2022-05-13 17:40:58 +01:00
Chris Smowton
498d3700bd Update java/ql/test/kotlin/library-tests/field-initializer-flow/test.ql
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2022-05-13 17:40:58 +01:00
Chris Smowton
81baca2c17 Fix initializer field flow by extracting field finality 2022-05-13 17:40:58 +01:00
Tamas Vajk
7376ec5d42 Handle variables as comment owners 2022-05-13 13:58:06 +02:00
Chris Smowton
63dadd88aa Revert "Identify data classes during extraction"
This reverts commit a61ba65c9f2182a578a7f4dbdb1c1657197f16cd, pending
adding a proper upgrade script for the DB change.
2022-05-12 22:37:30 +01:00
Tamas Vajk
cc92c6517b Fix labels of extension function parameters 2022-05-12 22:37:06 +01:00
Tamas Vajk
a0f4960e31 Add test case for extension function called from java 2022-05-12 22:37:06 +01:00
Tamas Vajk
ccaafd74f3 Fix declaring type of companion field 2022-05-12 22:37:06 +01:00
Tamas Vajk
a8cf0383cf Add test for companion field declaring type 2022-05-12 22:37:06 +01:00
Tamas Vajk
8b1a7c845c Fix return type of <clinit> methods 2022-05-12 22:37:06 +01:00
Tamas Vajk
de003fd122 Add test for return type of <clinit> methods 2022-05-12 22:37:06 +01:00
Tamas Vajk
b0ee557a51 Fix expected test files 2022-05-12 22:37:06 +01:00
Tamas Vajk
59581439dd Fix colliding property accessor and function names 2022-05-12 22:37:06 +01:00
Tamas Vajk
a51c2c496f Add test with colliding property accessor and function names 2022-05-12 22:37:06 +01:00
Tamas Vajk
857a74cf14 Adjust class label generation to handle classes in field initializers 2022-05-12 22:37:06 +01:00
Tamas Vajk
394ec56d9d Add test case for local class declaration in field initializer 2022-05-12 22:37:06 +01:00
Chris Smowton
4ceb2f13c4 Add test 2022-05-12 22:37:06 +01:00
Chris Smowton
2600dcd182 Fix extracting type accesses relating to proprerty getters/setters and SAM-converted methods
These should be handled the same as regular methods: extract type accesses for parameters and methods only if we're extracting "from source", i.e. at some point we're descended from extractFileContents.
2022-05-12 22:37:06 +01:00
Tamas Vajk
538e05995a Fix dataflow for kotlin.Array.iterator() 2022-05-12 22:37:03 +01:00
Tamas Vajk
776322bac2 Add foreach dataflow tests 2022-05-12 22:36:28 +01:00
Chris Smowton
22e48ca39a Accept test changes 2022-05-12 22:36:28 +01:00
Chris Smowton
77056c9bff Add test expectations 2022-05-12 22:36:28 +01:00
Chris Smowton
ce87a89009 Replace Map and similar functions with their Java cousins
This didn't appear to be necessary because the Kotlin and Java versions of Map (for example) are designed to be compatible, but in certain cases their functions have the same erasure but not the same type (e.g. Map.getOrDefault(K, V) vs. Map.getOrDefault(Object, V).

These have different erasures which was leading to callable-binding inconsistencies.
2022-05-12 22:36:28 +01:00
Tamas Vajk
fa0bd0366c Fix extension property labels 2022-05-12 22:36:28 +01:00
Tamas Vajk
25fce5f6bb Identify data classes during extraction 2022-05-12 22:36:28 +01:00
Chris Smowton
1e78f2893c Add test for special method getters 2022-05-12 22:36:28 +01:00
Chris Smowton
134f88fe8e Accept test results 2022-05-12 22:36:27 +01:00
Tamas Vajk
4f256d2958 Change LambdaExpr::asMethod to return the big-arity invoke instead of the wrapper 2022-05-10 19:51:31 +01:00
Ian Lynagh
e0053cd471 Kotlin: qlformat a query 2022-05-10 19:51:30 +01:00
Tamas Vajk
3af8273620 Modify extraction of &&/|| to resugar it from when expression 2022-05-10 19:51:30 +01:00
Tamas Vajk
d33224a058 Add test case for missing CFG successor 2022-05-10 19:51:30 +01:00
Tamas Vajk
b66a3141f6 Extract functions using their name from JvmName annotation 2022-05-10 19:51:30 +01:00
Tamas Vajk
a24753f552 Extract final modifier on local variables 2022-05-10 19:51:30 +01:00
Tamas Vajk
4efb87a7dd Extract enum entry initializers 2022-05-10 19:51:30 +01:00
Tamas Vajk
fc5229a0a5 Extract type access expression for static field access in initializer 2022-05-10 19:51:29 +01:00
Tamas Vajk
c6a75957e9 Fix expected files, fix type access extraction of file level static declarations 2022-05-10 19:51:29 +01:00
Tamas Vajk
1e529b2563 Add missing type access expression for static field accesses 2022-05-10 19:51:29 +01:00
Tamas Vajk
246f228a3b Add static field access test 2022-05-10 19:51:29 +01:00
Tamas Vajk
f43296a157 Extract type access for enum value access 2022-05-10 19:51:29 +01:00
Tamas Vajk
b5c8d29e40 Extract enum field declarations 2022-05-10 19:51:29 +01:00