kh: fail to parse invalid belts
Previously we would allow the tags that were added Haskell-side for
union type syntax. Now we explicitly reject those before falling back
to the auto-generated noun parsing logic.
@@ -306,10 +306,13 @@ $(pure [])
instance FromNoun Bolt where
parseNoun = \case
A c -> pure $ Key $ C.chr $ fromIntegral c
+ C (A 7955819) _ -> fail "%key not valid bolt tag"
n -> $(deriveFromNounFunc ''Bolt) n
instance FromNoun Belt where
- parseNoun n = Bol <$> parseNoun n <|> $(deriveFromNounFunc ''Belt) n
+ parseNoun = \case
+ C (A 7106402) _ -> fail "%bol not valid belt tag"
+ n -> Bol <$> parseNoun n <|> $(deriveFromNounFunc ''Belt) n
instance ToNoun Bolt where
toNoun = \case
