[GHC] #14953: Panic when exporting duplicate record fields from separate modules

GHC ghc-devs at haskell.org
Wed Mar 21 03:17:04 UTC 2018


#14953: Panic when exporting duplicate record fields from separate modules
-------------------------------------+-------------------------------------
           Reporter:  lyxia          |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.5
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  Compile-time
  Unknown/Multiple                   |  crash or panic
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 `A.hs`

 {{{
 {-# LANGUAGE DuplicateRecordFields #-}
 module A where
 data R = R {unR :: Int}
 }}}

 ---

 `B.hs`

 {{{
 {-# LANGUAGE DuplicateRecordFields #-}
 module B where
 data R = R {unR :: Int}
 }}}

 ---

 `C.hs`

 {{{
 {-# LANGUAGE DuplicateRecordFields #-}

 module C (module A, module B) where

 import A
 import B
 }}}

 ---

 Output:

 {{{
 C.hs:3:21: error:ghc-stage2: panic! (the 'impossible' happened)
   (GHC version 8.5.20180224 for x86_64-unknown-linux):
         exportClashErr
   $sel:unR:R
   Call stack:
       CallStack (from HasCallStack):
         callStackDoc, called at compiler/utils/Outputable.hs:1150:37 in
 ghc:Outputable
         pprPanic, called at compiler/typecheck/TcRnExports.hs:740:22 in
 ghc:TcRnExports

 }}}

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


More information about the ghc-tickets mailing list