Special case Option intermediary type in extraction. #1717
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR resolves a long-standing bug where trying to execute extraction when
Option
was an intermediary type on aList
would cause fireworks and explosions. So, for example if you tried something like the following:You would get explosions and fireworks because lift-json would try to match up what you've provided to the constructor for
Option
. We now special caseOption
as a type of collection in the generation of theMeta
ADT, and handle that case when constructing the concrete instance.I'm not quite familiar enough with this code to know if this is a kludge or a clever hack. Would love some 👀 from @jonifreeman (if you have time). Either way, I humbly submit this for review.
closes #1071