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

[TypeDeclaration] handle explicit if else new on ReturnTypeFromReturnNewRector #6104

Merged
merged 3 commits into from
Jul 2, 2024

Conversation

samsonasik
Copy link
Member

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review, for me, using SilentVoidResolver only is actually already enough, as that cover many edge cases already, but you decide ;)

@samsonasik
Copy link
Member Author

Another more consist way is to rename hasClassMethodRootReturn to something else, eg: hasOnlyReturnWithExpr, then we traverse, exclude inner class/function/closure to get Return_.

If there is Return_ without Expr in collection, then return false, as possible void

Then, lastly, verify Silent Void to handle no return like current PR change as last resort, wdyt?

@TomasVotruba
Copy link
Member

Neat solution, I like it 👍

Another more consist way is to rename hasClassMethodRootReturn to something else, eg: hasOnlyReturnWithExpr, then we traverse, exclude inner class/function/closure to get Return_.

Agreed, the name deserves an improvement :)

@samsonasik
Copy link
Member Author

implemented 👍

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I think it is ready.

@TomasVotruba TomasVotruba merged commit da745df into main Jul 2, 2024
33 checks passed
@TomasVotruba TomasVotruba deleted the exclusive-silent-void branch July 2, 2024 23:03
@TomasVotruba
Copy link
Member

Thank you 👍

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 this pull request may close these issues.

3 participants