Generic encoding incorrect for some cases
Open
- Dominant language
- Haskell
- Stars
- 1.3k
- Forks
- 336
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 4
Description
Consider a type like this:
```
data T = A { tag :: Int } | B
```
when using the default options for generic encoding and try to encode `A { tag = 2 }` the result is `{"tag":2}`, because the field `tag` overwrote the actual constructor tag `A`
Contributor guide
Research direction
Start by reproducing the generic encoding example for `data T = A { tag :: Int } | B` with the default options and inspect the generic encoding entry points. Done means the constructor tag `A` is not overwritten by the field named `tag`, with behavior confirmed by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100