Fix finding consistent component solution for targets
Union does the wrong thing, I wanted an intersection here.
This commit is contained in:
parent
39a8ded102
commit
2bf4c80580
@ -174,7 +174,7 @@ targetGhcOptions crdl sefnmn = do
|
||||
mcs <- cached cradleRootDir resolvedComponentsCache comps
|
||||
|
||||
let mdlcs = moduleComponents mcs `zipMap` Set.toList sefnmn
|
||||
candidates = Set.unions $ map snd mdlcs
|
||||
candidates = findCandidates $ map snd mdlcs
|
||||
|
||||
let noCandidates = Set.null candidates
|
||||
noModuleHasAnyAssignment = all (Set.null . snd) mdlcs
|
||||
@ -249,6 +249,11 @@ moduleComponents m efnmn =
|
||||
|
||||
foldr' b as f = Map.foldr f b as
|
||||
|
||||
|
||||
findCandidates :: [Set ChComponentName] -> Set ChComponentName
|
||||
findCandidates [] = Set.empty
|
||||
findCandidates scns = foldl1 Set.intersection scns
|
||||
|
||||
pickComponent :: Set ChComponentName -> ChComponentName
|
||||
pickComponent scn = Set.findMin scn
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user