0.10 causes Couldn't match expected type `Data.Text.Internal.Text' with actual type `Data.ByteString.Builder.Internal.Builder' #293

Closed
mantkiew opened this Issue Sep 24, 2015 · 8 comments

Projects

None yet

8 participants

@mantkiew

I get the following error now in the code generated by Aeson.TH:

src\Language\Clafer\Intermediate\Intclafer.hs:392:3:
    Couldn't match expected type `Data.Text.Internal.Text'
                with actual type `Data.ByteString.Builder.Internal.Builder'
    In the first argument of `(Data.Aeson..=)', namely
      `aeson-0.10.0.0:Data.Aeson.Encode.Builder.text
         (Data.Text.pack "gcard")'
    In the first argument of `(<$>)', namely
      `(aeson-0.10.0.0:Data.Aeson.Encode.Builder.text
          (Data.Text.pack "gcard")
        Data.Aeson..=)'

src\Language\Clafer\Intermediate\Intclafer.hs:400:3:
    Couldn't match expected type `Data.Text.Internal.Text'
                with actual type `Data.ByteString.Builder.Internal.Builder'
    In the first argument of `(Data.Aeson..=)', namely
      `aeson-0.10.0.0:Data.Aeson.Encode.Builder.text
         (Data.Text.pack "iType")'
    In the first argument of `(<$>)', namely
      `(aeson-0.10.0.0:Data.Aeson.Encode.Builder.text
          (Data.Text.pack "iType")
        Data.Aeson..=)'

the fields gcard and iType are

, _gcard :: Maybe IGCard

and

_iType :: Maybe IType.

The error occurs on line 392 and line 400.

@juodaspaulius

Yep, I was having the same issue and had to downgrade to 0.9.0.1..

@s9gf4ult

I have the same issue.

@Daniel-Diaz
Contributor

I ran into the same issue. An instance that used to work, it breaks on aeson-0.10.0.0. At the moment, I am building against 0.9.0.1, but I would like to build my package using the newest version. What is necessary to do in order to adapt to the new aeson?

@ankhers
ankhers commented Oct 9, 2015

I'm also seeing this issue.

It has something to do with omitNothingFields = True. If you remove that option, things should compile normally.

@basvandijk basvandijk added a commit that closed this issue Oct 10, 2015
@basvandijk basvandijk Fix #293 159de4f
@basvandijk
Collaborator

This should be fixed by 159de4f. @bos will you do the release honours?

@phadej phadej added a commit to phadej/aeson that referenced this issue Dec 8, 2015
@basvandijk @phadej basvandijk + phadej Fix #293 7c68998
@mantkiew
mantkiew commented Jan 6, 2016

I confirm that it's fixed with HEAD (latest commit ).

@bos New bug fix release pretty pretty please?

LTS-4.0 contains aeson-0.10.0.0, so I have to do the following in stack.yaml:

packages:
- '.'
- location:
    git: https://github.com/bos/aeson.git
    commit: 4de5a203eeeea593457bc92bc40062f3ea830426
@Osager
Osager commented Aug 1, 2016

@ankhers
I am still having the exact issue with LTS-4.1

@bergmark
Collaborator
bergmark commented Aug 1, 2016 edited

@Osager since that is an old LTS version it contains an old version of aeson without the fix. lts-4 was also discontinued early in favor of lts-5 which reverted to aeson 0.9.* (which doesn't have this problem either).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment