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

$L combined with ExecutableElement in ecj produces unexpected results #936

Closed
rzpt opened this issue Dec 1, 2022 · 2 comments
Closed

$L combined with ExecutableElement in ecj produces unexpected results #936

rzpt opened this issue Dec 1, 2022 · 2 comments

Comments

@rzpt
Copy link

rzpt commented Dec 1, 2022

In ecj, $L combined with an ExecutableElement representing Supplier#get will insert public abstract T get() instead of get(). I am not sure what the intended behavior is, but it seems to work fine with javac.

I have written a workaround in derive4j for this specific case, but I am wondering if this is javapoet bug.
derive4j/derive4j#105

@JakeWharton
Copy link
Member

If you're not using an explicitly supported type, I believe literal output falls back to toString. That would explain the difference in compilers.

@rzpt
Copy link
Author

rzpt commented Dec 1, 2022

Aha, thank you for the pointer. From the readme: Arguments for literals may be strings, primitives, and a few JavaPoet types described below. Indeed, it does seem that ecj's toString on the ExecutableElement will produce the entire method signature. Closing.

@rzpt rzpt closed this as completed Dec 1, 2022
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

No branches or pull requests

2 participants