summaryrefslogtreecommitdiff
path: root/compiler/coreSyn
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2017-04-06 16:38:45 -0400
committerBen Gamari <ben@smart-cactus.org>2017-04-06 16:40:17 -0400
commitf3af0463c81002a64a3b3e9a01351e64460c490f (patch)
tree99504dedafc6daf80ca5f36f4ba87faa0fff31ea /compiler/coreSyn
parenta8a7ca5e8a320028f984d808df1cbe6182fa27a7 (diff)
downloadhaskell-f3af0463c81002a64a3b3e9a01351e64460c490f.tar.gz
Enable lint checking of levity polymorphic coercions
This reverts commit 03c7dd0941fb4974be54026ef3e4bb97451c3b1f and fixes the coercions.
Diffstat (limited to 'compiler/coreSyn')
-rw-r--r--compiler/coreSyn/CoreLint.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/coreSyn/CoreLint.hs b/compiler/coreSyn/CoreLint.hs
index 16edcb8e60..8182272be7 100644
--- a/compiler/coreSyn/CoreLint.hs
+++ b/compiler/coreSyn/CoreLint.hs
@@ -1646,7 +1646,11 @@ lintCoercion co@(UnivCo prov r ty1 ty2)
-- see #9122 for discussion of these checks
checkTypes t1 t2
- = do { when (not (lev_poly1 || lev_poly2)) $
+ = do { checkWarnL (not lev_poly1)
+ (report "left-hand type is levity-polymorphic")
+ ; checkWarnL (not lev_poly2)
+ (report "right-hand type is levity-polymorphic")
+ ; when (not (lev_poly1 || lev_poly2)) $
do { checkWarnL (reps1 `equalLength` reps2)
(report "between values with different # of reps")
; zipWithM_ validateCoercion reps1 reps2 }}