Opened 5 years ago

Closed 5 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: Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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

Change History (1)

comment:1 Changed 5 years ago by elliottt

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #3150

Note: See TracTickets for help on using tickets.