Skip to content
  • Ryan Scott's avatar
    Fix #14125 by normalizing data family instances more aggressively · 6982ee99
    Ryan Scott authored
    Summary:
    Commit 3540d1e1 inadvertently broke
    the ability for newtype instances to be used as marshallable types in FFI
    declarations. The reason is a bit silly: an extra check was added for type
    synonyms with no type families on the RHS in `normalise_tc_app`, but this check
    would only skip over type families, not //data// families, since the predicate
    being used was `not . isTypeFamilyCon`.
    
    The fix is simple: just use `not . isFamilyCon` instead so that data families
    are also skipped by this check.
    
    Test Plan: make test TEST=T14125
    
    Reviewers: goldfire, simonpj, austin, bgamari
    
    Reviewed By: simonpj
    
    Subscribers: rwbarton, thomie
    
    GHC Trac Issues: #14125
    
    Differential Revision: https://phabricator.haskell.org/D3865
    6982ee99