Opened 4 years ago

Closed 3 years ago

#7481 closed bug (fixed)

Partially promoted data types

Reported by: simonpj Owned by:
Priority: high Milestone: 7.8.1
Component: Compiler Version: 7.6.1
Keywords: Cc: eir@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: polykinds/T7481
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by simonpj)

Consider

{-# LANGUAGE DataKinds, PolyKinds #-}

data D a where
  D1 :: a -> D a
  D2 :: (a~Int) => D a
  D3 :: forall (a:k). Proxy a -> D b

Is D a promoted type?

Well, D1 is promotable, but D2 is not because of constraints in its type, and neither is D3 because it uses kind polymorphism. It's a bit odd to promote only one of the three constructors, but that is what happens right now.

We should probably check for promotability of all data constructors, and promote all or none. A bit of fiddling around is need to do this, so I'm opening a ticket. It's not terribly pressing.

Change History (4)

comment:1 Changed 4 years ago by simonpj

Description: modified (diff)

comment:2 Changed 4 years ago by goldfire

Cc: eir@… added

comment:3 Changed 3 years ago by Richard Eisenberg <eir@…>

In d1dff94c9a82ffeff0bf92d0f90231a639ade59c/ghc:

Test #7481, which had already been fixed.

comment:4 Changed 3 years ago by goldfire

Resolution: fixed
Status: newclosed
Test Case: polykinds/T7481
Note: See TracTickets for help on using tickets.