Opened 15 months ago

Closed 15 months ago

Last modified 15 months ago

#15341 closed bug (fixed)

:info prints kinds in closed type family equations without enabling -fprint-explicit-kinds

Reported by: RyanGlScott Owned by:
Priority: normal Milestone: 8.6.1
Component: Compiler Version: 8.4.3
Keywords: TypeFamilies Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: ghci/scripts/T15341
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D4932
Wiki Page:


Load this file into GHCi:

{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeFamilies #-}
module Bug where

type family Foo (a :: k) :: k where
  Foo a = a

And run :info on Foo:

$ /opt/ghc/8.4.3/bin/ghci Bug.hs
GHCi, version 8.4.3:  :? for help
Loaded GHCi configuration from /home/ryanglscott/.ghci
[1 of 1] Compiling Bug              ( Bug.hs, interpreted )
Ok, one module loaded.
λ> :i Foo
type family Foo (a :: k) :: k
  where Foo k a = a
        -- Defined at Bug.hs:5:1

Note that when printing the equation for Foo, the kind k is treated as though it were the first visible argument to Foo, even though -fprint-explicit-kinds is not enabled. This is because ppr_tc_args in IfaceType does not take -fprint-explicit-kinds into account.

Patch incoming (pending a ./validate).

Change History (4)

comment:1 Changed 15 months ago by RyanGlScott

Differential Rev(s): Phab:D4932
Status: newpatch

comment:2 Changed 15 months ago by Ryan Scott <…>

In dbdcacf/ghc:

Make ppr_tc_args aware of -fprint-explicit-kinds

`ppr_tc_args` was printing invisible kind arguments even
when `-fprint-explicit-kinds` wasn't enabled. Easily fixed.

Test Plan: make test TEST=T15341

Reviewers: goldfire, bgamari, simonpj

Reviewed By: simonpj

Subscribers: simonpj, rwbarton, thomie, carter

GHC Trac Issues: #15341

Differential Revision:

comment:3 Changed 15 months ago by RyanGlScott

Status: patchmerge
Test Case: ghci/scripts/T15341

comment:4 Changed 15 months ago by bgamari

Resolution: fixed
Status: mergeclosed
Last edited 15 months ago by bgamari (previous) (diff)
Note: See TracTickets for help on using tickets.