diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2019-11-22 20:12:07 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-12-16 19:31:44 -0500 |
commit | 75355fdef61da44a395ee9bfa2b9dca0eecea58a (patch) | |
tree | 93731c2483e5886c4dd9344e39ff81110ef5bdd8 /compiler/GHC/HsToCore | |
parent | 3e17a866fecebc5f80b4e7da93a73803b86499ca (diff) | |
download | haskell-75355fdef61da44a395ee9bfa2b9dca0eecea58a.tar.gz |
Use "OrCoVar" functions less
As described in #17291, we'd like to separate coercions and expressions
in a more robust fashion.
This is a small step in this direction.
- `mkLocalId` now panicks on a covar.
Calls where this was not the case were changed to `mkLocalIdOrCoVar`.
- Don't use "OrCoVar" functions in places where we know the type is
not a coercion.
Diffstat (limited to 'compiler/GHC/HsToCore')
-rw-r--r-- | compiler/GHC/HsToCore/PmCheck/Oracle.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/HsToCore/PmCheck/Oracle.hs b/compiler/GHC/HsToCore/PmCheck/Oracle.hs index 1b5c5b24c8..1486dde365 100644 --- a/compiler/GHC/HsToCore/PmCheck/Oracle.hs +++ b/compiler/GHC/HsToCore/PmCheck/Oracle.hs @@ -97,7 +97,7 @@ mkPmId :: Type -> DsM Id mkPmId ty = getUniqueM >>= \unique -> let occname = mkVarOccFS $ fsLit "pm" name = mkInternalName unique occname noSrcSpan - in return (mkLocalId name ty) + in return (mkLocalIdOrCoVar name ty) ----------------------------------------------- -- * Caching possible matches of a COMPLETE set @@ -508,7 +508,7 @@ nameTyCt (TyCt pred_ty) = do unique <- getUniqueM let occname = mkVarOccFS (fsLit ("pm_"++show unique)) idname = mkInternalName unique occname noSrcSpan - return (mkLocalId idname pred_ty) + return (mkLocalIdOrCoVar idname pred_ty) -- | Add some extra type constraints to the 'TyState'; return 'Nothing' if we -- find a contradiction (e.g. @Int ~ Bool@). |