#2588: Missed suggestion with context on foralls
-----------------------------+----------------------------------------------
    Reporter:  NeilMitchell  |       Owner:          
        Type:  bug           |      Status:  new     
    Priority:  normal        |   Component:  Compiler
     Version:  6.9           |    Severity:  normal  
    Keywords:                |    Testcase:          
Architecture:  Unknown       |          Os:  Unknown 
-----------------------------+----------------------------------------------
 Given the program:

 {{{
 module Test where
 test :: forall a . a -> a
 test = id
 }}}

 I get the nice and helpful error message:

 {{{
 Test.hs:3:17:
     Illegal operator `.' in type `forall a . (a -> a)'
       Perhaps you intended to use -XRankNTypes or similar flag
       to enable explicit-forall syntax: forall <tvs>. <type>
 }}}

 [I personally usually want ScopedTypeVariables rather than RankNTypes, but
 its still a very useful hint at where to look]

 However, trying the program:

 {{{
 module Test where
 test :: forall a . Eq a => a -> a
 test = id
 }}}

 Gives:

 {{{
 Test.hs:3:24: parse error on input `=>'
 }}}

 I think it would be helpful to give the same suggestion as above.

 -- Neil

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2588>
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

Reply via email to