Skip to content

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Aug 30, 2025

This simplifies debugging issues that arise from accidentally trying to register multiple message types with the same name.

@ahoppen
Copy link
Member Author

ahoppen commented Aug 30, 2025

@swift-ci Please test

@ahoppen ahoppen merged commit f59c406 into swiftlang:main Aug 30, 2025
36 checks passed
}
#endif
for type in IPCMessage.messageTypes {
result[type.name] = type
Copy link
Collaborator

Choose a reason for hiding this comment

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

@ahoppen nit: I would have suggested just doing it here, unconditionally (not behind DEBUG), rather than having a second loop:

if let oldValue = result.updateValue(type, forKey: type.name) {
    fatalError("Multiple message types registered for same name: \(type.name)")
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Here we go: #764

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.

3 participants