Skip to content
  • Ryan Scott's avatar
    Provide a better error message for unpromotable data constructor contexts · c6375411
    Ryan Scott authored
    Trac #14845 brought to light a corner case where a data
    constructor could not be promoted (even with `-XTypeInType`) due to
    an unpromotable constraint in its context. However, the error message
    was less than helpful, so this patch adds an additional check to
    `tcTyVar` catch unpromotable data constructors like these //before//
    they're promoted, and to give a sensible error message in such cases.
    
    Test Plan: make test TEST="T13895 T14845"
    
    Reviewers: simonpj, goldfire, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie, carter
    
    GHC Trac Issues: #13895, #14845
    
    Differential Revision: https://phabricator.haskell.org/D4728
    c6375411