Skip to content

Commit 7ecff6e

Browse files
committed
fix infinite loop in D.Client.TargetSelector
The pattern guard was clearly meant as a list-comprehension filter, but on a let-bound pattern, it instead caused a circular loop in which whether the LHS variables are bound the the RHS values depends on the values of the LHS variables. fixes #5081
1 parent f3cacff commit 7ecff6e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cabal-install/Distribution/Client/TargetSelector.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,9 @@ disambiguateTargetSelectors matcher matchInput exactMatch matchResults =
611611
Left ( originalMatch
612612
, [ (forgetFileStatus rendering, matches)
613613
| rendering <- matchRenderings
614-
, let (Match m _ matches) | m /= Inexact =
614+
, let Match m _ matches =
615615
memoisedMatches Map.! rendering
616+
, m /= Inexact
616617
] )
617618

618619
| (originalMatch, matchRenderings) <- matchResultsRenderings ]

0 commit comments

Comments
 (0)