#2761: type checker bug
-------------------------------------+--------------------------------------
Reporter: guest | Owner:
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler (Type checker) | Version: 6.8.3
Severity: normal | Resolution: invalid
Keywords: | Difficulty: Unknown
Testcase: | Architecture: Unknown/Multiple
Os: Unknown/Multiple |
-------------------------------------+--------------------------------------
Changes (by igloo):
* status: new => closed
* resolution: => invalid
Comment:
Thanks for the report! However, the types are not equivalent, e.g. this
fails to typecheck:
{{{
foo :: forall b. (b -> String, Int)
foo = undefined
x :: (String, String)
x = case foo of
(f, _) -> (f 'a', f True)
}}}
with:
{{{
Couldn't match expected type `Char' against inferred type `Bool'
In the first argument of `f', namely `True'
In the expression: f True
In the expression: (f 'a', f True)
}}}
but this does typecheck:
{{{
bar :: (forall b. b -> String, Int)
bar = undefined
x :: (String, String)
x = case bar of
(f, _) -> (f 'a', f True)
}}}
(with `-XImpredicativeTypes -XRank2Types`)
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2761#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs