diff --git a/compiler/testData/diagnostics/tests/annotations/kt1860-negative.kt b/compiler/testData/diagnostics/tests/annotations/kt1860-negative.kt index 3fec7de034b..30c980161dc 100644 --- a/compiler/testData/diagnostics/tests/annotations/kt1860-negative.kt +++ b/compiler/testData/diagnostics/tests/annotations/kt1860-negative.kt @@ -3,7 +3,7 @@ fun foo(varargs f : Int) {} var bar : Int = 1 set(varargs v) {} -val x : (Int) -> Int = {([varargs] x : Int) -> x} +val x : (Int) -> Int = {[varargs] x : Int -> x} class Hello(varargs args: Any) { } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/kt1860-positive.kt b/compiler/testData/diagnostics/tests/annotations/kt1860-positive.kt index 9093eae485c..ef085470b05 100644 --- a/compiler/testData/diagnostics/tests/annotations/kt1860-positive.kt +++ b/compiler/testData/diagnostics/tests/annotations/kt1860-positive.kt @@ -5,7 +5,7 @@ fun foo(test f : Int) {} var bar : Int = 1 set(test v) {} -val x : (Int) -> Int = {([test] x : Int) -> x} +val x : (Int) -> Int = {[test] x : Int -> x} // todo fix parser annotation on lambda parameter class Hello(test args: Any) { } diff --git a/compiler/testData/diagnostics/tests/annotations/onFunctionParameter.kt b/compiler/testData/diagnostics/tests/annotations/onFunctionParameter.kt index 9fe7e7c5f76..ddb4c91694f 100644 --- a/compiler/testData/diagnostics/tests/annotations/onFunctionParameter.kt +++ b/compiler/testData/diagnostics/tests/annotations/onFunctionParameter.kt @@ -6,4 +6,4 @@ fun test([ann] p: Int) { val bar = fun test([ann] g: Int) {} -val bas = { ([ann] t: Int) -> } \ No newline at end of file +val bas = { ([ann] t: Int) -> } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.kt b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.kt index 65b24137aa0..bd7b8379f5a 100644 --- a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.kt +++ b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.kt @@ -34,7 +34,7 @@ fun test4() { // should be an error on receiver, shouldn't be thrown away fun test5() { - 1.{ String.(): String -> this}() + 1.{ String.(): String -> this}() } fun R?.sure() : R = this!! diff --git a/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParameterTypeMismatchVariance.kt b/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParameterTypeMismatchVariance.kt index 1cadc4052fc..08b3e7ba7eb 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParameterTypeMismatchVariance.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParameterTypeMismatchVariance.kt @@ -8,12 +8,12 @@ fun foo(f: (Trait) -> Trait) = f fun test(s: Sub) { foo { - (t: Super): Sub -> s + (t: Super): Sub -> s } foo { - (t: Trait): Trait -> s + (t: Trait): Trait -> s } foo { - (t: Sub): Super -> s + (t: Sub): Super -> s } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParametersTypesMismatch.kt b/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParametersTypesMismatch.kt index 5543fdb078b..3337f64a242 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParametersTypesMismatch.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/ExpectedParametersTypesMismatch.kt @@ -9,26 +9,26 @@ fun test1() { "" } foo0 { - (s: String) -> "" + (s: String) -> "" } foo0 { x, y -> "" } foo0 { - (): Int -> 42 + (): Int -> 42 } foo1 { "" } foo1 { - (s: String) -> "" + (s: String) -> "" } foo1 { x, y -> "" } foo1 { - (): Int -> 42 + (): Int -> 42 } @@ -36,12 +36,12 @@ fun test1() { "" } foo2 { - (s: String) -> "" + (s: String) -> "" } foo2 { x -> "" } foo2 { - (): Int -> 42 + (): Int -> 42 } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnsWithExplicitReturnType.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnsWithExplicitReturnType.kt index 1ba557e941e..b6ac6fdb559 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnsWithExplicitReturnType.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnsWithExplicitReturnType.kt @@ -1,11 +1,11 @@ fun test(a: Int) { - run @f{ (): Int -> + run @f{ (): Int -> if (a > 0) return@f "" return@f 1 } - run { (): Int -> "" } - run { (): Int -> 1 } + run { (): Int -> "" } + run { (): Int -> 1 } } fun run(f: () -> T): T { return f() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2484.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2484.kt index 7afa0c2eec9..8ebd4186041 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2484.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2484.kt @@ -8,15 +8,15 @@ fun Array.forEach(operation: (T) -> Unit) : Unit { for (element in this) fun bar(operation: (String) -> Unit) = operation("") fun main(args: Array) { - args.forEach { (a : String) : Unit -> a.length() } // Type mismatch: (String) -> Unit required, (String) -> Int found - args.forEach { (a) : Unit -> a.length() } // Type mismatch: (String) -> Unit required, (String) -> Int found - args.forEach { (a : String) -> a.length() } // Type mismatch: (String) -> Unit required, (String) -> Int found + args.forEach { (a : String) : Unit -> a.length() } // Type mismatch: (String) -> Unit required, (String) -> Int found + args.forEach { (a) : Unit -> a.length() } // Type mismatch: (String) -> Unit required, (String) -> Int found + args.forEach { (a : String) -> a.length() } // Type mismatch: (String) -> Unit required, (String) -> Int found args.forEach { a -> a.length() } // Type mismatch: (String) -> Unit required, (String) -> Int found args.forEach { it.length() } // This works! - bar { (a: String) : Unit -> a.length() } - bar { (a) : Unit -> a.length() } - bar { (a: String) -> a.length() } + bar { (a: String) : Unit -> a.length() } + bar { (a) : Unit -> a.length() } + bar { (a: String) -> a.length() } bar { a -> a.length() } bar { it.length() } } diff --git a/compiler/testData/diagnostics/tests/infos/SmartCasts.kt b/compiler/testData/diagnostics/tests/infos/SmartCasts.kt index 50ab0fad0b7..8be5836d093 100644 --- a/compiler/testData/diagnostics/tests/infos/SmartCasts.kt +++ b/compiler/testData/diagnostics/tests/infos/SmartCasts.kt @@ -177,8 +177,8 @@ fun returnFunctionLiteralBlock(a: Any?): Function0 { else return { 1 } } fun returnFunctionLiteral(a: Any?): Function0 = - if (a is Int) { (): Int -> a } - else { () -> 1 } + if (a is Int) { (): Int -> a } + else { () -> 1 } fun mergeSmartCasts(a: Any?) { if (a is String || a is Int) { diff --git a/compiler/testData/diagnostics/tests/inline/propagation.kt b/compiler/testData/diagnostics/tests/inline/propagation.kt index c994f4a92cd..e6205abf455 100644 --- a/compiler/testData/diagnostics/tests/inline/propagation.kt +++ b/compiler/testData/diagnostics/tests/inline/propagation.kt @@ -6,8 +6,8 @@ inline fun inlineFunWithInvoke(s: (p: Int) -> Unit, ext: Int.(p: Int) -> Unit) { } inline fun inlineFunWithInvokeClosure(s: (p: Int) -> Unit, ext: Int.(p: Int) -> Unit) { - subInline({(p: Int) -> s(p)}, {Int.(p:Int) -> this.ext(p)}) - subNoInline({(p: Int) -> s(p)}, {Int.(p:Int) -> this.ext(p)}) + subInline({p: Int -> s(p)}, {Int.(p:Int) -> this.ext(p)}) + subNoInline({p: Int -> s(p)}, {Int.(p:Int) -> this.ext(p)}) } //No inline @@ -17,8 +17,8 @@ inline fun inlineFunWithInvokeNonInline(noinline s: (p: Int) -> Unit, noinline e } inline fun inlineFunWithInvokeClosureNoinline(noinline s: (p: Int) -> Unit, noinline ext: Int.(p: Int) -> Unit) { - subInline({(p: Int) -> s(p)}, {Int.(p:Int) -> this.ext(p)}) - subNoInline({(p: Int) -> s(p)}, {Int.(p:Int) -> this.ext(p)}) + subInline({p: Int -> s(p)}, {Int.(p:Int) -> this.ext(p)}) + subNoInline({p: Int -> s(p)}, {Int.(p:Int) -> this.ext(p)}) } //ext function @@ -28,8 +28,8 @@ inline fun Function1.inlineExt(ext: Int.(p: Int) -> Unit) { } inline fun Function1.inlineExtWithClosure(ext: Int.(p: Int) -> Unit) { - subInline({(p: Int) -> this(p)}, {Int.(p:Int) -> this.ext(p)}) - subNoInline({(p: Int) -> this(p)}, {Int.(p:Int) -> this.ext(p)}) + subInline({p: Int -> this(p)}, {Int.(p:Int) -> this.ext(p)}) + subNoInline({p: Int -> this(p)}, {Int.(p:Int) -> this.ext(p)}) } inline fun subInline(s: (p: Int) -> Unit, ext: Int.(p: Int) -> Unit) {} diff --git a/compiler/testData/diagnostics/tests/labels/labelReferencesInsideObjectExpressions.kt b/compiler/testData/diagnostics/tests/labels/labelReferencesInsideObjectExpressions.kt index 72eaf7d426c..14249b42887 100644 --- a/compiler/testData/diagnostics/tests/labels/labelReferencesInsideObjectExpressions.kt +++ b/compiler/testData/diagnostics/tests/labels/labelReferencesInsideObjectExpressions.kt @@ -15,7 +15,7 @@ fun B.b() { } fun test() { - @b { B.() -> + @b { B.() -> object : A { override fun foo() { this@b.bar() diff --git a/compiler/testData/diagnostics/tests/regressions/kt306.kt b/compiler/testData/diagnostics/tests/regressions/kt306.kt index a13d02b9310..248cebd0177 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt306.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt306.kt @@ -1,14 +1,14 @@ // KT-306 Ambiguity when different this's have same-looking functions fun test() { - {Foo.() -> + {Foo.() -> bar(); - {Barr.() -> + {Barr.() -> this.bar() bar() } } - {Barr.() -> + {Barr.() -> bar() } } diff --git a/compiler/testData/diagnostics/tests/regressions/kt352.kt b/compiler/testData/diagnostics/tests/regressions/kt352.kt index a6dd0aca0b6..73887af05ae 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt352.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt352.kt @@ -2,18 +2,18 @@ package kt352 -val f : (Any) -> Unit = { () : Unit -> } //type mismatch +val f : (Any) -> Unit = { () : Unit -> } //type mismatch fun foo() { - val f : (Any) -> Unit = { () : Unit -> } //!!! no error + val f : (Any) -> Unit = { () : Unit -> } //!!! no error } class A() { - val f : (Any) -> Unit = { () : Unit -> } //type mismatch + val f : (Any) -> Unit = { () : Unit -> } //type mismatch } //more tests -val g : () -> Unit = { (): Int -> 42 } +val g : () -> Unit = { (): Int -> 42 } val h : () -> Unit = { doSmth() } diff --git a/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiterals.kt b/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiterals.kt index 31e257faed9..73b2db7fcf5 100644 --- a/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiterals.kt +++ b/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiterals.kt @@ -16,11 +16,11 @@ object A { fun foo(i: Int, f: (Int)->Int) = f(i) fun test() { - foo(1) { (x1: Int):Int -> - foo(2) { (x2: Int): Int -> - foo(3) { (x3: Int): Int -> - foo(4) { (x4: Int): Int -> - foo(5) { (x5: Int): Int -> + foo(1) { (x1: Int):Int -> + foo(2) { (x2: Int): Int -> + foo(3) { (x3: Int): Int -> + foo(4) { (x4: Int): Int -> + foo(5) { (x5: Int): Int -> x1 + x2 + x3 + x4 + x5 + A.iii } } diff --git a/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiteralsOverload.kt b/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiteralsOverload.kt index 7c979af9a51..3cf7a1a7990 100644 --- a/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiteralsOverload.kt +++ b/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiteralsOverload.kt @@ -17,11 +17,11 @@ fun foo(a: Any, f: (Any)->Int) = f(a) fun foo(i: Int, f: (Int)->Int) = f(i) fun test() { - foo(1) { (x1: Int):Int -> - foo(2) { (x2: Int): Int -> - foo(3) { (x3: Int): Int -> - foo(4) { (x4: Int): Int -> - foo(5) { (x5: Int): Int -> + foo(1) { (x1: Int):Int -> + foo(2) { (x2: Int): Int -> + foo(3) { (x3: Int): Int -> + foo(4) { (x4: Int): Int -> + foo(5) { (x5: Int): Int -> x1 + x2 + x3 + x4 + x5 + A.iii } } diff --git a/compiler/testData/diagnostics/tests/resolve/resolveWithSpecifiedFunctionLiteralWithId.kt b/compiler/testData/diagnostics/tests/resolve/resolveWithSpecifiedFunctionLiteralWithId.kt index 16b604a923d..bb0bd0b58f5 100644 --- a/compiler/testData/diagnostics/tests/resolve/resolveWithSpecifiedFunctionLiteralWithId.kt +++ b/compiler/testData/diagnostics/tests/resolve/resolveWithSpecifiedFunctionLiteralWithId.kt @@ -21,11 +21,11 @@ fun foo(i: Int, f: (Int)->Int) = f(i) fun id(t: T) = t fun test() { - foo(1, id { (x1: Int):Int -> - foo(2, id { (x2: Int): Int -> - foo(3, id { (x3: Int): Int -> - foo(4, id { (x4: Int): Int -> - foo(5, id { (x5: Int): Int -> + foo(1, id { (x1: Int):Int -> + foo(2, id { (x2: Int): Int -> + foo(3, id { (x3: Int): Int -> + foo(4, id { (x4: Int): Int -> + foo(5, id { (x5: Int): Int -> x1 + x2 + x3 + x4 + x5 + A.iii }) }) diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/dynamicCallsWithLambdas.kt b/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/dynamicCallsWithLambdas.kt index 7e98ff054cf..adb9f975d41 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/dynamicCallsWithLambdas.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/dynamicCallsWithLambdas.kt @@ -5,17 +5,17 @@ fun test(d: dynamic) { d.foo { x -> } - d.foo { (x: Int) -> "" } + d.foo { (x: Int) -> "" } d.foo { x, y -> "" } - d.foo { (x: String, y: Int) -> "" } + d.foo { (x: String, y: Int) -> "" } - d.foo { (x, y: Int) -> "" } + d.foo { (x, y: Int) -> "" } - d.foo { (x: String, y: Int): Int -> "" } + d.foo { (x: String, y: Int): Int -> "" } - d.foo { String.(x: String, y: Int): Int -> length() } + d.foo { String.(x: String, y: Int): Int -> length() } d.foo({}) @@ -27,7 +27,7 @@ fun test(d: dynamic) { d.foo(@label ({ x, y -> })) - d.foo((@label ({ (x, y: Int) -> }))) + d.foo((@label ({ (x, y: Int) -> }))) d.foo(({ x -> }))