Skip to content

Request: add inspection for replacing nullable/non-nullable parameter of functions, when it seems it's used as such #43

@AndroidDeveloperLB

Description

@AndroidDeveloperLB

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions