Ticket #7488 (closed bug: fixed)

Opened 6 months ago

Last modified 5 months ago

Promotion of newtypes

Reported by: dreixel Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.7
Keywords: Cc: eir@…, pho@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: polykinds/T7488 Blocked By:
Blocking: Related Tickets:

Description

{-# LANGUAGE DataKinds          #-}
{-# LANGUAGE KindSignatures     #-}
{-# LANGUAGE GADTs              #-}

newtype A = A Int
data B (x :: A)

The program above raises the error: A of kind * is not promotable. The program compiles fine if we declare A using data instead of newtype. Is there a good reason to prevent promotion of newtypes?

Change History

Changed 6 months ago by goldfire

  • cc eir@… added

Changed 5 months ago by PHO

  • cc pho@… added

Changed 5 months ago by simonpj

  • status changed from new to closed
  • difficulty set to Unknown
  • resolution set to fixed
  • testcase set to polykinds/T7488

Right, I've fixed this.

Simon

Changed 5 months ago by simonpj@…

commit b8739b28f5bc855b7c5406425b516698cf3b2f0d

Author: Simon Peyton Jones <simonpj@microsoft.com>
Date:   Fri Dec 21 08:05:58 2012 +0000

    Allow newtypes to be promoted
    
    Fixes Trac #7488

 compiler/basicTypes/DataCon.lhs |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
Note: See TracTickets for help on using tickets.