Resolve parenthesized element as expression

This commit is contained in:
Stanislav Erokhin
2015-02-03 21:51:21 +03:00
parent 3b92cab9e0
commit a33450395c
12 changed files with 26 additions and 43 deletions
@@ -1,16 +0,0 @@
data class A(val a: Int, val b: Int)
fun box() : String
{
(@a val x = 1)
(@b fun a() = 2)
(@c val (z, z2) = A(1, 2))
if (x != 1) return "fail 1"
if (a() != 2) return "fail 2"
if (z != 1 || z2 != 2) return "fail 3"
return "OK"
}
@@ -15,7 +15,7 @@ open class AllEvenNum() {
}
}
(i = i + 1)
i = i + 1
}
}
@@ -1,23 +1,23 @@
class C {
fun f (<!UNUSED_PARAMETER!>a<!> : Boolean, <!UNUSED_PARAMETER!>b<!> : Boolean) {
@b (while (true)
@b while (true)
@a {
<!NOT_A_LOOP_LABEL!>break@f<!>
break
<!UNREACHABLE_CODE!>break@b<!>
<!NOT_A_LOOP_LABEL!>break@a<!>
})
}
<!BREAK_OR_CONTINUE_OUTSIDE_A_LOOP!>continue<!>
@b (while (true)
@b while (true)
@a {
<!NOT_A_LOOP_LABEL!>continue@f<!>
continue
<!UNREACHABLE_CODE!>continue@b<!>
<!NOT_A_LOOP_LABEL!>continue@a<!>
})
}
<!BREAK_OR_CONTINUE_OUTSIDE_A_LOOP!>break<!>
@@ -0,0 +1,3 @@
fun test() {
(@d <!DECLARATION_IN_ILLEGAL_CONTEXT!>val bar = 2<!>)
}
@@ -0,0 +1,3 @@
package
internal fun test(): kotlin.Unit