Commit 77494fa9 authored by Georgios Karachalias's avatar Georgios Karachalias Committed by Ben Gamari

Remove -Wtoo-many-guards from default flags (fixes #11316)

Since #11316 indicates that having flag `-Wtoo-many-guards`
enabled by default causes issues, the simplest thing is to
remove it. This patch removes it from the default list, it
updates the docs and removes the suppression flags for
`T783` and `types/OptCoercion.hs`

Test Plan: validate

Reviewers: bgamari, austin, goldfire

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1737

GHC Trac Issues: #11316
parent cdeefa44
......@@ -3400,7 +3400,6 @@ optLevelFlags -- see Note [Documenting optimisation flags]
standardWarnings :: [WarningFlag]
standardWarnings -- see Note [Documenting warning flags]
= [ Opt_WarnOverlappingPatterns,
Opt_WarnTooManyGuards,
Opt_WarnWarningsDeprecations,
Opt_WarnDeprecatedFlags,
Opt_WarnDeferredTypeErrors,
......
-- (c) The University of Glasgow 2006
{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__ > 710
{-# OPTIONS_GHC -Wno-too-many-guards #-}
#endif
-- This module used to take 10GB of memory to compile with the new
-- (Nov '15) pattern-match check. In order to be able to compile it,
-- do not enable -ffull-guard-reasoning. Instead, simplify the guards
-- (default behaviour when guards are too many) but suppress the
-- "too-many-guards" warning (-Werror is on).
-- (default behaviour when guards are too many).
module OptCoercion ( optCoercion, checkAxInstCo ) where
......
......@@ -248,8 +248,7 @@ Compiler
- Added the ``-Wtoo-many-guards`` flag. When enabled, this will issue a
warning if a pattern match contains too many guards (over 20 at the
moment). It is enabled by default but makes a difference only if pattern
match checking is also enabled.
moment). Makes a difference only if pattern match checking is also enabled.
- Added the ``-ffull-guard-reasoning`` flag. When enabled, pattern match
checking tries its best to reason about guards. Since the additional
......
......@@ -545,14 +545,15 @@ of ``-W(no-)*``.
The option ``-Wtoo-many-guards`` warns about places where a
pattern match contains too many guards (over 20 at the moment).
It is enabled by default but has an effect only if any form of
exhaustivness/overlapping checking is enabled (one of
It has an effect only if any form of exhaustivness/overlapping
checking is enabled (one of
``-Wincomplete-patterns``,
``-Wincomplete-uni-patterns``,
``-Wincomplete-record-updates``,
``-Woverlapping-patterns``). The warning can be suppressed by
enabling either ``-Wno-too-many-guards``, which just hides the
warning, or ``-ffull-guard-reasoning``.
``-Woverlapping-patterns``). When enabled, the warning can be
suppressed by enabling either ``-Wno-too-many-guards``, which just
hides the warning, or ``-ffull-guard-reasoning`` which runs the
full check, independently of the number of guards.
``-ffull-guard-reasoning``
.. index::
......
{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__ > 710
{-# OPTIONS_GHC -Wno-too-many-guards #-}
#endif
module Test where
foo :: Double -> Int
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment