-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Omitting a space in custom command declaration causes misleading error #8934
Copy link
Copy link
Closed
Labels
A:error-unhelpfulThe error message you observe is not helpful to identify the problemThe error message you observe is not helpful to identify the problemA:parserIssues related to parsingIssues related to parsing
Milestone
Description
Describe the bug
Omitting a space between the function identifier and [ causes a Missing required positional argument error
# test.nu
def test_1[] {
echo "generates error"
}
def test_2 [] {
echo "runs fine"
}How to reproduce
type def test[] { echo "" } into the REPL
Expected behavior
Either the error should make sense given the context, or the tokenizer should accept this syntax
Screenshots
Configuration
| key | value |
|---|---|
| version | 0.78.0 |
| branch | makepkg |
| commit_hash | 2ec2028 |
| build_os | linux-x86_64 |
| build_target | x86_64-unknown-linux-gnu |
| rust_version | rustc 1.68.2 (9eb3afe9e 2023-03-27) (Arch Linux rust 1:1.68.2-1) |
| cargo_version | cargo 1.68.2 |
| build_time | 2023-04-05 02:09:35 +00:00 |
| build_rust_channel | release |
| features | default, zip |
| installed_plugins |
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A:error-unhelpfulThe error message you observe is not helpful to identify the problemThe error message you observe is not helpful to identify the problemA:parserIssues related to parsingIssues related to parsing
