Skip to content
  • Georgios Karachalias's avatar
    Exhaustiveness check for EmptyCase (Trac #10746) · b1035321
    Georgios Karachalias authored and Ben Gamari's avatar Ben Gamari committed
    Empty case expressions have strict semantics so the problem boils down
    to inhabitation checking for the type of the scrutinee. 3 main functions
    added:
    
    - pmTopNormaliseType_maybe for the normalisation of the scrutinee type
    
    - inhabitationCandidates for generating the possible patterns of the
      appropriate type
    
    - checkEmptyCase' to filter out the candidates that give rise to
      unsatisfiable constraints.
    
    See Note [Checking EmptyCase Expressions] in Check
    and Note [Type normalisation for EmptyCase] in FamInstEnv
    
    Test Plan: validate
    
    Reviewers: simonpj, goldfire, dfeuer, austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: mpickering, thomie
    
    Differential Revision: https://phabricator.haskell.org/D2105
    
    GHC Trac Issues: #10746
    b1035321