Chris Smowton
8bb23651ae
Extract type parameter bounds
2022-05-10 19:51:16 +01:00
Tamas Vajk
ec5bc8dad5
Add workaround for unbound symbols (get stub from descriptor)
2022-05-10 19:51:16 +01:00
Tamas Vajk
b7914ed77b
Code quality improvements
2022-05-10 19:51:16 +01:00
Tamas Vajk
695b3a6dbd
Add fallback symbol lookup for IrFunctionReference extraction
2022-05-10 19:51:16 +01:00
Tamas Vajk
9ff9bbe1c5
Fix merge conflict
2022-05-10 19:51:16 +01:00
Tamas Vajk
b4beddf2f9
Introduce cast for <unsafe-coerce> calls
2022-05-10 19:51:15 +01:00
Ian Lynagh
76ca0b2776
Kotlin: Pull Kotlin type for localvars out into its own table
2022-05-10 19:51:15 +01:00
Ian Lynagh
7862229807
Kotlin: Pull Kotlin type for params out into its own table
2022-05-10 19:51:15 +01:00
Ian Lynagh
dc26abe341
Kotlin: Pull Kotlin type for methods/constrs out into their own tables
2022-05-10 19:51:15 +01:00
Ian Lynagh
ee008773dc
Kotlin: Pull Kotlin type for fields out into its own table
2022-05-10 19:51:15 +01:00
Ian Lynagh
86bf126ed8
Kotlin: Pull Kotlin type for expressions out into its own table
2022-05-10 19:51:15 +01:00
Tamas Vajk
cd5555a5dd
Extract companion objects from interfaces
2022-05-10 19:51:15 +01:00
Tamas Vajk
53f40a3f31
Do not extract fake properties
2022-05-10 19:51:15 +01:00
Tamas Vajk
5c38b4e84d
Extract expression body
2022-05-10 19:51:15 +01:00
Chris Smowton
4d408159aa
When extracting a call to an inherited method, substitute the callee's type parameters appropriately.
2022-05-10 19:51:15 +01:00
Chris Smowton
8c9c37ca47
Revert "Kotlin: Extract fake overrides for now"
...
This reverts commit a1ffa7b66b6bc1a9b6fd93da60e7a16c0dc2fb21.
2022-05-10 19:51:15 +01:00
Ian Lynagh
16a27f5258
Kotlin: Provide a way for tests to cause an exception
2022-05-10 19:51:15 +01:00
Ian Lynagh
8d15d0acfb
Kotlin: Extract fake overrides for now
...
When we have Kotlin:
class A {
fun foo(z: OB<G1, G2>.B<E1, E2>) {
val foo = z.someFun()
}
}
and Java:
public class OB<S1, S2> extends OC<F1, F2> {
public class B<T1, T2> extends OC<F1, F2>.C<D1, D2, T1, T2> {
}
}
class OC<U1, U2> {
public class C<X1, X2, Y1, Y2> {
int someFun() {
return 5;
}
}
}
the `someFun` call is to a fake override, and has 4 type arguments.
If we treat it as calling the real function, then 6 type are expected,
and we get IndexOutOfBoundsException when we try to reorder the
type parameters in orderTypeArgsLeftToRight.
So for now, we just extract the fake overrides, so that we at least
don't crash.
2022-05-10 19:51:15 +01:00
Chris Smowton
fdb1668cff
CommentExtractor: use actual file label instead of hopefully correctly guessing its string form
2022-05-10 19:51:15 +01:00
Ian Lynagh
468a911f83
Kotlin: Use with in a number more cases
2022-05-10 19:51:14 +01:00
Ian Lynagh
f985671d7f
Kotlin: Make with an inline function
2022-05-10 19:51:14 +01:00
Ian Lynagh
3cc79f8b56
Kotlin: 'with' PoC
2022-05-10 19:51:14 +01:00
Ian Lynagh
5f176beb09
Kotlin: Refactoring: Use a more idiomatic way to prepend to a list
2022-05-10 19:51:14 +01:00
Ian Lynagh
d1a0a9668f
Kotlin: Remove a default argument
...
It was only defaulted in one case, and it's probably clearer to be
explicit.
2022-05-10 19:51:14 +01:00
Ian Lynagh
c125c1a698
Kotlin: getFunctionLabel: Make parentId be nullable
...
This allows us to simplify the set of functions.
2022-05-10 19:51:14 +01:00
Ian Lynagh
dd51141029
Kotlin: Use variable names more consistently
2022-05-10 19:51:14 +01:00
Ian Lynagh
2f8ede2ae5
Kotlin: Fix a variable shadowing warning
2022-05-10 19:51:14 +01:00
Chris Smowton
863037ec41
Always extract methods of user-class supertypes
...
This matches the Java extractor's behaviour. Also if we re-visit a class to extract its members, revisit its supertypes to extract their members too.
2022-05-10 19:51:14 +01:00
Tamas Vajk
52597e5d63
Fix missing declarations in declaration stack
2022-05-10 19:51:13 +01:00
Tamas Vajk
482a37cfe3
Fix unbound symbol.owner references and add todos
2022-05-10 19:51:13 +01:00
Ian Lynagh
41c36760f7
Kotlin: Small refactorings and comments
2022-05-10 19:51:13 +01:00
Ian Lynagh
6566f7b69f
Kotlin: Add types for the different kinds of casts that Kotlin has
...
We might want to unify some of these in future, but doing that
correctly is easier than splitting them up correctly, so I've given each
one its own QL class for now.
I am not familiar with many of the libraries/queries that use CastExpr.
I've briefly looked at them and updated them in a way that looks
superficially reasonable, but some of the uses will probably want to be
refined later.
2022-05-10 19:51:13 +01:00
Tamas Vajk
44b731c68e
Exclude extraction of fake overridden properties
2022-05-10 19:51:13 +01:00
Tamas Vajk
55b8e4400d
Code quality improvements
2022-05-10 19:51:13 +01:00
Tamas Vajk
b6e5e1977d
Extract more visibility modifiers
2022-05-10 19:51:13 +01:00
Ian Lynagh
a6d0dc7751
Kotlin: Small refactorings
2022-05-10 19:51:13 +01:00
Ian Lynagh
e1cff50c39
Kotlin: Remove KotlinSourceFileExtractor
2022-05-10 19:51:13 +01:00
Ian Lynagh
c1c4e4f86c
Kotlin: Move extractFileContents into KotlinFileExtractor
2022-05-10 19:51:13 +01:00
Ian Lynagh
d43efd4cc7
Kotlin: KotlinSourceFileExtractor: Take filePath rather than file
2022-05-10 19:51:13 +01:00
Chris Smowton
f4314c1f3d
Substitute all generic types into function trap IDs and signatures, and ensure the subbed types are never primitive
...
The solution for ensuring they are primitive (making the range of the substitution always nullable) will need replacing once we export Kotlin types.
2022-05-10 19:51:12 +01:00
Chris Smowton
3365f3972e
Instantiated generic type substitution: substitute outer class parameters too
2022-05-10 19:51:12 +01:00
Chris Smowton
f38f03e6c9
Value parameters: provide correct source declaration
2022-05-10 19:51:12 +01:00
Chris Smowton
cd07cc448e
Class trap labels: include outer type parameters
2022-05-10 19:51:12 +01:00
Chris Smowton
94efb427fe
Type parameters: record index Java-style
...
Previously they received indices offset by the number of surrounding class type parameters.
2022-05-10 19:51:12 +01:00
Chris Smowton
178f128bdc
Function labels: include <n> suffix (where n is the number of function type parameters)
...
This matches the Java extractor's behaviour.
2022-05-10 19:51:12 +01:00
Ian Lynagh
194e9fd2da
Kotlin: Handle file classes better
2022-05-10 19:51:12 +01:00
Tamas Vajk
b599ff2792
Change variable location extraction
2022-05-10 19:51:12 +01:00
Chris Smowton
5188998bc6
Extract outer <-> inner class relationships for generic instances
2022-05-10 19:51:12 +01:00
Chris Smowton
67e3374a23
Fix inner generic type extraction
...
- Don't attribute type parameters that belong to the outer class to the inner
- Don't extract constructor generic parameters as if they were parameters of the type being instantiated
2022-05-10 19:51:12 +01:00
Tamas Vajk
afd71a00d0
Fix extraction of function references without dispatch receiver
2022-05-10 19:51:12 +01:00