Commit Graph

421 Commits

Author SHA1 Message Date
Marco Pennekamp 93f560eb4d [Analysis API] Add call resolution tests for KTIJ-23373
- The Java functions aren't recognized as candidates during the test
  (`FULL_JDK` isn't helping), so I've replicated the tests with local
  extension functions and confirmed that they uncover the same
  exception.
2022-11-22 13:13:35 +01:00
Anna Kozlova 702d0b4d54 [compiler] missed type parameters in local properties (KTIJ-23583)
even though local variables won't contain type parameters,
let's build fir for them
2022-11-22 10:47:45 +00:00
Jaebaek Seo c55efe62a3 [AA] handles FIR isUsedAsExpression for return within function block
For the following example:

```
fun foo(bar: Int) {
  <expr>if (bar == 4) return "Four"
  else return "Int"</expr>
}
```

AA FE1.0 `isUsedAsExpression` returns `false`.
Since the current AA FIR `isUsedAsExpression` returns `true` for the
above example, this commit fixes it.
2022-11-21 18:26:41 +01:00
Nikolay Lunyak fb09f139dd [FIR] Unmute receiver annotations tests
These tests were muted in 89f8821d. Seems they began to work after the
introduction of `FirReceiverParameter` in KT-54417.
2022-11-21 08:51:43 +00:00
Anna Kozlova e5ce32feeb [ANALYSIS API] introduce dedicated KtCall for incomplete code
KTIJ-23505 and duplicates
2022-11-18 20:59:31 +01:00
Marco Pennekamp c5e5140c08 [Analysis API] Fix exceptions around type parameters being treated as callables
- `toResolvedCallableSymbol`: cast defensively because
  the resolved symbol might not be a callable symbol.
- `toKtCallInfo`: Check that the resolved symbol is actually callable.

^KTIJ-23003 fixed
2022-11-17 18:58:38 +00:00
Jinseong Jeon 6caf384bad AA FIR: handle Java annotation vararg values 2022-11-17 12:58:14 +01:00
Dmitrii Gridin a0f4c674f5 [AA] KtCallableReceiverRenderer: add annotations renderer
^KT-54417
2022-11-17 09:50:19 +00:00
Dmitrii Gridin b672949820 [AA] replace KtCallableReceiverTypeRenderer with KtCallableReceiverRenderer
^KT-54417
2022-11-17 09:50:18 +00:00
Dmitrii Gridin 032026278c fix compilation and testData after rebase
^KT-54417
2022-11-17 09:50:17 +00:00
Dmitrii Gridin a5d56e1877 [FIR] DebugSymbolRenderer: fix typo
^KT-54417
2022-11-17 09:50:14 +00:00
Dmitrii Gridin d0cc88ffe0 [AA] KtCallableSymbol: introduce receiverType extension
^KT-54417
2022-11-17 09:50:12 +00:00
Dmitrii Gridin 1ebfbc0ee9 [AA] KtCallableSymbol: rename receiver to receiverParameter
^KT-54417
2022-11-17 09:50:12 +00:00
Dmitrii Gridin 2741052db3 [AA] integrate KtReceiverParameterSymbol to KtCallableSymbol
^KT-54417
2022-11-17 09:50:10 +00:00
Dmitrii Gridin 37d688ae83 [AA] introduce FirReceiverParameter
^KT-54417
2022-11-17 09:50:09 +00:00
Dmitrii Gridin be7d282974 [FIR] introduce FirReceiverParameter
^KT-54417
2022-11-17 09:50:09 +00:00
Jinseong Jeon fcba1f215a AA: handle erroneous type in nested type argument 2022-11-16 14:13:43 +01:00
Dmitrii Gridin 36f9a8b7b8 [AA] fix symbol pointer for setter
^KT-54311
2022-11-15 21:37:27 +00:00
Jaebaek Seo f8a101cf3a Add KtType.isArrayOrPrimitiveArray/isNestedArray() to AA 2022-11-15 16:50:17 +01:00
Nikolay Lunyak 89f8821d0a [FIR] KT-53371, KT-53519: Fix annotations arguments mapping
See: compiler/testData/asJava/lightClasses/
AnnotatedParameterInInnerClassConstructor.kt

The muted tests don't work with the (KT-53371, KT-53519)-related
changes. During this test happens an attempt to access unresolved
annotations via CustomAnnotationTypeAttribute.
Discussion: KTIJ-23547
2022-11-14 22:40:41 +02: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
Dmitrii Gridin 592591acad [AA] KtPsiBasedSymbolPointer: disable type inference
^KT-54417
2022-11-11 14:34:52 +00:00
Dmitrii Gridin bbe1aa61af [AA FIR] support symbol pointer for property from constructor
^KT-54311
^KT-54311
2022-11-11 14:34:52 +00:00
Dmitrii Gridin fe93f49ff7 [AA] KtPsiBasedSymbolPointer: add class type check
^KT-54311
2022-11-11 14:34:51 +00:00
Yan Zhulanow 4d41ac09df [Analysis API] Treat inapplicable declarations safely (KTIJ-23458)
Make 'getClassOrObjectSymbol()' and 'getNamedClassOrObjectSymbol()'
return 'null' for inapplicable PSI declarations.
2022-11-11 11:28:38 +00:00
Ilya Kirillov 4b7cacd55e [FIR] do not ignore nested type aliases in FirNestedClassifierScope 2022-11-11 12:00:01 +01:00
Ilya Kirillov 2378437b30 [Analysis API FIR] do not create resolved KtTypes for unresolved ones 2022-11-11 12:00:00 +01:00
Ilya Kirillov b47675916f [Analysis API] remove old renderer code 2022-11-11 12:00:00 +01:00
Ilya Kirillov 10b593ba8c [Analysis API] mute tests for expect/actual rendering as expect/actuals are not suported in symbols yet
^KT-54036
^KTIJ-23268
2022-11-11 11:59:59 +01:00
Ilya Kirillov 26ec7ec296 [Analysis API] update testdata after renderer rework
The new testdata seems to be more correct or just different

^KTIJ-23268
2022-11-11 11:59:59 +01:00
Ilya Kirillov d1eb7c51f1 [Analysis API] rework renderer
^KTIJ-23268 fixed
2022-11-11 11:59:58 +01:00
Ilya Kirillov 068168bc3c [fir] change setter parameter name to value 2022-11-11 11:59:56 +01:00
Ilya Kirillov 725ae1fc65 [Analysis API] separate non-class error types from class error types and add information about type qualifiers
it's needed for type printing in renderer
2022-11-11 11:59:55 +01:00
Jinseong Jeon 2131cb4fe0 AA FIR: functional type for anonymous function
^KTIJ-17657 In progress
2022-11-11 10:15:44 +01:00
Dmitrii Gridin 41ebf5ed53 [AA] KtPsiBasedSymbolPointer: simplify test logic
^KT-54311
2022-11-10 06:39:24 +00:00
Dmitrii Gridin 638eccac16 [AA K2] add missing resolve for signature creation
^KT-54311
2022-11-10 06:39:23 +00:00
Dmitrii Gridin 202a022b49 [AA K2] implement symbol pointers for value parameters
^KT-54311
2022-11-10 06:39:23 +00:00
Dmitrii Gridin 043e3e6840 [AA K2] implement symbol pointers for receiver parameter
^KT-54311
2022-11-10 06:39:23 +00:00
Dmitrii Gridin 48f7cdfaa1 [AA K2] implement symbol pointers for property accessors
^KT-54311
2022-11-10 06:39:22 +00:00
Dmitrii Gridin 32c38c0ae4 [AA K2] cleanup CanNotCreateSymbolPointerForLocalLibraryDeclarationException usages
^KT-54311
2022-11-10 06:39:22 +00:00
Dmitrii Gridin 731545573a [AA K2] add more tests on java members
^KT-54311
2022-11-10 06:39:22 +00:00
Dmitrii Gridin 42f8e6fbe6 [AA] add more tests on java field symbols
^KT-54311
2022-11-10 06:39:20 +00:00
Dmitrii Gridin 897a5b085d [AA K2] implement symbol pointers for enum entry members without psi
^KT-54311
2022-11-10 06:39:19 +00:00
Dmitrii Gridin c6a3ca86eb [AA K2] symbol pointers: add tests on enum entry
^KT-54311
2022-11-10 06:39:19 +00:00
Dmitrii Gridin 9b6e9e2dd1 [AA K2] implement symbol pointers for type parameters
^KT-54311
2022-11-10 06:39:17 +00:00
Dmitrii Gridin 7d1ac0ac97 [AA] AbstractSymbolTest: fix race
^KT-54311
2022-11-10 06:39:17 +00:00
Dmitrii Gridin 47c9618b79 [AA K2] implement symbol pointers for type aliases
^KT-54311
2022-11-10 06:39:17 +00:00
Dmitrii Gridin 0808f4e233 [AA K2] implement symbol pointers for classes and objects
^KT-54311
2022-11-10 06:39:16 +00:00
Dmitrii Gridin 85072b0c96 [AA K2] KtFirMemberSymbolPointer: migrate owner to pointer
^KT-54311
2022-11-10 06:39:16 +00:00