Allow unsaturated uses of unlifted types in Core
Currently Core Lint checks for unsaturated uses of unlifted types in . These are easily produced in the new type-indexed Typeable
scheme. For instance, consider solving for Typeable # (Array# Int)
:
- We decompose the application into wanteds
Typeable (* -> #) Array#
andTypeable * Int
- We construct dictionaries for both, giving us a term
typeRepArray# :: TypeRep (* -> #) Array#
While nothing seems to blow up with this patch,
diff --git a/compiler/coreSyn/CoreLint.hs b/compiler/coreSyn/CoreLint.hs
index 99625c9..2c401de 100644
--- a/compiler/coreSyn/CoreLint.hs
+++ b/compiler/coreSyn/CoreLint.hs
@@ -1040,7 +1040,7 @@ lintType ty@(TyConApp tc tys)
= lintType ty' -- Expand type synonyms, so that we do not bogusly complain
-- about un-saturated type synonyms
- | isUnliftedTyCon tc || isTypeSynonymTyCon tc || isTypeFamilyTyCon tc
+ | isTypeSynonymTyCon tc || isTypeFamilyTyCon tc
-- Also type synonyms and type families
, length tys < tyConArity tc
= failWithL (hang (text "Un-saturated type application") 2 (ppr ty))
I otherwise have no reason to believe that this is safe.
Trac metadata
Trac field | Value |
---|---|
Version | 8.1 |
Type | FeatureRequest |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | goldfire, simonpj |
Operating system | |
Architecture |