Skip to content
  • Simon Peyton Jones's avatar
    Reject bad 'deriving' directives (fixes Trac #5287) · 49861e71
    Simon Peyton Jones authored
    The 'deriving' mechanism that infers the context for
    an instance declarations was going into a loop, as a
    result of an instance like
           instance C a b => D [a]
    where the 'b' isn't mentioned in the head.
    
    This patch identifies those cases.  I also needed to make
    TcErrors generate a suitable error message.  On the way
    I improved the reporting of "ambiguous" variables;
    for example arrowfail001 now generates a better message.
    49861e71