[fine] fix some bugs, semantics for is

This commit is contained in:
John Doty 2024-02-03 07:59:49 -08:00
parent ba5b37f5ff
commit b5b56b49a9
4 changed files with 59 additions and 7 deletions

View file

@ -0,0 +1,18 @@
class Foo {
a: f64;
}
fun test() -> f64 {
let b = new Foo { a : 23 };
let result = 0;
if b is c:Foo and c.a == 23 {
result = result + 1;
}
if b is c:Foo and c.a == 24 {
result = result + 1;
}
result
}
// @no-errors

View file

@ -0,0 +1,6 @@
fun explicit_return() -> f64 {
return 10.0;
// No error: after this point code is unreachable.
}
// @no-errors