#3154: Type families bug with data family instances
--------------------------+-------------------------------------------------
Reporter: elliottt | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler (Type checker)
Version: 6.10.2 | Severity: major
Keywords: type families | Testcase:
Os: Linux | Architecture: x86_64 (amd64)
--------------------------+-------------------------------------------------
This data family definition led to the ability to define a generic cast:
{{{
{-# LANGUAGE TypeFamilies #-}
data family T a b t
data instance T a b t = L a
data instance T a b () = R b
cast :: a -> b
cast x = let L i = R x in i
get :: IO Char
get = cast ()
}}}
This bug was observed in ghc version 6.10.1, 6.10.1.20090326 and 6.10.2.
{{{
% ghci test.hs
GHCi, version 6.10.2: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ... done.
[1 of 1] Compiling Main ( test.hs, interpreted )
Ok, modules loaded: Main.
*Main> get
'\4312564'
*Main> get
<interactive>: internal error: stg_ap_v_ret
(GHC version 6.10.2 for x86_64_unknown_linux)
Please report this as a GHC bug:
http://www.haskell.org/ghc/reportabug
zsh: abort ghci test.hs
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3154>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs