From 3a5e815ee41324573751d5369e136ee14c4b211f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sun, 11 Aug 2024 09:31:38 +0200 Subject: Parser: try ParamType Either branches with cleared delayed errors Changelog: Fix type error reporting for some command parameters --- src/Parser/Statement.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3