-
Notifications
You must be signed in to change notification settings - Fork 207
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
[Wildcard Variables][spec] Can we reuse _
as a non-binding name in function types or record types?
#3791
Comments
_
as a non-binding name in function types or record types?_
as a non-binding name in function types or record types?
I'd say yes. These locations are "documentation names" that have no effect, other than being readable in the source. For new-style function types and records, you can also just omit the name, which means we could also disallow having a For old-style function types, ... you should switch to new-style, but using Generally, any place you can write a name that:
we allow Top-level, static or instance declarations also introduced the name into a named/referable scope, so a Maybe we should make |
I would expect those examples to be allowed. |
Closing. Updated the spec addressing these explicitly. |
Today, it is illegal to repeat
_
as a name in these spots:I don't believe function types are addressed in the current spec. Should the code above be legal under the wildcards feature?
As for records, it is already illegal to name a positional record field
_
, as "record field names can't be private."Would this code become legal under the wildcards feature? Such names would maybe not be considered "private" any longer?
@kallentu @munificent
The text was updated successfully, but these errors were encountered: