mirror of
https://github.com/azur1s/bobbylisp.git
synced 2024-10-16 02:37:40 -05:00
25 lines
293 B
Plaintext
25 lines
293 B
Plaintext
mut ret_ty: Option<Ty>
|
|
|
|
if type_check(expr) = Return {
|
|
if ret_ty.is_some() && ret_ty != this_ty {
|
|
error
|
|
} else {
|
|
ret_ty = this_ty
|
|
}
|
|
}
|
|
|
|
=====
|
|
|
|
{
|
|
if true {
|
|
return 1;
|
|
}
|
|
|
|
if false {
|
|
return "Hello";
|
|
}
|
|
|
|
do_something();
|
|
|
|
return 4;
|
|
} |