[GHC] #11253: Duplicate warnings for pattern guards and relevant features (e.g. View Patterns)

#11253: Duplicate warnings for pattern guards and relevant features (e.g. View Patterns) -------------------------------------+------------------------------------- Reporter: gkaracha | Owner: gkaracha Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Keywords: pattern | Operating System: Unknown/Multiple matching, exhaustiveness | Architecture: | Type of failure: Incorrect Unknown/Multiple | warning at compile-time Test Case: | Blocked By: Blocking: | Related Tickets: #595 Differential Rev(s): | Wiki Page: | PatternMatchCheck, | PatternMatchCheckImplementation -------------------------------------+------------------------------------- There are some cases where the new exhaustiveness checker emits duplicate warnings. E.g. for `f`: {{{#!hs f :: Bool -> Bool -> () f (not -> True) (not -> False) = () }}} we get: {{{ DuplicateWarn.hs:6:1: warning: Pattern match(es) are non-exhaustive In an equation for ‘f’: Patterns not matched: _ _ -- represents (not -> False) _ _ _ -- represents (not -> True) (not -> True) }}} As indicated in the comments, the two comments represent different missing cases, but since we do not print the additional information, they look alike. It would be better to either: * Give additional information to the user to distinguish between the two or * Print a single warning `(_ _)` I cannot think of a nice solution to this yet but I will keep thinking about it. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11253 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11253: Duplicate warnings for pattern guards and relevant features (e.g. View Patterns) -------------------------------------+------------------------------------- Reporter: gkaracha | Owner: gkaracha Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: pattern | matching, exhaustiveness Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: #595 | Differential Rev(s): Wiki Page: | PatternMatchCheck, | PatternMatchCheckImplementation | -------------------------------------+------------------------------------- Changes (by gkaracha): * Attachment "DuplicateWarn.hs" added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11253 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11253: Duplicate warnings for pattern guards and relevant features (e.g. View Patterns) -------------------------------------+------------------------------------- Reporter: gkaracha | Owner: gkaracha Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: pattern | matching, exhaustiveness Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: #595 | Differential Rev(s): Wiki Page: | PatternMatchCheck, | PatternMatchCheckImplementation | -------------------------------------+------------------------------------- Description changed by gkaracha: Old description:
There are some cases where the new exhaustiveness checker emits duplicate warnings. E.g. for `f`: {{{#!hs f :: Bool -> Bool -> () f (not -> True) (not -> False) = () }}} we get: {{{ DuplicateWarn.hs:6:1: warning: Pattern match(es) are non-exhaustive In an equation for ‘f’: Patterns not matched: _ _ -- represents (not -> False) _ _ _ -- represents (not -> True) (not -> True) }}} As indicated in the comments, the two comments represent different missing cases, but since we do not print the additional information, they look alike. It would be better to either: * Give additional information to the user to distinguish between the two or * Print a single warning `(_ _)`
I cannot think of a nice solution to this yet but I will keep thinking about it.
New description: There are some cases where the new exhaustiveness checker emits duplicate warnings. E.g. for `f`: {{{#!hs f :: Bool -> Bool -> () f (not -> True) (not -> False) = () }}} we get: {{{ DuplicateWarn.hs:6:1: warning: Pattern match(es) are non-exhaustive In an equation for ‘f’: Patterns not matched: _ _ -- represents (not -> False) _ _ _ -- represents (not -> True) (not -> True) }}} As indicated in the comments, the two warnings represent different missing cases, but since we do not print the additional information, they look alike. It would be better to either: * Give additional information to the user to distinguish between the two or * Print a single warning `(_ _)` I cannot think of a nice solution to this yet but I will keep thinking about it. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11253#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11253: Duplicate warnings for pattern guards and relevant features (e.g. View Patterns) -------------------------------------+------------------------------------- Reporter: gkaracha | Owner: gkaracha Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: pattern | matching, exhaustiveness, pattern | checker Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: #595 | Differential Rev(s): Wiki Page: | PatternMatchCheck, | PatternMatchCheckImplementation | -------------------------------------+------------------------------------- Changes (by bgamari): * keywords: pattern matching, exhaustiveness => pattern matching, exhaustiveness, pattern checker -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11253#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11253: Duplicate warnings for pattern guards and relevant features (e.g. View Patterns) -------------------------------------+------------------------------------- Reporter: gkaracha | Owner: gkaracha Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: pattern | matching, exhaustiveness, pattern | checker, PatternMatchWarnings Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: #595 | Differential Rev(s): Wiki Page: | PatternMatchCheck, | PatternMatchCheckImplementation | -------------------------------------+------------------------------------- Changes (by simonpj): * keywords: pattern matching, exhaustiveness, pattern checker => pattern matching, exhaustiveness, pattern checker, PatternMatchWarnings -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11253#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC