permissions-dispatcher / PermissionsDispatcher

A declarative API to handle Android runtime permissions.
https://github.com/permissions-dispatcher/PermissionsDispatcher
Apache License 2.0
11.21k stars 1.44k forks source link

Shows lint "NeedOnRequestPermissionsResult" when not using braces to call generated method #680

Closed ashishmahla closed 3 years ago

ashishmahla commented 3 years ago

The following implementation shows lint error. Changing function implementation to use braces doesn't throw that lint.

override fun onRequestPermissionsResult(
        requestCode: Int,
        permissions: Array<out String>,
        grantResults: IntArray
    ) = onRequestPermissionsResult(requestCode, grantResults)

This is a valid call and should not throw the lint error.

hotchemi commented 3 years ago

thank you for the report. let us check.

mannodermaus commented 3 years ago

I wonder if the Lint rule trips over the explicit return type of Unit when the method is written like an assignment. 🤔