[fine] OK
This commit is contained in:
parent
50eb7a9673
commit
65fef78c44
10 changed files with 81 additions and 25 deletions
|
|
@ -929,6 +929,18 @@ impl<'a> Semantics<'a> {
|
|||
|
||||
Some(*ret.clone())
|
||||
}
|
||||
Type::MagicPrintGarbage => {
|
||||
if arg_types.len() > 1 {
|
||||
self.report_error_tree(tree, "print takes a single argument");
|
||||
Some(Type::Error)
|
||||
} else if arg_types.len() == 0 {
|
||||
Some(Type::Nothing)
|
||||
} else {
|
||||
let mut arg_types = arg_types;
|
||||
let (_, t) = arg_types.pop().unwrap();
|
||||
Some(t)
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
self.report_error_tree_ref(f_ref, format!("expected a function type, got: {f}"));
|
||||
Some(Type::Error)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue