[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
@@ -0,0 +1,29 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// !WITH_NEW_INFERENCE
// FILE: JavaFace.java
public interface JavaFace<T> {
void singleMethod();
}
// FILE: JavaFaceUser.java
public class JavaFaceUser<T> {
public <X> void use1(JavaFace<X> face) {}
public void use2(JavaFace<T> face) {}
}
// FILE: KotlinSamUser.kt
fun JavaFaceUser<out Any>.useOut() {
use1<Any> {}
use2 {}
}
fun JavaFaceUser<in Any>.useIn() {
use1<Any> {}
use2 {}
}
fun JavaFaceUser<Any>.useInv() {
use1<Any> {}
use2 {}
}
@@ -0,0 +1,21 @@
package
public fun JavaFaceUser<in kotlin.Any>.useIn(): kotlin.Unit
public fun JavaFaceUser<kotlin.Any>.useInv(): kotlin.Unit
public fun JavaFaceUser<out kotlin.Any>.useOut(): kotlin.Unit
public interface JavaFace</*0*/ T : kotlin.Any!> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public abstract fun singleMethod(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public open class JavaFaceUser</*0*/ T : kotlin.Any!> {
public constructor JavaFaceUser</*0*/ T : kotlin.Any!>()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
public open fun </*0*/ X : kotlin.Any!> use1(/*0*/ face: JavaFace<X!>!): kotlin.Unit
public open fun use2(/*0*/ face: JavaFace<T!>!): kotlin.Unit
}