Added custom "sure" function in some diagnostic tests, because it is being removed from builtins.
This commit is contained in:
@@ -6,4 +6,6 @@ fun foo1() {
|
||||
<!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>fooT22<!>()
|
||||
}
|
||||
|
||||
val n : Nothing = null.sure()
|
||||
val n : Nothing = null!!
|
||||
|
||||
fun <T : Any> T?.sure() : T = this!!
|
||||
|
||||
@@ -8,4 +8,5 @@ fun bar(a: Any?) {
|
||||
}
|
||||
}
|
||||
|
||||
fun <T : Any> T?.foo() {}
|
||||
fun <T : Any> T?.foo() {}
|
||||
fun <T : Any> T?.sure() : T = this!!
|
||||
@@ -1,7 +1,9 @@
|
||||
//KT-1558 Exception while analyzing
|
||||
package j
|
||||
|
||||
fun testArrays(val ci: List<Int?>, val cii: List<Int?>) {
|
||||
fun <T : Any> T?.sure() : T = this!!
|
||||
|
||||
fun testArrays(val ci: List<Int?>, val cii: List<Int?>?) {
|
||||
val c1: Array<Int?> = cii.sure().toArray(<!FUNCTION_CALL_EXPECTED!><!NO_VALUE_FOR_PARAMETER, NO_VALUE_FOR_PARAMETER!>Array<!><Int?><!>)
|
||||
|
||||
val c2: Array<Int?> = ci.toArray(Array<Int?><!NO_VALUE_FOR_PARAMETER, NO_VALUE_FOR_PARAMETER!>()<!>)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
//KT-742 Stack overflow in type inference
|
||||
package a
|
||||
|
||||
fun <T : Any> T?.sure() : T = this!!
|
||||
|
||||
class List<T>(val head: T, val tail: List<T>? = null)
|
||||
|
||||
fun <T, Q> List<T>.map1(f: (T)-> Q): List<T>? = tail!!.map1(f)
|
||||
|
||||
@@ -15,4 +15,6 @@ fun foo(lines: List<String>) {
|
||||
}
|
||||
|
||||
//standard library
|
||||
fun <T : Any> T?.sure() : T = this!!
|
||||
|
||||
public inline fun <T> comparator(<!UNUSED_PARAMETER!>fn<!>: (T,T) -> Int): Comparator<T> {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
Reference in New Issue
Block a user