New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TaggedObject sum encoding is broken after aeson 1.5.6 #967
Comments
I think this is broken TH of Until then try to derive |
When When Thank you for the workaround and for all the work you do for the haskell ecosystem @phadej ! |
I tried to reproduce it, and enabling |
If I dump splices, they look correct:
And if I disable optimizations with So I'm suspecting it's GHC to blame here. |
@donatello could you try #968, whether it fixes your production app. I'm not yet satisfied with a fix, as I don't understand why error happens. |
I suspect even more strongly it's GHC, as if the field names are of different length, error doesn't happen! |
I opened GHC issue https://gitlab.haskell.org/ghc/ghc/-/issues/22204, hopefully we'll get some light on this. |
I can confirm that 01e73c1 of #968 does fix my production app. Thanks a lot! Please release it soon on hackage! |
https://hackage.haskell.org/package/aeson-2.1.1.0 is on Hackage |
- Added `_githubSemaphore` field to the test executor. - Removed `Strict` and `StrictData` because they inadvertently triggered a bug in Aeson: haskell/aeson#967
- Added `_githubSemaphore` field to the test executor. - Removed `Strict` and `StrictData` because they inadvertently triggered a bug in Aeson: haskell/aeson#967
There seems to be at least two issues - one with TH and one with generic deriving.
First one with TH:
When run with
cabal run script.hs
, this prints out (ghc 8.10.7 and ghc 9.0.2):Same output with aeson 2.0
With aeson 1.5.6 (the expected output):
Second issue with generic deriving (only showing the change in how
Event
's instances are derived):The output with aeson 2.0 and 2.1 is:
Strangely the encoding is correct, but the decoding simply fails. I tried with
eitherDecode
to see the error and I get:I could not find any workaround to get this to work.
The text was updated successfully, but these errors were encountered: