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

Convert _MessageBase to a typealias #1498

Merged
merged 2 commits into from
Nov 9, 2023

Conversation

mjburghard
Copy link
Contributor

Remove the _MessageBase protocol in favor of a type alias with different definitions for debug and release builds.
This should decrease the code size without requiring an underscored attribute (see #1497).

@allevato
Copy link
Collaborator

allevato commented Nov 9, 2023

This seems like an even better option than the maker protocol.

Since _MessageBase is really just "a list of common protocols that messages conform to", I wonder if it's worth renaming it to hammer that point home. Something like _CommonMessageConformances, so people don't get the idea that they should try to constrain generics based on it or add functionality to it (which fortunately they won't be able to if it's just a typealias).

@mjburghard
Copy link
Contributor Author

mjburghard commented Nov 9, 2023

I like the new name. I will rename the type alias.

Copy link
Collaborator

@tbkka tbkka left a comment

Choose a reason for hiding this comment

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

Nice!

@thomasvl thomasvl merged commit 3ef835e into apple:main Nov 9, 2023
9 checks passed
@thomasvl
Copy link
Collaborator

thomasvl commented Nov 9, 2023

Thanks for the patch!

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.

4 participants