Commit Graph

5739 Commits

Author SHA1 Message Date
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
Tamas Vajk
222f2415e2 Fix local function reference extraction 2022-05-10 19:51:24 +01:00
Ian Lynagh
62d9b85b46 Kotlin: This might fix building on Windows 2022-05-10 19:51:24 +01:00
Ian Lynagh
967619f26a Kotlin: Remove non-ascii character 2022-05-10 19:51:24 +01:00
Ian Lynagh
f138ba5246 C#/Kotlin: Sync SignAnalysisCommon.qll 2022-05-10 19:51:24 +01:00
Chris Smowton
9f294d1ecd Adjust more test expectations 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
Chris Smowton
35d213afc0 Extract varargs constructors 2022-05-10 19:51:24 +01:00
Chris Smowton
e24d78ae14 Create instance variable initializer block eagerly
Otherwise when the init block is followed by other constructor statements we can get a gap in a BasicBlock's child sequence due to the child init block never getting created at all.
2022-05-10 19:51:23 +01:00
Chris Smowton
9fd9894f6a Move abbreviation to external-decl extractor; record full signature. 2022-05-10 19:51:23 +01:00
Chris Smowton
1a656af96a Make truncation consistent 2022-05-10 19:51:23 +01:00
Chris Smowton
1b91a35df0 Truncate (but keep unique-ish) the names of very long file declarations 2022-05-10 19:51:23 +01:00
Tamas Vajk
b26044b327 Change extension receiver this access to be a parameter access 2022-05-10 19:51:23 +01:00
Tamas Vajk
21f6867cd4 Add test cases for delegating properties to other properties 2022-05-10 19:51:23 +01:00
Tamas Vajk
2f0ad50c08 Adjust trap file names of external file class declarations 2022-05-10 19:51:23 +01:00
Tamas Vajk
f5383bbc17 Add extension receiver type to function signature in trap file names 2022-05-10 19:51:23 +01:00
Ian Lynagh
61728e6a69 Kotlin: Tweak kotlin_plugin_versions.py 2022-05-10 19:51:23 +01:00
Ian Lynagh
0610917435 Kotlin: Workaround for CI on Windows 2022-05-10 19:51:23 +01:00
Ian Lynagh
ef5950197d Kotlin: Broaden isFake 2022-05-10 19:51:23 +01:00
Ian Lynagh
aee74dd570 Kotlin: Be more consistent in how we deal with "fake" elements 2022-05-10 19:51:23 +01:00
Ian Lynagh
8f85f5552b Kotlin: Accept test changes 2022-05-10 19:51:23 +01:00
Ian Lynagh
1ff6ada955 Kotlin: Tweak logging 2022-05-10 19:51:23 +01:00
Tamas Vajk
d6feb58bfc Fix property references to fake overrides 2022-05-10 19:51:23 +01:00
Tony Torralba
4eb1e3a47b Update ExtensionMethodAccess QLDoc 2022-05-10 19:51:23 +01:00
Tony Torralba
fcb334180d Create ExtensionMethodAccess class 2022-05-10 19:51:23 +01:00
Ian Lynagh
270beecef5 Kotlin: Write diagnostics to the write TRAP file
When a TRAP writer wrote a warning, it was going to the wrong TRAP
file.
2022-05-10 19:51:23 +01:00
Ian Lynagh
62ce28eb68 Kotlin: Populate diagnostic_for 2022-05-10 19:51:23 +01:00
Tamas Vajk
ac3c635fe3 Extract set function for field accessing property references 2022-05-10 19:51:23 +01:00
Tamas Vajk
a6f036d94e Extract property references with only backing field 2022-05-10 19:51:23 +01:00
Tamas Vajk
90ca47a46b Extract local delegated property reference 2022-05-10 19:51:23 +01:00
Ian Lynagh
47d8eb458e Kotlin: Improve top-level error handling 2022-05-10 19:51:23 +01:00
Ian Lynagh
a653054eb3 Kotlin: Make sure the context is empty when it should be 2022-05-10 19:51:23 +01:00