Commit Graph

16 Commits

Author SHA1 Message Date
Tamas Vajk
af2614be84 Kotlin: Add array iterator tests 2022-08-25 09:17:50 +02:00
Chris Smowton
37543e7a86 Switch to expanding property initializers and init blocks in-place
Pros:
* <obinit> no longer emitted: one less function per class
* Parameters to the primary constructor, if any, are no longer referred to out of scope
* Simple primary constructor `val` and `var` declarations work as expected

Cons:
* If there are multiple secondary constructors, no primary constructor and long init blocks, there could be considerable duplicate extraction of those init blocks. Hopefully this case is very rare.
2022-05-10 19:51:20 +01:00
Chris Smowton
7cb6e19e44 Extract array update operations
These are of the form arrExpr[indexExpr] op= rhs
2022-05-10 19:51:18 +01:00
Chris Smowton
2fb54de269 Extract ordinary array get and set operations as ArrayAccesses, not calls 2022-05-10 19:51:18 +01:00
Chris Smowton
96f3ea460f Make varargs extraction more Java-like:
* Extract varargs as if they are ordinary positional arguments
* Adapt the QL that distinguishes varargs from ordinary arguments to account for Kotlin's varargs which can occur in the middle of the arg list
* Add a test checking dataflow through varargs which doesn't work yet due to array-get and array-set not being extracted as IndexExprs
* Extract the special case arrayOf(*x) as a clone call, which is (equivalent to) the Java lowering of that operation
2022-05-10 19:51:17 +01:00
Chris Smowton
70708d69bf Don't extract or call fake-override methods 2022-05-10 19:51:10 +01:00
Tamas Vajk
0978e522d0 Fix expected files 2022-05-10 19:51:10 +01:00
Tamas Vajk
f4c87cb79d Extract function expressions 2022-05-10 19:51:09 +01:00
Ian Lynagh
1719b921cf Kotlin: Accept test changes 2022-05-10 19:51:09 +01:00
Tamas Vajk
3a2f7bec1c Fix test expected files 2022-05-10 19:51:06 +01:00
Tamas Vajk
8b81ee7e59 Add array creation tests 2022-05-10 19:51:06 +01:00
Chris Smowton
ccf21b7183 Implement Java signature extraction 2022-05-10 19:51:04 +01:00
Chris Smowton
bde4534050 Only report locations without a source offset in non-source files
Also adjust tests that would otherwise report types with locations outside the source tree (i.e., for the most part in the standard library)
2022-05-10 19:51:03 +01:00
Chris Smowton
44bf35e623 Add and update tests 2022-05-10 19:51:03 +01:00
Chris Smowton
1b7e33b6e3 Remove Kotlin element and component type from arrays
Now that these are no longer required, array extraction can extract kt-types consistently with other parameterised classes.
2022-05-10 19:51:03 +01:00
Chris Smowton
70294bd26b Array types: distinguish (e.g.) Array<Int> from IntArray 2022-05-10 19:51:03 +01:00