Make GHC handle orphan COMPLETE sets of conlikes better
Like orphan rewrite rules, it's possible to define orphan COMPLETE sets. For instance:
module Foo where
{-# COMPLETE False #-}
I suppose that we could define an orphan COMPLETE set as one that lives in a module where none of the conlikes are defined (or should we say "where one or more of the conlikes are not defined"? I'm not sure.)
Like orphan RULES, orphan COMPLETE sets are important to track properly when transitively reading from interface files, as failing to bring an orphan COMPLETE set into scope could affect pattern-match exhaustivness warnings that users see.
After discussing this with rwbarton and mpickering IRC, we decided that one of the two should happen:
- Treat orphan
COMPLETEsets like orphanRULES. That is, mark a module as an orphan if it defines an orphanCOMPLETEset, and thread a "COMPLETEpragma visibility" state through various places. - Disallow orphan
COMPLETEsets entirely.
Trac metadata
| Trac field | Value |
|---|---|
| Version | 8.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | mpickering |
| Operating system | |
| Architecture |