Commit Graph

36 Commits

Author SHA1 Message Date
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
de9648e515 Accept test changes
- generics gains extra excluded generic "specialisations" (specifically raw types)
- java_properties stops overwriting the Java extractor's output, which specifically flags isDefConstructor which kotlinc does not
- types naturally gains a lot of new raw types
2022-05-10 19:51:27 +01:00
Tamas Vajk
0726b6410f Change location of methods inside parameterized types 2022-05-10 19:51:26 +01:00
Tamas Vajk
3813e6fc10 Fix expected files 2022-05-10 19:51:26 +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
Chris Smowton
dc64b536b3 Ensure that initializers are only printed once in a PrintAst run
Otherwise the output becomes a DAG not a tree. Java achieves the same by omitting all PrintAst of `<obinit>` routines.
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
024f8c651e Accept test changes 2022-05-10 19:51:14 +01:00
Chris Smowton
221fa37081 Fix naming of local class instances that fall within generic functions 2022-05-10 19:51:13 +01:00
Tamas Vajk
646fc58c25 Fix expected test files 2022-05-10 19:51:13 +01:00
Tamas Vajk
8e31bd8ec7 Update expected files after rebase 2022-05-10 19:51:13 +01:00
Tamas Vajk
9e21fa838e Test case for generic inner type instantiation 2022-05-10 19:51:13 +01:00
Chris Smowton
978978b86a Accept test changes 2022-05-10 19:51:13 +01:00
Tamas Vajk
1e64887903 Extract field receiver in field read/write 2022-05-10 19:51:11 +01:00
Ian Lynagh
7c03ed99dc Java/Kotlin: Add File.is{,Java,Kotlin}SourceFile() 2022-05-10 19:51:10 +01:00
Chris Smowton
70708d69bf Don't extract or call fake-override methods 2022-05-10 19:51:10 +01:00
Chris Smowton
0c7075c749 Give getters and setters their jvm-lowered names 2022-05-10 19:51:10 +01:00
Chris Smowton
248011e828 Improve generics test to indicate callee decltypes 2022-05-10 19:51:10 +01:00
Chris Smowton
25674247a2 Accept test changes relating to generic constructors 2022-05-10 19:51:10 +01:00
Chris Smowton
bb3049a686 Extract generic method prototypes
These feature substituted types according to their declaring generic specialisation, with wildcards that reach top-level being converted to their upper or lower bound depending on usage context.

This commit also includes an incidental fix such that constructors declare their return-type as unit, consistent with the Java extractor.
2022-05-10 19:51:10 +01:00
Ian Lynagh
b32ac935f6 Revert "Merge pull request #160 from github/smowton/feature/type-substitution-prototypes"
This reverts commit 1dd83a3f0fab407fe94a09fc517c516ed24b1d0c, reversing
changes made to 22aebf8128bfe20bb89e5ecc11e0e8cdd65bf317.
2022-05-10 19:51:09 +01:00
Chris Smowton
2f8b8fadc3 Extract generic method prototypes
These feature substituted types according to their declaring generic specialisation, with wildcards that reach top-level being converted to their upper or lower bound depending on usage context.

This commit also includes an incidental fix such that constructors declare their return-type as unit, consistent with the Java extractor.
2022-05-10 19:51:09 +01:00
Tamas Vajk
16ba27c476 Extract local functions 2022-05-10 19:51:08 +01:00
Chris Smowton
8accd35ce8 Substitute in generic type arguments when extracting the supertypes of an instantiated type 2022-05-10 19:51:08 +01:00
Chris Smowton
ccf21b7183 Implement Java signature extraction 2022-05-10 19:51:04 +01:00
Chris Smowton
2bcc3d425e Amend a test to avoid external paths and accept changes 2022-05-10 19:51:03 +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
Ian Lynagh
e120059a18 Kotlin: Accept test changes 2022-05-10 19:51:00 +01:00
Ian Lynagh
db0360d211 Kotlin: Accept test changes 2022-05-10 19:51:00 +01:00
Ian Lynagh
45cade8ff8 Kotlin: Accept/update tests 2022-05-10 18:46:01 +01:00
Tamas Vajk
1a6d693618 Implement review findings + fix ID of nested types 2022-05-10 18:46:00 +01:00
Tamas Vajk
85e713fa31 Extract generic type parameters as reference types even for primitive Kotlin types + add simplified array extraction 2022-05-10 18:46:00 +01:00
Tamas Vajk
b542769fe9 Fix constructor extraction and extract type arguments of constructor calls 2022-05-10 18:46:00 +01:00
Tamas Vajk
936c29b70c Handle star type argument 2022-05-10 18:46:00 +01:00
Tamas Vajk
8dff527a0e WIP: type arg extraction 2022-05-10 18:46:00 +01:00
Tamas Vajk
0c6e20928c Kotlin: extract type parameters 2022-05-10 18:46:00 +01:00