Skip to content

Commit

Permalink
priv deps: Fix long bad closure message
Browse files Browse the repository at this point in the history
We would previously include terminal nodes if these were not private.
  • Loading branch information
alt-romes committed Apr 30, 2024
1 parent 894c6c3 commit b7ff4a7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ findBadPrivClosures pkg rdm = do
| stopAtPkg && x == pkg
= (M.insert x (dontLook x) s, path)
| otherwise
= foldl go (M.insert x (dontLook x) s, x:path) $ neighbors x
= let nbs = neighbors x
in foldl go (M.insert x (dontLook x) s, if null nbs then path else x:path) nbs
-- \^ We don't add x to the path if this is a terminal node.

dontLook x = error $ "We should only lookup privately-qualified pkgs, but instead " ++ show x ++ " was looked up -- it is only inserted in the map for de-duplication purposes."

Expand Down

0 comments on commit b7ff4a7

Please sign in to comment.