diff --git a/compiler/testData/diagnostics/tests/Bounds.kt b/compiler/testData/diagnostics/tests/Bounds.kt index 2efca46f280..b6c3a1a2f22 100644 --- a/compiler/testData/diagnostics/tests/Bounds.kt +++ b/compiler/testData/diagnostics/tests/Bounds.kt @@ -6,7 +6,7 @@ package boundsWithSubstitutors class C : A() val a = B() - val a1 = B<Int>() + val a1 = B<Int>() class X() diff --git a/compiler/testData/diagnostics/tests/generics/kt9985.kt b/compiler/testData/diagnostics/tests/generics/kt9985.kt index 73f71d9693d..fbf95708cd5 100644 --- a/compiler/testData/diagnostics/tests/generics/kt9985.kt +++ b/compiler/testData/diagnostics/tests/generics/kt9985.kt @@ -27,15 +27,15 @@ fun foo(l: A?) { foo(l?.bar()) checkType { _() } foo(l?.gav()) checkType { _() } if (l != null) { - foo(l?.bar()) checkType { _() } - foo(l?.gav()) checkType { _() } + foo(l?.bar()) checkType { _() } + foo(l?.gav()) checkType { _() } } } fun fooNotNull(l: A) { // No errors should be here - foo(l?.bar()) checkType { _() } - foo(l?.gav()) checkType { _() } + foo(l?.bar()) checkType { _() } + foo(l?.gav()) checkType { _() } } fun bar() { diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.kt index da3c5bfd356..2fb01b55793 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.kt @@ -20,7 +20,7 @@ fun foo2(a: A, b: A) { a.foo2(Inv()) a.foo2(Inv()) - a.foo2<Inv>(Inv()) + a.foo2<Inv>(Inv()) a.foo3(In()) a.foo3(In()) @@ -32,7 +32,7 @@ fun foo2(a: A, b: A) { b.foo2(Inv()) b.foo2(Inv()) - b.foo2<Inv>(Inv()) + b.foo2<Inv>(Inv()) b.foo3(In()) diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferences.kt b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferences.kt index da4759bb918..cd1eead40ba 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferences.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferences.kt @@ -39,7 +39,7 @@ fun select(vararg x: R) = x[0] fun poll0(): Flow { return flow { val inv = select(::bar, ::foo) - inv() + inv() } } @@ -53,7 +53,7 @@ fun poll01(): Flow { fun poll02(): Flow { return flow { val inv = select(::bar3, ::foo3) - inv() + inv() } } @@ -67,7 +67,7 @@ fun poll03(): Flow { fun poll04(): Flow { return flow { val inv = select(::bar5, ::foo5) - inv + inv } } @@ -81,7 +81,7 @@ fun poll05(): Flow { fun poll06(): Flow { return flow { val inv = select(foo7(), ::Foo7) - inv + inv } } @@ -101,14 +101,14 @@ fun poll11(flag: Boolean): Flow { fun poll12(flag: Boolean): Flow { return flow { - val inv = if (flag) { ::bar3 } else { ::foo3 } - inv() + val inv = if (flag) { ::bar3 } else { ::foo3 } + inv() } } fun poll13(flag: Boolean): Flow { return flow { - val inv = if (flag) { ::bar2 } else { ::foo3 } + val inv = if (flag) { ::bar2 } else { ::foo3 } inv() } } @@ -122,8 +122,8 @@ fun poll14(flag: Boolean): Flow { fun poll15(flag: Boolean): Flow { return flow { - val inv = if (flag) { ::bar5 } else { ::foo5 } - inv() + val inv = if (flag) { ::bar5 } else { ::foo5 } + inv() } } @@ -137,14 +137,14 @@ fun poll16(flag: Boolean): Flow { fun poll17(flag: Boolean): Flow { return flow { val inv = if (flag) { foo7() } else { ::Foo7 } - inv + inv } } fun poll2(flag: Boolean): Flow { return flow { val inv = when (flag) { true -> ::bar else -> ::foo } - inv() + inv() } } @@ -158,7 +158,7 @@ fun poll21(flag: Boolean): Flow { fun poll22(flag: Boolean): Flow { return flow { val inv = when (flag) { true -> ::bar3 else -> ::foo3 } - inv() + inv() } } @@ -193,7 +193,7 @@ fun poll26(flag: Boolean): Flow { fun poll3(flag: Boolean): Flow { return flow { val inv = when (flag) { true -> ::bar false -> ::foo } - inv() + inv() } } @@ -207,7 +207,7 @@ fun poll31(flag: Boolean): Flow { fun poll32(flag: Boolean): Flow { return flow { val inv = when (flag) { true -> ::bar3 false -> ::foo3 } - inv() + inv() } } @@ -241,8 +241,8 @@ fun poll36(flag: Boolean): Flow { fun poll4(): Flow { return flow { - val inv = try { ::bar } finally { ::foo } - inv() + val inv = try { ::bar } finally { ::foo } + inv() } } @@ -255,8 +255,8 @@ fun poll41(): Flow { fun poll42(): Flow { return flow { - val inv = try { ::bar3 } finally { ::foo3 } - inv() + val inv = try { ::bar3 } finally { ::foo3 } + inv() } } @@ -269,8 +269,8 @@ fun poll43(): Flow { fun poll44(): Flow { return flow { - val inv = try { ::bar5 } finally { ::foo5 } - inv() + val inv = try { ::bar5 } finally { ::foo5 } + inv() } } @@ -290,8 +290,8 @@ fun poll46(): Flow { fun poll5(): Flow { return flow { - val inv = try { ::bar } catch (e: Exception) { ::foo } finally { ::foo } - inv() + val inv = try { ::bar } catch (e: Exception) { ::foo } finally { ::foo } + inv() } } @@ -304,8 +304,8 @@ fun poll51(): Flow { fun poll52(): Flow { return flow { - val inv = try { ::bar3 } catch (e: Exception) { ::foo3 } finally { ::foo3 } - inv() + val inv = try { ::bar3 } catch (e: Exception) { ::foo3 } finally { ::foo3 } + inv() } } @@ -318,8 +318,8 @@ fun poll53(): Flow { fun poll54(): Flow { return flow { - val inv = try { ::bar5 } catch (e: Exception) { ::foo5 } finally { ::foo5 } - inv() + val inv = try { ::bar5 } catch (e: Exception) { ::foo5 } finally { ::foo5 } + inv() } } @@ -333,14 +333,14 @@ fun poll55(): Flow { fun poll56(): Flow { return flow { val inv = try { ::Foo7 } catch (e: Exception) { foo7() } finally { foo7() } - inv + inv } } fun poll6(): Flow { return flow { - val inv = ::bar - inv + val inv = ::bar + inv } } @@ -353,8 +353,8 @@ fun poll61(): Flow { fun poll62(): Flow { return flow { - val inv = ::bar3 - inv + val inv = ::bar3 + inv } } @@ -367,8 +367,8 @@ fun poll63(): Flow { fun poll64(): Flow { return flow { - val inv = ::bar5 - inv + val inv = ::bar5 + inv } } @@ -388,8 +388,8 @@ fun poll66(): Flow { fun poll7(): Flow { return flow { - val inv = ::bar!! - inv() + val inv = ::bar!! + inv() } } @@ -402,8 +402,8 @@ fun poll71(): Flow { fun poll72(): Flow { return flow { - val inv = ::bar3!! - inv() + val inv = ::bar3!! + inv() } } @@ -416,8 +416,8 @@ fun poll73(): Flow { fun poll74(): Flow { return flow { - val inv = ::bar5!! - inv + val inv = ::bar5!! + inv } } @@ -437,7 +437,7 @@ fun poll76(): Flow { fun poll8(): Flow { return flow { - val inv = ::bar in setOf(::foo) + val inv = ::bar in setOf(::foo) inv() } } @@ -451,7 +451,7 @@ fun poll81(): Flow { fun poll82(): Flow { return flow { - val inv = ::bar3 in setOf(::foo3) + val inv = ::bar3 in setOf(::foo3) inv() } } @@ -465,7 +465,7 @@ fun poll83(): Flow { fun poll84(): Flow { return flow { - val inv = ::bar5 in setOf(::foo5) + val inv = ::bar5 in setOf(::foo5) inv } } @@ -486,8 +486,8 @@ fun poll86(): Flow { fun poll87(): Flow { return flow { - val inv = ::Foo7 in setOf(foo7()) - inv + val inv = ::Foo7 in setOf(foo7()) + inv } } diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExression.kt b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExression.kt index fbf0f6f9699..521a512472a 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExression.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesDontCareTypeInBlockExression.kt @@ -50,14 +50,14 @@ fun poll11(flag: Boolean): Flow { fun poll12(flag: Boolean): Flow { return flow { - val inv = if (flag) { ::bar3 } else { ::foo3 } - inv() + val inv = if (flag) { ::bar3 } else { ::foo3 } + inv() } } fun poll13(flag: Boolean): Flow { return flow { - val inv = if (flag) { ::bar2 } else { ::foo3 } + val inv = if (flag) { ::bar2 } else { ::foo3 } inv() } } @@ -71,8 +71,8 @@ fun poll14(flag: Boolean): Flow { fun poll15(flag: Boolean): Flow { return flow { - val inv = if (flag) { ::bar5 } else { ::foo5 } - inv() + val inv = if (flag) { ::bar5 } else { ::foo5 } + inv() } } @@ -86,14 +86,14 @@ fun poll16(flag: Boolean): Flow { fun poll17(flag: Boolean): Flow { return flow { val inv = if (flag) { foo7() } else { ::Foo7 } - inv + inv } } fun poll4(): Flow { return flow { - val inv = try { ::bar } finally { ::foo } - inv() + val inv = try { ::bar } finally { ::foo } + inv() } } @@ -106,8 +106,8 @@ fun poll41(): Flow { fun poll42(): Flow { return flow { - val inv = try { ::bar3 } finally { ::foo3 } - inv() + val inv = try { ::bar3 } finally { ::foo3 } + inv() } } @@ -120,8 +120,8 @@ fun poll43(): Flow { fun poll44(): Flow { return flow { - val inv = try { ::bar5 } finally { ::foo5 } - inv() + val inv = try { ::bar5 } finally { ::foo5 } + inv() } } @@ -141,8 +141,8 @@ fun poll46(): Flow { fun poll5(): Flow { return flow { - val inv = try { ::bar } catch (e: Exception) { ::foo } finally { ::foo } - inv() + val inv = try { ::bar } catch (e: Exception) { ::foo } finally { ::foo } + inv() } } @@ -155,8 +155,8 @@ fun poll51(): Flow { fun poll52(): Flow { return flow { - val inv = try { ::bar3 } catch (e: Exception) { ::foo3 } finally { ::foo3 } - inv() + val inv = try { ::bar3 } catch (e: Exception) { ::foo3 } finally { ::foo3 } + inv() } } @@ -169,8 +169,8 @@ fun poll53(): Flow { fun poll54(): Flow { return flow { - val inv = try { ::bar5 } catch (e: Exception) { ::foo5 } finally { ::foo5 } - inv() + val inv = try { ::bar5 } catch (e: Exception) { ::foo5 } finally { ::foo5 } + inv() } } @@ -184,6 +184,6 @@ fun poll55(): Flow { fun poll56(): Flow { return flow { val inv = try { ::Foo7 } catch (e: Exception) { foo7() } finally { foo7() } - inv + inv } } diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt index e8e69041c03..e357ec6494c 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithCallableReferencesErrorType.kt @@ -37,8 +37,8 @@ class Flow(private val block: suspend FlowCollector.() -> Unit) fun poll7(): Flow { return flow { - val inv = ::bar!! - inv() + val inv = ::bar!! + inv() } } @@ -51,8 +51,8 @@ fun poll71(): Flow { fun poll72(): Flow { return flow { - val inv = ::bar3!! - inv() + val inv = ::bar3!! + inv() } } @@ -65,8 +65,8 @@ fun poll73(): Flow { fun poll74(): Flow { return flow { - val inv = ::bar5!! - inv + val inv = ::bar5!! + inv } } diff --git a/compiler/testData/diagnostics/tests/inference/kt47316.kt b/compiler/testData/diagnostics/tests/inference/kt47316.kt index 72c88dd57ab..f881ef0e15d 100644 --- a/compiler/testData/diagnostics/tests/inference/kt47316.kt +++ b/compiler/testData/diagnostics/tests/inference/kt47316.kt @@ -30,7 +30,7 @@ fun String.asFsdAddress(): String { fun box(): String { val state = Test().state if (state is GoBuildingRunningState<*>) { - state.buildingWorkingDirectory.asFsdAddress() + state.buildingWorkingDirectory.asFsdAddress() } return "OK" } diff --git a/compiler/testData/diagnostics/tests/typealias/boundsViolationInDeepTypeAliasExpansion.kt b/compiler/testData/diagnostics/tests/typealias/boundsViolationInDeepTypeAliasExpansion.kt index c28152b7ac1..87e7208a5da 100644 --- a/compiler/testData/diagnostics/tests/typealias/boundsViolationInDeepTypeAliasExpansion.kt +++ b/compiler/testData/diagnostics/tests/typealias/boundsViolationInDeepTypeAliasExpansion.kt @@ -14,4 +14,4 @@ fun test4(x: TC2>() val test6 = TC2>() val test7 = TC2>() -val test8 = TC2List>() +val test8 = TC2List>() diff --git a/compiler/testData/diagnostics/tests/typealias/boundsViolationInTypeAliasExpansion.kt b/compiler/testData/diagnostics/tests/typealias/boundsViolationInTypeAliasExpansion.kt index badd11e9c6c..40739a7922b 100644 --- a/compiler/testData/diagnostics/tests/typealias/boundsViolationInTypeAliasExpansion.kt +++ b/compiler/testData/diagnostics/tests/typealias/boundsViolationInTypeAliasExpansion.kt @@ -28,4 +28,4 @@ fun test12(x: TCList>) {} val test13 = TC>() val test14 = TC>() val test15 = TC>() -val test16 = TCList>() +val test16 = TCList>() diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls.kt index 597625d0104..79e9a156bf0 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls.kt @@ -1,3 +1,4 @@ +// !LANGUAGE: -TypeEnhancementImprovementsInStrictMode // FULL_JDK // FILE: MapLike.java diff --git a/compiler/testData/diagnostics/testsWithStdLib/builderInference/incorrectCallsWithRestrictions.txt b/compiler/testData/diagnostics/testsWithStdLib/builderInference/incorrectCallsWithRestrictions.txt index a72fa6593da..aa1fb869364 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/builderInference/incorrectCallsWithRestrictions.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/builderInference/incorrectCallsWithRestrictions.txt @@ -2,14 +2,8 @@ package public val test1: kotlin.collections.List public val test2: kotlin.collections.List -public val test3: [ERROR : Type for generate { - yield(3) - yieldBarReturnType(3) -}] -public val test4: [ERROR : Type for generate { - yield(3) - barReturnType() -}] +public val test3: kotlin.collections.List +public val test4: kotlin.collections.List public fun generate(/*0*/ @kotlin.BuilderInference g: suspend GenericController.() -> kotlin.Unit): kotlin.collections.List public final class GenericController { diff --git a/compiler/testData/diagnostics/testsWithStdLib/builderInference/useInferenceInformationFromExtensionWithRestrictions.txt b/compiler/testData/diagnostics/testsWithStdLib/builderInference/useInferenceInformationFromExtensionWithRestrictions.txt index bdb5071930e..9a2789c7e6e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/builderInference/useInferenceInformationFromExtensionWithRestrictions.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/builderInference/useInferenceInformationFromExtensionWithRestrictions.txt @@ -1,8 +1,6 @@ package -public val extension: [ERROR : Type for generate { - extensionYield("foo") -}] +public val extension: kotlin.collections.List public val normal: kotlin.collections.List public val safeExtension: kotlin.collections.List public fun generate(/*0*/ @kotlin.BuilderInference g: suspend GenericController.() -> kotlin.Unit): kotlin.collections.List diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.kt index f32bcb18d64..6d385196345 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.kt @@ -21,7 +21,7 @@ fun test_2() { fun test_3() { sequence { yield(materialize()) - materialize() + materialize() } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.kt index f866bcfc5eb..955bf6863e0 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt41308.kt @@ -1,10 +1,10 @@ // FIR_IDENTICAL -// ISSUE: KT-41308 +// ISSUE: KT-41308, KT-47830 fun main() { - sequence { + sequence { val list: List? = null val outputList = ")!>list ?: listOf() - yieldAll(outputList) + yieldAll(outputList) } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt41430.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt41430.kt index 668d9990625..52138745311 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt41430.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt41430.kt @@ -1,4 +1,4 @@ -// ISSUE: KT-41430 +// ISSUE: KT-41430, KT-47830 class A @@ -14,7 +14,7 @@ fun test_2(list: List>) { fun test_3(list: List>) { sequence { - ")!>list.flatMapTo(mutableSetOf()) { it } + list.flatMapTo(mutableSetOf()) { it } yield(A()) } } @@ -22,6 +22,6 @@ fun test_3(list: List>) { fun test_4(list: List>) { sequence { yield(A()) - ")!>list.flatMapTo(mutableSetOf()) { it } + "), TYPE_MISMATCH, TYPE_MISMATCH!>list.flatMapTo(mutableSetOf()) { it } } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/notNullAnnotation.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/notNullAnnotation.kt index 2c1cd1514b7..cfa77186243 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/notNullAnnotation.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/notNullAnnotation.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +NewInference +// !LANGUAGE: -TypeEnhancementImprovementsInStrictMode // FILE: SmartFMap.java diff --git a/compiler/testData/diagnostics/testsWithStdLib/java/checkEnhancedUpperBounds.kt b/compiler/testData/diagnostics/testsWithStdLib/java/checkEnhancedUpperBounds.kt index 556657578d8..6efd793e6d9 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/java/checkEnhancedUpperBounds.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/java/checkEnhancedUpperBounds.kt @@ -1,4 +1,5 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE +// !LANGUAGE: -TypeEnhancementImprovementsInStrictMode // FULL_JDK // FILE: MapLike.java