Commit Graph

39 Commits

Author SHA1 Message Date
Chris Smowton
cf34dbd276 Kotlin: format string literals like the Java annotaton extractor
Java's regular strings are formatted as they appear in source, but we don't easily have this information available in Kotlin. During annotation extraction however it guesses a source rendering because the source is not necessarily available. By formatting to match the annotation extractor, we prepare to ensure consistency with a Java database
when extracting annotations as seen by Kotlin.
2022-11-17 17:28:17 +00:00
Tamas Vajk
44e70afa85 Kotlin: Extract missing arguments of enum constructor calls 2022-11-07 10:07:04 +01:00
Chris Smowton
e868cdf91b Merge pull request #9876 from smowton/smowton/feature/interface-forwarding
Kotlin: implement default interface forwarding
2022-10-20 10:17:47 +01:00
Chris Smowton
c6b62c934b Merge pull request #10853 from smowton/smowton/fix/specialised-anon-classes
Kotlin: extract called private methods of specialised types, and specialised instances of anonymous types
2022-10-19 16:48:28 +01:00
Chris Smowton
fff9a75ff8 Accept test changes 2022-10-17 18:38:13 +01:00
Chris Smowton
f358be85eb Accept test changes 2022-10-17 18:23:10 +01:00
Chris Smowton
be53ec9b42 Accept test changes 2022-10-17 11:48:22 +01: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
d6e31af985 Kotlin: Fix non-nested local class extraction 2022-09-23 11:23:21 +02:00
Tamas Vajk
b4eb4ec837 Kotlin: Add test case for top level local class extraction 2022-09-23 11:19:09 +02:00
Tamas Vajk
01a2d16974 Kotlin: Fix type access expressions in enum constructor calls 2022-09-21 10:32:27 +02:00
Tamas Vajk
b8b0fd8a74 Kotlin: Fix isUnspecialised to handle generic classes inside generic methods 2022-09-09 14:32:38 +02:00
Tamas Vajk
3267d7c96e Kotlin: Add test case with various nested generics 2022-09-09 11:09:50 +02:00
Chris Smowton
570e418b22 Fix ordering PrintAst nodes 2022-06-30 16:07:32 +01:00
Tamas Vajk
b0ee557a51 Fix expected test files 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
Tamas Vajk
4efb87a7dd Extract enum entry initializers 2022-05-10 19:51:30 +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
613d81d231 Extract static modifier and missing type access qualifier for static calls 2022-05-10 19:51:26 +01:00
Tamas Vajk
3813e6fc10 Fix expected files 2022-05-10 19:51:26 +01:00
Tony Torralba
f8ad93a530 Add test case for local variable in anonymous init
Also fix another instance of the same issue in extractLocalTypeDeclStmt
2022-05-10 19:51:25 +01:00
Tony Torralba
1926bef050 Don't extract static init when the class already contains an anonymous init 2022-05-10 19:51:25 +01:00
Tony Torralba
1f812f856c Extract static initializers of inner classes 2022-05-10 19:51:25 +01:00
Chris Smowton
96908d153d Accept and amend check for anonymous types with type parameters 2022-05-10 19:51:24 +01:00
Chris Smowton
c0f3988aaa Tolerate nullable references to anonymous classes
This also adds a test case illustrating when this can arise
2022-05-10 19:51:24 +01:00
Chris Smowton
2ea1a6c1f0 Adjust test expectations
These all just refer to re-adding empty blocks for classes whose constructors have no initializer statements for simplicity's sake.
2022-05-10 19:51:24 +01:00
Tony Torralba
64531dd717 Fix AST representation of WhenExpr and WhenBranch 2022-05-10 19:51:22 +01:00
Tamas Vajk
2d0bb43efe Do not extract local function containers as anonymous classes 2022-05-10 19:51:22 +01:00
Tamas Vajk
a70ade224f Fix (generic) type access extraction for lambdas 2022-05-10 19:51:21 +01:00
Tamas Vajk
4e18974889 Fix type access expression extraction for function/property references 2022-05-10 19:51:20 +01:00
Chris Smowton
f513fdce7b Accept 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
Tamas Vajk
4adf5829e4 Fix expected files 2022-05-10 19:51:16 +01:00
Ian Lynagh
579c590ea6 Kotlin: Accept test changes following "casting" operator changes 2022-05-10 19:51:13 +01:00
Ian Lynagh
368c330ecf Kotlin: Accept test changes following file-class fixes 2022-05-10 19:51:12 +01:00
Tamas Vajk
afd71a00d0 Fix extraction of function references without dispatch receiver 2022-05-10 19:51:12 +01:00
Tamas Vajk
ef2795c88b Add ktLocalFunction relation and tests for local and anonymous classes 2022-05-10 19:51:11 +01:00
Tamas Vajk
e0bf7d8246 Extract local class declarations 2022-05-10 19:51:11 +01:00