From 84bfdcf234a70daf8dc2d09fc4a1237448e54de0 Mon Sep 17 00:00:00 2001 From: Gavin Jaeger-Freeborn Date: Thu, 2 Feb 2023 15:59:50 -0800 Subject: [PATCH] fix: Infinite loop when evaluating `(())` (#1427) Evaluation of `(())` is treated as a malformed expression rather than causing an infinite loop --- src/Eval.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Eval.hs b/src/Eval.hs index 660b69a0..6dcf42d7 100644 --- a/src/Eval.hs +++ b/src/Eval.hs @@ -394,6 +394,7 @@ eval ctx xobj@(XObj o info ty) preference resolver = evaluateApp :: Evaluator evaluateApp (AppPat f' args) = case f' of + (ListPat []) -> pure (evalError ctx (format (GenericMalformed xobj)) (xobjInfo xobj)) l@(ListPat _) -> go l ResolveLocal sym@(SymPat _ _) -> go sym resolver _ -> pure (evalError ctx (format (GenericMalformed xobj)) (xobjInfo xobj))