Commit Graph

6451 Commits

Author SHA1 Message Date
Ian Lynagh
4cfda638cb Kotlin: Use -Xopt-in=kotlin.RequiresOptIn when compiling 2022-05-10 19:51:26 +01:00
Ian Lynagh
37cf36bc33 Kotlin: useDeclarationParent: Don't use fakeLabel 2022-05-10 19:51:26 +01:00
Ian Lynagh
5c8e0ff49b Kotlin: extractTypeParameter: Don't use fakeLabel 2022-05-10 19:51:26 +01:00
Tamás Vajk
48b6c61fdb Quality improvement: add explicit this in QL
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2022-05-10 19:51:26 +01:00
Tamas Vajk
e0afaa462e Fix Parameter.getACallArgument for parameters of extension methods 2022-05-10 19:51:26 +01:00
Ian Lynagh
1e8d077522 Kotlin: Fix some warnings 2022-05-10 19:51:26 +01:00
Ian Lynagh
f75e711474 Kotlin: Make the build noisier
We need to capture output for some commands we run during the build,
but this ended up being refactored so that we ate the output for all
commands. This means that we don't see warnings from the compiler.

Now we not only show the output, but we also print what commands we are
running.
2022-05-10 19:51:26 +01:00
Ian Lynagh
05c062da99 Kotlin: Stop useValueDeclaration returning fakeLabel 2022-05-10 19:51:26 +01:00
Ian Lynagh
c5e73cd6df Kotlin: Add TypeResult.cast() 2022-05-10 19:51:26 +01:00
Ian Lynagh
86c31cb2e8 Kotlin: Add Label.cast() 2022-05-10 19:51:26 +01:00
Tamas Vajk
c89f3163f9 Revert PrintAst changes related to wrong locations 2022-05-10 19:51:26 +01:00
Tamas Vajk
026ce2a27a Fix location of parameters in methods of parameterized types 2022-05-10 19:51:26 +01:00
Tamas Vajk
bfcd553c6c Change location of properties inside parameterized types 2022-05-10 19:51:26 +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
Tamas Vajk
acb310e46a Change parameterized type location to the class file 2022-05-10 19:51:26 +01:00
Tamas Vajk
53f484cd98 Add test for inconsistent generic instantiation locations 2022-05-10 19:51:26 +01:00
Tamas Vajk
49bf53da5d Make extracted file class public and final 2022-05-10 19:51:25 +01:00
Ian Lynagh
77fec17a36 Kotlin: Autoformat QL 2022-05-10 19:51:25 +01:00
Ian Lynagh
c5e3aefe10 Kotlin: Fix build on Mac (Arm)
We were getting:

$ echo foo > bar
$ jar -c -f baz.jar bar
-f : no such file or directory
baz.jar : no such file or directory
K-*��ϳR0�3��r.JM,IM�u�MEX��)h8������y�xk�r�rPYJO�?y_wTbarK���P�e2`wT    META-INF/�`wTYJO�??=META-INF/MANIFEST.My_wT�e2~�barPK��
2022-05-10 19:51:25 +01:00
Ian Lynagh
7c571dd551 Kotlin: Allow decoding errors
If an error happens, we'd rather see /something/ than get a decoding
error.
2022-05-10 19:51:25 +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
3920b64d62 Add support for live literals 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
Tamas Vajk
8c50e857e4 Add comments to clarify JVM type substitution for invoke methods 2022-05-10 19:51:25 +01:00
Tamas Vajk
1317d2d578 Fix DB inconsistencies with KFunction and KFunction::invoke call extraction 2022-05-10 19:51:25 +01:00
Tamas Vajk
0b4cf6ec82 Adjust extractEnclosingClass extraction 2022-05-10 19:51:25 +01:00
Tamas Vajk
44c8249a33 Remove outdated TODO comments 2022-05-10 19:51:25 +01:00
Tamas Vajk
5f729f8131 Merge two implementation of enclosing class extraction 2022-05-10 19:51:25 +01:00
Tamas Vajk
fe9333898f Minor code quality improvements 2022-05-10 19:51:25 +01:00
Tamas Vajk
f12bcc5715 Add dataflow test for property reference being used as lambda 2022-05-10 19:51:25 +01:00
Tamas Vajk
257224aa59 Change base class of property reference classes 2022-05-10 19:51:25 +01:00
Tamas Vajk
cf0be05b44 Add property reference invoke method implementation 2022-05-10 19:51:25 +01:00
Tamas Vajk
abcb367495 Add dataflow tests for lambda-like constructs
This commit adds tests for dataflow involving lambdas, big-arity lambdas, SAM conversions, and function references.
2022-05-10 19:51:25 +01:00
Chris Smowton
aab271d81e Fix extraction of data classes with array members
These use compiler-internal intrinsics at the IR layer, which are later lowered to java.util.Arrays calls. This performs that lowering in the same manner.
2022-05-10 19:51:25 +01:00
Chris Smowton
ae2ca183cc Improve logging when function resolution fails 2022-05-10 19:51:25 +01:00
Ian Lynagh
7dfd99d873 Kotlin: Accept test changes 2022-05-10 19:51:25 +01:00
Ian Lynagh
dbc5e73709 Kotlin: Add a test for annotation classes 2022-05-10 19:51:24 +01:00
Ian Lynagh
34f8d9b9b7 Kotlin: Handle annotation classes
Fixes:

[TYPES_NOT_DISJOINT] Base types @class and @interface are not disjoint. A common value is 225832
    Relevant element: id=225832
        Full ID for 225832: @"class;kotlin.internal.LowPriorityInOverloadResolution"

when Kotlin and Java both see such a class.
2022-05-10 19:51:24 +01:00
Ian Lynagh
b4d04f62b2 Kotlin: Log to the right TRAP file
Diagnostics for external classes were ending up in the source file's
TRAP file, and then breaking because `#compilation` isn't defined.
2022-05-10 19:51:24 +01:00
Tamas Vajk
91b7de42ad Make generated invoke/get/set public
The generated `invoke`/`get`/`set` methods are implementing interface members, so they need to be `public`.
2022-05-10 19:51:24 +01:00
Tamas Vajk
878352f69c Add test for checking generated invoke/get/set visibility 2022-05-10 19:51:24 +01:00
Chris Smowton
61b0efb401 Add test case 2022-05-10 19:51:24 +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
8d6ae50d21 Don't try to assign comments to fake overrides 2022-05-10 19:51:24 +01:00
Chris Smowton
613e6b29a9 Don't log every time a type alias is ignored
This is a known TODO; runtime output not required.
2022-05-10 19:51:24 +01:00
Tamas Vajk
5a5d0e15eb Extract calls to big-arity lambda's invoke by converting the artificial invoke to the existing one
Big arity lambda calls in IR look like standard method calls to an `invoke` with N arguments. However, this method doesn't exist in JVM, so instead we need to extract a call to `FunctionN.invoke(Object[])`.
2022-05-10 19:51:24 +01:00
Tamas Vajk
c6bc501207 Fix expected test file 2022-05-10 19:51:24 +01:00