diff options
Diffstat (limited to 'testsuite/tests')
75 files changed, 212 insertions, 163 deletions
diff --git a/testsuite/tests/backpack/should_run/T13955.bkp b/testsuite/tests/backpack/should_run/T13955.bkp index a7d447f169..eadeee6f5c 100644 --- a/testsuite/tests/backpack/should_run/T13955.bkp +++ b/testsuite/tests/backpack/should_run/T13955.bkp @@ -18,7 +18,7 @@ unit number-unknown where unit number-int where module NumberUnknown where import GHC.Types - type Rep = LiftedRep + type Rep = 'BoxedRep 'Lifted type Number = Int plus :: Int -> Int -> Int plus = (+) diff --git a/testsuite/tests/dependent/should_compile/RaeJobTalk.hs b/testsuite/tests/dependent/should_compile/RaeJobTalk.hs index 6c74e10a7c..90a72c2a9a 100644 --- a/testsuite/tests/dependent/should_compile/RaeJobTalk.hs +++ b/testsuite/tests/dependent/should_compile/RaeJobTalk.hs @@ -14,12 +14,14 @@ import Data.Type.Bool import Data.Type.Equality hiding ((:~~:)(..)) import GHC.TypeLits import Data.Proxy -import GHC.Exts +import GHC.Exts hiding (Lifted, BoxedRep) import Data.Kind import Unsafe.Coerce import Data.Char import Data.Maybe +import qualified GHC.Exts as Exts + ------------------------------- -- Utilities @@ -82,7 +84,9 @@ data TyCon (a :: k) where Arrow :: TyCon (->) TYPE :: TyCon TYPE RuntimeRep :: TyCon RuntimeRep - LiftedRep' :: TyCon 'LiftedRep + Levity :: TyCon Levity + BoxedRep :: TyCon 'Exts.BoxedRep + Lifted :: TyCon 'Exts.Lifted -- If extending, add to eqTyCon too eqTyCon :: TyCon a -> TyCon b -> Maybe (a :~~: b) @@ -94,7 +98,9 @@ eqTyCon Maybe Maybe = Just HRefl eqTyCon Arrow Arrow = Just HRefl eqTyCon TYPE TYPE = Just HRefl eqTyCon RuntimeRep RuntimeRep = Just HRefl -eqTyCon LiftedRep' LiftedRep' = Just HRefl +eqTyCon Levity Levity = Just HRefl +eqTyCon BoxedRep BoxedRep = Just HRefl +eqTyCon Lifted Lifted = Just HRefl eqTyCon _ _ = Nothing -- Check whether or not a type is really a plain old tycon; @@ -212,8 +218,10 @@ instance TyConAble [] where tyCon = List instance TyConAble Maybe where tyCon = Maybe instance TyConAble (->) where tyCon = Arrow instance TyConAble TYPE where tyCon = TYPE -instance TyConAble 'LiftedRep where tyCon = LiftedRep' -instance TyConAble RuntimeRep where tyCon = RuntimeRep +instance TyConAble 'Exts.Lifted where tyCon = Lifted +instance TyConAble 'Exts.BoxedRep where tyCon = BoxedRep +instance TyConAble RuntimeRep where tyCon = RuntimeRep +instance TyConAble Levity where tyCon = Levity -- Can't just define Typeable the way we want, because the instances -- overlap. So we have to mock up instance chains via closed type families. diff --git a/testsuite/tests/dependent/should_fail/T17131.stderr b/testsuite/tests/dependent/should_fail/T17131.stderr index daad6ac054..b2af8ab7b8 100644 --- a/testsuite/tests/dependent/should_fail/T17131.stderr +++ b/testsuite/tests/dependent/should_fail/T17131.stderr @@ -1,9 +1,9 @@ T17131.hs:12:34: error: • Couldn't match kind: TypeReps xs - with: '[ 'LiftedRep] + with: '[ 'BoxedRep 'Lifted] Expected kind ‘TYPE ('TupleRep (TypeReps xs))’, - but ‘(# a #)’ has kind ‘TYPE ('TupleRep '[ 'LiftedRep])’ + but ‘(# a #)’ has kind ‘TYPE ('TupleRep '[ 'BoxedRep 'Lifted])’ The type variable ‘xs’ is ambiguous • In the type ‘(# a #)’ In the type family declaration for ‘Tuple#’ diff --git a/testsuite/tests/deriving/should_compile/T13154b.hs b/testsuite/tests/deriving/should_compile/T13154b.hs index 9df828b111..585f010eba 100644 --- a/testsuite/tests/deriving/should_compile/T13154b.hs +++ b/testsuite/tests/deriving/should_compile/T13154b.hs @@ -24,10 +24,10 @@ deriving instance Foo1 a class Foo2 (a :: TYPE ('TupleRep '[])) deriving instance Foo2 (##) -class Foo3 (a :: TYPE ('SumRep '[ 'LiftedRep, 'LiftedRep ])) +class Foo3 (a :: TYPE ('SumRep '[ 'BoxedRep 'Lifted, 'BoxedRep 'Lifted ])) deriving instance Foo3 a -class Foo4 (a :: TYPE ('SumRep '[ 'LiftedRep, 'LiftedRep ])) +class Foo4 (a :: TYPE ('SumRep '[ 'BoxedRep 'Lifted, 'BoxedRep 'Lifted ])) deriving instance Foo4 (# a | b #) class Foo5 (a :: Type) diff --git a/testsuite/tests/deriving/should_fail/T12512.hs b/testsuite/tests/deriving/should_fail/T12512.hs index 804bfd31da..61410d84cf 100644 --- a/testsuite/tests/deriving/should_fail/T12512.hs +++ b/testsuite/tests/deriving/should_fail/T12512.hs @@ -6,8 +6,8 @@ module T12512 where import GHC.Exts -class Wat1 (a :: TYPE ('TupleRep ['LiftedRep, 'LiftedRep])) +class Wat1 (a :: TYPE ('TupleRep ['BoxedRep 'Lifted, 'BoxedRep 'Lifted])) deriving instance Wat1 (# a, b #) -class Wat2 (a :: TYPE ('SumRep ['LiftedRep, 'LiftedRep])) +class Wat2 (a :: TYPE ('SumRep ['BoxedRep 'Lifted, 'BoxedRep 'Lifted])) deriving instance Wat2 (# a | b #) diff --git a/testsuite/tests/ffi/should_run/T16650a.hs b/testsuite/tests/ffi/should_run/T16650a.hs index 3424a2c4f2..e14954d3ee 100644 --- a/testsuite/tests/ffi/should_run/T16650a.hs +++ b/testsuite/tests/ffi/should_run/T16650a.hs @@ -27,7 +27,7 @@ foreign import ccall unsafe "head_bytearray" c_head_bytearray :: MutableByteArray# RealWorld -> IO Word8 data Box :: Type where - Box :: (Any :: TYPE 'UnliftedRep) -> Box + Box :: (Any :: TYPE ('BoxedRep 'Unlifted)) -> Box data MutableByteArray :: Type where MutableByteArray :: MutableByteArray# RealWorld -> MutableByteArray diff --git a/testsuite/tests/ffi/should_run/T16650b.hs b/testsuite/tests/ffi/should_run/T16650b.hs index 06ffcb1d5e..e1537c757d 100644 --- a/testsuite/tests/ffi/should_run/T16650b.hs +++ b/testsuite/tests/ffi/should_run/T16650b.hs @@ -31,7 +31,7 @@ foreign import ccall unsafe "is_doubleton_homogenous" c_is_doubleton_homogeneous :: MutableArrayArray# RealWorld -> IO Word8 data Box :: Type where - Box :: (Any :: TYPE 'UnliftedRep) -> Box + Box :: (Any :: TYPE ('BoxedRep 'Unlifted)) -> Box -- An array of bytes data MutableByteArray :: Type where diff --git a/testsuite/tests/ffi/should_run/T16650c.hs b/testsuite/tests/ffi/should_run/T16650c.hs index 968731b3bd..0d8e9ac8ec 100644 --- a/testsuite/tests/ffi/should_run/T16650c.hs +++ b/testsuite/tests/ffi/should_run/T16650c.hs @@ -26,7 +26,7 @@ foreign import ccall unsafe "is_doubleton_homogenous" MutableArray# RealWorld a -> IO Word8 data Box :: Type where - Box :: (Any :: TYPE 'UnliftedRep) -> Box + Box :: (Any :: TYPE ('BoxedRep 'Unlifted)) -> Box -- An array of unary integer functions data MutableArray :: Type where diff --git a/testsuite/tests/ffi/should_run/T16650d.hs b/testsuite/tests/ffi/should_run/T16650d.hs index 8bb4a4697b..874701b40a 100644 --- a/testsuite/tests/ffi/should_run/T16650d.hs +++ b/testsuite/tests/ffi/should_run/T16650d.hs @@ -26,7 +26,7 @@ foreign import ccall unsafe "is_doubleton_homogenous" SmallMutableArray# RealWorld a -> IO Word8 data Box :: Type where - Box :: (Any :: TYPE 'UnliftedRep) -> Box + Box :: (Any :: TYPE ('BoxedRep 'Unlifted)) -> Box -- An array of unary integer functions data SmallMutableArray :: Type where diff --git a/testsuite/tests/ffi/should_run/UnliftedNewtypesByteArrayOffset.hs b/testsuite/tests/ffi/should_run/UnliftedNewtypesByteArrayOffset.hs index 02a2c55c91..119324c28e 100644 --- a/testsuite/tests/ffi/should_run/UnliftedNewtypesByteArrayOffset.hs +++ b/testsuite/tests/ffi/should_run/UnliftedNewtypesByteArrayOffset.hs @@ -19,7 +19,7 @@ foreign import ccall unsafe "head_bytearray" foreign import ccall unsafe "head_bytearray" c_head_bytearray_b :: MyArray# -> IO Word8 -newtype MyArray# :: TYPE 'UnliftedRep where +newtype MyArray# :: TYPE ('BoxedRep 'Unlifted) where MyArray# :: MutableByteArray# RealWorld -> MyArray# data MutableByteArray :: Type where diff --git a/testsuite/tests/ghci/T18060/T18060.stdout b/testsuite/tests/ghci/T18060/T18060.stdout index e60b6346a4..0d5d798db6 100644 --- a/testsuite/tests/ghci/T18060/T18060.stdout +++ b/testsuite/tests/ghci/T18060/T18060.stdout @@ -2,9 +2,6 @@ type (->) :: * -> * -> * type (->) = FUN 'Many :: * -> * -> * -- Defined in ‘GHC.Types’ infixr -1 -> -instance Applicative ((->) r) -- Defined in ‘GHC.Base’ -instance Functor ((->) r) -- Defined in ‘GHC.Base’ -instance Monad ((->) r) -- Defined in ‘GHC.Base’ instance Monoid b => Monoid (a -> b) -- Defined in ‘GHC.Base’ instance Semigroup b => Semigroup (a -> b) -- Defined in ‘GHC.Base’ type (~) :: forall k. k -> k -> Constraint diff --git a/testsuite/tests/ghci/scripts/T12550.stdout b/testsuite/tests/ghci/scripts/T12550.stdout index 05baf3e900..f5d6d7ba05 100644 --- a/testsuite/tests/ghci/scripts/T12550.stdout +++ b/testsuite/tests/ghci/scripts/T12550.stdout @@ -23,37 +23,12 @@ class Functor f where (<$) ∷ ∀ a b. a → f b → f a {-# MINIMAL fmap #-} -- Defined in ‘GHC.Base’ -instance Functor V1 -- Defined in ‘GHC.Generics’ -instance Functor (URec Char) -- Defined in ‘GHC.Generics’ -instance Functor (URec Double) -- Defined in ‘GHC.Generics’ -instance Functor (URec Float) -- Defined in ‘GHC.Generics’ -instance Functor (URec Int) -- Defined in ‘GHC.Generics’ -instance Functor (URec Word) -- Defined in ‘GHC.Generics’ -instance Functor U1 -- Defined in ‘GHC.Generics’ -instance ∀ (f ∷ ★ → ★). Functor f ⇒ Functor (Rec1 f) - -- Defined in ‘GHC.Generics’ instance Functor Par1 -- Defined in ‘GHC.Generics’ -instance ∀ i (c ∷ Meta) (f ∷ ★ → ★). Functor f ⇒ Functor (M1 i c f) - -- Defined in ‘GHC.Generics’ -instance ∀ i c. Functor (K1 i c) -- Defined in ‘GHC.Generics’ -instance ∀ (f ∷ ★ → ★) (g ∷ ★ → ★). - (Functor f, Functor g) ⇒ - Functor (f :.: g) - -- Defined in ‘GHC.Generics’ -instance ∀ (f ∷ ★ → ★) (g ∷ ★ → ★). - (Functor f, Functor g) ⇒ - Functor (f :+: g) - -- Defined in ‘GHC.Generics’ -instance ∀ (f ∷ ★ → ★) (g ∷ ★ → ★). - (Functor f, Functor g) ⇒ - Functor (f :*: g) - -- Defined in ‘GHC.Generics’ instance ∀ a. Functor (Either a) -- Defined in ‘Data.Either’ instance Functor [] -- Defined in ‘GHC.Base’ instance Functor Solo -- Defined in ‘GHC.Base’ instance Functor Maybe -- Defined in ‘GHC.Base’ instance Functor IO -- Defined in ‘GHC.Base’ -instance ∀ r. Functor ((->) r) -- Defined in ‘GHC.Base’ instance ∀ a b c. Functor ((,,,) a b c) -- Defined in ‘GHC.Base’ instance ∀ a b. Functor ((,,) a b) -- Defined in ‘GHC.Base’ instance ∀ a. Functor ((,) a) -- Defined in ‘GHC.Base’ diff --git a/testsuite/tests/ghci/scripts/T13963.script b/testsuite/tests/ghci/scripts/T13963.script index c5e830aad1..030e8087a9 100644 --- a/testsuite/tests/ghci/scripts/T13963.script +++ b/testsuite/tests/ghci/scripts/T13963.script @@ -1,5 +1,5 @@ :set -XPolyKinds -XDataKinds -XRankNTypes -import GHC.Exts (TYPE, RuntimeRep(LiftedRep)) +import GHC.Exts (TYPE, RuntimeRep, LiftedRep) type Pair (a :: TYPE rep) (b :: TYPE rep') rep'' = forall (r :: TYPE rep''). (a -> b -> r) :kind Pair :kind Pair Int diff --git a/testsuite/tests/ghci/scripts/T15941.stdout b/testsuite/tests/ghci/scripts/T15941.stdout index f9e6d339f9..803aa9ebd0 100644 --- a/testsuite/tests/ghci/scripts/T15941.stdout +++ b/testsuite/tests/ghci/scripts/T15941.stdout @@ -1,4 +1,4 @@ type T :: * -> * -> * type T = - (->) @{'GHC.Types.LiftedRep} @{'GHC.Types.LiftedRep} :: * -> * -> * + (->) @{GHC.Types.LiftedRep} @{GHC.Types.LiftedRep} :: * -> * -> * -- Defined at <interactive>:2:1 diff --git a/testsuite/tests/ghci/scripts/T19310.stdout b/testsuite/tests/ghci/scripts/T19310.stdout index 4e7ad631fc..943aa126dd 100644 --- a/testsuite/tests/ghci/scripts/T19310.stdout +++ b/testsuite/tests/ghci/scripts/T19310.stdout @@ -1,3 +1,3 @@ type T :: * -> * -> * -type T = (->) @{'LiftedRep} @{'LiftedRep} :: * -> * -> * +type T = (->) @{LiftedRep} @{LiftedRep} :: * -> * -> * -- Defined at <interactive>:3:1 diff --git a/testsuite/tests/ghci/scripts/T7627.stdout b/testsuite/tests/ghci/scripts/T7627.stdout index b86ea432ff..2a2b8bd58f 100644 --- a/testsuite/tests/ghci/scripts/T7627.stdout +++ b/testsuite/tests/ghci/scripts/T7627.stdout @@ -37,8 +37,7 @@ instance (Bounded a, Bounded b) => Bounded (a, b) type (#,#) :: * -> * -> TYPE - ('GHC.Types.TupleRep - '[ 'GHC.Types.LiftedRep, 'GHC.Types.LiftedRep]) + ('GHC.Types.TupleRep '[GHC.Types.LiftedRep, GHC.Types.LiftedRep]) data (#,#) a b = (#,#) a b -- Defined in ‘GHC.Prim’ (,) :: a -> b -> (a, b) diff --git a/testsuite/tests/ghci/scripts/T8535.stdout b/testsuite/tests/ghci/scripts/T8535.stdout index 5786372e9d..981124c9cb 100644 --- a/testsuite/tests/ghci/scripts/T8535.stdout +++ b/testsuite/tests/ghci/scripts/T8535.stdout @@ -2,8 +2,5 @@ type (->) :: * -> * -> * type (->) = FUN 'Many :: * -> * -> * -- Defined in ‘GHC.Types’ infixr -1 -> -instance Applicative ((->) r) -- Defined in ‘GHC.Base’ -instance Functor ((->) r) -- Defined in ‘GHC.Base’ -instance Monad ((->) r) -- Defined in ‘GHC.Base’ instance Monoid b => Monoid (a -> b) -- Defined in ‘GHC.Base’ instance Semigroup b => Semigroup (a -> b) -- Defined in ‘GHC.Base’ diff --git a/testsuite/tests/ghci/scripts/T8674.stdout b/testsuite/tests/ghci/scripts/T8674.stdout index 7d7beeb1cd..ff0355b617 100644 --- a/testsuite/tests/ghci/scripts/T8674.stdout +++ b/testsuite/tests/ghci/scripts/T8674.stdout @@ -1,6 +1,5 @@ type Sing :: forall k. k -> * data family Sing a -- Defined at T8674.hs:4:1 -data instance Sing Bool = SBool -- Defined at T8674.hs:6:15 data instance forall k (a :: [k]). Sing a = SNil -- Defined at T8674.hs:5:15 diff --git a/testsuite/tests/ghci/scripts/ghci020.stdout b/testsuite/tests/ghci/scripts/ghci020.stdout index 5786372e9d..981124c9cb 100644 --- a/testsuite/tests/ghci/scripts/ghci020.stdout +++ b/testsuite/tests/ghci/scripts/ghci020.stdout @@ -2,8 +2,5 @@ type (->) :: * -> * -> * type (->) = FUN 'Many :: * -> * -> * -- Defined in ‘GHC.Types’ infixr -1 -> -instance Applicative ((->) r) -- Defined in ‘GHC.Base’ -instance Functor ((->) r) -- Defined in ‘GHC.Base’ -instance Monad ((->) r) -- Defined in ‘GHC.Base’ instance Monoid b => Monoid (a -> b) -- Defined in ‘GHC.Base’ instance Semigroup b => Semigroup (a -> b) -- Defined in ‘GHC.Base’ diff --git a/testsuite/tests/ghci/should_run/T10145.stdout b/testsuite/tests/ghci/should_run/T10145.stdout index 5786372e9d..981124c9cb 100644 --- a/testsuite/tests/ghci/should_run/T10145.stdout +++ b/testsuite/tests/ghci/should_run/T10145.stdout @@ -2,8 +2,5 @@ type (->) :: * -> * -> * type (->) = FUN 'Many :: * -> * -> * -- Defined in ‘GHC.Types’ infixr -1 -> -instance Applicative ((->) r) -- Defined in ‘GHC.Base’ -instance Functor ((->) r) -- Defined in ‘GHC.Base’ -instance Monad ((->) r) -- Defined in ‘GHC.Base’ instance Monoid b => Monoid (a -> b) -- Defined in ‘GHC.Base’ instance Semigroup b => Semigroup (a -> b) -- Defined in ‘GHC.Base’ diff --git a/testsuite/tests/ghci/should_run/T16096.stdout b/testsuite/tests/ghci/should_run/T16096.stdout index 5826057d42..2749f06586 100644 --- a/testsuite/tests/ghci/should_run/T16096.stdout +++ b/testsuite/tests/ghci/should_run/T16096.stdout @@ -17,7 +17,7 @@ GHC.Base.returnIO (GHC.Types.: @() (Unsafe.Coerce.unsafeCoerce# - @'GHC.Types.LiftedRep @'GHC.Types.LiftedRep @[GHC.Types.Int] @() x) + @GHC.Types.LiftedRep @GHC.Types.LiftedRep @[GHC.Types.Int] @() x) (GHC.Types.[] @())) @@ -40,7 +40,7 @@ GHC.Base.returnIO (GHC.Types.: @() (Unsafe.Coerce.unsafeCoerce# - @'GHC.Types.LiftedRep @'GHC.Types.LiftedRep @[GHC.Types.Int] @() x) + @GHC.Types.LiftedRep @GHC.Types.LiftedRep @[GHC.Types.Int] @() x) (GHC.Types.[] @())) diff --git a/testsuite/tests/ghci/should_run/T18594.stdout b/testsuite/tests/ghci/should_run/T18594.stdout index 9e2e79cd8b..d3219de45e 100644 --- a/testsuite/tests/ghci/should_run/T18594.stdout +++ b/testsuite/tests/ghci/should_run/T18594.stdout @@ -8,8 +8,8 @@ instance Monad ((->) r) -- Defined in ‘GHC.Base’ instance Monoid b => Monoid (a -> b) -- Defined in ‘GHC.Base’ instance Semigroup b => Semigroup (a -> b) -- Defined in ‘GHC.Base’ type Type :: * -type Type = TYPE 'LiftedRep +type Type = TYPE LiftedRep -- Defined in ‘GHC.Types’ type Type :: Type -type Type = TYPE 'LiftedRep +type Type = TYPE LiftedRep -- Defined in ‘GHC.Types’ diff --git a/testsuite/tests/indexed-types/should_compile/T14111.hs b/testsuite/tests/indexed-types/should_compile/T14111.hs index d1af549187..4e304e5d90 100644 --- a/testsuite/tests/indexed-types/should_compile/T14111.hs +++ b/testsuite/tests/indexed-types/should_compile/T14111.hs @@ -20,5 +20,5 @@ data family Maybe(x :: TYPE (r :: RuntimeRep)) data instance Maybe (a :: Type ) where MaybeSum :: (# a | (# #) #) -> Maybe a -data instance Maybe (x :: TYPE 'UnliftedRep) where +data instance Maybe (x :: TYPE ('BoxedRep 'Unlifted)) where MaybeSumU :: (# x | (# #) #) -> Maybe x diff --git a/testsuite/tests/plugins/plugins09.stdout b/testsuite/tests/plugins/plugins09.stdout index 61f96283ff..776f34b5f3 100644 --- a/testsuite/tests/plugins/plugins09.stdout +++ b/testsuite/tests/plugins/plugins09.stdout @@ -3,5 +3,6 @@ interfacePlugin: Prelude interfacePlugin: GHC.Float interfacePlugin: GHC.Base typeCheckPlugin (rn) +interfacePlugin: GHC.Prim typeCheckPlugin (tc) interfacePlugin: GHC.Num.BigNat diff --git a/testsuite/tests/plugins/plugins10.stdout b/testsuite/tests/plugins/plugins10.stdout index 37f424b076..47e7d29b93 100644 --- a/testsuite/tests/plugins/plugins10.stdout +++ b/testsuite/tests/plugins/plugins10.stdout @@ -6,6 +6,7 @@ interfacePlugin: GHC.Float interfacePlugin: GHC.Base interfacePlugin: Language.Haskell.TH.Syntax typeCheckPlugin (rn) +interfacePlugin: GHC.Prim typeCheckPlugin (tc) interfacePlugin: GHC.Num.BigNat parsePlugin(a) diff --git a/testsuite/tests/plugins/plugins11.stdout b/testsuite/tests/plugins/plugins11.stdout index 6bab3559b1..b3e835f2bf 100644 --- a/testsuite/tests/plugins/plugins11.stdout +++ b/testsuite/tests/plugins/plugins11.stdout @@ -3,5 +3,6 @@ interfacePlugin: Prelude interfacePlugin: GHC.Float interfacePlugin: GHC.Base typeCheckPlugin (rn) +interfacePlugin: GHC.Prim typeCheckPlugin (tc) interfacePlugin: GHC.Num.BigNat diff --git a/testsuite/tests/plugins/static-plugins.stdout b/testsuite/tests/plugins/static-plugins.stdout index 032992824f..65af518b7f 100644 --- a/testsuite/tests/plugins/static-plugins.stdout +++ b/testsuite/tests/plugins/static-plugins.stdout @@ -5,11 +5,11 @@ interfacePlugin: GHC.Float interfacePlugin: GHC.Base interfacePlugin: System.IO typeCheckPlugin (rn) +interfacePlugin: GHC.Prim interfacePlugin: GHC.Types interfacePlugin: GHC.Show interfacePlugin: GHC.TopHandler typeCheckPlugin (tc) -interfacePlugin: GHC.Prim interfacePlugin: GHC.CString interfacePlugin: GHC.Num.BigNat ==pure.1 diff --git a/testsuite/tests/pmcheck/should_compile/T18249.hs b/testsuite/tests/pmcheck/should_compile/T18249.hs index b9bd048cbd..2a343b08e1 100644 --- a/testsuite/tests/pmcheck/should_compile/T18249.hs +++ b/testsuite/tests/pmcheck/should_compile/T18249.hs @@ -14,7 +14,7 @@ f :: Int# -> Int f !_ | False = 1 f _ = 2 -newtype UVoid :: TYPE 'UnliftedRep where +newtype UVoid :: TYPE ('BoxedRep 'Unlifted) where UVoid :: UVoid -> UVoid g :: UVoid -> Int diff --git a/testsuite/tests/polykinds/T14555.stderr b/testsuite/tests/polykinds/T14555.stderr index 3861872124..f85c1b44cc 100644 --- a/testsuite/tests/polykinds/T14555.stderr +++ b/testsuite/tests/polykinds/T14555.stderr @@ -1,6 +1,6 @@ T14555.hs:12:34: error: - • Couldn't match kind ‘rep’ with ‘'GHC.Types.LiftedRep’ + • Couldn't match kind ‘rep’ with ‘GHC.Types.LiftedRep’ Expected kind ‘TYPE rep’, but ‘a -> b’ has kind ‘*’ • In the second argument of ‘Exp’, namely ‘(a -> b)’ In the type ‘Exp xs (a -> b)’ diff --git a/testsuite/tests/polykinds/T14563.stderr b/testsuite/tests/polykinds/T14563.stderr index 2d81507659..e2dd07a6d6 100644 --- a/testsuite/tests/polykinds/T14563.stderr +++ b/testsuite/tests/polykinds/T14563.stderr @@ -1,6 +1,6 @@ T14563.hs:9:39: error: - • Couldn't match kind ‘rep''’ with ‘'GHC.Types.LiftedRep’ + • Couldn't match kind ‘rep''’ with ‘GHC.Types.LiftedRep’ Expected kind ‘TYPE rep -> TYPE rep''’, but ‘h’ has kind ‘TYPE rep -> *’ • In the second argument of ‘Lan’, namely ‘h’ diff --git a/testsuite/tests/polykinds/T17963.stderr b/testsuite/tests/polykinds/T17963.stderr index e38d216faf..aa0e4d0d3e 100644 --- a/testsuite/tests/polykinds/T17963.stderr +++ b/testsuite/tests/polykinds/T17963.stderr @@ -1,6 +1,6 @@ T17963.hs:15:23: error: - • Couldn't match kind ‘rep’ with ‘'LiftedRep’ + • Couldn't match kind ‘rep’ with ‘GHC.Types.LiftedRep’ When matching kinds k0 :: * ob :: TYPE rep diff --git a/testsuite/tests/polykinds/T18300.stderr b/testsuite/tests/polykinds/T18300.stderr index 53ea72b1b8..3ddd175d55 100644 --- a/testsuite/tests/polykinds/T18300.stderr +++ b/testsuite/tests/polykinds/T18300.stderr @@ -1,4 +1,2 @@ -T18300.hs:13:1: error: - • Data instance has non-* return kind ‘TYPE (F Int)’ - • In the data instance declaration for ‘T’ +T18300.hs:9:23: error: Not in scope: data constructor ‘LiftedRep’ diff --git a/testsuite/tests/simplCore/should_compile/T18013.stderr b/testsuite/tests/simplCore/should_compile/T18013.stderr index 8b1b57e6bd..45640d9ebc 100644 --- a/testsuite/tests/simplCore/should_compile/T18013.stderr +++ b/testsuite/tests/simplCore/should_compile/T18013.stderr @@ -129,9 +129,9 @@ Rule fired: Class op fmap (BUILTIN) ==================== Tidy Core ==================== Result size of Tidy Core - = {terms: 52, types: 101, coercions: 17, joins: 0/1} + = {terms: 52, types: 102, coercions: 17, joins: 0/1} --- RHS size: {terms: 37, types: 84, coercions: 17, joins: 0/1} +-- RHS size: {terms: 37, types: 85, coercions: 17, joins: 0/1} mapMaybeRule [InlPrag=[2]] :: forall a b. Rule IO a b -> Rule IO (Maybe a) (Maybe b) [GblId, diff --git a/testsuite/tests/simplCore/should_compile/T9400.stderr b/testsuite/tests/simplCore/should_compile/T9400.stderr index 7825071aea..c4584f460e 100644 --- a/testsuite/tests/simplCore/should_compile/T9400.stderr +++ b/testsuite/tests/simplCore/should_compile/T9400.stderr @@ -65,7 +65,7 @@ main @() (putStrLn (unpackCString# "efg"#)) (case Control.Exception.Base.patError - @'LiftedRep @() "T9400.hs:(17,5)-(18,29)|case"# + @LiftedRep @() "T9400.hs:(17,5)-(18,29)|case"# of wild { })))) diff --git a/testsuite/tests/simplCore/should_compile/spec-inline.stderr b/testsuite/tests/simplCore/should_compile/spec-inline.stderr index a8fa8e58e8..683ff4d6ac 100644 --- a/testsuite/tests/simplCore/should_compile/spec-inline.stderr +++ b/testsuite/tests/simplCore/should_compile/spec-inline.stderr @@ -48,8 +48,7 @@ lvl = "spec-inline.hs:(19,5)-(29,25)|function go"# Roman.foo3 :: () [GblId, Str=b, Cpr=b] Roman.foo3 - = Control.Exception.Base.patError - @'GHC.Types.LiftedRep @() lvl + = Control.Exception.Base.patError @GHC.Types.LiftedRep @() lvl Rec { -- RHS size: {terms: 40, types: 5, coercions: 0, joins: 0/0} diff --git a/testsuite/tests/th/T14869.hs b/testsuite/tests/th/T14869.hs index 4b0dcdc171..5bd2a0806a 100644 --- a/testsuite/tests/th/T14869.hs +++ b/testsuite/tests/th/T14869.hs @@ -9,7 +9,7 @@ import GHC.Exts import Language.Haskell.TH (pprint, reify, stringE) type MyConstraint = Constraint -type MyLiftedRep = LiftedRep +type MyLiftedRep = BoxedRep Lifted type family Foo1 :: Type type family Foo2 :: Constraint diff --git a/testsuite/tests/typecheck/should_compile/LevPolyResult.hs b/testsuite/tests/typecheck/should_compile/LevPolyResult.hs new file mode 100644 index 0000000000..22bfc0e2ae --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/LevPolyResult.hs @@ -0,0 +1,11 @@ +{-# language DataKinds #-} +{-# language KindSignatures #-} +{-# language PolyKinds #-} +{-# language RankNTypes #-} + +module LevPolyResult (example) where + +import GHC.Exts + +example :: forall (v :: Levity) (a :: TYPE ('BoxedRep v)). (Int -> a) -> a +example f = f 42 diff --git a/testsuite/tests/typecheck/should_compile/UnliftedNewtypesUnassociatedFamily.hs b/testsuite/tests/typecheck/should_compile/UnliftedNewtypesUnassociatedFamily.hs index 0a8143b0b6..dd7890d33c 100644 --- a/testsuite/tests/typecheck/should_compile/UnliftedNewtypesUnassociatedFamily.hs +++ b/testsuite/tests/typecheck/should_compile/UnliftedNewtypesUnassociatedFamily.hs @@ -12,14 +12,15 @@ module UnliftedNewtypesUnassociatedFamily where import GHC.Int (Int(I#)) import GHC.Word (Word(W#)) import GHC.Exts (Int#,Word#) -import GHC.Exts (TYPE,RuntimeRep(LiftedRep,IntRep,WordRep,TupleRep)) +import GHC.Exts (TYPE,Levity(Lifted)) +import GHC.Exts (RuntimeRep(BoxedRep,IntRep,WordRep,TupleRep)) data family DFT (r :: RuntimeRep) :: TYPE r newtype instance DFT 'IntRep = MkDFT1 Int# newtype instance DFT 'WordRep = MkDFT2 Word# newtype instance DFT ('TupleRep '[ 'IntRep, 'WordRep]) = MkDFT3 (# Int#, Word# #) -data instance DFT 'LiftedRep = MkDFT4 | MkDFT5 +data instance DFT ('BoxedRep 'Lifted) = MkDFT4 | MkDFT5 data family DF :: TYPE (r :: RuntimeRep) diff --git a/testsuite/tests/typecheck/should_compile/abstract_refinement_hole_fits.stderr b/testsuite/tests/typecheck/should_compile/abstract_refinement_hole_fits.stderr index 57214ba181..61ed517535 100644 --- a/testsuite/tests/typecheck/should_compile/abstract_refinement_hole_fits.stderr +++ b/testsuite/tests/typecheck/should_compile/abstract_refinement_hole_fits.stderr @@ -33,20 +33,20 @@ abstract_refinement_hole_fits.hs:4:5: warning: [-Wtyped-holes (in -Wdefault)] (a -> b -> b) -> b -> t a -> b const (_ :: Integer) where const :: forall a b. a -> b -> a - ($) (_ :: [Integer] -> Integer) - where ($) :: forall a b. (a -> b) -> a -> b - ($!) (_ :: [Integer] -> Integer) - where ($!) :: forall a b. (a -> b) -> a -> b curry (_ :: (t0, [Integer]) -> Integer) (_ :: t0) where curry :: forall a b c. ((a, b) -> c) -> a -> b -> c (.) (_ :: b1 -> Integer) (_ :: [Integer] -> b1) where (.) :: forall b c a. (b -> c) -> (a -> b) -> a -> c flip (_ :: [Integer] -> t0 -> Integer) (_ :: t0) where flip :: forall a b c. (a -> b -> c) -> b -> a -> c + ($) (_ :: [Integer] -> Integer) + where ($) :: forall a b. (a -> b) -> a -> b return (_ :: Integer) where return :: forall (m :: * -> *) a. Monad m => a -> m a pure (_ :: Integer) where pure :: forall (f :: * -> *) a. Applicative f => a -> f a + ($!) (_ :: [Integer] -> Integer) + where ($!) :: forall a b. (a -> b) -> a -> b (>>=) (_ :: [Integer] -> a8) (_ :: a8 -> [Integer] -> Integer) where (>>=) :: forall (m :: * -> *) a b. Monad m => @@ -109,18 +109,18 @@ abstract_refinement_hole_fits.hs:4:5: warning: [-Wtyped-holes (in -Wdefault)] where snd :: forall a b. (a, b) -> b const (_ :: [Integer] -> Integer) (_ :: t0) where const :: forall a b. a -> b -> a + uncurry (_ :: a3 -> b3 -> [Integer] -> Integer) (_ :: (a3, b3)) + where uncurry :: forall a b c. (a -> b -> c) -> (a, b) -> c seq (_ :: t2) (_ :: [Integer] -> Integer) where seq :: forall a b. a -> b -> b ($) (_ :: t0 -> [Integer] -> Integer) (_ :: t0) where ($) :: forall a b. (a -> b) -> a -> b - uncurry (_ :: a3 -> b3 -> [Integer] -> Integer) (_ :: (a3, b3)) - where uncurry :: forall a b c. (a -> b -> c) -> (a, b) -> c - ($!) (_ :: t0 -> [Integer] -> Integer) (_ :: t0) - where ($!) :: forall a b. (a -> b) -> a -> b return (_ :: [Integer] -> Integer) (_ :: t0) where return :: forall (m :: * -> *) a. Monad m => a -> m a pure (_ :: [Integer] -> Integer) (_ :: t0) where pure :: forall (f :: * -> *) a. Applicative f => a -> f a + ($!) (_ :: t0 -> [Integer] -> Integer) (_ :: t0) + where ($!) :: forall a b. (a -> b) -> a -> b abstract_refinement_hole_fits.hs:7:5: warning: [-Wtyped-holes (in -Wdefault)] • Found hole: _ :: Integer -> [Integer] -> Integer @@ -148,20 +148,20 @@ abstract_refinement_hole_fits.hs:7:5: warning: [-Wtyped-holes (in -Wdefault)] where flip :: forall a b c. (a -> b -> c) -> b -> a -> c const (_ :: [Integer] -> Integer) where const :: forall a b. a -> b -> a - ($) (_ :: Integer -> [Integer] -> Integer) - where ($) :: forall a b. (a -> b) -> a -> b - ($!) (_ :: Integer -> [Integer] -> Integer) - where ($!) :: forall a b. (a -> b) -> a -> b curry (_ :: (t0, Integer) -> [Integer] -> Integer) (_ :: t0) where curry :: forall a b c. ((a, b) -> c) -> a -> b -> c (.) (_ :: b1 -> [Integer] -> Integer) (_ :: Integer -> b1) where (.) :: forall b c a. (b -> c) -> (a -> b) -> a -> c flip (_ :: Integer -> t0 -> [Integer] -> Integer) (_ :: t0) where flip :: forall a b c. (a -> b -> c) -> b -> a -> c + ($) (_ :: Integer -> [Integer] -> Integer) + where ($) :: forall a b. (a -> b) -> a -> b return (_ :: [Integer] -> Integer) where return :: forall (m :: * -> *) a. Monad m => a -> m a pure (_ :: [Integer] -> Integer) where pure :: forall (f :: * -> *) a. Applicative f => a -> f a + ($!) (_ :: Integer -> [Integer] -> Integer) + where ($!) :: forall a b. (a -> b) -> a -> b (>>=) (_ :: Integer -> a8) (_ :: a8 -> Integer -> [Integer] -> Integer) where (>>=) :: forall (m :: * -> *) a b. @@ -228,16 +228,16 @@ abstract_refinement_hole_fits.hs:7:5: warning: [-Wtyped-holes (in -Wdefault)] where snd :: forall a b. (a, b) -> b const (_ :: Integer -> [Integer] -> Integer) (_ :: t0) where const :: forall a b. a -> b -> a + uncurry (_ :: a3 -> b3 -> Integer -> [Integer] -> Integer) + (_ :: (a3, b3)) + where uncurry :: forall a b c. (a -> b -> c) -> (a, b) -> c seq (_ :: t2) (_ :: Integer -> [Integer] -> Integer) where seq :: forall a b. a -> b -> b ($) (_ :: t0 -> Integer -> [Integer] -> Integer) (_ :: t0) where ($) :: forall a b. (a -> b) -> a -> b - uncurry (_ :: a3 -> b3 -> Integer -> [Integer] -> Integer) - (_ :: (a3, b3)) - where uncurry :: forall a b c. (a -> b -> c) -> (a, b) -> c - ($!) (_ :: t0 -> Integer -> [Integer] -> Integer) (_ :: t0) - where ($!) :: forall a b. (a -> b) -> a -> b return (_ :: Integer -> [Integer] -> Integer) (_ :: t0) where return :: forall (m :: * -> *) a. Monad m => a -> m a pure (_ :: Integer -> [Integer] -> Integer) (_ :: t0) where pure :: forall (f :: * -> *) a. Applicative f => a -> f a + ($!) (_ :: t0 -> Integer -> [Integer] -> Integer) (_ :: t0) + where ($!) :: forall a b. (a -> b) -> a -> b diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 68d5f21f49..6d3505c33d 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -694,6 +694,7 @@ test('UnliftedNewtypesForall', normal, compile, ['']) test('UnlifNewUnify', normal, compile, ['']) test('UnliftedNewtypesLPFamily', normal, compile, ['']) test('UnliftedNewtypesDifficultUnification', normal, compile, ['']) +test('LevPolyResult', normal, compile, ['']) test('T16832', normal, ghci_script, ['T16832.script']) test('T15772', normal, compile, ['']) test('T16995', normal, compile, ['']) diff --git a/testsuite/tests/typecheck/should_compile/constraint_hole_fits.stderr b/testsuite/tests/typecheck/should_compile/constraint_hole_fits.stderr index ffc02228f2..3cc66588f0 100644 --- a/testsuite/tests/typecheck/should_compile/constraint_hole_fits.stderr +++ b/testsuite/tests/typecheck/should_compile/constraint_hole_fits.stderr @@ -36,12 +36,12 @@ constraint_hole_fits.hs:4:5: warning: [-Wtyped-holes (in -Wdefault)] where const :: forall a b. a -> b -> a ($) (_ :: [a] -> a) where ($) :: forall a b. (a -> b) -> a -> b - ($!) (_ :: [a] -> a) - where ($!) :: forall a b. (a -> b) -> a -> b return (_ :: a) where return :: forall (m :: * -> *) a. Monad m => a -> m a pure (_ :: a) where pure :: forall (f :: * -> *) a. Applicative f => a -> f a + ($!) (_ :: [a] -> a) + where ($!) :: forall a b. (a -> b) -> a -> b id (_ :: [a] -> a) where id :: forall a. a -> a head (_ :: [[a] -> a]) diff --git a/testsuite/tests/typecheck/should_compile/refinement_hole_fits.stderr b/testsuite/tests/typecheck/should_compile/refinement_hole_fits.stderr index 9ed1615215..5941b587bf 100644 --- a/testsuite/tests/typecheck/should_compile/refinement_hole_fits.stderr +++ b/testsuite/tests/typecheck/should_compile/refinement_hole_fits.stderr @@ -67,12 +67,7 @@ refinement_hole_fits.hs:4:5: warning: [-Wtyped-holes (in -Wdefault)] (and originally defined in ‘GHC.Base’)) ($) (_ :: [Integer] -> Integer) where ($) :: forall a b. (a -> b) -> a -> b - with ($) @'GHC.Types.LiftedRep @[Integer] @Integer - (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 - (and originally defined in ‘GHC.Base’)) - ($!) (_ :: [Integer] -> Integer) - where ($!) :: forall a b. (a -> b) -> a -> b - with ($!) @'GHC.Types.LiftedRep @[Integer] @Integer + with ($) @GHC.Types.LiftedRep @[Integer] @Integer (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘GHC.Base’)) return (_ :: Integer) @@ -85,6 +80,11 @@ refinement_hole_fits.hs:4:5: warning: [-Wtyped-holes (in -Wdefault)] with pure @((->) [Integer]) @Integer (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘GHC.Base’)) + ($!) (_ :: [Integer] -> Integer) + where ($!) :: forall a b. (a -> b) -> a -> b + with ($!) @GHC.Types.LiftedRep @[Integer] @Integer + (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 + (and originally defined in ‘GHC.Base’)) id (_ :: [Integer] -> Integer) where id :: forall a. a -> a with id @([Integer] -> Integer) @@ -162,12 +162,7 @@ refinement_hole_fits.hs:7:5: warning: [-Wtyped-holes (in -Wdefault)] (and originally defined in ‘GHC.Base’)) ($) (_ :: Integer -> [Integer] -> Integer) where ($) :: forall a b. (a -> b) -> a -> b - with ($) @'GHC.Types.LiftedRep @Integer @([Integer] -> Integer) - (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 - (and originally defined in ‘GHC.Base’)) - ($!) (_ :: Integer -> [Integer] -> Integer) - where ($!) :: forall a b. (a -> b) -> a -> b - with ($!) @'GHC.Types.LiftedRep @Integer @([Integer] -> Integer) + with ($) @GHC.Types.LiftedRep @Integer @([Integer] -> Integer) (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘GHC.Base’)) return (_ :: [Integer] -> Integer) @@ -180,6 +175,11 @@ refinement_hole_fits.hs:7:5: warning: [-Wtyped-holes (in -Wdefault)] with pure @((->) Integer) @([Integer] -> Integer) (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘GHC.Base’)) + ($!) (_ :: Integer -> [Integer] -> Integer) + where ($!) :: forall a b. (a -> b) -> a -> b + with ($!) @GHC.Types.LiftedRep @Integer @([Integer] -> Integer) + (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 + (and originally defined in ‘GHC.Base’)) id (_ :: Integer -> [Integer] -> Integer) where id :: forall a. a -> a with id @(Integer -> [Integer] -> Integer) diff --git a/testsuite/tests/typecheck/should_fail/LevPolyLet.hs b/testsuite/tests/typecheck/should_fail/LevPolyLet.hs new file mode 100644 index 0000000000..6fb47133ae --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/LevPolyLet.hs @@ -0,0 +1,19 @@ +{-# language DataKinds #-} +{-# language KindSignatures #-} +{-# language PolyKinds #-} +{-# language RankNTypes #-} + +module LevPolyLet + ( example + ) where + +import GHC.Exts + +-- This should be rejected because of the let binding. +example :: forall (v :: Levity) (a :: TYPE ('BoxedRep v)). + (Int -> a) + -> (a -> Bool) + -> Bool +example f g = + let x = f 42 + in g x diff --git a/testsuite/tests/typecheck/should_fail/LevPolyLet.stderr b/testsuite/tests/typecheck/should_fail/LevPolyLet.stderr new file mode 100644 index 0000000000..8d01f4028b --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/LevPolyLet.stderr @@ -0,0 +1,5 @@ +LevPolyLet.hs:18:7: + A levity-polymorphic type is not allowed here: + Type: a + Kind: TYPE ('BoxedRep v) + In the type of binder ‘x’ diff --git a/testsuite/tests/typecheck/should_fail/T12373.stderr b/testsuite/tests/typecheck/should_fail/T12373.stderr index 20137fbdad..f53f5ea7e2 100644 --- a/testsuite/tests/typecheck/should_fail/T12373.stderr +++ b/testsuite/tests/typecheck/should_fail/T12373.stderr @@ -3,7 +3,7 @@ T12373.hs:10:19: error: • Couldn't match a lifted type with an unlifted type When matching types a0 :: * - MVar# RealWorld a1 :: TYPE 'UnliftedRep + MVar# RealWorld a1 :: UnliftedType Expected: (# State# RealWorld, a0 #) Actual: (# State# RealWorld, MVar# RealWorld a1 #) • In the expression: newMVar# rw diff --git a/testsuite/tests/typecheck/should_fail/T13610.stderr b/testsuite/tests/typecheck/should_fail/T13610.stderr index c04687988c..cfff3dc863 100644 --- a/testsuite/tests/typecheck/should_fail/T13610.stderr +++ b/testsuite/tests/typecheck/should_fail/T13610.stderr @@ -3,7 +3,7 @@ T13610.hs:11:15: error: • Couldn't match a lifted type with an unlifted type When matching types a :: * - Weak# () :: TYPE 'UnliftedRep + Weak# () :: UnliftedType Expected: (# State# RealWorld, a #) Actual: (# State# RealWorld, Weak# () #) • In the expression: mkWeakNoFinalizer# double () s diff --git a/testsuite/tests/typecheck/should_fail/T14884.stderr b/testsuite/tests/typecheck/should_fail/T14884.stderr index 6c2c78c0dc..2c5abc33f0 100644 --- a/testsuite/tests/typecheck/should_fail/T14884.stderr +++ b/testsuite/tests/typecheck/should_fail/T14884.stderr @@ -19,11 +19,11 @@ T14884.hs:4:5: error: (imported from ‘Prelude’ at T14884.hs:1:8-13 (and originally defined in ‘Data.Foldable’)) ($) :: forall a b. (a -> b) -> a -> b - with ($) @'GHC.Types.LiftedRep @String @(IO ()) + with ($) @GHC.Types.LiftedRep @String @(IO ()) (imported from ‘Prelude’ at T14884.hs:1:8-13 (and originally defined in ‘GHC.Base’)) ($!) :: forall a b. (a -> b) -> a -> b - with ($!) @'GHC.Types.LiftedRep @String @(IO ()) + with ($!) @GHC.Types.LiftedRep @String @(IO ()) (imported from ‘Prelude’ at T14884.hs:1:8-13 (and originally defined in ‘GHC.Base’)) id :: forall a. a -> a diff --git a/testsuite/tests/typecheck/should_fail/T15067.stderr b/testsuite/tests/typecheck/should_fail/T15067.stderr index 4ed3d3bc0a..a2ecc4326c 100644 --- a/testsuite/tests/typecheck/should_fail/T15067.stderr +++ b/testsuite/tests/typecheck/should_fail/T15067.stderr @@ -1,13 +1,13 @@ T15067.hs:9:14: error: - • No instance for (Typeable (# 'GHC.Types.LiftedRep #)) + • No instance for (Typeable (# GHC.Types.LiftedRep #)) arising from a use of ‘typeRep’ GHC can't yet do polykinded - Typeable ((# 'GHC.Types.LiftedRep #) :: * - -> * - -> TYPE - ('GHC.Types.SumRep - '[ 'GHC.Types.LiftedRep, - 'GHC.Types.LiftedRep])) + Typeable ((# GHC.Types.LiftedRep #) :: * + -> * + -> TYPE + ('GHC.Types.SumRep + '[GHC.Types.LiftedRep, + GHC.Types.LiftedRep])) • In the expression: typeRep In an equation for ‘floopadoop’: floopadoop = typeRep diff --git a/testsuite/tests/typecheck/should_fail/T15883b.hs b/testsuite/tests/typecheck/should_fail/T15883b.hs index 82613943a7..45b7d65360 100644 --- a/testsuite/tests/typecheck/should_fail/T15883b.hs +++ b/testsuite/tests/typecheck/should_fail/T15883b.hs @@ -11,4 +11,4 @@ module T15883b where import GHC.Exts newtype Foo rep = MkFoo (forall (a :: TYPE rep). a) -deriving stock instance Eq (Foo LiftedRep) +deriving stock instance Eq (Foo (BoxedRep Lifted)) diff --git a/testsuite/tests/typecheck/should_fail/T15883b.stderr b/testsuite/tests/typecheck/should_fail/T15883b.stderr index a89403d4af..21b9305315 100644 --- a/testsuite/tests/typecheck/should_fail/T15883b.stderr +++ b/testsuite/tests/typecheck/should_fail/T15883b.stderr @@ -1,5 +1,6 @@ T15883b.hs:14:1: Can't make a derived instance of - ‘Eq (Foo 'LiftedRep)’ with the stock strategy: + ‘Eq (Foo ('BoxedRep 'Lifted))’ with the stock strategy: Don't know how to derive ‘Eq’ for type ‘forall a. a’ - In the stand-alone deriving instance for ‘Eq (Foo LiftedRep)’ + In the stand-alone deriving instance for + ‘Eq (Foo (BoxedRep Lifted))’ diff --git a/testsuite/tests/typecheck/should_fail/T15883c.hs b/testsuite/tests/typecheck/should_fail/T15883c.hs index bd031540c2..93d57b784b 100644 --- a/testsuite/tests/typecheck/should_fail/T15883c.hs +++ b/testsuite/tests/typecheck/should_fail/T15883c.hs @@ -11,4 +11,4 @@ module T15883c where import GHC.Exts newtype Foo rep = MkFoo (forall (a :: TYPE rep). a) -deriving stock instance Ord (Foo LiftedRep) +deriving stock instance Ord (Foo (BoxedRep Lifted)) diff --git a/testsuite/tests/typecheck/should_fail/T15883c.stderr b/testsuite/tests/typecheck/should_fail/T15883c.stderr index 5444f5d6c8..60678c4fcb 100644 --- a/testsuite/tests/typecheck/should_fail/T15883c.stderr +++ b/testsuite/tests/typecheck/should_fail/T15883c.stderr @@ -1,5 +1,6 @@ T15883c.hs:14:1: Can't make a derived instance of - ‘Ord (Foo 'LiftedRep)’ with the stock strategy: + ‘Ord (Foo ('BoxedRep 'Lifted))’ with the stock strategy: Don't know how to derive ‘Ord’ for type ‘forall a. a’ - In the stand-alone deriving instance for ‘Ord (Foo LiftedRep)’ + In the stand-alone deriving instance for + ‘Ord (Foo (BoxedRep Lifted))’ diff --git a/testsuite/tests/typecheck/should_fail/T15883d.hs b/testsuite/tests/typecheck/should_fail/T15883d.hs index fd86c5cab3..dbcd93751e 100644 --- a/testsuite/tests/typecheck/should_fail/T15883d.hs +++ b/testsuite/tests/typecheck/should_fail/T15883d.hs @@ -11,5 +11,5 @@ module T15883d where import GHC.Exts newtype Foo rep = MkFoo (forall (a :: TYPE rep). a) -deriving stock instance Show (Foo LiftedRep) +deriving stock instance Show (Foo (BoxedRep Lifted)) diff --git a/testsuite/tests/typecheck/should_fail/T15883d.stderr b/testsuite/tests/typecheck/should_fail/T15883d.stderr index b080ff6544..162b31072e 100644 --- a/testsuite/tests/typecheck/should_fail/T15883d.stderr +++ b/testsuite/tests/typecheck/should_fail/T15883d.stderr @@ -1,5 +1,6 @@ T15883d.hs:14:1: Can't make a derived instance of - ‘Show (Foo 'LiftedRep)’ with the stock strategy: + ‘Show (Foo ('BoxedRep 'Lifted))’ with the stock strategy: Don't know how to derive ‘Show’ for type ‘forall a. a’ - In the stand-alone deriving instance for ‘Show (Foo LiftedRep)’ + In the stand-alone deriving instance for + ‘Show (Foo (BoxedRep Lifted))’ diff --git a/testsuite/tests/typecheck/should_fail/T15883e.hs b/testsuite/tests/typecheck/should_fail/T15883e.hs index bb1dcacf92..cfecdb693e 100644 --- a/testsuite/tests/typecheck/should_fail/T15883e.hs +++ b/testsuite/tests/typecheck/should_fail/T15883e.hs @@ -13,6 +13,6 @@ import GHC.Exts import Data.Data (Data) newtype Foo rep = MkFoo (forall (a :: TYPE rep). a) -deriving stock instance Data (Foo LiftedRep) +deriving stock instance Data (Foo (BoxedRep Lifted)) diff --git a/testsuite/tests/typecheck/should_fail/T15883e.stderr b/testsuite/tests/typecheck/should_fail/T15883e.stderr index 05e07f0307..a20b3f5d43 100644 --- a/testsuite/tests/typecheck/should_fail/T15883e.stderr +++ b/testsuite/tests/typecheck/should_fail/T15883e.stderr @@ -1,5 +1,6 @@ T15883e.hs:16:1: Can't make a derived instance of - ‘Data (Foo 'LiftedRep)’ with the stock strategy: + ‘Data (Foo ('BoxedRep 'Lifted))’ with the stock strategy: Don't know how to derive ‘Data’ for type ‘forall a. a’ - In the stand-alone deriving instance for ‘Data (Foo LiftedRep)’ + In the stand-alone deriving instance for + ‘Data (Foo (BoxedRep Lifted))’ diff --git a/testsuite/tests/typecheck/should_fail/T17021.stderr b/testsuite/tests/typecheck/should_fail/T17021.stderr index 12d6d687d8..96c700c4b7 100644 --- a/testsuite/tests/typecheck/should_fail/T17021.stderr +++ b/testsuite/tests/typecheck/should_fail/T17021.stderr @@ -2,5 +2,5 @@ T17021.hs:18:5: error: A levity-polymorphic type is not allowed here: Type: Int - Kind: TYPE (Id 'LiftedRep) + Kind: TYPE (Id ('BoxedRep 'Lifted)) When trying to create a variable of type: Int diff --git a/testsuite/tests/typecheck/should_fail/T18357a.stderr b/testsuite/tests/typecheck/should_fail/T18357a.stderr index a9e87fed98..f60e09922a 100644 --- a/testsuite/tests/typecheck/should_fail/T18357a.stderr +++ b/testsuite/tests/typecheck/should_fail/T18357a.stderr @@ -1,6 +1,6 @@ T18357a.hs:9:10: error: - • Couldn't match kind ‘r’ with ‘'LiftedRep’ + • Couldn't match kind ‘r’ with ‘LiftedRep’ Expected a type, but ‘Int’ has kind ‘*’ • In the type ‘Int’ In the definition of data constructor ‘MkT’ diff --git a/testsuite/tests/typecheck/should_fail/UnliftedNewtypesUnassociatedFamilyFail.hs b/testsuite/tests/typecheck/should_fail/UnliftedNewtypesUnassociatedFamilyFail.hs index adac27fe90..21b1b053fc 100644 --- a/testsuite/tests/typecheck/should_fail/UnliftedNewtypesUnassociatedFamilyFail.hs +++ b/testsuite/tests/typecheck/should_fail/UnliftedNewtypesUnassociatedFamilyFail.hs @@ -11,7 +11,7 @@ module UnliftedNewtypesUnassociatedFamily where import GHC.Int (Int(I#)) import GHC.Word (Word(W#)) import GHC.Exts (Int#,Word#) -import GHC.Exts (TYPE,RuntimeRep(LiftedRep,IntRep,WordRep,TupleRep)) +import GHC.Exts (TYPE,RuntimeRep(IntRep,WordRep,TupleRep)) data family DF :: TYPE (r :: RuntimeRep) diff --git a/testsuite/tests/typecheck/should_fail/UnliftedNewtypesUnassociatedFamilyFail.stderr b/testsuite/tests/typecheck/should_fail/UnliftedNewtypesUnassociatedFamilyFail.stderr index 972f873e62..a9cb694807 100644 --- a/testsuite/tests/typecheck/should_fail/UnliftedNewtypesUnassociatedFamilyFail.stderr +++ b/testsuite/tests/typecheck/should_fail/UnliftedNewtypesUnassociatedFamilyFail.stderr @@ -1,18 +1,18 @@ -UnliftedNewtypesUnassociatedFamilyFail.hs:21:30: error: - • Expecting a lifted type, but ‘Int#’ is unlifted - • In the type ‘Int#’ +UnliftedNewtypesUnassociatedFamilyFail.hs:21:30: + Expecting a lifted type, but ‘Int#’ is unlifted + In the type ‘Int#’ In the definition of data constructor ‘MkDF1a’ In the newtype instance declaration for ‘DF’ -UnliftedNewtypesUnassociatedFamilyFail.hs:22:30: error: - • Expecting a lifted type, but ‘Word#’ is unlifted - • In the type ‘Word#’ +UnliftedNewtypesUnassociatedFamilyFail.hs:22:30: + Expecting a lifted type, but ‘Word#’ is unlifted + In the type ‘Word#’ In the definition of data constructor ‘MkDF2a’ In the newtype instance declaration for ‘DF’ -UnliftedNewtypesUnassociatedFamilyFail.hs:23:30: error: - • Expecting a lifted type, but ‘(# Int#, Word# #)’ is unlifted - • In the type ‘(# Int#, Word# #)’ +UnliftedNewtypesUnassociatedFamilyFail.hs:23:30: + Expecting a lifted type, but ‘(# Int#, Word# #)’ is unlifted + In the type ‘(# Int#, Word# #)’ In the definition of data constructor ‘MkDF3a’ In the newtype instance declaration for ‘DF’ diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 4768b19263..0bd86e9288 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -442,6 +442,7 @@ test('T13068', [extra_files(['T13068.hs', 'T13068a.hs', 'T13068.hs-boot', 'T1306 test('T13075', normal, compile_fail, ['']) test('T13105', normal, compile_fail, ['']) test('LevPolyBounded', normal, compile_fail, ['']) +test('LevPolyLet', normal, compile_fail, ['']) test('T13487', normal, compile, ['']) test('T13292', normal, multimod_compile, ['T13292', '-v0 -fdefer-type-errors']) test('T13300', normal, compile_fail, ['']) diff --git a/testsuite/tests/typecheck/should_fail/tcfail090.stderr b/testsuite/tests/typecheck/should_fail/tcfail090.stderr index efb81e8ee6..efb73e2d45 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail090.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail090.stderr @@ -3,6 +3,6 @@ tcfail090.hs:11:9: error: • Couldn't match a lifted type with an unlifted type When matching types a0 :: * - ByteArray# :: TYPE 'UnliftedRep + ByteArray# :: UnliftedType • In the expression: my_undefined In an equation for ‘die’: die _ = my_undefined diff --git a/testsuite/tests/typecheck/should_run/EtaExpandLevPoly.hs b/testsuite/tests/typecheck/should_run/EtaExpandLevPoly.hs index d57d2e1499..82553b4ff2 100644 --- a/testsuite/tests/typecheck/should_run/EtaExpandLevPoly.hs +++ b/testsuite/tests/typecheck/should_run/EtaExpandLevPoly.hs @@ -6,12 +6,12 @@ module Main where import GHC.Exts data G a where - MkG :: G (TupleRep [LiftedRep, IntRep]) + MkG :: G (TupleRep [BoxedRep Lifted, IntRep]) -- tests that we don't eta-expand functions that are levity-polymorphic -- see CoreArity.mkEtaWW foo :: forall a (b :: TYPE a). G a -> b -> b -foo MkG = (\x -> x) :: forall (c :: TYPE (TupleRep [LiftedRep, IntRep])). c -> c +foo MkG = (\x -> x) :: forall (c :: TYPE (TupleRep [BoxedRep Lifted, IntRep])). c -> c data H a where MkH :: H IntRep diff --git a/testsuite/tests/typecheck/should_run/LevPolyResultInst.hs b/testsuite/tests/typecheck/should_run/LevPolyResultInst.hs new file mode 100644 index 0000000000..8302a43693 --- /dev/null +++ b/testsuite/tests/typecheck/should_run/LevPolyResultInst.hs @@ -0,0 +1,27 @@ +{-# language BangPatterns #-} +{-# language DataKinds #-} +{-# language MagicHash #-} +{-# language PolyKinds #-} +{-# language RankNTypes #-} +{-# language UnboxedTuples #-} + +import GHC.Exts + +main :: IO () +main = do + print (example (\x -> I# x > 7)) + case indexArray# (example replicateFalse) 0# of + (# r #) -> print r + +-- Combines base:runST, primitive:newArray, and primitive:unsafeFreezeArray +replicateFalse :: Int# -> Array# Bool +replicateFalse n = + let !(# _, r #) = runRW# + (\s -> case newArray# n False s of + (# s', arr #) -> unsafeFreezeArray# arr s' + ) + in r + +example :: forall (v :: Levity) (a :: TYPE ('BoxedRep v)). (Int# -> a) -> a +{-# noinline example #-} +example f = f 8# diff --git a/testsuite/tests/typecheck/should_run/LevPolyResultInst.stdout b/testsuite/tests/typecheck/should_run/LevPolyResultInst.stdout new file mode 100644 index 0000000000..1cc8b5e10d --- /dev/null +++ b/testsuite/tests/typecheck/should_run/LevPolyResultInst.stdout @@ -0,0 +1,2 @@ +True +False diff --git a/testsuite/tests/typecheck/should_run/T12809.hs b/testsuite/tests/typecheck/should_run/T12809.hs index 66031a5af7..3e20403add 100644 --- a/testsuite/tests/typecheck/should_run/T12809.hs +++ b/testsuite/tests/typecheck/should_run/T12809.hs @@ -32,7 +32,7 @@ g (# b, x #) = show b ++ " " ++ show (I# x) h :: (# Double, Int# #) -> String h (# d, x #) = show d ++ " " ++ show (I# x) -cond :: forall (a :: TYPE (TupleRep [LiftedRep, IntRep])). Bool -> a -> a -> a +cond :: forall (a :: TYPE (TupleRep [BoxedRep Lifted, IntRep])). Bool -> a -> a -> a cond True x _ = x cond False _ x = x diff --git a/testsuite/tests/typecheck/should_run/T14236.stdout b/testsuite/tests/typecheck/should_run/T14236.stdout index ffa0e65dc9..73c98017f2 100644 --- a/testsuite/tests/typecheck/should_run/T14236.stdout +++ b/testsuite/tests/typecheck/should_run/T14236.stdout @@ -1,3 +1,3 @@ -(FUN 'Many 'LiftedRep 'LiftedRep Int,Char) -(FUN 'Many 'IntRep 'LiftedRep Int#,Char) +(FUN 'Many ('BoxedRep 'Lifted) ('BoxedRep 'Lifted) Int,Char) +(FUN 'Many 'IntRep ('BoxedRep 'Lifted) Int#,Char) Int# -> [Char] diff --git a/testsuite/tests/typecheck/should_run/TestTypeableBinary.stdout b/testsuite/tests/typecheck/should_run/TestTypeableBinary.stdout index 1303db844c..6ef72dfb83 100644 --- a/testsuite/tests/typecheck/should_run/TestTypeableBinary.stdout +++ b/testsuite/tests/typecheck/should_run/TestTypeableBinary.stdout @@ -5,7 +5,7 @@ good: Maybe good: TYPE good: RuntimeRep good: 'IntRep -good: FUN 'Many 'LiftedRep 'LiftedRep +good: FUN 'Many ('BoxedRep 'Lifted) ('BoxedRep 'Lifted) good: Proxy * Int good: Proxy (TYPE 'IntRep) Int# good: * diff --git a/testsuite/tests/typecheck/should_run/TypeOf.hs b/testsuite/tests/typecheck/should_run/TypeOf.hs index cec6833b64..37113bfe80 100644 --- a/testsuite/tests/typecheck/should_run/TypeOf.hs +++ b/testsuite/tests/typecheck/should_run/TypeOf.hs @@ -28,9 +28,12 @@ main = do print $ typeOf (Proxy :: Proxy [1,2,3]) print $ typeOf (Proxy :: Proxy 'EQ) print $ typeOf (Proxy :: Proxy TYPE) - print $ typeOf (Proxy :: Proxy (TYPE 'LiftedRep)) + print $ typeOf (Proxy :: Proxy (TYPE ('BoxedRep 'Lifted))) print $ typeOf (Proxy :: Proxy *) print $ typeOf (Proxy :: Proxy ★) - print $ typeOf (Proxy :: Proxy 'LiftedRep) + print $ typeOf (Proxy :: Proxy ('BoxedRep 'Lifted)) + print $ typeOf (Proxy :: Proxy 'Lifted) + print $ typeOf (Proxy :: Proxy 'Unlifted) + print $ typeOf (Proxy :: Proxy LiftedRep) print $ typeOf (Proxy :: Proxy '(1, "hello")) print $ typeOf (Proxy :: Proxy (~~)) diff --git a/testsuite/tests/typecheck/should_run/TypeOf.stdout b/testsuite/tests/typecheck/should_run/TypeOf.stdout index 40d2cb5f8f..3344f17193 100644 --- a/testsuite/tests/typecheck/should_run/TypeOf.stdout +++ b/testsuite/tests/typecheck/should_run/TypeOf.stdout @@ -19,6 +19,9 @@ Proxy (RuntimeRep -> *) TYPE Proxy * * Proxy * * Proxy * * -Proxy RuntimeRep 'LiftedRep +Proxy RuntimeRep ('BoxedRep 'Lifted) +Proxy Levity 'Lifted +Proxy Levity 'Unlifted +Proxy RuntimeRep ('BoxedRep 'Lifted) Proxy (Natural,Symbol) ('(,) Natural Symbol 1 "hello") Proxy (* -> * -> Constraint) ((~~) * *) diff --git a/testsuite/tests/typecheck/should_run/TypeRep.hs b/testsuite/tests/typecheck/should_run/TypeRep.hs index beae93f6b3..886479fd33 100644 --- a/testsuite/tests/typecheck/should_run/TypeRep.hs +++ b/testsuite/tests/typecheck/should_run/TypeRep.hs @@ -53,10 +53,10 @@ main = do print $ rep @(Proxy [1,2,3]) print $ rep @(Proxy 'EQ) print $ rep @(Proxy TYPE) - print $ rep @(Proxy (TYPE 'LiftedRep)) + print $ rep @(Proxy (TYPE ('BoxedRep 'Lifted))) print $ rep @(Proxy *) print $ rep @(Proxy ★) - print $ rep @(Proxy 'LiftedRep) + print $ rep @(Proxy ('BoxedRep 'Lifted)) -- Something lifted and primitive print $ rep @RealWorld -- #12132 diff --git a/testsuite/tests/typecheck/should_run/TypeRep.stdout b/testsuite/tests/typecheck/should_run/TypeRep.stdout index a0c03e09d8..cf43264714 100644 --- a/testsuite/tests/typecheck/should_run/TypeRep.stdout +++ b/testsuite/tests/typecheck/should_run/TypeRep.stdout @@ -13,7 +13,7 @@ Int -> Int (%,%) (Eq Int) (Eq [Char]) Int# (##) -(#,#) 'IntRep 'LiftedRep Int# Int +(#,#) 'IntRep ('BoxedRep 'Lifted) Int# Int Proxy Constraint (Eq Int) Proxy * (Int,Int) Proxy Symbol "hello world" @@ -24,5 +24,5 @@ Proxy (RuntimeRep -> *) TYPE Proxy * * Proxy * * Proxy * * -Proxy RuntimeRep 'LiftedRep +Proxy RuntimeRep ('BoxedRep 'Lifted) RealWorld diff --git a/testsuite/tests/typecheck/should_run/all.T b/testsuite/tests/typecheck/should_run/all.T index ef8ae9136d..ef7bedb354 100755 --- a/testsuite/tests/typecheck/should_run/all.T +++ b/testsuite/tests/typecheck/should_run/all.T @@ -145,5 +145,6 @@ test('UnliftedNewtypesFamilyRun', normal, compile_and_run, ['']) test('UnliftedNewtypesDependentFamilyRun', normal, compile_and_run, ['']) test('UnliftedNewtypesIdentityRun', normal, compile_and_run, ['']) test('UnliftedNewtypesCoerceRun', normal, compile_and_run, ['']) +test('LevPolyResultInst', normal, compile_and_run, ['']) test('T17104', normal, compile_and_run, ['']) test('T18627', normal, compile_and_run, ['-O']) # Optimisation shows up the bug diff --git a/testsuite/tests/unboxedsums/T12711.stdout b/testsuite/tests/unboxedsums/T12711.stdout index 54af3fdfa6..18a67a078d 100644 --- a/testsuite/tests/unboxedsums/T12711.stdout +++ b/testsuite/tests/unboxedsums/T12711.stdout @@ -1,2 +1,4 @@ (# _ | _ #) :: TYPE - ('GHC.Types.SumRep '[ 'GHC.Types.LiftedRep, 'GHC.Types.LiftedRep]) + ('GHC.Types.SumRep + '[ 'GHC.Types.BoxedRep 'GHC.Types.Lifted, + 'GHC.Types.BoxedRep 'GHC.Types.Lifted]) diff --git a/testsuite/tests/unboxedsums/sum_rr.hs b/testsuite/tests/unboxedsums/sum_rr.hs index 448a9b2221..11c8cbb648 100644 --- a/testsuite/tests/unboxedsums/sum_rr.hs +++ b/testsuite/tests/unboxedsums/sum_rr.hs @@ -5,4 +5,4 @@ module Example where import Data.Typeable import GHC.Exts -data Wat (a :: TYPE (SumRep '[LiftedRep, IntRep])) = Wat a +data Wat (a :: TYPE (SumRep '[BoxedRep Lifted, IntRep])) = Wat a |