vscode-nushell-lang icon indicating copy to clipboard operation
vscode-nushell-lang copied to clipboard

Chained assignment should be an error/warning

Open Kajiih opened this issue 6 months ago • 2 comments

At the moment, we can write

$env.foo = $env.bar = "baz"

and even

let $foo = let $bar = "baz"

without any warning, but the resulting values are

$env.foo == null
$env.bar == "baz"

which is most likely not what was expected.

I think this should be reported as a warning (or even an error if there are no actual use cases for this syntax).

Kajiih avatar Jun 03 '25 12:06 Kajiih

Agreed, but that is probably a nushell problem vs a extension problem. All the diagnostics are generated from nushell.

fdncred avatar Jun 03 '25 14:06 fdncred

Related feature request: https://github.com/nushell/nushell/issues/15883

Kajiih avatar Jun 03 '25 16:06 Kajiih