[Git][ghc/ghc][wip/soulomoon/25647-allow-newtype-instance-in-gadt-syntax] allow newtype instance in gadt syntax

Patrick (@soulomoon) gitlab at gitlab.haskell.org
Sat Jan 11 14:03:37 UTC 2025



Patrick pushed to branch wip/soulomoon/25647-allow-newtype-instance-in-gadt-syntax at Glasgow Haskell Compiler / GHC


Commits:
171d280a by Patrick at 2025-01-11T22:03:25+08:00
allow newtype instance in gadt syntax

- - - - -


2 changed files:

- compiler/GHC/Tc/TyCl.hs
- testsuite/tests/rep-poly/T25611d.hs


Changes:

=====================================
compiler/GHC/Tc/TyCl.hs
=====================================
@@ -4855,7 +4855,7 @@ checkNewDataCon con
           -- If the newtype is a GADT, the GADT error is enough;
           -- we don't need to *also* complain about existentials.
         ; if not (null eq_spec)
-          then addErrTc $ TcRnIllegalNewtype con show_linear_types IsGADT
+          then return ()
           else unless (null ex_tvs) $
                addErrTc $
                TcRnIllegalNewtype con show_linear_types HasExistentialTyVar


=====================================
testsuite/tests/rep-poly/T25611d.hs
=====================================
@@ -1,4 +1,5 @@
 {-# LANGUAGE DataKinds #-}
+{-# LANGUAGE UnliftedNewtypes #-}
 {-# LANGUAGE TypeFamilies #-}
 {-# LANGUAGE MagicHash #-}
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/171d280a71b52fde7df0be702dac13cda5bdcc03

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/171d280a71b52fde7df0be702dac13cda5bdcc03
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/20250111/9c0f07f7/attachment-0001.html>


More information about the ghc-commits mailing list