fromDynamic crashes ghci
|Reported by:||apfeffer||Owned by:||nobody|
|Type of failure:||Test Case:|
|Related Tickets:||Differential Rev(s):|
Loading the following code into ghci and evaluating x causes a segmentation fault: data Foo a = Foo a instance Typeable (Foo a) where typeOf x = mkAppTy (mkTyCon "BAD")  x :: Maybe (Foo Char) x = fromDynamic (toDyn (Foo "abc")) This is not a problem for ghc. The version of ghci is 5.00.2 I'm running on linux, not sure what vintage I'm afraid. By the way, the reason I wrote this code was because I was trying to figure out what role the type string plays in the Dynamic library. The documentation seems to indicate that it is checked for equality every time fromDyn or fromDynamic is called, but that doesn't seem to be the case. More documentation on what the string does, and how to construct it correctly, would be appreciated. I was trying to figure out if I could make this type Typeable: data Name a = String
Change History (1)
Note: See TracTickets for help on using tickets.