Ticket #5952 (closed bug: fixed)

Opened 15 months ago

Last modified 15 months ago

Extra ' in error output concerning promoted kinds

Reported by: goldfire Owned by:
Priority: normal Milestone:
Component: Compiler (Type checker) Version: 7.5
Keywords: DataKinds Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Incorrect warning at compile-time Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

When I try to compile the following code, a slightly erroneous error message is produced:

{-# LANGUAGE DataKinds #-}

foo :: 'False
foo = undefined

The error message is

Kind mis-match
Expected kind `ArgKind', but `False' has kind 'Bool
In the type signature for `foo': foo :: False

The problem is that the kind of 'False is reported as 'Bool. However, if you use a kind written 'Bool in a program, that program fails to compile. As I understand it, the only way to write the kind of 'False is Bool, without the initial tick.

Change History

Changed 15 months ago by simonpj@…

commit 6100eb449c613e003e6114e03f1408f0366a8dba

Author: Simon Peyton Jones <simonpj@microsoft.com>
Date:   Thu Apr 5 11:42:53 2012 +0100

    Fix Trac #5952, by changing the Outputable TyCon instance,
    so that it does not print a quote in front of a promoted
    TyCon in a Kind.
    
    I also systematically renamed
       PromotedTypeTyCon  -->   PromotedTyCon
       PromotedDataTyCon  -->   PromotedDataCon

 compiler/basicTypes/DataCon.lhs  |    2 +-
 compiler/simplCore/OccurAnal.lhs |    9 ++++---
 compiler/types/Kind.lhs          |    2 +-
 compiler/types/TyCon.lhs         |   48 +++++++++++++++++++------------------
 compiler/types/Type.lhs          |    2 +-
 5 files changed, 33 insertions(+), 30 deletions(-)

Changed 15 months ago by simonpj

  • status changed from new to closed
  • difficulty set to Unknown
  • resolution set to fixed

Good point thank you. Turns out that the change is picked up by an existing regression test, so I won't add a new one.

Note: See TracTickets for help on using tickets.