Add tests making sure that a couple of issues are fixed by PCLA
^KT-49283 Fixed ^KT-64077 Fixed
This commit is contained in:
committed by
Space Team
parent
fb8cc00d1f
commit
a4ccb72b94
@@ -0,0 +1,18 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// WITH_STDLIB
|
||||
// ISSUE: KT-49283
|
||||
|
||||
// IGNORE_BACKEND_K1: ANY
|
||||
|
||||
fun takeListOfStrings(x: List<String>) {}
|
||||
|
||||
fun box(): String {
|
||||
val result = buildList l1@ { // Not enough information to infer type variable E, but could be inferred into String
|
||||
val anotherList = buildList {
|
||||
takeListOfStrings(this)
|
||||
this@l1.add("OK")
|
||||
}
|
||||
}
|
||||
|
||||
return result[0]
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// ISSUE: KT-64077
|
||||
fun <R1> build(block: InvBuilder<R1>.() -> Unit): R1 = TODO()
|
||||
fun <R2> build2(block: InvBuilder<R2>.() -> Unit): R2 = TODO()
|
||||
|
||||
class InvBuilder<R>() {
|
||||
fun set(r: R) {}
|
||||
fun get(): R = TODO()
|
||||
}
|
||||
|
||||
fun consumeInt(e: Int) {}
|
||||
|
||||
fun test() {
|
||||
val ret = build {
|
||||
set("")
|
||||
build2 {
|
||||
set(1)
|
||||
consumeInt(<!ARGUMENT_TYPE_MISMATCH!>this@build.get()<!>) // K1 red ARGUMENT_TYPE_MISMATCH, runtime crash K2
|
||||
}
|
||||
Unit // This unit is essential!!!
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// ISSUE: KT-64077
|
||||
fun <R1> build(block: InvBuilder<R1>.() -> Unit): R1 = TODO()
|
||||
fun <R2> build2(block: InvBuilder<R2>.() -> Unit): R2 = TODO()
|
||||
|
||||
class InvBuilder<R>() {
|
||||
fun set(r: R) {}
|
||||
fun get(): R = TODO()
|
||||
}
|
||||
|
||||
fun consumeInt(e: Int) {}
|
||||
|
||||
fun test() {
|
||||
val ret = build {
|
||||
set("")
|
||||
build2 {
|
||||
set(1)
|
||||
consumeInt(<!TYPE_MISMATCH!>this@build.get()<!>) // K1 red ARGUMENT_TYPE_MISMATCH, runtime crash K2
|
||||
}
|
||||
Unit // This unit is essential!!!
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user