Skip to content
  • Richard Eisenberg's avatar
    Refactor checking for GADT-like datacons' return types · 3cd1360f
    Richard Eisenberg authored
    This check is somewhat subtle. See Note [Checking GADT return types]
    in TcTyClsDecls. The new plan is to check *before* desugaring the type
    from HsType to Type. This avoids problems with the pattern-match
    in rejigConRes.
    
    As a nice side benefit to this, I discovered that Template Haskell
    splices were a little conservative in their treatment of valid data
    constructors. (For example, a kind signature in the return type caused
    failure.) Now, the TH code uses exactly the same function as the
    "real" code, which is nice. See hsTyGetAppHead_maybe in HsTypes.
    3cd1360f