Default the values of named params (#695)

This commit is contained in:
JT
2022-01-07 07:32:47 +11:00
committed by GitHub
parent eab6b322bb
commit 3478f35330
2 changed files with 44 additions and 8 deletions

View File

@ -111,14 +111,18 @@ fn eval_call(
}
}
if !found && named.arg.is_none() {
callee_stack.add_var(
var_id,
Value::Bool {
val: false,
span: call.head,
},
)
if !found {
if named.arg.is_none() {
callee_stack.add_var(
var_id,
Value::Bool {
val: false,
span: call.head,
},
)
} else {
callee_stack.add_var(var_id, Value::Nothing { span: call.head })
}
}
}
}