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

Some addPermittedSubclass methods call invalid addSuperinterface inside. #68

Closed
skku-daniilkim opened this issue Sep 16, 2024 · 2 comments · Fixed by #69 · May be fixed by skku-daniilkim/javapoet#1
Closed

Some addPermittedSubclass methods call invalid addSuperinterface inside. #68

skku-daniilkim opened this issue Sep 16, 2024 · 2 comments · Fixed by #69 · May be fixed by skku-daniilkim/javapoet#1

Comments

@skku-daniilkim
Copy link
Contributor

skku-daniilkim commented Sep 16, 2024

What happened?

TypeSpec.addPermittedSubclass(Type permittedSubclass) and TypeSpec.addPermittedSubclass(TypeMirro permittedSubclass) incorrectly call TypeSpec.addSuperinterface(... superinterface, boolean avoidNestedTypeNameClashes) instead of TypeSpec.addPermittedSubclass(... superinterface, boolean avoidNestedTypeNameClashes):

public Builder addPermittedSubclass(Type permittedSubclass) {
return addSuperinterface(permittedSubclass, true);
}

public Builder addPermittedSubclass(TypeMirror permittedSubclass) {
return addSuperinterface(permittedSubclass, true);
}

What did you want to happen?

They should call the TypeSpec.addPermittedSubclass(... superinterface, boolean avoidNestedTypeNameClashes).

skku-daniilkim added a commit to skku-daniilkim/javapoet that referenced this issue Sep 16, 2024
@carterkozak
Copy link
Contributor

That looks like a bug! Would you like to PR a fix? (I think you’ve opened a pr, but into your own fork)

@skku-daniilkim
Copy link
Contributor Author

Oh yeah, my bad. Fixed the PR.

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 a pull request may close this issue.

2 participants