id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
1813	Strange type representation bug with phantom type synonyms in interactive mode	guest	igloo	"Sorry for the confusing summary 

The following module defines a phatom type synonym and a simple function

{{{
module Phantom where

type PhantomSyn a  = Int

f = (\_ -> 2) :: PhantomSyn a -> Int
}}}

When running in interactive mode (the bug doesn't seem to be reproducible otherwise) the typechecker gives a strange error


{{{
./ghc-inplace  --interactive /tmp/Phantom.hs
GHCi, version 6.9.20071025: http://www.haskell.org/ghc/  :? for help
Loading package base ... linking ... done.
[1 of 1] Compiling Phantom          ( /tmp/Phantom.hs, interpreted )
Ok, modules loaded: Phantom.
*Phantom> f ""incorrectParam""

<interactive>:1:2:
    Couldn't match expected type `PhantomSyn GHC.Prim.Any'
           against inferred type `[Char]'
      Expected type: PhantomSyn GHC.Prim.Any
      Inferred type: [Char]
    In the first argument of `f', namely `""incorrectParam""'
    In the expression: f ""incorrectParam""
}}}

The typechecker  should  output 


{{{
Expected type: PhantomSyn a
}}}


If I skip the interactive mode (including the erroneous declaration in the Phantom.hs itself) or I define f as

{{{
f :: PhantomSyn a -> Int
f = (\_ -> 2)
}}}

The incorrect error report disappears.
"	merge	closed	normal	6.10 branch	GHCi	6.9	fixed		alfonso.acosta@…	Unknown/Multiple	Unknown/Multiple		Unknown	tcfail186			
