From cb8b7d7aa679d919321853af69a7fef90b7eb3b9 Mon Sep 17 00:00:00 2001 From: Sebastian Graf Date: Sat, 10 Aug 2019 19:29:59 +0100 Subject: [PATCH] Remove dead code This would trip up the improved pattern match checker from [!963](https://gitlab.haskell.org/ghc/ghc/merge_requests/963). The removed code is related to maintaining the round-trip property, so should be re-introduced at some point. This is tracked in #6193. --- .../PackageDescription/PrettyPrint.hs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/Cabal/Distribution/PackageDescription/PrettyPrint.hs b/Cabal/Distribution/PackageDescription/PrettyPrint.hs index f7cf2f6b17c..aed448bcbaa 100644 --- a/Cabal/Distribution/PackageDescription/PrettyPrint.hs +++ b/Cabal/Distribution/PackageDescription/PrettyPrint.hs @@ -126,17 +126,10 @@ ppCondTree2 v grammar = go thenDoc = go thenTree ppIf (CondBranch c thenTree (Just elseTree)) = - case (False, False) of - -- case (isEmpty thenDoc, isEmpty elseDoc) of - (True, True) -> mempty - (False, True) -> [ ppIfCondition c thenDoc ] - (True, False) -> [ ppIfCondition (cNot c) elseDoc ] - (False, False) -> [ ppIfCondition c thenDoc - , PrettySection () "else" [] elseDoc - ] - where - thenDoc = go thenTree - elseDoc = go elseTree + -- See #6193 + [ ppIfCondition c (go thenTree) + , PrettySection () "else" [] (go elseTree) + ] ppCondLibrary :: CabalSpecVersion -> Maybe (CondTree ConfVar [Dependency] Library) -> [PrettyField ()] ppCondLibrary _ Nothing = mempty