[GHC] #15214: Redefining (~) yields a baffling error message

GHC ghc-devs at haskell.org
Fri Jun 1 23:39:30 UTC 2018


#15214: Redefining (~) yields a baffling error message
-------------------------------------+-------------------------------------
           Reporter:  RyanGlScott    |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:  8.6.1
          Component:  Compiler       |           Version:  8.4.3
           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:
-------------------------------------+-------------------------------------
 Running this code:

 {{{#!hs
 {-# LANGUAGE TypeOperators #-}
 module Bug where

 type (~) = Either
 }}}

 Yields a rather strange error:

 {{{
 $ /opt/ghc/8.4.3/bin/ghci Bug2.hs
 GHCi, version 8.4.3: http://www.haskell.org/ghc/  :? for help
 Loaded GHCi configuration from /home/rgscott/.ghci
 [1 of 1] Compiling Bug              ( Bug2.hs, interpreted )

 Bug2.hs:4:1: error:
     Cannot redefine a Name retrieved by a Template Haskell quote: ~
   |
 4 | type (~) = Either
   | ^^^^^^^^^^^^^^^^^
 }}}

 Since Template Haskell certainly isn't involved here.

 The culprit is that `(~)` isn't listed within `isBuiltInOcc_maybe`. Patch
 incoming.

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


More information about the ghc-tickets mailing list