[GHC] #14315: GHC panic caused by destructuring with qualified name
GHC
ghc-devs at haskell.org
Wed Oct 4 14:19:37 UTC 2017
#14315: GHC panic caused by destructuring with qualified name
-------------------------------------+-------------------------------------
Reporter: bloxx | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.2.1
Resolution: | Keywords:
Operating System: Linux | Architecture: Other
Type of failure: Compile-time | Test Case:
crash or panic |
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Changes (by bloxx):
* architecture: Unknown/Multiple => Other
Old description:
> I have a cabal project with the following files:
> {{{#!hs
> -- src/Alt.hs
> module Alt where
>
> data Pizza = Pizza { filling :: String }
>
> -- ===========
> -- src/Main.hs
> module Main where
>
> import qualified Alt as A
>
> data Pizza = Pizza { filling :: String }
>
> unpizza :: A.Pizza -> String
> -- to fix it, replace "filling" with "A.filling"
> unpizza A.Pizza { filling = filling } = filling
>
> main :: IO ()
> main = putStrLn "Hello Haskell!"
> }}}
>
> Of course, this is not valid code. "filling" belongs to "Pizza" and
> "A.filling" belongs to "A.Pizza". But it causes a panic in GHC 8.2.1
> instead of an error, so I suppose it is a bug. Can you reproduce this
> behavior?
New description:
I have a cabal project with the following files:
{{{#!hs
-- src/Alt.hs
module Alt where
data Pizza = Pizza { filling :: String }
-- ===========
-- src/Main.hs
module Main where
import qualified Alt as A
data Pizza = Pizza { filling :: String }
unpizza :: A.Pizza -> String
-- to fix it, replace "filling" with "A.filling"
unpizza A.Pizza { filling = filling } = filling
main :: IO ()
main = putStrLn "Hello Haskell!"
}}}
Of course, this is not valid code. "filling" belongs to "Pizza" and
"A.filling" belongs to "A.Pizza". But it causes a panic in GHC 8.2.1
instead of an error, so I suppose it is a bug. Can you reproduce this
behavior?
Edit: GHC tells me:
<no location info>: error:
ghc: panic! (the 'impossible' happened)
(GHC version 8.2.1 for x86_64-unknown-linux):
translateConPatVec: lookup
--
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14315#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list