Opened 9 years ago

Closed 9 years ago

#3154 closed bug (duplicate)

Type families bug with data family instances

Reported by: elliottt Owned by:
Priority: normal Milestone:
Component: Compiler (Type checker) Version: 6.10.2
Keywords: type families Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


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, and 6.10.2.

% ghci test.hs
GHCi, version 6.10.2:  :? 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
*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:
zsh: abort      ghci test.hs

Change History (1)

comment:1 Changed 9 years ago by elliottt

Resolution: duplicate
Status: newclosed

Duplicate of #3150

Note: See TracTickets for help on using tickets.