[GHC] #12615: Record pattern synonyms cause spurious name shadowing warnings

GHC ghc-devs at haskell.org
Sat Sep 24 14:05:59 UTC 2016


#12615: Record pattern synonyms cause spurious name shadowing warnings
-------------------------------------+-------------------------------------
           Reporter:  gelisam        |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           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:
-------------------------------------+-------------------------------------
 The example given in the
 [https://downloads.haskell.org/~ghc/8.0.1/docs/html/users_guide/glasgow_exts.html
 #record-pattern-synonyms documentation] gives a warning when compiled with
 `-Wall`:

 {{{#!hs
 {-# LANGUAGE PatternSynonyms #-}
 {-# OPTIONS_GHC -Wall #-}
 module Test where

 -- Test.hs:13:24: warning: [-Wname-shadowing]
 --     This binding for ‘x’ shadows the existing binding
 --       defined at Test.hs:13:15
 --
 -- Test.hs:13:27: warning: [-Wname-shadowing]
 --     This binding for ‘y’ shadows the existing binding
 --       defined at Test.hs:13:18
 pattern Point :: Int -> Int -> (Int, Int)
 pattern Point{x, y} = (x, y)
 }}}

 I don't see anything being shadowed here, so I don't think GHC should
 produce these warnings.


 Also, the type signature for that example in the documentation is `pattern
 Point :: (Int, Int)`, which doesn't compile. Should I file a separate bug
 for that?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12615>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list