Skip to content

Conversation

@jpobst
Copy link
Contributor

@jpobst jpobst commented Mar 4, 2020

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:

My.Namespace.IMyInterfaceMyClass

Now we correctly leave the name nested:

My.Namespace.IMyInterface.MyClass

@jpobst jpobst force-pushed the interface-nested-class branch from 6abb5af to 15040b6 Compare March 4, 2020 20:22
@jpobst jpobst requested a review from jonpryor March 4, 2020 20:49
@jonpryor jonpryor merged commit 7582716 into master Mar 5, 2020
@jonpryor jonpryor deleted the interface-nested-class branch March 5, 2020 16:29
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 {
	    }
	}
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants