Changes between Initial Version and Version 1 of Ticket #3100


Ignore:
Timestamp:
Mar 16, 2009 3:58:19 PM (5 years ago)
Author:
simonpj
Comment:

Can you give me a self-contained repro case? I'm much more likely to fix this if I can do it without downloading all of Happs.

Usually it's just a case of figuring out what the imports are, and replacing

 import Wurble

by

 f :: (?x:Int) => Int -> Int
 f = error "urk"

For what it's worth, the only way I can see that this crash can arise is if you are reifying the type of an instance declaration. For example, from the decl

class Foo a where
   op1 :: a -> a
   op2 :: a -> Int

instance Foo a => Foo [a] where ...

GHC generates a data type from the class decl, and a function from the instance thus:

data TFoo a = MkTFoo (a->a) (a->Int)
  
dfEqList :: forall a. TFoo a -> TFoo [a]

In trying to convert this back into TH syntax in 'reifyType' it can convert the TFoo on the left of the arrow to Foo =>, but it gets stuck with the TFoo on the right.

Crashing is unhelpful I grant you. Maybe I should just return TFoo (it's actually more like :TFoo so as to avoid name clashes with your other data types)? But I'm still a bit unsure how yo managed to provoke this case. More info needed pls, on (a) repro case, (b) desired result.

Simon

Thanks

Simon

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3100

    • Property Difficulty changed from to Unknown
  • Ticket #3100 – Description

    initial v1  
     1{{{ 
    12Exception when trying to run compile-time code: 
    23  ghc: panic! (the 'impossible' happened) 
    34(GHC version 6.10.1 for x86_64-unknown-linux): 
    45      reifyType PredTy 
    5  
     6}}} 
    67Code reproducing this bug can be found at: 
    78http://hpaste.org/fastcgi/hpaste.fcgi/view?id=2419