Commit Graph

16 Commits

Author SHA1 Message Date
Tamas Vajk
b66a3141f6 Extract functions using their name from JvmName annotation 2022-05-10 19:51:30 +01:00
Ian Lynagh
77fec17a36 Kotlin: Autoformat QL 2022-05-10 19:51:25 +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
Ian Lynagh
368c330ecf Kotlin: Accept test changes following file-class fixes 2022-05-10 19:51:12 +01:00
Tamas Vajk
aa0ddeb29a Fix external type locations in tests 2022-05-10 19:51:12 +01:00
Chris Smowton
70708d69bf Don't extract or call fake-override methods 2022-05-10 19:51:10 +01:00
Ian Lynagh
c35f871c46 Kotlin: Add tests for file classes 2022-05-10 19:51:09 +01:00
Chris Smowton
070c0a03f4 Add .fromSource() qualifier to tests 2022-05-10 19:50:58 +01:00
Chris Smowton
124dcb0e5f Update test expectations 2022-05-10 19:50:58 +01:00
Ian Lynagh
14a10564f3 Kotlin: Fix File locations, and fromSource/hasSourceLocation for Kotlin code 2022-05-10 18:46:01 +01:00
Ian Lynagh
45cade8ff8 Kotlin: Accept/update tests 2022-05-10 18:46:01 +01:00
Ian Lynagh
90eccc634b Kotlin: Refactor locations
Amongst other tidyups, we now generate correct "unknown location"s
2022-05-10 18:45:56 +01:00
Ian Lynagh
d10024e7e9 Kotlin: Don't make a *Kt class unless we need one 2022-05-10 18:45:54 +01:00
Ian Lynagh
f0e2de1fa9 Kotlin: Add file classes
Kotlin invents a class for each file that has a top-level
functionp/property, so that Java can use them.
2022-05-10 18:45:54 +01:00
Ian Lynagh
f5e2826b9f Kotlin: Accept test changes 2022-05-10 18:45:53 +01:00
Ian Lynagh
4721ccd965 Kotlin: Add tests 2022-05-10 18:45:51 +01:00