Commit Graph

7509 Commits

Author SHA1 Message Date
Mikhail Glukhikh 962c2e5dd2 ControlFlowInformationProvider: convert to Kotlin
(cherry picked from commit a1394bc)
2016-08-08 17:45:52 +03:00
Mikhail Glukhikh 16cf6379c1 ControlFlowInformationProvider.java --> ControlFlowInformationProvider.kt
(cherry picked from commit 28bb9ea)
2016-08-08 17:45:41 +03:00
Nikolay Krasko bfb4c48785 Minor: rename variables 2016-08-05 16:46:25 +03:00
Nikolay Krasko 300e0acd27 Report RETURN_NOT_ALLOWED and RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY only on the return with label (KT-13340)
#KT-13340 Fixed
2016-08-05 13:16:05 +03:00
Mikhail Zarechenskiy 7679e49b25 Do not generate properties for script parameters if there is template definition 2016-08-04 15:19:15 +03:00
Natalia Ukhorskaya 6a04cd39b2 Debugger: allow to evaluate kotlin expressions in java files
#KT-7549 Fixed

 If the context is inside PsiJavaFile, get list of all local variables available in current frame (this logic was removed in 29778311e8 01.12.2015 Drop unnecesary logic about additional context for lambda in debugger). For each variable create KtProperty inside top-level KtFunction in KtFile and set it as contextElement for KtCodeFragment. This file should have all imports from PsiJavaFile. We do not create properties on top-level because they will be highlighted as top-level vals/vars.
2016-08-03 17:51:49 +03:00
Ilya Chernikov 1248230c69 Fix after review, add logging for scripting-specific behavior 2016-08-03 09:51:40 +02:00
Ilya Chernikov f73b8e80be Fixes after review 2016-08-03 09:51:40 +02:00
Ilya Chernikov df64736192 Refactor script dependnecies template and resolver interfaces:
- get rid of obsolete interfaces and annotations
- rename actual resolver interface to ScriptDependenciesResolver
- make ScriptDependenciesResolverEx interface compatible with the one from 1.1-M01 to be able to support both on the provider side
- add possibility to override file patter in the script template provider
- construct resolver lazily, if possible
2016-08-03 09:51:40 +02:00
Ilya Chernikov 8024367915 Move KotlinScriptDefinitionFromTemplate to separate file...
leaving only interfaces in the scriptTemplate.kt. It could now be extracted into the separate lib if necessary.
2016-08-03 09:51:40 +02:00
Ilya Chernikov c73ab6c0a1 Fix pathlist comparison - fixes too frequent caches updates 2016-08-03 09:51:40 +02:00
Ilya Chernikov 31d9da3d4f Update resolver interface - make it return Future and add message reporter function +
plus minor fixes
2016-08-03 09:51:40 +02:00
Ilya Chernikov 5117ecb817 Collect annotations lazily 2016-08-03 09:51:40 +02:00
Ilya Chernikov 3b1e7494b8 Change dependencies resolver API - it gets message reporter and returns Future now 2016-08-03 09:51:40 +02:00
Pavel V. Talanov 500554e58c Clarify API so that it's possible to get single KotlinScriptExternalDependencies per script file 2016-08-03 09:51:40 +02:00
Ilya Chernikov 59712d4bf8 Implement updatable dependencies index with usage API in the environment for using in REPL 2016-08-03 09:51:40 +02:00
Ilya Chernikov 210a37e08c Support for multiparam dependency annotations (with reservations)
Due to missing feature (#KT-13106) it works either with single argument
or with all named arguments.
2016-08-03 09:51:40 +02:00
Ilya Chernikov 5900cad8b3 Add possibility to pass script dependency resolver directly rather than via definition annotation
This may help to reduce dependencies in certain situations
2016-08-03 09:51:40 +02:00
Mikhail Glukhikh b7fd41844d Wrap with safe let call handles qualified calls correctly #KT-13262 Fixed
(cherry picked from commit 7044348)
2016-08-01 12:24:38 +03:00
Mikhail Glukhikh f309021c9f KT-11425: convert !a.equals(b) to a != b
(cherry picked from commit 56c7786)
2016-08-01 12:23:07 +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
Stanislav Erokhin 2c2f105c5d Do not add receiver for function expression by expected type. 2016-07-29 17:53:10 +03:00
Dmitry Petrov a08e70879f KT-13161 java static methods call not working for typealias
Introduce special qualifier for type aliases with member scope
containing static class members only.
2016-07-28 17:38:36 +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 e515d7f773 Data flow analysis: unnecessary assignment removed (related to complex expressions) 2016-07-27 16:24:36 +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
Mikhail Glukhikh c7af3f7865 Data flow values: more accurate handling of postfix ++ and -- 2016-07-27 16:24:27 +03:00
Mikhail Glukhikh 692623cb55 Cleanup: smart casts of safe call receiver applied (do NOT cherry-pick to 1.0.X) 2016-07-27 16:24:18 +03:00
Stanislav Erokhin f3be1b8f1f Add assertion for variable as function call with explicit type parameters. 2016-07-27 13:17:15 +03:00
Mikhail Glukhikh b56e84d47f Cast never succeeds: special 'Nothing' / 'Nothing?' case
(cherry picked from commit 63435b4)
2016-07-27 10:52:13 +03:00
Mikhail Glukhikh b88282c0fc Suppress CAST_NEVER_SUCCEEDS removed from source code
(cherry picked from commit d448a92)
2016-07-27 10:51:30 +03:00
Mikhail Glukhikh a902c4901a CAST_NEVER_SUCCEED: replace subtyping check with subclassing check #KT-13206 Fixed
(cherry picked from commit 5fc797a)
2016-07-27 10:51:13 +03:00
Alexander Udalov 0380b6cd88 Never resolve modality of members to SEALED 2016-07-26 21:16:15 +03:00
Alexander Udalov d945c33d5e Move some members from OverrideResolver to OverridingUtil 2016-07-25 15:55:31 +03:00
Alexander Udalov 475fb6e8a7 Simplify OverrideResolver#filterOverrides
- move source vs binary equivalent call filtering hack to
  ResolutionResultsHandler (see c4778bfe5a for
  the original commit introducing this behavior)
- rewrite the algorithm so that it doesn't need noDuplicates in the beginning:
  modulo the hack above whish is only needed in ResolutionResultsHandler,
  descriptor equivalence is checked anyway in OverrideResolver#overrides
2016-07-25 15:55:31 +03:00
Alexander Udalov a6faab834d Move OverrideResolver#generateOverridesInAClass to CollectionStubMethodGenerator
Also simplify substantially
2016-07-25 15:55:31 +03:00
Alexander Udalov bbd1e889a6 Use kotlin.Function1 instead of intellij Function in OverrideResolver 2016-07-25 15:55:31 +03:00
Alexander Udalov 191f532675 Remove OverrideResolver#filterOutOverriding, simplify the only usage 2016-07-25 15:55:31 +03:00
Alexander Udalov 5d04fa3c2f Remove unreachable code in ResolutionResultsHandler 2016-07-25 15:55:31 +03:00
Alexander Udalov 89c5799155 Move utilities used in IDE from OverrideResolver to descriptorUtils.kt 2016-07-25 15:55:31 +03:00
Alexander Udalov 24c383a009 Remove unnecessary loop from OverrideResolver#filterOverrides
It was not needed because overridability in both ways is already checked in
DescriptorEquivalenceForOverrides, which is called in
OverrideResolver#overrides
2016-07-25 15:55:31 +03:00
Alexey Sedunov 0769d47f4b Introduce Type Alias: Support type constructor extraction 2016-07-25 12:44:28 +03:00
Alexander Udalov 83000c50ff Remove quotes around visibility in invisible member diagnostic 2016-07-22 18:13:41 +03:00
Alexander Udalov b6b2303aa7 Improve error message for inaccessible invisible_fake members
#KT-8989 Fixed
2016-07-22 18:13:40 +03:00
Alexander Udalov 2a390155a9 Fix quotes in diagnostic messages
See 8316953259
2016-07-22 18:13:38 +03:00
Alexander Udalov 9ab8da2ef9 Fix type of reference to protected var
#KT-12982 Fixed
2016-07-22 11:05:19 +03:00
Alexander Udalov 6baf3ae737 Minor, inline LexicalScope.Companion.empty 2016-07-22 11:05:19 +03:00
Alexander Udalov 969ff43152 Merge CallableReferencesResolutionUtils.kt into DoubleColonExpressionResolver 2016-07-22 11:05:19 +03:00