Skip to content

Commit

Permalink
fail on field conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz committed Aug 9, 2023
1 parent d415df6 commit 6bc8b6d
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 6bc8b6d

Please sign in to comment.