#5912: exporting while having defined a non-nullary promoted type synonym causes
panic
--------------------------------+-------------------------------------------
 Reporter:  guest               |          Owner:                         
     Type:  bug                 |         Status:  new                    
 Priority:  normal              |      Component:  Compiler               
  Version:  7.4.1               |       Keywords:  promoted synonym       
       Os:  Linux               |   Architecture:  x86_64 (amd64)         
  Failure:  Compile-time crash  |       Testcase:  http://hpaste.org/64692
Blockedby:                      |       Blocking:                         
  Related:                      |  
--------------------------------+-------------------------------------------
 {{{
 {-# LANGUAGE DataKinds #-}

 module Bug(loop) where

 data UnaryTypeC a = UnaryDataC a

 type Bug = 'UnaryDataC

 loop = loop
 }}}

 produces

 {{{
 ghc Bug.hs
 [1 of 1] Compiling Bug              ( Bug.hs, Bug.o )
 ghc: panic! (the 'impossible' happened)
   (GHC version 7.4.1 for x86_64-unknown-linux):
         urk! lookup local fingerprint main:Bug.UnaryDataC{d r0}
 }}}

 it won't panic if either:[[BR]]

 1. the export is removed[[BR]]
 2. the data constructor (UnaryDataC) is nullary[[BR]]
 3. there is no type synonym defined [[BR]]

 a verbose run:

 {{{
 ghc -v -dcore-lint Bug.hs
 Glasgow Haskell Compiler, Version 7.4.1, stage 2 booted by GHC version
 7.0.3
 Using binary package database:
 /usr/lib/ghc-7.4.1/package.conf.d/package.cache
 Using binary package database:
 /home/exfalso/.ghc/x86_64-linux-7.4.1/package.conf.d/package.cache
 wired-in package ghc-prim mapped to ghc-
 prim-0.2.0.0-c2ff696e5b8ec4d4b2bc2e42085fe471
 wired-in package integer-gmp mapped to integer-
 gmp-0.4.0.0-3cccac07aef8e27023f605c1f45bdf74
 wired-in package base mapped to
 base-4.5.0.0-6db966b4cf8c1a91188e66d354ba065e
 wired-in package rts mapped to builtin_rts
 wired-in package template-haskell mapped to template-
 haskell-2.7.0.0-133c0fdb189e05de22bd926d39f99fe3
 wired-in package dph-seq not found.
 wired-in package dph-par not found.
 Hsc static flags: -static
 *** Chasing dependencies:
 Chasing modules from: *Bug.hs
 Stable obj: []
 Stable BCO: []
 Ready for upsweep
   [NONREC
       ModSummary {
          ms_hs_date = Sat Mar  3 16:40:21 GMT 2012
          ms_mod = main:Bug,
          ms_textual_imps = [import (implicit) Prelude]
          ms_srcimps = []
       }]
 *** Deleting temp files:
 Deleting:
 compile: input file Bug.hs
 Created temporary directory: /tmp/ghc21075_0
 *** Checking old interface for main:Bug:
 [1 of 1] Compiling Bug              ( Bug.hs, Bug.o )
 *** Parser:
 *** Renamer/typechecker:
 *** Desugar:
 Result size of Desugar (after optimization) = 5
 *** Core Linted result of Desugar (after optimization):
 *** Simplifier:
 Result size of Simplifier iteration=1 = 8
 *** Core Linted result of Simplifier:
 Result size of Simplifier = 8
 *** Core Linted result of Simplifier:
 *** Tidy Core:
 Result size of Tidy Core = 8
 *** Core Linted result of Tidy Core:
 *** Deleting temp files:
 Deleting: /tmp/ghc21075_0/ghc21075_0.s
 Warning: deleting non-existent /tmp/ghc21075_0/ghc21075_0.s
 *** Deleting temp dirs:
 Deleting: /tmp/ghc21075_0
 ghc: panic! (the 'impossible' happened)
   (GHC version 7.4.1 for x86_64-unknown-linux):
         urk! lookup local fingerprint main:Bug.UnaryDataC{d r9J}
 }}}

 system:

 {{{
 $ uname -a
 Linux QuodLibet 3.2.8-1-ARCH #1 SMP PREEMPT Mon Feb 27 21:51:46 CET 2012
 x86_64 Intel(R) Core(TM)2 Duo CPU T6500 @ 2.10GHz GenuineIntel GNU/Linux
 $ gcc --version
 gcc (GCC) 4.6.2 20120120 (prerelease)
 }}}

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

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to