Mikhail Zarechenskiy
974dad571c
[NI] Report errors about inapplicable wrong receiver
...
Now it's possible because we don't commit trace with inapplicable `provideDelegate` operator (20e105c274 )
2017-08-09 17:37:44 +03:00
Dmitry Jemerov
a7bbf3d1f8
Don't increase OOCB count when a REPL line is modified
2017-08-09 13:26:09 +02:00
Dmitry Jemerov
3415853cac
Add ModuleDescriptor.assertValid() for ensuring consistency
2017-08-09 13:26:09 +02:00
Dmitry Jemerov
ac96c31a7d
Retrieve module descriptors for implementing modules on demand
2017-08-09 13:26:09 +02:00
Dmitry Jemerov
0b45d25bb1
Fix compilation after rebase
2017-08-09 13:26:09 +02:00
Dmitry Jemerov
bdbe134b60
Recreate module descriptors for affected modules only on a change
2017-08-09 13:26:09 +02:00
Dmitry Jemerov
07794c8188
On-demand creation of ModuleDescriptors
2017-08-09 13:26:09 +02:00
Dmitry Jemerov
36cabf1bfc
Move entire logic for ModuleDescriptor setup into ResolverForProjectImpl
2017-08-09 13:26:09 +02:00
Dmitry Jemerov
d6a9a49968
Disable tracking of Kotlin files by Java OOCB listener
2017-08-09 13:26:09 +02:00
Dmitry Jemerov
aafe7e6f1b
Refactoring: move createResolverForModule() into ResolverForProjectImpl
2017-08-09 13:26:09 +02:00
Dmitry Jemerov
3debca09ea
Remove callback hell from LazyModuleDependencies
2017-08-09 13:26:09 +02:00
Mikhail Zarechenskiy
cfbc559a97
[NI] Propagate tracking binding trace into context
2017-08-09 14:01:04 +03:00
Mikhail Zarechenskiy
4a74ca568c
[NI] Don't forget to deparenthesize expression before type checking
2017-08-09 14:01:00 +03:00
Mikhail Zarechenskiy
20e105c274
Don't commit trace with inapplicable provideDelegate operator
...
This helps in NI as there we have different logic for delegates inference
2017-08-09 13:50:50 +03:00
Mikhail Zarechenskiy
46d0ea3eed
Use operation reference as lookup element to preserve old behaviour
...
See related changes in fb72726f08
2017-08-09 00:59:12 +03:00
Valentin Kipyatkov
9361cd895c
Support for import aliases in code completion
...
#KT-8848 Fixed
2017-08-08 22:06:04 +03:00
Mikhail Zarechenskiy
48246e5f34
[NI] Add resolution part to check for abstract super call
2017-08-08 15:44:31 +03:00
Mikhail Zarechenskiy
b6e195128c
[NI] Resolution diagnostics don't produce errors as is
2017-08-08 15:44:30 +03:00
Mikhail Zarechenskiy
5486f4e612
[NI] Don't report NI error for recorded info about smartcasts
2017-08-08 15:44:28 +03:00
Mikhail Zarechenskiy
64b722d4f6
Minor, reduce nesting
2017-08-08 15:44:20 +03:00
Mikhail Zarechenskiy
ae3497c6ce
Reduce highlighting range for UNCHECKED_CAST
...
#KT-18985 Fixed
2017-08-07 18:49:58 +03:00
Mikhail Zarechenskiy
8f8143d3ed
Fix IAE for wrong use-site @file annotation
...
#EA-100189 Fixed
2017-08-07 18:49:57 +03:00
Mikhail Zarechenskiy
4d4c39939f
Report full package FQ name in compilation errors related to visibility
...
#KT-18966 Fixed
2017-08-07 18:49:55 +03:00
Mikhail Zarechenskiy
7693f64dee
[NI] Take into account safe call when updating recorded type
2017-08-07 18:01:21 +03:00
Mikhail Zarechenskiy
a13442b12b
[NI] Fix data flow for arguments in special calls
2017-08-07 18:01:18 +03:00
Mikhail Zarechenskiy
fb72726f08
Resolve right part of equality with given descriptors
2017-08-07 18:01:15 +03:00
Stanislav Erokhin
ab2f99542a
[NI] Redo how we take care of postpone arguments
...
The main change here is the following: before callable reference
resolution starts directly after choosing candidate. Since now we
start resolution before call completion.
2017-08-07 18:01:02 +03:00
Stanislav Erokhin
93d80c252f
[NI] Refactoring. Move properties from KotlinCall to external component
2017-08-07 18:01:00 +03:00
Stanislav Erokhin
ef93088a42
[NI] Move most of KotlinCallDiagnostic to one file
...
Now there is 3 kind of KotlinCallDiagnostic:
- ResolutionDiagnostic
- ConstraintSystemCallDiagnostic
- other common diagnostic
Also SpecialResolutionParts were merged into other ResolutionParts
2017-08-07 18:00:59 +03:00
Stanislav Erokhin
1bc68e073d
[NI] Minor. Clarified type for arguments from lambda
2017-08-07 18:00:56 +03:00
Stanislav Erokhin
85e34163bb
[NI] Temporary fix for cases related callable reference and if
...
For cases like if (..) ::foo else ::bar we didn't write stub resolved
calls for ::foo before call completion. Because of this, and strange
code in if we get null inside type info.
2017-08-07 18:00:54 +03:00
Stanislav Erokhin
f1144c9f01
[NI] Use resolved lhsType as unbound receiver.
2017-08-07 18:00:53 +03:00
Stanislav Erokhin
c752e1580e
[NI] Check receivers for callable reference resolution.
2017-08-07 18:00:52 +03:00
Stanislav Erokhin
a5dffafacd
[NI] Fix provideDelegate resolution.
...
For provideDelegate there is no real psi for resolution,
so we write corresponding call via special trace key.
2017-08-07 18:00:51 +03:00
Mikhail Zarechenskiy
76d013a33f
[NI] Resolve % to mod if candidates have wrong receivers
2017-08-07 18:00:48 +03:00
Dmitry Petrov
4963580f90
[NI] Take into account return without expression in lambdas
2017-08-07 18:00:47 +03:00
Mikhail Zarechenskiy
e74a02eb94
[NI] Approximate implicit return type for functions
2017-08-07 18:00:42 +03:00
Stanislav Erokhin
5f2cc75718
[NI] Support INAPPLICABLE_WRONG_RECEIVER candidate applicability
...
It is important for provideDelegate resolution, because if scope has
provideDelegate with wrong receiver we shouldn't resolve to it and
report any errors.
2017-08-07 18:00:40 +03:00
Stanislav Erokhin
e4b73fcdbd
[NI] Create SubCallArgument for variable in VariableAsFunctionCall
...
If variable is generic call, then we should complete inference only
after invoke resolution. It means that explicit receiver for invoke
should be SubKotlinCallArgument.
But, if this property has no generics,
for example local property, then this property can have smartcast and
such call has no type arguments -> no completion required.
For such call we should store information about smart casts.
2017-08-07 18:00:39 +03:00
Dmitry Petrov
b336919db3
[NI] In NI mode, use return type from special call resolution for '!!'
2017-08-07 18:00:35 +03:00
Dmitry Petrov
397e04f382
[NI] Do not use return type from 'onlyResolvedCall'
2017-08-07 18:00:34 +03:00
Dmitry Petrov
5b2e66f0ca
[NI] Invoke checkType for arguments
...
checkType performs various actions required by BE
(e.g., record nullability assertions information for JVM BE).
2017-08-07 18:00:33 +03:00
Dmitry Petrov
dc453e6d8b
[NI] Update lambda argument expression type when return type is known
2017-08-07 18:00:32 +03:00
Mikhail Zarechenskiy
def0816095
[NI] Write info about hidden descriptor to candidate
2017-08-07 18:00:30 +03:00
Stanislav Erokhin
18961cc5a9
[NI] Analyze lambda in independent context if it isn't call argument
2017-08-07 18:00:28 +03:00
Dmitry Petrov
8599763cb9
Do not perform type checks for function literals in visitor in NI mode
...
They are type-checked as arguments for the corresponding expressions.
2017-08-07 18:00:27 +03:00
Mikhail Zarechenskiy
bc2a8555a3
[NI] Resolve collection literals arguments as postponed ones
2017-08-07 18:00:24 +03:00
Dmitry Petrov
26cc08be65
Fix anonymous function literals handling in type checker
...
- [NI] Create type info directly if the expected type is functional.
- Properly handle suspended function expected type.
2017-08-07 18:00:21 +03:00
Mikhail Zarechenskiy
badbf777df
[NI] Use data flow info from arguments in parenthesis to resolve lambda
...
Fixes 'javaObjectType' and 'javaPrimitiveType'
2017-08-07 18:00:19 +03:00
Mikhail Zarechenskiy
cf55674109
[NI] Support fallback resolve to operator mod if needed
...
Fixes:
- assignmentOperations
- percentAsModOnBigIntegerWithoutRem
2017-08-07 18:00:16 +03:00