diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2024-08-11 09:31:38 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2024-08-11 09:31:38 +0200 |
commit | 3a5e815ee41324573751d5369e136ee14c4b211f (patch) | |
tree | 1eab4de84f6636be50923921c99cbeb3445dfb98 /src | |
parent | df8cbbe83631df3d14b8fc4fafda7154b9788ff5 (diff) |
Parser: try ParamType Either branches with cleared delayed errors
Changelog: Fix type error reporting for some command parameters
Diffstat (limited to 'src')
-rw-r--r-- | src/Parser/Statement.hs | 2 |
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 |