[Git][ghc/ghc][wip/soulomoon/25647-allow-newtype-instance-in-gadt-syntax] add more without extension tests
Patrick (@soulomoon)
gitlab at gitlab.haskell.org
Thu Feb 6 08:10:28 UTC 2025
Patrick pushed to branch wip/soulomoon/25647-allow-newtype-instance-in-gadt-syntax at Glasgow Haskell Compiler / GHC
Commits:
88307a2b by Patrick at 2025-02-06T16:10:16+08:00
add more without extension tests
- - - - -
1 changed file:
- testsuite/tests/indexed-types/should_compile/T25647b.hs
Changes:
=====================================
testsuite/tests/indexed-types/should_compile/T25647b.hs
=====================================
@@ -20,6 +20,22 @@ newtype Fix1a f = In1a (f (Fix1a f))
newtype Fix1b f where
In1b :: forall ff. ff (Fix1b ff) -> Fix1b ff
+-- A plain newtype, GADT syntax, with a return kind signature,
+-- and runtime-rep quantification in the data constructor
+-- Should infer Fix2 :: (Type -> Type) -> Type
+newtype Fix2 f where
+ In2 :: forall (ff :: Type -> Type). ff (Fix2 ff) -> Fix2 ff
+
+-- Plain newtype, H98 syntax, standalone kind signature
+type Fix3 :: (Type -> Type) -> Type
+newtype Fix3 f = In3 (f (Fix3 f))
+
+-- Plain newtype, H98 syntax, standalone kind signature
+-- Should get In4 :: forall r k (f :: k -> TYPE r). Fix4 @r @k f -> Fix4 @r @k f
+type Fix4 :: (Type -> Type) -> Type
+newtype Fix4 f where
+ In4 :: forall (ff :: Type -> Type).
+ ff (Fix4 ff) -> Fix4 ff
-------------------- Data families with newtype instance -----------------
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/88307a2b65330f34e2cbb8fff7804d04ab7490ba
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/88307a2b65330f34e2cbb8fff7804d04ab7490ba
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20250206/f12e603a/attachment-0001.html>
More information about the ghc-commits
mailing list