• simonpj@microsoft.com's avatar
    Improve error reporting for non-rigid GADT matches · 259d5ea8
    simonpj@microsoft.com authored
    Following suggestions from users, this patch improves the error message
    when a GADT match needs a rigid type:
         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.
HsExpr.lhs 42.7 KB