projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
FIX #1465, error messages could sometimes say things like "A.T doesn't match A.T"
[ghc-hetmet.git]
/
compiler
/
typecheck
/
Inst.lhs
diff --git
a/compiler/typecheck/Inst.lhs
b/compiler/typecheck/Inst.lhs
index
8d21d1b
..
e175951
100644
(file)
--- a/
compiler/typecheck/Inst.lhs
+++ b/
compiler/typecheck/Inst.lhs
@@
-48,7
+48,7
@@
module Inst (
mkWantedCo, mkGivenCo,
fromWantedCo, fromGivenCo,
mkWantedCo, mkGivenCo,
fromWantedCo, fromGivenCo,
- eitherEqInst, mkEqInst, mkEqInsts,
+ eitherEqInst, mkEqInst, mkEqInsts, mkWantedEqInst,
finalizeEqInst, writeWantedCoercion,
eqInstType, updateEqInstCoercion,
eqInstCoercion,
finalizeEqInst, writeWantedCoercion,
eqInstType, updateEqInstCoercion,
eqInstCoercion,
@@
-1004,6
+1004,12
@@
mkEqInst (EqPred ty1 ty2) co
}
where mkName uniq src_span = mkInternalName uniq (mkVarOcc "co") src_span
}
where mkName uniq src_span = mkInternalName uniq (mkVarOcc "co") src_span
+mkWantedEqInst :: PredType -> TcM Inst
+mkWantedEqInst pred@(EqPred ty1 ty2)
+ = do { cotv <- newMetaTyVar TauTv (mkCoKind ty1 ty2)
+ ; mkEqInst pred (Left cotv)
+ }
+
-- type inference:
-- We want to promote the wanted EqInst to a given EqInst
-- in the signature context.
-- type inference:
-- We want to promote the wanted EqInst to a given EqInst
-- in the signature context.