You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm in the process of migrating my multiplatform application to use the resources system introduced in 1.6.0. Many of my XML string names include the $ character as a way of indicating that the following word will be replaced at runtime with a different value.
This character is illegal within an unquoted Kotlin name, but this isn't handled correctly in some cases by the resources generator and causes compilation to fail in several places per string.
Fixes#4548
## Testing
Add compose resources with name such as "package", "is" or "item_$xxx"
and check that app compiles and works fine. Accessors should be properly
escaped
## Release Notes
### Fixes - Resources
- Fix resource accessors escaping. Now it is possible to use resources
with names: "package", "is", "item_$xxx" etc
Describe the bug
I'm in the process of migrating my multiplatform application to use the resources system introduced in 1.6.0. Many of my XML string names include the
$
character as a way of indicating that the following word will be replaced at runtime with a different value.This character is illegal within an unquoted Kotlin name, but this isn't handled correctly in some cases by the resources generator and causes compilation to fail in several places per string.
Example
This string:
Is incorrectly generated into Kotlin as:
Affected platforms
All platforms (affects resources at compile-time)
Versions
To Reproduce
Steps and/or the code snippet to reproduce the behavior:
src/commonMain/composeResources/values
, create a string with a name that is illegal as a Kotlin variable nameExpected behavior
XML strings are accessible using the resources API even if names contain Kotlin-illegal characters.
Hacky workaround
Code
The text was updated successfully, but these errors were encountered: