allow export alias in repl (#15054)

# Description
Fixes: #15048
The issue is happened while `parse_export_in_block`, it makes a call to
`parse_internal_call`, which may be an error.
But in reality, these errors are not useful, all useful errors will be
generated by `parse_xxx` at the end of the function.

# User-Facing Changes
The following code should no longer raise error:
```
export alias a = overlay use
```

# Tests + Formatting
Added 1 test.

# After Submitting
NaN
This commit is contained in:
Wind
2025-02-10 15:32:05 +08:00
committed by GitHub
parent 6e88b3f8d6
commit d4675d9138
2 changed files with 10 additions and 3 deletions

View File

@ -163,3 +163,9 @@ fn alias_default_help() {
let first_help_line = actual.out.lines().next().unwrap();
assert!(first_help_line.starts_with("Alias for `echo 'I am a beautiful teapot'`"));
}
#[test]
fn export_alias_with_overlay_use_works() {
let actual = nu!("export alias teapot = overlay use");
assert!(actual.err.is_empty())
}