From 87b88a738e50bc70b866bfbf2463eabb7846a6f2 Mon Sep 17 00:00:00 2001 From: Pavel Kirpichenkov Date: Fri, 25 Oct 2019 15:45:59 +0300 Subject: [PATCH] [Minor] Update test data for NI --- .../tests/annotations/annotationRenderingInTypes.kt | 5 +++-- .../tests/annotations/rendering/memberProjectedOut.kt | 3 ++- .../rendering/typeMismatchDueToTypeProjections.kt | 3 ++- .../tests/resolve/overloadConflicts/genericClash.kt | 5 +++-- .../diagnostics/testsWithStdLib/addAllProjection.kt | 2 +- .../javaAnnotationWithVarargArgument.kt | 2 +- .../kotlinAnnotationWithVarargArgument.kt | 2 +- .../kClass/kClassArrayInAnnotationsInVariance.kt | 4 ++-- .../kClass/kClassArrayInAnnotationsOutVariance.kt | 6 +++--- .../coroutines/inference/nestedSuspendCallInsideLambda.kt | 2 +- .../testsWithStdLib/coroutines/lambdaExpectedType.kt | 4 ++-- .../testsWithStdLib/coroutines/tryCatchLambda.kt | 2 +- .../testData/diagnostics/testsWithStdLib/resolve/kt4711.kt | 2 +- .../diagnostics/testsWithStdLib/tryCatch/tryExpression.kt | 2 +- 14 files changed, 24 insertions(+), 20 deletions(-) diff --git a/compiler/testData/diagnostics/tests/annotations/annotationRenderingInTypes.kt b/compiler/testData/diagnostics/tests/annotations/annotationRenderingInTypes.kt index 6ad7f38aaff..12accf90560 100644 --- a/compiler/testData/diagnostics/tests/annotations/annotationRenderingInTypes.kt +++ b/compiler/testData/diagnostics/tests/annotations/annotationRenderingInTypes.kt @@ -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) { - val r: Array = f3(a) + val r: Array = f3(a) } @@ -22,4 +23,4 @@ var test3: Int = 0 fun f4(fn: (@Ann Int, @Ann Int) -> Unit) {} -val test4 = f4 { single -> } +val test4 = f4 Unit", "(Int) -> Unit")!>{ single -> } diff --git a/compiler/testData/diagnostics/tests/annotations/rendering/memberProjectedOut.kt b/compiler/testData/diagnostics/tests/annotations/rendering/memberProjectedOut.kt index 99c67a63922..9ff64213d65 100644 --- a/compiler/testData/diagnostics/tests/annotations/rendering/memberProjectedOut.kt +++ b/compiler/testData/diagnostics/tests/annotations/rendering/memberProjectedOut.kt @@ -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 { } fun test(a: C) { - ")!>a[1] = 25 + ")!>a[1] = 25 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/rendering/typeMismatchDueToTypeProjections.kt b/compiler/testData/diagnostics/tests/annotations/rendering/typeMismatchDueToTypeProjections.kt index 6e63befc14f..461153d69c9 100644 --- a/compiler/testData/diagnostics/tests/annotations/rendering/typeMismatchDueToTypeProjections.kt +++ b/compiler/testData/diagnostics/tests/annotations/rendering/typeMismatchDueToTypeProjections.kt @@ -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 { class Out fun test(a: C, y: Out) { - a + ", "Out", "C", "public final operator fun plus(x: Out): C defined in C")!>y + a + ", "Out"), OI;TYPE_MISMATCH_DUE_TO_TYPE_PROJECTIONS("Out", "Out", "C", "public final operator fun plus(x: Out): C defined in C")!>y } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/genericClash.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/genericClash.kt index 84b86d3228a..0b5472a913a 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/genericClash.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/genericClash.kt @@ -1,4 +1,5 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER +// !WITH_NEW_INFERENCE interface A { fun foo(x: T) @@ -14,6 +15,6 @@ fun baz(x: String, y: E) {} fun bar(x: A) { x.foo("") - x.baz("", "") - baz("", "") + x.baz("", "") + baz("", "") } diff --git a/compiler/testData/diagnostics/testsWithStdLib/addAllProjection.kt b/compiler/testData/diagnostics/testsWithStdLib/addAllProjection.kt index 73dfa29926d..0d47fae1499 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/addAllProjection.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/addAllProjection.kt @@ -8,7 +8,7 @@ fun test(mc: MutableCollection) { mc.addAll(listOf("")) mc.addAll(listOf("")) - mc.addAll(listOf("")) + mc.addAll(listOf("")) mc.addAll(emptyList()) mc.addAll(emptyList()) diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/javaAnnotationWithVarargArgument.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/javaAnnotationWithVarargArgument.kt index 006d4521a75..00348297f80 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/javaAnnotationWithVarargArgument.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/javaAnnotationWithVarargArgument.kt @@ -6,6 +6,6 @@ public @interface A { } // FILE: b.kt -@A(*arrayOf(1, "b")) +@A(*arrayOf(1, "b")) fun test() { } diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/kotlinAnnotationWithVarargArgument.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/kotlinAnnotationWithVarargArgument.kt index 396ab51a176..87eb60ef350 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/kotlinAnnotationWithVarargArgument.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationWithVarargParameter/kotlinAnnotationWithVarargArgument.kt @@ -2,6 +2,6 @@ annotation class B(vararg val args: String) -@B(*arrayOf(1, "b")) +@B(*arrayOf(1, "b")) fun test() { } diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassArrayInAnnotationsInVariance.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassArrayInAnnotationsInVariance.kt index 5b024cc8baf..bc57ae7ff64 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassArrayInAnnotationsInVariance.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassArrayInAnnotationsInVariance.kt @@ -14,7 +14,7 @@ class MyClass1 @Ann1(arrayOf(Any::class)) class MyClass1a -@Ann1(arrayOf(B1::class)) +@Ann1(arrayOf(B1::class)) class MyClass2 annotation class Ann2(val arg: Array>) @@ -25,5 +25,5 @@ class MyClass3 @Ann2(arrayOf(B1::class)) class MyClass4 -@Ann2(arrayOf(B2::class)) +@Ann2(arrayOf(B2::class)) class MyClass5 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassArrayInAnnotationsOutVariance.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassArrayInAnnotationsOutVariance.kt index e99d39240eb..121cfda3fe7 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassArrayInAnnotationsOutVariance.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassArrayInAnnotationsOutVariance.kt @@ -11,7 +11,7 @@ annotation class Ann1(val arg: Array>) @Ann1(arrayOf(A::class)) class MyClass1 -@Ann1(arrayOf(Any::class)) +@Ann1(arrayOf(Any::class)) class MyClass1a @Ann1(arrayOf(B1::class)) @@ -19,11 +19,11 @@ class MyClass2 annotation class Ann2(val arg: Array>) -@Ann2(arrayOf(A::class)) +@Ann2(arrayOf(A::class)) class MyClass3 @Ann2(arrayOf(B1::class)) class MyClass4 -@Ann2(arrayOf(B2::class)) +@Ann2(arrayOf(B2::class)) class MyClass5 diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/nestedSuspendCallInsideLambda.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/nestedSuspendCallInsideLambda.kt index 0df46524f9c..047c8cad174 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/nestedSuspendCallInsideLambda.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/nestedSuspendCallInsideLambda.kt @@ -3,7 +3,7 @@ suspend fun wrapUp2() { withContext { - other() + other() } } suspend fun withContext(block: suspend () -> T) {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/lambdaExpectedType.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/lambdaExpectedType.kt index 7c08bebe60b..0466fc0c4cb 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/lambdaExpectedType.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/lambdaExpectedType.kt @@ -28,7 +28,7 @@ fun foo() { i = genericBuilder { 1 } genericBuilder { 1 } genericBuilder { 1 } - genericBuilder { "" } + genericBuilder { "" } val y = { 1 } genericBuilder(y) @@ -43,7 +43,7 @@ fun foo() { val s: String = manyArgumentsBuilder({}, { "" }) { 1 } manyArgumentsBuilder({}, { "" }, { 1 }) - manyArgumentsBuilder({}, { 1 }, { 2 }) + manyArgumentsBuilder({}, { 1 }, { 2 }) severalParamsInLambda { x, y -> x checkType { _() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/tryCatchLambda.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/tryCatchLambda.kt index a5a9f5caf4a..cdbc394658d 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/tryCatchLambda.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/tryCatchLambda.kt @@ -8,7 +8,7 @@ fun genericBuilder(c: suspend () -> T): T = null!! fun foo() { var result = "" genericBuilder { - try { + try { await("") } catch(e: Exception) { result = "fail" diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/kt4711.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/kt4711.kt index 5942f1eb0d9..d57a6ff4c60 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/kt4711.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/kt4711.kt @@ -10,7 +10,7 @@ fun main() { val pi = 4.0.toDouble() * delta * (1..n).reduce( {t, i -> val x = (i - 0.5) * delta - t + 1.0 / (1.0 + x * x) + t + 1.0 / (1.0 + x * x) }) // !!! pi has error type here diff --git a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/tryExpression.kt b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/tryExpression.kt index ca7bc4401a8..23e21dc8dd7 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/tryExpression.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/tryExpression.kt @@ -30,6 +30,6 @@ fun test2(): Map = run { try { emptyMap() } catch (e: ExcA) { - mapOf("" to "") + mapOf("" to "") } } \ No newline at end of file