No propagation of names bound in patterns to else-branches

This commit is contained in:
Andrey Breslav
2011-06-15 14:38:19 +04:00
parent e3dda48d09
commit 41d2c73c06
2 changed files with 7 additions and 42 deletions
+4 -4
View File
@@ -104,7 +104,7 @@ fun f13(a : A?) {
}
else {
a.foo()
<info descr="Automatically cast to B">c</info>.bar()
<error>c</error>.bar()
}
a?.foo()
@@ -122,11 +122,11 @@ fun f13(a : A?) {
<error>c</error>
}
else {
<info descr="Automatically cast to C">x</info>.bar()
<info descr="Automatically cast to B">c</info>.bar()
<error>x</error>
<error>c</error>
}
if (!(a is val <error>c</error> is B) || !(a is val <error>c</error> is C)) {
if (!(a is val c is B) || !(a is val c is C)) {
}
if (!(a is val c is B)) return