[fine] Just some more tests
This commit is contained in:
parent
b43947b6f1
commit
09a85596d8
2 changed files with 17 additions and 0 deletions
|
|
@ -14,6 +14,20 @@ fun extract_value(v: Foo or Bar) -> f64 {
|
||||||
} // No error; exhaustivity analysis should work.
|
} // No error; exhaustivity analysis should work.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Some type compatibility nonsense
|
||||||
|
fun bottom() -> string or nothing {
|
||||||
|
"woooo"
|
||||||
|
}
|
||||||
|
|
||||||
|
fun same_but_wrong_way_around_should_be_compatible() -> nothing or string {
|
||||||
|
bottom()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun same_but_larger_should_be_compatible() -> nothing or f64 or string {
|
||||||
|
bottom()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// This is Bob Nystrom's example from
|
// This is Bob Nystrom's example from
|
||||||
// https://journal.stuffwithstuff.com/2023/08/04/representing-heterogeneous-data/
|
// https://journal.stuffwithstuff.com/2023/08/04/representing-heterogeneous-data/
|
||||||
//
|
//
|
||||||
|
|
|
||||||
3
fine/tests/expression/if_mismatched_arms.fine
Normal file
3
fine/tests/expression/if_mismatched_arms.fine
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
if true { "blarg" } else { 23 }
|
||||||
|
|
||||||
|
// @type: 0 f64 or string
|
||||||
Loading…
Add table
Add a link
Reference in a new issue