diff --git a/crates/nu-command/src/conversions/into/datetime.rs b/crates/nu-command/src/conversions/into/datetime.rs index 2b274c3ea5..0fc9725bcf 100644 --- a/crates/nu-command/src/conversions/into/datetime.rs +++ b/crates/nu-command/src/conversions/into/datetime.rs @@ -65,6 +65,11 @@ impl Command for SubCommand { (Type::List(Box::new(Type::String)), Type::List(Box::new(Type::Date))), (Type::table(), Type::table()), (Type::record(), Type::record()), + (Type::Nothing, Type::table()), + // FIXME Type::Any input added to disable pipeline input type checking, as run-time checks can raise undesirable type errors + // which aren't caught by the parser. see https://github.com/nushell/nushell/pull/14922 for more details + // only applicable for --list flag + (Type::Any, Type::table()), ]) .allow_variants_without_examples(true) .named( diff --git a/crates/nu-command/src/env/load_env.rs b/crates/nu-command/src/env/load_env.rs index f35b1d08ea..b508aa6f3b 100644 --- a/crates/nu-command/src/env/load_env.rs +++ b/crates/nu-command/src/env/load_env.rs @@ -17,6 +17,9 @@ impl Command for LoadEnv { .input_output_types(vec![ (Type::record(), Type::Nothing), (Type::Nothing, Type::Nothing), + // FIXME Type::Any input added to disable pipeline input type checking, as run-time checks can raise undesirable type errors + // which aren't caught by the parser. see https://github.com/nushell/nushell/pull/14922 for more details + (Type::Any, Type::Nothing), ]) .allow_variants_without_examples(true) .optional( diff --git a/crates/nu-command/src/filesystem/cd.rs b/crates/nu-command/src/filesystem/cd.rs index 3ba438746d..c4f540010e 100644 --- a/crates/nu-command/src/filesystem/cd.rs +++ b/crates/nu-command/src/filesystem/cd.rs @@ -25,10 +25,6 @@ impl Command for Cd { .input_output_types(vec![(Type::Nothing, Type::Nothing)]) .switch("physical", "use the physical directory structure; resolve symbolic links before processing instances of ..", Some('P')) .optional("path", SyntaxShape::Directory, "The path to change to.") - .input_output_types(vec![ - (Type::Nothing, Type::Nothing), - (Type::String, Type::Nothing), - ]) .allow_variants_without_examples(true) .category(Category::FileSystem) } diff --git a/crates/nu-command/src/filesystem/open.rs b/crates/nu-command/src/filesystem/open.rs index a372d7e79e..a2a63f180b 100644 --- a/crates/nu-command/src/filesystem/open.rs +++ b/crates/nu-command/src/filesystem/open.rs @@ -35,7 +35,13 @@ impl Command for Open { fn signature(&self) -> nu_protocol::Signature { Signature::build("open") - .input_output_types(vec![(Type::Nothing, Type::Any), (Type::String, Type::Any)]) + .input_output_types(vec![ + (Type::Nothing, Type::Any), + (Type::String, Type::Any), + // FIXME Type::Any input added to disable pipeline input type checking, as run-time checks can raise undesirable type errors + // which aren't caught by the parser. see https://github.com/nushell/nushell/pull/14922 for more details + (Type::Any, Type::Any), + ]) .rest( "files", SyntaxShape::OneOf(vec![SyntaxShape::GlobPattern, SyntaxShape::String]), diff --git a/crates/nu-command/src/stor/insert.rs b/crates/nu-command/src/stor/insert.rs index 4a2ebf4928..1d0f5ae6c0 100644 --- a/crates/nu-command/src/stor/insert.rs +++ b/crates/nu-command/src/stor/insert.rs @@ -17,6 +17,9 @@ impl Command for StorInsert { (Type::Nothing, Type::table()), (Type::record(), Type::table()), (Type::table(), Type::table()), + // FIXME Type::Any input added to disable pipeline input type checking, as run-time checks can raise undesirable type errors + // which aren't caught by the parser. see https://github.com/nushell/nushell/pull/14922 for more details + (Type::Any, Type::table()), ]) .required_named( "table-name", diff --git a/crates/nu-command/src/stor/update.rs b/crates/nu-command/src/stor/update.rs index 8a77f41d51..98652bae2a 100644 --- a/crates/nu-command/src/stor/update.rs +++ b/crates/nu-command/src/stor/update.rs @@ -16,6 +16,9 @@ impl Command for StorUpdate { .input_output_types(vec![ (Type::Nothing, Type::table()), (Type::record(), Type::table()), + // FIXME Type::Any input added to disable pipeline input type checking, as run-time checks can raise undesirable type errors + // which aren't caught by the parser. see https://github.com/nushell/nushell/pull/14922 for more details + (Type::Any, Type::table()), ]) .required_named( "table-name", diff --git a/crates/nu-command/src/strings/format/date.rs b/crates/nu-command/src/strings/format/date.rs index 658823aa6a..fa7911361c 100644 --- a/crates/nu-command/src/strings/format/date.rs +++ b/crates/nu-command/src/strings/format/date.rs @@ -19,6 +19,10 @@ impl Command for FormatDate { (Type::Date, Type::String), (Type::String, Type::String), (Type::Nothing, Type::table()), + // FIXME Type::Any input added to disable pipeline input type checking, as run-time checks can raise undesirable type errors + // which aren't caught by the parser. see https://github.com/nushell/nushell/pull/14922 for more details + // only applicable for --list flag + (Type::Any, Type::table()), ]) .allow_variants_without_examples(true) // https://github.com/nushell/nushell/issues/7032 .switch("list", "lists strftime cheatsheet", Some('l')) diff --git a/crates/nu-command/src/system/nu_check.rs b/crates/nu-command/src/system/nu_check.rs index ca0d09965a..f3ecdd004d 100644 --- a/crates/nu-command/src/system/nu_check.rs +++ b/crates/nu-command/src/system/nu_check.rs @@ -20,6 +20,9 @@ impl Command for NuCheck { (Type::Nothing, Type::Bool), (Type::String, Type::Bool), (Type::List(Box::new(Type::Any)), Type::Bool), + // FIXME Type::Any input added to disable pipeline input type checking, as run-time checks can raise undesirable type errors + // which aren't caught by the parser. see https://github.com/nushell/nushell/pull/14922 for more details + (Type::Any, Type::Bool), ]) // type is string to avoid automatically canonicalizing the path .optional("path", SyntaxShape::String, "File path to parse.") diff --git a/crates/nu-engine/src/eval_ir.rs b/crates/nu-engine/src/eval_ir.rs index 4cc8cef782..ecdebbac51 100644 --- a/crates/nu-engine/src/eval_ir.rs +++ b/crates/nu-engine/src/eval_ir.rs @@ -1277,11 +1277,8 @@ fn check_input_types( } // If a command only has a nothing input type, then allow any input data - match io_types.first() { - Some((Type::Nothing, _)) if io_types.len() == 1 => { - return Ok(()); - } - _ => (), + if io_types.iter().all(|(intype, _)| intype == &Type::Nothing) { + return Ok(()); } match input { diff --git a/crates/nu_plugin_polars/src/dataframe/command/boolean/when.rs b/crates/nu_plugin_polars/src/dataframe/command/boolean/when.rs index 9c6976aa54..e6c70ec73d 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/boolean/when.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/boolean/when.rs @@ -41,6 +41,9 @@ impl PluginCommand for ExprWhen { Type::Custom("expression".into()), Type::Custom("expression".into()), ), + // FIXME Type::Any input added to disable pipeline input type checking, as run-time checks can raise undesirable type errors + // which aren't caught by the parser. see https://github.com/nushell/nushell/pull/14922 for more details + (Type::Any, Type::Custom("expression".into())), ]) .category(Category::Custom("expression".into())) }