• Ryan Scott's avatar
    Overhaul -fprint-explicit-kinds to use VKA · f5d20838
    Ryan Scott authored
    This patch changes the behavior of `-fprint-explicit-kinds`
    so that it displays kind argument using visible kind application.
    In other words, the flag now:
    
    1. Prints instantiations of specified variables with `@(...)`.
    2. Prints instantiations of inferred variables with `@{...}`.
    
    In addition, this patch removes the `Use -fprint-explicit-kinds to
    see the kind arguments` error message that often arises when a type
    mismatch occurs due to different kinds. Instead, whenever there is a
    kind mismatch, we now enable the `-fprint-explicit-kinds` flag
    locally to help cue to the programmer where the error lies.
    (See `Note [Kind arguments in error messages]` in `TcErrors`.)
    As a result, these funny `@{...}` things can now appear to the user
    even without turning on the `-fprint-explicit-kinds` flag explicitly,
    so I took the liberty of documenting them in the users' guide.
    
    Test Plan: ./validate
    
    Reviewers: goldfire, simonpj, bgamari
    
    Reviewed By: simonpj
    
    Subscribers: rwbarton, carter
    
    GHC Trac Issues: #15871
    
    Differential Revision: https://phabricator.haskell.org/D5314
    f5d20838
TcErrors.hs 128 KB