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

Request: for Kotlin, offer remove un-needed ? and !! when you see ?)!! #19

Open
AndroidDeveloperLB opened this issue Feb 24, 2022 · 2 comments

Comments

@AndroidDeveloperLB
Copy link

Often when I convert from Java to Kotlin, I see something like this:

foo((value as Boolean?)!!)

Instead, it should be like this:

foo(value as Boolean)

If foo is defined only as foo(Boolean) , it could even be replaced in this case to just:

foo(value)

Can you please add this ? I don't know of similar cases, but maybe there are some...

@Miha-x64
Copy link
Owner

Yes! Any chain with ?s inside looks suspicious when ends with !!.

@AndroidDeveloperLB
Copy link
Author

You say you know of other, similar cases?

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