> The new GHC lexer contains some small bugs:
> 
> -- Foo.hs ------------------------------------------------------------
> module Foo where
> forall :: Int
> forall = 1
> -- Main.hs -----------------------------------------------------------
> import Foo
> main :: IO ()
> main = print forall
> ----------------------------------------------------------------------
> panne@liesl:~ > ghc -Wall -c Foo.hs
> ghc: module version changed to 1; reason: no old .hi file
> panne@liesl:~ > ghc -Wall -c Main.hs
> 
> ParseIface.hs:6496: Non-exhaustive patterns in case
> ----------------------------------------------------------------------
> 
> Similar games can be played with the identifiers foreign, export,
> label, dynamic, unsafe, ...

Fixed, although I could only find bugs for 'forall' and 'foreign', the rest
seem to be ok.

> And a small quiz: What's wrong with the following program?  :-)
> (no EOL after the 1)
> 
> -- Main.hs -----------------------------------------------------------
> main = print 1
> ----------------------------------------------------------------------
> panne@liesl:~ > ghc -c Main.hs
> 
> Main.hs:1:
>     Couldn't match `IO t' against `a -> IO ()'
>       Expected type: IO t
>       Inferred type: a -> IO ()
>     When checking that `main' has the required type
> 
> Compilation had errors

Fixed.

Cheers,
        Simon

Reply via email to