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:
Denis Zharkov
2015-09-23 20:07:06 +03:00
parent 5f69789636
commit 73799e2c3c
73 changed files with 325 additions and 340 deletions
+9 -3
View File
@@ -176,9 +176,15 @@ fun returnFunctionLiteralBlock(a: Any?): Function0<Int> {
if (a is Int) return { <!DEBUG_INFO_SMARTCAST!>a<!> }
else return { 1 }
}
fun returnFunctionLiteral(a: Any?): Function0<Int> =
if (a is Int) { <!DEPRECATED_LAMBDA_SYNTAX!>(): Int<!> -> <!DEBUG_INFO_SMARTCAST!>a<!> }
else { <!DEPRECATED_LAMBDA_SYNTAX!>()<!> -> 1 }
fun returnFunctionLiteral(a: Any?): Function0<Int> {
if (a is Int) return { -> <!DEBUG_INFO_SMARTCAST!>a<!> }
else return { -> 1 }
}
fun returnFunctionLiteralDoesntWork(a: Any?): Function0<Int> =
if (a is Int) <!TYPE_MISMATCH!>{ -> a }<!>
else { -> 1 }
fun mergeSmartCasts(a: Any?) {
if (a is String || a is Int) {
@@ -17,6 +17,7 @@ public fun illegalWhenBody(/*0*/ a: kotlin.Any): kotlin.Int
public fun mergeSmartCasts(/*0*/ a: kotlin.Any?): kotlin.Unit
public fun returnFunctionLiteral(/*0*/ a: kotlin.Any?): () -> kotlin.Int
public fun returnFunctionLiteralBlock(/*0*/ a: kotlin.Any?): () -> kotlin.Int
public fun returnFunctionLiteralDoesntWork(/*0*/ a: kotlin.Any?): () -> kotlin.Int
public fun toInt(/*0*/ i: kotlin.Int?): kotlin.Int
public fun vars(/*0*/ a: kotlin.Any?): kotlin.Unit