diff --git a/crates/nu-protocol/src/value/mod.rs b/crates/nu-protocol/src/value/mod.rs index 18362b8068..15765da81f 100644 --- a/crates/nu-protocol/src/value/mod.rs +++ b/crates/nu-protocol/src/value/mod.rs @@ -267,6 +267,23 @@ impl Value { return Err(ShellError::AccessBeyondEnd(val.len(), *origin_span)); } } + Value::Binary { val, .. } => { + if let Some(item) = val.get(*count) { + current = Value::Int { + val: *item as i64, + span: *origin_span, + }; + } else { + return Err(ShellError::AccessBeyondEnd(val.len(), *origin_span)); + } + } + Value::Range { val, .. } => { + if let Some(item) = val.clone().into_range_iter()?.nth(*count) { + current = item.clone(); + } else { + return Err(ShellError::AccessBeyondEndOfStream(*origin_span)); + } + } x => { return Err(ShellError::IncompatiblePathAccess( format!("{}", x.get_type()),