Skip to content
This repository

Fix #72. #73

Merged
merged 1 commit into from over 1 year ago

3 participants

Jared Hance Bryan O'Sullivan Michael Klishin
Jared Hance

Sometimes, it appears, Nullary constructors can be encoded as Null as
well as an empty array [not sure why one this!]. The Generic code, as of
49befca, fails when a Null is
passed for a nullary constructor. Add in a pattern match to fix this
issue.

See #72

Jared Hance Fix #72.
Sometimes, it appears, Nullary constructors can be encoded as Null as
well as an empty array [not sure why one this!]. The Generic code, as of
49befca, fails when a Null is
passed for a nullary constructor. Add in a pattern match to fix this
issue.
7639ea8
Bryan O'Sullivan
Owner
bos commented June 15, 2012

I'm nervous about accepting this patch unless @basvandijk can give it a once-over first.

Michael Klishin

#72 is currently a blocker for using Aeson (and, likely, Haskell) for me. Any ETA on when it may be finally resolved?

Bryan O'Sullivan bos merged commit 7639ea8 into from November 19, 2012
Bryan O'Sullivan bos closed this November 19, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Mar 18, 2012
Jared Hance Fix #72.
Sometimes, it appears, Nullary constructors can be encoded as Null as
well as an empty array [not sure why one this!]. The Generic code, as of
49befca, fails when a Null is
passed for a nullary constructor. Add in a pattern match to fix this
issue.
7639ea8
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 1 addition and 0 deletions. Show diff stats Hide diff stats

  1. 1  Data/Aeson/Generic.hs
1  Data/Aeson/Generic.hs
@@ -290,6 +290,7 @@ parseJSON_generic j = generic
290 290
         decodeArgs c0 = go (numConstrArgs (resType generic) c0) c0
291 291
                            (constrFields c0)
292 292
          where
  293
+          go 0 c _        Null       = construct c []
293 294
           go 1 c []       jd         = construct c [jd] -- unary constructor
294 295
           go _ c []       (Array js) = construct c (V.toList js) -- no field names
295 296
           -- FIXME? We could allow reading an array into a constructor
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.