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

#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

#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 Resolution: | 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: | -------------------------------------+------------------------------------- Description changed by lyxia: Old description:
`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
}}}
New description: `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 of `ghc C.hs`: {{{ 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#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 Resolution: | Keywords: ORF 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: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * keywords: => ORF -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14953#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 Resolution: | Keywords: ORF 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: | -------------------------------------+------------------------------------- Changes (by simonpj): * cc: adamgundry, mpickering (added) Comment: Matthew or Adam: might you look? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14953#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14953: Panic when exporting duplicate record fields from separate modules -------------------------------------+------------------------------------- Reporter: lyxia | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.5 Resolution: | Keywords: ORF Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: crash or panic | overloadedrecflds/should_fail/T14953 Blocked By: | Blocking: Related Tickets: #13352 | Differential Rev(s): Phab:D4527 Wiki Page: | -------------------------------------+------------------------------------- Changes (by adamgundry): * testcase: => overloadedrecflds/should_fail/T14953 * status: new => patch * differential: => Phab:D4527 * related: => #13352 * milestone: => 8.6.1 Comment: Fixing the panic was comparatively straightforward, though there is a bigger issue here that re-exports of duplicate record fields are prohibited in surprising cases (see #13352). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14953#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14953: Panic when exporting duplicate record fields from separate modules
-------------------------------------+-------------------------------------
Reporter: lyxia | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone: 8.6.1
Component: Compiler | Version: 8.5
Resolution: | Keywords: ORF
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: Compile-time | Test Case:
crash or panic | overloadedrecflds/should_fail/T14953
Blocked By: | Blocking:
Related Tickets: #13352 | Differential Rev(s): Phab:D4527
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#14953: Panic when exporting duplicate record fields from separate modules -------------------------------------+------------------------------------- Reporter: lyxia | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.5 Resolution: fixed | Keywords: ORF Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Compile-time | Test Case: crash or panic | overloadedrecflds/should_fail/T14953 Blocked By: | Blocking: Related Tickets: #13352 | Differential Rev(s): Phab:D4527 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed Old description:
`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 of `ghc C.hs`:
{{{ 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
}}}
New description: `A.hs` {{{#!hs {-# LANGUAGE DuplicateRecordFields #-} module A where data R = R {unR :: Int} }}} --- `B.hs` {{{#!hs {-# LANGUAGE DuplicateRecordFields #-} module B where data R = R {unR :: Int} }}} --- `C.hs` {{{#!hs {-# LANGUAGE DuplicateRecordFields #-} module C (module A, module B) where import A import B }}} --- Output of `ghc C.hs`: {{{ 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#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC