Skip to content

Commit 19218fd

Browse files
authored
Workaround "Pattern match has inaccessible right hand side" bug (#2611)
When using GHC < 9 .../ICE40/Blackboxes/IO.hs sometimes(?) warns: Pattern match has inaccessible right hand side In a pattern binding in a pattern guard for an equation for ‘sbioTemplate’: [_HasCallStack, (clk, clkTy, _), (en, _enTy, _), (pinConfig, _pinTy, pinConfigLiteral -> ()), (packagePin, packagePinTy, _), (latchInput, Bit, _), (dOut0, Bit, _), (dOut1, Bit, _), (outputEnable, Bool, _)] <- ... And because we run with -Werror on CI this causes compilation to fail. This works around that by explicitly turning it back into a warning.
1 parent a2407d3 commit 19218fd

File tree

1 file changed

+8
-0
lines changed
  • clash-cores/src/Clash/Cores/LatticeSemi/ICE40/Blackboxes

1 file changed

+8
-0
lines changed

clash-cores/src/Clash/Cores/LatticeSemi/ICE40/Blackboxes/IO.hs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,19 @@
55
66
HDL generation functionality for LATTICE ICE IO primitives.
77
-}
8+
9+
{-# LANGUAGE CPP #-}
810
{-# LANGUAGE OverloadedStrings #-}
911
{-# LANGUAGE ViewPatterns #-}
1012

1113
{-# OPTIONS_HADDOCK hide #-}
1214

15+
-- GHC < 9, sometimes(?) compains about the RHS of sbioTemplate being unreacheble,
16+
-- this explicitly turns that into an warning overriding -Werror.
17+
#if __GLASGOW_HASKELL__ < 900
18+
{-# OPTIONS_GHC -Wwarn=overlapping-patterns #-}
19+
#endif
20+
1321
module Clash.Cores.LatticeSemi.ICE40.Blackboxes.IO (sbioTF) where
1422

1523
import Prelude

0 commit comments

Comments
 (0)