summaryrefslogtreecommitdiff
path: root/compiler/GHC/Stg/Lint.hs
diff options
context:
space:
mode:
authorSebastian Graf <sgraf1337@gmail.com>2019-11-03 19:42:52 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-03-14 12:54:29 -0400
commitb73c9c5face16cc8bedf4168ce10770c7cc67f80 (patch)
tree9e5b60b2cfd7ddbae3562c21e838a797fe7539f0 /compiler/GHC/Stg/Lint.hs
parent96b3c66b50c77c105dd97b7ef9b44d0779d712b1 (diff)
downloadhaskell-b73c9c5face16cc8bedf4168ce10770c7cc67f80.tar.gz
Implement the UnliftedDatatypes extension
GHC Proposal: 0265-unlifted-datatypes.rst Discussion: https://github.com/ghc-proposals/ghc-proposals/pull/265 Issues: https://gitlab.haskell.org/ghc/ghc/-/issues/19523 Implementation Details: Note [Implementation of UnliftedDatatypes] This patch introduces the `UnliftedDatatypes` extension. When this extension is enabled, GHC relaxes the restrictions around what result kinds are allowed in data declarations. This allows data types for which an unlifted or levity-polymorphic result kind is inferred. The most significant changes are in `GHC.Tc.TyCl`, where `Note [Implementation of UnliftedDatatypes]` describes the details of the implementation. Fixes #19523.
Diffstat (limited to 'compiler/GHC/Stg/Lint.hs')
-rw-r--r--compiler/GHC/Stg/Lint.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/GHC/Stg/Lint.hs b/compiler/GHC/Stg/Lint.hs
index bf52840f5c..1e12e9bab9 100644
--- a/compiler/GHC/Stg/Lint.hs
+++ b/compiler/GHC/Stg/Lint.hs
@@ -45,7 +45,7 @@ import GHC.Driver.Session
import GHC.Data.Bag ( Bag, emptyBag, isEmptyBag, snocBag, bagToList )
import GHC.Types.Basic ( TopLevelFlag(..), isTopLevel )
import GHC.Types.CostCentre ( isCurrentCCS )
-import GHC.Types.Id ( Id, idType, isJoinId, idName )
+import GHC.Types.Id
import GHC.Types.Var.Set
import GHC.Core.DataCon
import GHC.Core ( AltCon(..) )
@@ -134,8 +134,10 @@ lint_binds_help top_lvl (binder, rhs)
lintStgRhs rhs
opts <- getStgPprOpts
-- Check binder doesn't have unlifted type or it's a join point
- checkL (isJoinId binder || not (isUnliftedType (idType binder)))
- (mkUnliftedTyMsg opts binder rhs)
+ checkL ( isJoinId binder
+ || not (isUnliftedType (idType binder))
+ || isDataConWorkId binder || isDataConWrapId binder) -- until #17521 is fixed
+ (mkUnliftedTyMsg opts binder rhs)
-- | Top-level bindings can't inherit the cost centre stack from their
-- (static) allocation site.