Generate parse error on label without name '@'

This commit is contained in:
Svetlana Isakova
2014-05-15 15:24:14 +04:00
parent f109cfc303
commit e0f37bbef0
15 changed files with 358 additions and 316 deletions
@@ -0,0 +1,36 @@
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!>@<!>{}
}