[GHC] #13840: Pattern matching duplicated record fields

#13840: Pattern matching duplicated record fields -------------------------------------+------------------------------------- Reporter: lapdot | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Keywords: | Operating System: Linux Architecture: x86_64 | Type of failure: Compile-time (amd64) | crash or panic Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- GHC panic during compiling pattern matching with duplicated record fields. The following is a short example. Main module: {{{#!hs module Lib ( someFunc ) where import F1 import qualified F2 r :: F2.T2 r = F2.T2 { F2.foo = "ok" } someFunc :: IO () someFunc = case r of F2.T2{ foo = a } -> putStrLn a }}} The first submodule: {{{#!hs module F1 ( T1(..) ) where newtype T1 = T1 { foo :: String } }}} The second submodule: {{{#!hs module F2 ( T2(..) ) where newtype T2 = T2 { foo :: String } }}} GHC compiles the modules successfully if uses DuplicateRecordFields. The modules may be not correct without DuplicateRecordFields. But GHC should show an error message other than panic. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13840 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13840: Pattern matching duplicated record fields -------------------------------------+------------------------------------- Reporter: lapdot | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: duplicate | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: #13644 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * resolution: => duplicate * related: => #13644 Comment: To be clear, this is the panic you get: {{{ GHCi, version 8.2.0.20170523: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rgscott/.ghci [1 of 3] Compiling F1 ( F1.hs, interpreted ) [2 of 3] Compiling F2 ( F2.hs, interpreted ) [3 of 3] Compiling Lib ( Lib.hs, interpreted ) ghc: panic! (the 'impossible' happened) (GHC version 8.2.0.20170523 for x86_64-unknown-linux): translateConPatVec: lookup }}} Closing as a duplicate of #13644. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13840#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC