From 00821bbc63a3a24f2d011f6cb8c2a9a2ba361a15 Mon Sep 17 00:00:00 2001 From: "Denis.Zharkov" Date: Tue, 27 Apr 2021 18:03:23 +0300 Subject: [PATCH] FIR: Update test data (repeated diagnostics) They are a bit redundant, but it needs additional work to be done to avoid them --- .../returnTypeMismatchOnOverride.kt | 2 +- .../resolve/samConversions/genericSam.kt | 6 +-- .../resolve/samConversions/kotlinSam.kt | 4 +- .../notSamBecauseOfSupertype.kt | 9 ++-- .../basic.kt | 4 +- .../cli/jvm/instanceAccessBeforeSuperCall.out | 3 ++ .../diagnostics/tests/AutoCreatedIt.fir.kt | 8 ++-- .../testData/diagnostics/tests/Bounds.fir.kt | 2 +- .../SafeCallNonNullReceiverReturnNull.fir.kt | 2 +- .../argumentAndReturnExpectedType.fir.kt | 2 +- .../genericFunctionsWithNullableTypes.fir.kt | 6 +-- ...ionGenericCallableWithNullableTypes.fir.kt | 6 +-- ...AdaptationForReferenceCompatibility.fir.kt | 6 +-- .../tests/cast/AsInBinaryUnary.fir.kt | 6 +-- .../expressionWithNullableType.fir.kt | 16 +++++++ .../expressionWithNullableType.kt | 1 - .../specialConstructsAndPlatformTypes.fir.kt | 2 +- .../tests/cyclicHierarchy/kt303.fir.kt | 2 +- .../clashes/finalMemberOverridden.fir.kt | 2 +- .../severalDelegates.fir.kt | 4 +- .../extensionMemberInClassObject.fir.kt | 19 ++++++++ .../extensionMemberInClassObject.kt | 1 - .../ReceiverByExpectedType.fir.kt | 2 +- ...pectedParameterTypeMismatchVariance.fir.kt | 4 +- .../ExpectedParametersTypesMismatch.fir.kt | 48 +++++++++---------- ...ntOperationInLambdaWithExpectedType.fir.kt | 2 +- .../inferredFunctionalType.fir.kt | 4 +- .../generics/suppressVarianceConflict.fir.kt | 2 +- .../imports/InaccessiblePrivateClass.fir.kt | 2 +- .../specialCallsWithLambdas.fir.kt | 4 +- .../expectedTypeMismatchWithInVariance.fir.kt | 2 +- ...ToUnitForIfAsLastExpressionInLambda.fir.kt | 4 +- .../coercionToUnitWithNothingType.fir.kt | 2 +- ...WithAnonymousFunctionsAndUnresolved.fir.kt | 4 +- .../completionOfMultipleLambdas.fir.kt | 2 +- .../constraintOnFunctionLiteral.fir.kt | 3 +- .../tests/inference/constraints/kt6320.fir.kt | 2 +- .../inference/dependantOnVariance.fir.kt | 14 +++--- .../diagnostics/tests/inference/kt1293.fir.kt | 2 +- .../tests/inference/kt28654.fir.kt | 2 +- ...tionalExpectedTypeForLambdaArgument.fir.kt | 4 +- .../tests/inference/regressions/kt1127.fir.kt | 2 +- .../tests/inference/regressions/kt2741.fir.kt | 2 +- .../tests/inference/regressions/kt2841.fir.kt | 17 +++++++ .../tests/inference/regressions/kt2841.kt | 1 - .../inference/regressions/kt2841_it.fir.kt | 20 ++++++++ .../tests/inference/regressions/kt2841_it.kt | 3 +- .../regressions/kt2841_it_this.fir.kt | 21 ++++++++ .../inference/regressions/kt2841_it_this.kt | 3 +- .../inference/regressions/kt2841_this.fir.kt | 20 ++++++++ .../inference/regressions/kt2841_this.kt | 3 +- .../tests/inference/regressions/kt2883.fir.kt | 4 +- .../FunctionPlaceholder.fir.kt | 6 +-- ...oAmbiguityForDifferentFunctionTypes.fir.kt | 17 +++++++ .../NoAmbiguityForDifferentFunctionTypes.kt | 1 - .../j+k/sam/enhancedSamConstructor.fir.kt | 12 ++--- .../tests/library/Collections.fir.kt | 10 ++-- .../numbers/doublesInSimpleConstraints.fir.kt | 2 +- .../tests/regressions/OutProjections.fir.kt | 2 +- .../TypeMismatchOnUnaryOperations.fir.kt | 4 +- .../tests/regressions/kt312.fir.kt | 2 +- .../overloadConflicts/originalExamples.fir.kt | 2 +- .../javaMemberAgainstExtension.fir.kt | 3 +- .../scopes/inheritance/methodsPriority.fir.kt | 4 +- .../inheritFromContainingClass_after.fir.kt | 4 +- .../inheritFromContainingClass_before.fir.kt | 4 +- .../inheritance/statics/localVsStatic.fir.kt | 4 +- .../headerCallChecker/lambdaAsArgument.fir.kt | 4 +- .../headerCallChecker/memberFunAccess.fir.kt | 2 +- .../headerCallChecker/propertyAccess.fir.kt | 2 +- .../propertyAccessUnitialized.fir.kt | 2 +- .../headerCallChecker/superFunAccess.fir.kt | 2 +- .../superFunAccessOverriden.fir.kt | 2 +- .../superPropertyAccess.fir.kt | 2 +- .../inference/intersectionTypes.fir.kt | 2 +- .../samAdapters/GenericClass.fir.kt | 2 +- .../samAdapters/GenericMethod.fir.kt | 2 +- .../GenericMethodInGenericClass.fir.kt | 4 +- .../samAdapters/Simple.fir.kt | 8 ++-- ...IntersectUpperBoundWithExpectedType.fir.kt | 4 +- .../tests/typeParameters/kt42042.fir.kt | 2 +- .../tests/typeParameters/kt42042Error.fir.kt | 2 +- ...oundViolationInTypeAliasConstructor.fir.kt | 2 +- .../testsWithStdLib/elvisOnJavaList.fir.kt | 2 +- .../onlyInputTypesAndLowPriority.fir.kt | 2 +- .../suspendFunctions.fir.kt | 4 +- .../diagnostics/testsWithStdLib/kt9078.fir.kt | 4 +- .../purelyImplementedCollection/maps.fir.kt | 12 ++--- .../mapsWithNullableKey.fir.kt | 10 ++-- .../mapsWithNullableValues.fir.kt | 8 ++-- .../testsWithStdLib/when/kt10807.fir.kt | 4 +- .../diagnostics/notLinked/dfa/pos/72.fir.kt | 2 +- .../checker/trivialHierarchyLoop.fir.kt | 2 +- 93 files changed, 306 insertions(+), 183 deletions(-) create mode 100644 compiler/testData/diagnostics/tests/classLiteral/expressionWithNullableType.fir.kt create mode 100644 compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.fir.kt create mode 100644 compiler/testData/diagnostics/tests/inference/regressions/kt2841.fir.kt create mode 100644 compiler/testData/diagnostics/tests/inference/regressions/kt2841_it.fir.kt create mode 100644 compiler/testData/diagnostics/tests/inference/regressions/kt2841_it_this.fir.kt create mode 100644 compiler/testData/diagnostics/tests/inference/regressions/kt2841_this.fir.kt create mode 100644 compiler/testData/diagnostics/tests/inference/reportingImprovements/NoAmbiguityForDifferentFunctionTypes.fir.kt diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/returnTypeMismatchOnOverride.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/returnTypeMismatchOnOverride.kt index 4c5ae15c767..6dc8902e693 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/returnTypeMismatchOnOverride.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/returnTypeMismatchOnOverride.kt @@ -57,7 +57,7 @@ open class J() : S() { } open class Base { - open fun kek(): Z = Z() + open fun kek(): Z = Z() } open class GoodDerrived : Base() { diff --git a/compiler/fir/analysis-tests/testData/resolve/samConversions/genericSam.kt b/compiler/fir/analysis-tests/testData/resolve/samConversions/genericSam.kt index 15623b888e3..fa8b377f32a 100644 --- a/compiler/fir/analysis-tests/testData/resolve/samConversions/genericSam.kt +++ b/compiler/fir/analysis-tests/testData/resolve/samConversions/genericSam.kt @@ -21,9 +21,9 @@ fun main() { x.toInt().toString() } - JavaUsage.foo2 { x: Int -> - x.toString() - } + JavaUsage.foo2 { x: Int -> + x.toString() + } JavaUsage.foo3( { x -> diff --git a/compiler/fir/analysis-tests/testData/resolve/samConversions/kotlinSam.kt b/compiler/fir/analysis-tests/testData/resolve/samConversions/kotlinSam.kt index cd4b1791d65..9b3f3f10ed7 100644 --- a/compiler/fir/analysis-tests/testData/resolve/samConversions/kotlinSam.kt +++ b/compiler/fir/analysis-tests/testData/resolve/samConversions/kotlinSam.kt @@ -29,10 +29,10 @@ fun main() { foo1 { x -> x > 1 } foo1(f) - foo2 { x -> x > 1 } + foo2 { x -> x > 1 } foo2(f) - foo3 { x -> x > 1 } + foo3 { x -> x > 1 } foo3(f) foo4 { x -> x > 1 } diff --git a/compiler/fir/analysis-tests/testData/resolve/samConversions/notSamBecauseOfSupertype.kt b/compiler/fir/analysis-tests/testData/resolve/samConversions/notSamBecauseOfSupertype.kt index c9955ff8ac2..2e8f15e87fa 100644 --- a/compiler/fir/analysis-tests/testData/resolve/samConversions/notSamBecauseOfSupertype.kt +++ b/compiler/fir/analysis-tests/testData/resolve/samConversions/notSamBecauseOfSupertype.kt @@ -18,12 +18,11 @@ public class JavaUsage { fun foo(m: MyRunnable) {} fun main() { - JavaUsage.foo { - x -> - x > 1 - } + JavaUsage.foo { + x -> x > 1 + } - JavaUsage.foo({ it > 1 }) + JavaUsage.foo({ it > 1 }) val x = { x: Int -> x > 1 } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/diagnostics/functionReturnTypeMismatchChecker/basic.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/diagnostics/functionReturnTypeMismatchChecker/basic.kt index 112c3a321d2..78b5b3d7d1f 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/diagnostics/functionReturnTypeMismatchChecker/basic.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/diagnostics/functionReturnTypeMismatchChecker/basic.kt @@ -12,7 +12,7 @@ fun ok(): Int { } fun okOneLineFunction(): Int = 10 + 1 -fun errorOneLineFunction(): String = 10 + 1 +fun errorOneLineFunction(): String = 10 + 1 class A { fun bar() {} @@ -52,4 +52,4 @@ fun blockReturnValueTypeMatch2() : Int { if (1 > 2) else return 1.0 return 2.0 -} \ No newline at end of file +} diff --git a/compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.out b/compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.out index 15fb869580c..b4081d81db5 100644 --- a/compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.out +++ b/compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.out @@ -13,6 +13,9 @@ compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.kt:2:74: error: unresolv compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.kt:7:20: error: 'this' is not defined in this context class B(other: B = this) ^ +compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.kt:10:32: error: argument type mismatch: actual type is kotlin/Int but kotlin/Function0 was expected + constructor(x: Int) : this({ + ^ compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.kt:12:9: error: argument type mismatch: actual type is ERROR CLASS: Cannot access '''' before superclass constructor has been called but TypeVariable(_L) was expected this ^ diff --git a/compiler/testData/diagnostics/tests/AutoCreatedIt.fir.kt b/compiler/testData/diagnostics/tests/AutoCreatedIt.fir.kt index 09a0d4d3f8d..c151676b279 100644 --- a/compiler/testData/diagnostics/tests/AutoCreatedIt.fir.kt +++ b/compiler/testData/diagnostics/tests/AutoCreatedIt.fir.kt @@ -3,17 +3,17 @@ fun text() { "direct:a" to "mock:a" "direct:a" on {it.body == ""} to "mock:a" "direct:a" on {it -> it.body == ""} to "mock:a" - bar {1} - bar {it + 1} + bar {1} + bar {it + 1} bar {it, it1 -> it} bar1 {1} bar1 {it + 1} - bar2 {} + bar2 {} bar2 {1} bar2 {it} - bar2 {it -> it} + bar2 {it -> it} } fun bar(f : (Int, Int) -> Int) {} diff --git a/compiler/testData/diagnostics/tests/Bounds.fir.kt b/compiler/testData/diagnostics/tests/Bounds.fir.kt index 2c1c71a57fe..2ce05505b6c 100644 --- a/compiler/testData/diagnostics/tests/Bounds.fir.kt +++ b/compiler/testData/diagnostics/tests/Bounds.fir.kt @@ -21,7 +21,7 @@ package boundsWithSubstitutors class Pair - abstract class C, X : (B) -> Pair, B>>() : B() { // 2 errors + abstract class C, X : (B) -> Pair, B>>() : B() { // 2 errors val a = B<Char>() // error abstract val x : (B) -> B diff --git a/compiler/testData/diagnostics/tests/SafeCallNonNullReceiverReturnNull.fir.kt b/compiler/testData/diagnostics/tests/SafeCallNonNullReceiverReturnNull.fir.kt index e1ef23c55be..240fd132847 100644 --- a/compiler/testData/diagnostics/tests/SafeCallNonNullReceiverReturnNull.fir.kt +++ b/compiler/testData/diagnostics/tests/SafeCallNonNullReceiverReturnNull.fir.kt @@ -3,5 +3,5 @@ fun Int.gg() = null fun ff() { val a: Int = 1 - val b: Int = a?.gg() + val b: Int = a?.gg() } diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/argumentAndReturnExpectedType.fir.kt b/compiler/testData/diagnostics/tests/callableReference/generic/argumentAndReturnExpectedType.fir.kt index 5bc8ad3e762..60b75a40b50 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/argumentAndReturnExpectedType.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/argumentAndReturnExpectedType.fir.kt @@ -18,7 +18,7 @@ fun test1() { bar("", 1, ::fooTakeString).checkType { _>() } bar("", "", ::fooReturnInt).checkType { _>() } - val x: String = bar("", "", ::fooReturnInt) + val x: String = bar("", "", ::fooReturnInt) baz(Int::toString, ::foo).checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/genericFunctionsWithNullableTypes.fir.kt b/compiler/testData/diagnostics/tests/callableReference/generic/genericFunctionsWithNullableTypes.fir.kt index 4cb176ad67a..84441117a43 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/genericFunctionsWithNullableTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/genericFunctionsWithNullableTypes.fir.kt @@ -29,9 +29,9 @@ fun test(x: T) { baz(1, null, ::foo) baz(null, null, ::foo) - val s3: Pair = bar(null, null, ::foo) - val s4: Pair = bar(null, null, ::foo) + val s3: Pair = bar(null, null, ::foo) + val s4: Pair = bar(null, null, ::foo) - val s5: Pair = bar(1, "", ::foo) + val s5: Pair = bar(1, "", ::foo) val (a1: Int, b1: String) = bar(1, "", ::foo) } diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/resolutionGenericCallableWithNullableTypes.fir.kt b/compiler/testData/diagnostics/tests/callableReference/generic/resolutionGenericCallableWithNullableTypes.fir.kt index 68c5db2e4c6..300376e9f75 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/resolutionGenericCallableWithNullableTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/resolutionGenericCallableWithNullableTypes.fir.kt @@ -17,7 +17,7 @@ fun test1() { baz(::foo).checkType { _() } baz(::foo).checkType { _() } - val b1: Int = baz(::foo) - val b2: String = baz(::foo) - val b3: Boolean = baz(::foo) + val b1: Int = baz(::foo) + val b2: String = baz(::foo) + val b3: Boolean = baz(::foo) } diff --git a/compiler/testData/diagnostics/tests/callableReference/unitAdaptationForReferenceCompatibility.fir.kt b/compiler/testData/diagnostics/tests/callableReference/unitAdaptationForReferenceCompatibility.fir.kt index 1e441058319..923a6141a5f 100644 --- a/compiler/testData/diagnostics/tests/callableReference/unitAdaptationForReferenceCompatibility.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/unitAdaptationForReferenceCompatibility.fir.kt @@ -20,6 +20,6 @@ public interface Executor { fun f(): String = "test" class A { - fun schedule1(e: Executor): Future = e.submit(::f) - fun schedule2(e: Executor): Future = e.submit { f() } -} \ No newline at end of file + fun schedule1(e: Executor): Future = e.submit(::f) + fun schedule2(e: Executor): Future = e.submit { f() } +} diff --git a/compiler/testData/diagnostics/tests/cast/AsInBinaryUnary.fir.kt b/compiler/testData/diagnostics/tests/cast/AsInBinaryUnary.fir.kt index c0d39d65d21..39a65c807bf 100644 --- a/compiler/testData/diagnostics/tests/cast/AsInBinaryUnary.fir.kt +++ b/compiler/testData/diagnostics/tests/cast/AsInBinaryUnary.fir.kt @@ -20,12 +20,12 @@ operator fun Impl2.unaryMinus() = Impl2() // See also KT-10384: in non-error functions, as is necessary! fun add1(x: Impl2, y: Base): Impl1 = x as Base + y -fun error1(x: Impl2, y: Base): Impl1 = x + y +fun error1(x: Impl2, y: Base): Impl1 = x + y fun add2(x: Base, y: Impl2): Impl1 = x + y as Base -fun error2(x: Base, y: Impl2): Impl1 = x + y +fun error2(x: Base, y: Impl2): Impl1 = x + y fun minus3(x: Impl2): Impl1 = -(x as Base) -fun error3(x: Impl2): Impl1 = -x +fun error3(x: Impl2): Impl1 = -x diff --git a/compiler/testData/diagnostics/tests/classLiteral/expressionWithNullableType.fir.kt b/compiler/testData/diagnostics/tests/classLiteral/expressionWithNullableType.fir.kt new file mode 100644 index 00000000000..56cb3b7bc20 --- /dev/null +++ b/compiler/testData/diagnostics/tests/classLiteral/expressionWithNullableType.fir.kt @@ -0,0 +1,16 @@ +// FILE: J.java + +public interface J { + String platformString(); +} + +// FILE: test.kt + +fun f1(x: Int?): Any = x::class +fun f2(t: T): Any = t::class +fun f21(t: T): Any where T : Any?, T : Comparable = t::class +fun f3(s: S): Any = s::class +fun f4(u: U?): Any = u::class +fun f5(c: List<*>): Any = c[0]::class + +fun f6(j: J): Any = j.platformString()::class diff --git a/compiler/testData/diagnostics/tests/classLiteral/expressionWithNullableType.kt b/compiler/testData/diagnostics/tests/classLiteral/expressionWithNullableType.kt index c4623c60434..b222cb09911 100644 --- a/compiler/testData/diagnostics/tests/classLiteral/expressionWithNullableType.kt +++ b/compiler/testData/diagnostics/tests/classLiteral/expressionWithNullableType.kt @@ -1,4 +1,3 @@ -// FIR_IDENTICAL // FILE: J.java public interface J { diff --git a/compiler/testData/diagnostics/tests/controlStructures/specialConstructsAndPlatformTypes.fir.kt b/compiler/testData/diagnostics/tests/controlStructures/specialConstructsAndPlatformTypes.fir.kt index 567e0756a26..534dda0051e 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/specialConstructsAndPlatformTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/specialConstructsAndPlatformTypes.fir.kt @@ -12,7 +12,7 @@ public class J { val testImplicitExclExcl1: String = J.s val testImplicitExclExcl2: String? = J.s -val testImplicitExclExcl3: String = J.m[""] +val testImplicitExclExcl3: String = J.m[""] val testImplicitExclExcl4: String? = J.m[""] val testExclExcl1: String = J.s!! diff --git a/compiler/testData/diagnostics/tests/cyclicHierarchy/kt303.fir.kt b/compiler/testData/diagnostics/tests/cyclicHierarchy/kt303.fir.kt index c0f90cf663b..acd5a57f27b 100644 --- a/compiler/testData/diagnostics/tests/cyclicHierarchy/kt303.fir.kt +++ b/compiler/testData/diagnostics/tests/cyclicHierarchy/kt303.fir.kt @@ -9,4 +9,4 @@ open class Bar() : Foo() { } -val x : Int = Foo() +val x : Int = Foo() diff --git a/compiler/testData/diagnostics/tests/delegation/clashes/finalMemberOverridden.fir.kt b/compiler/testData/diagnostics/tests/delegation/clashes/finalMemberOverridden.fir.kt index 10f24e13d59..bdaa4551534 100644 --- a/compiler/testData/diagnostics/tests/delegation/clashes/finalMemberOverridden.fir.kt +++ b/compiler/testData/diagnostics/tests/delegation/clashes/finalMemberOverridden.fir.kt @@ -53,4 +53,4 @@ class CBarT : IBarT { class Test7 : Final(), IBarT by CBarT() -class Test8 : Final(), IBarT by CBar() +class Test8 : Final(), IBarT by CBar() diff --git a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/severalDelegates.fir.kt b/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/severalDelegates.fir.kt index 9aec17205bc..31a575c77f5 100644 --- a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/severalDelegates.fir.kt +++ b/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/severalDelegates.fir.kt @@ -23,6 +23,6 @@ public abstract class MyClass : Base1, Base2 { } } -class A : MyClass(), Base1 by Delegate1(), Base1 by Delegate2() { +class A : MyClass(), Base1 by Delegate1(), Base1 by Delegate2() { -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.fir.kt b/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.fir.kt new file mode 100644 index 00000000000..a5802ec230a --- /dev/null +++ b/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.fir.kt @@ -0,0 +1,19 @@ +// !DIAGNOSTICS: -UNUSED_PARAMETER +// !WITH_NEW_INFERENCE + +interface JPAEntityClass { + fun T.findByName(s: String): D {null!!} +} + +class Foo { + companion object : JPAEntityClass +} + +fun main() { + with("", { + Foo.findByName("") + }) + with(Foo) { + findByName("") + } +} diff --git a/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.kt b/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.kt index 85f107ca35d..46f5bc1c2f0 100644 --- a/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.kt +++ b/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.kt @@ -1,4 +1,3 @@ -// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // !WITH_NEW_INFERENCE diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/ReceiverByExpectedType.fir.kt b/compiler/testData/diagnostics/tests/functionAsExpression/ReceiverByExpectedType.fir.kt index ed8693f6b60..1ba956ba591 100644 --- a/compiler/testData/diagnostics/tests/functionAsExpression/ReceiverByExpectedType.fir.kt +++ b/compiler/testData/diagnostics/tests/functionAsExpression/ReceiverByExpectedType.fir.kt @@ -1,3 +1,3 @@ // !WITH_NEW_INFERENCE fun foo(f: String.() -> Int) {} -val test = foo(fun () = length) +val test = foo(fun () = length) diff --git a/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParameterTypeMismatchVariance.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParameterTypeMismatchVariance.fir.kt index 842cc372edb..b78dc2ed6de 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParameterTypeMismatchVariance.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParameterTypeMismatchVariance.fir.kt @@ -16,6 +16,6 @@ fun test(s: Sub) { t: Trait -> s } - foo(fun(t: Sub) = s) - foo(fun(t): Super = s) + foo(fun(t: Sub) = s) + foo(fun(t): Super = s) } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParametersTypesMismatch.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParametersTypesMismatch.fir.kt index 5d58d8c3227..33e568b0c0e 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParametersTypesMismatch.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParametersTypesMismatch.fir.kt @@ -9,37 +9,37 @@ fun test1() { foo0 { "" } - foo0 { - s: String-> "" - } - foo0 { - x, y -> "" - } + foo0 { + s: String-> "" + } + foo0 { + x, y -> "" + } foo1 { "" } + foo1 { + s: String -> "" + } + foo1 { + x, y -> "" + } foo1 { - s: String -> "" - } - foo1 { - x, y -> "" - } - foo1 { - -> 42 + -> 42 } - foo2 { - "" - } - foo2 { - s: String -> "" - } - foo2 { - x -> "" - } - foo2 { + foo2 { + "" + } + foo2 { + s: String -> "" + } + foo2 { + x -> "" + } + foo2 { -> 42 - } + } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.fir.kt index 08e5bae9fc5..ad9dee88e17 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.fir.kt @@ -12,5 +12,5 @@ fun test(bal: Array) { val e: Unit = run { bar += 4 } - val f: Int = run { bar += 4 } + val f: Int = run { bar += 4 } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/inferredFunctionalType.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/inferredFunctionalType.fir.kt index 651b8a2da93..af2c1f80b19 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/inferredFunctionalType.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/inferredFunctionalType.fir.kt @@ -27,8 +27,8 @@ fun bar(aList: List) { b checkType { _() } } - aList.foo { (a, b): B -> + aList.foo { (a, b): B -> b checkType { _() } a checkType { _() } - } + } } diff --git a/compiler/testData/diagnostics/tests/generics/suppressVarianceConflict.fir.kt b/compiler/testData/diagnostics/tests/generics/suppressVarianceConflict.fir.kt index f348329e716..3a491b04dd4 100644 --- a/compiler/testData/diagnostics/tests/generics/suppressVarianceConflict.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/suppressVarianceConflict.fir.kt @@ -13,5 +13,5 @@ fun foo(x: A, cs: CharSequence, ls: List) { y.foo(cs) val s: String = y.foo(cs, ls) - val ls2: List = y.bar() + val ls2: List = y.bar() } diff --git a/compiler/testData/diagnostics/tests/imports/InaccessiblePrivateClass.fir.kt b/compiler/testData/diagnostics/tests/imports/InaccessiblePrivateClass.fir.kt index b608e3c0d55..b855214d291 100644 --- a/compiler/testData/diagnostics/tests/imports/InaccessiblePrivateClass.fir.kt +++ b/compiler/testData/diagnostics/tests/imports/InaccessiblePrivateClass.fir.kt @@ -14,5 +14,5 @@ package p1 import p2.* -val x: X = X() +val x: X = X() val y: Y = Y() diff --git a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithLambdas.fir.kt b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithLambdas.fir.kt index b5a719de899..119e5c2e3ce 100644 --- a/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithLambdas.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/builderInference/specialCallsWithLambdas.fir.kt @@ -147,7 +147,7 @@ fun poll73(): Flow { fun poll8(): Flow { return flow { - val inv = {1} in setOf({1f}) + val inv = {1} in setOf({1f}) inv() } } @@ -175,7 +175,7 @@ fun poll83(): Flow { fun poll84(): Flow { return flow { - val inv = {{1}} in setOf({{1f}}) + val inv = {{1}} in setOf({{1f}}) inv() } } diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/expectedTypeMismatchWithInVariance.fir.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/expectedTypeMismatchWithInVariance.fir.kt index 12bb9443a9e..c2baf7b9e51 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/expectedTypeMismatchWithInVariance.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/expectedTypeMismatchWithInVariance.fir.kt @@ -5,6 +5,6 @@ fun foo(a1: Array, a2: Array): T = null!! fun test(a1: Array, a2: Array) { - val c: Int = foo(a1, a2) + val c: Int = foo(a1, a2) } diff --git a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionToUnitForIfAsLastExpressionInLambda.fir.kt b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionToUnitForIfAsLastExpressionInLambda.fir.kt index 55ca5294eeb..b4c414777da 100644 --- a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionToUnitForIfAsLastExpressionInLambda.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionToUnitForIfAsLastExpressionInLambda.fir.kt @@ -12,7 +12,7 @@ fun foo(): String? { run { if (true) return@run - if (true) return Obj() // correct error, type check against return type of function "foo" + if (true) return Obj() // correct error, type check against return type of function "foo" } run { @@ -39,4 +39,4 @@ fun foo(): String? { } return "" -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionToUnitWithNothingType.fir.kt b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionToUnitWithNothingType.fir.kt index bd7cd0c840e..22d94ca5740 100644 --- a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionToUnitWithNothingType.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionToUnitWithNothingType.fir.kt @@ -42,7 +42,7 @@ fun test(i: Inv, iUnit: Inv) { } launch { @Suppress("UNSUPPORTED") - run { "" } + run { "" } } if (iUnit is String) { diff --git a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coersionWithAnonymousFunctionsAndUnresolved.fir.kt b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coersionWithAnonymousFunctionsAndUnresolved.fir.kt index 2dc485f8c82..9b18874a312 100644 --- a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coersionWithAnonymousFunctionsAndUnresolved.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coersionWithAnonymousFunctionsAndUnresolved.fir.kt @@ -52,7 +52,7 @@ fun testUnit() { fun testParameter() { takeFnToParameter { } takeFnToParameter { Unit } - takeFnToParameter { unresolved() } + takeFnToParameter { unresolved() } takeFnToParameter { if (true) unresolved() } takeFnToParameter { if (true) unresolved() else unresolved() @@ -66,7 +66,7 @@ fun testParameter() { takeFnToParameter(fun(): Unit { return Unit }) takeFnToParameter(fun() { if (true) return }) takeFnToParameter(fun() { if (true) return Unit }) - takeFnToParameter(fun() = unresolved()) + takeFnToParameter(fun() = unresolved()) takeFnToParameter(fun() { unresolved() }) takeFnToParameter(fun(): Unit { unresolved() }) takeFnToParameter(fun() { return unresolved() }) diff --git a/compiler/testData/diagnostics/tests/inference/completionOfMultipleLambdas.fir.kt b/compiler/testData/diagnostics/tests/inference/completionOfMultipleLambdas.fir.kt index 069f1996f2b..2d16bb1696d 100644 --- a/compiler/testData/diagnostics/tests/inference/completionOfMultipleLambdas.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/completionOfMultipleLambdas.fir.kt @@ -11,7 +11,7 @@ fun test() { select3( { a: A, b: A -> Unit }, { b, a -> Unit }, - { it; Unit } + { it; Unit } ) } diff --git a/compiler/testData/diagnostics/tests/inference/constraints/constraintOnFunctionLiteral.fir.kt b/compiler/testData/diagnostics/tests/inference/constraints/constraintOnFunctionLiteral.fir.kt index 122525114b8..6a20e7b74fd 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/constraintOnFunctionLiteral.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/constraintOnFunctionLiteral.fir.kt @@ -3,10 +3,9 @@ package c import java.util.ArrayList -fun Array.toIntArray(): IntArray = this.mapTo(IntArray(size), {it}) +fun Array.toIntArray(): IntArray = this.mapTo(IntArray(size), {it}) fun Array.toArrayList(): ArrayList = this.mapTo(ArrayList(size), {it}) public fun > Array.mapTo(result: C, transform : (T) -> R) : C = throw Exception("$result $transform") - diff --git a/compiler/testData/diagnostics/tests/inference/constraints/kt6320.fir.kt b/compiler/testData/diagnostics/tests/inference/constraints/kt6320.fir.kt index 0d87ad62be1..377a18614be 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/kt6320.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/kt6320.fir.kt @@ -16,6 +16,6 @@ class C class D(foo: C) { fun test(a: C) { - val d: D = D(a) + val d: D = D(a) } } diff --git a/compiler/testData/diagnostics/tests/inference/dependantOnVariance.fir.kt b/compiler/testData/diagnostics/tests/inference/dependantOnVariance.fir.kt index eb6cfc9d313..02030065e69 100644 --- a/compiler/testData/diagnostics/tests/inference/dependantOnVariance.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/dependantOnVariance.fir.kt @@ -25,17 +25,17 @@ fun test1(int: Int, any: Any) { val a5 : MyList = getMyListToWriteTo(any) - val a6 : MyList = getMyList(int) + val a6 : MyList = getMyList(int) val a7 : MyList = getMyList(int) - val a8 : MyList = getMyListToReadFrom(int) - val a9 : MyList = getMyListToReadFrom(int) + val a8 : MyList = getMyListToReadFrom(int) + val a9 : MyList = getMyListToReadFrom(int) - val a10 : MyList = getMyList(any) - val a11 : MyList = getMyList(any) + val a10 : MyList = getMyList(any) + val a11 : MyList = getMyList(any) - val a12 : MyList = getMyListToWriteTo(any) - val a13 : MyList = getMyListToWriteTo(any) + val a12 : MyList = getMyListToWriteTo(any) + val a13 : MyList = getMyListToWriteTo(any) useMyList(getMyList(int), int) useMyList(getMyList(any), int) diff --git a/compiler/testData/diagnostics/tests/inference/kt1293.fir.kt b/compiler/testData/diagnostics/tests/inference/kt1293.fir.kt index 2bff6e8f05f..eee3c01b0b8 100644 --- a/compiler/testData/diagnostics/tests/inference/kt1293.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/kt1293.fir.kt @@ -5,7 +5,7 @@ package kt1293 fun main() { val intArray = arrayOfNulls(10) - val i : Int = intArray[0] + val i : Int = intArray[0] requiresInt(intArray[0]) } diff --git a/compiler/testData/diagnostics/tests/inference/kt28654.fir.kt b/compiler/testData/diagnostics/tests/inference/kt28654.fir.kt index b5c63b66f0c..246c86b318c 100644 --- a/compiler/testData/diagnostics/tests/inference/kt28654.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/kt28654.fir.kt @@ -2,7 +2,7 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE // Related issue: KT-28654 -fun select(): K = run { } +fun select(): K = run { } fun test() { val x: Int = select() diff --git a/compiler/testData/diagnostics/tests/inference/nonFunctionalExpectedTypeForLambdaArgument.fir.kt b/compiler/testData/diagnostics/tests/inference/nonFunctionalExpectedTypeForLambdaArgument.fir.kt index 92bb0a159b9..befb058613f 100644 --- a/compiler/testData/diagnostics/tests/inference/nonFunctionalExpectedTypeForLambdaArgument.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/nonFunctionalExpectedTypeForLambdaArgument.fir.kt @@ -15,7 +15,7 @@ fun testAny() { fun testAnyCall() { callAny { - error -> error() + error -> error() } } @@ -27,7 +27,7 @@ fun testParam() { fun testParamCall() { callParam { - param -> param() + param -> param() } } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt1127.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt1127.fir.kt index b3a0999132f..7826a33bb55 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt1127.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt1127.fir.kt @@ -6,5 +6,5 @@ package d fun asList(t: T) : List? {} fun main() { - val list : List = asList("") + val list : List = asList("") } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2741.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2741.fir.kt index 6528c36d735..cef3337b9fa 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2741.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2741.fir.kt @@ -9,5 +9,5 @@ fun _arrayList(vararg values: T) : List = throw Exception() class _Pair(val a: A) fun test() { - _arrayList(_Pair(1))._sortBy { it -> xxx } + _arrayList(_Pair(1))._sortBy { it -> xxx } } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2841.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2841.fir.kt new file mode 100644 index 00000000000..34b6397ef08 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2841.fir.kt @@ -0,0 +1,17 @@ +// !WITH_NEW_INFERENCE + +package a + +interface Closeable {} +class C : Closeable {} + +public inline fun T.use1(block: (T)-> R) : R { + return block(this) +} + +fun main() { + C().use1 { + w -> // ERROR here + x + } +} diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2841.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2841.kt index e26830d0d32..8fe0c9ffc98 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2841.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2841.kt @@ -1,4 +1,3 @@ -// FIR_IDENTICAL // !WITH_NEW_INFERENCE package a diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it.fir.kt new file mode 100644 index 00000000000..076d8c24bad --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it.fir.kt @@ -0,0 +1,20 @@ +// !WITH_NEW_INFERENCE + +package a + +interface Closeable { + fun close() {} +} + +class C : Closeable + +public inline fun T.use(block: (t: T)-> R) : R { + return block(this) +} + +fun test() { + C().use { + it.close() + x + } +} diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it.kt index 9932f696ec0..37ba71be17f 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it.kt @@ -1,4 +1,3 @@ -// FIR_IDENTICAL // !WITH_NEW_INFERENCE package a @@ -18,4 +17,4 @@ fun test() { it.close() x } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it_this.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it_this.fir.kt new file mode 100644 index 00000000000..a42aefcaadf --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it_this.fir.kt @@ -0,0 +1,21 @@ +// !WITH_NEW_INFERENCE + +package a + +interface Closeable { + fun close() {} +} + +class C : Closeable + +public inline fun use(t: T, block: T.(T)-> R) : R { + return t.block(t) +} + +fun test() { + use(C()) { + this.close() + it.close() + xx + } +} diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it_this.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it_this.kt index 83cf07ad502..c223113c487 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it_this.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it_this.kt @@ -1,4 +1,3 @@ -// FIR_IDENTICAL // !WITH_NEW_INFERENCE package a @@ -19,4 +18,4 @@ fun test() { it.close() xx } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2841_this.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2841_this.fir.kt new file mode 100644 index 00000000000..e856e2b1b25 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2841_this.fir.kt @@ -0,0 +1,20 @@ +// !WITH_NEW_INFERENCE + +package a + +interface Closeable { + fun close() {} +} + +class C : Closeable + +public inline fun T.use(block: T.()-> R) : R { + return this.block() +} + +fun test() { + C().use { + this.close() + x + } +} diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2841_this.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2841_this.kt index 3081338e9e5..8e5e6c574d6 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2841_this.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2841_this.kt @@ -1,4 +1,3 @@ -// FIR_IDENTICAL // !WITH_NEW_INFERENCE package a @@ -18,4 +17,4 @@ fun test() { this.close() x } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2883.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2883.fir.kt index d014143a310..879d4b84eed 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2883.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2883.fir.kt @@ -22,12 +22,12 @@ fun test() { doAction { bar(12) } - val u: Unit = bar(11) + val u: Unit = bar(11) } fun testWithoutInference(col: MutableCollection) { doAction { col.add(2) } - val u: Unit = col.add(2) + val u: Unit = col.add(2) } diff --git a/compiler/testData/diagnostics/tests/inference/reportingImprovements/FunctionPlaceholder.fir.kt b/compiler/testData/diagnostics/tests/inference/reportingImprovements/FunctionPlaceholder.fir.kt index 23aba2b62af..3bed3f2a2d8 100644 --- a/compiler/testData/diagnostics/tests/inference/reportingImprovements/FunctionPlaceholder.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/reportingImprovements/FunctionPlaceholder.fir.kt @@ -7,9 +7,9 @@ fun foo(a: A) = a fun bar(f: (T) -> R) = f fun test() { - foo { it } - foo { x -> x} - foo { x: Int -> x} + foo { it } + foo { x -> x} + foo { x: Int -> x} bar { it + 1 } bar { x -> x + 1} diff --git a/compiler/testData/diagnostics/tests/inference/reportingImprovements/NoAmbiguityForDifferentFunctionTypes.fir.kt b/compiler/testData/diagnostics/tests/inference/reportingImprovements/NoAmbiguityForDifferentFunctionTypes.fir.kt new file mode 100644 index 00000000000..995f30938ea --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/reportingImprovements/NoAmbiguityForDifferentFunctionTypes.fir.kt @@ -0,0 +1,17 @@ +// !WITH_NEW_INFERENCE + +package a + +interface Closeable {} +class C : Closeable {} + +fun T.foo(block: (T)-> R) = block + +fun T.foo(block: (T, T)-> R) = block + +fun main() { + C().foo { // no ambiguity here + www -> + xs + } +} diff --git a/compiler/testData/diagnostics/tests/inference/reportingImprovements/NoAmbiguityForDifferentFunctionTypes.kt b/compiler/testData/diagnostics/tests/inference/reportingImprovements/NoAmbiguityForDifferentFunctionTypes.kt index 20f697f6907..324921801de 100644 --- a/compiler/testData/diagnostics/tests/inference/reportingImprovements/NoAmbiguityForDifferentFunctionTypes.kt +++ b/compiler/testData/diagnostics/tests/inference/reportingImprovements/NoAmbiguityForDifferentFunctionTypes.kt @@ -1,4 +1,3 @@ -// FIR_IDENTICAL // !WITH_NEW_INFERENCE package a diff --git a/compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.fir.kt b/compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.fir.kt index 15462da0915..64cd635b035 100644 --- a/compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.fir.kt @@ -16,13 +16,13 @@ public interface J2 extends J { // FILE: main.kt fun main() { - J { s: String -> s} // should be prohibited, because SAM value parameter has nullable type + J { s: String -> s} // should be prohibited, because SAM value parameter has nullable type J { "" + it.length } - J { null } - J { it?.length?.toString() } + J { null } + J { it?.length?.toString() } - J2 { s: String -> s} + J2 { s: String -> s} J2 { "" + it.length } - J2 { null } - J2 { it?.length?.toString() } + J2 { null } + J2 { it?.length?.toString() } } diff --git a/compiler/testData/diagnostics/tests/library/Collections.fir.kt b/compiler/testData/diagnostics/tests/library/Collections.fir.kt index c721deda4d3..27a12114e35 100644 --- a/compiler/testData/diagnostics/tests/library/Collections.fir.kt +++ b/compiler/testData/diagnostics/tests/library/Collections.fir.kt @@ -8,7 +8,7 @@ fun testCollection(c: Collection, t: T) { val iterator: Iterator = c.iterator() c.containsAll(c) - val mutableIterator: MutableIterator = c.iterator() + val mutableIterator: MutableIterator = c.iterator() c.add(t) c.remove(1) c.addAll(c) @@ -45,9 +45,9 @@ fun testList(l: List, t: T) { val value: T = l.set(1, t) l.add(1, t) l.remove(1) - val mutableListIterator: MutableListIterator = l.listIterator() - val mutableListIterator1: MutableListIterator = l.listIterator(1) - val mutableList: MutableList = l.subList(1, 2) + val mutableListIterator: MutableListIterator = l.listIterator() + val mutableListIterator1: MutableListIterator = l.listIterator(1) + val mutableList: MutableList = l.subList(1, 2) } fun testMutableList(l: MutableList, t: T) { @@ -66,7 +66,7 @@ fun testSet(s: Set, t: T) { val iterator: Iterator = s.iterator() s.containsAll(s) - val mutableIterator: MutableIterator = s.iterator() + val mutableIterator: MutableIterator = s.iterator() s.add(t) s.remove(1) s.addAll(s) diff --git a/compiler/testData/diagnostics/tests/numbers/doublesInSimpleConstraints.fir.kt b/compiler/testData/diagnostics/tests/numbers/doublesInSimpleConstraints.fir.kt index 3aa4281c58a..6e531829f0f 100644 --- a/compiler/testData/diagnostics/tests/numbers/doublesInSimpleConstraints.fir.kt +++ b/compiler/testData/diagnostics/tests/numbers/doublesInSimpleConstraints.fir.kt @@ -21,5 +21,5 @@ fun test() { val d = either(11, 2.3) checkSubtype(d) - val e: Float = id(1) + val e: Float = id(1) } diff --git a/compiler/testData/diagnostics/tests/regressions/OutProjections.fir.kt b/compiler/testData/diagnostics/tests/regressions/OutProjections.fir.kt index 1544579fc22..48dbe3206e1 100644 --- a/compiler/testData/diagnostics/tests/regressions/OutProjections.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/OutProjections.fir.kt @@ -9,7 +9,7 @@ fun f(expression : T) : G = G() fun foo() : G { val p = Point() - return f(p) + return f(p) } class Out() {} diff --git a/compiler/testData/diagnostics/tests/regressions/TypeMismatchOnUnaryOperations.fir.kt b/compiler/testData/diagnostics/tests/regressions/TypeMismatchOnUnaryOperations.fir.kt index 074bc3a3894..d404428b921 100644 --- a/compiler/testData/diagnostics/tests/regressions/TypeMismatchOnUnaryOperations.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/TypeMismatchOnUnaryOperations.fir.kt @@ -8,9 +8,9 @@ fun main() { val g1 : String = ++v; val h : String = v--; val h1 : String = --v; - val i : String = !true; + val i : String = !true; val j : String = foo@ true; val k : String = foo@ bar@ true; val l : String = -1; val m : String = +1; -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/regressions/kt312.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt312.fir.kt index c0917fdfd79..55c6122115e 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt312.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt312.fir.kt @@ -6,5 +6,5 @@ fun Array.safeGet(index : Int) : T? { } val args : Array = Array(1, {""}) -val name : String = args.safeGet(0) // No error, must be type mismatch +val name : String = args.safeGet(0) // No error, must be type mismatch val name1 : String? = args.safeGet(0) diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/originalExamples.fir.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/originalExamples.fir.kt index ac2070fe9e5..9d84149bd57 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/originalExamples.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/originalExamples.fir.kt @@ -8,7 +8,7 @@ fun overloadedFun1(c: Any = "", b: String = "", f: Any = "") = Right fun overloadedFun1(b: Any = "", c: Any = "", e: String = "") = Wrong val test1: Right = overloadedFun1(b = "") -val test1a: Wrong = overloadedFun1(b = "") +val test1a: Wrong = overloadedFun1(b = "") fun overloadedFun2(a: String, b: Any = "") = Right fun overloadedFun2(a: Any, b: String = "") = Wrong diff --git a/compiler/testData/diagnostics/tests/samConversions/javaMemberAgainstExtension.fir.kt b/compiler/testData/diagnostics/tests/samConversions/javaMemberAgainstExtension.fir.kt index 0638f9ccb7b..2b866cb4c7f 100644 --- a/compiler/testData/diagnostics/tests/samConversions/javaMemberAgainstExtension.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/javaMemberAgainstExtension.fir.kt @@ -16,7 +16,7 @@ fun LiveData.observe(a: Any, observer: (T) -> Unit): Observer { } // FILE: test.kt -fun test1(r: Runnable, l: LiveData): Observer = l.observe(r) { } // partial conversion +fun test1(r: Runnable, l: LiveData): Observer = l.observe(r) { } // partial conversion fun test2(r: Runnable, o: Observer, l: LiveData) { val a = l.observe(r, o) // no conversion @@ -28,4 +28,3 @@ fun test2(r: Runnable, o: Observer, l: LiveData) { val c = l.observe({}) {} // conversion for all arguments c } - diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/methodsPriority.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/methodsPriority.fir.kt index f7c35ad409b..90e14f46766 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/methodsPriority.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/methodsPriority.fir.kt @@ -20,7 +20,7 @@ fun test() { class B: A() { init { - val a: Int = foo() // todo + val a: Int = foo() // todo } } } @@ -31,4 +31,4 @@ class E: A() { init { val a: A = foo() // todo: discuss } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromContainingClass_after.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromContainingClass_after.fir.kt index 2bce74682e1..ac919c10d97 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromContainingClass_after.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromContainingClass_after.fir.kt @@ -12,14 +12,14 @@ open class A : J() { init { foo() bar() - val a: Int = baz() + val a: Int = baz() val b: T = baz() } fun test1() { foo() bar() - val a: Int = baz() + val a: Int = baz() val b: T = baz() } diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromContainingClass_before.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromContainingClass_before.fir.kt index 1482463d2e1..a4f8219498e 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromContainingClass_before.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromContainingClass_before.fir.kt @@ -12,14 +12,14 @@ open class A : J() { init { foo() bar() - val a: Int = baz() + val a: Int = baz() val b: T = baz() } fun test1() { foo() bar() - val a: Int = baz() + val a: Int = baz() val b: T = baz() } diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/localVsStatic.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/localVsStatic.fir.kt index 4f2380bb4ae..38debd27bef 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/localVsStatic.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/localVsStatic.fir.kt @@ -21,7 +21,7 @@ fun test() { class B: A() { init { - val a: Int = foo() // todo + val a: Int = foo() // todo } } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/lambdaAsArgument.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/lambdaAsArgument.fir.kt index 46441fff1a9..861f86c6b97 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/lambdaAsArgument.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/lambdaAsArgument.fir.kt @@ -7,9 +7,9 @@ class A { constructor(x: () -> Int) constructor() : this( { - foo() + + foo() + this.foo() + this@A.foo() + - foobar() + foobar() }) } diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/memberFunAccess.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/memberFunAccess.fir.kt index 96b58ce3770..4efd51ca5a8 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/memberFunAccess.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/memberFunAccess.fir.kt @@ -2,6 +2,6 @@ class A { fun foo() = 1 constructor(x: Int) - constructor(x: Int, y: Int, z: Int = x + foo() + this.foo()) : + constructor(x: Int, y: Int, z: Int = x + foo() + this.foo()) : this(x + foo() + this.foo()) } diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/propertyAccess.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/propertyAccess.fir.kt index ee8342d6e19..6b6896fbc09 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/propertyAccess.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/propertyAccess.fir.kt @@ -2,6 +2,6 @@ class A { val prop = 1 constructor(x: Int) - constructor(x: Int, y: Int, z: Int = x + prop + this.prop) : + constructor(x: Int, y: Int, z: Int = x + prop + this.prop) : this(x + prop + this.prop) } diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/propertyAccessUnitialized.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/propertyAccessUnitialized.fir.kt index c8c5b7abf28..cdb18f2fbc1 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/propertyAccessUnitialized.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/propertyAccessUnitialized.fir.kt @@ -2,6 +2,6 @@ open class B(x: Int) class A : B { val prop = 1 - constructor(x: Int, y: Int = x + prop + this.prop) : + constructor(x: Int, y: Int = x + prop + this.prop) : super(x + prop + this.prop) } diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/superFunAccess.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/superFunAccess.fir.kt index 0112b5a8813..b977fd05e96 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/superFunAccess.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/superFunAccess.fir.kt @@ -3,6 +3,6 @@ open class B(x: Int) { fun foo() = 1 } class A : B { - constructor(x: Int, y: Int = x + foo() + this.foo() + super.foo()) : + constructor(x: Int, y: Int = x + foo() + this.foo() + super.foo()) : super(x + foo() + this.foo() + super.foo()) } diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/superFunAccessOverriden.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/superFunAccessOverriden.fir.kt index 611fd7813a8..7e9f5bc6d8f 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/superFunAccessOverriden.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/superFunAccessOverriden.fir.kt @@ -4,6 +4,6 @@ open class B(x: Int) { } class A : B { override fun foo() = 2 - constructor(x: Int, y: Int = x + foo() + this.foo() + super.foo()) : + constructor(x: Int, y: Int = x + foo() + this.foo() + super.foo()) : super(x + foo() + this.foo() + super.foo()) } diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/superPropertyAccess.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/superPropertyAccess.fir.kt index 0b52e0a30cb..4e2fc08a2fc 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/superPropertyAccess.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/superPropertyAccess.fir.kt @@ -1,6 +1,6 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER open class B(val prop: Int) class A : B { - constructor(x: Int, y: Int = x + prop + this.prop + super.prop) : + constructor(x: Int, y: Int = x + prop + this.prop + super.prop) : super(x + prop + this.prop + super.prop) } diff --git a/compiler/testData/diagnostics/tests/smartCasts/inference/intersectionTypes.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/inference/intersectionTypes.fir.kt index 1a5d2bf5272..4a40d9e72ff 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/inference/intersectionTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/inference/intersectionTypes.fir.kt @@ -31,7 +31,7 @@ fun test(a: A, b: B, c: C) { val k = three(a, b, c) checkSubtype(k) checkSubtype(k) - val l: Int = three(a, b, c) + val l: Int = three(a, b, c) use(d, e, f, g, h, k, l) } diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/GenericClass.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/GenericClass.fir.kt index 2dff77654d4..e3625a4770b 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/GenericClass.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/GenericClass.fir.kt @@ -2,7 +2,7 @@ // JAVAC_EXPECTED_FILE // FILE: KotlinFile.kt fun foo(javaClass: JavaClass): String { - return javaClass.doSomething("", 1) { s: String -> "" } + return javaClass.doSomething("", 1) { s: String -> "" } } // FILE: JavaClass.java diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/GenericMethod.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/GenericMethod.fir.kt index 2af00146d3d..8567f829710 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/GenericMethod.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/GenericMethod.fir.kt @@ -2,7 +2,7 @@ // JAVAC_EXPECTED_FILE // FILE: KotlinFile.kt fun foo(javaClass: JavaClass): String { - return javaClass.doSomething("") { it } + return javaClass.doSomething("") { it } } // FILE: JavaClass.java diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/GenericMethodInGenericClass.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/GenericMethodInGenericClass.fir.kt index abd17056fb1..cebd52e664b 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/GenericMethodInGenericClass.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/GenericMethodInGenericClass.fir.kt @@ -2,8 +2,8 @@ // JAVAC_EXPECTED_FILE // FILE: KotlinFile.kt fun foo(javaClass: JavaClass) { - val a: String = javaClass.doSomething1("", 1) { p: String -> p } - val b: String = javaClass.doSomething2("", 1, true) { p: Int -> p } + val a: String = javaClass.doSomething1("", 1) { p: String -> p } + val b: String = javaClass.doSomething2("", 1, true) { p: Int -> p } } // FILE: JavaClass.java diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/Simple.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/Simple.fir.kt index a2e2a2f4d66..5002953e88c 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/Simple.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/Simple.fir.kt @@ -16,9 +16,9 @@ fun foo(javaClass: JavaClass, kotlinClass: KotlinClass) { bar() } - javaClass.doSomething2 { - bar() - } + javaClass.doSomething2 { + bar() + } } fun bar(){} @@ -27,4 +27,4 @@ fun bar(){} public class JavaClass { public void doSomething(Runnable runnable) { runnable.run(); } public void doSomething2(I i) { i.doIt(); } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/typeParameters/dontIntersectUpperBoundWithExpectedType.fir.kt b/compiler/testData/diagnostics/tests/typeParameters/dontIntersectUpperBoundWithExpectedType.fir.kt index a8b6e5a069b..bb80323465a 100644 --- a/compiler/testData/diagnostics/tests/typeParameters/dontIntersectUpperBoundWithExpectedType.fir.kt +++ b/compiler/testData/diagnostics/tests/typeParameters/dontIntersectUpperBoundWithExpectedType.fir.kt @@ -9,9 +9,9 @@ fun foo(): T? { } fun main() { - val a: Bar? = foo() + val a: Bar? = foo() } fun wtf(): T = TODO() -val bar: Int = wtf() // happily compiles +val bar: Int = wtf() // happily compiles diff --git a/compiler/testData/diagnostics/tests/typeParameters/kt42042.fir.kt b/compiler/testData/diagnostics/tests/typeParameters/kt42042.fir.kt index 9048fe31266..a780b6a296e 100644 --- a/compiler/testData/diagnostics/tests/typeParameters/kt42042.fir.kt +++ b/compiler/testData/diagnostics/tests/typeParameters/kt42042.fir.kt @@ -8,6 +8,6 @@ sealed class Subtype { } fun unsafeCast(value: A): B { - val proof: Subtype = Subtype.Trivial() + val proof: Subtype = Subtype.Trivial() return proof.cast(value) } diff --git a/compiler/testData/diagnostics/tests/typeParameters/kt42042Error.fir.kt b/compiler/testData/diagnostics/tests/typeParameters/kt42042Error.fir.kt index f645eae87f9..c4018ff0a4a 100644 --- a/compiler/testData/diagnostics/tests/typeParameters/kt42042Error.fir.kt +++ b/compiler/testData/diagnostics/tests/typeParameters/kt42042Error.fir.kt @@ -8,6 +8,6 @@ sealed class Subtype { } fun unsafeCast(value: A): B { - val proof: Subtype = Subtype.Trivial() + val proof: Subtype = Subtype.Trivial() return proof.cast(value) } diff --git a/compiler/testData/diagnostics/tests/typealias/boundViolationInTypeAliasConstructor.fir.kt b/compiler/testData/diagnostics/tests/typealias/boundViolationInTypeAliasConstructor.fir.kt index 8c4b1df4396..121f705be3a 100644 --- a/compiler/testData/diagnostics/tests/typealias/boundViolationInTypeAliasConstructor.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/boundViolationInTypeAliasConstructor.fir.kt @@ -13,6 +13,6 @@ class TColl> typealias TC = TColl typealias TC2 = TC -val y1 = TCollAny>() +val y1 = TCollAny>() val y2 = TC() val y3 = TC2() diff --git a/compiler/testData/diagnostics/testsWithStdLib/elvisOnJavaList.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/elvisOnJavaList.fir.kt index 6fb9ad31f41..777bc808f19 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/elvisOnJavaList.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/elvisOnJavaList.fir.kt @@ -15,5 +15,5 @@ public class P { fun foo(c: P): MutableList { // Error should be here: see KT-8168 Typechecker fails for platform collection type - return c.getList() ?: listOf() + return c.getList() ?: listOf() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndLowPriority.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndLowPriority.fir.kt index 22c49051968..076edaa5ce5 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndLowPriority.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAndLowPriority.fir.kt @@ -18,7 +18,7 @@ public fun Map.get1(key: Any?): Int = null!! public fun <@kotlin.internal.OnlyInputTypes K, V> Map.get1(key: K): V? = null!! fun test(map: Map) { - val a: Int = listOf(1).contains1("") + val a: Int = listOf(1).contains1("") val b: Boolean = listOf(1).contains1(1) val c: String? = map.get1("") diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/completion/postponedArgumentsAnalysis/suspendFunctions.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/completion/postponedArgumentsAnalysis/suspendFunctions.fir.kt index adfd486c01c..ade28898909 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/completion/postponedArgumentsAnalysis/suspendFunctions.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/completion/postponedArgumentsAnalysis/suspendFunctions.fir.kt @@ -19,7 +19,7 @@ fun main() { val x1: suspend (Int) -> Unit = takeSuspend(")!>id { it }, ")!>{ x -> x }) // Here, the error should be - val x2: (Int) -> Unit = takeSuspend(")!>id { it }, ")!>{ x -> x }) - val x3: suspend (Int) -> Unit = takeSimpleFunction(")!>id { it }, ")!>{ x -> x }) + val x2: (Int) -> Unit = takeSuspend(")!>id { it }, "), TYPE_MISMATCH, TYPE_MISMATCH!>{ x -> x }) + val x3: suspend (Int) -> Unit = takeSimpleFunction(")!>id { it }, "), TYPE_MISMATCH, TYPE_MISMATCH!>{ x -> x }) val x4: (Int) -> Unit = takeSimpleFunction(id Unit> {}, ")!>{}) } diff --git a/compiler/testData/diagnostics/testsWithStdLib/kt9078.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/kt9078.fir.kt index 27ba075a9ad..dd0bf410807 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/kt9078.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/kt9078.fir.kt @@ -3,10 +3,10 @@ abstract class KFunctionKt9005WorkAround(private val _functionInsta private val _reflectedFunction: kotlin.reflect.KFunction = _functionInstance.reflect() ?: throw IllegalStateException("") private val _parameters: List = run { - _functionInstance.javaClass.methods.first().parameters.map { + _functionInstance.javaClass.methods.first().parameters.map { object : kotlin.reflect.KParameter { override val index: Int = 0 } - } + } } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/maps.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/maps.fir.kt index 3e7f0ce0212..d220473c0af 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/maps.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/maps.fir.kt @@ -26,8 +26,8 @@ fun hashMapTest() { val b4: Map = x val b5: Map = x - val b6: Int = x[""] - val b7: Int = x.get("") + val b6: Int = x[""] + val b7: Int = x.get("") val b8: Int? = x.get("") } @@ -50,8 +50,8 @@ fun treeMapTest() { val b4: Map = x val b5: Map = x - val b6: Int = x[""] - val b7: Int = x.get("") + val b6: Int = x[""] + val b7: Int = x.get("") val b8: Int? = x.get("") } @@ -74,8 +74,8 @@ fun concurrentHashMapTest() { val b4: Map = x val b5: Map = x - val b6: Int = x[""] - val b7: Int = x.get("") + val b6: Int = x[""] + val b7: Int = x.get("") val b8: Int? = x.get("") } diff --git a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/mapsWithNullableKey.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/mapsWithNullableKey.fir.kt index a6165a0767a..3532b3cc0a4 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/mapsWithNullableKey.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/mapsWithNullableKey.fir.kt @@ -25,9 +25,9 @@ fun hashMapTest() { val b4: Map = x val b5: Map = x - val b6: Int = x[""] - val b7: Int = x[null] - val b8: Int = x.get("") + val b6: Int = x[""] + val b7: Int = x[null] + val b8: Int = x.get("") val b9: Int? = x.get("") } @@ -50,8 +50,8 @@ fun treeMapTest() { val b4: Map = x val b5: Map = x - val b6: Int = x[""] - val b7: Int = x.get("") + val b6: Int = x[""] + val b7: Int = x.get("") val b8: Int? = x.get("") } diff --git a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/mapsWithNullableValues.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/mapsWithNullableValues.fir.kt index 754fd19f4fb..4b5d2934f06 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/mapsWithNullableValues.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/mapsWithNullableValues.fir.kt @@ -25,8 +25,8 @@ fun hashMapTest() { val b4: Map = x val b5: Map = x - val b6: Int = x[""] - val b7: Int = x.get("") + val b6: Int = x[""] + val b7: Int = x.get("") val b8: Int? = x.get("") } @@ -49,8 +49,8 @@ fun treeMapTest() { val b4: Map = x val b5: Map = x - val b6: Int = x[""] - val b7: Int = x.get("") + val b6: Int = x[""] + val b7: Int = x.get("") val b8: Int? = x.get("") } diff --git a/compiler/testData/diagnostics/testsWithStdLib/when/kt10807.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/when/kt10807.fir.kt index cc0827a7554..4c92314b803 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/when/kt10807.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/when/kt10807.fir.kt @@ -10,8 +10,8 @@ fun getComp(): Comparator = } fun getCompInverted(): Comparator = - nullsLast( + nullsLast( when { else -> compareBy({ it.a }, { it.b }) } - ) \ No newline at end of file + ) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/72.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/72.fir.kt index 00c243f8d15..a0db9d3fed5 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/72.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/72.fir.kt @@ -13,5 +13,5 @@ fun case_1() { val strs = list as MutableList strs.add("two") & kotlin.collections.MutableList & kotlin.collections.MutableList")!>list - val s: String = & kotlin.collections.MutableList & kotlin.collections.MutableList")!>list[0] + val s: String = & kotlin.collections.MutableList & kotlin.collections.MutableList")!>list[0] } diff --git a/idea/testData/checker/trivialHierarchyLoop.fir.kt b/idea/testData/checker/trivialHierarchyLoop.fir.kt index 685438e8651..8547f61a93c 100644 --- a/idea/testData/checker/trivialHierarchyLoop.fir.kt +++ b/idea/testData/checker/trivialHierarchyLoop.fir.kt @@ -1,3 +1,3 @@ class A : A() {} -val x : Int = A() +val x : Int = A()