-
Notifications
You must be signed in to change notification settings - Fork 187
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
Name collision refactor #492
Conversation
override fun toEnumVariantName(definition: EnumDefinition): MaybeRenamed? { | ||
val baseName = base.toEnumVariantName(definition) ?: return null | ||
if (baseName.renamedFrom != null) { | ||
throw CodegenException("hmm") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the intent here?
when (sortedMembers.any { it.collidesWithUnknown }) { | ||
true -> | ||
"`$enumName::$UnknownVariant` has been renamed to `::$EscapedUnknownVariant`. " + | ||
"`$enumName::$UnknownVariant` refers to additional values that may have been added since " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the Unknown
variant have documentation on it indicating what it is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah added (see description)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Issue #, if available: Fixes #488
Description of changes: A medium sized overhaul of our renaming machinery.
ReservedWordSymbolProvider
Unknown
was un-special cased and docs are now generated generically during renamesUnknownValue
Generated code from integration test:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.