Substitute lambda's receiver type during completion including the builder inference stub variables substitution
^KT-42175 Fixed
This commit is contained in:
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
// WITH_RUNTIME
|
||||
// DONT_TARGET_EXACT_BACKEND: WASM
|
||||
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
operator fun <T> SequenceScope<String>.plusAssign(x: SequenceScope<T>) {}
|
||||
|
||||
@OptIn(ExperimentalTypeInference::class)
|
||||
|
||||
fun <T> mySequence(@BuilderInference block: suspend SequenceScope<T>.() -> Unit): Sequence<T> = Sequence { iterator(block) }
|
||||
|
||||
fun main() {
|
||||
val y: Sequence<String> = mySequence {
|
||||
yield("result")
|
||||
this += this
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
main()
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user