[NI] Complete contradictory candidates inside builder-inference

In this test `kotlin` was resolved to the extension
 `val Class<T>.kotlin` because it was saved in builder-inference.
 Usually, it's fine, but not for qualified expressions as they have
 fallback resolve in case of error
This commit is contained in:
Mikhail Zarechenskiy
2020-02-21 15:46:10 +03:00
parent 3398683093
commit f2f95496e3
7 changed files with 52 additions and 2 deletions
@@ -0,0 +1,20 @@
// !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// !DIAGNOSTICS: -UNUSED_PARAMETER
import kotlin.experimental.ExperimentalTypeInference
fun test() {
flow {
emit(42)
kotlin.coroutines.coroutineContext
}
}
@OptIn(ExperimentalTypeInference::class)
fun <T> flow(@BuilderInference block: suspend FlowCollector<T>.() -> Unit): Flow<T> = TODO()
interface Flow<out T>
interface FlowCollector<in T> {
suspend fun emit(value: T)
}
@@ -0,0 +1,17 @@
package
@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun </*0*/ T> flow(/*0*/ @kotlin.BuilderInference block: suspend FlowCollector<T>.() -> kotlin.Unit): Flow<T>
public fun test(): kotlin.Unit
public interface Flow</*0*/ out T> {
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 interface FlowCollector</*0*/ in T> {
public abstract suspend fun emit(/*0*/ value: T): kotlin.Unit
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
}