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: add inspection for replacing nullable/non-nullable parameter of functions, when it seems it's used as such #43

Open
AndroidDeveloperLB opened this issue Jan 1, 2023 · 0 comments

Comments

@AndroidDeveloperLB
Copy link

AndroidDeveloperLB commented Jan 1, 2023

For example:

fun foo(someInt:Int?){
  val temp=someInt!!.toString()
  ...
}

This means that the parameter is actually supposed to be non-null, because it would cause a crash otherwise.
This also helps the IDE to detect bad usages from outside the function.

As for the opposite, not sure if it's needed (non-null parameter, which is treated as if it's nullable), but maybe for Java it's useful.

If this is too hard, I've also requested on IntelliJ:
https://youtrack.jetbrains.com/issue/IDEA-309644/Request-add-inspection-for-replacing-nullable-non-nullable-parameter-of-functions-when-it-seems-its-used-as-such

@AndroidDeveloperLB AndroidDeveloperLB changed the title Request: add check for replacing nullable/non-nullable parameter of functions, when it seems it's used as such Request: add inpsection for replacing nullable/non-nullable parameter of functions, when it seems it's used as such Jan 1, 2023
@AndroidDeveloperLB AndroidDeveloperLB changed the title Request: add inpsection for replacing nullable/non-nullable parameter of functions, when it seems it's used as such Request: add inspection for replacing nullable/non-nullable parameter of functions, when it seems it's used as such Jan 1, 2023
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

1 participant