Skip to content

add warning for local type signatures that use the same type variable names as outer type signatures

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?))

Trac metadata
Trac field Value
Version 6.6.1
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information