[Minor] Update test data for NI

This commit is contained in:
Pavel Kirpichenkov
2019-10-25 15:45:59 +03:00
parent 1b96e14b1e
commit 87b88a738e
14 changed files with 24 additions and 20 deletions
@@ -1,5 +1,6 @@
// !RENDER_DIAGNOSTICS_MESSAGES
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -UNUSED_ANONYMOUS_PARAMETER
// !WITH_NEW_INFERENCE
fun f1(x: String) {}
fun f2(f: () -> Unit) {}
@@ -12,7 +13,7 @@ annotation class Ann
fun <@Ann R : @Ann Any> f3(a: Array<@Ann R>): Array<@Ann R?> = null!!
fun test2(a: @Ann Array<in @Ann Int>) {
val r: Array<in Int?> = <!TYPE_INFERENCE_CANNOT_CAPTURE_TYPES("'R' cannot capture 'in Int'. Type parameter has an upper bound 'Any' that cannot be satisfied capturing 'in' projection")!>f3<!>(a)
val r: Array<in Int?> = <!OI;TYPE_INFERENCE_CANNOT_CAPTURE_TYPES("'R' cannot capture 'in Int'. Type parameter has an upper bound 'Any' that cannot be satisfied capturing 'in' projection")!>f3<!>(<!NI;TYPE_MISMATCH("Any", "Int")!>a<!>)
}
@@ -22,4 +23,4 @@ var test3: Int = 0
fun f4(fn: (@Ann Int, @Ann Int) -> Unit) {}
val test4 = f4 { <!EXPECTED_PARAMETERS_NUMBER_MISMATCH("2", "Int, Int")!>single<!> -> }
val test4 = f4 <!NI;TYPE_MISMATCH("(Int, Int) -> Unit", "(Int) -> Unit")!>{ <!EXPECTED_PARAMETERS_NUMBER_MISMATCH("2", "Int, Int")!>single<!> -> }<!>
@@ -1,4 +1,5 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// !WITH_NEW_INFERENCE
// !RENDER_DIAGNOSTICS_MESSAGES
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.TYPE, AnnotationTarget.CLASS)
@@ -11,5 +12,5 @@ class C<T> {
}
fun test(a: C<out CharSequence>) {
<!MEMBER_PROJECTED_OUT("public final operator fun set(x: Int, y: T): Unit defined in C", "C<out CharSequence>")!>a[1]<!> = 25
<!OI;MEMBER_PROJECTED_OUT("public final operator fun set(x: Int, y: T): Unit defined in C", "C<out CharSequence>")!>a[1]<!> = <!NI;CONSTANT_EXPECTED_TYPE_MISMATCH("integer", "Nothing")!>25<!>
}
@@ -1,5 +1,6 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// !RENDER_DIAGNOSTICS_MESSAGES
// !WITH_NEW_INFERENCE
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.TYPE, AnnotationTarget.CLASS)
annotation class A
@@ -13,5 +14,5 @@ class C<T> {
class Out<out F>
fun test(a: C<out CharSequence>, y: Out<CharSequence>) {
a + <!TYPE_MISMATCH_DUE_TO_TYPE_PROJECTIONS("Out<Nothing>", "Out<CharSequence>", "C<out CharSequence>", "public final operator fun plus(x: Out<T>): C<T> defined in C")!>y<!>
a + <!NI;TYPE_MISMATCH("Out<Nothing>", "Out<CharSequence>"), OI;TYPE_MISMATCH_DUE_TO_TYPE_PROJECTIONS("Out<Nothing>", "Out<CharSequence>", "C<out CharSequence>", "public final operator fun plus(x: Out<T>): C<T> defined in C")!>y<!>
}