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

make NamedTuple.Empty an alias to NamedTuple #20502

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

bishabosha
Copy link
Member

It was suggested for a follow-up perhaps we should also rename Empty -> EmptyNamedTuple (most code will be doing import NamedTuple.*)

fixes #20428

Copy link
Contributor

@EugeneFlesselle EugeneFlesselle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new definition looks good to me, avoids the incompleteness from transitivity and seems more natural.

I'm also in favour of renaming to EmptyNamedTuple to be more inline with the standard tuples.

@odersky
Copy link
Contributor

odersky commented Jun 2, 2024

I am not sure about the EmptyNamedTuple change. I think if we do it, it's best to make EmptyNamedTuple a toplevel val, similar to NamedTuple.

I don't think most people would import NamedTuple.* since its members have very generic names, and they would clash with Tuple members.

@odersky odersky merged commit c1b25d6 into scala:main Jun 18, 2024
19 checks passed
@odersky odersky deleted the named-tuples-empty branch June 18, 2024 09:41
@Kordyjan Kordyjan added this to the 3.5.1 milestone Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NamedTuple.Empty is not a NamedTuple
4 participants