Commit ea081c07 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Check that existential data constructors can't be promoted

parent a8ed7cc9
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
module Holdermans where
data K = forall a. T a -- promotion gives 'T :: * -> K
data G :: K -> * where
D :: G (T []) -- kind error!
Holdermans.hs:11:11:
`T' of type `forall a. a -> K' is not promotable
In the type `G (T [])'
In the definition of data constructor `D'
In the data declaration for `G'
......@@ -72,3 +72,4 @@ test('T7224', normal, compile_fail,[''])
test('T7230', normal, compile_fail,[''])
test('T7238', normal, compile,[''])
test('T7278', normal, compile_fail,[''])
test('Holdermans', normal, compile_fail,[''])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment