Giter Site home page Giter Site logo

Comments (6)

KAAtheWiseGit avatar KAAtheWiseGit commented on May 20, 2024 2

nu test-bug.nu outputs raw input as per describe.

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 TypeMismatch error and send a PR.

from nushell.

antarktidi4 avatar antarktidi4 commented on May 20, 2024

upd: I updated nushell to the lattest 0.89.0 version and it still happening

from nushell.

fdncred avatar fdncred commented on May 20, 2024

How would 'test string' be converted to a record, there is no key/value?

With your script, when you do nu test-bug.nu | into record that shouldn't work either because you're shelling out to a new instance of nu, running a script that returns a record but the the output is converted to a string and then you try to convert a string into a record which isn't supported.

from nushell.

antarktidi4 avatar antarktidi4 commented on May 20, 2024

How would 'test string' be converted to a record, there is no key/value?

I'm not saying it should work with strings, i'm saying the hint message is wrong, it shouldn't be a only string input data is supported because if I pass a string it throw command doesn't support string input.

from nushell.

fdncred avatar fdncred commented on May 20, 2024

oh, i see what you're saying. i wonder why it says that? maybe it means that nu test-bug.nu only outputs strings?

from nushell.

KAAtheWiseGit avatar KAAtheWiseGit commented on May 20, 2024

While I was making the PR I realized the problem was a different one. The command was never supposed to let raw input type in, it should've thrown an error earlier. Signature guards didn't work for some reason

from nushell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.