-
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
add list<string> -> string
to last
#11137
Conversation
I think the test error in CI is the same problem but with the |
ugh, what is that? 😢 |
I think the problem is just that our input_output_types aren't defined properly, nor do they work properly on all commands. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've checked input/output type checking logic.
I think the checking logic is good. But we need to follow a rule:
If we have an input type that may generate multiple output type, last
as example, we need to annotated it to <input_type> -> any
, and we can't add other things about this input_type.
So you can have list<string> -> any
for a command.
But you can't have both list<string> -> list<string>
, list<string> -> int
for a command.
yeah that's unfortunate but makes sense 👍 [
list<string> -> anyof<list<string>, string>
list<int> -> anyof<list<int>, int>
...
] |
good catch @WindSoilder 👌 it's unfortunate but at least it works 😌 |
Thanks for tweaking the commit title @WindSoilder ! |
@amtoine Unfortunally, I don't think If we have the following commands' signature:
Then if we run |
this should - close nushell#11134 # Description this is band-aid... but it should address the issue in nushell#11134 until we have a better long-term fix for this i/o types bug 😇 # User-Facing Changes the following will now parse and run fine ```nushell def get-initial-commit []: nothing -> string { ^git rev-list HEAD | lines | last } ``` # Tests + Formatting # After Submitting
this should - close nushell#11134 # Description this is band-aid... but it should address the issue in nushell#11134 until we have a better long-term fix for this i/o types bug 😇 # User-Facing Changes the following will now parse and run fine ```nushell def get-initial-commit []: nothing -> string { ^git rev-list HEAD | lines | last } ``` # Tests + Formatting # After Submitting
related to - nushell/nushell#11134 - nushell/nushell#11137
this should
Description
this is band-aid...
but it should address the issue in #11134 until we have a better long-term fix for this i/o types bug 😇
User-Facing Changes
the following will now parse and run fine
Tests + Formatting
After Submitting