#1123: forall not hoisted properly
-----------------------------------------------------+----------------------
Reporter: Ashley Yakeley <[EMAIL PROTECTED]> | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 6.6
Severity: normal | Keywords:
Difficulty: Unknown | Testcase:
Architecture: Unknown | Os: Unknown
-----------------------------------------------------+----------------------
Try compiling this:
{{{
{-# OPTIONS -fglasgow-exts #-}
module Bug where
data T a = MkT
out :: forall a. T a -> ()
out MkT = ()
inHoisted :: forall r. () -> (forall a. T a -> r) -> r
inHoisted _ foo = foo MkT
inUnhoisted :: () -> forall r. (forall a. T a -> r) -> r
inUnhoisted _ foo = foo MkT
testHoisted :: ()
testHoisted = inHoisted () out
testUnhoisted :: ()
testUnhoisted = inUnhoisted () out
}}}
Results:
{{{
Bug.hs:18:17:
Couldn't match expected type `T a -> ()'
against inferred type `forall a1. T a1 -> r'
Expected type: (T a -> ()) -> ()
Inferred type: (forall a1. T a1 -> r) -> r
In the expression: inUnhoisted () out
In the definition of `testUnhoisted':
testUnhoisted = inUnhoisted () out
}}}
Expected:
testUnhoisted to compile, just like testHoisted
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1123>
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