[generator] Fix names of classes nested in an interface.#592
Merged
Conversation
6abb5af to
15040b6
Compare
jonpryor
added a commit
that referenced
this pull request
Mar 6, 2020
Commit 28b1fc9 added support to bind Java interfaces nested within interfaces in a "parallel" fashion when `generator --lang-features=nested-interface-types` is used. Unfortunately this overlooked *classes* nested within interfaces: // Java public interface Parent { public class Child { } } The C# binding of `Parent.Child` would prefix `Child` with a leading `I`, as if it were an interface, resulting in: // C# binding public interface IParent { public class IChild { } } Properly differentiate nested types so that we don't prefix class names with `I`: // C# binding: Good! public interface IParent { public class Child { } }
pjcollins
pushed a commit
that referenced
this pull request
Mar 10, 2020
Commit 28b1fc9 added support to bind Java interfaces nested within interfaces in a "parallel" fashion when `generator --lang-features=nested-interface-types` is used. Unfortunately this overlooked *classes* nested within interfaces: // Java public interface Parent { public class Child { } } The C# binding of `Parent.Child` would prefix `Child` with a leading `I`, as if it were an interface, resulting in: // C# binding public interface IParent { public class IChild { } } Properly differentiate nested types so that we don't prefix class names with `I`: // C# binding: Good! public interface IParent { public class Child { } }
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In #589 we stopped mangling names of interfaces nested inside interfaces. However we need to expand this fix to support classes nested inside interfaces as well.
That is, previously we were doing this:
Now we correctly leave the name nested: