Opened 7 years ago

Closed 7 years ago

#7433 closed bug (fixed)

Promoted constructors accepted without flag

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

Description

Sean Leather reports that

data N = Z
type T = 'Z

is accepted without -XDataKinds.

Interestingly, if we remove the quote on 'Z we get the expected error:

    Not in scope: type constructor or class `Z'
    A data constructor of that name is in scope; did you mean -XDataKinds?

Change History (4)

comment:1 Changed 7 years ago by dreixel

Summary: Promoted types accepted without flagPromoted constructors accepted without flag

comment:2 Changed 7 years ago by jpm@…

commit 6486213bc4ad307273956bc6164eeeb3f6f31d1c

Author: Jose Pedro Magalhaes <jpm@cs.ox.ac.uk>
Date:   Wed Nov 21 13:13:44 2012 +0000

    Reject promoted constructors when -XDataKinds is not enabled (FIX #7433)

 compiler/typecheck/TcHsType.lhs  |    5 ++++-
 compiler/typecheck/TcRnTypes.lhs |    3 +++
 2 files changed, 7 insertions(+), 1 deletions(-)

comment:3 Changed 7 years ago by dreixel

Status: newmerge

Fixed; the example now gives:

    Data constructor `Z' cannot be used here
      (Perhaps you intended to use -XDataKinds)
    In the type `Z'
    In the type declaration for `T'

comment:4 Changed 7 years ago by igloo

difficulty: Unknown
Resolution: fixed
Status: mergeclosed
Note: See TracTickets for help on using tickets.