Perhaps ['match'...] shouldn't require 4 arguments
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
This wasn't valid as a match expression:
```
'fill-color': ['match', ['get','type'],
/*'park', 'lightgreen',
'wetland','darkgreen',
'school','pink',
'project','red',
'service','cyan',
'polder','hsla(200,70%,50%,0.3)',
'farm', 'hsl(60,90%,60%)',*/
// 'white'
colors.lightgreen
],
```
That is, a `match` where there is only the default value (everything else was temporarily commented out). It seems legitimate by analogy with:
```
switch(x) {
default: f()
}
```
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 tracing how the map expression parser validates the `match` expression shown in the issue, then look for existing tests covering `match` arguments. Confirm the desired behavior for an expression containing only a default value and add coverage showing whether that form is accepted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100