Commit Graph

605 Commits

Author SHA1 Message Date
Ian Lynagh
8ab52dba83 Kotlin: Don't write the erasure relation
It's no longer used
2024-10-29 11:32:18 +00:00
Ian Lynagh
b5bfd06624 Kotlin: Fix for 2.1.0-Beta2
We need to catch a different exception now.
2024-10-15 13:17:26 +01:00
Ian Lynagh
2a5b48930a Kotlin: Fix the return type for lambda constructors 2024-09-27 11:21:40 +01:00
Ian Lynagh
a6fce19b0c Kotlin: Fix build with 2.1.0-Beta1 2024-09-25 15:23:35 +01:00
Ian Lynagh
0be52f9660 Kotlin: Follow removal of sourceid column of the fields relation 2024-09-24 14:06:53 +01:00
Ian Lynagh
b1f5f9a5cd Kotlin: Follow removal of typeVars.kind 2024-09-17 11:39:06 +01:00
Ian Lynagh
1b40b595fa Kotlin: Handle forAllMethodsWithBody being removed
Per:
    commit 28797a31b4d9b7f5c99d162ab19fc6b46f8e529d
    Author: Alexander Udalov <alexander.udalov@jetbrains.com>
    Date:   Thu Feb 1 13:22:48 2024 +0100

    JVM: refactor JvmDefaultMode, remove/rename some entries

    [...]
    - remove forAllMethodsWithBody because its behavior is now equivalent to
      isEnabled
    [...]
2024-02-14 11:55:54 +00:00
Ian Lynagh
79d9109850 Merge pull request #15428 from igfoo/igfoo/catch_illegal_arg
Kotlin: Catch/ignore a IllegalArgumentException exception
2024-01-29 11:27:38 +00:00
Ian Lynagh
c0a9c11101 Kotlin: Catch/ignore a IllegalArgumentException exception
This works around
    https://youtrack.jetbrains.com/issue/KT-63847/K2-IllegalStateException-IrFieldPublicSymbolImpl-for-java.time-Clock.OffsetClock.offset0-is-already-bound
2024-01-25 16:04:08 +00:00
Ian Lynagh
b3f8167973 Kotlin: Don't warn if we can't find a label for a fake owner
The fake owner probably just wasn't extracted
2024-01-10 16:39:02 +00:00
Ian Lynagh
bf611feab3 Kotlin: Reformat code
Using:
    java -jar ktfmt-0.46-jar-with-dependencies.jar --kotlinlang-style java/kotlin-extractor/**/*.kt
2024-01-09 15:33:41 +00:00
Ian Lynagh
95f336c05b Merge pull request #14393 from igfoo/igfoo/no1.4
Kotlin: Remove 1.4 compatibility
2024-01-09 12:20:15 +00:00
Ian Lynagh
02734be287 Kotlin: Fix building with 2.0.255 snapshots
A couple of extension functions were moved
2024-01-08 13:25:25 +00:00
Ian Lynagh
69cfc79561 Kotlin: Add LighterAST support to numlines extraction 2023-11-23 12:02:27 +00:00
Ian Lynagh
1998e29639 Kotlin 2: isFake is currently broken, so assume not fake for now
We'll want to find a Kotlin-2-compatible replacement for this.
2023-11-21 14:37:53 +00:00
Ian Lynagh
6bd269502f Kotlin: Pull out a tryIsHiddenToOvercomeSignatureClash method 2023-11-21 14:36:10 +00:00
Ian Lynagh
5c36e63dfe Kotlin: Fix findTopLevelFunctionOrWarn for Kotlin 2
The AST when the parent class is a file class is different in
Kotlin 2 mode.
2023-11-17 15:25:53 +00:00
Ian Lynagh
d34b85cf03 Kotlin: Remove 1.4 compatibility
We now only build with >= 1.5
2023-10-06 15:17:32 +01:00
Ian Lynagh
e9482fb096 Kotlin: Differentiate 2 error messages 2023-09-28 14:59:21 +01:00
Ian Lynagh
52d924924b Kotlin: Extract LighterAST comments as well as PSI comments 2023-09-14 14:24:52 +01:00
Ian Lynagh
5ea4c44701 Kotlin: Give some more informative errors messages 2023-09-05 12:33:49 +01:00
Ian Lynagh
d511d46cde Kotlin: Use packageFqName rather than fqName
Upstream master says:
   error: using 'fqName: FqName' is an error. Please use `packageFqName` instead
2023-08-31 19:28:05 +01:00
Ian Lynagh
a8b69e5b55 Kotlin: Fix build on old versions 2023-08-15 11:30:23 +01:00
Ian Lynagh
eb27428514 Kotlin: Handle IrExternalPackageFragment when dealing with external decls 2023-08-14 17:37:48 +01:00
Ian Lynagh
72af8ac1e2 Kotlin: Switch to useDeclarationParentOf
This lets us handle Kotlin 2 declarations whose parent is an
IrExternalPackageFragment, indicating that they are in a (multi)file
class.
2023-08-14 17:02:49 +01:00
Ian Lynagh
4f336820de Kotlin: Start handling IrExternalPackageFragment parents 2023-08-14 17:02:48 +01:00
Ian Lynagh
58da62e244 Kotlin: Handle null parent IDs in getFunctionLabel correctly 2023-08-10 18:49:10 +01:00
Ian Lynagh
0eb6d1c76e Kotlin: useFunction might return null 2023-08-09 13:45:15 +01:00
Ian Lynagh
3e86c4c39e Kotlin: Allow extractNewExpr to return null 2023-08-07 18:59:51 +01:00
Ian Lynagh
01a512b677 Kotlin: Pass on a parentId 2023-07-28 17:46:05 +01:00
Ian Lynagh
e8f4aee1cf Kotlin: Remove some redundant braces 2023-07-28 17:02:24 +01:00
Ian Lynagh
6dedd9286c Kotlin: Record "file class" info from the compiler
We were making file classes when the parent was a file, but not when it
was a class marked as one.
2023-07-11 15:58:42 +01:00
Ian Lynagh
fcf003ceb5 Revert "Kotlin: Remove a use of ObsoleteDescriptorBasedAPI"
This reverts commit a50d804ad7.
2023-06-30 19:32:37 +01:00
Ian Lynagh
a50d804ad7 Kotlin: Remove a use of ObsoleteDescriptorBasedAPI
This isn't supported in Kotlin 2 mode, but removing this code doesn't
affect any tests.
2023-06-28 13:48:43 +01:00
Ian Lynagh
0d05f50aaa Kotlin: Remove an expected-no-getter exception
We're not sure why it was necessary.
2023-06-22 18:12:13 +01:00
Ian Lynagh
64e591a823 Merge pull request #13482 from igfoo/igfoo/conc
Kotlin: Avoid another cause of ConcurrentModificationException with 1.9
2023-06-19 12:57:25 +01:00
Ian Lynagh
1f538cced3 Kotlin: Handle IrSyntheticBodyKind.ENUM_ENTRIES
Generated by Kotlin 1.9 for some of our tests.
2023-06-19 10:36:29 +01:00
Ian Lynagh
096e9a4ba4 Kotlin: Avoid another cause of ConcurrentModificationException with 1.9 2023-06-16 17:06:54 +01:00
Ian Lynagh
d3941ae935 Kotlin: Avoid using deprecated APIs 2023-06-09 18:14:09 +01:00
Ian Lynagh
0090429d53 Kotlin: Support 1.9.0 2023-05-31 19:43:45 +01:00
Chris Smowton
3514dd1e4d Java: merge the @class and @interface database types and tables
This will allow the extractor to emit class(id, ...) when all it knows about a class is its name, due to not having it available on the classpath. Previously it would have had to guess whether it belonged to @class or @interface, possibly introducing an inconsistency.
2023-02-14 17:21:23 +00:00
Ian Lynagh
c4119761cc Kotlin: Another 1.8 build fix 2023-01-10 14:41:30 +00:00
Ian Lynagh
f7d8d16ed3 Kotlin: Fix build for 1.8.0-Beta
The build no longer works for Kotlin < 1.8: We get

    error: class 'org.jetbrains.kotlin.ir.IrElement' was compiled
           with an incompatible version of Kotlin. The binary version
           of its metadata is 1.8.0, expected version is 1.6.0.
2023-01-10 14:41:29 +00:00
Chris Smowton
406a12e797 Remove unused function DeclarationStack.findFirst 2022-12-13 09:34:36 +00:00
Chris Smowton
dd86f7a696 Kotlin: Revert type erasure within $default functions
This imprecise implementation turned out to cause linkage errors, e.g. when type variables in the signatures of member methods were inappropriately erased. For the time being we accept that $default methods despite having erased signatures in keeping with their JVM representation can contain expressions whose types make reference to their
surrounding function or class' type variables, even though they should be out of scope since $default methods are static and don't have type parameters, and need to cope with the inconsistency in QL.
2022-12-12 18:33:22 +00:00
Chris Smowton
77004f3e15 Merge pull request #11258 from smowton/smowton/feature/kotlin-annotation-extraction
Kotlin: extract annotations
2022-12-12 09:52:49 +00:00
Chris Smowton
5282c86158 Apply review feedback 2022-12-09 18:07:14 +00:00
Chris Smowton
93ea433c49 Add missing imports 2022-12-09 10:33:06 +00:00
Chris Smowton
78234c52fd Ensure constructors don't get nullability annotations 2022-12-09 10:33:06 +00:00
Chris Smowton
f5dc5155f9 Don't introduce @NotNull on Kotlin methods that already have that annotation
This usually can't happen, but delegates pointing at Java appear to be synthesised with this normally-hidden annotation
2022-12-09 10:33:05 +00:00