Denis Zharkov
d0bf0f5fb3
Filter out inapplicable non-local levels for implicit receivers
2017-09-28 14:01:30 +03:00
Denis Zharkov
51d3969822
Do not run resolution processors for inapplicable statics
2017-09-28 14:01:30 +03:00
Denis Zharkov
3322ed6e04
Implement LazyImportResolver::definitelyDoesNotContainName
2017-09-28 14:01:30 +03:00
Denis Zharkov
6e766634c1
Add location parameter to ResolutionScope::definitelyDoesNotContainName
...
It should be used to record lookups in case of fast paths
in resolution
2017-09-28 14:01:30 +03:00
Denis Zharkov
69f3b01e98
Introduce ImportingScope::computeImportedNames
2017-09-28 14:01:30 +03:00
Denis Zharkov
688a359985
Avoid running scope processors on hides-member for not-forEach names
2017-09-28 14:01:30 +03:00
Denis Zharkov
fb80e19b88
Filter out inapplicable local scopes in call resolution
...
The idea is that resolution has an approximate complexity
close to (n + n*m) * 3
Where n is a number of scopes, m is a number of receivers
and 3-constant is used because each of these combinations
runs through 3 processors for functions.
And while call resolver seems to be a hot spot, it should be
useful to decreate the value of n
2017-09-28 14:01:30 +03:00
Denis Zharkov
94356e891b
Introduce ResolutionScope::definitelyDoesNotContainName
...
Also add some obvious implementations
This method might be used in resolution to filter out
inapplicable scopes
2017-09-28 14:01:30 +03:00
Alexander Podkhalyuzin
3f8170d369
Clean idea files generated on the gradle import, add them to .gitignore
2017-09-19 23:58:27 +02:00
Ilya Chernikov
27968c8e13
Set proper jvmTarget for projects
2017-09-19 21:37:27 +02:00
Ilya Chernikov
deda50dbbb
Continue switching projects to improved dsl: sourceSets and test running
2017-09-19 21:37:26 +02:00
Ilya Chernikov
61dfb75e0e
Implement Gradle Kotlin DSL build
2017-09-19 21:37:06 +02:00
Stanislav Erokhin
c8ee424f67
Rename isHeader to isExpect in descriptors
2017-09-15 18:25:41 +03:00
Denis Zharkov
97fd72a1e0
Minor. Drop unused function in resolution
2017-09-13 15:34:14 +03:00
Dmitry Petrov
3bae430d49
Resolve lateinit variables
...
Do not report UNINITIALIZED_VARIABLE on lateinit variables
Provide delegating constructors for descriptors for compatibility.
2017-08-31 11:28:08 +03:00
Stanislav Erokhin
98eae4e7ee
[NI] Support Exact and NoInfer annotations
2017-08-25 03:38:48 +03:00
Stanislav Erokhin
d1e52e76f9
[NI] Reduced allowed depth in incorporation
...
We set it to 1 now, because otherwise there is examples where
incorporation work too long. We will fix such cases in the future,
but seems like 1 is also good depth delta for incorporation
2017-08-25 03:38:47 +03:00
Mikhail Zarechenskiy
f31c48017b
[NI] Don't process lambda until expected type will be fixed
2017-08-25 02:47:46 +03:00
Mikhail Zarechenskiy
e666b87545
[NI] Support AllCandidates mode for features in IDE
2017-08-24 13:50:11 +03:00
Mikhail Zarechenskiy
3f8a685ace
[NI] Make return type of !! operator definitely not-null
2017-08-24 13:50:11 +03:00
Mikhail Zarechenskiy
d18a14b717
[NI] Eliminate special intersection type from result type
2017-08-24 13:50:10 +03:00
Mikhail Zarechenskiy
51be629e13
[NI] Pass resulting constraint system for error candidate
2017-08-24 13:50:10 +03:00
Mikhail Zarechenskiy
6f397f8512
[NI] Drop useless isEmpty property from NewTypeSubstitutor
2017-08-24 13:50:10 +03:00
Stanislav Erokhin
6eb534fca8
[NI] Fix processParts in KotlinResolutionCandidate
2017-08-23 15:53:53 +03:00
Mikhail Zarechenskiy
55d1130dfc
[NI] Add getters to avoid inspections about useless boolean expressions
2017-08-23 15:53:49 +03:00
Mikhail Zarechenskiy
f075934697
[NI] Pass candidates with wrong visibility in debugger context
...
See test 'privateMembersPriority' (KT-10634)
2017-08-23 15:53:48 +03:00
Mikhail Zarechenskiy
f42be4aea2
[NI] Fix exception explicit qualified receiver and dispatch receiver
2017-08-23 15:53:46 +03:00
Stanislav Erokhin
d9eef94a8e
[NI] Support smartcast info in ResolvedCall on receivers
2017-08-23 15:53:43 +03:00
Stanislav Erokhin
cb1270836c
[NI] Introduced ResolutionAtom's
...
Introduced new model for resolution result: tree of ResolvedAtoms.
Moved all postprocessing for arguments to front-end module.
Do not create freshDescriptor -- use freshTypeSubstitutor directly.
Removed Candidates for variables+invoke.
Add lazy way for argument analysis -- do not analyze all arguments
if we have subtyping error in first argument, but if we want report
all errors, then all arguments checks will be performed.
Future improvements:
- optimize constraint system usage inside ResolutionCandidate
- improve constraint system API
- improve diagnostic handlers
2017-08-23 15:53:42 +03:00
Stanislav Erokhin
76012f6603
Minor. rename ConstraintSystemCompleter
...
In front-end we have other ConstraintSystemCompleter and because of this
in dist we have ambiguity(because there all src folders compiles inside
same module.
2017-08-23 15:53:41 +03:00
Stanislav Erokhin
e011e443cc
[NI] Implement next call completer.
...
Type inference completer features:
- type variables depended from result type will be fixed in the end
- type variables with proper constraints will be fixed first
- fixation via groups "accessible" via constraints is supported
TODO:
- stable order via PSI order
- argument constraint should rewrite position if constraint is the
same as upper bound for type parameter
2017-08-23 15:53:40 +03:00
Stanislav Erokhin
3cf240340c
[NI] Extract logic about fixation order to separated component
2017-08-23 15:53:39 +03:00
Stanislav Erokhin
ff1e230828
[NI] Use right scope for callable reference resolution
...
Previously was used scope for top-level call. It isn't correct because
if we have callable reference inside lambda -> scope is different.
2017-08-23 15:53:38 +03:00
Stanislav Erokhin
da003d48ff
Support isSuccessful in SuccessfulResultCollector
...
Since now SuccessfulResultCollector do not run computation of
resultingApplicability for error candidate before
getFinalCandidates(). It is very useful because we can do not run
all checks for error candidates if we have not-error candidate.
2017-08-23 15:53:37 +03:00
Stanislav Erokhin
6b8293ae5b
Refactoring. Remove ResolutionCandidateStatus.
...
Use diagnostics directly.
Also TowerCandidate since now know only about applicability
and not about diagnostics itself.
2017-08-23 15:53:36 +03:00
Stanislav Erokhin
cdaa98fb63
[NI] Fixes after review
2017-08-23 15:53:33 +03:00
Stanislav Erokhin
2b01b91315
[NI] Refactoring: KotlinCallContext to stateless component (2)
2017-08-23 15:53:32 +03:00
Stanislav Erokhin
e88c1b4f0a
[NI] Refactoring: KotlinCallContext to stateless component (1)
2017-08-23 15:53:31 +03:00
Stanislav Erokhin
9bbfac11b4
[NI] Add common supertype for PSI lambda arguments
...
Also move initial dataFlowInfo to lambda arguments.
As result, we can not store outer call for postpone call arguments
2017-08-23 15:53:30 +03:00
Dmitry Petrov
674d30cd76
Report deprecation on typealias companion object for deprecated alias
2017-08-10 15:45:44 +03:00
Mikhail Zarechenskiy
053b02e0df
[NI] Fold { Lower | Upper } & Equality constraints if it's possible
2017-08-09 14:00:53 +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
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
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
ac507e721c
[NI] Do not add non-dynamic candidates when there is dynamic extension
2017-08-07 18:01:11 +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