Skip to content
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

Signature::vectorizes_over_list not useful at runtime only relevant to test. #9734

Closed
sholderbach opened this issue Jul 19, 2023 · 1 comment · Fixed by #9742
Closed

Signature::vectorizes_over_list not useful at runtime only relevant to test. #9734

sholderbach opened this issue Jul 19, 2023 · 1 comment · Fixed by #9742
Labels
type-system Problems or features related to nushell's type system
Milestone

Comments

@sholderbach
Copy link
Member

When defining the input and output types #6796 already added the capability to declare that a command operates on a single scalar of a type AND a whole list/vector of this type. This can be indicated by the Signature::vectorizes_over_list method and field. But this only affects the rough testing done for the Examples. Here this field is checked to see if the Examples are member of the set of declared input_output_types.

The runtime type checker that is much more effective since #9680 does not take this into account at all. Thus several commands that support both scalar as well as list/stream values currently need to be updated in their type signature (see for example #9683)

Either we support the vectorizes_over_list field in the type check as well or we remove it and update all necessary signatures manually.

@sholderbach sholderbach added the type-system Problems or features related to nushell's type system label Jul 19, 2023
@fdncred
Copy link
Collaborator

fdncred commented Jul 19, 2023

I think I'd vote to remove it as I'd rather have the supported types listed in input_output_types(), otherwise some types will be hidden and less obvious.

@sholderbach sholderbach linked a pull request Jul 19, 2023 that will close this issue
@hustcer hustcer added this to the v0.83.0 milestone Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-system Problems or features related to nushell's type system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants