Fix parsing of signature inp/out types in predecls (#10642)

# Description
Fixes https://github.com/nushell/nushell/issues/10605 (again).

The loop looking for `[` to determine signature position didn't stop
early enough, so it thought the second `[` denoting the inp/out types
marks the beginning of the signature.

# User-Facing Changes

# Tests + Formatting
adds a new `predecl_signature_multiple_inp_out_types` test

# After Submitting
This commit is contained in:
Jakub Žádník
2023-10-08 13:58:26 +03:00
committed by GitHub
parent 67b5e1bde9
commit 4efccb2b1c
2 changed files with 27 additions and 4 deletions

View File

@ -202,6 +202,7 @@ pub fn parse_def_predecl(working_set: &mut StateWorkingSet, spans: &[Span]) {
.starts_with(&[b'('])
{
signature_pos = Some(pos);
break;
}
pos += 1;