[fine] Some fixes around return statements

This commit is contained in:
John Doty 2024-01-15 09:04:28 -08:00
parent 44bc072b04
commit 55749af917
3 changed files with 59 additions and 4 deletions

View file

@ -0,0 +1,3 @@
return "skidoo!";
// @check-error: a return statement can only be used inside a function

View file

@ -0,0 +1,8 @@
fun test() -> f64 {
if false {
return "no way!";
}
23.0
}
// @check-error: callers of this function expect a value of type `f64` but this statement returns a value of type `string`