Skip to content

Commit

Permalink
Remove pattern match redundant according to GHC 8.10
Browse files Browse the repository at this point in the history
Pattern match checking has improved since 8.6.5. GHC now considers more pattern
matches as redundant than before. This commit removes such a redundant pattern
match. Consequently, GHC 8.6.5 will consider it incomplete, although the case in
question will never be reached at run-time, so disable the incomplete patterns
warning for older GHC versions.
  • Loading branch information
mrBliss committed Oct 19, 2020
1 parent ee18bb2 commit 18d2182
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 6 additions & 0 deletions cardano-node/cardano-node.cabal
Expand Up @@ -133,6 +133,12 @@ library
-Wpartial-fields
-Wcompat

-- Pattern match checking has improved since 8.6.5. GHC now considers more
-- pattern matches as redundant than before, so disable this warning for older
-- versions of GHC that still consider them incomplete.
if impl(ghc < 8.10)
ghc-options: -Wno-incomplete-patterns

if os(windows)
build-depends: Win32
else
Expand Down
Expand Up @@ -232,7 +232,6 @@ instance Era era => ToObject (ChainPredicateFailure era) where
\protocol version."
toObject verb (BbodyFailure f) = toObject verb f
toObject verb (TickFailure f) = toObject verb f
toObject verb (TicknFailure f) = toObject verb f
toObject verb (PrtclFailure f) = toObject verb f
toObject verb (PrtclSeqFailure f) = toObject verb f

Expand Down

0 comments on commit 18d2182

Please sign in to comment.