Skip to content
  • Simon Peyton Jones's avatar
    Improve error reporting for non-rigid GADT matches · 259d5ea8
    Simon Peyton Jones authored
    Following suggestions from users, this patch improves the error message
    when a GADT match needs a rigid type:
    
     tcfail172.hs:19:10:
         GADT pattern match in non-rigid context for `Nil'
    -      Solution: add a type signature
    +      Probable solution: add a type signature for `is_normal'
         In the pattern: Nil
         In the definition of `is_normal': is_normal Nil = True
    
    Now GHC tries to tell you what to give a type signature *for*.
    Thanks to Daniel Gorin and others for the suggestions.
    259d5ea8