Fixed
Status Update
Comments
vi...@google.com <vi...@google.com> #2
Thank you for your feedback. Team may reach out for more feedback in reproducing or triaging this issue.
es...@google.com <es...@google.com>
tn...@google.com <tn...@google.com>
tn...@google.com <tn...@google.com> #3
This is fixed for an upcoming 4.1 beta and 4.2 canary (by Change-Id: I734821282d433bc059f8f933ff7cb07f39db958d). Thanks for the report!
tn...@google.com <tn...@google.com> #4
(And as always, the reproducible test case was very valuable; thank you for creating it!!)
Description
When declaring an enum containing a StringRes :
enum class MYENUM(@StringRes val title: Int) {
FIRST(R.string.first_title)
}
Using this enum as argument of a fragment (with navigation component and safe args)
<fragment
android:id="@+id/testFragment"
android:name="com.nitrog42.stringreslintissue.TestFragment">
<argument
android:name="myenum"
app:argType="com.nitrog42.stringreslintissue.MYENUM" />
</fragment>
Produces the following error :
Error: Expected resource of type string [ResourceType]
With the following code (using apply, without it works):
val test = TestFragmentArgs(MYENUM.FIRST).myenum
//LINT FAIL
test.apply {
mytextview.text = getString(title)
}
Reproducing sample on Github :