[GHC] #8101: No pattern match non-exhaustiveness warnings when compiling with -fno-code
#8101: No pattern match non-exhaustiveness warnings when compiling with -fno-code -------------------------+------------------------------------------------- Reporter: exbb2 | Owner: Type: bug | Status: new Priority: | Milestone: normal | Version: 7.6.3 Component: | Operating System: Unknown/Multiple Compiler | Type of failure: Incorrect warning at Keywords: | compile-time Architecture: | Test Case: Unknown/Multiple | Blocking: Difficulty: | Unknown | Blocked By: | Related Tickets: | -------------------------+------------------------------------------------- {{{ {-# OPTIONS_GHC -Wall #-} module A where data ABC = A | B | C abc :: ABC -> Int abc x = case x of A -> 1 }}} {{{ $ ghc -fno-code -fforce-recomp /tmp/A.hs [1 of 1] Compiling A ( /tmp/A.hs, nothing ) }}} {{{ $ ghc -fobject-code -fforce-recomp /tmp/A.hs [1 of 1] Compiling A ( /tmp/A.hs, /tmp/A.o ) /tmp/A.hs:7:9: Warning: Pattern match(es) are non-exhaustive In a case alternative: Patterns not matched: B C }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8101> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8101: No pattern match non-exhaustiveness warnings when compiling with -fno-code -------------------------------------------------+------------------------- Reporter: exbb2 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect warning at | Unknown/Multiple compile-time | Difficulty: Test Case: | Unknown Blocking: | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Comment (by ian@…): commit b475be321106f79da115ae203a5a27fabfbb80d8 {{{ Author: Ian Lynagh <ian@well-typed.com> Date: Sun Jul 28 17:01:50 2013 +0100 desugar code even when -fno-code is used; fixes #8101 We need to desugar the code, or we don't get the warnings from the desugarer. compiler/deSugar/Desugar.lhs | 7 +------ compiler/main/HscMain.hs | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8101#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8101: No pattern match non-exhaustiveness warnings when compiling with -fno-code -------------------------------------------------+------------------------- Reporter: exbb2 | Owner: Type: bug | Status: Priority: normal | closed Component: Compiler | Milestone: 7.8.1 Resolution: fixed | Version: 7.6.3 Operating System: Unknown/Multiple | Keywords: Type of failure: Incorrect warning at | Architecture: compile-time | Unknown/Multiple Test Case: T8101 | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Changes (by igloo): * status: new => closed * testcase: => T8101 * resolution: => fixed * milestone: => 7.8.1 Comment: Thanks for the report; fixed. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8101#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8101: No pattern match non-exhaustiveness warnings when compiling with -fno-code -------------------------------------------------+------------------------- Reporter: exbb2 | Owner: Type: bug | Status: Priority: normal | closed Component: Compiler | Milestone: 7.8.1 Resolution: fixed | Version: 7.6.3 Operating System: Unknown/Multiple | Keywords: Type of failure: Incorrect warning at | Architecture: compile-time | Unknown/Multiple Test Case: T8101 | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Comment (by monoidal): There's a comment in DynFlags, line 882, which might suggest this was deliberate. At least I would remove it: {{{ -- 'HscNothing' can be used to avoid generating any output, however, note -- that: -- -- * This will not run the desugaring step, thus no warnings generated in -- this step will be output. In particular, this includes warnings related -- to pattern matching. You can run the desugarer manually using -- 'GHC.desugarModule'. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8101#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8101: No pattern match non-exhaustiveness warnings when compiling with -fno-code -------------------------------------------------+------------------------- Reporter: exbb2 | Owner: Type: bug | Status: Priority: normal | closed Component: Compiler | Milestone: 7.8.1 Resolution: fixed | Version: 7.6.3 Operating System: Unknown/Multiple | Keywords: Type of failure: Incorrect warning at | Architecture: compile-time | Unknown/Multiple Test Case: T8101 | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Comment (by igloo): Hmm, thanks monoidal. It doesn't give a reason for that behaviour, so I've just removed the comment. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8101#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8101: No pattern match non-exhaustiveness warnings when compiling with -fno-code -------------------------------------------------+------------------------- Reporter: exbb2 | Owner: Type: bug | Status: Priority: normal | closed Component: Compiler | Milestone: 7.8.1 Resolution: fixed | Version: 7.6.3 Operating System: Unknown/Multiple | Keywords: Type of failure: Incorrect warning at | Architecture: compile-time | Unknown/Multiple Test Case: T8101 | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Comment (by ian@…): commit 9e185cc06d9efa833f7b0efdcf3a1d434781ceb6 {{{ Author: Ian Lynagh <ian@well-typed.com> Date: Sun Jul 28 18:49:07 2013 +0100 Remove an out-of-date comment (see #8101) compiler/main/DynFlags.hs | 5 ----- 1 file changed, 5 deletions(-) }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8101#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8101: No pattern match non-exhaustiveness warnings when compiling with -fno-code -------------------------------------+------------------------------------- Reporter: exbb2 | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: T8101 Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by DanielG): * status: closed => new * resolution: fixed => Comment: Looks to me like this is still an issue, I couldn't actually find a released version where this was ever fixed. This is also biting us in ghc-mod land: https://github.com/kazu-yamamoto /ghc-mod/issues/507 {{{ $ ghc-7.8.1 -fno-code -fforce-recomp A.hs [1 of 1] Compiling A ( A.hs, nothing ) $ ghc-7.8.4 -fno-code -fforce-recomp A.hs [1 of 1] Compiling A ( A.hs, nothing ) $ ghc-7.10.2 -fno-code -fforce-recomp A.hs [1 of 1] Compiling A ( A.hs, nothing ) # ghc-7.8.1 -fobject-code -fforce-recomp A.hs [1 of 1] Compiling A ( A.hs, A.o ) A.hs:7:9: Warning: Pattern match(es) are non-exhaustive In a case alternative: Patterns not matched: B C $ ghc-7.8.4 -fobject-code -fforce-recomp A.hs [1 of 1] Compiling A ( A.hs, A.o ) A.hs:7:9: Warning: Pattern match(es) are non-exhaustive In a case alternative: Patterns not matched: B C $ ghc-7.10.2 -fobject-code -fforce-recomp A.hs [1 of 1] Compiling A ( A.hs, A.o ) A.hs:7:9: Warning: Pattern match(es) are non-exhaustive In a case alternative: Patterns not matched: B C }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8101#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8101: No pattern match non-exhaustiveness warnings when compiling with -fno-code -------------------------------------+------------------------------------- Reporter: exbb2 | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: 7.6.3 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: T8101 Blocked By: | Blocking: Related Tickets: #10600 | Differential Revisions: -------------------------------------+------------------------------------- Changes (by rwbarton): * status: new => closed * resolution: => duplicate * related: => #10600 Comment: This was also recently reported in #10600, so closing in favor of that ticket. The fix here applied to one-shot mode (`-c`), but not make mode. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8101#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8101: No pattern match non-exhaustiveness warnings when compiling with -fno-code -------------------------------------+------------------------------------- Reporter: exbb2 | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: 7.6.3 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: T8101 Blocked By: | Blocking: Related Tickets: #10600 | Differential Rev(s): -------------------------------------+------------------------------------- Comment (by Edward Z. Yang <ezyang@…>): In [changeset:"427f8a15c385de486d479989ecfbb6f82699f405/ghc" 427f8a15/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="427f8a15c385de486d479989ecfbb6f82699f405" Deduplicate one-shot/make compile paths. Summary: We had a duplicate copy of the code for --make and for -c which was a pain. The call graph looked something like this: compileOne -> genericHscCompileGetFrontendResult -> genericHscFrontend hscCompileOneShot ---^ with genericHscCompileGetFrontendResult and hscCompileOneShot duplicating logic for deciding whether or not recompilation was needed. This patchset fixes it, so now everything goes through this call-chain: compileOne (--make entry point) Calls hscIncrementCompile, invokes the pipeline to do codegen and sets up linkables. hscIncrementalCompile (-c entry point) Calls hscIncrementalFrontend, and then simplifying, desugaring, and writing out the interface. hscIncrementalFrontend Performs recompilation avoidance, if recompilation needed, does parses typechecking. I also cleaned up some of the MergeBoot nonsense by introducing a FrontendResult type. NB: this BREAKS #8101 again, because I can't unconditionally desugar due to Haddock barfing on lint, see #10600 Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, bgamari, simonmar, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1302 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8101#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8101: No pattern match non-exhaustiveness warnings when compiling with -fno-code -------------------------------------+------------------------------------- Reporter: exbb2 | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: 7.6.3 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: T8101 Blocked By: | Blocking: Related Tickets: #10600 | Differential Rev(s): -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"baa18def0da17f11497fecc6fe440cf125b50878/ghc" baa18de/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="baa18def0da17f11497fecc6fe440cf125b50878" testsuite: add new test for desugar warnings/errors with -fno-code Add a new (expect_broken) test T10600 that checks that the error: Top-level bindings for unlifted types aren't allowed: is thrown when compiling with -fno-code. This test currently fails because modules compiled with -fno-code aren't desugared. There are several other errors which can be thrown during desugaring that aren't tested for, discoverable by grepping for "errDs". Update .stderr files T8101 and T8101b. Presumably the compilation output has changed slightly since they were written. Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #10600, #8101 Differential Revision: https://phabricator.haskell.org/D3533 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8101#comment:9> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC