#1316: add warning for local type signatures that use the same type variable 
names
as outer type signatures
------------------------------+---------------------------------------------
  Reporter:  Isaac Dupree     |          Owner:         
      Type:  feature request  |         Status:  new    
  Priority:  normal           |      Milestone:         
 Component:  Compiler         |        Version:  6.6.1  
  Severity:  normal           |       Keywords:         
Difficulty:  Unknown          |             Os:  Unknown
  Testcase:                   |   Architecture:  Unknown
------------------------------+---------------------------------------------
for a (poor) example,
 {{{
 f :: a -> a
 f x = x
    where
      g :: a  --this is (forall x. x) not the 'a' from f's type signature
              -- So, warn about this signature.
      g = undefined
 }}}
 Because it is likely to be confusing, as well as interfering with any
 possibility of the type variables being considered scoped by default.  In
 fact, this may be a helpful/explanatory message in cases where there will
 also be a type error due to the type variables not actually being scoped.
 (although, detecting those cases particularly and giving a recommended
 solution for how to give such a type signature, would be a more difficult
 endeavor (what to recommend?))

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