-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Perhaps ['match'...] shouldn't require 4 arguments #7661
Comments
@stevage Can you describe your use case for wanting this behavior with the |
No use case here. If it's any harder to implement than changing a 4 to a 2, it's probably not worth it. |
There was an attempt at fixing this at #6964, which we punted on — see discussion on the reasons there. |
@asheemmamoowala I actually have a usecase where I needed this. I'm generating a "match" from other data, and in one case that other data resulted in no cases. It was very surprising that this caused an error, because there was still the "fallback" value. Caused a bug in production. The same probably applies to "case" and perhaps other things too. @mourner That issue was describing a different usecase, where the last value was a label not a fallback value. |
@mvirkkunen Ah yes, I have run into that situation as well. I think similar issues arise sometimes when you end up with an expression like |
This wasn't valid as a match expression:
That is, a
match
where there is only the default value (everything else was temporarily commented out). It seems legitimate by analogy with:The text was updated successfully, but these errors were encountered: