-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong hint message in into record
call
#11632
Comments
upd: I updated nushell to the lattest 0.89.0 version and it still happening |
How would 'test string' be converted to a record, there is no key/value? With your script, when you do |
I'm not saying it should work with strings, i'm saying the hint message is wrong, it shouldn't be a |
oh, i see what you're saying. i wonder why it says that? maybe it means that |
Looking at the code, it simply uses string message for all unsupported types: Value::Record { val, .. } => Value::record(val, span),
Value::Error { .. } => input,
other => Value::error(
ShellError::OnlySupportsThisInputType {
exp_input_type: "string".into(),
wrong_type: other.get_type().to_string(),
dst_span: call.head,
src_span: other.span(),
},
call.head,
), The error must've been refactored at some point. I'll replace it with a |
While I was making the PR I realized the problem was a different one. The command was never supposed to let |
Describe the bug
When the script returns a record it converts the return type to a string (idk if this is expected behavior) so if I pipe it in
into record
(I know it shouldn't work) it will throw an error messageinput type: string
with hintonly string input data is supported
, but if I pipe string ininto record
it will give different errorcommand doesn't support string input
.How to reproduce
into record
test-bug.nu | into record
Expected behavior
I think it should print
command doesn't support string input
.Screenshots
Configuration
Additional context
I also have a question about returning a record from a function in a script, why is it a string?
The text was updated successfully, but these errors were encountered: