Fixed
Status Update
Comments
uc...@google.com <uc...@google.com>
tn...@google.com <tn...@google.com> #3
This is now fixed by Change-Id: I0ba284f52e62015af95aff8c5e83539b5a888e81 ; the fix will go out in 4.0 Canary 8. Thanks for the report!
Description
AI-191.8026.42.35.5977832, JRE 1.8.0_202-release-1483-b49-5587405x64 JetBrains s.r.o, OS Mac OS X(x86_64) v10.14.6, screens 1280x800, 1920x1080; Retina
AS: 3.5.2; Android Gradle Plugin: 3.5.2; Gradle: 5.6.3; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: pinned revision 3.1 not found, latest from SDK: (package not found); CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: (not found)
Description:
When only referencing a resource (e.g. R.string.foo) within a private Kotlin suspend function, the lint tool will incorrectly warn, that the resource appears to be unused ("UnusedResources").
Also the code folding feature will not work for string resources within private Kotlin suspend functions.
This may be related to this issue:
How to reproduce:
This code will not fold the string resource and it will be flagged as unused:
private suspend fun test(resources: android.content.res.Resources) = resources.getString(R.string.foo)
This code will correctly fold the string resource and it will not be flagged as unused:
private fun test(resources: android.content.res.Resources) = resources.getString(R.string.foo)