Skip to content

Validate error under 7.2.1 caused by incomplete pattern warnings in new code gen (GADTs)

the files compiler/cmm/Cmm.hs, compiler/cmm/CmmNode.hs and compiler/cmm/CmmStackLayout.hs all contain the following lines at the top:

{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}
#if __GLASGOW_HASKELL__ >= 701
-- GHC 7.0.1 improved incomplete pattern warnings with GADTs
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
#endif

This causes a validation error when building with 7.2.1 as this version of GHC still seems to incorrectly warn about incorrect patterns despite the above comment. (The above comment is wrong anyway as the cpp if statement only triggers with GHC 7.2.1 and greater, not with GHC 7.0.1).

For now I've dealt with this simply by changing the cpp if statement to be:

#if __GLASGOW_HASKELL__ >= 703
...

Someone more familiar with the code and the state of '-fwarn-incomplete-patterns' should actually fix this up though.

Trac metadata
Trac field Value
Version 7.2.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information