[GHC] #14086: Empty case does not detect kinds
GHC
ghc-devs at haskell.org
Sat Aug 5 16:12:45 UTC 2017
#14086: Empty case does not detect kinds
-------------------------------------+-------------------------------------
Reporter: dfeuer | Owner: (none)
Type: bug | Status: patch
Priority: low | Milestone: 8.4.1
Component: Compiler (Type | Version: 8.2.1
checker) |
Resolution: | Keywords: TypeInType
Operating System: Unknown/Multiple | Architecture:
Type of failure: Incorrect | Unknown/Multiple
error/warning at compile-time | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D3819
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ryan Scott <ryan.gl.scott@…>):
In [changeset:"a267580e4ab37115dcc33f3b8a9af67b9364da12/ghc" a267580/ghc]:
{{{
#!CommitTicketReference repository="ghc"
revision="a267580e4ab37115dcc33f3b8a9af67b9364da12"
Don't warn when empty casing on Type
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
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14086#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list