[fine] Bindings in if remain in scope!
This commit is contained in:
parent
198dc5bdb3
commit
f00b9e22e7
2 changed files with 34 additions and 3 deletions
|
|
@ -3,17 +3,20 @@ class Foo {
|
|||
}
|
||||
|
||||
fun test() -> f64 {
|
||||
let b = new Foo { a : 23 };
|
||||
let b = new Foo { a : 1000 };
|
||||
|
||||
let result = 0;
|
||||
if b is c:Foo and c.a == 23 {
|
||||
if b is c:Foo and c.a == 1000 {
|
||||
result = result + 1;
|
||||
}
|
||||
if b is c:Foo and c.a == 24 {
|
||||
result = result + 10;
|
||||
}
|
||||
if b is c:Foo {
|
||||
result = result + c.a; // c should still be in scope!
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
// @no-errors
|
||||
// @eval: Float(1.0)
|
||||
// @eval: Float(1001.0)
|
||||
Loading…
Add table
Add a link
Reference in a new issue