Commit Graph

27 Commits

Author SHA1 Message Date
Kirill Rakhman 1eb18f13bd FIR: Fix test data after making LHS of assignment an expression
KT-54648
2023-01-31 08:39:43 +00:00
Anna Kozlova e54627b309 [FIR] add missed diagnostics for incomplete code
^KT-55053
2023-01-27 18:36:36 +00:00
Anna Kozlova b026678a34 [LL] retrieve fir from generated property of desugaring ++ operator
^ KTIJ-24385
Temp property to store receiver is generated for `a.b++` expression.
If this property's psi corresponds to receiver expr, then FirProperty
would be found by mapper if receiver is requested.
It works unexpectedly, because FirProperty is normally not expected by expression.
This change set fake sources for generated FirProperty, so it won't be found
by source psi
2023-01-25 11:03:29 +00:00
Yan Zhulanow 5120da6b70 [LL API] Rename 'outside' testPrefix with 'out_of_src_roots' 2023-01-25 08:04:40 +00:00
Yan Zhulanow f1edbc1a14 [LL API] Add tests for 'out of content root' analysis mode 2023-01-25 08:04:36 +00:00
Anna Kozlova 15b1e429d7 [compiler] introduce dedicated Fir declaration for dangling modifier lists (KTIJ-23008)
ensure fir annotations are included in FirDanglingModifierList and resolved,
dedicated DanglingTopLevelModifierListStructureElement exists for top
level lists only, class level lists are processed by containing structure
element
2022-12-21 20:58:46 +00:00
Anna Kozlova b81c210535 [AA] resolve array access expression to corresponding set operator
k1 would suggest `get` as well
 but with current fir structure with fake desugaring
 get is moved to the separate fake psi which doesn't exist
 thus the problem is ignored for now
 ^ KTIJ-24025
2022-12-21 10:45:40 +00:00
Anna Kozlova a529f8510d [LL] ensure FirConstExpression's annotations are not lost (KTIJ-23968) 2022-12-15 14:31:48 +00:00
Anna Kozlova 98cb25605a [LL] testdata for KTIJ-21468
ensure that for each destructuring declaration entry exists FirProperty
2022-11-24 10:20:38 +00:00
Ilya Kirillov c8e3103af9 [FIR] do not create FirParameter for catch parameter
use FirProperty instead

^KT-55034
2022-11-22 18:25:30 +01:00
Anna Kozlova 3fdd0aacd3 [compiler] preserve fir receiver in tree
when selector is invalid expression,
ensure that fir tree still contains receiver as well as selector

KTIJ-23578
2022-11-22 10:46:59 +00:00
Ilya Kirillov b6481ed891 [FIR] do not use FirValueParameter for function type parameter
As it is a different abstraction, introduced FirFunctionTypeParameter instead

Also, fix syntax checkers for function type parameter

^KT-55035 fixed
2022-11-21 16:17:51 +00:00
Anna Kozlova 9f470e2a4d [LL API] return FirErrorProperty for top level destructuring declaration
KTIJ-23552
2022-11-11 17:39:54 +01:00
Anna Kozlova 3590c4ea35 [Analysis API FIR] support generated temp properties
KTIJ-23492 (array index expression), KTIJ-23138 (inc/dec desugaring)
2022-11-11 17:39:53 +01:00
Yan Zhulanow 61ce9fe524 [FE] Fix source element duplication in object literal expressions 2022-11-11 11:28:35 +00:00
Kristoffer Andersen fcabc60471 [FIR] Insert fake source for FIR for array access temporaries 2022-10-05 16:22:22 +02:00
Roman Golyshev 01ce499bb2 [FIR] Unify some special names to make code more uniform 2022-06-01 00:11:17 +04:00
Jinseong Jeon af21b67eb5 LL: cache reverse converted constant expression 2022-04-22 18:55:31 +02:00
Jinseong Jeon 7e8c893ce1 LL: showcase converted constants in raw FIR 2022-04-22 18:55:30 +02:00
Dmitriy Novozhilov ade2307345 [FIR] Fix exponential analysis of augmented array access calls
^KT-50861 Fixed
2022-03-11 15:36:05 +03:00
Dmitriy Novozhilov 52b72a7dac [FIR] Implement Int -> Long conversions for literals and operators over them
^KT-38895
^KT-50996 Fixed
^KT-51000 Fixed
^KT-51003 Fixed
^KT-51018 Fixed
2022-02-07 13:36:36 +03:00
Ilya Kirillov 3b943706d8 Analysis API: fix call resolve inside plusAssign target
^KT-50864 fixed
2022-01-20 23:26:28 +03:00
Ilya Kirillov db1dedc9fe LL API: add source element kind rendering to the GetOrBuildFirTest 2022-01-20 23:26:28 +03:00
Tianyu Geng bc95733818 FIR LL API: resolve PSI elements to more specific FIR element
Compound access and implicit delegated constructor are mapped to FIR
elements that are way too broad.
2021-12-06 12:40:41 +01:00
Jinseong Jeon cf886c5975 FIR LL: fix searching logic for enum entry
KtEnumEntry, a subtype of KtClass, has been handled by
findNonLocalClass. Since KtEnumEntry doesn't have class id, that util
always throws an error while retrieving class id.

Instead, we should use containing class (i.e., enum class) id.
Also, once the enum class is resolved, we should search for matching
enum entry inside the enum class.
2021-11-12 12:11:06 +03:00
Tianyu Geng 765cad8448 FIR checker: substitute type parameters in dispatch receiver type
Consider the following code:

```
fun test(a: List<String>) {
  a.first()
}
```

The dispatch receiver type of `first` in this case is `List<T>` before
this change. After this change, it's `List<String>`.

In addition, this change also replace the dispatch receiver type with
the more specific type if available. For example, consider the following

```
class MyList: ArrayList<String>()

fun test(a: MyList) {
  a.get(0)
}
```
The dispatch receiver type of `get` is `MyList`, instead of
`ArrayList<String>`. That is, a fake override is created in this case.
2021-09-17 01:59:06 +03:00
Ilya Kirillov 989f3248e4 FIR IDE: move low level api testdata sources to the analysis directory 2021-09-15 11:32:28 +02:00