[FE 1.0] Don't use BuilderInferenceSubstitutionConstraintPosition for declared upper bound constraint with no substituted upper bound

It leads to further infer type variable into those upper bounds which is forbidden

Substituted upper bounds is ok because specific substituted types came from constraints of other proper positions, or if specific substituted type is from declared upper bound too, then there should be another declared upper bound with no substitution

^KT-51464 Fixed
^KT-47986 Fixed
This commit is contained in:
Victor Petukhov
2022-05-31 09:57:00 +02:00
committed by teamcity
parent c3b5d83f31
commit 848075192c
16 changed files with 278 additions and 1 deletions
@@ -0,0 +1,12 @@
fun <T> flowOf(value: T): Flow<T> = TODO()
interface FlowCollector<in T> {}
interface Flow<out T>
fun <T, R> Flow<T>.transform(transform: FlowCollector<R>.(T) -> Unit): Flow<R> = TODO()
fun f() {
fun <T> doEmit(collector: FlowCollector<T>) {}
flowOf(1).<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>transform<!> { doEmit(this) }
}