From 74b1745a1998c5b0a203a5d3c67dade7997ad1b2 Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Sun, 11 Dec 2022 14:48:00 -0800 Subject: [PATCH] Fix compiler error on some GHC versions Fixes the following error: src/ShellCheck/CFGAnalysis.hs:1394:40: error: * Couldn't match expected type `[S.Set a]' with actual type `M.Map String FunctionValue' * In the second argument of `($)', namely `mapStorage $ sFunctionTargets state' In the expression: S.unions $ mapStorage $ sFunctionTargets state In an equation for `declaredFuncs': declaredFuncs = S.unions $ mapStorage $ sFunctionTargets state * Relevant bindings include declaredFuncs :: S.Set a (bound at src/ShellCheck/CFGAnalysis.hs:1394:13) --- src/ShellCheck/CFGAnalysis.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ShellCheck/CFGAnalysis.hs b/src/ShellCheck/CFGAnalysis.hs index 7b270a8..cac913e 100644 --- a/src/ShellCheck/CFGAnalysis.hs +++ b/src/ShellCheck/CFGAnalysis.hs @@ -1391,7 +1391,7 @@ analyzeControlFlow params t = getFunctionTargets :: InternalState -> M.Map Node FunctionDefinition getFunctionTargets state = let - declaredFuncs = S.unions $ mapStorage $ sFunctionTargets state + declaredFuncs = S.unions $ M.elems $ mapStorage $ sFunctionTargets state getFunc d = case d of FunctionDefinition _ entry _ -> Just (entry, d)