Replace deprecated lambda syntax in testData
It's done with similar constructions where possible trying to preserve intended behavior. Some usages are removed because they test exactly the feature that we are going to drop soon.
This commit is contained in:
+1
-1
@@ -7,5 +7,5 @@ fun <T, R> foo(a: A<T, R>) = a
|
||||
fun test() {
|
||||
foo { it }
|
||||
foo { x -> x}
|
||||
foo { (x: Int) -> x}
|
||||
foo { x: Int -> x}
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
fun foo() {
|
||||
val (i :Int, s :String) = bar()
|
||||
val h = {() :Unit -> bar() }
|
||||
val h = { -> bar() }
|
||||
for (i :Int in collection) {
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
fun foo() {
|
||||
val (i: Int, s: String) = bar()
|
||||
val h = {(): Unit -> bar() }
|
||||
val h = { -> bar() }
|
||||
for (i: Int in collection) {
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
fun foo() {
|
||||
val (i:Int,s:String) = bar()
|
||||
val h = {():Unit -> bar()}
|
||||
val h = { -> bar()}
|
||||
for (i:Int in collection) {
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -16,19 +16,19 @@ fun test3(): Int {
|
||||
}
|
||||
|
||||
fun test4(): Int {
|
||||
return synchronized(this) {(): Int ->
|
||||
return synchronized(this) { ->
|
||||
return@synchronized 12
|
||||
}
|
||||
}
|
||||
|
||||
fun test5(): Int {
|
||||
return synchronized(this) {(): Int ->
|
||||
return synchronized(this) { ->
|
||||
return@synchronized 12
|
||||
}
|
||||
}
|
||||
|
||||
fun test6(): Int {
|
||||
return synchronized(this) {(): Int ->
|
||||
return synchronized(this) { ->
|
||||
return
|
||||
|
||||
@synchronized
|
||||
|
||||
+3
-3
@@ -16,19 +16,19 @@ fun test3(): Int {
|
||||
}
|
||||
|
||||
fun test4(): Int {
|
||||
return synchronized(this) {(): Int ->
|
||||
return synchronized(this) { ->
|
||||
return@synchronized 12
|
||||
}
|
||||
}
|
||||
|
||||
fun test5(): Int {
|
||||
return synchronized(this) {(): Int ->
|
||||
return synchronized(this) { ->
|
||||
return @synchronized 12
|
||||
}
|
||||
}
|
||||
|
||||
fun test6(): Int {
|
||||
return synchronized(this) {(): Int ->
|
||||
return synchronized(this) { ->
|
||||
return
|
||||
|
||||
@synchronized
|
||||
|
||||
@@ -2,7 +2,7 @@ fun test(some: (Int) -> Int) {
|
||||
}
|
||||
|
||||
fun foo() = test() {it}
|
||||
val function = test {(a: Int) -> a}
|
||||
val function = test {a: Int -> a}
|
||||
val function1 = test {a: Int -> a}
|
||||
val function2 = test { }
|
||||
val function3 = test {}
|
||||
|
||||
@@ -2,7 +2,7 @@ fun test(some: (Int) -> Int) {
|
||||
}
|
||||
|
||||
fun foo() = test() { it }
|
||||
val function = test {(a: Int) -> a }
|
||||
val function = test { a: Int -> a }
|
||||
val function1 = test { a: Int -> a }
|
||||
val function2 = test { }
|
||||
val function3 = test {}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ fun test(some: (Int) -> Int) {
|
||||
}
|
||||
|
||||
fun foo() = test() { it }
|
||||
val function = test { (a: Int) -> a }
|
||||
val function = test { a: Int -> a }
|
||||
val function1 = test {a : Int -> a}
|
||||
val function2 = test { }
|
||||
val function3 = test {}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
fun <T> test(a: Int) = {(a: Int) -> a }
|
||||
fun <T> test(a: Int) = { a: Int -> a }
|
||||
class Test<T>
|
||||
|
||||
fun foo() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
fun < T > test( a: Int ) = {( a: Int ) -> a }
|
||||
fun < T > test( a: Int ) = { a: Int -> a }
|
||||
class Test< T >
|
||||
|
||||
fun foo( ) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun foo(): Any {
|
||||
return { (x: String<caret>) -> 42 }
|
||||
return { x: String<caret> -> 42 }
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
fun f() {
|
||||
val f = { (<caret>x: Int) -> x + x }
|
||||
val f = { <caret>x: Int -> x + x }
|
||||
}
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
fun f() {
|
||||
val f = { (<caret>y: Int) -> y + y }
|
||||
val f = { <caret>y: Int -> y + y }
|
||||
}
|
||||
+1
-1
@@ -5,6 +5,6 @@ class C {
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
val lambda = {() -> /* STATEMENT DELETED: x() */; C() }
|
||||
val lambda = { -> /* STATEMENT DELETED: x() */; C() }
|
||||
lambda().<caret>f()
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,6 +3,6 @@ class C {
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
val lambda = {() -> x(); C() }
|
||||
val lambda = { -> x(); C() }
|
||||
lambda().<caret>f()
|
||||
}
|
||||
|
||||
Vendored
+4
-10
@@ -1,29 +1,23 @@
|
||||
fun foo(f: (Int) -> Unit) {
|
||||
{ (m: Int, n: Int, s: String) ->
|
||||
{ m: Int, n: Int, s: String ->
|
||||
val a = n + m
|
||||
println(s)
|
||||
f(a)
|
||||
}
|
||||
|
||||
{ (n: Int, s: String) ->
|
||||
{ n: Int, s: String ->
|
||||
val a = n + 1
|
||||
println(s)
|
||||
f(a)
|
||||
}
|
||||
|
||||
<selection>{ Int.(n: Int, s: String) ->
|
||||
val q: Int.(Int, String) -> Unit = <selection>{ n: Int, s: String ->
|
||||
val a = n + this
|
||||
println(s)
|
||||
f(a)
|
||||
}</selection>
|
||||
|
||||
{ Int.(m: Int, r: String) ->
|
||||
val b = m + this
|
||||
println(r)
|
||||
f(b)
|
||||
}
|
||||
|
||||
val g: Int.(Int, String) -> Unit = { (a, b) ->
|
||||
val g: Int.(Int, String) -> Unit = { a, b ->
|
||||
val m = a + this
|
||||
println(b)
|
||||
f(m)
|
||||
|
||||
+2
-8
@@ -1,16 +1,10 @@
|
||||
{ Int.(n: Int, s: String) ->
|
||||
{ n: Int, s: String ->
|
||||
val a = n + this
|
||||
println(s)
|
||||
f(a)
|
||||
}
|
||||
|
||||
{ Int.(m: Int, r: String) ->
|
||||
val b = m + this
|
||||
println(r)
|
||||
f(b)
|
||||
}
|
||||
|
||||
{ (a, b) ->
|
||||
{ a, b ->
|
||||
val m = a + this
|
||||
println(b)
|
||||
f(m)
|
||||
|
||||
Reference in New Issue
Block a user