Mikhael Bogdanov
fca1500d48
Clean code
2017-08-08 09:50:40 +02:00
Mikhail Zarechenskiy
e2dcf47b3b
Fix highlighting range of diagnostic in test data
...
Because of ae3497c6ce
2017-08-08 00:29:18 +03:00
Sergey Igushkin
52f923c5ff
Fix internals of an android-library not accessible in its androidTest
...
Issue #KT-19370 Fixed
2017-08-07 20:33:18 +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
216ab1c6d1
Fix error message for inapplicable operator on getValue function
...
#KT-11739 Fixed
2017-08-07 18:49:52 +03:00
Mikhail Zarechenskiy
7ba073206d
Add test for obsolete issue about SAMs
...
#KT-11951 Obsolete
2017-08-07 18:36:07 +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
9e018fa094
[NI] Try to analyze each lambda at least once
2017-08-07 18:01:20 +03:00
Mikhail Zarechenskiy
07a4496054
[NI] Resolve lambda even if there is contradiction in CS
...
To avoid exceptions about non-recorded lambda
2017-08-07 18:01:19 +03:00
Mikhail Zarechenskiy
a13442b12b
[NI] Fix data flow for arguments in special calls
2017-08-07 18:01:18 +03:00
Mikhail Zarechenskiy
dc83e5ca3a
Fix test which is correctly work in old inference
2017-08-07 18:01:17 +03:00
Mikhail Zarechenskiy
3fb865e07c
Move test for NI to diagnostic tests and add "todo"
2017-08-07 18:01:16 +03:00
Mikhail Zarechenskiy
fb72726f08
Resolve right part of equality with given descriptors
2017-08-07 18:01:15 +03:00
Stanislav Erokhin
6680f01cfe
[NI] Fix assertion error at FlexibleTypeImpl
...
Use KotlinTypeFactory for FlexibleType creation
2017-08-07 18:01:14 +03:00
Mikhail Zarechenskiy
e7cd615450
[NI] Introduce type depth in CS calculator to avoid SOE
2017-08-07 18:01:13 +03:00
Mikhail Zarechenskiy
cf75afba66
[NI] Fix type intersection for equal types
2017-08-07 18:01:12 +03:00
Mikhail Zarechenskiy
ac507e721c
[NI] Do not add non-dynamic candidates when there is dynamic extension
2017-08-07 18:01:11 +03:00
Mikhail Zarechenskiy
21c5187c9e
[NI] Handle dynamic types in type intersector
2017-08-07 18:01:10 +03:00
Mikhail Zarechenskiy
0d464f06d1
[NI] Consider CS as nullable if one of the types isn't subtype of Any
...
Note that this isn't fully correct, consider the following situation:
S : T, T : Any?
=> CS(S, T) = T, but for now it will be T?, which is reliable but not so specific as just T
2017-08-07 18:01:09 +03:00
Mikhail Zarechenskiy
39349abd39
[NI] Preserve name of parameters for functional types
2017-08-07 18:01:07 +03:00
Mikhail Zarechenskiy
5ec8d4920f
[NI] Translate new resolved call to old one to avoid CCE
2017-08-07 18:01:06 +03:00
Dmitry Petrov
c0d6eff97c
[NI] Select variable with proper non-trivial constraint first
2017-08-07 18:01:05 +03:00
Dmitry Petrov
0bf81aeec0
[NI] Extract InferenceStepResolver into a separate component
2017-08-07 18:01:04 +03:00
Dmitry Petrov
258a5aea28
[NI] Minor cleanup in FixationOrderCalculator
2017-08-07 18:01:03 +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
b344865c15
[NI] Minor. Fixes after review
2017-08-07 18:01:01 +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
9378bff65c
[NI] Move irrelevant code from KotlinCallCompleter
...
Extract code about smart cast diagnostic to new component
AdditionalDiagnosticReporter
2017-08-07 18:00:58 +03:00
Stanislav Erokhin
3450340d7f
[NI] Refactoring. Introduced PostponableCallArgument
...
Also here argument resolution was divided to two parts:
for SimpleCallArguments and for PostponableCallArguments.
Call Resolution for SimpleCallArguments also used for CheckReceivers
and lambda result arguments checks
2017-08-07 18:00:57 +03:00
Stanislav Erokhin
1bc68e073d
[NI] Minor. Clarified type for arguments from lambda
2017-08-07 18:00:56 +03:00
Stanislav Erokhin
4848f8e3da
[NI] Use correct type in TypeApproximator for Invariant projection
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
455c43afa8
[NI] Some improvements in callable reference resolution
2017-08-07 18:00:53 +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
7802492b08
[NI] Fix resulting type when there are no proper constraints
2017-08-07 18:00:50 +03:00
Mikhail Zarechenskiy
6be726854f
[NI] Preserve type abbreviation during type substitution
2017-08-07 18:00:49 +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
17cdbcca03
[NI] Approximate substituted type arguments for non-members
2017-08-07 18:00:46 +03:00
Stanislav Erokhin
915ac32bfb
[NI] Improve type inference for T vs Captured(in Smt)
...
If we has Inv<T> <: Inv<Captured(in Foo)> then we should get:
- T <: Captured(in Foo)
- Captured(in Foo) <: T
Before this commit we got: T <: Foo instead first constraint.
2017-08-07 18:00:45 +03:00
Stanislav Erokhin
91241a34d1
[NI] Run checks for captured types only once in NewTypeSubstitutor
...
Sometimes we can get Enum<Captured(*)> type here, so, supertype for
Captured(*) is Enum<Capture(*)> and we go into SO.
2017-08-07 18:00:44 +03:00
Stanislav Erokhin
d58c6e245f
Minor. rename type parameters for debug purposes.
2017-08-07 18:00:43 +03:00
Mikhail Zarechenskiy
e74a02eb94
[NI] Approximate implicit return type for functions
2017-08-07 18:00:42 +03:00
Mikhail Zarechenskiy
ffc130f5fb
[NI] Always approximate captured types for property descriptors
2017-08-07 18:00:41 +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