Files
kotlin-fork/compiler/testData/diagnostics/tests/labels/labelsMustBeNamed.kt
T
2014-05-20 15:07:03 +04:00

36 lines
604 B
Kotlin

fun foo(a: Any?): Int {
<!SYNTAX!>@<!>{ () : Unit ->
return<!SYNTAX!>@<!>
}
<!SYNTAX!>@<!> while(a == null) {
if (true) {
break<!SYNTAX!>@<!>
}
else {
continue<!SYNTAX!>@<!>
}
}
var <!ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE!>b<!> = 1
(<!SYNTAX!>@<!> b) = <!UNUSED_VALUE!>2<!>
return<!SYNTAX!>@<!> 1
}
open class A {
fun foo() {}
}
class B : A() {
fun bar() {
this<!SYNTAX!>@<!>.foo()
super<!SYNTAX!>@<!>.foo()
}
}
fun bar(f: () -> Unit) = f
fun test() {
bar <!SYNTAX!>@<!>{}
}