Commit 6c07f142 authored by eir@cis.upenn.edu's avatar eir@cis.upenn.edu

Fix #11311

All things of kind *, including * itself, need to have a PtrRep.

Test: dependent/should_compile/T11311
parent d459f55c
......@@ -568,7 +568,7 @@ data TyCon
primTyConRep :: PrimRep,-- ^ Many primitive tycons are unboxed, but
-- some are boxed (represented by
-- pointers). This 'PrimRep' holds that
-- information. Only relevant if tyConKind = *
-- information. Only relevant if tyConKind = #
isUnLifted :: Bool, -- ^ Most primitive tycons are unlifted (may
-- not contain bottom) but other are lifted,
......@@ -1203,7 +1203,8 @@ mkKindTyCon :: Name -> Kind -> [Role] -> Name -> TyCon
mkKindTyCon name kind roles rep_nm
= tc
where
tc = mkPrimTyCon' name kind roles VoidRep False (Just rep_nm)
tc = mkPrimTyCon' name kind roles PtrRep False (Just rep_nm)
-- PtrRep because kinds have kind *.
-- | Create a lifted primitive 'TyCon' such as @RealWorld@
mkLiftedPrimTyCon :: Name -> Kind -> [Role] -> PrimRep -> TyCon
......
module T11311 where
import Data.Kind
foo :: ()
foo = (id :: * -> *) undefined `seq` ()
main = print foo
......@@ -11,3 +11,4 @@ test('mkGADTVars', normal, compile, [''])
test('TypeLevelVec',normal,compile, [''])
test('T9632', normal, compile, [''])
test('dynamic-paper', normal, compile, [''])
test('T11311', normal, compile, [''])
TOP=../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
module T11311 where
import Data.Kind
foo :: ()
foo = (id :: * -> *) undefined `seq` ()
main = print foo
# test('T11311', normal, compile_and_run, [''])
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