Working on bindings in ifs

This commit is contained in:
Andrey Breslav
2011-06-13 14:33:32 +04:00
parent c2aceefe76
commit 3cacb512a3
6 changed files with 128 additions and 48 deletions
+10
View File
@@ -75,4 +75,14 @@ fun f12(a : A?) {
is val c is C => <info descr="Automatically cast to C">a</info>.bar()
else => a?.foo()
}
if (a is val b) {
a?.<error>bar</error>()
b?.foo()
}
if (a is val b is B) {
b.foo()
<info descr="Automatically cast to B">a</info>.bar()
<info descr="Automatically cast to B">b</info>.bar()
}
}