Commit Graph

1400 Commits

Author SHA1 Message Date
Tamas Vajk
df595c05f2 WIP: revert some annotation extraction to get proper tree in printast 2022-12-09 10:31:34 +00:00
Tamas Vajk
fed770fcd1 Move kotlin annotations to negative child index 2022-12-09 10:31:33 +00:00
Tamas Vajk
96a407c9c5 WIP: extract annotations for all declarations 2022-12-09 10:31:33 +00:00
Tamas Vajk
3e1d4a7400 Add more annotation tests, add KClass to Class substitution 2022-12-09 10:31:33 +00:00
Tamas Vajk
b73bfd6133 Compilation fixup 2022-12-09 10:31:33 +00:00
Tamas Vajk
3b09cb2224 WIP: Extract annotation values (tests are missing) 2022-12-09 10:31:33 +00:00
Tamas Vajk
7b075c2190 WIP: extract annotations on classes, with constant values 2022-12-09 10:31:33 +00:00
Tamas Vajk
9fa840106f Extract annotation declarations 2022-12-09 10:31:33 +00:00
Tamas Vajk
d93dce0fa9 Kotlin: Fix extension and dispatch parameter order in $default functions 2022-12-09 10:29:51 +01:00
Tamas Vajk
6457e059f5 Kotlin: Fix extraction of $default extension functions 2022-12-09 10:26:44 +01:00
Chris Smowton
a79126268c Override modality when needed
In particular when generating an implementation based on an abstract prototype, the result is final, and an interface forwarder is open / Java's default modality.
2022-12-08 14:39:57 +00:00
Chris Smowton
045e3a2cf3 Kotlin: extract callable modality 2022-12-08 12:22:50 +00:00
Ian Lynagh
6267da44ae Kotlin: Improve diagnostic limit message
The message saying that the limit was exceeded is now given at the same
severity as the original message.
2022-12-07 18:33:35 +00:00
Chris Smowton
522a549d61 Improve debug logging when the external decl extractor handles an IrFile 2022-12-06 20:39:14 +00:00
Chris Smowton
d2e7797485 Rename to writeStubTrapFile 2022-12-06 20:39:03 +00:00
Chris Smowton
00f323c8bd Fix: extract directly exposed fields with static modifier 2022-12-06 20:32:10 +00:00
Chris Smowton
82f3c2f6d5 Mark the Companion field as static 2022-12-06 18:35:04 +00:00
Chris Smowton
d9dc8e38f9 Fix binary names for classes declared from source
Only top-level non-class declarations need the IrFile's expected class name inserting
2022-12-06 18:35:04 +00:00
Chris Smowton
910a1f872d Adjust opt-in required to use string-manipulation functions in Kotlin <= 1.5 2022-12-06 18:35:04 +00:00
Chris Smowton
540a2a623e Don't create stub trap files for anonymous or local classes, or unexpected kinds of top-level declaration 2022-12-06 18:35:04 +00:00
Chris Smowton
08e3431107 Also stub class files relating to file classes and top-level declarations 2022-12-06 18:35:04 +00:00
Chris Smowton
748637c2d8 Tidy and use version 0 for classes extracted from source 2022-12-06 18:35:03 +00:00
Chris Smowton
e34d72aee9 Kotlin: stub trap .class files when extracting a class from Kotlin source 2022-12-06 18:35:03 +00:00
Chris Smowton
3b5b121aeb Merge pull request #11553 from smowton/smowton/fix/kotlin-synthetic-noarg-constructor
Kotlin: Extract a no-arg constuctor whenever a Kotlin class has default values for all parameters
2022-12-06 10:07:31 +00:00
Chris Smowton
407e4cdd07 Don't create a default constructor for annotations, or classes that explicitly declare a no-arg constructor. 2022-12-05 16:17:51 +00:00
Chris Smowton
ff4baf096f Don't add name mangling to top-level internal functions
Turns out kotlinc only adds this sort of name mangling to class member functions
2022-12-02 20:16:19 +00:00
Chris Smowton
1c0494ec53 Extract a no-arg constuctor whenever a Kotlin class has default values for all parameters 2022-12-02 20:07:43 +00:00
Ian Lynagh
7eaef0cd3d Merge pull request #11436 from igfoo/igfoo/NamingConventionsRefTypes
Kotlin: Enable java/misnamed-type query
2022-11-29 18:39:18 +00:00
Ian Lynagh
3b31b50983 Kotlin: Rename compilerGeneratedKind to compilerGeneratedKindOverride 2022-11-29 13:07:47 +00:00
Ian Lynagh
a32363de79 Kotlin: Avoid giving a single class 2 compiler-generated kinds 2022-11-28 12:14:50 +00:00
Ian Lynagh
a423f5f695 Kotlin: Enable java/misnamed-type query
We used to get alerts for the class around a local function, a lambda,
or a function reference, which we give name "". Now those are marked as
compiler-generated, and the query ignores compiler-generated types.
2022-11-25 17:11:40 +00:00
Chris Smowton
8ec681e61c Kotlin: bump default CI version to 1.7.20
A bunch of test expectations change because 7f531d8426 means that we now see (a) local variable declarations with source locations covering only their identifier, not the whole statement, and (b) more SYNTHETIC_OFFSET values for the parts of a destructuring assignment
or initialiser, which show up as file.kt:0:0:0:0 in DbLocation form.
2022-11-25 10:19:26 +00:00
Ian Lynagh
184c903ec7 Merge pull request #11401 from igfoo/igfoo/unused
Kotlin: Remove an unused argument
2022-11-24 12:47:50 +00:00
Ian Lynagh
2d92cee26a Kotlin build system: Refactor jar-finder
We were globbing with a * in the filename, but that is not necessary.
2022-11-23 21:43:32 +00:00
Ian Lynagh
5b8b9044a5 Kotlin: Remove an unused argument 2022-11-23 18:47:53 +00:00
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
Ian Lynagh
7bf55c5846 Merge pull request #11251 from igfoo/igfoo/total
Kotlin: Add total number of diagnostics to telemetry
2022-11-14 15:09:57 +00:00
Ian Lynagh
fab2d30f38 Kotlin: Make emitDiagnostic private 2022-11-14 13:53:16 +00:00
Ian Lynagh
b20f8fc8c9 Kotlin: Add total number of diagnostics to telemetry 2022-11-14 12:27:54 +00:00
Ian Lynagh
b5c7d6bfcd Kotlin: Fix build on OS X 2022-11-11 14:57:36 +00:00
Ian Lynagh
7d54b542b5 Kotlin: Put extractor name in a resource rather than generating code 2022-11-11 14:04:14 +00:00
Ian Lynagh
2fb78565a7 Kotlin: Write version information to the database 2022-11-10 20:29:04 +00:00
Tamás Vajk
830be92f1d Merge pull request #11089 from tamasvajk/kotlin-enum-ctor-call
Kotlin: Extract missing arguments of enum constructor calls
2022-11-07 12:55:27 +01:00
Chris Smowton
1cd30847f6 Merge pull request #11121 from smowton/smowton/fix/java-wildcard-extraction
Kotlin: fix extraction of Java nested wildcards; wildcards in return types
2022-11-07 10:23:02 +00:00
Chris Smowton
68face8d46 Merge pull request #11130 from smowton/smowton/fix/kotlin-always-extract-file-labels
Kotlin: always populate the `files` table
2022-11-07 10:14:41 +00:00
Chris Smowton
587aa93f6d Merge pull request #11105 from smowton/smowton/fix/use-defaults-method-to-implement-jvmoverloads
Kotlin: use `$default` functions to implement `@JvmOverloads`
2022-11-07 09:54:16 +00:00
Tamas Vajk
7d927a7396 Adjust enum constructor argument extraction based on review 2022-11-07 10:07:05 +01:00
Tamas Vajk
fb5b344427 Fix failing build on early kotlin versions 2022-11-07 10:07:05 +01:00
Tamas Vajk
44e70afa85 Kotlin: Extract missing arguments of enum constructor calls 2022-11-07 10:07:04 +01:00
Chris Smowton
8fd4041511 Kotlin: always populate the files table
Previously individual top-level file declarations relied on their corresponding file-class to declare their `File` instance, but this can be scuppered by a Java extractor replacing that file-class and identifying a different file location.
2022-11-04 15:00:27 +00:00