Files
kotlin-fork/idea/testData/psi/When.jet
T
2011-03-16 15:22:49 +03:00

76 lines
1.2 KiB
Plaintext

fun foo() {
return false
fun a() = {when(x) { is a => b }}
// foo
fun b() {}
}
fun foo() {
when (e) {
}
when (e) {
is a => foo
}
when (e) {
is Tree @ (a, b) => foo
is Tree @ (a, b) if (a > 5) => foo
is null => foo
is 1 => foo
is A.b => foo
is 1.0 => foo
is 'c' => foo
is "sadfsa" => foo
is """ddd""" => foo
is * => foo
is val a is Foo => foo
is (val a is Foo, b) => foo
}
when (when(when (e) {
}) {
}) {
}
}
fun foo() {
when (val a = e) {
is Tree => c
is Tree @ (null, val r) => c
is a @ (a, b) => c
is a @ (a, b) => c
is a.a @ (a, b) => c
is a.a @ (foo = a, bar = b) => c
is namespace.a.a @ (a, b) => c
is a @ (val a is T, b) => c
is a @ (b, 1) => c
in 1..2 => dsf
!in 2 => sd
!is t => d
is {(foo) : Bar} => fgpp
is (1, val a is Foo, *, Foo, bar) => d
is (Foo, val a in 1..2, *, val _ !is Foo, val bar is foo.bar<a> @ (a)) => d
is (Int, Int) => 2
is val a : Foo => 2
else => foo
else continue
}
}
fun foo() {
when (val a = e) {
is Tree,
is Tree @ (null, val r),
is a @ (a, b) => c
1, foo(), bar, 2 + 3,
is a @ (a, b) => c
is a.a @ (val b, b) if (b == a + 3) => c
}
}