mapbox / mapbox/mapbox-maps-android
literal with array or listOf does not work
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 578
- Forks
- 161
- PR merge metrics
- No merged PRs in 30d
Description
Environment
Android SDK 11.3.1
Observed behavior and steps to reproduce
iconTranslate(
Expression.switchCase(
Expression.eq(Expression.get("has-icon"), Expression.literal(true)),
Expression.literal(listOf(7.0,7.0)),
Expression.literal(listOf(7.0,7.0))
))
Notes / preliminary analysis
This code gives me the error: Cannot access 'literal': it is internal in 'Companion'
It makes sense, but how else should I do it then?
Apparently this has been a bug in SDK 10 before (there is a Github bug ticket) and it is supposed to be fixed.
Any help?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the reported Expression.switchCase reproduction with Expression.literal(listOf(7.0, 7.0)) in the Android SDK. Inspect the public Expression.literal entry point and related expression API behavior; the issue is resolved when an array or list literal can be used in this expression without the internal-access error, with coverage for the reported case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100