diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2020-04-16 13:00:34 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-04-17 12:46:02 -0400 |
commit | bfde3b76ac7f5a72eca012fe34ac1340a5ce2011 (patch) | |
tree | 0a68b028e000ab53ad38b5b7f8125d59614fa86d /compiler | |
parent | 85fc32f03a6df92ec8d4ec9accca3c11b31a1596 (diff) | |
download | haskell-bfde3b76ac7f5a72eca012fe34ac1340a5ce2011.tar.gz |
Fix #18065 by fixing an InstCo oversight in Core Lint
There was a small thinko in Core Lint's treatment of `InstCo`
coercions that ultimately led to #18065. The fix: add an apostrophe.
That's it!
Fixes #18065.
Co-authored-by: Simon Peyton Jones <simonpj@microsoft.com>
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/GHC/Core/Lint.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/GHC/Core/Lint.hs b/compiler/GHC/Core/Lint.hs index 8bc9709c5f..fb530cb2c7 100644 --- a/compiler/GHC/Core/Lint.hs +++ b/compiler/GHC/Core/Lint.hs @@ -2030,21 +2030,21 @@ lintCoercion the_co@(LRCo lr co) lintCoercion (InstCo co arg) = do { co' <- lintCoercion co ; arg' <- lintCoercion arg - ; let Pair t1' t2' = coercionKind co' - Pair s1 s2 = coercionKind arg + ; let Pair t1 t2 = coercionKind co' + Pair s1 s2 = coercionKind arg' ; lintRole arg Nominal (coercionRole arg') - ; case (splitForAllTy_ty_maybe t1', splitForAllTy_ty_maybe t2') of + ; case (splitForAllTy_ty_maybe t1, splitForAllTy_ty_maybe t2) of -- forall over tvar { (Just (tv1,_), Just (tv2,_)) | typeKind s1 `eqType` tyVarKind tv1 , typeKind s2 `eqType` tyVarKind tv2 -> return (InstCo co' arg') | otherwise - -> failWithL (text "Kind mis-match in inst coercion") + -> failWithL (text "Kind mis-match in inst coercion1" <+> ppr co) - ; _ -> case (splitForAllTy_co_maybe t1', splitForAllTy_co_maybe t2') of + ; _ -> case (splitForAllTy_co_maybe t1, splitForAllTy_co_maybe t2) of -- forall over covar { (Just (cv1, _), Just (cv2, _)) | typeKind s1 `eqType` varType cv1 @@ -2053,7 +2053,7 @@ lintCoercion (InstCo co arg) , CoercionTy _ <- s2 -> return (InstCo co' arg') | otherwise - -> failWithL (text "Kind mis-match in inst coercion") + -> failWithL (text "Kind mis-match in inst coercion2" <+> ppr co) ; _ -> failWithL (text "Bad argument of inst") }}} |