• Andrew Farmer's avatar
    Fix deriving Ord when RebindableSyntax is enabled · 527ed724
    Andrew Farmer authored
    Deriving clauses (Ord especially) generated if-expressions with nlHsIf
    which were subject to RebindableSyntax. This changes nlHsIf to generate
    concrete if-expressions.
    There was also an error about calling tagToEnum# at a polymorphic type,
    which is not allowed. Fixing nlHsIf didn't fix this for some reason, so
    I generated a type ascription around the call to tagToEnum#. Not sure
    why the typechecker could not figure this out.
    Test Plan: Added a test, ran validate.
    Reviewers: simonpj, simonmar, austin, bgamari
    Reviewed By: bgamari
    Subscribers: thomie
    Differential Revision: https://phabricator.haskell.org/D2247
    GHC Trac Issues: #12080
TcGenDeriv.hs 115 KB