Commit Graph

141 Commits

Author SHA1 Message Date
Tamas Vajk
91972d1d1f Kotlin: Fix location (start position) of method calls 2022-10-31 21:08:15 +01:00
Chris Smowton
eb97735568 Merge pull request #10797 from smowton/smowton/fix/byte-short-inversion
Kotlin: fix bit-inversion operator for Byte and Short types
2022-10-17 15:05:57 +01:00
Chris Smowton
be53ec9b42 Accept test changes 2022-10-17 11:48:22 +01:00
Chris Smowton
1efcf38a34 Kotlin SAM conversion: tolerate property refs used to implement a SAM interface 2022-10-13 17:32:22 +01:00
Chris Smowton
429d400125 Kotlin: fix bit-inversion operator for Byte and Short types 2022-10-12 17:23:16 +01:00
Tamas Vajk
ea0a04a74f Kotlin: extract unary plus and minus operators 2022-10-04 15:18:35 +02:00
Tamas Vajk
2e72ec748f Kotlin: add numeric unary operator test cases 2022-10-04 15:18:35 +02:00
Tamas Vajk
ffc7e6b7b6 Extract bit not expression 2022-10-03 10:30:46 +02:00
Tamas Vajk
54b210f176 Extract logical not expression 2022-10-03 10:23:40 +02:00
Tamas Vajk
a2d0b38a6d Kotlin: extract all binary numeric operators 2022-10-03 09:52:00 +02:00
Tamas Vajk
121a5645b8 Kotlin: extract operator expression when operator is in method call form 2022-09-30 13:48:53 +02:00
Tamás Vajk
9358070ae9 Merge pull request #10506 from tamasvajk/kotlin-enum-type-access
Kotlin: Fix type access expressions in enum constructor calls
2022-09-27 12:42:30 +02:00
Tamas Vajk
01a2d16974 Kotlin: Fix type access expressions in enum constructor calls 2022-09-21 10:32:27 +02:00
Tamas Vajk
a6e44ed1cf Kotlin: extract suspend modifier and handle suspend SAM conversions 2022-09-19 13:36:28 +02:00
Tamas Vajk
3e58605e8e Kotlin: Add tests with suspend functions 2022-09-19 13:28:20 +02:00
Tamas Vajk
71cce9cf28 Kotlin: Extract error expression for enumValues<T> calls 2022-09-02 15:42:05 +02:00
Tamas Vajk
fd0d2ad767 Kotlin: Add test for enumValues call with type parameter 2022-09-02 15:40:03 +02:00
Chris Smowton
efbe264f93 Accept toInt/intValue and similar test changes 2022-06-14 21:44:54 +01:00
Chris Smowton
c1592cb1dc Accept test changes 2022-06-02 10:31:35 +01:00
Chris Smowton
6ea87cd718 Accept test changes 2022-05-27 22:05:57 +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
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
3af8273620 Modify extraction of &&/|| to resugar it from when expression 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
Chris Smowton
f3bd89a5cf Adjust test expectations 2022-05-10 19:51:29 +01:00
Tamas Vajk
6ab86a1f46 Fix expected test files after 1.6.20 upgrade 2022-05-10 19:51:27 +01:00
Tamas Vajk
613d81d231 Extract static modifier and missing type access qualifier for static calls 2022-05-10 19:51:26 +01:00
Tamas Vajk
1317d2d578 Fix DB inconsistencies with KFunction and KFunction::invoke call extraction 2022-05-10 19:51:25 +01:00
Tamas Vajk
cf0be05b44 Add property reference invoke method implementation 2022-05-10 19:51:25 +01:00
Tamas Vajk
5a5d0e15eb Extract calls to big-arity lambda's invoke by converting the artificial invoke to the existing one
Big arity lambda calls in IR look like standard method calls to an `invoke` with N arguments. However, this method doesn't exist in JVM, so instead we need to extract a call to `FunctionN.invoke(Object[])`.
2022-05-10 19:51:24 +01:00
Tamas Vajk
222f2415e2 Fix local function reference extraction 2022-05-10 19:51:24 +01:00
Tamas Vajk
b26044b327 Change extension receiver this access to be a parameter access 2022-05-10 19:51:23 +01:00
Tamas Vajk
21f6867cd4 Add test cases for delegating properties to other properties 2022-05-10 19:51:23 +01:00
Tamas Vajk
90ca47a46b Extract local delegated property reference 2022-05-10 19:51:23 +01:00
Tamas Vajk
a7e6ec9d02 Add test case for delegated properties initialized through provideDelegate operator 2022-05-10 19:51:22 +01:00
Tamas Vajk
a3992950b1 Add delegated property call tests 2022-05-10 19:51:22 +01:00
Tamas Vajk
126d780f34 Add delegated property declaration test 2022-05-10 19:51:22 +01:00
Tamas Vajk
78b4c9403d Add lazy local delegated property test case 2022-05-10 19:51:22 +01:00
Tamas Vajk
f8343b8cc7 Extract local delegated properties 2022-05-10 19:51:22 +01:00
Tamas Vajk
9597932112 Add test that calls a local function multiple times 2022-05-10 19:51:22 +01:00
Tamas Vajk
a8f595c50a Refactor type access extraction 2022-05-10 19:51:21 +01:00
Tamas Vajk
92e59a3ae1 Add SAM conversion tests 2022-05-10 19:51:21 +01:00
Tamas Vajk
a70ade224f Fix (generic) type access extraction for lambdas 2022-05-10 19:51:21 +01:00
Tamas Vajk
4af12e7c9d Change array.get calls to array indexing in FunctionN.invoke body 2022-05-10 19:51:20 +01:00
Tamas Vajk
4e18974889 Fix type access expression extraction for function/property references 2022-05-10 19:51:20 +01:00
Chris Smowton
73c5f8c591 Accept more test changes 2022-05-10 19:51:20 +01: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
8d8a2482f1 Accept test changes
These are just ordering changes because the bounds of assignment statements relative to their operands have changed.
2022-05-10 19:51:20 +01:00