Adjust testData to new labels syntax

This commit is contained in:
Denis Zharkov
2015-04-27 14:39:46 +03:00
parent 5977302465
commit 44a55e5bf6
191 changed files with 747 additions and 747 deletions
@@ -5,8 +5,8 @@ public inline fun <reified T> Array(n: Int, block: (Int) -> T): Array<T> = null!
fun test() {
val ints = Array<Int?>(2, { null })
ints.forEach @lit {
if (it == null) return @lit
ints.forEach lit@ {
if (it == null) return@lit
use(<!DEBUG_INFO_SMARTCAST!>it<!> + 5)
}
}
@@ -1,5 +1,5 @@
fun nonlocals(b : Boolean) {
@a<!UNUSED_FUNCTION_LITERAL!>{
a@<!UNUSED_FUNCTION_LITERAL!>{
fun foo() {
if (b) {
<!RETURN_NOT_ALLOWED!>return@a 1<!> // The label must be resolved, but an error should be reported for a non-local return
@@ -2,7 +2,7 @@
//KT-3920 Labeling information is lost when passing through some expressions
fun test() {
run @f{
run f@{
val x = if (1 > 2) return@f 1 else 2
2
}
@@ -7,7 +7,7 @@ fun string(init: StringBuilder.() -> Unit): String{
return answer.toString()
}
val str = string @l{
val str = string l@{
append("hello, ")
val sub = string {
@@ -2,7 +2,7 @@
//KT-4603 Labeling information is lost when passing through local classes or objects
fun foo() {
val s: Int.() -> Unit = @l{
val s: Int.() -> Unit = l@{
class Local(val y: Int = this@l) {
fun bar() {
val x: Int = this@l //unresolved
@@ -1,10 +1,10 @@
//KT-591 Unresolved label in valid code
fun test() {
val <!UNUSED_VARIABLE!>a<!>: (Int?).() -> Unit = @a{
val <!UNUSED_VARIABLE!>a<!>: (Int?).() -> Unit = a@{
if (this != null) {
val <!UNUSED_VARIABLE!>b<!>: String.() -> Unit = {
<!DEBUG_INFO_SMARTCAST!>this@a<!>.times(5) // @a Unresolved
<!DEBUG_INFO_SMARTCAST!>this@a<!>.times(5) // a@ Unresolved
}
}
}
@@ -15,7 +15,7 @@ fun B.b() {
}
fun test() {
@b <!UNUSED_FUNCTION_LITERAL!>{ <!DEPRECATED_LAMBDA_SYNTAX!>B.()<!> ->
b@ <!UNUSED_FUNCTION_LITERAL!>{ <!DEPRECATED_LAMBDA_SYNTAX!>B.()<!> ->
object : A {
override fun foo() {
this@b.bar()