Commit Graph

12 Commits

Author SHA1 Message Date
Roman Golyshev b765cf3f99 KT-66411 [AA] Add fake source kind for single expression block around array assignments
A wrapper block was introduced as a part of fixing KT-59748, but was
assigned a real source, which had `getOrBuildFir` confused because
of the incorrectly built `KtToFirMapping`

It is relevant for:
- `if`, `when` expressions with an assignment as a single expression
- Kotlin code fragments,
when the assignment is being analysed as a single expression
in the fragment

^KT-66411 Fixed
2024-03-10 15:35:47 +00:00
Roman Golyshev 83a80a45a9 KT-66411 [AA] Add more tests for resolving compound set operators 2024-03-10 15:35:47 +00:00
Nikolay Lunyak 7056ad5325 [FIR] Set status.isOverride for fake overrides
Even though SO may not be correct
overrides sometimes, it feels more
natural to treat fake overrides as...
well, "overrides". And without it
we'd need to make the code in
`FirOverrideChecker` less intuitive.
2024-02-15 16:10:13 +00:00
vladislav.grechko 9aa8fb80e7 Set correct IR origins for inc/dec operations
NB: in order to produce correct IR origins, the source element kinds for
some FIR elements has been changed. As a side effect, mapping PSI to FIR
slightly changed: namely, for `a[b]++`, `a[b]` used to be mapped on
`set` call or callable reference, but now it is mapped on `get` call.

^KT-61891: Fixed
^KT-64387: Fixed
2024-01-30 14:26:10 +00:00
Roman Golyshev 304112cd8a [tests] Refactor AbstractReferenceResolveTest. Part 1
Instead of relying on UNRESOLVED_REFERENCE directive for the whole file,
just render the unresolved reference right in the .txt testdata

This will allow to introduce multi-caret resolve testdata more naturally

Required for KT-65152 and KT-62695
2024-01-26 10:12:09 +00:00
Jinseong Jeon f5d2ce3022 AA: render containing file and JvmClassName 2023-12-21 15:34:34 +00:00
Egor Kulikov 27f4b53570 [FIR] Do not expect builtin imports to be always resolved
Merge-request: KT-MR-10886
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
2023-07-05 14:02:50 +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
Ilya Kirillov 4530041cbb Analysis API: move reference resolve testsdata with errors to dedicated folders 2022-01-31 21:12:30 +01:00
Roman Golyshev f0f2f67024 KT-50862 Unwrap use-site substitution overrides
Use-site substitution override happens in situations like this:

```
interface List<A> { fun get(i: Int): A }

fun take(list: List<String>) {
  list.get(10) // this call
}
```

We want to have those overrides unwrapped, because we don't want
to deal with a different KtSymbol for each possible use-site

^KT-50862 Fixed
2022-01-29 07:42:18 +00:00
Mads Ager 61265a6501 Return error candidates from KtFirArrayAccessReference.resolveToSymbols 2021-12-21 13:22:15 +03:00
Ilya Kirillov 42f0536904 FIR IDE: move analysis api fir testdata to the analysis directory 2021-09-15 11:32:43 +02:00