Skip to content

-Wmissing-signatures should warn when top-level signature is partial

I'd like GHC to emit a warning for the following definition:

g :: _
g = True

But not for that one:

f :: Int
f = x
  where
    x :: _
    x = 1

The context is that I'm using partial signatures to help the type checker give the right type to a binding, with no intention of filling the holes later. (what Richard calls elision here)

The warning accompanying partial signatures (-Wpartial-type-signatures) effectively treats _-s in type signatures as holes which are meant to be filled (the type-level equivalent of typed holes). Which is not useful to my usage.

I can deactivate -Wpartial-type-signatures, however, it seems to me that, in that case, a partial top-level signature is just as bad as a missing top-level signature. So it seems to me that whenever I have -Wmissing-signatures enabled I also want to warn for partial top-level signatures.

Trac metadata
Trac field Value
Version 8.6.3
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC goldfire, simonpj
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information