mirror of
https://github.com/nushell/nushell.git
synced 2024-11-23 00:43:33 +01:00
bf40f035f6
# Description Fixes: #10410 So the following script is possible: ```nushell def a [b: any = null] { let b = ($b | default "default_b"); } a "given_b" ``` ## About the change When parsing signature, and nushell meets something like `a: any`, it force the parser to treat `a` as `any` type. This is what `arg_explicit_type` means, it's only set when we goes into `ParseMode::TypeMode`, and it will be reset to `false` if the token goes to next argument. so, when we have something like this: `def a [b: any = null] { $b }`, the type of `$b` won't be overwritten. But if we have something like this: `def a [b = null] { $b }`, the type of `$b` is not annotated, so we make it to be `nothing`(which is the type of null) |
||
---|---|---|
.. | ||
deparse.rs | ||
flatten.rs | ||
known_external.rs | ||
lex.rs | ||
lib.rs | ||
lite_parser.rs | ||
parse_keywords.rs | ||
parse_patterns.rs | ||
parser_path.rs | ||
parser.rs | ||
type_check.rs |