Fixed
Status Update
Comments
ac...@google.com <ac...@google.com>
tn...@google.com <tn...@google.com>
ga...@linecorp.com <ga...@linecorp.com> #3
Thanks for quick response.
But I found my report have misunderstanding content.
app/src/main/java/com/example/myapplication/MainActivity.kt:15: Warning: Resource IDs will be non-final by default in Android Gradle Plugin version 8.0, avoid using them in switch case statements [NonConstantResourceId]
val resId = R.id.text
~~~
This is not actual report, but expected
report.
And actual code have const
modifier at this field and I missed it in expected result.
And if android.nonFinalResIds
is turned on, this line will get error by kotlin compiler.
Because const val
field can be assigned by contant value only on kotlin compiler.
So, IMHO, const val
field for kotlin
And should check expected lint report about const val
field assignment from resource Id.
Description
DESCRIBE THE ISSUE IN DETAIL:
android.nonFinalResIds
property will beAnd lint checker provides
NonConstantResourceId
rule to prepare behavior changes.But
NonConstantResourceId
rule does not warning about constant value assign from resource ids.STEPS TO REPRODUCE:
Expected Result :
When
android.nonFinalResIds
is enabled, kotlin compiler raised error.So, lint check result should be
Actual result :
NonConstantResourceId
rule does not show warning about constants value assign from resource Ids.ATTACH SCREENSHOTS/RECORDINGS OF THE ISSUE
ATTACH LOG FILES (Select Help > Show Log in Files, or Show Log in Finder on a Mac)
IMPORTANT: Please readhttps://developer.android.com/studio/report-bugs.html carefully and supply
all required information.
Studio Build: 2021.3.1 Version of Gradle Plugin: 7.3.1
Version of Gradle: 7.5
Version of Java: OpenJDK 11/17
OS: Any