Commit Graph

161 Commits

Author SHA1 Message Date
Denis.Zharkov 21b86123e8 FIR: Adjust analysis test data after changes in how we load Java types
Especially, it's about types based on type parameters
2022-05-19 16:54:05 +00:00
Denis.Zharkov d7f87e0182 FIR: Adjust analysis test data to changes in loading Java types 2022-05-19 16:54:02 +00:00
Ivan Kylchik 51ccc32a3f Update test data after introducing IntrinsicConstEvaluation annotation 2022-05-18 21:19:57 +03:00
Jinseong Jeon 61cca31b6b AA: special handling for converted constants 2022-04-22 18:55:30 +02:00
Jinseong Jeon faf6939515 AA: showcase strange const evaluation for -1 2022-04-22 18:55:30 +02:00
Jinseong Jeon 889db4cc5d AA: indicate whether a value parameter is an implicit lambda parameter
^KTIJ-18800 In progress
2022-04-21 19:18:25 +02:00
Jinseong Jeon a74a51b2d9 AA: add tests about resolution of implicit lambda parameter 2022-04-21 19:18:24 +02:00
Ilya Kirillov 3bd892fe82 [analysis api fe10] provide a dummy implementation for KtFe10SymbolContainingDeclarationProvider.getContainingModule
to satisfy some tests
2022-04-13 12:53:26 +02:00
Ilya Kirillov 2cd0792e98 [analysis api, tests] actualize testdata with newly added getContainingModule 2022-04-13 12:53:25 +02:00
Ilya Kirillov 6831bde751 [analysis api fir, tests] update parameter names in testdata 2022-04-13 12:53:18 +02:00
Ilya Kirillov 443ee4c860 [analysis api] allow generating test with for with more possible parameters 2022-04-13 12:52:59 +02:00
Roman Golyshev 32fa2fc476 [FIR] Resolve receiver in qualified expressions with no selector
In qualified expression like `foo().`, selector expression is null.
Because of that the whole expression was marked as an error FIR
expression, and `foo()` part was not resolved at all (including
arguments and everything else).

This commit fixes the problem by providing receiver's FIR expression
as an underlying expression for error FIR expression. That way
it will be seen by all resolve transformers and will be successfully
resolved.

^KTIJ-21484 Fixed
2022-04-12 10:55:12 +00:00
Victor Petukhov 27fa632630 [FE 1.0] Update test data with new error type representation 2022-03-23 21:13:33 +00:00
Jinseong Jeon 881a6bed35 AA: add tests about resolution to Java static method 2022-03-22 15:44:50 +01:00
Roman Golyshev 22830cf159 [FIR IDE] Fix resolving sugared compound operators (like +=, -=)
^KTIJ-21374 Fixed
2022-03-22 13:14:54 +00:00
Roman Golyshev 7bcd67068c [FIR IDE] Resolve explicit invoke calls more correctly
Also, enable some muted tests

^KTIJ-21343 Fixed
2022-03-15 21:29:36 +03:00
Jinseong Jeon a106ec6530 Do not create FastJarFileSystem when USE_PSI_CLASS_FILES_READING
because the intention of that configuration is to use "slower" class
reading.

In the near future, even though FIR is enabled, which uses experimental
faster jar file system, FIR clients (e.g., FIR UAST or Android Lint) may
still need to use slower class reading. So, we need to handle that
configuration before checking others.
2022-03-15 19:50:18 +03:00
Jinseong Jeon 89725941df AA: showcase an error in resolution to stdlib in standalone mode 2022-03-15 19:50:16 +03:00
Jinseong Jeon 46707b0426 AA: test evaluation mode with same test inputs 2022-03-11 13:51:16 +01:00
Jinseong Jeon a7fcbfb717 AA: move logic to evaluate constant property initializer
so as to handle composite expressions w/ constant property
2022-03-11 13:51:16 +01:00
Jinseong Jeon 606033e1e6 AA: introduce KtConstantEvaluationMode 2022-03-11 13:51:15 +01:00
Jinseong Jeon 1f93630a9c AA: evaluate constant property initializers 2022-03-11 13:51:14 +01:00
Jinseong Jeon 7ec7cc47a9 AA: ignore evaluating named reference (to avoid exceptions) 2022-03-11 13:51:14 +01:00
Jinseong Jeon e36bf55807 AA: avoid NPE while evaluating operations with non-numbers 2022-03-11 13:51:13 +01:00
Jinseong Jeon a68fd25982 AA: relax the assertion about referenced ClassId and qualified access
If an import alias is involved, they could be not identical.
Since an import alias ends with a simple identifer, we can simply drop
the first segment of qualified access and try the assertion again.
2022-03-02 20:30:31 +01:00
Roman Golyshev 8bcdc70adc FIR IDE: Add IDE tests for sample compiler plugin 2022-02-25 23:08:26 +03:00
Mikhail Glukhikh 53d6ac24e5 Switch kotlin version to 1.7
* Change 1.6 to 1.7 constants
* Fix SAFE_CALL_WILL_CHANGE_NULLABILITY for testData
* Change EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_WARNING to EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR
* Change NON_EXHAUSTIVE_WHEN_STATEMENT to NO_ELSE_IN_WHEN
* Fix testData for SafeCallsAreAlwaysNullable
* Change T -> T & Any in test dumps
* Change INVALID_CHARACTERS_NATIVE_WARNING -> INVALID_CHARACTERS_NATIVE_ERROR
* TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_WARNING -> TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR
2022-02-25 11:46:27 +00:00
Dmitriy Novozhilov 23af5510a6 [FIR] Render full declaration header in diagnostic messages 2022-02-18 17:44:38 +03:00
Mark Punzalan afb34d3193 Analysis API: Implement KtCallResolver.collectAllCandidates for FE 1.0. 2022-02-17 19:51:35 +01:00
Mark Punzalan 3f3873dc50 Analysis API: Return KtCallCandidateInfo instead of KtCallInfo in
KtCallResolver.collectAllCandidates().
2022-02-11 13:22:58 +01:00
Mark Punzalan 58c6c25fe9 Analysis API: Handle other FirElements in
KtCallResolver.resolveCandidates() and copy over remaining tests.
2022-02-11 13:22:58 +01:00
Mark Punzalan 9b9da94a09 Analysis API: Fix issues related to implicit invoke calls:
- Correctly set explicit receiver value.
- Restore original function call from FirImplicitFunctionCall (i.e.,
calls implicitly resolved to `invoke`) to get the correct name for
getting all candidates.
- Collect candidates at all tower levels.

Also make order of candidate calls in tests deterministic.
2022-02-11 13:22:58 +01:00
Mark Punzalan ace826c570 Analysis API: Get argument mapping from candidate and type parameters
from candidate symbol.
2022-02-11 13:22:58 +01:00
Mark Punzalan 0ed802bca4 Analysis API: Add tests for KtCallResolver.resolveCandidates(). 2022-02-11 13:22:57 +01:00
Vladimir Dolzhenko 918a91dbdf Escape special names with backticks in test data
#KT-51248
2022-02-10 21:20:47 +00:00
Jinseong Jeon 26e923e3ae AA: introduce static project structure provider by compiler configuration
Also add standalone mode utils to configure Application/Project environments
2022-02-09 23:11:43 +01:00
Dmitriy Novozhilov aadfc59d0f [FIR] Complete delegated constructor calls without proper constructed type
This is needed to definitely complete arguments of such calls
2022-02-07 13:36:38 +03:00
Ilya Kirillov b8c36b7998 Analysis API FIR: remove compilation errors from new testdata 2022-02-01 16:31:29 +01:00
Ilya Kirillov 441de5cd75 Analysis API FIR: resolve Java synthetic properties KtSyntheticJavaPropertySymbol 2022-02-01 16:31:28 +01:00
Mads Ager d13e117a58 Change FIR analysis API resolution for super type calls.
The IDE expects the super type calls to resolve to the constructor
invoked and not the class. The frontend itself resolves to the
class, so an extra layer is needed to adjust that to the constructor.
2022-02-01 16:31:26 +01:00
Ilya Kirillov 4530041cbb Analysis API: move reference resolve testsdata with errors to dedicated folders 2022-01-31 21:12:30 +01:00
Ilya Kirillov 96e1f1e7d4 Analysis API: fix some compilation errors in reference resolve testdata 2022-01-31 21:11:54 +01:00
Roman Golyshev bc3142f4da Remove accidentally copied testData file 2022-01-29 07:42:18 +00: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
Roman Golyshev 564e408434 KT-50862 Add name property to KtSignature
See the KDoc of the property for the reasons why
it was created
2022-01-29 07:42:17 +00:00
Roman Golyshev 9ff46004e4 FIR IDE: Remove typesCache from KtSymbolByFirBuilder
This cache wasn't working too well, because ConeTypes have
equals/hashCode implementations which do not account for types'
attributes (like annotations, for example).

Because of that, `String` and `@Annotated String` were considered the
same type, and the cache was remembering whichever came first.
2022-01-27 16:23:44 +03:00
Roman Golyshev 8befbc6375 KTIJ-20826 Approximate builder inference stub types as type parameters
This is a temporary fix to avoid crashes in FIR IDE

Of all stub types, only `ConeStubTypeForChainInference` is handled now,
so we can catch the other possible errors with stub types (in the
delegates' inference, for example)

The fix introduced in this commit should be reworked when KT-50916 is
fixed

^KTIJ-20826 Fixed
2022-01-25 17:09:03 +03:00
Ilya Kirillov e1fece6402 Analysis API: fix testdata of reference resolve tests which started to pass 2022-01-21 16:46:28 +01: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 5e42be9849 Analysis API: fix redundant caret symbol in testdata 2022-01-02 21:56:54 +03:00