Fix annotation default target warnings in enum constructors#602
Fix annotation default target warnings in enum constructors#602gioalex07 wants to merge 4 commits intoVREMSoftwareDevelopment:mainfrom
Conversation
Add explicit @param: target to @stringres, @DrawableRes and @ColorRes annotations on enum constructor parameters to suppress KT-73255 warnings. Kotlin 2.x will apply these annotations to both parameter and field by default in a future release; this change opts in to the parameter-only behavior explicitly. Affected files: WiFiBand, Strength, WiFiSecurity, WiFiStandard, WiFiWidth
|
Thanks for the contribution.
Please update the PR with real‑device testing details so review can continue. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #602 +/- ##
============================================
- Coverage 97.83% 97.76% -0.07%
- Complexity 975 979 +4
============================================
Files 121 121
Lines 2581 2813 +232
Branches 211 211
============================================
+ Hits 2525 2750 +225
- Misses 19 26 +7
Partials 37 37 🚀 New features to boost your workflow:
|
|
Thank you for the contribution. |
Summary
@param:target to@StringRes,@DrawableResand@ColorResannotations on enum constructor parameters.What does this implement/fix?
Kotlin 2.x introduced a warning when
@StringRes,@DrawableResor@ColorResare applied to enum constructorparameters without an explicit annotation target. In a future release, these annotations will be applied to both
the parameter and the backing field by default. This change opts in to the parameter-only behavior explicitly
using the
@param:target, silencing the warning and future-proofing the code.Affected files:
wifi/band/WiFiBand.kt—@param:StringReswifi/model/Strength.kt—@param:DrawableRes,@param:ColorReswifi/model/WiFiSecurity.kt—@param:DrawableRes,@param:StringReswifi/model/WiFiStandard.kt—@param:StringRes(x2)wifi/model/WiFiWidth.kt—@param:StringResDoes this close any issues?
How was this tested?