forked from extern/nushell
Make ++ operator work with strings and binary values (#8017)
This PR makes `++` (the append operator) work with strings and binary values. Can now do things like: ```bash 〉"a" ++ "b" ab 〉0x[01 02] ++ 0x[03] Length: 3 (0x3) bytes | printable whitespace ascii_other non_ascii 00000000: 01 02 03 ••• ``` Closes #8015.
This commit is contained in:
@ -84,6 +84,8 @@ pub fn math_result_type(
|
||||
}
|
||||
}
|
||||
(Type::Table(a), Type::Table(_)) => (Type::Table(a.clone()), None),
|
||||
(Type::String, Type::String) => (Type::String, None),
|
||||
(Type::Binary, Type::Binary) => (Type::Binary, None),
|
||||
(Type::Any, _) | (_, Type::Any) => (Type::Any, None),
|
||||
_ => {
|
||||
*op = Expression::garbage(op.span);
|
||||
|
Reference in New Issue
Block a user