[NI] Don't always complete builder inference lambda in FULL mode
#KT-41164 Fixed
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -EXPERIMENTAL_IS_NOT_ENABLED
|
||||
// ISSUE: KT-41164
|
||||
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
interface MyProducerScope<in E>
|
||||
interface MyFlow<out T>
|
||||
|
||||
fun <K> select(x: K, y: K): K = x
|
||||
|
||||
@OptIn(ExperimentalTypeInference::class)
|
||||
fun <T> myCallbackFlow(@BuilderInference block: MyProducerScope<T>.() -> Unit): MyFlow<T> = null!!
|
||||
|
||||
fun MyProducerScope<*>.myAwaitClose(block: () -> Unit = {}) {}
|
||||
fun <T> myEmptyFlow(): MyFlow<T> = null!!
|
||||
|
||||
fun test(): MyFlow<Int> {
|
||||
return select(
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("MyFlow<kotlin.Any?>")!>myCallbackFlow <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<MyProducerScope<kotlin.Any?>, kotlin.Unit>")!>{
|
||||
myAwaitClose {}
|
||||
}<!><!>,
|
||||
myEmptyFlow()
|
||||
)
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -EXPERIMENTAL_IS_NOT_ENABLED
|
||||
// ISSUE: KT-41164
|
||||
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
interface MyProducerScope<in E>
|
||||
interface MyFlow<out T>
|
||||
|
||||
fun <K> select(x: K, y: K): K = x
|
||||
|
||||
@OptIn(ExperimentalTypeInference::class)
|
||||
fun <T> myCallbackFlow(@BuilderInference block: MyProducerScope<T>.() -> Unit): MyFlow<T> = null!!
|
||||
|
||||
fun MyProducerScope<*>.myAwaitClose(block: () -> Unit = {}) {}
|
||||
fun <T> myEmptyFlow(): MyFlow<T> = null!!
|
||||
|
||||
fun test(): MyFlow<Int> {
|
||||
return select(
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("MyFlow<kotlin.Int>")!>myCallbackFlow <!DEBUG_INFO_EXPRESSION_TYPE("MyProducerScope<kotlin.Int>.() -> kotlin.Unit")!>{
|
||||
myAwaitClose {}
|
||||
}<!><!>,
|
||||
myEmptyFlow()
|
||||
)
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package
|
||||
|
||||
@kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun </*0*/ T> myCallbackFlow(/*0*/ @kotlin.BuilderInference block: MyProducerScope<T>.() -> kotlin.Unit): MyFlow<T>
|
||||
public fun </*0*/ T> myEmptyFlow(): MyFlow<T>
|
||||
public fun </*0*/ K> select(/*0*/ x: K, /*1*/ y: K): K
|
||||
public fun test(): MyFlow<kotlin.Int>
|
||||
public fun MyProducerScope<*>.myAwaitClose(/*0*/ block: () -> kotlin.Unit = ...): kotlin.Unit
|
||||
|
||||
public interface MyFlow</*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 MyProducerScope</*0*/ in E> {
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user