Commit Graph

213 Commits

Author SHA1 Message Date
Dmitry Petrov 6437a4bdc6 Support overload ambiguity resolution for callable references by expected type.
Resolve callable references taking into account expected callable types.

This affects call resolution procedure (resolve 'foo' in for 'foo(::bar)') similar to the approach used for function literals:

* During "shape arguments" phase of call resolution, callable references are resolved in independent context without expected type. If the callable reference is ambiguous, its shape type is a function placeholder type without parameter types and return type information. Otherwise, it is a reflection type for the resolved function or property. Upper-level call is resolved without taking into account ambiguous callable references.

* During "complete call" phase of call resolution, resolve callable reference arguments to actual descriptors (if possible), and update constraint system for the given call accordingly.

 #KT-6982 Fixed
 #KT-5780 Fixed
2015-07-21 18:33:15 +03:00
Dmitry Jemerov 9142d48e81 code cleanup: eval4j, ide-common, idea-analysis 2015-07-21 14:26:18 +02:00
Valentin Kipyatkov e0e7044032 Synthetic properties: fixed completion and inspection for generic class
+ fixed KT-8539 No completion of generic extension function for <*> type arguments

 #KT-8539 Fixed
2015-07-21 08:32:50 +03:00
Valentin Kipyatkov 23cfe88b71 KT-8530 Synthetic properties doesn't work with smart casts
#KT-8530 Fixed
2015-07-21 08:32:50 +03:00
Valentin Kipyatkov 08ac0ae7a0 Renamed classes 2015-07-21 08:32:49 +03:00
Valentin Kipyatkov c1b2ea0b48 More elegant way to achieve the same + fixed KT-7746 Top level package name completion does not work inside class body
#KT-7746 Fixed
2015-07-16 14:03:37 +03:00
Valentin Kipyatkov 82c9cd790e After dot completion optimization: do not ask for packages and classes when searching extensions 2015-07-16 14:03:37 +03:00
Valentin Kipyatkov 53810c67db Changes on code review 2015-07-16 13:49:22 +03:00
Valentin Kipyatkov f5e7483d19 Renames 2015-07-16 13:49:21 +03:00
Valentin Kipyatkov be5c0ea28b Renamed function 2015-07-16 13:49:21 +03:00
Valentin Kipyatkov bae90e9c2b Perform and cache full resolve when partial is not supported 2015-07-16 13:49:20 +03:00
Valentin Kipyatkov 745bed74b2 Minor fix in partial body resolve 2015-07-16 13:49:20 +03:00
Valentin Kipyatkov 58f2d37d95 Changed element of additional resolve from single import to whole import list (as we resolve all imports anyway) 2015-07-16 13:49:20 +03:00
Valentin Kipyatkov 02de67417a Minor code refactorings 2015-07-16 13:49:20 +03:00
Valentin Kipyatkov e612787833 More advanced partial body resolve caching 2015-07-16 13:49:19 +03:00
Valentin Kipyatkov 53e751be1f Caching of partial body resolve 2015-07-16 13:49:19 +03:00
Valentin Kipyatkov b33202d32d Hiding getters and setters from completion 2015-07-16 13:49:16 +03:00
Valentin Kipyatkov 92349e41ec Reordered parameters 2015-07-16 13:49:16 +03:00
Valentin Kipyatkov 434e3ab38b Moved utility functions for JetType from IDE to core 2015-07-16 13:49:14 +03:00
Valentin Kipyatkov 17442617bb Synthetic extensions suggested in completion 2015-07-16 13:49:13 +03:00
Natalia Ukhorskaya ec3c667f38 Debugger: allow Evaluate Expression in context of File (for some synthetic methods or when file was changed during debug and breakpoint line no longer match the actual line) 2015-07-16 13:09:26 +03:00
Natalia Ukhorskaya 75edfa6527 Debugger: do not resolve symbols on breakpoint line in Evaluate Expression 2015-07-16 13:08:31 +03:00
Natalia Ukhorskaya 9a53142b26 Refactoring: move similar part for obtaining scope for codeFragment to JetCodeFragment 2015-07-16 13:04:04 +03:00
Svetlana Isakova f25f59bb6e Solve the constraint system for alpha-converted variables,
store initial and backward conversions for
substituting new constraints and the result
2015-07-10 15:05:08 +03:00
Svetlana Isakova 9a5abf368f Constraint incorporation
In a constraint system a new bound is incorporated:
all new constrains that can be derived from it
(and from existing ones) are added
2015-07-10 15:05:04 +03:00
Denis Zharkov 0a19fb7df2 Make project compilable after types enhancement 2015-07-09 16:36:46 +03:00
Andrey Breslav d140e83386 Minor. Methods renamed to reflect tha fact that they handle more types than just collections 2015-07-09 16:32:24 +03:00
Valentin Kipyatkov 4dc7081dc4 Completion: fixed filtering shadowed declarations for generic functions 2015-07-08 16:28:54 +03:00
Alexander Udalov 0bad4e0137 Make KotlinJvmCheckerProvider non-singleton, pass module to it 2015-07-06 16:19:53 +03:00
Pavel V. Talanov b173f96505 Refactor: Remove ScopeProvider, introduce FileScopeProviderImpl
Rename NoFileScopeProvider -> FileScopeProvider.ThrowException, ScopeProvider.AdditionalScopeProvider -> FileScopeProvider.AdditionalScopes
2015-06-30 16:12:23 +03:00
Nikolay Krasko 8bea21a847 Introduce BodyResolveCache for storing resolve function body task in IDE 2015-06-30 13:54:42 +03:00
Nikolay Krasko 083023211e Refactoring: create trace inside each resolve task
This will allow reuse external cached results with their temp traces
2015-06-30 13:54:39 +03:00
Nikolay Krasko 980a0d19be Refactoring: don't register scopes explicitly, get them from scope provider on demand 2015-06-30 13:54:38 +03:00
Nikolay Krasko b81d8eb484 Refactoring: Don't depend on whole context if only DataFlowInfo is needed 2015-06-30 13:54:37 +03:00
Nikolay Krasko 0b49197ca3 Minor: suppress warning 2015-06-30 13:54:36 +03:00
Ilya Gorbunov 5779b89ff0 Deprecations cleanup: sequence -> asSequence 2015-06-29 17:06:33 +03:00
Pavel V. Talanov df529f1a4b Convert usages of existing generated injectors to dynamic injectors
Rewrite RuntimeModuleData to use hand-written code as we do not pack container module into runtime
This change introduces some overhead (up to 10% for the tests I ran) in some scenarios in IDE, that should be addressed later
2015-06-26 15:21:41 +03:00
Pavel V. Talanov 37bcd455b5 Make ModuleDescriptor#getPackage() return not null lazy object with lazy scope
Refactor: no need to create package view in order to obtain its subpackages
LazyPackageViewDescriptorImpl to replace PackageViewDescriptorImpl
This allows to avoid computations when package views are requested but their contents not necessarily queried
For example: DescriptorResolver.resolvePackageHeader()
2015-06-23 15:19:06 +03:00
Pavel V. Talanov 1cf38e4799 Convert PackageViewDescriptor to Kotlin 2015-06-23 15:18:57 +03:00
Evgeny Gerashchenko cc70ea2586 KT-7883 Receiver parameter falsely marked as unused
#KT-7883 fixed
2015-06-17 13:14:06 +03:00
Valentin Kipyatkov b301b22f47 KT-4822 Wrong scope is used for local variable name completion
#KT-4822 Fixed
2015-06-15 18:27:23 +03:00
Valentin Kipyatkov b3d74c380a Shadowed declarations filtering: more correct selection of imported declarations 2015-06-15 18:27:22 +03:00
Valentin Kipyatkov abc9c1ab02 Non-imported extensions from different packages do not shadow each other 2015-06-15 18:27:22 +03:00
Valentin Kipyatkov 8d11ab9866 Non-imported extensions are excluded when shadowed by members or something 2015-06-15 18:27:21 +03:00
Valentin Kipyatkov 3d0c3e225e Added test for second press completion for inaccessible 2015-06-15 18:27:21 +03:00
Valentin Kipyatkov 483da9607c KT-4893 Code completion should not show multiple functions with the same signature
#KT-4893 Fixed
2015-06-15 18:27:21 +03:00
Valentin Kipyatkov 4deefce603 KT-7901 Auto import is not suggested
KT-7229 Completion for extension functions with complex capture

 #KT-7901 Fixed
 #KT-7229 Fixed
2015-06-15 17:10:05 +03:00
Denis Zharkov eb7114bd53 Add 'constructor' keyword in whole project where needed 2015-06-12 09:55:15 +03:00
Mikhail Glukhikh 731e5d85a4 Annotation arguments resolve refactoring via ForceResolveUtil. Deptecated...Intention fixed accordingly 2015-06-10 18:38:25 +03:00
Valentin Kipyatkov 4263c47f4d DescriptorRenderer: moved enums out 2015-06-10 11:34:59 +03:00