[GHC] #7669: Empty case causes warning
#7669: Empty case causes warning ----------------------------------------------+----------------------------- Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.7 | Keywords: EmptyCase Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Incorrect warning at compile-time | Blockedby: Blocking: | Related: ----------------------------------------------+----------------------------- The following code {{{ {-# LANGUAGE EmptyCase #-} {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} data Void foo :: Void -> () foo x = case x of {} }}} causes this warning {{{ /Users/rae/temp/Scratch.hs:6:9: Warning: Pattern match(es) are non-exhaustive In a case alternative: Patterns not matched: Ok, modules loaded: Main. }}} -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7669> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#7669: Empty case causes warning ----------------------------------------------+----------------------------- Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.7 | Keywords: EmptyCase Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Incorrect warning at compile-time | Blockedby: Blocking: | Related: ----------------------------------------------+----------------------------- Comment(by simonpj@…): commit 9162d159a62d19d4b371b7348eb1b524001fddcd {{{ Author: Simon Peyton Jones <simonpj@microsoft.com> Date: Wed Feb 13 17:37:17 2013 +0000 Simplify the base case for 'check', and thereby fix Trac #7669 compiler/deSugar/Check.lhs | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) }}} -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7669#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#7669: Empty case causes warning ------------------------------------------------+--------------------------- Reporter: goldfire | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: fixed | Keywords: EmptyCase Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Incorrect warning at compile-time | Difficulty: Unknown Testcase: deSugar/should_compile/T7669 | Blockedby: Blocking: | Related: ------------------------------------------------+--------------------------- Changes (by simonpj): * status: new => closed * difficulty: => Unknown * resolution: => fixed * testcase: => deSugar/should_compile/T7669 Comment: Thanks. Turns out I could cure this ''and'' make the code simpler! Simon -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7669#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#7669: Empty case causes warning ------------------------------------------------+--------------------------- Reporter: goldfire | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: fixed | Keywords: EmptyCase Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Incorrect warning at compile-time | Difficulty: Unknown Testcase: deSugar/should_compile/T7669 | Blockedby: Blocking: | Related: ------------------------------------------------+--------------------------- Comment(by monoidal): However, previously empty case always gave a warning; now it never does. {{{ f :: Bool -> a f x = case x of { } }}} -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7669#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#7669: Empty case causes warning ------------------------------------------------+--------------------------- Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: EmptyCase Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Incorrect warning at compile-time | Difficulty: Unknown Testcase: deSugar/should_compile/T7669 | Blockedby: Blocking: | Related: ------------------------------------------------+--------------------------- Changes (by simonpj): * status: closed => new * resolution: fixed => Comment: Very true. Would anyone like to look at the overlapping-pattern warnings? It's a well-defined problem, restricted to a single module in GHC (`deSugar/Check.lhs`). We have a bunch of tickets about it: at least #595, #5728, #3927, #5724, #5762, #4139, #6124. A lovely project awaits! Meanwhile I think I'll leave the code in its simplified state. Simon -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7669#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#7669: Empty case causes warning ------------------------------------------------+--------------------------- Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: 7.7 Resolution: | Keywords: EmptyCase Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Incorrect warning at compile-time | Difficulty: Unknown Testcase: deSugar/should_compile/T7669 | Blockedby: Blocking: | Related: ------------------------------------------------+--------------------------- Changes (by igloo): * milestone: => 7.8.1 -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7669#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC