[GHC] #12548: Exported pattern synonyms does not mark top-level bindings in RHS as used
#12548: Exported pattern synonyms does not mark top-level bindings in RHS as used -------------------------------------+------------------------------------- Reporter: pkmx | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple PatternSynonyms | Architecture: | Type of failure: Incorrect Unknown/Multiple | warning at compile-time Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- {{{#!hs {-# LANGUAGE PatternSynonyms #-} module Foo (pattern P) where x :: Int x = 0 pattern P :: Int pattern P <- _ where P = x }}} gives: {{{ Foo.hs:6:1: warning: [-Wunused-top-binds] Defined but not used: ‘x’ }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12548> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12548: Exported pattern synonyms does not mark top-level bindings in RHS as used -------------------------------------+------------------------------------- Reporter: pkmx | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | PatternSynonyms, newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * keywords: PatternSynonyms => PatternSynonyms, newcomer -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12548#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12548: Exported pattern synonyms does not mark top-level bindings in RHS as used -------------------------------------+------------------------------------- Reporter: pkmx | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | PatternSynonyms, newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Simon Peyton Jones <simonpj@…>): In [changeset:"6305674f310633d159a4df4e2e0d033a698599d1/ghc" 6305674/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="6305674f310633d159a4df4e2e0d033a698599d1" Fix used-variable calculation (Trac #12548) The used-variable calculation for pattern synonyms is a little tricky, for reasons described in RnBinds Note [Pattern synonym builders don't yield dependencies] It was right semantically, but the "unused-variable warning" was wrong, which led to Trac #12548. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12548#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12548: Exported pattern synonyms does not mark top-level bindings in RHS as used -------------------------------------+------------------------------------- Reporter: pkmx | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: | PatternSynonyms, newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Incorrect | Test Case: warning at compile-time | rename/should_compile/T12548 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * testcase: => rename/should_compile/T12548 * resolution: => fixed Comment: Thanks for the example! -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12548#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC