Skip to content

Revamp -fprint-explicit-kinds

With the imminent #12045 (closed), we will have type application in kinds. This ticket tracks mirroring this new behavior in the pretty-printer.

To wit, when -fprint-explicit-kinds is enabled, we should

  1. Print instantiations of specified variables like @....
  2. Print instantiations of inferred variables like @{...}.

Examples:

data Proxy (a :: k) = Proxy
 -- Then, `Proxy Int` would be printed as `Proxy @Type Int` with -fprint-explicit-kinds

data Proxy2 a = Proxy2
 -- Then, `Proxy2 Int` would be printed as `Proxy2 @{Type} Int` with -fprint-explicit-kinds

In addition, sometimes error messages suggest enabling -fprint-explicit-kinds. Instead of doing this, we should just locally enable the flag. The existence of the @ prefixes will alert the reader that these are not type arguments. (Without the @ syntax, locally and silently enabling -fprint-explicit-kinds would be very confusing.)

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