Skip to content
  • Ryan Scott's avatar
    Don't warn when empty casing on Type · a267580e
    Ryan Scott authored
    Summary:
    `Type` (a.k.a. `TYPE LiftedRep`) can be used at the type level thanks
    to `TypeInType`. However, expressions like
    
    ```lang=haskell
    f :: Type -> Int
    f x = case x of {}
    ```
    
    were falsely claiming that the empty case on the value of type `Type` was
    non-exhaustive. The reason is a bit silly: `TYPE` is technically not an empty
    datatype in GHC's eyes, since it's a builtin, primitive type. To convince the
    pattern coverage checker otherwise, this adds a special case for `TYPE`.
    
    Test Plan: make test TEST=T14086
    
    Reviewers: gkaracha, austin, bgamari, goldfire
    
    Reviewed By: goldfire
    
    Subscribers: goldfire, rwbarton, thomie
    
    GHC Trac Issues: #14086
    
    Differential Revision: https://phabricator.haskell.org/D3819
    a267580e