Commit Graph

20 Commits

Author SHA1 Message Date
Victor Petukhov 260683c20e NI: Improve postponed arguments analysis
Introduce seven stages:
1) Analyze postponed arguments with fixed parameter types
2) Collect parameter types from constraints and lambda parameters' declaration
3) Fix not postponed variables for parameter types of all postponed arguments
4) Create atoms with revised expected types if needed
5) Analyze the first ready postponed argument and rerun stages if it has been analyzed
6) Force fixation remaining type variables: fix if possible or report not enough information
7) Force analysis remaining not analyzed postponed arguments and rerun stages if there are

^KT-37952 Fixed
^KT-32156 Fixed
^KT-37249 Fixed
^KT-37341 Fixed
2020-05-07 11:42:00 +03:00
Pavel Kirpichenkov 78c9bbcc0d [NI] Soften restictions on using Nothing as proper constraint for full call completion
Consider lower `Nothing` constraint non-proper only if there is a dependant not analyzed postponed atom.
Early completion to `Nothing` provides data flow info for smart casts.

KT-35668 Fixed
2020-01-23 19:12:01 +03:00
Pavel Kirpichenkov 2d21b82501 [NI] Remove hack for special functions
Treating special functions for `if`, `when`, `try`, `?:` as not accepting `Nothing` result type is incorrect.
Making so leads to cases with uninferred `Nothing` result type for inner calls and lost data flow info.
2019-12-27 18:40:42 +03:00
Dmitriy Novozhilov 0c01499d98 [NI] Improve completing calls with multiple postponed arguments
#KT-27999 Fixed
#KT-30244 Fixed
#KT-31102 Fixed
2019-12-26 10:53:03 +03:00
Mikhail Zarechenskiy 787a8bb9bd Revert "[NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI"
This reverts commit 7c4101e21c.

 #KT-31866 Fixed
 #KT-31868 Fixed
 #EA-125401 Fixed
 #KT-25290 Open
2019-06-07 12:31:38 +03:00
Dmitriy Novozhilov 7c4101e21c [NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI 2019-05-29 10:35:46 +03:00
Mikhail Zarechenskiy 848640253a Revert "[NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI"
This reverts commit f20ec3e0a6.
2019-05-29 01:31:28 +03:00
Dmitriy Novozhilov f20ec3e0a6 [NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI
There is added a new service named `SubstitutingScopeProvider`, that
  provides factory that creates captured types and approximator for them.
  In OI they are the same as before commit, for NI they are empty, because
  that approximation interferes with NI algorithm

That service is injected into function descriptors and property descriptors
  and used for creating `SubstitutingScope` with correct services

Also there is changed time when we approximate captured types in NI
  (after all call checkers)

#KT-25290 Fixed
2019-05-28 11:18:33 +03:00
Dmitriy Novozhilov e70bdb51c5 [NI] Automatically squash equal diagnostics in OI and NI in testdata 2019-04-19 10:53:19 +03:00
Mikhail Zarechenskiy ca894a6a71 [NI] Don't complete nested call if there's no constraints at all 2019-03-25 12:17:28 +03:00
Dmitriy Novozhilov 9825984bc5 [NI] Update test data for diagnostic tests 2019-03-25 12:17:27 +03:00
Mikhail Zarechenskiy 612baacc25 Make useless elvis diagnostic more consistent for new and old inference
Also, remove diagnostics that can be covered by usual USELESS_ELVIS diagnostic
2018-04-12 14:38:55 +03:00
Mikhail Zarechenskiy 3afd4a2f4a [NI] Record all diagnostics from subcalls resolution results 2018-02-14 14:58:04 +03:00
Mikhail Zarechenskiy 328c67b9e8 Add separate diagnostic renderer results for tests with NI 2017-11-29 02:54:30 +03:00
Mikhail Zarechenskiy 8757298994 Add diagnostics to test data from NI 2017-11-29 02:54:26 +03:00
Mikhail Zarechenskiy a71238bf94 Place !WITH_NEW_INFERENCE directive to diagnostics test data 2017-11-29 02:53:49 +03:00
Mikhail Zarechenskiy 2d3ce89afc Use only completed arguments of special call 2017-07-13 12:26:03 +03:00
Mikhail Glukhikh d08d8af407 USELESS_ELVIS_RIGHT_IS_NULL : build fix (add to different files in DiagnosticsTestGenerated), do not report if USELESS_ELVIS already exists
(cherry picked from commit c71b656)
2016-08-23 16:26:54 +03:00
Mikhail Glukhikh 5ccbf47531 Elvis / if / when now infer error type in case of ErrorType + Nothing #KT-6665 Fixed
(cherry picked from commit 9a50a0b)
2016-06-17 16:43:24 +03:00
Mikhail Glukhikh 069282cb6e Regression test #KT-8277 Can't Reproduce 2016-01-28 13:33:29 +03:00