summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2024-08-11 09:31:38 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2024-08-11 09:31:38 +0200
commit3a5e815ee41324573751d5369e136ee14c4b211f (patch)
tree1eab4de84f6636be50923921c99cbeb3445dfb98
parentdf8cbbe83631df3d14b8fc4fafda7154b9788ff5 (diff)
Parser: try ParamType Either branches with cleared delayed errors
Changelog: Fix type error reporting for some command parameters
-rw-r--r--src/Parser/Statement.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Parser/Statement.hs b/src/Parser/Statement.hs
index 8dd285a..b2f3cd6 100644
--- a/src/Parser/Statement.hs
+++ b/src/Parser/Statement.hs
@@ -123,7 +123,7 @@ instance (ParamType a, ParamType b) => ParamType (Either a b) where
type ParamRep (Either a b) = Either (ParamRep a) (ParamRep b)
parseParam _ = try' (Left <$> parseParam @a Proxy) <|> (Right <$> parseParam @b Proxy)
where
- try' act = try $ do
+ try' act = try $ region id $ do
x <- act
(stateParseErrors <$> getParserState) >>= \case
[] -> return x