#4875: ghc misdiagnoses a compile time error concerning parameterized types
------------------------------------------+---------------------------------
  Reporter:  Stef Joosten                 |          Owner:  simonpj         
      Type:  bug                          |         Status:  closed          
  Priority:  normal                       |      Milestone:  7.2.1           
 Component:  Compiler                     |        Version:  6.12.3          
Resolution:  fixed                        |       Keywords:                  
  Testcase:  typecheck/should_fail/T4875  |      Blockedby:                  
Difficulty:                               |             Os:  Windows         
  Blocking:                               |   Architecture:  Unknown/Multiple
   Failure:  Other                        |  
------------------------------------------+---------------------------------

Comment(by simonpj):

 Oops I missed out the commit message:
 {{{
 Mon Jan 10 11:03:51 GMT 2011  [email protected]
   * Do dependency analysis when kind-checking type declarations

   This patch fixes Trac #4875.  The main point is to do dependency
   analysis on type and class declarations, and kind-check them in
   dependency order, so as to improve error messages.

   This patch means that a few programs that would typecheck before won't
   typecheck any more; but before we were (naughtily) going beyond
   Haskell 98 without any language-extension flags, and Trac #4875
   convinces me that doing so is a Bad Idea.

   Here's an example that won't typecheck any more
          data T a b = MkT (a b)
          type F k = T k Maybe

   If you look at T on its own you'd default 'a' to kind *->*;
   and then kind-checking would fail on F.

   But GHC currently accepts this program beause it looks at
   the *occurrences* of T.

     M ./compiler/deSugar/DsMeta.hs -1 +1
     M ./compiler/hsSyn/HsDecls.lhs -2 +8
     M ./compiler/hsSyn/HsUtils.lhs -3 +4
     M ./compiler/rename/RnNames.lhs -1 +1
     M ./compiler/rename/RnSource.lhs -11 +52
     M ./compiler/typecheck/TcInstDcls.lhs -1 +1
     M ./compiler/typecheck/TcRnDriver.lhs -5 +5
     M ./compiler/typecheck/TcTyClsDecls.lhs -224 +139
     M ./compiler/typecheck/TcTyDecls.lhs +37
     M ./utils/ghctags/Main.hs -1 +1
 }}}

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