diff --git a/compiler/testData/diagnostics/testsWithStdLib/addAllProjection.kt b/compiler/testData/diagnostics/testsWithStdLib/addAllProjection.kt index f338d15b4d7..73dfa29926d 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/addAllProjection.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/addAllProjection.kt @@ -1,14 +1,14 @@ // !WITH_NEW_INFERENCE fun test(mc: MutableCollection) { - mc.addAll(mc) + mc.addAll(mc) - mc.addAll(arrayListOf()) + mc.addAll(arrayListOf()) mc.addAll(arrayListOf()) - mc.addAll(listOf("")) - mc.addAll(listOf("")) - 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 00348297f80..006d4521a75 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 87eb60ef350..396ab51a176 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 bc57ae7ff64..5b024cc8baf 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 121cfda3fe7..e99d39240eb 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/applyInsideCoroutine.ni.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/applyInsideCoroutine.ni.txt index 861d69dbc6a..09d104dd806 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/applyInsideCoroutine.ni.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/applyInsideCoroutine.ni.txt @@ -1,8 +1,25 @@ package -public val test1: ??? -public val test2: ??? -public val test3: ??? +public val test1: [ERROR : Type for generate { + apply { + yield(4) + } +}] +public val test2: [ERROR : Type for generate { + yield(B) + apply { + yield(C) + } +}] +public val test3: [ERROR : Type for generate { + this.let { + yield(B) + } + + apply { + yield(C) + } +}] public fun generate(/*0*/ g: suspend Controller.() -> kotlin.Unit): S public interface A { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.kt index 7aafbff5bdd..4ff8e63652c 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.kt @@ -53,7 +53,7 @@ val test6 = generate { } val test7 = generate { - yield("baz") + yield("baz") genericExtension() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.ni.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.ni.txt index 4b2dfcbb0cd..f3a2ee1919d 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.ni.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionWithNonValuableConstraints.ni.txt @@ -1,7 +1,9 @@ package public val test1: kotlin.String -public val test2: kotlin.Any? +public val test2: [ERROR : Type for generate { + baseExtension() +}] public val test3: kotlin.Int public val test4: kotlin.Any? public val test5: kotlin.Int diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionsWithNonValuableConstraintsGenericBase.ni.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionsWithNonValuableConstraintsGenericBase.ni.txt index b5f7fb08b84..fd48df2e0e9 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionsWithNonValuableConstraintsGenericBase.ni.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/extensionsWithNonValuableConstraintsGenericBase.ni.txt @@ -1,11 +1,15 @@ package public val test1: kotlin.String -public val test2: kotlin.Any? +public val test2: [ERROR : Type for generate { + starBase() +}] public val test3: kotlin.String public val test4: kotlin.Int public val test5: kotlin.Int -public val test6: kotlin.Any? +public val test6: [ERROR : Type for generateSpecific { + stringBase() +}] public fun generate(/*0*/ @kotlin.BuilderInference g: suspend Controller.() -> kotlin.Unit): S public fun generateSpecific(/*0*/ @kotlin.BuilderInference g: suspend SpecificController.() -> kotlin.Unit): S public fun Base<*>.starBase(): kotlin.Unit diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/inferCoroutineTypeInOldVersion.ni.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/inferCoroutineTypeInOldVersion.ni.txt index 36443636f61..efde51d672d 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/inferCoroutineTypeInOldVersion.ni.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/inferCoroutineTypeInOldVersion.ni.txt @@ -2,7 +2,9 @@ package public val extension: kotlin.collections.List public val member: kotlin.collections.List -public val memberWithoutAnn: kotlin.collections.List +public val memberWithoutAnn: [ERROR : Type for wrongBuild { + add(42) +}] public val safeExtension: kotlin.collections.List public fun build(/*0*/ g: suspend Builder.() -> kotlin.Unit): kotlin.collections.List public fun wrongBuild(/*0*/ g: Builder.() -> kotlin.Unit): kotlin.collections.List diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators2.ni.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators2.ni.txt index 18d72d5c225..78927684873 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators2.ni.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/recursiveGenerators2.ni.txt @@ -1,6 +1,11 @@ package -public val test1: kotlin.collections.List> +public val test1: [ERROR : Type for generate { + // TODO: KT-15185 + yieldGenerate { + yield(4) + } +}] public fun generate(/*0*/ @kotlin.BuilderInference g: suspend GenericController.() -> kotlin.Unit): kotlin.collections.List @kotlin.BuilderInference public suspend fun GenericController>.yieldGenerate(/*0*/ g: suspend GenericController.() -> kotlin.Unit): kotlin.Unit diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/resolveUsualCallWithBuilderInference.ni.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/resolveUsualCallWithBuilderInference.ni.txt index 2c2293e9996..4ba791ecafa 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/resolveUsualCallWithBuilderInference.ni.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/resolveUsualCallWithBuilderInference.ni.txt @@ -2,7 +2,9 @@ package public val extension: kotlin.collections.List public val member: kotlin.collections.List -public val memberWithoutAnn: kotlin.collections.List +public val memberWithoutAnn: [ERROR : Type for wrongBuild { + add(42) +}] public val safeExtension: kotlin.collections.List public fun build(/*0*/ @kotlin.BuilderInference g: Builder.() -> kotlin.Unit): kotlin.collections.List public fun wrongBuild(/*0*/ g: Builder.() -> kotlin.Unit): kotlin.collections.List diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWithErrors.ni.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWithErrors.ni.txt index d5cae1aa27b..e1c830c8f28 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWithErrors.ni.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWithErrors.ni.txt @@ -1,6 +1,8 @@ package -public val test1: kotlin.Any? +public val test1: [ERROR : Type for generate { + yield(A) +}] public val test2: kotlin.Int public fun generate(/*0*/ @kotlin.BuilderInference g: suspend Controller.() -> kotlin.Unit): S diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWrongUpperBound.ni.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWrongUpperBound.ni.txt index c2415d62369..4e862b7743f 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWrongUpperBound.ni.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/suspendCallsWrongUpperBound.ni.txt @@ -1,6 +1,8 @@ package -public val test: ??? +public val test: [ERROR : Type for generate { + yield("foo") +}] public fun generate(/*0*/ g: suspend Controller.() -> kotlin.Unit): S public final class Controller { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/withUninferredParameter.ni.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/withUninferredParameter.ni.txt index a052cb2fec4..5bc218f1a4a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/withUninferredParameter.ni.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/withUninferredParameter.ni.txt @@ -1,6 +1,8 @@ package -public val test1: ??? +public val test1: [ERROR : Type for generate { + yield(4) +}] public val test2: kotlin.Int public val test3: kotlin.Int public fun generate(/*0*/ g: suspend GenericController.(S) -> kotlin.Unit): S diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/lambdaExpectedType.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/lambdaExpectedType.kt index 0466fc0c4cb..7c08bebe60b 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 cdbc394658d..a5a9f5caf4a 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/inference/kt11266.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/kt11266.kt index ba3299f2b20..218fb33e0e4 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/kt11266.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/kt11266.kt @@ -1,4 +1,4 @@ // !WITH_NEW_INFERENCE // NI_EXPECTED_FILE -fun foo(first: Array, second: Array) = Pair(first.toCollection(), second.toCollection()) \ No newline at end of file +fun foo(first: Array, second: Array) = Pair(first.toCollection(), second.toCollection()) \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/kt11266.ni.txt b/compiler/testData/diagnostics/testsWithStdLib/inference/kt11266.ni.txt index 71d97fe0ee3..e1f0a5b5c7b 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/kt11266.ni.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/kt11266.ni.txt @@ -1,3 +1,3 @@ package -public fun foo(/*0*/ first: kotlin.Array, /*1*/ second: kotlin.Array): kotlin.Pair, kotlin.collections.MutableCollection> +public fun foo(/*0*/ first: kotlin.Array, /*1*/ second: kotlin.Array): [ERROR : Error function type] diff --git a/compiler/testData/diagnostics/testsWithStdLib/reified/arrayConstruction.kt b/compiler/testData/diagnostics/testsWithStdLib/reified/arrayConstruction.kt index 0390aedf06c..b502f0241cc 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/reified/arrayConstruction.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/reified/arrayConstruction.kt @@ -5,7 +5,7 @@ fun ok1(block: () -> Array): Array = block() inline fun ok2(): Array = Array(1) { null!! } -fun fail2(): Array = ok1 { Array<T>(1) { null!! } } +fun fail2(): Array = ok1 { Array<T>(1) { null!! } } fun ok3(block: () -> Array): Array = ok1 { block() } inline fun ok4(): Array = ok1 { Array(1) { null!! } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/kt4711.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/kt4711.kt index d57a6ff4c60..5942f1eb0d9 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