[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
This commit is contained in:
Dmitriy Novozhilov
2019-05-16 14:51:17 +03:00
parent f47aafc471
commit f20ec3e0a6
80 changed files with 864 additions and 171 deletions
@@ -1,4 +1,6 @@
// FILE: test/GenericSam.java
// !WITH_NEW_INFERENCE
// NI_EXPECTED_FILE
package test;
@@ -16,7 +18,7 @@ fun f3() = java.lang.Runnable::class
fun f4() = java.lang.Runnable::run
fun f5() = GenericSam::class
fun f6() = GenericSam<*>::invoke
fun f6() = GenericSam<*>::<!NI;DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>invoke<!>
fun f7() = test.GenericSam::class
fun f8() = test.GenericSam<String>::invoke