Skip to content

Commit

Permalink
fail on field conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz authored and jonaprieto committed Aug 9, 2023
1 parent 4384029 commit d70dd59
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Juvix/Data/FixityInfo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ instance FromJSON FixityInfo where
_fixityPrecSame <- keyMay "same" asText
_fixityPrecBelow <- fromMaybe [] <$> keyMay "below" (eachInArray asText)
_fixityPrecAbove <- fromMaybe [] <$> keyMay "above" (eachInArray asText)
when (isJust _fixityPrecSame && not (null _fixityPrecBelow && null _fixityPrecAbove)) $
throwCustomError "'same' cannot be provided together with 'above' or 'below'"
return FixityInfo {..}

parseArity :: Parse YamlError Arity
Expand Down

0 comments on commit d70dd59

Please sign in to comment.