Fix front-end test data: replace @Suspend -> suspend.

This commit is contained in:
Stanislav Erokhin
2016-12-15 00:16:09 +03:00
parent 3ea24cbe08
commit 2671826ed1
19 changed files with 36 additions and 34 deletions
@@ -8,7 +8,7 @@ class A {
suspend fun suspendHere(a: Int) = 1
}
fun builder(c: @Suspend() (Controller.() -> Unit)) {}
fun builder(c: suspend Controller.() -> Unit) {}
fun test() {
builder {
@@ -1,6 +1,6 @@
package
public fun builder(/*0*/ c: @kotlin.coroutines.Suspend() (Controller.() -> kotlin.Unit)): kotlin.Unit
public fun builder(/*0*/ c: suspend Controller.() -> kotlin.Unit): kotlin.Unit
public fun test(): kotlin.Unit
public final class A {
@@ -1,26 +1,26 @@
// !CHECK_TYPE
// !DIAGNOSTICS: -UNUSED_PARAMETER -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_VARIABLE
fun builder(c: @Suspend() (() -> Int)) = 1
fun <T> genericBuilder(c: @Suspend() (() -> T)): T = null!!
fun unitBuilder(c: @Suspend() (() -> Unit)) = 1
fun emptyBuilder(c: @Suspend() (() -> Unit)) = 1
fun builder(c: suspend () -> Int) = 1
fun <T> genericBuilder(c: suspend () -> T): T = null!!
fun unitBuilder(c: suspend () -> Unit) = 1
fun emptyBuilder(c: suspend () -> Unit) = 1
fun <T> manyArgumentsBuilder(
c1: @Suspend() (() -> Unit),
c2: @Suspend() (() -> T),
c3: @Suspend() (() -> Int)
c1: suspend () -> Unit,
c2: suspend () -> T,
c3: suspend () -> Int
):T = null!!
fun severalParamsInLambda(c: @Suspend() ((String, Int) -> Unit)) {}
fun severalParamsInLambda(c: suspend (String, Int) -> Unit) {}
fun foo() {
builder({ 1 })
builder { 1 }
val x = { 1 }
builder(x)
builder({1} <!USELESS_CAST!>as (@Suspend() (() -> Int))<!>)
builder(<!TYPE_MISMATCH!>x<!>)
builder(<!UNCHECKED_CAST!>{1} as (suspend () -> Int)<!>)
var i: Int = 1
i = genericBuilder({ 1 })
@@ -30,7 +30,7 @@ fun foo() {
genericBuilder<Int> { <!TYPE_MISMATCH!>""<!> }
val y = { 1 }
genericBuilder(y)
<!TYPE_INFERENCE_PARAMETER_CONSTRAINT_ERROR!>genericBuilder<!>(<!TYPE_MISMATCH!>y<!>)
unitBuilder {}
unitBuilder { <!UNUSED_EXPRESSION!>1<!> }
@@ -1,9 +1,9 @@
package
public fun builder(/*0*/ c: @kotlin.coroutines.Suspend () -> kotlin.Int): kotlin.Int
public fun emptyBuilder(/*0*/ c: @kotlin.coroutines.Suspend () -> kotlin.Unit): kotlin.Int
public fun builder(/*0*/ c: suspend () -> kotlin.Int): kotlin.Int
public fun emptyBuilder(/*0*/ c: suspend () -> kotlin.Unit): kotlin.Int
public fun foo(): kotlin.Unit
public fun </*0*/ T> genericBuilder(/*0*/ c: @kotlin.coroutines.Suspend () -> T): T
public fun </*0*/ T> manyArgumentsBuilder(/*0*/ c1: @kotlin.coroutines.Suspend () -> kotlin.Unit, /*1*/ c2: @kotlin.coroutines.Suspend () -> T, /*2*/ c3: @kotlin.coroutines.Suspend () -> kotlin.Int): T
public fun severalParamsInLambda(/*0*/ c: @kotlin.coroutines.Suspend (kotlin.String, kotlin.Int) -> kotlin.Unit): kotlin.Unit
public fun unitBuilder(/*0*/ c: @kotlin.coroutines.Suspend () -> kotlin.Unit): kotlin.Int
public fun </*0*/ T> genericBuilder(/*0*/ c: suspend () -> T): T
public fun </*0*/ T> manyArgumentsBuilder(/*0*/ c1: suspend () -> kotlin.Unit, /*1*/ c2: suspend () -> T, /*2*/ c3: suspend () -> kotlin.Int): T
public fun severalParamsInLambda(/*0*/ c: suspend (kotlin.String, kotlin.Int) -> kotlin.Unit): kotlin.Unit
public fun unitBuilder(/*0*/ c: suspend () -> kotlin.Unit): kotlin.Int
@@ -3,7 +3,7 @@
suspend fun suspendHere() = 1
suspend fun <T> another(a: T) = 1
fun <T> builder(c: @Suspend() (() -> Unit)) { }
fun <T> builder(c: suspend () -> Unit) { }
inline fun run(x: () -> Unit) {}
@@ -1,7 +1,7 @@
package
public suspend fun </*0*/ T> another(/*0*/ a: T): kotlin.Int
public fun </*0*/ T> builder(/*0*/ c: @kotlin.coroutines.Suspend () -> kotlin.Unit): kotlin.Unit
public fun </*0*/ T> builder(/*0*/ c: suspend () -> kotlin.Unit): kotlin.Unit
public fun foo(): kotlin.Unit
public fun noinline(/*0*/ x: () -> kotlin.Unit): kotlin.Unit
public inline fun run(/*0*/ x: () -> kotlin.Unit): kotlin.Unit
@@ -15,7 +15,7 @@ suspend fun String.stringReceiver(y: Int) = 1.0
suspend fun Any.anyReceiver(y: Int) = 1.0
fun builder(c: @Suspend() (() -> Unit)) {}
fun builder(c: suspend () -> Unit) {}
fun test() {
builder {
@@ -2,7 +2,7 @@ package
public suspend fun </*0*/ V> await(/*0*/ f: () -> V): V
public suspend fun </*0*/ V> await(/*0*/ f: kotlin.Int): V
public fun builder(/*0*/ c: @kotlin.coroutines.Suspend () -> kotlin.Unit): kotlin.Unit
public fun builder(/*0*/ c: suspend () -> kotlin.Unit): kotlin.Unit
public suspend fun noParams(): kotlin.Unit
public suspend fun severalParams(/*0*/ x: kotlin.String, /*1*/ y: kotlin.Int): kotlin.Double
public fun test(): kotlin.Unit
@@ -11,6 +11,7 @@ fun test2(fn: () -> Unit) = useSuspendFn(<!TYPE_MISMATCH!>fn<!>)
fun test3(sfn: suspend () -> Unit) = useSuspendFn(sfn)
fun test4(): suspend () -> Unit = useSuspendFn {}
fun test5() = useSuspendFn {}
fun test5(sfn: suspend () -> Unit) = ambiguous(sfn)
fun test6(fn: () -> Unit) = ambiguous(fn)
@@ -6,6 +6,7 @@ public fun test1(/*0*/ sfn: suspend () -> kotlin.Unit): () -> kotlin.Unit
public fun test2(/*0*/ fn: () -> kotlin.Unit): suspend () -> kotlin.Unit
public fun test3(/*0*/ sfn: suspend () -> kotlin.Unit): suspend () -> kotlin.Unit
public fun test4(): suspend () -> kotlin.Unit
public fun test5(): suspend () -> kotlin.Unit
public fun test5(/*0*/ sfn: suspend () -> kotlin.Unit): suspend () -> kotlin.Unit
public fun test6(/*0*/ fn: () -> kotlin.Unit): () -> kotlin.Unit
public fun test7(): () -> kotlin.Unit
@@ -2,4 +2,4 @@
fun <T1, T2> withS2(x: T1, sfn1: suspend (T1) -> T2, sfn2: suspend (T2) -> Unit): T2 = null!!
val test1 = withS2(100, { "" }, { })
val test1 = withS2(100, { it.toLong().toString() }, { it.length })
@@ -13,7 +13,7 @@ class Controller {
suspend fun severalParams(x: String, y: Int) = 1.0
}
fun builder(c: @Suspend() (Controller.() -> Unit)) {}
fun builder(c: suspend Controller.() -> Unit) {}
fun test() {
builder {
@@ -1,6 +1,6 @@
package
public fun builder(/*0*/ c: @kotlin.coroutines.Suspend() (Controller.() -> kotlin.Unit)): kotlin.Unit
public fun builder(/*0*/ c: suspend Controller.() -> kotlin.Unit): kotlin.Unit
public fun test(): kotlin.Unit
public final class Controller {
@@ -2,9 +2,9 @@
// !CHECK_TYPE
class Controller {
suspend fun noParams(): Unit = suspendWithCurrentContinuation {
if (hashCode() <!DEPRECATED_BINARY_MOD_AS_REM!>%<!> 2 == 0) {
if (hashCode() % 2 == 0) {
it.resume(Unit)
Suspend
SUSPENDED
}
else {
Unit
@@ -21,7 +21,7 @@ class Controller {
}
}
fun builder(c: @Suspend() (Controller.() -> Unit)) {}
fun builder(c: suspend Controller.() -> Unit) {}
fun test() {
builder {
@@ -1,6 +1,6 @@
package
public fun builder(/*0*/ c: @kotlin.coroutines.Suspend() (Controller.() -> kotlin.Unit)): kotlin.Unit
public fun builder(/*0*/ c: suspend Controller.() -> kotlin.Unit): kotlin.Unit
public fun test(): kotlin.Unit
public final class Controller {
@@ -1,7 +1,7 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_VARIABLE
suspend fun <V> await(f: V): V = f
fun <T> genericBuilder(c: @Suspend() (() -> T)): T = null!!
fun <T> genericBuilder(c: suspend () -> T): T = null!!
fun foo() {
var result = ""
@@ -2,4 +2,4 @@ package
public suspend fun </*0*/ V> await(/*0*/ f: V): V
public fun foo(): kotlin.Unit
public fun </*0*/ T> genericBuilder(/*0*/ c: @kotlin.coroutines.Suspend () -> T): T
public fun </*0*/ T> genericBuilder(/*0*/ c: suspend () -> T): T
@@ -3,7 +3,7 @@
<!UNSUPPORTED_FEATURE!>suspend<!> fun suspendHere(): String = "OK"
fun builder(c: @Suspend() (() -> Unit)) {
fun builder(c: suspend () -> Unit) {
}
@@ -1,5 +1,5 @@
package
public fun box(): kotlin.String
public fun builder(/*0*/ c: @kotlin.coroutines.Suspend () -> kotlin.Unit): kotlin.Unit
public fun builder(/*0*/ c: suspend () -> kotlin.Unit): kotlin.Unit
public suspend fun suspendHere(): kotlin.String