record spread error on duplicate
This commit is contained in:
parent
f8297abf62
commit
455ab41303
|
@ -565,7 +565,13 @@ fn eval_instruction<D: DebugContext>(
|
|||
.into_record()
|
||||
.map_err(|_| ShellError::CannotSpreadAsRecord { span: items_span })?
|
||||
{
|
||||
record.insert(key, val);
|
||||
if let Some(first_value) = record.insert(&key, val) {
|
||||
return Err(ShellError::ColumnDefinedTwice {
|
||||
col_name: key,
|
||||
second_use: *span,
|
||||
first_use: first_value.span(),
|
||||
});
|
||||
}
|
||||
}
|
||||
ctx.put_reg(
|
||||
*src_dst,
|
||||
|
|
Loading…
Reference in New Issue
Block a user