[GHC] #14954: Passing -fno-code disables reporting of some warnings

#14954: Passing -fno-code disables reporting of some warnings -------------------------------------+------------------------------------- Reporter: mrkkrp | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Here is how to reproduce the issue with GHC 8.2.2: {{{ $ cat Main.hs module Main (main) where main = case (1+1) :: Int of 1 -> return () $ ghc -Wall -Werror -fno-code Main.hs [1 of 1] Compiling Main ( Main.hs, nothing ) Main.hs:3:1: warning: [-Wmissing-signatures] Top-level binding with no type signature: main :: IO () | 3 | main = | ^^^^ <no location info>: error: Failing due to -Werror. $ ghc -Wall -Werror Main.hs [1 of 1] Compiling Main ( Main.hs, Main.o ) Main.hs:3:1: warning: [-Wmissing-signatures] Top-level binding with no type signature: main :: IO () | 3 | main = | ^^^^ Main.hs:4:3: warning: [-Wincomplete-patterns] Pattern match(es) are non-exhaustive In a case alternative: Patterns not matched: p where p is not one of {1} | 4 | case (1+1) :: Int of | ^^^^^^^^^^^^^^^^^^^^... <no location info>: error: Failing due to -Werror. }}} Note that `missing-signature` is reported both times, but the `incomplete- patterns` is not reported with `-fno-code`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14954 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14954: Passing -fno-code disables reporting of some warnings -------------------------------------+------------------------------------- Reporter: mrkkrp | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): See #10600 . I still don't know why the pattern match checking happens in the desugarer but perhaps this is fixed? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14954#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14954: Passing -fno-code disables reporting of some warnings -------------------------------------+------------------------------------- Reporter: mrkkrp | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #10600 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * resolution: => duplicate * related: => #10600 Comment: Indeed, this is a duplicate of #10600, as this emits the warning with GHC 8.4.1: {{{ $ /opt/ghc/8.4.1/bin/ghci -Wall -fno-code Bug.hsGHCi, version 8.4.1: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rgscott/.ghci [1 of 1] Compiling Main ( Bug.hs, nothing ) Bug.hs:3:1: warning: [-Wmissing-signatures] Top-level binding with no type signature: main :: IO () | 3 | main = | ^^^^ Bug.hs:4:3: warning: [-Wincomplete-patterns] Pattern match(es) are non-exhaustive In a case alternative: Patterns not matched: p where p is not one of {1} | 4 | case (1+1) :: Int of | ^^^^^^^^^^^^^^^^^^^^... }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14954#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC