[fine] Some fixes around return statements
This commit is contained in:
parent
44bc072b04
commit
55749af917
3 changed files with 59 additions and 4 deletions
3
fine/tests/errors/return_statement_only_function.fine
Normal file
3
fine/tests/errors/return_statement_only_function.fine
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
return "skidoo!";
|
||||
|
||||
// @check-error: a return statement can only be used inside a function
|
||||
|
|
@ -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`
|
||||
Loading…
Add table
Add a link
Reference in a new issue