#1376: panic caused in ghci by the following code involving monad transformers
---------------------------------------+------------------------------------
Reporter: [EMAIL PROTECTED] | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 6.8
Component: Compiler | Version: 6.6.1
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Os: MacOS X | Testcase:
Architecture: powerpc |
---------------------------------------+------------------------------------
Changes (by simonmar):
* milestone: => 6.8
Comment:
I've narrowed this down further, to a probable bug in the typechecker.
Core lint finds the error, and GHCi isn't required. Code:
{{{
h :: f a b -> f a b
h x = x
main = print (h ['a'])
}}}
yields:
{{{
*** Core Lint Errors: in result of Desugar ***
<no location info>:
In the expression: Main.main @ (GHC.IOBase.IO ())
Main.main is out of scope
*** Offending Program ***
Rec {
:Main.main :: GHC.IOBase.IO ()
[Exported]
[]
:Main.main = GHC.TopHandler.runMainIO @ () (Main.main @ (GHC.IOBase.IO
()))
Main.h :: forall (f_ada :: * -> * -> *) a_adb b_adc.
f_ada a_adb b_adc -> f_ada a_adb b_adc
[]
Main.h =
\ (@ f_adr) (@ a_ads) (@ b_adt) ->
__letrec {
h_adu :: f_adr a_ads b_adt -> f_adr a_ads b_adt
[]
h_adu = \ (x_adg :: f_adr a_ads b_adt) -> x_adg;
} in h_adu
end Rec }
*** End of Offense ***
}}}
The binding for `main` has been thrown away. HEAD gives a type error
(correctly, I guess). The problem manifests in GHCi as a missing binding
for `it`, which leads to the `nameModule` panic.
Is this a bug in 6.6.1's typechecker?
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1376>
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