Search code examples
haskellcabalhaskell-stackghci

GHCI: ghc-options for test suite overriding ghc-options for library


I have a library being compiled with -Wall, and I have a test suite with -Wall -Wno-incomplete-patterns

When I fire up ghci with stack ghci --test, it seems ghci picks the ghc options from the test suite and applies them to both projects. In other words, it applies -Wno-incomplete-patterns to the library code as well.

Is there a way of stopping ghci from doing that?


Solution

  • I ended up just removing the flag from the test suite and adding it on a per-module basis:

    {-# OPTIONS_GHC -Wno-incomplete-patterns #-}
    

    Not a proper fix, but worked for this simple scenario.