Commit Graph

1042 Commits

Author SHA1 Message Date
Mikhail Glukhikh 35446037bb UNINITIALIZED_ENUM_ENTRY compiler warning introduced #KT-2349 Fixed
(cherry picked from commit 76ac6d1)
2016-08-08 17:47:56 +03:00
Mikhail Glukhikh b7ed68db05 CFA: No more UNRESOLVED_CALL for object / enum entry qualifiers
(cherry picked from commit 4b09de8)
2016-08-08 17:47:40 +03:00
Stanislav Erokhin 19e4dbc37c Refactoring. Move functionTypeResolveUtils.kt to resolution module. 2016-07-29 17:53:11 +03:00
Stanislav Erokhin df461d6e7f Refactoring. Remove supertype TowerContext from class InvokeTowerContext. 2016-07-29 17:53:11 +03:00
Mikhail Glukhikh 6e391854a0 Data flow values refactoring: removed DataFlowValue.kind.isStable, renamed DataFlowValue.isPredictable -> DataFlowValue.isStable 2016-07-28 15:14:48 +03:00
Mikhail Glukhikh 4f7d8e34b0 Data flow values: initializers for local variables are now stored as "bound values" with inherited nullability #KT-6840 Fixed 2016-07-27 16:24:50 +03:00
Mikhail Glukhikh 7090abddcd Data flow values: variable-based are no more compared with taking kind into account 2016-07-27 16:24:46 +03:00
Mikhail Glukhikh f96b9ddbf5 Minor: unused imports in IdentifierInfo 2016-07-27 16:24:41 +03:00
Mikhail Glukhikh 1c9f08e986 Data flow values: STABLE_COMPLEX_EXPRESSION kind is removed, no use cases exist for them 2016-07-27 16:24:32 +03:00
Alexander Udalov 6baf3ae737 Minor, inline LexicalScope.Companion.empty 2016-07-22 11:05:19 +03:00
Alexander Udalov 00f1415ed7 Fix "rewrite at slice LEXICAL_SCOPE" during callable reference resolution
Following the TODO in CallableReferencesResolutionUtils.kt, delete the
suspicious scope and use the new resolution process with the qualifier which
was obtained after the resolution of LHS. However, by default the tower
resolution algorithm also considers each qualifier as a class value as well,
which would be wrong here because resolution of LHS as a "value" happens
earlier in DoubleColonExpressionResolver and with slightly different rules. To
avoid that, do not mix in the "explicit receiver" scope tower processor when
creating processors for callable reference resolution.

Also delete unused functions and classes related to deleted scope, refactor
Scopes.kt

 #KT-8596 Fixed
2016-07-22 11:05:19 +03:00
Mikhail Glukhikh edeef90c4b Minor improvements in DataFlowValue / IdentifierInfo 2016-07-21 21:15:27 +03:00
Mikhail Glukhikh 11f50186fa x?.y != null and x?.call() != null provoke now x != null, a set of tests #KT-2127 Fixed 2016-07-21 21:15:19 +03:00
Mikhail Glukhikh 9001b9bcc0 DataFlowValue & DataFlowValueFactory major refactoring, get rid of DataFlowValue.id : Any?
Instead, DataFlowValue now requires IdentifierInfo implementation to be created
DataFlowValue is compared using IdentifierInfo
2016-07-21 21:15:05 +03:00
Denis Zharkov 3a59e1d222 Support suspending extension functions 2016-07-06 15:25:19 +03:00
Denis Zharkov 30b4dfa65d Minor. Make extension's receiver to be a type parameter and simplify usage 2016-07-06 15:25:19 +03:00
Alexander Udalov b44f060ffa Do not consider fake variables for objects in :: resolution
The main change is in
NewResolutionOldInference.ResolutionKind.CallableReference, where
createVariableProcessor creates a processor which no longer lists objects

 #KT-12322 Fixed
2016-07-04 15:42:35 +03:00
Denis Zharkov 72eb87f5d0 Support inline suspend functions
A lot of additional work was required to support them:
- Suspension points are being identified by two markers
  instead of one pointing to suspend function call
- Approach with replacing return type of suspend function does not work anymore.
  So we decode suspension return type as an argument for begin marker
- It became necessary to perform variables liveness analysis
  (see comment in org.jetbrains.kotlin.codegen.coroutines.CoroutineTransformerMethodVisitor.spillVariables)
2016-06-19 12:50:54 +03:00
Dmitry Petrov 12710bec2f Redeclaration errors for type aliases: type alias vs function. 2016-06-10 10:25:08 +03:00
Denis Zharkov d2bf4cbfa0 Fix reference resolution on suspension calls 2016-06-09 17:57:15 +03:00
Denis Zharkov 2bdaec6eac Refine definition of whether call is suspension point
It's not about all calls to suspend functions, they may called from non-coroutine code
2016-06-08 18:53:16 +03:00
Denis Zharkov b1189eff23 Make suspension calls generation more stable
Instead of performing signature change during transformation
it's convinient to make just when generating corresponding call,
for example there is no need to think about default parameters as they just work as is

See comment above replaceSuspensionFunctionViewWithRealDescriptor for clarification
2016-06-08 18:53:16 +03:00
Denis Zharkov 372791eb15 Replace common extension receiver of coroutine-lambda with magic one
Currently it only contains additional synthetic declarations for suspend-functions

E.g. `fun <V> await(f: CompletableFuture<V>): V` for `fun <V> await(f: CompletableFuture<V>, machine: Continuation<V>): Unit`
2016-06-08 18:53:16 +03:00
Denis Zharkov 329fb9d619 Introduce 'coroutine'/'suspend' modifiers 2016-06-08 18:53:16 +03:00
Dmitry Petrov 9cf8ef287e KT-11588 Type aliases
Additional tests for generic type alias arguments.
Small refactoring in TowerLevels.
2016-06-01 14:32:45 +03:00
Dmitry Petrov 62f8d00f89 KT-11588 Type aliases
Create substituted constructor descriptors for generic type aliases.
2016-06-01 14:32:45 +03:00
Dmitry Petrov 1329a43d89 KT-11588 Type aliases
Type alias constructor
2016-06-01 14:32:44 +03:00
Dmitry Petrov 4a9507b3ab KT-11588 Type aliases
Type alias companion object
2016-06-01 14:32:44 +03:00
Pavel V. Talanov 9f67072098 Minor: ScopeUtils: avoid wrapping lexical scopes several times 2016-05-24 15:41:55 +03:00
Dmitry Petrov a4406687f1 KT-11588 Type aliases
Resolution & expansion for type aliases.
NB: Nested type aliases capturing type parameters of outer classes are not supported yet.
2016-05-20 14:17:24 +03:00
Mikhail Glukhikh ebd57fafd7 Cleanup: val can be parameter 2016-05-20 13:38:42 +03:00
Dotlin fa523b9af4 Delegated Properties: Analysis adjustments for local delegated properties support 2016-05-13 19:11:18 +03:00
Mikhail Glukhikh 733f3e8025 Code cleanup: type parameters can have in / out variance 2016-05-13 17:57:02 +03:00
Valentin Kipyatkov b551886889 Code cleanup: removed redundant semicolons 2016-04-29 11:26:25 +03:00
Stanislav Erokhin 3b41fcb5ba Refactoring. Add type safety to resolution. 2016-04-12 03:22:45 +03:00
Denis Zharkov 5bf336474d Respect receiver-dependent visibility when selecting smart-cast type 2016-03-31 14:51:57 +03:00
Denis Zharkov 4bea054e4b Optimize TowerResolver.run implementation
- run `processor` at each level instead of list construction
- make it as lazy as possible

Speed up analysis time nearly for 2-5%
2016-03-16 19:27:28 +03:00
Alexander Udalov c18fab82e5 Simplify and rename function type utilities
- isFunctionType -> change the only usage in TracingStrategyForInvoke to check
  for exact function type
- isExtensionFunctionType -> change all usages to check for exact extension
  function type because extension function types are uninheritable in Kotlin
- isExactFunctionType -> isNonExtensionFunctionType
- isExactExtensionFunctionType -> isExtensionFunctionType
- isExactFunctionOrExtensionFunctionType -> isFunctionType
- isFunctionOrExtensionFunctionType -> isFunctionTypeOrSubtype
2016-03-14 19:24:07 +03:00
Alexander Udalov fd344561fc Move static function type utilities from KotlinBuiltIns to functionTypes.kt 2016-03-14 19:24:05 +03:00
Stanislav Erokhin 5141d95a88 Refactoring. Remove dependence intellij-core from resolution module 2016-03-02 18:07:41 +03:00
Stanislav Erokhin 7a43d62408 Move sources to resolution module 2016-02-26 00:39:37 +03:00
Stanislav Erokhin 5bb1f3b2ea Create resolution module. 2016-02-26 00:39:37 +03:00