-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
(;) returns nothing rather than empty named tuple #30115
Comments
We should definitely fix this since the empty named tuple is something that it's useful to have syntax for whereas having |
Used to be a syntax error, then from what I can tell this "feature" was "added" in v0.5 :) Probably best to make it an error again in 1.1? |
Is the plan to make it an error and later use if for an empty named tuple? Or leave it as an error? |
I'm not sure; I guess it's (slightly) breaking either way, so maybe it's equally good/bad to just switch it directly to an empty named tuple? |
👍 yes, I think that's the way to go. |
Triage is ok with that. |
There is some package code (very little) that uses |
Triage has decided to make |
We never did end up doing anything about this, did we? |
It doesn't seem too important. I can make a branch that turns it into an error though. MacroTools changed its use of it already, so it might be ok. |
Here's something I don't think came up: how to parse |
As 3- and 4-dimensional tuples, obviously. |
Intuitively I would have imagined that
(;)
would be the syntax for the emptyNamedTuple
, whereas it returnsnothing
instead. After posting it on slack it seems that the rationale is that it is parsing as a concatenation of expressions. For example(1;)
returns1
, so(;)
should return the value of the first expression which isnothing
.I'm not sure which is more intuitive but maybe it could be changed to return
NamedTuple()
. The change in technically breaking though I imagine in practice very little code will rely on(;) === nothing
The text was updated successfully, but these errors were encountered: