From 20403c2a675acab389f243db05bc1680df4afc6f Mon Sep 17 00:00:00 2001 From: Bretton Date: Tue, 5 Jul 2022 17:14:02 -0700 Subject: [PATCH] Panic on recursive foreign decl group --- src/Cryptol/Eval/FFI.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Cryptol/Eval/FFI.hs b/src/Cryptol/Eval/FFI.hs index c47d6d363..4accda339 100644 --- a/src/Cryptol/Eval/FFI.hs +++ b/src/Cryptol/Eval/FFI.hs @@ -29,8 +29,9 @@ evalForeignDecls :: ModulePath -> Module -> EvalEnv -> Eval (Either [FFILoadError] EvalEnv) evalForeignDecls path m env = do foreignSrc <- liftIO $ newIORef Nothing - let evalForeignDeclGroup e (Recursive ds) = foldlM evalForeignDecl e ds - evalForeignDeclGroup e (NonRecursive d) = evalForeignDecl e d + let evalForeignDeclGroup e (NonRecursive d) = evalForeignDecl e d + evalForeignDeclGroup _ (Recursive _) = panic "evalForeignDecls" + ["Recursive foreign declaration group"] evalForeignDecl e d = case dDefinition d of DForeign -> do fsrc <- liftIO (readIORef foreignSrc) >>= \case