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
Add rule to use runCatching instead of kotlin.runCatching #4448
Comments
🤔 This should be work for |
As I was expecting But the problem is bigger than that. Right now
|
🤔 the only way that I can think of handle extension functions with the current "function signature" is to treat the receiver type as the "first paramenter" of the function. This will not create any problem because the compiler doesn't allow you to define this two functions fun String.hello()
fun hello(world: String) because they have the same JVM signature. It is the only way I can think without adding a breaking change or deprecate the current function signature and create a new one. In terms of UX it would be really hacky because it's difficult to think about: |
@BraisGabin That's great! I tried adding a separate ForbiddenMethodCall for an extension function yesterday and couldn't figure out why it wasn't working! |
* Match functions with generics * Add test to ensure that #4448 is fixed
* Match functions with generics * Add test to ensure that #4448 is fixed
Expected Behavior
Per KTIJ-11561, Android Studio/IntelliJ will autocomplete
runCatching
tokotlin.runCatching
which is inconsistent with other Kotlin APIs such asrun
which don't do that.It would be great to have a rule that would enforce that it is used consistently as just
runCatching
across the codebase.The text was updated successfully, but these errors were encountered: