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
- Print instantiations of specified variables like
@...
. - 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 |