Commit Graph

9900 Commits

Author SHA1 Message Date
Ilya Muradyan 017f640f26 Allow skipping extensions resolution for implicit receivers 2020-06-19 13:03:23 +02:00
Mikhail Bogdanov 9c0b96af71 Report error on missed specialization in compatibility mode
#KT-39603 Fixed
2020-06-19 11:57:36 +02:00
Victor Petukhov ece61915de NI: clean calls in coroutine inference before the second analysis of += only for right side
^KT-39660 Fixed
2020-06-18 17:09:59 +03:00
Ilya Muradyan 8c2baf0704 Add missing definitelyDoesNotContainName methods 2020-06-18 09:51:16 +02:00
Victor Petukhov c0f4ee7dc9 Revert "Add missing definitelyDoesNotContainName methods"
This reverts commit b74692e9
2020-06-17 13:16:16 +03:00
Ilmir Usmanov d9821412d0 Do not generate fields for unused suspend lambda parameters
This also allows us to not spill them in the lambda.
But, disable this optimization for local named functions.

 #KT-16222 In progress
2020-06-17 12:00:25 +02:00
Victor Petukhov 901b794af3 Use lexical scope from trace during checking suspend context if the analysis of engaged parent function isn't completed
^KT-39461 Fixed
2020-06-16 22:00:04 +03:00
Mikhail Glukhikh d385a9b29e Add more detailed exception message in KtExpression.isUsedAsExpression 2020-06-16 19:17:29 +03:00
Victor Petukhov 982cbf1148 NI: clear calls info in coroutine inference before the second analysis of += right side
^KT-39376 Fixed
2020-06-16 18:26:59 +03:00
Ilya Chernikov d7df249480 Convert contributed descriptors to list...
without this `KDocCompletionTestGenerated,testExtensionsFQLink`, which
most likely point to some broken contract in the test.
2020-06-15 16:08:41 +02:00
Ilya Chernikov d528d24f83 Optimize AllUnderImportScope 2020-06-11 16:16:15 +02:00
Ilya Chernikov a0efd1e323 Optimize scopes handling inside ChainedMemberScope 2020-06-11 16:16:15 +02:00
Ilya Chernikov 3da6ff7ec3 Optimize scopes handling inside LexicalChainedScope 2020-06-11 16:16:14 +02:00
Ilya Chernikov bf97323301 Optimize data handling inside scopes 2020-06-11 16:16:14 +02:00
Ilya Chernikov c720fa5793 Optimize LazyScopeAdapter internals 2020-06-11 16:16:14 +02:00
Ilya Muradyan b74692e96b Add missing definitelyDoesNotContainName methods
Some implementations of definitelyDoesNotContainName method were
missing that led to performance problems during symbols resolution
using TowerResolver.

Relates to KT-39139.
2020-06-11 16:16:13 +02:00
Alexander Udalov 6e67e1e78d Replace appendln with appendLine in project 2020-06-11 13:01:30 +02:00
Ilya Kirillov 418903e9ef FIR IDE: Make KtReference class descriptors frontend independent
* The new idea-frontend-independent module created
* Moved KtReference and it inheritors to that module & implement them in idea-analysis module by using descriptors frontend
2020-06-09 16:19:12 +03:00
Ilya Muradyan 489290263f Add info about the end of range in scripting REPL compiler messages 2020-06-05 21:58:28 +02:00
Mikhail Zarechenskiy bfa648972f Introduce call checker for Unit-conversions 2020-06-05 13:24:21 +03:00
Mikhail Zarechenskiy 6b0a803d14 Allow suspend-conversion for callable references as part of adaptation 2020-06-05 13:24:21 +03:00
Mikhail Zarechenskiy a4af833d55 Narrow down the range for compatibility warning to callee expression 2020-06-05 13:24:19 +03:00
Pavel Kirpichenkov 8ed4424e3e Clean up API of AbstractResolverForProject
Resolution anchors are IDE-specific.
Creating dedicated methods for them in AbstractResolverForProject leads to meaningless
implementation in non-IDE resolvers. Now this method is implemented only
for IDE resolver and accessed through JvmPlatformParameters.

#KT-24309 In Progress
2020-06-05 11:14:01 +03:00
Ilmir Usmanov 8cc5f2abfb Forbid val field initialization inside EXACLTY_ONCE lambda
unless the lambda is inline. This way, final field will remain final.
2020-06-04 21:26:48 +02:00
Pavel Kirpichenkov 7fff8f82e2 Changes after review
- Replace leaking ModuleResolverTracker with use of ModuleDescriptor.Capabilies
- Provide API for retrieving ResolverForProject from ResolutionFacade
- Update names
2020-06-03 20:58:07 +03:00
Pavel Kirpichenkov db1210fc67 Introduce components for library-to-source resolution in IDE
#KT-24309 In progress
2020-06-03 20:58:07 +03:00
Dmitriy Novozhilov 069adebf01 [NI] Fix checking for inline lambdas without candidate
#KT-34506
2020-06-01 23:40:32 +03:00
Leonid Startsev 7c8c5b057f Extensible mechanism for plugin metadata during descriptor serialization
A mechanism that allows kotlinx.serialization plugin to preserve the
correct (program) order of properties after serializing/deserializing
descriptors to kotlin metadata, which is needed for correct and stable
json serialization of class hierarchies in incremental/multi-module scenario.
It uses protobuf extensions.
2020-06-01 17:48:16 +03:00
Mikhail Zarechenskiy 7ec8716d65 Introduce HTML redenred version for compatibility warning 2020-06-01 10:19:36 +03:00
Mikhail Zarechenskiy a5203428a4 Replace resolution error for suspend-conversion with call checker error 2020-06-01 10:19:34 +03:00
Mikhail Zarechenskiy 47e6805186 Add compatibility warning for reference adaptation 2020-06-01 10:19:33 +03:00
Mikhail Zarechenskiy 03358c61d4 Add compatibility warning for SAM conversions 2020-06-01 10:19:33 +03:00
Ilmir Usmanov 5f3e296f19 Fix bugs with capturing rhs into EXACTLY_ONCE lambda
There are multiple ways to declare a named variable-like entity in
Kotlin:
1. val/var variable declaration
2. destructuring declaration
3. parameter of a function
4. parameter of a lambda
5. destructured lambda parameter
6. for-loop's variable declaration
7. catch block exception declaration
8. val in when
9. field declaration

Out of them, only variable and field can be assignable, in other words,
they can be on the left hand side of an assignment.
Val/var variable declarations were already supported.
So, we needed to just support field initialization and tell the backend
that other ways are prohibited. Function and lambda parameters were
already been supported. So, the only thing to explain to the backend are
remaining ways.
 #KT-39113 Fixed
 #KT-34048 Fixed
2020-05-29 09:55:04 +02:00
Dmitriy Novozhilov 2812ed0a02 [NI] Use types and systems from return arguments instead of return type of lambda 2020-05-29 09:36:33 +03:00
Dmitriy Novozhilov f76b57d260 [OI] Prefer candidate without @OverloadResolutionByLambdaReturnType 2020-05-29 09:36:33 +03:00
Dmitriy Novozhilov a604404bff [NI] Report warning if candidate was chosen using only @OverloadResolutionByLambdaReturnType 2020-05-29 09:36:33 +03:00
Dmitriy Novozhilov e7869bd9d4 [NI] Analyse lambda in factory pattern resolution in independent context 2020-05-29 09:36:32 +03:00
Dmitriy Novozhilov 865ddac07a [NI] Add feature for choosing candidate by lambda return type 2020-05-29 09:36:31 +03:00
Mikhail Zarechenskiy 4dbd4a56d5 Compose: adapt new API for intercepting candidates in call resolvers
Most part is made by @lelandrichardson
2020-05-27 01:42:48 +03:00
Yan Zhulanow 38b6b73745 Add additional diagnostic for EA-225967 2020-05-27 02:38:39 +09:00
Svyatoslav Scherbina 3e8b0055ab Decouple Call.hasUnresolvedArguments from ResolutionContext 2020-05-26 20:24:30 +03:00
Victor Petukhov 756326cefe NI: report error diagnostic about impossible to infer anonymous function's parameter
Partially fixed KT-39098
2020-05-25 19:37:27 +03:00
Mikhail Zarechenskiy 2cee82a348 [NI] Resolve receiver of provideDelegate independently
#KT-38259 Fixed
2020-05-25 16:06:55 +03:00
Victor Petukhov 379c6944a2 NI: extract diagnostics from partially resolved call instead of separately handling it including running all checks
^KT-37630 Fixed
^KT-35494 Fixed
2020-05-22 22:13:53 +03:00
Pavel Kirpichenkov 0b33e9430b [NI] Report unstable smart cast directly instead of using SmartCastManager
Fix compilation errors, revealed by this fix.

SmartCastManager is unnecessary for error reporting, intermediate diagnostics from the NI contain all required infromation.
When SmartCastManager is used it leads to missing unstable smart casts in case of expressions with captured types.
This happens, because data flow info is recorded for original expression without captured types, which is used as a key.
DataFlowValues created from receivers with captured types can't be used to retrieve that info.

^KT-39010 Fixed
2020-05-21 17:09:10 +03:00
Victor Petukhov eff5f3a242 NI: do type checking for anonymous functions not inside a call
^KT-38890 Fixed
^KT-38439 Fixed
2020-05-19 16:29:14 +03:00
Ilya Chernikov fb6ef38370 Revert "Add info about the end of range in scripting REPL compiler messages"
This reverts commit af251caf, because it breaks daemon/client
compatibility, which we'd like to keep as much as possible
2020-05-15 21:15:48 +02:00
Victor Petukhov 73dec25eb1 NI: intersect DFI types before capturing
^KT-37887 Fixed
2020-05-14 19:54:59 +03:00
Alexander Udalov 6fb40878c4 Minor, do not report "no reflection" error on KTypeParameter
Since an implementation of KTypeParameter for stdlib is coming, an
instance of which can be obtained through `typeOf`.
2020-05-13 10:04:27 +02:00
Alexander Udalov ea413cefb4 Remove TypeOfChecker for JVM frontend
This is needed to support typeOf with non-reified type parameters.

 #KT-30279
2020-05-13 10:04:26 +02:00